Mainline GPUI2 UI work (#3062)
This PR mainlines the current state of new GPUI2-based UI from the `gpui2-ui` branch. Release Notes: - N/A --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Co-authored-by: Nate <nate@zed.dev> Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
e7ee8a95f6
commit
f26ca0866c
85 changed files with 4658 additions and 1623 deletions
13
crates/ui/docs/_project.md
Normal file
13
crates/ui/docs/_project.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
## Project Plan
|
||||
|
||||
- Port existing UI to GPUI2
|
||||
- Update UI in places that GPUI1 was limiting us*
|
||||
- Understand the needs &/|| struggles the engineers have been having with building UI in the past and address as many of those as possible as we go
|
||||
- Ship a simple, straightforward system with documentation that is easy to use to build UI
|
||||
|
||||
## Component Classification
|
||||
|
||||
To simplify the understanding of components and minimize unnecessary cognitive load, let's categorize components into two types:
|
||||
|
||||
- An element refers to a standalone component that doesn't import any other 'ui' components.
|
||||
- A component indicates a component that utilizes or imports other 'ui' components.
|
57
crates/ui/docs/elevation.md
Normal file
57
crates/ui/docs/elevation.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Elevation
|
||||
|
||||
Elevation in Zed applies to all surfaces and components. Elevation is categorized into levels.
|
||||
|
||||
Elevation accomplishes the following:
|
||||
- Allows surfaces to move in front of or behind others, such as content scrolling beneath app top bars.
|
||||
- Reflects spatial relationships, for instance, how a floating action button’s shadow intimates its disconnection from a collection of cards.
|
||||
- Directs attention to structures at the highest elevation, like a temporary dialog arising in front of other surfaces.
|
||||
|
||||
Elevations are the initial elevation values assigned to components by default.
|
||||
|
||||
Components may transition to a higher elevation in some cases, like user interations.
|
||||
|
||||
On such occasions, components transition to predetermined dynamic elevation offsets. These are the typical elevations to which components move when they are not at rest.
|
||||
|
||||
## Understanding Elevation
|
||||
|
||||
Elevation can be thought of as the physical closeness of an element to the user. Elements with lower elevations are physically further away from the user on the z-axis and appear to be underneath elements with higher elevations.
|
||||
|
||||
Material Design 3 has a some great visualizations of elevation that may be helpful to understanding the mental modal of elevation. [Material Design – Elevation](https://m3.material.io/styles/elevation/overview)
|
||||
|
||||
## Elevation Levels
|
||||
|
||||
Zed integrates six unique elevation levels in its design system. The elevation of a surface is expressed as a whole number ranging from 0 to 5, both numbers inclusive. A component’s elevation is ascertained by combining the component’s resting elevation with any dynamic elevation offsets.
|
||||
|
||||
The levels are detailed as follows:
|
||||
|
||||
0. App Background
|
||||
1. UI Surface
|
||||
2. Elevated Elements
|
||||
3. Wash
|
||||
4. Focused Element
|
||||
5. Dragged Element
|
||||
|
||||
### 0. App Background
|
||||
|
||||
The app background constitutes the lowest elevation layer, appearing behind all other surfaces and components. It is predominantly used for the background color of the app.
|
||||
|
||||
### 1. UI Surface
|
||||
|
||||
The UI Surface is the standard elevation for components and is placed above the app background. It is generally used for the background color of the app bar, card, and sheet.
|
||||
|
||||
### 2. Elevated Elements
|
||||
|
||||
Elevated elements appear above the UI surface layer surfaces and components. Elevated elements are predominantly used for creating popovers, context menus, and tooltips.
|
||||
|
||||
### 3. Wash
|
||||
|
||||
Wash denotes a distinct elevation reserved to isolate app UI layers from high elevation components such as modals, notifications, and overlaid panels. The wash may not consistently be visible when these components are active. This layer is often referred to as a scrim or overlay and the background color of the wash is typically deployed in its design.
|
||||
|
||||
### 4. Focused Element
|
||||
|
||||
Focused elements obtain a higher elevation above surfaces and components at wash elevation. They are often used for modals, notifications, and overlaid panels and indicate that they are the sole element the user is interacting with at the moment.
|
||||
|
||||
### 5. Dragged Element
|
||||
|
||||
Dragged elements gain the highest elevation, thus appearing above surfaces and components at the elevation of focused elements. These are typically used for elements that are being dragged, following the cursor
|
Loading…
Add table
Add a link
Reference in a new issue