@underpin/ui 0.0.0-stage → 2.0.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/components/autocomplete.d.ts +25 -0
  4. package/components/autocomplete.js +71 -0
  5. package/components/autocomplete.js.map +1 -0
  6. package/components/avatar.d.ts +5 -0
  7. package/components/avatar.js +26 -0
  8. package/components/avatar.js.map +1 -0
  9. package/components/badge.d.ts +36 -0
  10. package/components/badge.js +140 -0
  11. package/components/badge.js.map +1 -0
  12. package/components/bar-list.d.ts +133 -0
  13. package/components/bar-list.js +204 -0
  14. package/components/bar-list.js.map +1 -0
  15. package/components/breakdown-card.d.ts +30 -0
  16. package/components/breakdown-card.js +43 -0
  17. package/components/breakdown-card.js.map +1 -0
  18. package/components/button-group.d.ts +17 -0
  19. package/components/button-group.js +27 -0
  20. package/components/button-group.js.map +1 -0
  21. package/components/button.d.ts +39 -0
  22. package/components/button.js +128 -0
  23. package/components/button.js.map +1 -0
  24. package/components/calendar.d.ts +27 -0
  25. package/components/calendar.js +95 -0
  26. package/components/calendar.js.map +1 -0
  27. package/components/callout.d.ts +26 -0
  28. package/components/callout.js +71 -0
  29. package/components/callout.js.map +1 -0
  30. package/components/card.d.ts +55 -0
  31. package/components/card.js +96 -0
  32. package/components/card.js.map +1 -0
  33. package/components/chart.d.ts +32 -0
  34. package/components/chart.js +43 -0
  35. package/components/chart.js.map +1 -0
  36. package/components/checkbox.d.ts +15 -0
  37. package/components/checkbox.js +42 -0
  38. package/components/checkbox.js.map +1 -0
  39. package/components/code-block.d.ts +21 -0
  40. package/components/code-block.js +35 -0
  41. package/components/code-block.js.map +1 -0
  42. package/components/collapse.d.ts +14 -0
  43. package/components/collapse.js +25 -0
  44. package/components/collapse.js.map +1 -0
  45. package/components/combobox.d.ts +71 -0
  46. package/components/combobox.js +155 -0
  47. package/components/combobox.js.map +1 -0
  48. package/components/copy-button.d.ts +29 -0
  49. package/components/copy-button.js +100 -0
  50. package/components/copy-button.js.map +1 -0
  51. package/components/copy-input.d.ts +15 -0
  52. package/components/copy-input.js +51 -0
  53. package/components/copy-input.js.map +1 -0
  54. package/components/date-picker-trigger.d.ts +12 -0
  55. package/components/date-picker-trigger.js +30 -0
  56. package/components/date-picker-trigger.js.map +1 -0
  57. package/components/date-picker.d.ts +36 -0
  58. package/components/date-picker.js +70 -0
  59. package/components/date-picker.js.map +1 -0
  60. package/components/detail-row.d.ts +51 -0
  61. package/components/detail-row.js +77 -0
  62. package/components/detail-row.js.map +1 -0
  63. package/components/dialog.d.ts +121 -0
  64. package/components/dialog.js +327 -0
  65. package/components/dialog.js.map +1 -0
  66. package/components/disabled-reason.d.ts +31 -0
  67. package/components/disabled-reason.js +67 -0
  68. package/components/disabled-reason.js.map +1 -0
  69. package/components/empty-state.d.ts +41 -0
  70. package/components/empty-state.js +84 -0
  71. package/components/empty-state.js.map +1 -0
  72. package/components/entity-avatar.d.ts +54 -0
  73. package/components/entity-avatar.js +68 -0
  74. package/components/entity-avatar.js.map +1 -0
  75. package/components/form-section.d.ts +22 -0
  76. package/components/form-section.js +38 -0
  77. package/components/form-section.js.map +1 -0
  78. package/components/form.d.ts +199 -0
  79. package/components/form.js +456 -0
  80. package/components/form.js.map +1 -0
  81. package/components/formatted-number.d.ts +21 -0
  82. package/components/formatted-number.js +13 -0
  83. package/components/formatted-number.js.map +1 -0
  84. package/components/heading.d.ts +23 -0
  85. package/components/heading.js +44 -0
  86. package/components/heading.js.map +1 -0
  87. package/components/icon-swap.d.ts +15 -0
  88. package/components/icon-swap.js +29 -0
  89. package/components/icon-swap.js.map +1 -0
  90. package/components/inline-action.d.ts +21 -0
  91. package/components/inline-action.js +36 -0
  92. package/components/inline-action.js.map +1 -0
  93. package/components/input.d.ts +51 -0
  94. package/components/input.js +52 -0
  95. package/components/input.js.map +1 -0
  96. package/components/kbd.d.ts +17 -0
  97. package/components/kbd.js +34 -0
  98. package/components/kbd.js.map +1 -0
  99. package/components/label.d.ts +10 -0
  100. package/components/label.js +20 -0
  101. package/components/label.js.map +1 -0
  102. package/components/menu.d.ts +77 -0
  103. package/components/menu.js +189 -0
  104. package/components/menu.js.map +1 -0
  105. package/components/nav-button.d.ts +34 -0
  106. package/components/nav-button.js +71 -0
  107. package/components/nav-button.js.map +1 -0
  108. package/components/nav.d.ts +39 -0
  109. package/components/nav.js +68 -0
  110. package/components/nav.js.map +1 -0
  111. package/components/number-input.d.ts +16 -0
  112. package/components/number-input.js +25 -0
  113. package/components/number-input.js.map +1 -0
  114. package/components/page.d.ts +14 -0
  115. package/components/page.js +23 -0
  116. package/components/page.js.map +1 -0
  117. package/components/pagination.d.ts +15 -0
  118. package/components/pagination.js +63 -0
  119. package/components/pagination.js.map +1 -0
  120. package/components/ping.d.ts +38 -0
  121. package/components/ping.js +50 -0
  122. package/components/ping.js.map +1 -0
  123. package/components/popover.d.ts +5 -0
  124. package/components/popover.js +25 -0
  125. package/components/popover.js.map +1 -0
  126. package/components/radio-group.d.ts +35 -0
  127. package/components/radio-group.js +81 -0
  128. package/components/radio-group.js.map +1 -0
  129. package/components/relative-time.d.ts +25 -0
  130. package/components/relative-time.js +51 -0
  131. package/components/relative-time.js.map +1 -0
  132. package/components/saved-mark.d.ts +15 -0
  133. package/components/saved-mark.js +45 -0
  134. package/components/saved-mark.js.map +1 -0
  135. package/components/search-input.d.ts +13 -0
  136. package/components/search-input.js +44 -0
  137. package/components/search-input.js.map +1 -0
  138. package/components/section-header.d.ts +83 -0
  139. package/components/section-header.js +170 -0
  140. package/components/section-header.js.map +1 -0
  141. package/components/segmented-control.d.ts +24 -0
  142. package/components/segmented-control.js +70 -0
  143. package/components/segmented-control.js.map +1 -0
  144. package/components/select.d.ts +28 -0
  145. package/components/select.js +129 -0
  146. package/components/select.js.map +1 -0
  147. package/components/shortcut-keys.d.ts +14 -0
  148. package/components/shortcut-keys.js +32 -0
  149. package/components/shortcut-keys.js.map +1 -0
  150. package/components/shortcuts-dialog.d.ts +10 -0
  151. package/components/shortcuts-dialog.js +92 -0
  152. package/components/shortcuts-dialog.js.map +1 -0
  153. package/components/skeleton.d.ts +8 -0
  154. package/components/skeleton.js +23 -0
  155. package/components/skeleton.js.map +1 -0
  156. package/components/sparkline.d.ts +25 -0
  157. package/components/sparkline.js +70 -0
  158. package/components/sparkline.js.map +1 -0
  159. package/components/stack.d.ts +21 -0
  160. package/components/stack.js +45 -0
  161. package/components/stack.js.map +1 -0
  162. package/components/stat-strip.d.ts +43 -0
  163. package/components/stat-strip.js +151 -0
  164. package/components/stat-strip.js.map +1 -0
  165. package/components/steps.d.ts +19 -0
  166. package/components/steps.js +25 -0
  167. package/components/steps.js.map +1 -0
  168. package/components/switch.d.ts +16 -0
  169. package/components/switch.js +29 -0
  170. package/components/switch.js.map +1 -0
  171. package/components/tabs.d.ts +18 -0
  172. package/components/tabs.js +65 -0
  173. package/components/tabs.js.map +1 -0
  174. package/components/text-link.d.ts +16 -0
  175. package/components/text-link.js +32 -0
  176. package/components/text-link.js.map +1 -0
  177. package/components/textarea.d.ts +10 -0
  178. package/components/textarea.js +23 -0
  179. package/components/textarea.js.map +1 -0
  180. package/components/theme.d.ts +28 -0
  181. package/components/theme.js +158 -0
  182. package/components/theme.js.map +1 -0
  183. package/components/time-series-chart.d.ts +122 -0
  184. package/components/time-series-chart.js +722 -0
  185. package/components/time-series-chart.js.map +1 -0
  186. package/components/toaster.d.ts +3 -0
  187. package/components/toaster.js +44 -0
  188. package/components/toaster.js.map +1 -0
  189. package/components/tooltip.d.ts +64 -0
  190. package/components/tooltip.js +126 -0
  191. package/components/tooltip.js.map +1 -0
  192. package/components/view-picker.d.ts +20 -0
  193. package/components/view-picker.js +24 -0
  194. package/components/view-picker.js.map +1 -0
  195. package/fonts/inter-OFL.txt +93 -0
  196. package/fonts/inter-cyrillic-ext.woff2 +0 -0
  197. package/fonts/inter-cyrillic.woff2 +0 -0
  198. package/fonts/inter-greek-ext.woff2 +0 -0
  199. package/fonts/inter-greek.woff2 +0 -0
  200. package/fonts/inter-latin-ext.woff2 +0 -0
  201. package/fonts/inter-latin.woff2 +0 -0
  202. package/fonts/inter-vietnamese.woff2 +0 -0
  203. package/fonts.css +83 -0
  204. package/lib/animation.d.ts +14 -0
  205. package/lib/animation.js +20 -0
  206. package/lib/animation.js.map +1 -0
  207. package/lib/aria.d.ts +5 -0
  208. package/lib/aria.js +12 -0
  209. package/lib/aria.js.map +1 -0
  210. package/lib/chart-curve.d.ts +13 -0
  211. package/lib/chart-curve.js +79 -0
  212. package/lib/chart-curve.js.map +1 -0
  213. package/lib/classes.d.ts +134 -0
  214. package/lib/classes.js +152 -0
  215. package/lib/classes.js.map +1 -0
  216. package/lib/color.d.ts +25 -0
  217. package/lib/color.js +149 -0
  218. package/lib/color.js.map +1 -0
  219. package/lib/day.d.ts +9 -0
  220. package/lib/day.js +20 -0
  221. package/lib/day.js.map +1 -0
  222. package/lib/design-tokens.d.ts +56 -0
  223. package/lib/design-tokens.js +196 -0
  224. package/lib/design-tokens.js.map +1 -0
  225. package/lib/icon.d.ts +17 -0
  226. package/lib/icon.js +34 -0
  227. package/lib/icon.js.map +1 -0
  228. package/lib/icons.d.ts +23 -0
  229. package/lib/icons.js +28 -0
  230. package/lib/icons.js.map +1 -0
  231. package/lib/interactive.d.ts +21 -0
  232. package/lib/interactive.js +31 -0
  233. package/lib/interactive.js.map +1 -0
  234. package/lib/media.d.ts +58 -0
  235. package/lib/media.js +116 -0
  236. package/lib/media.js.map +1 -0
  237. package/lib/segmented.d.ts +57 -0
  238. package/lib/segmented.js +83 -0
  239. package/lib/segmented.js.map +1 -0
  240. package/lib/shortcuts.d.ts +94 -0
  241. package/lib/shortcuts.js +271 -0
  242. package/lib/shortcuts.js.map +1 -0
  243. package/lib/slot.d.ts +9 -0
  244. package/lib/slot.js +18 -0
  245. package/lib/slot.js.map +1 -0
  246. package/lib/time-series.d.ts +100 -0
  247. package/lib/time-series.js +144 -0
  248. package/lib/time-series.js.map +1 -0
  249. package/lib/tone.d.ts +6 -0
  250. package/lib/tone.js +0 -0
  251. package/lib/variants.d.ts +12 -0
  252. package/lib/variants.js +14 -0
  253. package/lib/variants.js.map +1 -0
  254. package/package.json +116 -4
  255. package/styles.css +619 -0
  256. package/tokens.d.ts +104 -0
  257. package/tokens.js +108 -0
  258. package/tokens.js.map +1 -0
