shelving 1.237.0 → 1.239.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.
Files changed (149) hide show
  1. package/package.json +1 -1
  2. package/ui/README.md +27 -4
  3. package/ui/app/App.d.ts +13 -2
  4. package/ui/app/App.js +15 -2
  5. package/ui/app/App.tsx +15 -2
  6. package/ui/block/Address.module.css +2 -1
  7. package/ui/block/Block.module.css +1 -1
  8. package/ui/block/Blockquote.module.css +5 -1
  9. package/ui/block/Caption.module.css +4 -1
  10. package/ui/block/Card.md +1 -1
  11. package/ui/block/Card.module.css +7 -1
  12. package/ui/block/Definitions.module.css +6 -1
  13. package/ui/block/Divider.module.css +4 -1
  14. package/ui/block/Heading.md +1 -1
  15. package/ui/block/Heading.module.css +5 -1
  16. package/ui/block/Image.module.css +2 -1
  17. package/ui/block/Label.module.css +6 -1
  18. package/ui/block/List.md +1 -1
  19. package/ui/block/List.module.css +2 -1
  20. package/ui/block/Panel.d.ts +6 -5
  21. package/ui/block/Panel.js +6 -5
  22. package/ui/block/Panel.md +1 -1
  23. package/ui/block/Panel.module.css +7 -5
  24. package/ui/block/Panel.tsx +7 -5
  25. package/ui/block/Paragraph.md +1 -1
  26. package/ui/block/Paragraph.module.css +2 -1
  27. package/ui/block/Preformatted.module.css +10 -1
  28. package/ui/block/Prose.md +1 -1
  29. package/ui/block/Prose.module.css +2 -1
  30. package/ui/block/Section.md +1 -1
  31. package/ui/block/Section.module.css +2 -1
  32. package/ui/block/Subheading.md +1 -1
  33. package/ui/block/Subheading.module.css +5 -1
  34. package/ui/block/Table.md +1 -1
  35. package/ui/block/Table.module.css +7 -1
  36. package/ui/block/Title.md +1 -1
  37. package/ui/block/Title.module.css +5 -1
  38. package/ui/block/Video.module.css +7 -1
  39. package/ui/dialog/Dialog.md +1 -1
  40. package/ui/dialog/Dialog.module.css +4 -1
  41. package/ui/dialog/Modal.md +2 -2
  42. package/ui/dialog/Modal.module.css +8 -1
  43. package/ui/docs/DocumentationHomePage.d.ts +15 -0
  44. package/ui/docs/DocumentationHomePage.js +24 -0
  45. package/ui/docs/DocumentationHomePage.md +42 -0
  46. package/ui/docs/DocumentationHomePage.test.tsx +35 -0
  47. package/ui/docs/DocumentationHomePage.tsx +46 -0
  48. package/ui/docs/index.d.ts +1 -0
  49. package/ui/docs/index.js +1 -0
  50. package/ui/docs/index.ts +1 -0
  51. package/ui/form/Button.md +1 -1
  52. package/ui/form/Button.module.css +10 -1
  53. package/ui/form/Field.md +1 -1
  54. package/ui/form/Field.module.css +6 -1
  55. package/ui/form/Form.md +1 -1
  56. package/ui/form/Form.module.css +2 -1
  57. package/ui/form/Input.module.css +10 -2
  58. package/ui/form/Popover.module.css +6 -1
  59. package/ui/form/Progress.module.css +4 -1
  60. package/ui/inline/Code.md +2 -2
  61. package/ui/inline/Code.module.css +7 -1
  62. package/ui/inline/Deleted.module.css +4 -1
  63. package/ui/inline/Emphasis.module.css +1 -1
  64. package/ui/inline/Inserted.module.css +4 -1
  65. package/ui/inline/Link.md +2 -2
  66. package/ui/inline/Link.module.css +4 -2
  67. package/ui/inline/Mark.md +1 -1
  68. package/ui/inline/Mark.module.css +3 -1
  69. package/ui/inline/Small.module.css +2 -1
  70. package/ui/inline/Strong.md +1 -1
  71. package/ui/inline/Strong.module.css +2 -1
  72. package/ui/inline/Subscript.module.css +1 -1
  73. package/ui/inline/Superscript.module.css +1 -1
  74. package/ui/layout/CenteredLayout.md +2 -2
  75. package/ui/layout/CenteredLayout.module.css +2 -1
  76. package/ui/layout/Layout.module.css +4 -2
  77. package/ui/layout/SidebarLayout.md +1 -1
  78. package/ui/layout/SidebarLayout.module.css +5 -1
  79. package/ui/menu/Menu.md +1 -1
  80. package/ui/menu/Menu.module.css +9 -1
  81. package/ui/menu/MenuItem.md +1 -1
  82. package/ui/misc/Loading.module.css +3 -1
  83. package/ui/misc/StatusIcon.module.css +2 -1
  84. package/ui/misc/Tag.md +1 -1
  85. package/ui/misc/Tag.module.css +9 -1
  86. package/ui/notice/Message.module.css +3 -1
  87. package/ui/notice/Notice.md +1 -1
  88. package/ui/notice/Notice.module.css +7 -1
  89. package/ui/notice/Notices.module.css +3 -1
  90. package/ui/style/Color.module.css +28 -1
  91. package/ui/style/Duration.d.ts +24 -0
  92. package/ui/style/Duration.js +13 -0
  93. package/ui/style/Duration.module.css +23 -0
  94. package/ui/style/Duration.tsx +31 -0
  95. package/ui/style/Flex.module.css +3 -1
  96. package/ui/style/Font.d.ts +24 -0
  97. package/ui/style/Font.js +13 -0
  98. package/ui/style/Font.module.css +50 -0
  99. package/ui/style/Font.tsx +31 -0
  100. package/ui/style/Gap.module.css +2 -1
  101. package/ui/style/Padding.module.css +2 -1
  102. package/ui/style/Radius.d.ts +24 -0
  103. package/ui/style/Radius.js +13 -0
  104. package/ui/style/Radius.module.css +43 -0
  105. package/ui/style/Radius.tsx +31 -0
  106. package/ui/style/Scroll.module.css +4 -0
  107. package/ui/style/Shadow.d.ts +24 -0
  108. package/ui/style/Shadow.js +13 -0
  109. package/ui/style/Shadow.module.css +42 -0
  110. package/ui/style/Shadow.tsx +31 -0
  111. package/ui/style/Size.d.ts +24 -0
  112. package/ui/style/Size.js +13 -0
  113. package/ui/style/Size.module.css +69 -0
  114. package/ui/style/Size.tsx +31 -0
  115. package/ui/style/Space.module.css +19 -1
  116. package/ui/style/Status.module.css +2 -1
  117. package/ui/style/Stroke.d.ts +24 -0
  118. package/ui/style/Stroke.js +13 -0
  119. package/ui/style/Stroke.module.css +26 -0
  120. package/ui/style/Stroke.tsx +31 -0
  121. package/ui/style/Tint.module.css +4 -1
  122. package/ui/style/Typography.d.ts +10 -26
  123. package/ui/style/Typography.js +8 -3
  124. package/ui/style/Typography.module.css +2 -66
  125. package/ui/style/Typography.tsx +17 -31
  126. package/ui/style/Weight.d.ts +24 -0
  127. package/ui/style/Weight.js +13 -0
  128. package/ui/style/Weight.module.css +42 -0
  129. package/ui/style/Weight.tsx +31 -0
  130. package/ui/style/Width.module.css +7 -1
  131. package/ui/style/getColorClass.md +47 -0
  132. package/ui/style/getDurationClass.md +18 -0
  133. package/ui/style/getFontClass.md +39 -0
  134. package/ui/style/getRadiusClass.md +24 -0
  135. package/ui/style/getShadowClass.md +23 -0
  136. package/ui/style/getSizeClass.md +42 -0
  137. package/ui/style/getSpaceClass.md +35 -0
  138. package/ui/style/getStrokeClass.md +20 -0
  139. package/ui/style/getWeightClass.md +25 -0
  140. package/ui/style/getWidthClass.md +18 -0
  141. package/ui/style/index.d.ts +7 -0
  142. package/ui/style/index.js +7 -0
  143. package/ui/style/index.tsx +7 -0
  144. package/ui/style/layers.css +26 -0
  145. package/ui/transition/FadeTransition.md +1 -1
  146. package/ui/transition/HorizontalTransition.md +1 -1
  147. package/ui/transition/Transition.md +1 -1
  148. package/ui/transition/VerticalTransition.md +1 -1
  149. package/ui/style/base.css +0 -161
