Commit Graph
65 Commits
Author SHA1 Message Date
Marshall Bowers 5083ab7694 Add TrafficLights component (#3011)
This PR adds a `TrafficLights` component for GPUI2.

<img width="861" alt="Screenshot 2023-09-21 at 11 32 10 PM"
src="https://github.com/zed-industries/zed/assets/1486634/0fe0e847-49b3-44dc-bd4c-64f12f0051c1">

Release Notes:

- N/A
2023-09-21 23:42:18 -04:00
Marshall Bowers 66358f2900 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
2023-09-21 22:41:53 -04:00
Marshall Bowers baa07e935e Extract UI elements from storybook into new ui crate (#3008)
This PR extracts the various UI elements from the `storybook` crate into
a new `ui` library crate.

Release Notes:

- N/A
2023-09-21 19:25:35 -04:00
Marshall Bowers c252eae32e Reorganize ui module exports (#3007)
This PR reorganizes the exports for the `ui` module in the `storybook`
crate.

### Motivation

Currently we expose each of the various elements/components/modules in
two places:

- Through the module itself (e.g., `ui::element::Avatar`)
- Through the `ui` module's re-exports (e.g., `ui::Avatar`)

This means it's possible to import any given item from two spots, which
can lead to inconsistencies in the consumers. Additionally, it also
means we're shipping the exact module structure underneath `ui` as part
of the public API.

### Explanation

To avoid this, we can avoid exposing each of the individual modules
underneath `ui::{element, component, module}` and instead export just
the module contents themselves.

This makes the `ui` module namespace flat.

Release Notes:

- N/A
2023-09-21 17:46:37 -04:00
Nate Butler be6690bf0b Update tracker.md 2023-09-20 13:08:20 -04:00
Nate Butler 6dcb0bafb0 WIP Project Tracker 2023-09-20 12:53:08 -04:00
Nate Butler 2699f170ca Checkpoint - Details 2023-09-19 19:18:23 -04:00
Nate ButlerandJulia 65aa4d5642 Draw indent guides using indent_level
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-09-19 12:38:46 -04:00
Nate ButlerandJulia 3a9f5d6ddc use u32 as indent_level
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-09-19 11:59:55 -04:00
Nate ButlerandJulia 748ad5f05a Make list_item toggleable, improve optional left_icon on list item
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-09-19 11:52:35 -04:00
Nate Butler 7e300079ce WIP 2023-09-19 08:31:22 -04:00
Nate Butler 8aa4fbea83 Add icon, list_item, work on project panel 2023-09-19 00:25:46 -04:00
Nathan Sobo 2701be91e3 Add negative style helpers 2023-09-18 20:47:40 -06:00
Nathan Sobo f2e87a3429 Add Element::when method 2023-09-18 20:25:12 -06:00
Nathan Sobo c7a3186d08 Checkpoint 2023-09-18 20:17:27 -06:00
Nathan Sobo a5e4ceb735 Checkpoint: Add methods for setting arbitrary lengths 2023-09-18 19:48:22 -06:00
Nate Butler b725cadf48 Checkpoint 2023-09-18 19:59:01 -04:00
Nate Butler db1dacde5d Add facepile, indicator, follow_group 2023-09-15 22:10:51 -04:00
Nate Butler 9f2a9d43b1 Organize design system under ui 2023-09-15 16:34:56 -04:00
Nate Butler d6f24feb4a WIP 2023-09-15 14:14:28 -04:00
Nate Butler 40e785fdff Merge branch 'main' into nate/gpui2-ui-components 2023-09-15 13:57:15 -04:00
Nate Butler 24974ee2fa Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
Nate Butler 70a91c5426 Checkpoint 2023-09-15 11:41:21 -04:00
Nate ButlerandNathan Sobo fd10b49742 Fix .active() interaction state
Co-Authored-By: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
2023-09-13 13:56:13 -04:00
Nate Butler a316e25034 Checkpoint 2023-09-13 12:50:01 -04:00
Nate Butler f54f2c52e9 Checkpoint 2023-09-13 12:40:28 -04:00
Nate Butler bbc4673f17 Checkpoint 2023-09-12 15:18:13 -04:00
Nate Butler 0d161519e4 Checkpoint 2023-09-12 11:34:27 -04:00
Nate Butler c7ad89d7fa Merge branch 'main' into nate/storybook-components 2023-09-11 11:49:49 -04:00
Nate Butler 04fc9d2d33 Fix incorrect workspace order 2023-09-11 11:42:54 -04:00
Nate Butler 1376115db2 Use enabled for active tabs 2023-09-11 11:40:03 -04:00
Nate ButlerandPiotr Osiewicz 917884ffaf Restructure storybook modules and components
Co-Authored-By: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-09-11 11:05:10 -04:00
Nathan Sobo e0fdc7d0aa Eliminate PaintContext 2023-09-11 09:00:59 -06:00
Nate Butler 2774eae21a Checkpoint 2023-09-11 10:36:49 -04:00
Nate Butler e84e791dde Checkpoint 2023-09-09 17:51:23 -04:00
Nate Butler 9bb8eae985 init tab_bar 2023-09-09 13:38:57 -04:00
Nate Butler 8dd6fcc186 Add icon_button 2023-09-08 22:16:12 -04:00
Nathan Sobo c3b1264c05 Checkpoint 2023-09-08 14:09:29 -06:00
Nathan Sobo 21d390fa4a Support overflow scroll 2023-09-08 10:20:45 -06:00
Nathan Sobo 7738867639 Always pass parent origin when painting elements 2023-09-08 06:32:20 -06:00
Nathan Sobo d311bd04ff Add basic inspector 2023-09-07 22:24:02 -06:00
Nate Butler e7760e1a3f Outline workspace 2023-09-07 16:25:02 -04:00
Nathan Sobo 4307a06073 WIP 2023-09-07 14:16:44 -06:00
Nate Butler 14ea5a1485 Checkpoint 2023-09-07 16:01:32 -04:00
Nate Butler 5fb9c60905 Checkpoint 2023-09-07 15:33:50 -04:00
Nate Butler f7b2edb59a Checkpoint 2023-09-07 13:15:38 -04:00
Nate Butler 17c5bbfd96 Update titlebar style 2023-09-07 12:58:42 -04:00
Nate Butler 23a8d8fba4 Merge workspace and collab panel demos 2023-09-07 12:55:47 -04:00
Nate Butler a87711d157 Merge branch 'nate/wip-storybook-workspace' into storybook 2023-09-07 12:51:05 -04:00
Nathan Sobo a8d5d93757 Max out corner radii to half the smaller dimension of the parent box 2023-09-06 17:21:05 -06:00