package/styles.css ADDED
@@ -0,0 +1,619 @@
1
+ /*
2
+ * Inter 4 with the opsz axis: text from ~20px up takes the Display cut on its own. The files are
3
+ * cut from Google Fonts' source by `scripts/fonts.py` at the repo root, which keeps the
4
+ * alternates the theme turns on below.
5
+ */
6
+ @import "./fonts.css";
7
+ /* Geist Mono for machine strings: keys, IDs, snippets. Each subset loads only when used. */
8
+ @import "@fontsource-variable/geist-mono";
9
+
10
+ @plugin "tailwindcss-animate";
11
+
12
+ /*
13
+ * Scan this library's own source for utility classes. `@source` resolves relative to
14
+ * THIS stylesheet, so the same directive works in both consumption modes:
15
+ * - built: node_modules/@underpin/ui/dist/styles.css scans the sibling dist folder (.js)
16
+ * - source: @underpin/ui/src/styles.css scans the sibling src folder (.ts, .tsx)
17
+ * Either way the class names baked into the components (bg-canvas,
18
+ * text-ink-muted, the popover animation utilities, etc.) get generated.
19
+ * The consuming app still owns the `@import "tailwindcss"` in its own entry.
20
+ */
21
+ @source "./";
22
+
23
+ /*
24
+ * Every colour is a `light-dark()` pair, resolved by the element's `color-scheme`: unset follows
25
+ * the OS, `[data-theme="dark"|"light"]` forces one (see the base layer below). The set has seven
26
+ * groups, and every token a component uses is one of them:
27
+ * - surfaces (`canvas`, `surface`, `overlay`, `well`, `field`, `knob`): opaque, one per height
28
+ * - ink (`ink`, `ink-secondary`, `ink-muted`, `ink-inverse`): text and icons
29
+ * - fills and edges (`fill-subtle` … `edge-solid`): backgrounds and 1px outlines
30
+ * - brand (`brand`, `-ink`, `-subtle`, `-edge`, `-on`): checked controls, links, the first
31
+ * chart series
32
+ * - focus: the keyboard focus ring alone
33
+ * - status (`success`, `warning`, `danger`, each with `-ink`, `-subtle`, `-edge`, `-on`)
34
+ * - chart series, the scrim and the drops under a shadow
35
+ * Every coloured role takes the same suffixes: the solid, `-ink` for text on the canvas
36
+ * (>= 4.5:1 there), `-subtle` for a tinted fill, `-edge` for the 1px edge around that fill, `-on`
37
+ * for text and icons on the solid.
38
+ *
39
+ * A product built on the package sets its own look in its stylesheet, after this one's import,
40
+ * in its own `@theme` block or a `:root` rule: the gray as two numbers (`--gray-hue` and
41
+ * `--gray-chroma`, first in the theme below), and the accent as the brand tokens (`--color-brand`,
42
+ * `--color-brand-ink`, `--color-brand-subtle`, and `--color-brand-on` for an accent light enough
43
+ * to need dark text). The edge around a brand tint and the first chart series follow the brand.
44
+ */
45
+ @theme {
46
+ --system-font:
47
+ ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
48
+ "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
49
+ "Segoe UI Symbol", "Noto Color Emoji";
50
+
51
+ /*
52
+ * The gray, in two numbers that the ramp and every neutral token read, so none writes a hue of
53
+ * its own: `--gray-hue`, and `--gray-chroma`, which scales the ramp's chroma (1 is the ladder as
54
+ * written, 0 a neutral gray). The default is a warm gray. Both are numbers, not colours, so a
55
+ * product that sets its own writes no colour literal.
56
+ */
57
+ --gray-hue: 80;
58
+ --gray-chroma: 1;
59
+
60
+ /*
61
+ * Surfaces, ink and fills are steps of one gray ramp (`--gray-1` … `--gray-12`, in the base
62
+ * layer), so every neutral in the interface shares one hue. Surfaces sit off the ramp on its
63
+ * hue: white in light, and in dark a lift of about 0.03 per height above the canvas.
64
+ */
65
+ --color-canvas: var(--gray-1);
66
+ --color-surface: light-dark(
67
+ oklch(1 0 0),
68
+ oklch(0.212 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
69
+ );
70
+ --color-overlay: light-dark(
71
+ oklch(1 0 0),
72
+ oklch(0.24 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
73
+ );
74
+ /*
75
+ * Below the surface: the track of a segmented control, a tab row or a switch, and a sunk state.
76
+ * The fill in light; in dark a step under the canvas, so the key on it is the lighter part.
77
+ */
78
+ --color-well: light-dark(
79
+ oklch(0.945 calc(0.004 * var(--gray-chroma)) var(--gray-hue)),
80
+ oklch(0.155 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
81
+ );
82
+ /*
83
+ * The ground of a text field: white in light, the canvas in dark, so it reads as an opening
84
+ * in a card.
85
+ */
86
+ --color-field: light-dark(
87
+ oklch(1 0 0),
88
+ oklch(0.18 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
89
+ );
90
+ /*
91
+ * The switch knob, off and on: white in light, and in dark mid grey on the well and near white
92
+ * on the brand.
93
+ */
94
+ --color-knob: light-dark(
95
+ oklch(1 0 0),
96
+ oklch(0.42 calc(0.006 * var(--gray-chroma)) var(--gray-hue))
97
+ );
98
+ --color-knob-on: light-dark(
99
+ oklch(1 0 0),
100
+ oklch(0.95 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
101
+ );
102
+
103
+ --color-ink: var(--gray-12);
104
+ --color-ink-secondary: var(--gray-11);
105
+ --color-ink-muted: var(--gray-9);
106
+ /* The ink on a solid ink fill: a primary button, a tooltip, a checked neutral control. */
107
+ --color-ink-inverse: var(--gray-1);
108
+
109
+ /*
110
+ * Hover, selected and the code block, pressed. Opaque, so a fill reads the same anywhere and
111
+ * rows slide under a sticky one.
112
+ */
113
+ --color-fill-subtle: var(--gray-2);
114
+ --color-fill: var(--gray-3);
115
+ --color-fill-strong: var(--gray-4);
116
+
117
+ /*
118
+ * Hairlines. Every 1px outline is a `border` in one of these; `border` alone draws `edge`. Each
119
+ * is the ink in light and white in dark at a fraction, so a hairline takes its tone from what it
120
+ * sits on: a card, the canvas, a fill or a tinted callout. Two bordered boxes must not overlap,
121
+ * or the shared line doubles. The strength follows the role: `edge-subtle` a quiet divider,
122
+ * `edge` a card, a dialog or a divider, `edge-strong` anything operated (a field, a button, a
123
+ * raised key, a checkbox), `edge-solid` a control under the pointer, and `edge-float` whatever
124
+ * floats over the page.
125
+ */
126
+ --color-edge-subtle: light-dark(
127
+ color-mix(in oklab, var(--gray-ink) 7%, transparent),
128
+ oklch(1 0 0 / 6.5%)
129
+ );
130
+ --color-edge: light-dark(
131
+ color-mix(in oklab, var(--gray-ink) 10.5%, transparent),
132
+ oklch(1 0 0 / 9.5%)
133
+ );
134
+ --color-edge-strong: light-dark(
135
+ color-mix(in oklab, var(--gray-ink) 14%, transparent),
136
+ oklch(1 0 0 / 15%)
137
+ );
138
+ /* The edge of a control under the pointer: one step past the strong edge. */
139
+ --color-edge-solid: light-dark(
140
+ color-mix(in oklab, var(--gray-ink) 21%, transparent),
141
+ oklch(1 0 0 / 24%)
142
+ );
143
+ /*
144
+ * The edge of a menu, a select's list, a popover, a tooltip or a toast. In light it is `edge`,
145
+ * since the popup's shadow separates it from the page. In dark it is `edge-strong`: a black
146
+ * shadow barely shows on the dark page, and the popup's lighter surface weakens a translucent
147
+ * line, so the edge has to carry the separation alone.
148
+ */
149
+ --color-edge-float: light-dark(
150
+ color-mix(in oklab, var(--gray-ink) 10.5%, transparent),
151
+ oklch(1 0 0 / 15%)
152
+ );
153
+
154
+ /*
155
+ * The brand: the steel blue of the logo. Checked controls, links, the live ping and the first
156
+ * chart series take it. A product swaps the solid, `-ink`, `-subtle` and `-on` for its own
157
+ * accent; the edge and `--color-chart-1` follow them.
158
+ */
159
+ --color-brand: light-dark(oklch(0.52 0.11 245), oklch(0.68 0.11 245));
160
+ --color-brand-ink: light-dark(oklch(0.46 0.11 245), oklch(0.78 0.1 245));
161
+ --color-brand-subtle: light-dark(oklch(0.52 0.11 245 / 10%), oklch(0.68 0.11 245 / 16%));
162
+ --color-brand-edge: color-mix(in oklab, var(--color-brand-ink) 20%, transparent);
163
+ --color-brand-on: light-dark(oklch(1 0 0), var(--gray-ink));
164
+
165
+ /*
166
+ * The keyboard focus ring. A vivid blue of its own, fixed across themes, so a focused
167
+ * control never reads as a checked one and a product's own accent never hides focus.
168
+ */
169
+ --color-focus: light-dark(oklch(0.58 0.2 255), oklch(0.72 0.16 255));
170
+
171
+ /*
172
+ * Status. Every solid is dark enough in light for white and light enough in dark for the dark
173
+ * ink, so `-on` flips with the theme. The light solids sit at L 0.54 to 0.57 for that, darker
174
+ * than a bright green or amber, so the label on a solid badge reaches 4.5:1.
175
+ */
176
+ --color-success: light-dark(oklch(0.54 0.15 150), oklch(0.72 0.16 152));
177
+ --color-success-ink: light-dark(oklch(0.5 0.14 150), oklch(0.78 0.15 152));
178
+ --color-success-subtle: light-dark(oklch(0.62 0.16 150 / 10%), oklch(0.72 0.16 152 / 14%));
179
+ --color-success-edge: color-mix(in oklab, var(--color-success-ink) 20%, transparent);
180
+ --color-success-on: light-dark(oklch(1 0 0), var(--gray-ink));
181
+ --color-warning: light-dark(oklch(0.57 0.15 62), oklch(0.8 0.16 75));
182
+ --color-warning-ink: light-dark(oklch(0.54 0.16 49), oklch(0.83 0.17 85));
183
+ --color-warning-subtle: light-dark(oklch(0.77 0.17 70 / 14%), oklch(0.8 0.16 75 / 14%));
184
+ --color-warning-edge: color-mix(in oklab, var(--color-warning-ink) 20%, transparent);
185
+ --color-warning-on: light-dark(oklch(1 0 0), var(--gray-ink));
186
+ --color-danger: light-dark(oklch(0.56 0.19 25), oklch(0.7 0.19 22));
187
+ --color-danger-ink: light-dark(oklch(0.51 0.2 27), oklch(0.77 0.16 22));
188
+ --color-danger-subtle: light-dark(oklch(0.56 0.19 25 / 10%), oklch(0.7 0.19 22 / 14%));
189
+ --color-danger-edge: color-mix(in oklab, var(--color-danger-ink) 20%, transparent);
190
+ --color-danger-on: light-dark(oklch(1 0 0), var(--gray-ink));
191
+
192
+ /* Categorical chart palette: the brand first, then four hues far enough apart to read as different series. */
193
+ --color-chart-1: var(--color-brand);
194
+ --color-chart-2: light-dark(oklch(0.62 0.13 158), oklch(0.77 0.16 158));
195
+ --color-chart-3: light-dark(oklch(0.64 0.15 70), oklch(0.8 0.16 75));
196
+ --color-chart-4: light-dark(oklch(0.55 0.15 300), oklch(0.7 0.15 300));
197
+ --color-chart-5: light-dark(oklch(0.58 0.17 25), oklch(0.7 0.17 25));
198
+
199
+ /*
200
+ * The page behind a dialog or a sheet, unblurred. In light the fill at 80%: the page fades back
201
+ * rather than darkening, so the dialog stays the lightest surface. In dark black at 50%, since a
202
+ * lighter veil would lift the page above the dialog.
203
+ */
204
+ --color-scrim: light-dark(
205
+ oklch(0.945 calc(0.004 * var(--gray-chroma)) var(--gray-hue) / 80%),
206
+ oklch(0 0 0 / 50%)
207
+ );
208
+
209
+ /*
210
+ * The shadow under a raised surface and inside a sunken one. Black at both themes, stronger in
211
+ * dark, where a drop must stay darker than the surface it falls on. `drop` is the crisp 1px
212
+ * contact shadow, kept light so it does not read as a second line under the border. `drop-soft`
213
+ * is the short second layer under a card, and a well's inner shadow. `drop-strong` is the second
214
+ * layer under anything that floats over the page, and `drop-ambient` its faint long third layer.
215
+ */
216
+ --color-drop: light-dark(oklch(0 0 0 / 7%), oklch(0 0 0 / 50%));
217
+ --color-drop-soft: light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 40%));
218
+ --color-drop-strong: light-dark(oklch(0 0 0 / 14%), oklch(0 0 0 / 50%));
219
+ --color-drop-ambient: light-dark(oklch(0 0 0 / 8%), oklch(0 0 0 / 40%));
220
+
221
+ /*
222
+ * Depth only. An outline is a `border` in an edge colour, so a state that changes one never
223
+ * restates the other. Anything resting on the page takes the crisp 1px drop and at most one
224
+ * short layer, whose negative spread keeps it under the surface: no long soft blur, which reads
225
+ * as a glow rather than as an object resting on the page. Only what floats over the page, a
226
+ * popup, a dialog or a drawer, adds one faint long layer, so it separates from a busy chart or
227
+ * table beneath it. `control` lifts a button, a checkbox, a radio, a switch's knob or a picker's
228
+ * chosen option, and a press takes it away. `well` is anything sunk into its surface, and light
229
+ * falls from above, so its top edge is the dark one. `card` is a resting panel and `card-hover`
230
+ * a clickable card under the pointer. `popup` holds a menu, select or popover over the page,
231
+ * `tooltip` is the same idea at caption size, `modal` a dialog or bottom sheet, and `drawer` the
232
+ * modal shadow cast sideways.
233
+ */
234
+ --shadow-control: 0 1px 2px var(--color-drop);
235
+ --shadow-well: inset 0 1px 2px var(--color-drop-soft);
236
+ --shadow-card: 0 1px 2px var(--color-drop), 0 3px 4px -2px var(--color-drop-soft);
237
+ --shadow-card-hover: 0 1px 2px var(--color-drop), 0 5px 6px -3px var(--color-drop-soft);
238
+ --shadow-popup:
239
+ 0 1px 2px var(--color-drop), 0 4px 8px -4px var(--color-drop-strong),
240
+ 0 16px 24px -8px var(--color-drop-ambient);
241
+ --shadow-tooltip: 0 1px 2px var(--color-drop), 0 3px 6px -3px var(--color-drop-strong);
242
+ --shadow-modal:
243
+ 0 1px 2px var(--color-drop), 0 6px 8px -4px var(--color-drop-strong),
244
+ 0 24px 48px -12px var(--color-drop-ambient);
245
+ --shadow-drawer:
246
+ 1px 0 2px var(--color-drop), 6px 0 8px -4px var(--color-drop-strong),
247
+ 24px 0 48px -12px var(--color-drop-ambient);
248
+
249
+ --tracking-micro: -0.0125em;
250
+
251
+ /*
252
+ * The type scale. Every size carries its line height, so `text-copy` alone is the agreed
253
+ * pair and a `/leading` suffix marks a deliberate exception (`text-xs/5`). Tailwind's own
254
+ * steps keep their pairs: xs 12/16, sm 14/20, base 16/24, xl 20/28, 2xl 24/32, 3xl 30/36,
255
+ * 4xl 36/40.
256
+ *
257
+ * 13px has two jobs and a line for each. `control` (13/16) is a single line inside a
258
+ * control: buttons, inputs, select triggers, menu items, tabs, toasts. Its whole 16px line
259
+ * lands a field's padding on the control scale below, 6px for sm and 8px for md. `copy`
260
+ * (13/20) is text to read: a description, a callout, a textarea.
261
+ *
262
+ * `2xs` (11/14) is the smallest label: an eyebrow, a chart tick, a weekday, a count.
263
+ * `figure` (28px, 1.3) is a headline number; `figureClasses` carries its weight and
264
+ * tracking, and a fluid or smaller figure keeps those and sets its own size.
265
+ */
266
+ --text-2xs: 0.6875rem;
267
+ --text-2xs--line-height: 0.875rem;
268
+ --text-control: 0.8125rem;
269
+ --text-control--line-height: 1rem;
270
+ --text-copy: 0.8125rem;
271
+ --text-copy--line-height: 1.25rem;
272
+ --text-figure: 1.75rem;
273
+ --text-figure--line-height: var(--leading-figure);
274
+ --leading-figure: 1.3;
275
+ --tracking-figure: -0.02em;
276
+
277
+ /*
278
+ * Corner radii, one step rounder than Tailwind's own. Each step is two pixels past the one
279
+ * below it from sm up, so a part inset into its parent nests concentric: a switch knob or a
280
+ * field's button 2px in takes `sm` inside `md`, and a menu row in a popup's 4px padding takes
281
+ * `sm` inside `lg`. A bare `rounded` is `sm`. A field, a button and a tooltip take `md`, a card
282
+ * and a popup `lg`, a dialog `xl`.
283
+ */
284
+ --radius: 6px;
285
+ --radius-xs: 4px;
286
+ --radius-sm: 6px;
287
+ --radius-md: 8px;
288
+ --radius-lg: 10px;
289
+ --radius-xl: 14px;
290
+
291
+ /*
292
+ * The control scale, on the 4px grid and shared by every control, so two controls of one
293
+ * size always line up: xs 24px (inside a row or a menu), sm 28px (card headers, toolbars),
294
+ * md 32px (the default), lg 36px (auth forms, a page's main action). Text runs 12, 12, 13
295
+ * and 14px. md is spelled `h-control` / `min-h-control` so the number lives in one place;
296
+ * the others are `h-6`, `h-7` and `h-9`.
297
+ */
298
+ --spacing-control: 32px;
299
+
300
+ --font-sans: "Inter Variable", var(--system-font);
301
+ --font-display: "Inter Variable", var(--system-font);
302
+ /*
303
+ * Inter's alternates: a one without its flag (`cv01`), a single-storey a (`cv11`) and round
304
+ * quotes and commas (`ss03`). Mono text resets them, so a key or a snippet keeps Geist Mono's
305
+ * own letters.
306
+ */
307
+ --font-sans--font-feature-settings: "cv01", "cv11", "ss03";
308
+ --font-display--font-feature-settings: "cv01", "cv11", "ss03";
309
+ --font-mono--font-feature-settings: normal;
310
+ /* Geist Mono, the same face the design file uses, so a key or a snippet reads alike on every
311
+ platform. The app loads it; the platform mono stands in until it has. */
312
+ --font-mono:
313
+ "Geist Mono Variable", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
314
+ "Liberation Mono", monospace;
315
+ /* The platform's own UI font, for the glyphs it draws better than a webfont does: ⇧ ⌘ ⌥ ⌃
316
+ are part of SF Pro's job on a Mac, and Inter's arrows sit light and small beside a letter. */
317
+ --font-system: var(--system-font);
318
+
319
+ /* The main motion curve: popups, tab pills, chart updates, step bars. */
320
+ --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
321
+ /* A small mark changing state in place: an icon swap, a saved tick. */
322
+ --ease-swap: cubic-bezier(0.2, 0, 0, 1);
323
+ /* A sheet or side panel, which rides the same curve as the swipe that moves it. */
324
+ --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
325
+
326
+ --animate-fill-bar: fill-bar 0.5s var(--ease-out-expo);
327
+ --animate-slide-up-and-fade: slide-up-and-fade 0.5s var(--ease-out-expo);
328
+ --animate-slide-down-and-fade: slide-down-and-fade 0.5s var(--ease-out-expo);
329
+ --animate-wipe-in: wipe-in 0.5s var(--ease-out-expo);
330
+
331
+ @keyframes slide-up-and-fade {
332
+ from {
333
+ opacity: 0;
334
+ transform: translateY(8px);
335
+ }
336
+ to {
337
+ opacity: 1;
338
+ transform: translateY(0);
339
+ }
340
+ }
341
+
342
+ @keyframes slide-down-and-fade {
343
+ from {
344
+ opacity: 0;
345
+ transform: translateY(-8px);
346
+ }
347
+ to {
348
+ opacity: 1;
349
+ transform: translateY(0);
350
+ }
351
+ }
352
+
353
+ @keyframes fill-bar {
354
+ from {
355
+ transform: scaleX(0);
356
+ }
357
+ to {
358
+ transform: scaleX(1);
359
+ }
360
+ }
361
+
362
+ /* Revealed from the left edge, as if drawn. */
363
+ @keyframes wipe-in {
364
+ from {
365
+ clip-path: inset(0 100% 0 0);
366
+ }
367
+ to {
368
+ clip-path: inset(0 0 0 0);
369
+ }
370
+ }
371
+ }
372
+
373
+ /*
374
+ * Base helpers the components depend on to render correctly, and the rules every consuming
375
+ * app shares: the pointer on controls and reduced motion. Kept minimal on purpose; the
376
+ * consuming app still supplies its body reset, its page `container` and `@import "tailwindcss"`.
377
+ */
378
+ @layer base {
379
+ /* Theme switch: unset follows the OS, `data-theme` forces one. Drives every `light-dark()`. */
380
+ :root {
381
+ color-scheme: light dark;
382
+ }
383
+
384
+ [data-theme="light"] {
385
+ color-scheme: light;
386
+ }
387
+
388
+ [data-theme="dark"] {
389
+ color-scheme: dark;
390
+ }
391
+
392
+ /*
393
+ * The gray ramp under every neutral token. One hue, chroma rising toward the middle and falling
394
+ * off at both ends, so all twelve steps read as one family; dark keeps its chroma low, so the
395
+ * surfaces read as charcoal rather than coloured. Step 1 is the canvas and step 12 the ink in
396
+ * both themes: 2–4 are fills (hover, selected, pressed, spaced so each reads apart from the
397
+ * next), 5–8 the solid greys behind the translucent edges, 9 muted ink, 10 muted ink under the
398
+ * pointer, 11 secondary ink. Dark ink stops short of white, which glares on the dark canvas.
399
+ * Components never use a step directly; they use the token that names its job.
400
+ */
401
+ :root {
402
+ --gray-1: light-dark(
403
+ oklch(0.985 calc(0.002 * var(--gray-chroma)) var(--gray-hue)),
404
+ oklch(0.18 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
405
+ );
406
+ --gray-2: light-dark(
407
+ oklch(0.965 calc(0.003 * var(--gray-chroma)) var(--gray-hue)),
408
+ oklch(0.25 calc(0.004 * var(--gray-chroma)) var(--gray-hue))
409
+ );
410
+ --gray-3: light-dark(
411
+ oklch(0.945 calc(0.004 * var(--gray-chroma)) var(--gray-hue)),
412
+ oklch(0.278 calc(0.004 * var(--gray-chroma)) var(--gray-hue))
413
+ );
414
+ --gray-4: light-dark(
415
+ oklch(0.92 calc(0.005 * var(--gray-chroma)) var(--gray-hue)),
416
+ oklch(0.305 calc(0.005 * var(--gray-chroma)) var(--gray-hue))
417
+ );
418
+ --gray-5: light-dark(
419
+ oklch(0.9 calc(0.005 * var(--gray-chroma)) var(--gray-hue)),
420
+ oklch(0.33 calc(0.005 * var(--gray-chroma)) var(--gray-hue))
421
+ );
422
+ --gray-6: light-dark(
423
+ oklch(0.875 calc(0.006 * var(--gray-chroma)) var(--gray-hue)),
424
+ oklch(0.36 calc(0.006 * var(--gray-chroma)) var(--gray-hue))
425
+ );
426
+ --gray-7: light-dark(
427
+ oklch(0.83 calc(0.007 * var(--gray-chroma)) var(--gray-hue)),
428
+ oklch(0.42 calc(0.006 * var(--gray-chroma)) var(--gray-hue))
429
+ );
430
+ --gray-8: light-dark(
431
+ oklch(0.72 calc(0.008 * var(--gray-chroma)) var(--gray-hue)),
432
+ oklch(0.52 calc(0.006 * var(--gray-chroma)) var(--gray-hue))
433
+ );
434
+ --gray-9: light-dark(
435
+ oklch(0.52 calc(0.009 * var(--gray-chroma)) var(--gray-hue)),
436
+ oklch(0.78 calc(0.005 * var(--gray-chroma)) var(--gray-hue))
437
+ );
438
+ --gray-10: light-dark(
439
+ oklch(0.45 calc(0.009 * var(--gray-chroma)) var(--gray-hue)),
440
+ oklch(0.82 calc(0.005 * var(--gray-chroma)) var(--gray-hue))
441
+ );
442
+ --gray-11: light-dark(
443
+ oklch(0.37 calc(0.008 * var(--gray-chroma)) var(--gray-hue)),
444
+ oklch(0.86 calc(0.004 * var(--gray-chroma)) var(--gray-hue))
445
+ );
446
+ --gray-12: light-dark(
447
+ var(--gray-ink),
448
+ oklch(0.95 calc(0.003 * var(--gray-chroma)) var(--gray-hue))
449
+ );
450
+
451
+ /*
452
+ * Step 12 of the light ramp as one colour rather than a pair: every edge in light is this ink
453
+ * at a fraction, and the text on a solid in dark is this ink whole.
454
+ */
455
+ --gray-ink: oklch(0.21 calc(0.006 * var(--gray-chroma)) var(--gray-hue));
456
+ }
457
+
458
+ /*
459
+ * No lone word on a paragraph's last line. The longhand leaves wrap modes (`nowrap`,
460
+ * `truncate`) alone, and headings keep their `text-balance`. Browsers apply it to editable
461
+ * text too, where it moves words between lines while typing, so fields and code opt out.
462
+ */
463
+ :root {
464
+ text-wrap-style: pretty;
465
+ }
466
+
467
+ input,
468
+ textarea,
469
+ select,
470
+ [contenteditable]:not([contenteditable="false"]),
471
+ pre,
472
+ code {
473
+ text-wrap-style: auto;
474
+ }
475
+
476
+ /* Tailwind v4 defaults `border` to currentColor; the components expect the hairline token. */
477
+ *,
478
+ ::before,
479
+ ::after {
480
+ border-color: var(--color-edge);
481
+ }
482
+
483
+ /* No grey flash from the OS on tap; the `:active` rule below is the feedback instead. */
484
+ * {
485
+ -webkit-tap-highlight-color: transparent;
486
+ }
487
+
488
+ /*
489
+ * The one focus ring, wherever the browser judges focus worth showing (`:focus-visible`): a
490
+ * key press, or a text field however it took focus. Every control, row, link and cell draws the
491
+ * same 2px ring over its own edge, 1px in and 1px out with no gap, so focus reads as the edge
492
+ * turning blue, and a row flush with a surface that clips keeps it whole. Popups and menu items
493
+ * opt out with `outline-none`.
494
+ */
495
+ :focus-visible {
496
+ outline: 2px solid var(--color-focus);
497
+ outline-offset: -1px;
498
+ }
499
+
500
+ /* The ring covers an invalid control's danger edge, so it takes the danger colour instead. */
501
+ [aria-invalid="true"]:focus-visible {
502
+ outline-color: var(--color-danger);
503
+ }
504
+
505
+ /*
506
+ * A disabled control takes no pointer: no hover look, no press, no cursor of its own. Base UI
507
+ * marks a disabled switch, tab or select trigger with `data-disabled` alone, since none of them
508
+ * is a native control. Two kinds keep the pointer, so a reason can show on hover: a control
509
+ * under `DisabledReason`, which is `aria-disabled` rather than disabled, and a disabled menu
510
+ * row, select option, radio or checkbox, which Base UI already keeps from acting.
511
+ */
512
+ :is(button, input, select, textarea):disabled,
513
+ :is(a, [role="button"], [role="switch"], [role="tab"], [role="combobox"])[data-disabled] {
514
+ pointer-events: none;
515
+ }
516
+
517
+ /* Taps fire at once, with no double-tap-to-zoom wait, on anything that acts like a control. */
518
+ a[href],
519
+ button,
520
+ [role="button"],
521
+ [role="tab"],
522
+ [role="menuitem"],
523
+ [role="option"] {
524
+ touch-action: manipulation;
525
+ }
526
+
527
+ /*
528
+ * Tap feedback. `hover:` is gated behind `@media (hover: hover)`, so on a touch screen a
529
+ * press would look inert; one rule dims every control the same amount, whatever its size.
530
+ * A control that moves under a press (`data-pressable`) already answers, so it stays solid.
531
+ */
532
+ @media (pointer: coarse) {
533
+ :is(
534
+ button,
535
+ [role="button"],
536
+ [role="tab"],
537
+ [role="menuitem"],
538
+ [role="option"],
539
+ a[href],
540
+ label[for]
541
+ ):active:not(:disabled, [aria-disabled="true"], [data-disabled], [data-pressable]) {
542
+ opacity: 0.6;
543
+ }
544
+ }
545
+
546
+ a,
547
+ button:not(:disabled),
548
+ label[for] {
549
+ cursor: pointer;
550
+ }
551
+
552
+ /*
553
+ * Less motion, not none. A reader who asks for reduced motion is asking for nothing to
554
+ * travel across the screen; a fade still explains that a dialog opened or a toast arrived,
555
+ * and stripping it leaves popups snapping in and out with no sense of where they came from.
556
+ * So movement goes and opacity and colour stay, at their authored timing.
557
+ */
558
+ @media (prefers-reduced-motion: reduce) {
559
+ *,
560
+ ::before,
561
+ ::after {
562
+ /* `tailwindcss-animate` builds its enter/exit keyframe out of these four pairs, so
563
+ flattening them leaves every popup's fade and drops its slide and its zoom. A
564
+ keyframe of this library's own (a bar fill, a step bar) opts out with
565
+ `motion-reduce:animate-none` instead; a spinner keeps turning, since a still one
566
+ reads as a hung page. */
567
+ --tw-enter-translate-x: 0 !important;
568
+ --tw-enter-translate-y: 0 !important;
569
+ --tw-exit-translate-x: 0 !important;
570
+ --tw-exit-translate-y: 0 !important;
571
+ --tw-enter-scale: 1 !important;
572
+ --tw-exit-scale: 1 !important;
573
+ --tw-enter-rotate: 0 !important;
574
+ --tw-exit-rotate: 0 !important;
575
+
576
+ /* Transitions are narrowed to the properties that do not move anything: a transform,
577
+ a width, an inset or a clip-path jumps straight to its end value. */
578
+ transition-property:
579
+ opacity, color, background-color, border-color, outline-color, box-shadow, fill, stroke !important;
580
+ scroll-behavior: auto !important;
581
+ }
582
+
583
+ /* The view-transition pseudo-elements sit outside `*`; without animations they end at once. */
584
+ ::view-transition-group(*),
585
+ ::view-transition-old(*),
586
+ ::view-transition-new(*) {
587
+ animation: none !important;
588
+ }
589
+ }
590
+ }
591
+
592
+ /*
593
+ * One tooltip popup serves every trigger in the app, so moving the pointer from one trigger to
594
+ * the next slides the panel over instead of closing it and opening another in place. Only the
595
+ * move is animated: the content swaps at once, since a tooltip that reads as one panel changing
596
+ * what it says beats one that carries words across the screen. `data-instant` is Base UI asking
597
+ * for no animation at all (a keyboard focus, a dismissal), and both rules step aside for it.
598
+ */
599
+ @layer components {
600
+ .tooltip-positioner {
601
+ transition:
602
+ top 150ms var(--ease-out-expo),
603
+ left 150ms var(--ease-out-expo),
604
+ right 150ms var(--ease-out-expo),
605
+ bottom 150ms var(--ease-out-expo),
606
+ transform 150ms var(--ease-out-expo);
607
+ }
608
+
609
+ /* Base UI slides the arrow along the panel's edge to stay over the anchor. */
610
+ .tooltip-arrow {
611
+ transition:
612
+ left 150ms var(--ease-out-expo),
613
+ top 150ms var(--ease-out-expo);
614
+ }
615
+
616
+ :is(.tooltip-positioner, .tooltip-arrow)[data-instant] {
617
+ transition: none;
618
+ }
619
+ }