@@ -0,0 +1,39 @@
1
+ # getFontClass
2
+
3
+ The `font` variant prop sets an element's font family — `<Code font="monospace">`, `<Heading font="title">`. It's an **override** for one-off typeface changes; for an app-wide change, point the font variables below at your own faces in a theme file.
4
+
5
+ `getFontClass({ font })` maps the prop to a font-family class (e.g. `font="title"` → `title`). The semantic faces (`--font-title`, `--font-body`, …) are aliases of the three base faces, so a theme typically only redefines `--font-sans` / `--font-serif` / `--font-monospace`.
6
+
7
+ ## Theme variables
8
+
9
+ 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.
10
+
11
+ ### Faces
12
+
13
+ | Variable | Default | Notes |
14
+ |---|---|---|
15
+ | `--font-sans` | `system-ui` | Default UI face. |
16
+ | `--font-monospace` | `ui-monospace, "SF Mono", "Consolas", "Menlo", monospace` | Code face. |
17
+ | `--font-serif` | `"Palatino", "Garamond", serif` | Serif face. |
18
+
19
+ ### Semantic
20
+
21
+ | Variable | Default | Used for |
22
+ |---|---|---|
23
+ | `--font-title` | `var(--font-sans)` | Headings and titles. |
24
+ | `--font-body` | `var(--font-sans)` | Body baseline. |
25
+ | `--font-label` | `var(--font-sans)` | Labels. |
26
+ | `--font-code` | `var(--font-monospace)` | Code and preformatted text. |
27
+
28
+ ### Case
29
+
30
+ | Variable | Default | Used for |
31
+ |---|---|---|
32
+ | `--case-label` | `uppercase` | `text-transform` for labels and tags. |
33
+
34
+ ## See also
35
+
36
+ - [`getSizeClass`](/ui/getSizeClass) — font size.
37
+ - [`getWeightClass`](/ui/getWeightClass) — font weight.
38
+ - [`getTypographyClass`](/ui/getTypographyClass) — combines size, weight, font, alignment, and tint.
39
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,24 @@
1
+ # getRadiusClass
2
+
3
+ This module's main job is to **define and document the corner-radius design tokens**. Components don't take a `radius` prop — they read these tokens directly and expose their own per-component hooks (`--card-radius`, `--button-radius`, …) for surgical overrides. `getRadiusClass({ radius })` exists as a utility (e.g. `radius="large"` → `radius-large`) and as the home for this documentation.
4
+
5
+ ## Theme variables
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. Every step derives from `--radius`, so changing that one value reflows the whole ramp.
8
+
9
+ | Variable | Default | Notes |
10
+ |---|---|---|
11
+ | `--radius` | `1rem` | Base radius — the root of the scale. |
12
+ | `--radius-xxsmall` | `calc(var(--radius) * 0.25)` | 4px |
13
+ | `--radius-xsmall` | `calc(var(--radius) * 0.5)` | 8px |
14
+ | `--radius-small` | `calc(var(--radius) * 0.75)` | 12px |
15
+ | `--radius-normal` | `calc(var(--radius) * 1)` | 16px |
16
+ | `--radius-large` | `calc(var(--radius) * 1.5)` | 24px |
17
+ | `--radius-xlarge` | `calc(var(--radius) * 2)` | 32px |
18
+ | `--radius-xxlarge` | `calc(var(--radius) * 3)` | 48px |
19
+
20
+ ## See also
21
+
22
+ - [`getStrokeClass`](/ui/getStrokeClass) — border-thickness tokens.
23
+ - [`getShadowClass`](/ui/getShadowClass) — drop-shadow tokens.
24
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,23 @@
1
+ # getShadowClass
2
+
3
+ This module's main job is to **define and document the elevation drop-shadow design tokens**. Components read these tokens directly; `getShadowClass({ shadow })` exists as a utility (e.g. `shadow="large"` → `shadow-large`) and as the home for this documentation.
4
+
5
+ ## Theme variables
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. Each step deepens both blur and offset for a consistent elevation ramp.
8
+
9
+ | Variable | Default |
10
+ |---|---|
11
+ | `--shadow-xxsmall` | `0 0.125rem 0.5rem -0.25rem #0006` |
12
+ | `--shadow-xsmall` | `0 0.25rem 1rem -0.5rem #0006` |
13
+ | `--shadow-small` | `0 0.375rem 1.5rem -0.75rem #0006` |
14
+ | `--shadow-normal` | `0 0.5rem 2rem -1rem #0006` |
15
+ | `--shadow-large` | `0 0.75rem 3rem -1.5rem #0006` |
16
+ | `--shadow-xlarge` | `0 1rem 4rem -2rem #0006` |
17
+ | `--shadow-xxlarge` | `0 1.5rem 6rem -3rem #0006` |
18
+
19
+ ## See also
20
+
21
+ - [`getRadiusClass`](/ui/getRadiusClass) — corner-radius tokens.
22
+ - [`getStrokeClass`](/ui/getStrokeClass) — border-thickness tokens.
23
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,42 @@
1
+ # getSizeClass
2
+
3
+ The `size` variant prop sets an element's font size from the modular scale — `<Heading size="large">`, `<Small size="xsmall">`. It's an **override** for one-off sizing; for an app-wide change, retune the scale variables below in a theme file.
4
+
5
+ `getSizeClass({ size })` maps the prop to a font-size class (e.g. `size="large"` → `large`). All steps derive from `--size` and `--size-scale`, so changing those two reflows the whole ramp.
6
+
7
+ ## Theme variables
8
+
9
+ 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.
10
+
11
+ ### Scale
12
+
13
+ | Variable | Default | Notes |
14
+ |---|---|---|
15
+ | `--size` | `1rem` | Base size — the root of the modular scale. |
16
+ | `--size-scale` | `1.25` | Ratio between steps. |
17
+ | `--size-xxsmall` … `--size-xxxlarge` | `calc(var(--size) * pow(var(--size-scale), n))` | Each step is the base scaled by a power of the ratio (`--size-normal` = `var(--size)`). |
18
+
19
+ ### Semantic & relative
20
+
21
+ | Variable | Default | Used for |
22
+ |---|---|---|
23
+ | `--size-icon` | `var(--size-large)` | Icon box size. |
24
+ | `--size-label` | `var(--size-small)` | Label text size. |
25
+ | `--size-smaller` | `0.875em` | Relative (em) shrink — e.g. inline `<Small>`. |
26
+ | `--size-larger` | `1.5em` | Relative grow. |
27
+ | `--size-xlarger` | `2.5em` | Relative grow. |
28
+ | `--size-xxlarger` | `5em` | Relative grow. |
29
+
30
+ ### Line height
31
+
32
+ | Variable | Default | Used for |
33
+ |---|---|---|
34
+ | `--leading` | `clamp(1.05em, calc(1em + 0.5rem), 1.5em)` | Default line height; paired with every font-size variant and the body baseline. |
35
+ | `--leading-normal` | `1.5` | Plain unitless line height for dense blocks. |
36
+
37
+ ## See also
38
+
39
+ - [`getWeightClass`](/ui/getWeightClass) — font weight.
40
+ - [`getFontClass`](/ui/getFontClass) — font family.
41
+ - [`getTypographyClass`](/ui/getTypographyClass) — combines size, weight, font, alignment, and tint.
42
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,35 @@
1
+ # getSpaceClass
2
+
3
+ The `space` variant prop sets a block-level element's `margin-block` (top + bottom) from the spacing scale — `<Section space="large">`, `<Paragraph space="none">`. It's an **override** for one-off spacing; for an app-wide change, retune the spacing variables below in a theme file.
4
+
5
+ `getSpaceClass({ space })` maps the prop to a margin class (e.g. `space="large"` → `large`). The same scale also backs [`getPaddingClass`](/ui/getPaddingClass) and [`getGapClass`](/ui/getGapClass), so all three move together when you change `--space`.
6
+
7
+ ## Theme variables
8
+
9
+ 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.
10
+
11
+ ### Scale
12
+
13
+ | Variable | Default | Notes |
14
+ |---|---|---|
15
+ | `--space` | `1rem` | Base spacing unit — the root of the scale. |
16
+ | `--space-xxsmall` | `calc(var(--space) * 0.25)` | 4px |
17
+ | `--space-xsmall` | `calc(var(--space) * 0.5)` | 8px |
18
+ | `--space-small` | `calc(var(--space) * 0.75)` | 12px |
19
+ | `--space-normal` | `calc(var(--space) * 1)` | 16px |
20
+ | `--space-large` | `calc(var(--space) * 1.5)` | 24px |
21
+ | `--space-xlarge` | `calc(var(--space) * 2)` | 32px |
22
+ | `--space-xxlarge` | `calc(var(--space) * 3)` | 48px |
23
+
24
+ ### Semantic
25
+
26
+ | Variable | Default | Used for |
27
+ |---|---|---|
28
+ | `--space-section` | `2rem` | Top margin for titles / headings / section blocks. |
29
+ | `--space-paragraph` | `var(--space-normal)` | Default block-space for most prose elements. |
30
+
31
+ ## See also
32
+
33
+ - [`getPaddingClass`](/ui/getPaddingClass) — the `padding-block` sibling on the same scale.
34
+ - [`getGapClass`](/ui/getGapClass) — the flex/grid `gap` sibling on the same scale.
35
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,20 @@
1
+ # getStrokeClass
2
+
3
+ This module's main job is to **define and document the border-thickness design tokens**. Components don't take a `stroke` prop — they hard-code to these tokens and expose their own per-component hooks (`--button-stroke`, `--card-border`, …) for overrides. `getStrokeClass({ stroke })` exists as a utility (e.g. `stroke="thick"` → `stroke-thick`) and as the home for this documentation.
4
+
5
+ ## Theme variables
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.
8
+
9
+ | Variable | Default | Used for |
10
+ |---|---|---|
11
+ | `--stroke` | `2px` | Base border thickness — the root of the scale. |
12
+ | `--stroke-normal` | `calc(var(--stroke) * 1)` | Default borders. |
13
+ | `--stroke-thick` | `calc(var(--stroke) * 1.5)` | Heavier borders. |
14
+ | `--stroke-focus` | `var(--stroke-thick)` | Focus-outline thickness. |
15
+
16
+ ## See also
17
+
18
+ - [`getRadiusClass`](/ui/getRadiusClass) — corner-radius tokens.
19
+ - [`getShadowClass`](/ui/getShadowClass) — drop-shadow tokens.
20
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,25 @@
1
+ # getWeightClass
2
+
3
+ The `weight` variant prop sets an element's font weight — `<Paragraph weight="strong">`. It's an **override** for one-off emphasis; for an app-wide change, override the weight variables below in a theme file.
4
+
5
+ `getWeightClass({ weight })` maps the prop to a weight class (e.g. `weight="strong"` → `weight-strong`). The semantic weights are aliases of the two base weights, so themes usually only need to move `--weight-normal` / `--weight-strong`.
6
+
7
+ ## Theme variables
8
+
9
+ 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.
10
+
11
+ | Variable | Default | Used for |
12
+ |---|---|---|
13
+ | `--weight-normal` | `400` | Body text. |
14
+ | `--weight-strong` | `700` | Bold / emphasis. |
15
+ | `--weight-title` | `var(--weight-strong)` | Headings and titles. |
16
+ | `--weight-body` | `var(--weight-normal)` | Body baseline. |
17
+ | `--weight-label` | `var(--weight-strong)` | Labels (`<Label>`, table/definition headers). |
18
+ | `--weight-code` | `500` | Monospace / code. |
19
+
20
+ ## See also
21
+
22
+ - [`getSizeClass`](/ui/getSizeClass) — font size.
23
+ - [`getFontClass`](/ui/getFontClass) — font family.
24
+ - [`getTypographyClass`](/ui/getTypographyClass) — combines size, weight, font, alignment, and tint.
25
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -0,0 +1,18 @@
1
+ # getWidthClass
2
+
3
+ The width variant props (`narrow`, `wide`, `full`, `fit`) constrain a block-level component's max-inline-size — `<Section narrow>`, `<Card wide>`. They're **overrides** for one-off layout; for an app-wide change, retune the width variables below in a theme file.
4
+
5
+ `getWidthClass({ narrow, wide, full })` maps the boolean props to a width class. The `narrow` and `wide` constraints read the variables below.
6
+
7
+ ## Theme variables
8
+
9
+ 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.
10
+
11
+ | Variable | Default | Used for |
12
+ |---|---|---|
13
+ | `--width-narrow` | `22.5rem` | The `narrow` constraint — single-column forms, dialogs. |
14
+ | `--width-wide` | `33.75rem` | The `wide` constraint — readable prose measure. |
15
+
16
+ ## See also
17
+
18
+ - [`ui`](/ui) — the styling-system overview and the full list of base token pages.
@@ -1,10 +1,17 @@
1
1
  export * from "./Color.js";
