Update storybook to support stories for individual components (#3010)
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
M
Marshall Bowers committed
66358f2900cf3c2ec2d42b169d81b012c8642e7e
Parent: 4628639
Committed by GitHub <noreply@github.com>
on 9/22/2023, 2:41:53 AM