This PR builds on top of #3652 by adding a selection prompt to the
storybook to allow you to choose from the available list of stories if
you don't provide one explicitly:
<img width="1387" alt="Screenshot 2023-12-14 at 12 00 26 PM"
src="https://github.com/zed-industries/zed/assets/1486634/640d62a3-1340-45f1-9746-69b513faff62">
This way we don't have to keep generating the `script/storybook` script
whenever stories are added/removed.
#### Usage (through `cargo`):
```sh
# Select from the available stories
cargo run -p storybook2
# Run a specific story
cargo run -p storybook2 -- components/list_item
```
#### Usage (through `script/storybook`):
```sh
# Select from the available stories
./script/storybook
# Run a specific story
./script/storybook list_item
```
Release Notes:
- N/A
This PR enables scrolling horizontally in the tab bar.
Currently this requires holding down <kbd>Shift</kbd> for the scroll to
activate. We'll need to look into this.
Scrolling also currently works when there is a split in the editor, as
the non-split view goes down a different rendering path that does not
constrain the pane width, which breaks a number of things.
Release Notes:
- N/A
This PR adds `w_vw` and `h_vh` methods to `StyledExt`.
These methods are the same as their `w` and `h` counterparts, but
operate in viewport units, giving us the equivalent of `vw` and `vh` in
CSS.
You can see them in action in this story:
```
cargo run -p storybook2 -- components/viewport_units
```
Release Notes:
- N/A
This PR extracts a new `Tab` component from the tabs implementation in
the workspace.
This will allow us to reuse this component anywhere that we need to use
tabs.
Like our other newer components, the `Tab` component has a relatively
open API.
It accepts `children` (or `child`) as well as a `start_slot` and
`end_slot` to position content in the slots on either end of the
content. These slots also respect the `TabCloseSide` and will switch
positions based on this value.
<img width="763" alt="Screenshot 2023-12-07 at 12 19 42 PM"
src="https://github.com/zed-industries/zed/assets/1486634/78e4db6a-f807-431e-8777-f52f2631e6ed">
Release Notes:
- N/A
This PR fixes an issue where an element with a cursor style set would
not update the cursor when hovering over it.
Previously the cursor style would only appear by interacting with the
element in some way, for instance, by clicking on the element or by
having a `.hover` with some other style being applied.
Release Notes:
- N/A
This PR reworks the `ListHeader` component to be more open.
The `meta` method can now be used to append meta items of any element to
the `ListHeader`, and they will be rendered with the appropriate spacing
between them.
Release Notes:
- N/A
This PR fixes tooltips not showing on `IconButton`s.
The "fix" here is the same hack that we used to fix `on_click` handlers
for `ListItem`s, where we introduce another layer of wrapping with an
element with an ID set.
This PR also adds a story for the `IconButton` so this issue can be
tested/observed in isolation.
Release Notes:
- N/A
This PR adds an inset variant to the `ListItem` component.
We're now using this inset variant for the `ListItem`s we render in
pickers.
Release Notes:
- N/A
This PR extracts the `Story` component into a separate `story` crate so
that it can be shared among various crates that define stories.
Release Notes:
- N/A
---------
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This PR adds a parameter to the `theme2::init` method to indicate what
the theme-loading behavior should be.
This allows us to indicate when we want to load all of the additional
built-in user themes (like in the Zed binary and in the storybook), and
when we don't want to load the user themes (like in tests).
We're using an enum over just a `bool` here for clarity at the call
site.
Release Notes:
- N/A