2
+ export * from "./Duration.js";
2
3
  export * from "./Flex.js";
4
+ export * from "./Font.js";
3
5
  export * from "./Gap.js";
4
6
  export * from "./Padding.js";
7
+ export * from "./Radius.js";
5
8
  export * from "./Scroll.js";
9
+ export * from "./Shadow.js";
10
+ export * from "./Size.js";
6
11
  export * from "./Space.js";
7
12
  export * from "./Status.js";
13
+ export * from "./Stroke.js";
8
14
  export * from "./Tint.js";
9
15
  export * from "./Typography.js";
16
+ export * from "./Weight.js";
10
17
  export * from "./Width.js";
package/ui/style/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  export * from "./Color.js";
2
+ export * from "./Duration.js";
2
3
  export * from "./Flex.js";
4
+ export * from "./Font.js";
3
5
  export * from "./Gap.js";
4
6
  export * from "./Padding.js";
7
+ export * from "./Radius.js";
5
8
  export * from "./Scroll.js";
9
+ export * from "./Shadow.js";
10
+ export * from "./Size.js";
6
11
  export * from "./Space.js";
7
12
  export * from "./Status.js";
13
+ export * from "./Stroke.js";
8
14
  export * from "./Tint.js";
9
15
  export * from "./Typography.js";
