@valiify/dashboard-ui 0.1.0-alpha.1

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 (61) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/LICENSE +21 -0
  3. package/README.md +373 -0
  4. package/dist/index.css +3743 -0
  5. package/package.json +82 -0
  6. package/src/base/index.css +21 -0
  7. package/src/components/ICON-SYSTEM.md +425 -0
  8. package/src/components/_template.css +109 -0
  9. package/src/components/alert.css +156 -0
  10. package/src/components/avatar.css +87 -0
  11. package/src/components/breadcrumbs.css +158 -0
  12. package/src/components/button.css +177 -0
  13. package/src/components/card.css +63 -0
  14. package/src/components/checkbox.css +181 -0
  15. package/src/components/chip.css +234 -0
  16. package/src/components/data-row.css +142 -0
  17. package/src/components/divider.css +143 -0
  18. package/src/components/dropdown-field.css +185 -0
  19. package/src/components/dropdown-menu.css +80 -0
  20. package/src/components/field-verification.css +156 -0
  21. package/src/components/filter-segment.css +163 -0
  22. package/src/components/icon-button.css +83 -0
  23. package/src/components/icon.css +145 -0
  24. package/src/components/index.css +47 -0
  25. package/src/components/input.css +180 -0
  26. package/src/components/link.css +183 -0
  27. package/src/components/loading-indicator.css +184 -0
  28. package/src/components/loading-inline.css +75 -0
  29. package/src/components/menu-item.css +138 -0
  30. package/src/components/modal.css +203 -0
  31. package/src/components/navigation-rail.css +558 -0
  32. package/src/components/pagination-item.css +196 -0
  33. package/src/components/pagination.css +108 -0
  34. package/src/components/pill.css +108 -0
  35. package/src/components/progress-bar.css +157 -0
  36. package/src/components/radio-select.css +97 -0
  37. package/src/components/section-marker.css +96 -0
  38. package/src/components/segment-selector.css +78 -0
  39. package/src/components/sensitive-data.css +77 -0
  40. package/src/components/skeleton.css +184 -0
  41. package/src/components/step.css +106 -0
  42. package/src/components/stepper.css +93 -0
  43. package/src/components/switch.css +99 -0
  44. package/src/components/tabs.css +213 -0
  45. package/src/components/tag.css +133 -0
  46. package/src/components/text-button.css +170 -0
  47. package/src/components/textarea.css +156 -0
  48. package/src/components/toast.css +182 -0
  49. package/src/components/tooltip.css +70 -0
  50. package/src/fonts.css +23 -0
  51. package/src/icons/README.md +297 -0
  52. package/src/icons/custom/help.svg +3 -0
  53. package/src/icons/custom/valiify-logo.svg +6 -0
  54. package/src/icons/icon-list.txt +2036 -0
  55. package/src/icons/sprite.svg +12223 -0
  56. package/src/index.css +35 -0
  57. package/src/library.css +34 -0
  58. package/src/themes/valiify.css +319 -0
  59. package/src/utilities/index.css +35 -0
  60. package/types/components.d.ts +630 -0
  61. package/types/index.d.ts +15 -0
