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