16
+ export * from "./Weight.js";
10
17
  export * from "./Width.js";
@@ -1,10 +1,17 @@
1
1
  export * from "./Color.js";
2
+ export * from "./Duration.js";
2
3
  export * from "./Flex.js";
4
+ export * from "./Font.js";
3
5
  export * from "./Gap.js";
4
6
  export * from "./Padding.js";
7
+ export * from "./Radius.js";
5
8
  export * from "./Scroll.js";
9
+ export * from "./Shadow.js";
10
+ export * from "./Size.js";
6
11
  export * from "./Space.js";
7
12
  export * from "./Status.js";
13
+ export * from "./Stroke.js";
8
14
  export * from "./Tint.js";
9
15
  export * from "./Typography.js";
16
+ export * from "./Weight.js";
10
17
  export * from "./Width.js";
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Cascade-layer anchor for the shelving UI library. See `modules/ui/README.md` for the styling system overview.
3
+ *
4
+ * This file does exactly one thing: declare the cascade-layer order (lowest → highest priority). Every other
5
+ * `*.module.css` `@import`s it (alongside the specific token modules it references), so the layer order reaches
6
+ * every component regardless of bundle order. Re-declaring the same order elsewhere is a harmless no-op.
7
+ *
8
+ * • `defaults` — `:root` design tokens (spread across the themed token modules), the tint ladder, and the
9
+ * body baseline. Low-priority opt-in defaults.
10
+ * • `components` — component-defining CSS. The bulk of the codebase.
11
+ * • `variants` — cross-cutting opt-in modifiers (Color, Status, Space, Padding, Gap, Width, Size, Weight,
12
+ * Font, Flex, Scroll). Always beat components.
13
+ * • `overrides` — top-priority structural overrides like `:first-child` / `:last-child` margin collapses,
14
+ * which must beat variant-set margins.
15
+ *
16
+ * Unlayered rules beat all layered rules — themes should override design tokens at `:root` (via inheritance),
17
+ * not via class selectors. Each themed token module documents the `:root` variables it defines and which ones
18
+ * a theme file is expected to override.
19
+ */
20
+ @layer defaults, components, variants, overrides;
21
+
22
+ @layer defaults {
23
+ :root {
24
+ color-scheme: light;
25
+ }
26
+ }
@@ -27,7 +27,7 @@ function Panel({ visible }: { visible: boolean }) {
27
27
  |---|---|---|
28
28
  | `--fade-transition-duration` | Duration of the fade-in and fade-out keyframes | `var(--duration-fast)` |
29
29
 
30
- **Global tokens it reads** — `--duration-fast`.
30
+ **Global tokens it reads** — [`--duration-fast`](/ui/getDurationClass).
31
31
 
32
32
  ## See also
33
33
 
@@ -35,7 +35,7 @@ function navigate(direction: "forward" | "back", url: string) {
35
35
  | `--horizontal-transition-size` | Slide distance for the enter/leave keyframes | `25vw` |
36
36
  | `--horizontal-transition-duration` | Duration of the slide keyframes | `var(--duration-normal)` |
37
37
 
38
- **Global tokens it reads** — `--duration-normal`.
38
+ **Global tokens it reads** — [`--duration-normal`](/ui/getDurationClass).
39
39
 
40
40
  ## See also
41
41
 
@@ -60,7 +60,7 @@ Transitions are driven by CSS `::view-transition-*` pseudo-element rules keyed o
60
60
 
61
61
  The `overlay` variant sets `z-index: 100` on `::view-transition-group(.overlay)`. The preset variants document their own timing/distance hooks (`--fade-transition-duration`, `--vertical-transition-size` / `-duration`, `--horizontal-transition-size` / `-duration`) on their pages.
62
62
 
63
- **Global tokens it reads** — none directly; the preset variants fall back to `--duration-fast` / `--duration-normal`.
63
+ **Global tokens it reads** — none directly; the preset variants fall back to [`--duration-fast`](/ui/getDurationClass) / [`--duration-normal`](/ui/getDurationClass).
64
64
 
65
65
  ## See also
66
66
 
@@ -25,7 +25,7 @@ import { VerticalTransition } from "shelving/ui";
25
25
  | `--vertical-transition-size` | Slide distance for the enter/leave keyframes | `25vh` |
26
26
  | `--vertical-transition-duration` | Duration of the slide keyframes | `var(--duration-normal)` |
27
27
 
28
- **Global tokens it reads** — `--duration-normal`.
28
+ **Global tokens it reads** — [`--duration-normal`](/ui/getDurationClass).
29
29
 
30
30
  ## See also
31
31
 
package/ui/style/base.css DELETED
@@ -1,161 +0,0 @@
1
- /*
2
- * Base styles for the shelving UI library. See `modules/ui/README.md` for the styling system overview.
3
- *
4
- * Every `*.module.css` `@import`s this file at the very top. It does three things:
5
- *
6
- * 1. Declares the cascade-layer order (lowest → highest priority):
7
- * • `defaults` — `:root` design tokens + body baseline + low-priority opt-in defaults.
8
- * • `components` — component-defining CSS. The bulk of the codebase.
9
- * • `variants` — cross-cutting opt-in modifiers (Color, Status, Spacing, Padding, Gap,
10
- * Width, Typography, Flex, Scroll). Always beat components.
11
- * • `overrides` — top-priority structural overrides like `:first-child` / `:last-child` margin
12
- * collapses, which must beat variant-set margins.
13
- *
14
- * 2. Defines the design-token constants at `:root` — colours, sizes, spacing, etc.
15
- *
16
- * 3. Sets baseline typography on `body` so a page with no `<Layout>` still reads correctly.
17
- *
18
- * Re-declaring the same layer order across every importer is a no-op. Unlayered rules beat all layered
19
- * rules — themes should override tokens at `:root` (via inheritance), not via class selectors.
20
- */
21
- @layer defaults, components, variants, overrides;
22
-
23
- @layer defaults {
24
- :root {
25
- color-scheme: light;
26
-
27
- /* Semantic widths */
28
- --width-narrow: 22.5rem;
29
- --width-wide: 33.75rem;
30
-
31
- /* Font weights */
32
- --weight-normal: 400;
33
- --weight-strong: 700;
34
-
35
- /* Semantic font weights */
36
- --weight-title: var(--weight-strong);
37
- --weight-body: var(--weight-normal);
38
- --weight-label: var(--weight-strong);
39
- --weight-code: 500;
40
-
41
- /* Font faces */
42
- --font-sans: system-ui;
43
- --font-monospace: ui-monospace, "SF Mono", "Consolas", "Menlo", monospace;
44
- --font-serif: "Palatino", "Garamond", serif;
45
-
46
- /* Semantic font faces */
47
- --font-title: var(--font-sans);
48
- --font-body: var(--font-sans);
49
- --font-label: var(--font-sans);
50
- --font-code: var(--font-monospace);
51
-
52
- /* Semantic cases */
53
- --case-label: uppercase;
54
-
55
- /* Sizings */
56
- --size: 1rem;
57
- --size-scale: 1.25;
58
- --size-xxsmall: calc(var(--size) * pow(var(--size-scale), -3));
59
- --size-xsmall: calc(var(--size) * pow(var(--size-scale), -2));
60
- --size-small: calc(var(--size) * pow(var(--size-scale), -1));
61
- --size-normal: calc(var(--size) * pow(var(--size-scale), 0));
62
- --size-large: calc(var(--size) * pow(var(--size-scale), 1));
63
- --size-xlarge: calc(var(--size) * pow(var(--size-scale), 2));
64
- --size-xxlarge: calc(var(--size) * pow(var(--size-scale), 3));
65
- --size-xxxlarge: calc(var(--size) * pow(var(--size-scale), 4));
66
-
67
- /* Semantic sizes */
68
- --size-icon: var(--size-large);
69
- --size-label: var(--size-small);
70
-
71
- /* Relative sizes */
72
- --size-smaller: 0.875em;
73
- --size-larger: 1.5em;
74
- --size-xlarger: 2.5em;
75
- --size-xxlarger: 5em;
76
-
77
- /* Line heights */
78
- --leading: clamp(1.05em, calc(1em + 0.5rem), 1.5em);
79
- --leading-normal: 1.5;
80
-
81
- /* Spacings */
82
- --space: 1rem;
83
- --space-xxsmall: calc(var(--space) * 0.25); /* 4px */
84
- --space-xsmall: calc(var(--space) * 0.5); /* 8px */
85
- --space-small: calc(var(--space) * 0.75); /* 12px */
86
- --space-normal: calc(var(--space) * 1); /* 16px */
87
- --space-large: calc(var(--space) * 1.5); /* 24px */
88
- --space-xlarge: calc(var(--space) * 2); /* 32px */
89
- --space-xxlarge: calc(var(--space) * 3); /* 48px */
90
-
91
- /* Semantic spacings */
92
- --space-section: 2rem; /* Default top margin for titles/headings/section blocks. */
93
- --space-paragraph: var(--space-normal); /* Default block-space for most prose-level elements. */
94
-
95
- /* Radii */
96
- --radius: 1rem;
97
- --radius-xxsmall: calc(var(--radius) * 0.25); /* 4px */
98
- --radius-xsmall: calc(var(--radius) * 0.5); /* 8px */
99
- --radius-small: calc(var(--radius) * 0.75); /* 12px */
100
- --radius-normal: calc(var(--radius) * 1); /* 16px */
101
- --radius-large: calc(var(--radius) * 1.5); /* 24px */
102
- --radius-xlarge: calc(var(--radius) * 2); /* 32px */
103
- --radius-xxlarge: calc(var(--radius) * 3); /* 48px */
104
-
105
- /* Strokes — border thicknesses. A single normal weight; components hard-code to it and expose
106
- * per-component `--x-border` / `--x-stroke` hooks to override (there are deliberately no thickness modifiers). */
107
- --stroke: 2px;
108
- --stroke-normal: calc(var(--stroke) * 1);
109
- --stroke-thick: calc(var(--stroke) * 1.5);
110
-
111
- /* Semantic strokes */
112
- --stroke-focus: var(--stroke-thick);
113
-
114
- /* Durations */
115
- --duration-fast: 150ms;
116
- --duration-normal: 300ms;
117
- --duration-slow: 600ms;
118
-
119
- /* Basic colors */
120
- --color-gray: oklch(60% 0.01 240); /* Subtle blue tint so neutrals don't feel "dead". */
121
- --color-red: oklch(62% 0.2 30); /* Slightly desaturated from default — takes the edge off without losing red identity. */
122
- --color-orange: oklch(74% 0.157 60);
123
- --color-yellow: oklch(86% 0.16 92);
124
- --color-green: oklch(72% 0.185 130);
125
- --color-aqua: oklch(72% 0.121 185);
126
- --color-blue: oklch(57% 0.216 260); /* OKLCH form of #156ef4 — warmer hue (260) than the previous 240. */
127
- --color-purple: oklch(58% 0.25 300);
128
- --color-pink: oklch(68% 0.239 350);
129
-
130
- /* Semantic colors */
131
- --color-link: var(--color-blue);
132
- --color-focus: var(--color-blue);
133
- --color-success: var(--color-green);
134
- --color-warning: var(--color-orange);
135
- --color-failure: var(--color-red);
136
-
137
- /* Brand colors */
138
- --color-primary: var(--color-blue); /* Primary brand color */
139
- --color-secondary: var(--color-purple); /* Secondary brand color */
140
- --color-tertiary: var(--color-pink); /* Tertiary brand color */
141
-
142
- /* Shadows */
143
- --shadow-xxsmall: 0 0.125rem 0.5rem -0.25rem #0006;
144
- --shadow-xsmall: 0 0.25rem 1rem -0.5rem #0006;
145
- --shadow-small: 0 0.375rem 1.5rem -0.75rem #0006;
146
- --shadow-normal: 0 0.5rem 2rem -1rem #0006;
147
- --shadow-large: 0 0.75rem 3rem -1.5rem #0006;
148
- --shadow-xlarge: 0 1rem 4rem -2rem #0006;
149
- --shadow-xxlarge: 0 1.5rem 6rem -3rem #0006;
150
- }
151
-
152
- /* Typography reset — baseline fonts on body. Colours come from the tint ladder in
153
- * `Tint.module.css`, which paints body `--tint-00` text on a `--tint-100` background. */
154
- body {
155
- font-family: var(--font-body);
156
- font-weight: var(--weight-normal);
157
- font-size: var(--size-normal);
158
- line-height: var(--leading);
159
- text-align: start;
160
- }
161
- }