mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-30 22:23:37 +03:00
66358f2900
This PR updates the `storybook` with support for adding stories for individual components. ### Motivation Right now we just have one story in the storybook that renders an entire `WorkspaceElement`. While iterating on the various UI components, it will be helpful to be able to create stories of those components just by themselves. This is especially true for components that have a number of different states, as we can render the components in all of the various states in a single layout. ### Explanation We achieve this by adding a simple CLI to the storybook. The `storybook` binary now accepts an optional `[STORY]` parameter that can be used to indicate which story should be loaded. If this parameter is not provided, it will load the workspace story as it currently does. Passing a story name will load the corresponding story, if it exists. For example: ``` cargo run -- elements/avatar ``` <img width="723" alt="Screenshot 2023-09-21 at 10 29 52 PM" src="https://github.com/zed-industries/zed/assets/1486634/5df489ed-8607-4024-9c19-c5f4541f97c9"> ``` cargo run -- components/facepile ``` <img width="785" alt="Screenshot 2023-09-21 at 10 30 07 PM" src="https://github.com/zed-industries/zed/assets/1486634/e04a4577-7403-405d-b23c-e765b7a06229"> Release Notes: - N/A |
||
---|---|---|
.. | ||
docs | ||
src | ||
Cargo.lock | ||
Cargo.toml |