shelving 1.296.0 → 1.297.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/dialog/Dialog.md +2 -2
- package/ui/dialog/Dialog.module.css +1 -2
- package/ui/dialog/Modal.d.ts +1 -1
- package/ui/dialog/Modal.js +1 -1
- package/ui/dialog/Modal.md +5 -5
- package/ui/dialog/Modal.module.css +1 -1
- package/ui/dialog/Modal.tsx +1 -1
- package/ui/layout/SidebarLayout.md +2 -1
- package/ui/layout/SidebarLayout.module.css +2 -2
- package/ui/notice/Notices.md +2 -2
- package/ui/notice/Notices.module.css +1 -1
- package/ui/style/Color.module.css +1 -0
- package/ui/style/Shadow.module.css +5 -5
- package/ui/style/getColorClass.md +1 -0
- package/ui/style/getShadowClass.md +9 -6
package/package.json
CHANGED
package/ui/dialog/Dialog.md
CHANGED
|
@@ -71,10 +71,10 @@ function DeleteButton({ onConfirm }: { onConfirm: () => void }) {
|
|
|
71
71
|
| `--dialog-padding` | Top and bottom padding around the centred content (one length) | `var(--space-normal)` (16px) |
|
|
72
72
|
| `--dialog-indent` | Left and right padding around the centred content (one length) | `var(--space-normal)` (16px) |
|
|
73
73
|
| `--dialog-width` | Width of the centred content, and so of a centred `<Modal>` | `var(--width-narrow)` (36rem) |
|
|
74
|
-
| `--dialog-background` | Overlay fill behind the content | `var(--
|
|
74
|
+
| `--dialog-background` | Overlay fill behind the content | `var(--color-backdrop)` |
|
|
75
75
|
| `--dialog-color` | Text colour directly on the overlay | `var(--tint-100)` (white) |
|
|
76
76
|
| `--dialog-close-offset` | Inset of the close button from the top-right corner | `var(--space-small)` (12px) |
|
|
77
77
|
|
|
78
78
|
The fade uses the `fade` class from `<FadeTransition>`, so `--fade-transition-duration` sets its length. It runs only as the dialog opens and closes; an open dialog stays still while other dialogs open and close.
|
|
79
79
|
|
|
80
|
-
**Global tokens it reads** — move these to retheme broadly: `--tint-100`, `--width-narrow`, `--space-normal`, `--space-small`, `--
|
|
80
|
+
**Global tokens it reads** — move these to retheme broadly: `--tint-100`, `--width-narrow`, `--space-normal`, `--space-small`, `--color-backdrop`, and `--duration-fast` (through `<FadeTransition>`).
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@import url("../style/layers.css");
|
|
2
2
|
@import url("../style/Color.module.css");
|
|
3
3
|
@import url("../style/Space.module.css");
|
|
4
|
-
@import url("../style/Shadow.module.css");
|
|
5
4
|
@import url("../style/Tint.module.css");
|
|
6
5
|
@import url("../style/Width.module.css");
|
|
7
6
|
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
|
|
28
27
|
/* Style */
|
|
29
28
|
color: var(--dialog-color, var(--tint-100));
|
|
30
|
-
background: var(--dialog-background, var(--
|
|
29
|
+
background: var(--dialog-background, var(--color-backdrop));
|
|
31
30
|
|
|
32
31
|
/* Flex only to centre `.content`, its one in-flow child. */
|
|
33
32
|
&[open] {
|
package/ui/dialog/Modal.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface ModalProps extends ModalVariants, PaddingVariants, IndentVarian
|
|
|
33
33
|
* Styled `<aside>` panel for content inside a `<Dialog>`, with dark text on a light surface.
|
|
34
34
|
*
|
|
35
35
|
* - Centred by default. It fades in and out with its `<Dialog>`.
|
|
36
|
-
* - Has a `--shadow-
|
|
36
|
+
* - Has a `--shadow-large` drop shadow by default. Set `shadow="none"`, `shadow="small"` or `shadow="normal"` to change it.
|
|
37
37
|
* - `top`, `right`, `bottom`, or `left` pins it to that edge. It then takes its own layer in the `<Dialog>` view transition, and slides in from that edge and out to it.
|
|
38
38
|
*
|
|
39
39
|
* @kind component
|
package/ui/dialog/Modal.js
CHANGED
|
@@ -9,7 +9,7 @@ import styles from "./Modal.module.css";
|
|
|
9
9
|
* Styled `<aside>` panel for content inside a `<Dialog>`, with dark text on a light surface.
|
|
10
10
|
*
|
|
11
11
|
* - Centred by default. It fades in and out with its `<Dialog>`.
|
|
12
|
-
* - Has a `--shadow-
|
|
12
|
+
* - Has a `--shadow-large` drop shadow by default. Set `shadow="none"`, `shadow="small"` or `shadow="normal"` to change it.
|
|
13
13
|
* - `top`, `right`, `bottom`, or `left` pins it to that edge. It then takes its own layer in the `<Dialog>` view transition, and slides in from that edge and out to it.
|
|
14
14
|
*
|
|
15
15
|
* @kind component
|
package/ui/dialog/Modal.md
CHANGED
|
@@ -11,7 +11,7 @@ The panel inside a `<Dialog>`. `<Dialog>` dims the page; `Modal` gives the conte
|
|
|
11
11
|
- A centred `Modal` fills the width of its `<Dialog>`, so set `--dialog-width` to change it. `--modal-width` sets the width of a `left` or `right` panel, and the maximum width of a `top` or `bottom` panel.
|
|
12
12
|
- The `padding` variant (for example `padding="large"`) sets the top and bottom padding, and the `indent` variant sets the left and right padding, the same as on `<Panel>`.
|
|
13
13
|
- The `radius` variant sets the corner radius. On a pinned panel, corners that touch a screen edge stay square.
|
|
14
|
-
- It has a `--shadow-
|
|
14
|
+
- It has a `--shadow-large` drop shadow by default. Set `shadow="none"`, `shadow="small"` or `shadow="normal"` to change it, the same as on `<Card>`.
|
|
15
15
|
- Set `top`, `right`, `bottom`, or `left` to pin the panel to that edge of the screen. A top or bottom panel is full width up to `--modal-width`, and centred on a wider screen. A left or right panel is full height. Use these for mobile menus, bottom sheets, and side menus.
|
|
16
16
|
- A centred panel fades in and out with its `<Dialog>`. A pinned panel slides in from its edge and out to it, in its own view-transition layer. With reduced motion, a pinned panel fades in place.
|
|
17
17
|
|
|
@@ -67,8 +67,8 @@ function DeleteButton({ onConfirm }: { onConfirm: () => void }) {
|
|
|
67
67
|
### Shadow
|
|
68
68
|
|
|
69
69
|
```tsx
|
|
70
|
-
<Modal shadow="
|
|
71
|
-
<p>
|
|
70
|
+
<Modal shadow="small">
|
|
71
|
+
<p>Sits closer to the page.</p>
|
|
72
72
|
</Modal>
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -110,6 +110,6 @@ A link click inside a `<Dialog>` closes it, so the menu slides out as the page c
|
|
|
110
110
|
| `--modal-color` | Text colour | `var(--tint-00)` |
|
|
111
111
|
| `--modal-max-height` | Maximum height of a `top` or `bottom` panel (it scrolls past this) | `100%` |
|
|
112
112
|
| `--modal-transition-duration` | Length of the slide for a pinned panel. Keep it the same as `--fade-transition-duration`, so the panel and the `<Dialog>` overlay finish together | `var(--duration-fast)` (150ms) |
|
|
113
|
-
| `--modal-shadow` | Drop shadow (the `shadow` variant wins over it) | `var(--shadow-
|
|
113
|
+
| `--modal-shadow` | Drop shadow (the `shadow` variant wins over it) | `var(--shadow-large)` |
|
|
114
114
|
|
|
115
|
-
**Global tokens it reads** — move these to retheme broadly: the tint ladder `--tint-00` / `--tint-80` / `--tint-100`, plus `--width-narrow`, `--space-normal`, `--radius-normal`, `--shadow-
|
|
115
|
+
**Global tokens it reads** — move these to retheme broadly: the tint ladder `--tint-00` / `--tint-80` / `--tint-100`, plus `--width-narrow`, `--space-normal`, `--radius-normal`, `--shadow-large`, and `--duration-fast`.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
/* Style */
|
|
23
23
|
color: var(--modal-color, var(--tint-00));
|
|
24
|
-
box-shadow: var(--modal-shadow, var(--shadow-
|
|
24
|
+
box-shadow: var(--modal-shadow, var(--shadow-large));
|
|
25
25
|
|
|
26
26
|
/* Pinned to an edge: fixed to the viewport, flush with the edge, and scrolls when its content is too tall. */
|
|
27
27
|
&.top,
|
package/ui/dialog/Modal.tsx
CHANGED
|
@@ -44,7 +44,7 @@ export interface ModalProps
|
|
|
44
44
|
* Styled `<aside>` panel for content inside a `<Dialog>`, with dark text on a light surface.
|
|
45
45
|
*
|
|
46
46
|
* - Centred by default. It fades in and out with its `<Dialog>`.
|
|
47
|
-
* - Has a `--shadow-
|
|
47
|
+
* - Has a `--shadow-large` drop shadow by default. Set `shadow="none"`, `shadow="small"` or `shadow="normal"` to change it.
|
|
48
48
|
* - `top`, `right`, `bottom`, or `left` pins it to that edge. It then takes its own layer in the `<Dialog>` view transition, and slides in from that edge and out to it.
|
|
49
49
|
*
|
|
50
50
|
* @kind component
|
|
@@ -44,7 +44,8 @@ Layouts compose naturally as `<Router>` route values — wrap a group of routes
|
|
|
44
44
|
| `--sidebar-layout-sidebar-background` | Sidebar column fill | `var(--tint-90)` (one shade darker than the page) |
|
|
45
45
|
| `--sidebar-layout-sidebar-color` | Sidebar column text colour | `var(--tint-00)` (black) |
|
|
46
46
|
| `--sidebar-layout-border` | Divider between sidebar and content, e.g. `1px solid var(--tint-80)` | `none` |
|
|
47
|
+
| `--sidebar-layout-shadow` | Drop shadow of the open drawer on a narrow screen | `var(--shadow-large)` |
|
|
47
48
|
|
|
48
49
|
The sidebar and content columns own their own scroll behaviour directly (this layout no longer composes a shared `.layout` class).
|
|
49
50
|
|
|
50
|
-
**Global tokens it reads** — `--tint-00` / `--tint-90` / `--tint-100`, plus `--space-normal`, `--duration-normal`, and `--color-
|
|
51
|
+
**Global tokens it reads** — `--tint-00` / `--tint-90` / `--tint-100`, plus `--space-normal`, `--duration-normal`, `--shadow-large`, and `--color-backdrop`.
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
|
|
160
160
|
.sidebar.open {
|
|
161
161
|
transform: translateX(0);
|
|
162
|
-
box-shadow:
|
|
162
|
+
box-shadow: var(--sidebar-layout-shadow, var(--shadow-large));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/* Right variant: dock the drawer to the right edge and slide it in from the right instead. */
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
border: 0;
|
|
195
195
|
|
|
196
196
|
/* Style */
|
|
197
|
-
background: var(--
|
|
197
|
+
background: var(--color-backdrop);
|
|
198
198
|
cursor: pointer;
|
|
199
199
|
|
|
200
200
|
/* Hidden and non-interactive until open. Transition `visibility` alongside `opacity` so the overlay stays in the a11y tree (and clickable) only while shown, then flips hidden at the end of the fade-out. */
|
package/ui/notice/Notices.md
CHANGED
|
@@ -69,8 +69,8 @@ notice.close(); // Or close it immediately.
|
|
|
69
69
|
|---|---|---|
|
|
70
70
|
| `--notices-offset` | Distance of the list from the top or bottom edge, and from the left and right edges | `var(--space-normal)` (16px) |
|
|
71
71
|
| `--notices-width` | Maximum width of the list and of each notice | `var(--width-narrow)` |
|
|
72
|
-
| `--notices-shadow` | Drop shadow under each notice in the list (sets `--notice-shadow`) | `var(--shadow-
|
|
72
|
+
| `--notices-shadow` | Drop shadow under each notice in the list (sets `--notice-shadow`) | `var(--shadow-normal)` |
|
|
73
73
|
| `--notices-gap` | Gap between notices | `var(--space-small)` (12px) |
|
|
74
74
|
| `--notices-transition-duration` | Length of the slide in, slide out, and move | `var(--duration-fast)` (150ms) |
|
|
75
75
|
|
|
76
|
-
**Global tokens it reads** — move these to retheme broadly: `--space-normal`, `--space-small`, `--shadow-
|
|
76
|
+
**Global tokens it reads** — move these to retheme broadly: `--space-normal`, `--space-small`, `--shadow-normal`, `--width-narrow`, and `--duration-fast`.
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
--color-success: var(--color-green);
|
|
21
21
|
--color-warning: var(--color-orange);
|
|
22
22
|
--color-failure: var(--color-red);
|
|
23
|
+
--color-backdrop: #0006; /* Dims the page behind a dialog or an open sidebar drawer. */
|
|
23
24
|
|
|
24
25
|
/* Brand colors */
|
|
25
26
|
--color-primary: var(--color-blue); /* Primary brand color */
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
@layer defaults {
|
|
4
4
|
:root {
|
|
5
5
|
/* Colors */
|
|
6
|
-
--shadow-color: #
|
|
6
|
+
--shadow-color: #0003;
|
|
7
7
|
|
|
8
|
-
/* Shadows — elevation drop-shadows. */
|
|
9
|
-
--shadow-small: 0 0.375rem
|
|
10
|
-
--shadow-normal: 0 0.
|
|
11
|
-
--shadow-large: 0 0.
|
|
8
|
+
/* Shadows — elevation drop-shadows. Each has two layers with a negative spread, so no dark line shows under the bottom edge. The Y offset is small enough that a sliver of shadow also shows at the top. */
|
|
9
|
+
--shadow-small: 0 0.125rem 0.375rem -0.0625rem var(--shadow-color), 0 0.0625rem 0.25rem -0.125rem var(--shadow-color);
|
|
10
|
+
--shadow-normal: 0 0.3125rem 0.9375rem -0.1875rem var(--shadow-color), 0 0.125rem 0.375rem -0.25rem var(--shadow-color);
|
|
11
|
+
--shadow-large: 0 0.625rem 1.5625rem -0.3125rem var(--shadow-color), 0 0.25rem 0.625rem -0.375rem var(--shadow-color);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -31,6 +31,7 @@ The following `:root` variables are defined by this module and can be overridden
|
|
|
31
31
|
| `--color-success` | `var(--color-green)` | `status="success"`. |
|
|
32
32
|
| `--color-warning` | `var(--color-orange)` | `status="warning"`. |
|
|
33
33
|
| `--color-failure` | `var(--color-red)` | `status="error"` / `status="danger"`. |
|
|
34
|
+
| `--color-backdrop` | `#0006` | The backdrop that dims the page behind `<Dialog>` and an open `<SidebarLayout>` drawer. |
|
|
34
35
|
|
|
35
36
|
### Brand
|
|
36
37
|
|
|
@@ -4,12 +4,15 @@ This module's main job is to **define and document the elevation drop-shadow des
|
|
|
4
4
|
|
|
5
5
|
## Theme variables
|
|
6
6
|
|
|
7
|
-
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app.
|
|
7
|
+
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app. The scale is [Tailwind's](https://tailwindcss.com/docs/box-shadow) `shadow-md`, `shadow-lg` and `shadow-xl` with half the Y offset, so a sliver of shadow always shows at the top. Each shadow has two layers of `--shadow-color`. Both layers have a negative spread, so no dark line shows under the bottom edge.
|
|
8
8
|
|
|
9
|
-
| Variable | Default |
|
|
10
|
-
|
|
11
|
-
| `--shadow-
|
|
12
|
-
| `--shadow-
|
|
13
|
-
| `--shadow-
|
|
9
|
+
| Variable | Default | Used by |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `--shadow-color` | `#0003` (20% black) | Every layer of every shadow below. |
|
|
12
|
+
| `--shadow-small` | `0 2px 6px -1px`, `0 1px 4px -2px` | `<Popover>` |
|
|
13
|
+
| `--shadow-normal` | `0 5px 15px -3px`, `0 2px 6px -4px` | Floating `<Notices>` |
|
|
14
|
+
| `--shadow-large` | `0 10px 25px -5px`, `0 4px 10px -6px` | `<Modal>`, the open `<SidebarLayout>` drawer |
|
|
15
|
+
|
|
16
|
+
The table shows the values in pixels. The source uses `rem`.
|
|
14
17
|
|
|
15
18
|
The `shadow=` variant prop accepts `"none"`, `"small"`, `"normal"`, or `"large"` — `"none"` removes a component's default shadow rather than mapping to a token.
|