package/src/index.css ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Valiify Dashboard UI — build entry for the prebuilt dist/index.css.
3
+ *
4
+ * This file is NOT the consumer entry point. It wraps src/library.css with
5
+ * Tailwind so the result is a self-contained compiled stylesheet.
6
+ *
7
+ * src/library.css -> `@valiify/dashboard-ui/source` (consumers + their Tailwind)
8
+ * src/index.css -> `dist/index.css` (prebuilt)
9
+ *
10
+ * NO font import here, on purpose. CSS requires every `@import` to precede all
11
+ * other rules, so a font import baked into the bundle is fine only while the
12
+ * bundle is used standalone — the moment a consumer does
13
+ * `@import "@valiify/dashboard-ui"` it lands mid-file and the browser discards
14
+ * it. Verified against a real packed install: it ended up after 44 rules.
15
+ * Fonts are opt-in via `@valiify/dashboard-ui/fonts` (see src/fonts.css).
16
+ */
17
+
18
+ /*
19
+ * Tailwind first, so its layers are established before ours.
20
+ *
21
+ * source(none) disables automatic content detection. Without it Tailwind scans
22
+ * the whole repo — including CLAUDE.md and this file's own comments — and emits
23
+ * a real utility class for every class-shaped string it finds, so documentation
24
+ * prose leaks into the published artifact.
25
+ *
26
+ * The library ships tokens plus component classes only. @apply inside our
27
+ * components still resolves normally; it does not depend on source detection.
28
+ * Storybook re-adds sources explicitly in .storybook/preview.css.
29
+ *
30
+ * Verified: source(none) is scoped to this import and does NOT disable content
31
+ * detection for consumers who import src/library.css into their own build.
32
+ */
33
+ @import "tailwindcss" source(none);
34
+
35
+ @import "./library.css";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Valiify Dashboard UI — library source.
3
+ *
4
+ * This is the `@valiify/dashboard-ui/source` entry point: the design tokens and
5
+ * component classes, with NO `@import "tailwindcss"` and NO webfont import of
6
+ * its own.
7
+ *
8
+ * Consumers import this into their own stylesheet so that THEIR Tailwind build
9
+ * processes our `@theme` block and generates token-derived utilities
10
+ * (`bg-approved`, `rounded-pill`, `type-label-l`, …):
11
+ *
12
+ * @import "tailwindcss";
13
+ * @import "@valiify/dashboard-ui/source";
14
+ *
15
+ * Two deliberate omissions:
16
+ *
17
+ * 1. No `@import "tailwindcss"`. The consumer owns that line, so their config,
18
+ * plugins, and content detection stay in charge.
19
+ *
20
+ * 2. No font `@import`. CSS requires every `@import` to precede all other
21
+ * rules, and a nested one lands mid-file and is silently discarded — so
22
+ * putting it here would produce invalid CSS in the consumer's bundle. It
23
+ * would also force a Google Fonts request they never asked for. Consumers on
24
+ * this path load Inter and JetBrains Mono themselves.
25
+ *
26
+ * src/index.css wraps this file to build the standalone dist/index.css, which
27
+ * DOES include the font import (at a valid position) so the compiled artifact
28
+ * works on its own.
29
+ */
30
+
31
+ @import "./themes/valiify.css";
32
+ @import "./base/index.css";
33
+ @import "./components/index.css";
34
+ @import "./utilities/index.css";
@@ -0,0 +1,319 @@
1
+ /**
2
+ * Valiify Dashboard Theme — REAL design tokens from Figma.
3
+ *
4
+ * GENERATED FILE — do not edit by hand.
5
+ * Source: tokens/figma-tokens.json
6
+ * Generator: scripts/build-theme.mjs (npm run build:theme)
7
+ *
8
+ * Figma: Valiify-Dashboard-Component-Library (FdcEV83HPv44bzLPAQU1hR)
9
+ *
10
+ * Declared in Tailwind's `@theme` so every token generates utilities:
11
+ * --color-primary -> bg-primary, text-primary, border-primary
12
+ * --radius-control -> rounded-control
13
+ * --text-body-1 -> text-body-1 (size + line-height + weight + tracking)
14
+ *
15
+ * Prefer those utilities over hand-written var().
16
+ *
17
+ * Colors are OKLCh; the source hex follows each line so values stay
18
+ * diffable against Figma. See scripts/build-theme.mjs for the round-trip
19
+ * assertion that guards the conversion.
20
+ *
21
+ * V1 is a single light theme, so tokens live at the root with no
22
+ * [data-theme] wrapper.
23
+ */
24
+
25
+ @theme static {
26
+ /* Brand primary */
27
+ --color-primary: oklch(0.4234 0.1163 256.9); /* #1e4d8c */
28
+ --color-primary-dark: oklch(0.3509 0.0948 257.07); /* #163a6b */
29
+ --color-primary-pressed: oklch(0.3126 0.0825 247.19); /* #003358 */
30
+ --color-primary-soft: oklch(0.4234 0.1163 256.9 / 0.078); /* #1e4d8c14 */
31
+ --color-primary-disabled: oklch(0.4234 0.1163 256.9 / 0.4); /* #1e4d8c66 */
32
+
33
+ /* Brand secondary */
34
+ --color-secondary: oklch(0.4759 0.0208 285.58); /* #5b5b68 */
35
+ --color-secondary-strong: oklch(0.428 0.018 285.61); /* #4e4e59 */
36
+ --color-secondary-soft: oklch(0.637 0.0163 285.93 / 0.09); /* #8a8a9517 */
37
+ --color-secondary-disabled: oklch(0.637 0.0163 285.93 / 0.4); /* #8a8a9566 */
38
+
39
+ /* Content (text / ink) */
40
+ --color-content-primary: oklch(0.202 0.0079 285.67); /* #16161a */
41
+ --color-content-secondary: oklch(0.4759 0.0208 285.58); /* #5b5b68 */
42
+ --color-content-tertiary: oklch(0.5569 0.0215 285.68); /* #727280 */
43
+ --color-content-faint: oklch(0.8233 0.0139 286.09); /* #c4c4ce */
44
+ --color-content-contrast: oklch(1 0 0); /* #ffffff */
45
+
46
+ /* Surface stack (back to front) */
47
+ --color-surface-frame: oklch(0.963 0.0062 255.48); /* #f0f3f7 */
48
+ --color-surface-neutral: oklch(0.959 0.004 286.32); /* #f1f1f4 */
49
+ --color-surface-card: oklch(0.9854 0.0013 286.38); /* #fafafb */
50
+ --color-surface-paper: oklch(1 0 0); /* #ffffff */
51
+
52
+ /* Stroke colors — widths are --border-* below */
53
+ --color-stroke-divider: oklch(0.2027 0.0395 282.3 / 0.078); /* #14142814 */
54
+ --color-stroke-border: oklch(0.2027 0.0395 282.3 / 0.129); /* #14142821 */
55
+ --color-stroke-disabled: oklch(0.2027 0.0395 282.3 / 0.039); /* #1414280a */
56
+
57
+ /* Action overlays (interaction states) */
58
+ --color-action-subtle: oklch(0.2027 0.0395 282.3 / 0.031); /* #14142808 */
59
+ --color-action-hover: oklch(0.2027 0.0395 282.3 / 0.059); /* #1414280f */
60
+ --color-action-selected: oklch(0.2027 0.0395 282.3 / 0.078); /* #14142814 */
61
+ --color-action-focused: oklch(0.2027 0.0395 282.3 / 0.129); /* #14142821 */
62
+
63
+ /* Status — approved */
64
+ --color-approved: oklch(0.5269 0.0996 169.13); /* #157d61 */
65
+ --color-approved-soft: oklch(0.6154 0.1179 168.68 / 0.09); /* #1a9b7817 */
66
+ --color-approved-strong: oklch(0.5508 0.1048 168.92); /* #168567 */
67
+ --color-approved-content: oklch(0.4993 0.095 168.47); /* #137459 */
68
+
69
+ /* Status — critical */
70
+ --color-critical: oklch(0.5458 0.1847 21.87); /* #c5303c */
71
+ --color-critical-soft: oklch(0.5994 0.1849 20.33 / 0.09); /* #d8434f17 */
72
+ --color-critical-strong: oklch(0.5379 0.1636 20.28); /* #ba3a44 */
73
+ --color-critical-content: oklch(0.5316 0.1616 20.19); /* #b73943 */
74
+
75
+ /* Status — warning */
76
+ --color-warning: oklch(0.6765 0.1352 72.89); /* #c9881f */
77
+ --color-warning-soft: oklch(0.6765 0.1352 72.89 / 0.09); /* #c9881f17 */
78
+
79
+ /* Status — neutral */
80
+ --color-neutral: oklch(0.6871 0.0189 285.89); /* #9999a6 */
81
+ --color-neutral-strong: oklch(0.428 0.018 285.61); /* #4e4e59 */
82
+ --color-neutral-soft: oklch(0.6871 0.0189 285.89 / 0.09); /* #9999a617 */
83
+ --color-neutral-content: oklch(0.5099 0.0141 285.89); /* #65656e */
84
+
85
+ /* UnGrouped one-offs */
86
+ --color-misc-purple: oklch(0.5425 0.1143 300.99); /* #7b5ea7 */
87
+
88
+ /*
89
+ * Radii — named by ROLE, not by Figma's t-shirt size. Tailwind v4 ships
90
+ * --radius-xs/-sm/-md itself; redefining those would silently change
91
+ * rounded-xs/-sm/-md for consumers.
92
+ */
93
+ --radius-micro: 2px; /* Radius/Micro — indicators, bars */
94
+ --radius-tight: 4px; /* Radius/XS — tags, badges */
95
+ --radius-control: 6px; /* Radius/SM — buttons, inputs */
96
+ --radius-surface: 8px; /* Radius/MD — cards, panels */
97
+ --radius-pill: 9999px; /* Radius/Rounded — avatars, pills */
98
+
99
+ /* Border widths — no Tailwind namespace, so used via border-[length:var(...)] */
100
+ --border-thin: 0.5px; /* Stroke/Thin */
101
+ --border-line: 1px; /* Stroke/Line */
102
+ --border-micro: 2px; /* Stroke/Micro */
103
+
104
+ /* Font families */
105
+ --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
106
+ Roboto, 'Helvetica Neue', Arial, sans-serif;
107
+ --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code',
108
+ 'Roboto Mono', Consolas, 'Courier New', monospace;
109
+
110
+ /*
111
+ * Text styles — composite tokens, so one utility carries size,
112
+ * line-height, weight and tracking.
113
+ *
114
+ * `line-height: normal` is Figma's "Auto": the font's own metrics
115
+ * (~1.21x for Inter). The API reports Auto as the sentinel 100, which does
116
+ * NOT mean 100% — emitting `1` for it makes the style too tight.
117
+ *
118
+ * letter-spacing is in em because every letterSpacing value the API
119
+ * returns is a percentage of font size, not px.
120
+ *
121
+ * IMPORTANT: the --text-* composite carries size, line-height, weight and
122
+ * tracking but NOT font-family and NOT text-transform. Two consequences:
123
+ *
124
+ * JetBrains Mono styles must be paired with font-mono, or they render
125
+ * in Inter: @apply text-data-m font-mono;
126
+ *
127
+ * Label styles are uppercase in Figma, so use the generated
128
+ * type-label-* utilities below, which bundle the casing.
129
+ */
130
+ --text-display: 46px; /* Body Content/Display (Inter Light) */
131
+ --text-display--line-height: 39px;
132
+ --text-display--font-weight: 300;
133
+ --text-h1: 19px; /* Body Content/H1 (Inter Semi Bold) */
134
+ --text-h1--line-height: 21.8px;
135
+ --text-h1--font-weight: 600;
136
+ --text-h2: 17px; /* Body Content/H2 (Inter Semi Bold) */
137
+ --text-h2--line-height: 19.5px;
138
+ --text-h2--font-weight: 600;
139
+ --text-subtitle: 14px; /* Body Content/Subtitle (Inter Medium) */
140
+ --text-subtitle--line-height: 19.6px;
141
+ --text-subtitle--font-weight: 500;
142
+ --text-body-1: 13px; /* Body Content/Body 1 (Inter Regular) */
143
+ --text-body-1--line-height: 19.5px;
144
+ --text-body-1--font-weight: 400;
145
+ --text-body-1-bold: 13px; /* Body Content/Body 1 - Bold (Inter Medium) */
146
+ --text-body-1-bold--line-height: 19.5px;
147
+ --text-body-1-bold--font-weight: 500;
148
+ --text-body-2: 12.5px; /* Body Content/Body 2 (Inter Regular) */
149
+ --text-body-2--line-height: 12.5px;
150
+ --text-body-2--font-weight: 400;
151
+ --text-body-2-bold: 12.5px; /* Body Content/Body 2 - Bold (Inter Medium) */
152
+ --text-body-2-bold--line-height: 12.5px;
153
+ --text-body-2-bold--font-weight: 500;
154
+ --text-caption: 12px; /* Body Content/Caption (Inter Regular) */
155
+ --text-caption--line-height: 18px;
156
+ --text-caption--font-weight: 400;
157
+ --text-caption-bold: 12px; /* Body Content/Caption - Bold (Inter Medium) */
158
+ --text-caption-bold--line-height: 18px;
159
+ --text-caption-bold--font-weight: 500;
160
+ --text-label-l: 10.5px; /* Label/Label L Sans (Inter Regular) */
161
+ --text-label-l--line-height: 19.6px;
162
+ --text-label-l--font-weight: 400;
163
+ --text-label-l--letter-spacing: 0.1em; /* 10% */
164
+ --text-label-l-bold: 10.5px; /* Label/Label L Sans - Bold (Inter Semi Bold) */
165
+ --text-label-l-bold--line-height: 19.6px;
166
+ --text-label-l-bold--font-weight: 600;
167
+ --text-label-l-bold--letter-spacing: 0.1em; /* 10% */
168
+ --text-label-l-mono: 10.5px; /* Label/Label L Mono (JetBrains Mono Medium — needs font-mono) */
169
+ --text-label-l-mono--line-height: 12.6px;
170
+ --text-label-l-mono--font-weight: 500;
171
+ --text-label-l-mono--letter-spacing: 0.1em; /* 10% */
172
+ --text-label-s: 10px; /* Label/Label S Sans (Inter Regular) */
173
+ --text-label-s--line-height: 12px;
174
+ --text-label-s--font-weight: 400;
175
+ --text-label-s--letter-spacing: 0.1em; /* 10% */
176
+ --text-label-s-bold: 10px; /* Label/Label S Sans - Bold (Inter Semi Bold) */
177
+ --text-label-s-bold--line-height: 12px;
178
+ --text-label-s-bold--font-weight: 600;
179
+ --text-label-s-bold--letter-spacing: 0.1em; /* 10% */
180
+ --text-label-s-mono: 10px; /* Label/Label S Mono (JetBrains Mono Bold — needs font-mono) */
181
+ --text-label-s-mono--line-height: 12px;
182
+ --text-label-s-mono--font-weight: 700;
183
+ --text-label-s-mono--letter-spacing: 0.1em; /* 10% */
184
+ --text-data-l: 18px; /* Data/Data L (JetBrains Mono Medium — needs font-mono) */
185
+ --text-data-l--line-height: 21.6px;
186
+ --text-data-l--font-weight: 500;
187
+ --text-data-m: 14px; /* Data/Data M (JetBrains Mono Medium — needs font-mono) */
188
+ --text-data-m--line-height: 21px;
189
+ --text-data-m--font-weight: 500;
190
+ --text-data-s: 13px; /* Data/Data S (JetBrains Mono Regular — needs font-mono) */
191
+ --text-data-s--line-height: 19.5px;
192
+ --text-data-s--font-weight: 400;
193
+ --text-data-xs: 12px; /* Data/Data xs (JetBrains Mono Regular — needs font-mono) */
194
+ --text-data-xs--line-height: 16.5px;
195
+ --text-data-xs--font-weight: 400;
196
+ --text-action-l: 13px; /* Button & Actions/Action L (Inter Medium) */
197
+ --text-action-l--line-height: normal;
198
+ --text-action-l--font-weight: 500;
199
+ --text-action-l-bold: 13px; /* Button & Actions/Action L - bold (Inter Semi Bold) */
200
+ --text-action-l-bold--line-height: normal;
201
+ --text-action-l-bold--font-weight: 600;
202
+ --text-action-m: 12.5px; /* Button & Actions/Action M (Inter Medium) */
203
+ --text-action-m--line-height: 14px;
204
+ --text-action-m--font-weight: 500;
205
+ --text-action-m-bold: 12.5px; /* Button & Actions/Action M - Bold (Inter Semi Bold) */
206
+ --text-action-m-bold--line-height: 14px;
207
+ --text-action-m-bold--font-weight: 600;
208
+ --text-action-s: 12px; /* Button & Actions/Action S (Inter Medium) */
209
+ --text-action-s--line-height: 14px;
210
+ --text-action-s--font-weight: 500;
211
+ --text-action-s-bold: 12px; /* Button & Actions/Action S - Bold (Inter Semi Bold) */
212
+ --text-action-s-bold--line-height: 14px;
213
+ --text-action-s-bold--font-weight: 600;
214
+ --text-micro-l: 11px; /* Micro Text/Micro L (Inter Regular) */
215
+ --text-micro-l--line-height: normal;
216
+ --text-micro-l--font-weight: 400;
217
+ --text-micro-l-bold: 11px; /* Micro Text/Micro L - Bold (Inter Medium) */
218
+ --text-micro-l-bold--line-height: normal;
219
+ --text-micro-l-bold--font-weight: 500;
220
+ --text-micro-m: 8.5px; /* Micro Text/Micro M (Inter Regular) */
221
+ --text-micro-m--line-height: normal;
222
+ --text-micro-m--font-weight: 400;
223
+ --text-micro-m-bold: 8.5px; /* Micro Text/Micro M - Bold (Inter Medium) */
224
+ --text-micro-m-bold--line-height: normal;
225
+ --text-micro-m-bold--font-weight: 500;
226
+ --text-micro-s: 8px; /* Micro Text/Micro S (Inter Regular) */
227
+ --text-micro-s--line-height: normal;
228
+ --text-micro-s--font-weight: 400;
229
+ --text-micro-s-bold: 8px; /* Micro Text/Micro S - Bold (Inter Semi Bold) */
230
+ --text-micro-s-bold--line-height: normal;
231
+ --text-micro-s-bold--font-weight: 600;
232
+ --text-micro-s-bold--letter-spacing: 0.004em; /* 0.4% */
233
+ --text-data-micro-l: 11px; /* Micro Text/Micro Data L (JetBrains Mono Medium — needs font-mono) */
234
+ --text-data-micro-l--line-height: normal;
235
+ --text-data-micro-l--font-weight: 500;
236
+ --text-data-micro-m: 8.5px; /* Micro Text/Micro Data M (JetBrains Mono Medium — needs font-mono) */
237
+ --text-data-micro-m--line-height: normal;
238
+ --text-data-micro-m--font-weight: 500;
239
+ --text-data-micro-s: 8px; /* Micro Text/Micro Data S (JetBrains Mono Medium — needs font-mono) */
240
+ --text-data-micro-s--line-height: normal;
241
+ --text-data-micro-s--font-weight: 500;
242
+ --text-statecap: 9.5px; /* Micro Text/Statecap (Inter Semi Bold) */
243
+ --text-statecap--line-height: normal;
244
+ --text-statecap--font-weight: 600;
245
+ --text-help-caption: 12px; /* Body & Supporting/Help & Caption (Inter Regular) */
246
+ --text-help-caption--line-height: 14px;
247
+ --text-help-caption--font-weight: 400;
248
+
249
+ /* Effects */
250
+ --shadow-panel: 0 12px 34px -12px oklch(0 0 0 / 0.251); /* General Drop Shadow #00000040 */
251
+ --shadow-knob: 0 1px 2px 0px oklch(0.2027 0.0395 282.3 / 0.251); /* Switch Knob Shadow #14142840 */
252
+ --shadow-modal: 0 12px 16px 0px oklch(0.2027 0.0395 282.3 / 0.122); /* Modal Drop Shadow #1414281f */
253
+ --shadow-toast: 0 4px 6px 0px oklch(0.2027 0.0395 282.3 / 0.071); /* Toast Drop Shadow #14142812 */
254
+
255
+ /*
256
+ * Keyboard focus ring — Figma Menu Item > Ring.
257
+ *
258
+ * In Figma this is a full-size overlay frame, so the ring's OUTER edge
259
+ * aligns with the component's own outer edge instead of sitting outside
260
+ * it. Apply with the .focus-ring utility, which reproduces that with a
261
+ * negative outline-offset. The radius is inherited from the component.
262
+ *
263
+ * The width is a raw value in Figma, not a variable, so it gets its own
264
+ * token rather than borrowing --border-micro, which shares the value but
265
+ * carries no stated relationship to it.
266
+ */
267
+ --ring-focus-width: 2px;
268
+ --ring-focus-color: oklch(0.4234 0.1163 256.9); /* Primary/Main #1e4d8c */
269
+
270
+ /*
271
+ * NOTE: no --spacing-* tokens on purpose. Tailwind v4's spacing scale is a
272
+ * multiplier of --spacing (0.25rem), so Figma's whole-pixel values all map
273
+ * to standard steps: Spacing/8 -> p-2, Spacing/7 -> p-1.75.
274
+ *
275
+ * The multiplier must be a multiple of 0.25 (= 1px steps), so Tailwind can
276
+ * express any whole pixel but no half-pixel. Figma's two fractional tokens
277
+ * need arbitrary values instead: Spacing/7-5 -> p-[7.5px] and
278
+ * Spacing/12-5 -> p-[12.5px]. The multiplier forms p-1.875 / p-3.125 do
279
+ * not compile.
280
+ *
281
+ * Defining --spacing-8: 8px would make p-8 mean 8px instead of 32px and
282
+ * break existing usage. See CLAUDE.md for the full mapping table.
283
+ */
284
+ }
285
+
286
+ /**
287
+ * Label type utilities.
288
+ *
289
+ * Figma marks every Label style UPPER, but Tailwind's --text-* composite
290
+ * cannot carry text-transform or font-family. These bundle the whole style so
291
+ * the casing — and the mono family, where it applies — cannot be forgotten:
292
+ *
293
+ * <span class="type-label-l">Section heading</span>
294
+ *
295
+ * Prefer these over the bare text-label-* tokens.
296
+ */
297
+ @utility type-label-l {
298
+ @apply text-label-l uppercase; /* Label/Label L Sans */
299
+ }
300
+
301
+ @utility type-label-l-bold {
302
+ @apply text-label-l-bold uppercase; /* Label/Label L Sans - Bold */
303
+ }
304
+
305
+ @utility type-label-l-mono {
306
+ @apply text-label-l-mono font-mono uppercase; /* Label/Label L Mono */
307
+ }
308
+
309
+ @utility type-label-s {
310
+ @apply text-label-s uppercase; /* Label/Label S Sans */
311
+ }
312
+
313
+ @utility type-label-s-bold {
314
+ @apply text-label-s-bold uppercase; /* Label/Label S Sans - Bold */
315
+ }
316
+
317
+ @utility type-label-s-mono {
318
+ @apply text-label-s-mono font-mono uppercase; /* Label/Label S Mono */
319
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Custom utilities.
3
+ *
4
+ * Declared with `@utility`, not `@layer utilities`. Only `@utility` registers a
5
+ * real Tailwind utility, which is what makes it usable both as a class in
6
+ * markup AND via `@apply` inside components. A plain class in
7
+ * `@layer utilities` cannot be @applied.
8
+ */
9
+
10
+ /**
11
+ * Keyboard focus ring — Figma Menu Item > Ring (I923:25890;851:22778).
12
+ *
13
+ * The shared affordance for tabbing between interactive elements. Apply on
14
+ * :focus-visible (not :focus) so it appears for keyboard navigation but not on
15
+ * mouse clicks:
16
+ *
17
+ * .btn:focus-visible { @apply focus-ring; }
18
+ *
19
+ * Two details worth knowing:
20
+ *
21
+ * 1. The negative outline-offset is deliberate. In Figma the ring is a
22
+ * full-size overlay frame, so its outer edge aligns with the component's own
23
+ * outer edge rather than sitting outside it. A negative offset equal to the
24
+ * ring width reproduces that. Offset 0 or positive would grow the element's
25
+ * visual bounds.
26
+ *
27
+ * 2. `outline` follows the element's own border-radius, so the ring needs no
28
+ * radius of its own — it picks up rounded-control, rounded-surface, or
29
+ * whatever the component already sets. This matches Figma, where the Ring
30
+ * frame's radius tracks its parent.
31
+ */
32
+ @utility focus-ring {
33
+ outline: var(--ring-focus-width) solid var(--ring-focus-color);
34
+ outline-offset: calc(-1 * var(--ring-focus-width));
35
+ }