@valiify/dashboard-ui 0.3.0 → 0.5.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 (101) hide show
  1. package/CHANGELOG.md +948 -10
  2. package/COMPONENTS.md +199 -79
  3. package/GETTING_STARTED.md +116 -54
  4. package/QUICK_REFERENCE.md +48 -30
  5. package/README.md +107 -85
  6. package/TROUBLESHOOTING.md +52 -34
  7. package/class-manifest.json +141 -71
  8. package/design-methodology/dashboard.md +92 -80
  9. package/dist/dashboard-ui.css +1529 -1078
  10. package/dist/index.css +1250 -732
  11. package/package.json +17 -10
  12. package/scripts/codemods/0.5.0-chip-sizes.mjs +437 -0
  13. package/src/build/utilities.css +7 -10
  14. package/src/components/_template.css +12 -8
  15. package/src/components/alert.css +35 -8
  16. package/src/components/avatar.css +42 -30
  17. package/src/components/breadcrumbs.css +39 -22
  18. package/src/components/button.css +84 -14
  19. package/src/components/card.css +2 -2
  20. package/src/components/checkbox.css +16 -11
  21. package/src/components/chip.css +155 -79
  22. package/src/components/composer.css +145 -0
  23. package/src/components/data-row.css +10 -6
  24. package/src/components/divider.css +17 -22
  25. package/src/components/dropdown-field.css +83 -43
  26. package/src/components/dropdown-menu.css +80 -14
  27. package/src/components/field-verification.css +21 -5
  28. package/src/components/filter-segment.css +27 -8
  29. package/src/components/icon-button.css +49 -10
  30. package/src/components/index.css +2 -0
  31. package/src/components/input.css +88 -32
  32. package/src/components/link.css +27 -16
  33. package/src/components/loading-inline.css +15 -21
  34. package/src/components/menu-item.css +149 -49
  35. package/src/components/modal.css +8 -5
  36. package/src/components/navigation-rail.css +67 -31
  37. package/src/components/pagination-item.css +29 -28
  38. package/src/components/pagination.css +9 -14
  39. package/src/components/pill.css +16 -10
  40. package/src/components/progress-bar.css +8 -10
  41. package/src/components/radio-select.css +9 -2
  42. package/src/components/recipient-input.css +119 -0
  43. package/src/components/section-marker.css +5 -5
  44. package/src/components/segment-selector.css +9 -3
  45. package/src/components/sensitive-data.css +7 -5
  46. package/src/components/skeleton.css +18 -6
  47. package/src/components/step.css +15 -4
  48. package/src/components/stepper.css +3 -2
  49. package/src/components/switch.css +7 -0
  50. package/src/components/tabs.css +122 -28
  51. package/src/components/tag.css +156 -51
  52. package/src/components/text-button.css +54 -59
  53. package/src/components/textarea.css +87 -22
  54. package/src/components/toast.css +41 -15
  55. package/src/components/tooltip.css +13 -2
  56. package/src/fonts.css +2 -1
  57. package/src/library.css +1 -1
  58. package/src/reset.css +1 -1
  59. package/src/themes/valiify-tokens.css +101 -126
  60. package/src/themes/valiify.css +258 -157
  61. package/src/utility-surface.css +51 -49
  62. package/types/components.d.ts +145 -25
  63. package/CLAUDE.md +0 -3740
  64. package/examples/README.md +0 -198
  65. package/examples/basic/index.html +0 -155
  66. package/examples/daisyui-starter/README.md +0 -58
  67. package/examples/daisyui-starter/check-no-bleed.mjs +0 -249
  68. package/examples/daisyui-starter/index.html +0 -72
  69. package/examples/daisyui-starter/linked.html +0 -74
  70. package/examples/daisyui-starter/package-lock.json +0 -2221
  71. package/examples/daisyui-starter/package.json +0 -22
  72. package/examples/daisyui-starter/postcss.config.js +0 -1
  73. package/examples/daisyui-starter/src/host.css +0 -14
  74. package/examples/daisyui-starter/src/only-import.css +0 -4
  75. package/examples/daisyui-starter/src/styles.css +0 -36
  76. package/examples/daisyui-starter/tailwind.config.js +0 -13
  77. package/examples/postcss-starter/README.md +0 -47
  78. package/examples/postcss-starter/index.html +0 -54
  79. package/examples/postcss-starter/package.json +0 -19
  80. package/examples/postcss-starter/postcss.config.js +0 -5
  81. package/examples/postcss-starter/src/styles.css +0 -17
  82. package/examples/sveltekit-starter/README.md +0 -32
  83. package/examples/sveltekit-starter/check-scoped-styles.mjs +0 -103
  84. package/examples/sveltekit-starter/package-lock.json +0 -1300
  85. package/examples/sveltekit-starter/package.json +0 -24
  86. package/examples/sveltekit-starter/src/app.css +0 -17
  87. package/examples/sveltekit-starter/src/app.html +0 -11
  88. package/examples/sveltekit-starter/src/lib/GlobalReset.svelte +0 -20
  89. package/examples/sveltekit-starter/src/lib/ScopedRemedy.svelte +0 -27
  90. package/examples/sveltekit-starter/src/lib/ScopedReset.svelte +0 -22
  91. package/examples/sveltekit-starter/src/routes/+layout.svelte +0 -6
  92. package/examples/sveltekit-starter/src/routes/+page.svelte +0 -10
  93. package/examples/sveltekit-starter/svelte.config.js +0 -4
  94. package/examples/sveltekit-starter/vite.config.js +0 -6
  95. package/examples/vite-starter/README.md +0 -125
  96. package/examples/vite-starter/index.html +0 -12
  97. package/examples/vite-starter/package.json +0 -19
  98. package/examples/vite-starter/src/main.js +0 -188
  99. package/examples/vite-starter/src/styles.css +0 -22
  100. package/examples/vite-starter/vite.config.js +0 -6
  101. package/src/themes/valiify-type-prefixed.css +0 -37
package/CLAUDE.md DELETED
@@ -1,3740 +0,0 @@
1
- # Valiify Dashboard UI Component Kit
2
-
3
- A Tailwind CSS component library for building Valiify Dashboard applications. CSS-only, zero JavaScript dependencies, framework-agnostic.
4
-
5
- ## Git
6
-
7
- **Never run `git commit` or `git push`.** Stage changes with `git add` if asked,
8
- then stop — I write all commit messages and commit myself.
9
-
10
- ## Val agents are generated — do not hand-edit them
11
-
12
- `.claude/agents/*.md` and `.claude/commands/{val,extract}.md` are **generated**
13
- by `@valiify/val-core` (`npx val-init`) from its templates plus this repo's
14
- [val/config.json](val/config.json). Each file carries a header saying so. To
15
- change agent behaviour, edit the template in the val-core repo
16
- (`~/Desktop/val-core`, published to npm as `@valiify/val-core`), release it, then
17
- bump the devDependency here and rerun `npx val-init`; to change a path, font rule
18
- or audience sentence, edit `val/config.json`, then run `npx val-init` and stage
19
- the output. `npx val-init --check` fails when the generated files
20
- drift from their sources. `val/tools` is a symlink into the package; the
21
- methodology skills live at `node_modules/@valiify/val-core/skills/`.
22
-
23
- ## Quick Reference
24
-
25
- ### Available Components (Phase 1 - Proof of Concept)
26
-
27
- #### Button
28
-
29
- - **Base**: `.vd-btn` — Display=outline at medium size (see the note below)
30
- - **Variants**: `.vd-btn-primary`, `.vd-btn-outline`, `.vd-btn-empty`, `.vd-btn-critical` (not in Figma's Button set — see Modal)
31
- - **Sizes**: `.vd-btn-sm` (24px), `.vd-btn-lg` (32px) - medium (28px) is default
32
- - **States**: `:hover`, `:active`, `:focus-visible`, `:disabled`, `[aria-selected="true"]`
33
- - **Heights**: Explicitly set (24px / 28px / 32px) per Figma measurements
34
- - **Typography**: one style PER SIZE — `text-action-s` (12px), `text-action-m`
35
- (12.5px, default), `text-action-l` (13px). They are not shared.
36
- - **Icons**: Use Icon component with size-matched icons (sm=13px, md=14px, lg=15px)
37
-
38
- > **There is no "default" Display value.** Figma's axis is
39
- > primary / outline / empty, and a bare `.vd-btn` is outline — that is all
40
- > "default" ever meant here. The Storybook control still offers `default`, but
41
- > it renders a bare `.vd-btn`, not a fourth variant.
42
- >
43
- > **Fixed 2026-08-24:** the base previously took outline's _rest appearance_
44
- > while its interaction rules lived inside `.vd-btn-outline`, so a bare `.vd-btn`
45
- > looked like an outline button and responded to nothing — inert on hover and on
46
- > `aria-selected`. The ramp now lives on the base and `.vd-btn-outline` is an
47
- > explicit alias for the same thing.
48
- >
49
- > **Outline and empty share one ramp in Figma** — hover `Action/Subtle`,
50
- > selected `Action/Hover`, active `Primary/Soft` + `Primary/Main` — differing
51
- > only in the rest border and whether active draws one. That is why the ramp
52
- > sits on the base, and it also closed the two states `.vd-btn-empty` was missing.
53
- >
54
- > The filled displays override all of it. Because the base `:active` sets both a
55
- > border colour and `Primary/Main` text, `.vd-btn-primary` and `.vd-btn-critical` reset
56
- > `border-transparent` **and** `Content/Contrast` in their own active rules —
57
- > without the second, a pressed primary renders a blue label on a blue fill.
58
- >
59
- > **The `md` size default is not verified against Figma.** Outline as the base
60
- > Display is grounded (it is the set's rest default), but nothing confirms
61
- > medium as the default size — the set's top-left variant is `sm`. Unresolved.
62
-
63
- ```html
64
- <!-- Basic buttons -->
65
- <button class="vd-btn vd-btn-primary">Primary Button</button>
66
- <button class="vd-btn vd-btn-outline vd-btn-sm">Small Outline</button>
67
- <button class="vd-btn vd-btn-empty vd-btn-lg">Large Empty</button>
68
- <button class="vd-btn vd-btn-primary" disabled>Disabled</button>
69
- <button class="vd-btn vd-btn-outline" aria-selected="true">Selected</button>
70
-
71
- <!-- Buttons with icons (using Icon component + sprite) -->
72
- <button class="vd-btn vd-btn-primary">
73
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
74
- <use href="#save" />
75
- </svg>
76
- Save
77
- </button>
78
-
79
- <button class="vd-btn vd-btn-outline vd-btn-sm">
80
- <svg class="vd-icon vd-icon-size-13" aria-hidden="true">
81
- <use href="#filter" />
82
- </svg>
83
- Filter
84
- </button>
85
-
86
- <!-- Icon-only button (requires aria-label) -->
87
- <button class="vd-btn vd-btn-outline" aria-label="Settings">
88
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
89
- <use href="#settings" />
90
- </svg>
91
- </button>
92
- ```
93
-
94
- #### Input
95
-
96
- Complete form input system with labels, help text, icons, and error messages.
97
-
98
- - **Container**: `.vd-input-container` (wraps label + input + error)
99
- - **Label**: `.vd-input-label` (10px semibold uppercase, optional help button)
100
- - **Help Button**: `.vd-icon-button vd-icon-button-xs` (12px icon button)
101
- - **Field**: `.vd-input-field` (the styled input row container)
102
- - **Input**: `.vd-input` (actual input element, unstyled)
103
- - **Icons**: `.vd-input-icon-left`, `.vd-input-icon-right` (14px icons)
104
- - **Error**: `.vd-input-error-message` (11px error text)
105
- - **Sizes**: `.vd-input-sm` (25px), `.vd-input-md` (29px), `.vd-input-lg` (35px, default)
106
- - **BG Variants**: default (white, `surface-paper`), `.vd-input-bg-neutral` (`surface-card`)
107
- - **States**: `.vd-input-error`, `:hover`, `:focus-within`, `:disabled`
108
-
109
- Each size carries padding **and** type — lg and md are both Body 1 (13px) at
110
- different padding, sm drops to Micro L (11px):
111
-
112
- | Size | Padding (x / y) | Type | Height |
113
- | ---- | --------------- | ---- | ------ |
114
- | sm | 8 / 5.5 | 11px | 25px |
115
- | md | 10 / 4 | 13px | 29px |
116
- | lg | 12 / 7 | 13px | 35px |
117
-
118
- > Sizes changed on **2026-08-22** (were 29 / 33 / 35) so Input and DropdownField
119
- > line up. The placeholder also moved from `content-faint` to `content-tertiary`
120
- > in the same update. Note DropdownField's placeholder is still `content-faint`
121
- > — the two field types genuinely differ in the design file.
122
- >
123
- > `py-[5.5px]` needs arbitrary syntax: Tailwind's multiplier only steps in whole
124
- > pixels, so there is no multiplier form for a half-pixel.
125
-
126
- ```html
127
- <!-- Complete form field -->
128
- <div class="vd-input-container">
129
- <div class="vd-input-label">
130
- <span>Email Address</span>
131
- <button class="vd-icon-button vd-icon-button-xs" aria-label="Help">
132
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
133
- <use href="#custom-help" />
134
- </svg>
135
- </button>
136
- </div>
137
-
138
- <div class="vd-input-field vd-input-md">
139
- <svg class="vd-input-icon-left vd-icon vd-icon-size-14" aria-hidden="true">
140
- <use href="#mail" />
141
- </svg>
142
- <input type="email" class="vd-input" placeholder="you@example.com" />
143
- </div>
144
-
145
- <div class="vd-input-error-message">Please enter a valid email address</div>
146
- </div>
147
-
148
- <!-- Simple input (no label/icons) -->
149
- <div class="vd-input-container">
150
- <div class="vd-input-field">
151
- <input type="text" class="vd-input" placeholder="Enter text..." />
152
- </div>
153
- </div>
154
-
155
- <!-- Small input with neutral background -->
156
- <div class="vd-input-container">
157
- <div class="vd-input-field vd-input-sm vd-input-bg-neutral">
158
- <input type="text" class="vd-input" placeholder="Search..." />
159
- <svg class="vd-input-icon-right vd-icon vd-icon-size-14" aria-hidden="true">
160
- <use href="#search" />
161
- </svg>
162
- </div>
163
- </div>
164
-
165
- <!-- Error state -->
166
- <div class="vd-input-container">
167
- <div class="vd-input-field vd-input-error">
168
- <input type="text" class="vd-input" value="Invalid value" />
169
- </div>
170
- <div class="vd-input-error-message">This field is required</div>
171
- </div>
172
-
173
- <!-- Disabled -->
174
- <div class="vd-input-container">
175
- <div class="vd-input-field">
176
- <input type="text" class="vd-input" disabled value="Disabled input" />
177
- </div>
178
- </div>
179
- ```
180
-
181
- #### Textarea
182
-
183
- Multi-line text input field with labels, help text, and error messages. Separate component from Input for multi-line text entry like comments, descriptions, and messages.
184
-
185
- - **Container**: `.vd-textarea-container` (wraps label + textarea + error/counter)
186
- - **Label**: `.vd-textarea-label` (10px semibold uppercase, optional help button)
187
- - **Help Button**: `.vd-icon-button vd-icon-button-xs` (12px icon button)
188
- - **Field**: `.vd-textarea-field` (the styled textarea container)
189
- - **Textarea**: `.vd-textarea` (actual textarea element, resizable)
190
- - **Error**: `.vd-textarea-error-message` (11px error text)
191
- - **Counter**: `.vd-textarea-counter` (optional character counter)
192
- - **Sizes**: none — height is set by `rows`, a height utility, or the resize handle
193
- - **BG Variants**: default (white, `surface-paper`), `.vd-textarea-bg-neutral` (`surface-card`)
194
- - **States**: `.vd-textarea-error`, `:hover`, `:focus-within`, `:disabled`
195
-
196
- > **Height is deliberately not styled.** Figma defines one geometry — 12px / 7px
197
- > padding, 6px radius, 0.5px hairline, Body 1 text — across 12 variants
198
- > (state × filled × error), and **no Size property**. A multi-line box's height
199
- > is a usage decision, so the field hugs its `<textarea>`: size it with `rows`,
200
- > a height utility, or the resize handle. Pair an explicit height with
201
- > `resize-none` for a fixed box.
202
- >
203
- > `.vd-textarea-counter` is a library extension, not in the design file.
204
-
205
- ```html
206
- <!-- Complete textarea field -->
207
- <div class="vd-textarea-container">
208
- <div class="vd-textarea-label">
209
- <span>Description</span>
210
- <button class="vd-icon-button vd-icon-button-xs" aria-label="Help">
211
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
212
- <use href="#custom-help" />
213
- </svg>
214
- </button>
215
- </div>
216
-
217
- <div class="vd-textarea-field">
218
- <textarea
219
- class="vd-textarea"
220
- rows="4"
221
- placeholder="Enter description..."
222
- ></textarea>
223
- </div>
224
-
225
- <div class="vd-textarea-counter">45 / 500</div>
226
- </div>
227
-
228
- <!-- Simple textarea -->
229
- <div class="vd-textarea-container">
230
- <div class="vd-textarea-field">
231
- <textarea class="vd-textarea" rows="4" placeholder="Enter text..."></textarea>
232
- </div>
233
- </div>
234
-
235
- <!-- Textarea with neutral background -->
236
- <div class="vd-textarea-container">
237
- <div class="vd-textarea-field vd-textarea-bg-neutral">
238
- <textarea class="vd-textarea" rows="3" placeholder="Quick note..."></textarea>
239
- </div>
240
- </div>
241
-
242
- <!-- Error state -->
243
- <div class="vd-textarea-container">
244
- <div class="vd-textarea-field vd-textarea-error">
245
- <textarea class="vd-textarea" rows="4">Invalid content</textarea>
246
- </div>
247
- <div class="vd-textarea-error-message">Please provide more details</div>
248
- </div>
249
-
250
- <!-- Disabled -->
251
- <div class="vd-textarea-container">
252
- <div class="vd-textarea-field">
253
- <textarea class="vd-textarea" rows="4" disabled>Cannot edit this</textarea>
254
- </div>
255
- </div>
256
- ```
257
-
258
- #### MenuItem
259
-
260
- Single row within a dropdown menu or navigation list. Supports left icon, avatar, badge, subtitle, right icon, and right text slots.
261
-
262
- - **Base**: `.vd-menu-item` (defaults to md; full-width flex row)
263
- - **Parts**: `.vd-menu-item-text` (flex column wrapper), `.vd-menu-item-title`,
264
- `.vd-menu-item-subtitle` (11px, same at every size), `.vd-menu-item-right-text`,
265
- `.vd-menu-item-badge` (20px tinted icon tile). Use the Avatar component
266
- (`.vd-avatar vd-avatar-md`) for the initials bubble.
267
- - **Sizes**: `.vd-menu-item-sm` (11px / 10×6 padding), `.vd-menu-item-md` (12.5px / 12×7, default),
268
- `.vd-menu-item-lg` (13px / 12×11)
269
- - **Variant**: `.vd-menu-item-combined` — medium-weight primary title, designed for `lg`
270
- - **States**: `:hover`, `:focus-visible`, `[aria-selected="true"]` /
271
- `[aria-checked="true"]`, `:disabled` / `[aria-disabled="true"]`
272
- - **Icons**: sm uses 12px icons, md and lg use 15px
273
-
274
- > **Heights are content-driven** (padding + line box), matching Figma's hug
275
- > behaviour — 25 / 29 / 42px with a right icon present. They are deliberately
276
- > not hardcoded, because the sm title uses an Auto line height.
277
-
278
- ```html
279
- <!-- Simple row -->
280
- <button class="vd-menu-item" role="menuitem">
281
- <span class="vd-menu-item-text">
282
- <span class="vd-menu-item-title">Daily</span>
283
- </span>
284
- </button>
285
-
286
- <!-- Selected row with a check -->
287
- <button class="vd-menu-item" role="menuitem" aria-selected="true">
288
- <span class="vd-menu-item-text">
289
- <span class="vd-menu-item-title">Weekly</span>
290
- </span>
291
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true">
292
- <use href="#check" />
293
- </svg>
294
- </button>
295
-
296
- <!-- Left icon + keyboard shortcut -->
297
- <button class="vd-menu-item" role="menuitem">
298
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true">
299
- <use href="#settings" />
300
- </svg>
301
- <span class="vd-menu-item-text">
302
- <span class="vd-menu-item-title">Preferences</span>
303
- </span>
304
- <span class="vd-menu-item-right-text">⌘,</span>
305
- </button>
306
-
307
- <!-- Large row with avatar and subtitle -->
308
- <button class="vd-menu-item vd-menu-item-lg" role="menuitem">
309
- <span class="vd-avatar vd-avatar-md">NC</span>
310
- <span class="vd-menu-item-text">
311
- <span class="vd-menu-item-title">Nicholas Cooper</span>
312
- <span class="vd-menu-item-subtitle">Primary applicant</span>
313
- </span>
314
- </button>
315
-
316
- <!-- Combined variant: badge + primary title -->
317
- <button class="vd-menu-item vd-menu-item-lg vd-menu-item-combined" role="menuitem">
318
- <span class="vd-menu-item-badge">
319
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
320
- <use href="#users" />
321
- </svg>
322
- </span>
323
- <span class="vd-menu-item-text">
324
- <span class="vd-menu-item-title">Combined</span>
325
- <span class="vd-menu-item-subtitle">Both Applicants</span>
326
- </span>
327
- </button>
328
-
329
- <!-- Small row -->
330
- <button class="vd-menu-item vd-menu-item-sm" role="menuitem">
331
- <span class="vd-menu-item-text">
332
- <span class="vd-menu-item-title">Quarterly</span>
333
- </span>
334
- </button>
335
-
336
- <!-- Disabled -->
337
- <button class="vd-menu-item" role="menuitem" disabled>
338
- <span class="vd-menu-item-text">
339
- <span class="vd-menu-item-title">Archived</span>
340
- </span>
341
- </button>
342
- ```
343
-
344
- #### DropdownMenu
345
-
346
- Overlay panel holding a vertical list of MenuItem rows. Rows stretch to the
347
- panel width on their own, so they need no extra width class.
348
-
349
- - **Base**: `.vd-dropdown-menu` (200px minimum width, 4px padding, `rounded-surface`, `shadow-panel`)
350
- - **Parts**: `.vd-dropdown-menu-divider`
351
- - **Positioning**: `.vd-dropdown` (relative wrapper) + `.vd-dropdown-panel` (absolute, below the trigger)
352
- - **States**: `:focus-visible`
353
-
354
- > `.vd-dropdown-menu-divider` is **not in Figma yet**. It is composed from existing
355
- > tokens (0.5px `stroke-divider` rule) for grouped menus; confirm the treatment
356
- > with the designer before relying on it.
357
-
358
- **Opening and closing.** The library ships no JavaScript, so the consuming app
359
- drives two attributes:
360
-
361
- | Element | Attribute |
362
- | ----------------- | --------------------------------- |
363
- | trigger | `aria-expanded="true" \| "false"` |
364
- | `.vd-dropdown-panel` | `hidden` present / absent |
365
-
366
- `.vd-dropdown-panel` deliberately declares no `display`, so the native `hidden`
367
- attribute keeps working; a `[hidden] { display: none }` guard backs it up. Do
368
- **not** add a display utility to the panel — it would defeat `hidden` and the
369
- menu could never close.
370
-
371
- ```html
372
- <!-- Select-style menu -->
373
- <div class="vd-dropdown-menu" role="menu">
374
- <button class="vd-menu-item" role="menuitem" aria-selected="true">
375
- <span class="vd-menu-item-text"
376
- ><span class="vd-menu-item-title">Weekly</span></span
377
- >
378
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true">
379
- <use href="#check" />
380
- </svg>
381
- </button>
382
- <button class="vd-menu-item" role="menuitem">
383
- <span class="vd-menu-item-text"
384
- ><span class="vd-menu-item-title">Daily</span></span
385
- >
386
- </button>
387
- <button class="vd-menu-item" role="menuitem">
388
- <span class="vd-menu-item-text"
389
- ><span class="vd-menu-item-title">Monthly</span></span
390
- >
391
- </button>
392
- </div>
393
-
394
- <!-- Action menu with a divider before a destructive row -->
395
- <div class="vd-dropdown-menu" role="menu">
396
- <button class="vd-menu-item" role="menuitem">
397
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true">
398
- <use href="#pencil" />
399
- </svg>
400
- <span class="vd-menu-item-text"
401
- ><span class="vd-menu-item-title">Edit</span></span
402
- >
403
- </button>
404
-
405
- <div class="vd-dropdown-menu-divider"></div>
406
-
407
- <button class="vd-menu-item" role="menuitem">
408
- <svg class="vd-icon vd-icon-size-15 text-critical" aria-hidden="true">
409
- <use href="#trash-2" />
410
- </svg>
411
- <span class="vd-menu-item-text">
412
- <span class="vd-menu-item-title text-critical">Delete</span>
413
- </span>
414
- </button>
415
- </div>
416
-
417
- <!-- Anchored under a trigger (positioning is the consumer's) -->
418
- <!-- Anchored under a trigger -->
419
- <div class="vd-dropdown">
420
- <button class="vd-btn vd-btn-outline" aria-expanded="false" aria-haspopup="menu">
421
- Weekly
422
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
423
- <use href="#chevron-down" />
424
- </svg>
425
- </button>
426
- <div class="vd-dropdown-panel" hidden>
427
- <div class="vd-dropdown-menu" role="menu">
428
- <!-- .menu-item rows -->
429
- </div>
430
- </div>
431
- </div>
432
- ```
433
-
434
- #### DropdownField
435
-
436
- Dropdown select field for choosing from a list of options. Supports avatar and
437
- left icon, with interaction states across 3 sizes. Structurally mirrors Input,
438
- and pairs with DropdownMenu for the panel.
439
-
440
- - **Container**: `.vd-dropdown-field-container` (wraps label + field + error)
441
- - **Label**: `.vd-dropdown-field-label` (10px semibold uppercase, optional help button)
442
- - **Trigger**: `.vd-dropdown-field` (defaults to lg)
443
- - **Value**: `.vd-dropdown-field-value` (chosen, `content-primary`) /
444
- `.vd-dropdown-field-placeholder` (empty, `content-faint`)
445
- - **Slots**: `.vd-dropdown-field-icon` (14px leading), `.vd-dropdown-field-chevron` (14px trailing),
446
- Avatar for the initials bubble — `avatar-sm` (18px) at lg, `avatar-xs` (16px) at md/sm
447
- - **Error**: `.vd-dropdown-field-error-message` (11px)
448
- - **Sizes**: `.vd-dropdown-field-sm` (25px), `.vd-dropdown-field-md` (29px), `.vd-dropdown-field-lg` (35px, default)
449
- - **BG Variants**: default (white, `surface-paper`), `.vd-dropdown-field-bg-neutral` (`surface-card`)
450
- - **States**: `:hover`, `:focus-visible`, `[aria-expanded="true"]`,
451
- `.vd-dropdown-field-error`, `:disabled`
452
-
453
- Open state comes from `aria-expanded="true"` on the trigger: it takes the focus
454
- ring and rotates the chevron 180°. Both icons are 14px at every size.
455
-
456
- Heights match Input exactly (35 / 29 / 25), so the two field types can sit
457
- side by side in a form row.
458
-
459
- > **Avatar sizing is the call site's choice, not automatic.** This component
460
- > used to resize its own initials bubble with a descendant selector. That copy
461
- > was retired in favour of the shared Avatar component, so pick `avatar-sm` at
462
- > lg and `avatar-xs` at md/sm yourself — the same way you pick `.icon-size-*`.
463
-
464
- > The error hairline is deliberately overridden by the open ring, matching the
465
- > active + error variants in Figma. Disabled leaves the border alone, so a
466
- > disabled field in error keeps its crimson hairline.
467
- >
468
- > The Dropdown Field Container has **no BG property in Figma yet**.
469
- > `.vd-dropdown-field-bg-neutral` mirrors the Text Input Container's White/Neutral
470
- > pair so the three field types stay interchangeable; confirm with the designer.
471
-
472
- ```html
473
- <!-- Complete field, closed -->
474
- <div class="vd-dropdown-field-container">
475
- <div class="vd-dropdown-field-label">
476
- <span>Frequency</span>
477
- <button class="vd-icon-button vd-icon-button-xs" aria-label="Help">
478
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
479
- <use href="#custom-help" />
480
- </svg>
481
- </button>
482
- </div>
483
-
484
- <div class="vd-dropdown">
485
- <button
486
- class="vd-dropdown-field"
487
- aria-haspopup="listbox"
488
- aria-expanded="false"
489
- >
490
- <svg class="vd-dropdown-field-icon vd-icon vd-icon-size-14" aria-hidden="true">
491
- <use href="#calendar" />
492
- </svg>
493
- <span class="vd-dropdown-field-placeholder">Select</span>
494
- <svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
495
- <use href="#chevron-down" />
496
- </svg>
497
- </button>
498
-
499
- <div class="vd-dropdown-panel" hidden>
500
- <div class="vd-dropdown-menu" role="listbox">
501
- <button class="vd-menu-item" role="option" aria-selected="false">
502
- <span class="vd-menu-item-text"
503
- ><span class="vd-menu-item-title">Weekly</span></span
504
- >
505
- </button>
506
- </div>
507
- </div>
508
- </div>
509
- </div>
510
-
511
- <!-- Filled -->
512
- <button class="vd-dropdown-field" aria-haspopup="listbox" aria-expanded="false">
513
- <span class="vd-dropdown-field-value">Weekly</span>
514
- <svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
515
- <use href="#chevron-down" />
516
- </svg>
517
- </button>
518
-
519
- <!-- With avatar -->
520
- <button class="vd-dropdown-field" aria-haspopup="listbox" aria-expanded="false">
521
- <span class="vd-avatar vd-avatar-sm">NC</span>
522
- <span class="vd-dropdown-field-value">Nicholas Cooper</span>
523
- <svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
524
- <use href="#chevron-down" />
525
- </svg>
526
- </button>
527
-
528
- <!-- Small, error -->
529
- <div class="vd-dropdown-field-container">
530
- <button
531
- class="vd-dropdown-field vd-dropdown-field-sm vd-dropdown-field-error"
532
- aria-haspopup="listbox"
533
- aria-expanded="false"
534
- >
535
- <span class="vd-dropdown-field-placeholder">Select</span>
536
- <svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
537
- <use href="#chevron-down" />
538
- </svg>
539
- </button>
540
- <div class="vd-dropdown-field-error-message">Please choose an option</div>
541
- </div>
542
-
543
- <!-- Disabled -->
544
- <button
545
- class="vd-dropdown-field"
546
- aria-haspopup="listbox"
547
- aria-expanded="false"
548
- disabled
549
- >
550
- <span class="vd-dropdown-field-value">Weekly</span>
551
- <svg class="vd-dropdown-field-chevron vd-icon vd-icon-size-14" aria-hidden="true">
552
- <use href="#chevron-down" />
553
- </svg>
554
- </button>
555
- ```
556
-
557
- #### Card — PLACEHOLDER, not a real component
558
-
559
- > **Leftover Phase 1 proof-of-concept scaffolding.** It was never extracted from
560
- > Figma and has not been replaced by a real component yet. Its padding, radius
561
- > and structure are invented — do not use it as a reference for new components
562
- > and do not build product UI on it. It is excluded from `verify:visual` on
563
- > purpose. When the real Card lands in Figma, rewrite the file from scratch.
564
-
565
- - **Base**: `.vd-card`
566
- - **Parts**: `.vd-card-title`, `.vd-card-body`
567
- - **Modifiers**: `.vd-card-compact`, `.vd-card-bordered`, `.vd-card-hover`
568
-
569
- ```html
570
- <div class="vd-card">
571
- <h2 class="vd-card-title">Title</h2>
572
- <p class="vd-card-body">Content goes here.</p>
573
- </div>
574
- ```
575
-
576
- #### RadioSelect
577
-
578
- - **Base**: `.vd-radio-select` (label wrapper)
579
- - **Parts**: `.vd-radio-select-input` (radio input), `.vd-radio-select-label` (label text)
580
- - **States**: `:hover`, `:focus-visible`, `:checked`, `:disabled`
581
- - **Dimensions**: 15px circle, 8px inner dot when selected, 9px gap
582
- - **Typography**: Caption (12px/18px/400)
583
-
584
- ```html
585
- <label class="vd-radio-select">
586
- <input type="radio" name="group" class="vd-radio-select-input" />
587
- <span class="vd-radio-select-label">Option 1</span>
588
- </label>
589
- <label class="vd-radio-select">
590
- <input type="radio" name="group" class="vd-radio-select-input" checked />
591
- <span class="vd-radio-select-label">Option 2</span>
592
- </label>
593
- ```
594
-
595
- #### Chip
596
-
597
- Status indicator system with three presentation modes: chip (text with optional dot), badge (circular number), and dot (indicator only).
598
-
599
- All three share Figma's **Size** property (SM / MD). **SM is the default**, so
600
- bare `.vd-chip` / `.vd-badge` / `.vd-dot` are SM and need no size class.
601
-
602
- | | SM (default) | MD |
603
- | ----- | ---------------------------- | ------------------------------------- |
604
- | chip | 20px tall, 4px gap, 8px text | 23px tall, 6px gap, 11px text |
605
- | badge | 15×15, 4px padding, 8px mono | **19×19**, **6px** padding, 11px mono |
606
- | dot | 5×5 | 7×7 |
607
-
608
- > The chip's **padding is identical** at both sizes (9 / 5) and its inner
609
- > `.vd-chip-dot` **stays 5px** — only gap and type move. The badge is the one
610
- > element that grows its box.
611
-
612
- They also share Figma's **BG** property (yes / no). **`yes` (filled) is the
613
- default**, so bare `.vd-chip` / `.vd-badge` need no class; `.vd-chip-bg-no` and
614
- `.vd-badge-bg-no` are the opt-out — the same shape as Input/Textarea/DropdownField's
615
- `-bg-*` classes.
616
-
617
- | | BG=yes (default) | BG=no |
618
- | ----- | ---------------- | --------------------------------------------- |
619
- | chip | soft tinted fill | no fill, no border — bare coloured text + dot |
620
- | badge | soft tinted fill | no fill, **no circle at all** |
621
- | dot | filled | **identical — BG is a no-op** |
622
-
623
- > **Only the fill changes.** Text and dot keep the same colour token across the
624
- > axis, and there is deliberately **no hairline or border** in the unfilled
625
- > form — verified against the Figma render.
626
-
627
- > **There is no `.dot-bg-no`.** Figma draws all 18 dot variants across the axis,
628
- > but a dot _is_ its fill: `BG=yes` and `BG=no` sample byte-identical. Nine of
629
- > those variants are redundant. On the designer list.
630
-
631
- > **`primary` exists only at BG=no in Figma** — there is no filled primary,
632
- > which is why `.vd-chip-primary` and `.vd-badge-primary` are already transparent.
633
- > Adding `.vd-chip-bg-no` to one is harmless but redundant.
634
-
635
- > **Casing is the caller's — confirmed 2026-08-26.** Figma renders the labels
636
- > UPPERCASE (`REVIEW`, `FLAGGED`), and for a long time nothing distinguished a
637
- > `text-transform` on the component from the casing of the sample strings. The
638
- > designer has since bound a text style to the label — `Micro Text/Micro S -
639
- Bold` — and it applies **no** text-case: the rendered variant emits `REVIEW`
640
- > with no `uppercase`. So the caps are typed into the sample strings, and leaving
641
- > casing alone was right — a label passed as "Review" stays "Review". There is
642
- > still no `text-transform: none` assertion, because nothing sets one to guard
643
- > against. Contrast Pill, where the same question was answered differently and
644
- > the spec does pin it; Divider reached the same behaviour from the other
645
- > direction, by dropping the `type-label-*` form.
646
-
647
- **Chip** (text with optional dot):
648
-
649
- - **Base**: `.vd-chip`
650
- - **Parts**: `.vd-chip-dot` (5px circle indicator, both sizes)
651
- - **Variants**: `.vd-chip-warning`, `.vd-chip-critical`, `.vd-chip-success`, `.vd-chip-neutral`, `.vd-chip-primary`
652
- - **Sizes**: `.vd-chip-sm` (default), `.vd-chip-md`
653
- - **BG**: default filled, `.vd-chip-bg-no` (unfilled)
654
- - **States**: `.vd-with-ring` (2px inset ring in `Primary/Main`, zero offset)
655
- - **Dimensions**: 9px horizontal padding, 5px vertical padding, pill-shaped
656
- - **Typography**: `text-micro-s-bold` (8px/600/0.4%) — MD uses `text-micro-l-bold` (11px/500)
657
-
658
- **Badge** (circular number indicator):
659
-
660
- - **Base**: `.vd-badge`
661
- - **Variants**: `.vd-badge-warning`, `.vd-badge-critical`, `.vd-badge-success`, `.vd-badge-neutral`, `.vd-badge-primary`
662
- - **Sizes**: `.vd-badge-sm` (default), `.vd-badge-md`
663
- - **BG**: default filled, `.vd-badge-bg-no` (unfilled — removes the circle)
664
- - **States**: `.vd-with-ring` (2px inset ring in `Primary/Main`, zero offset)
665
- - **Dimensions**: 15px × 15px circle, 4px padding — MD is 19px × 19px, 6px padding
666
- - **Typography**: `text-data-micro-s` (8px/500, JetBrains Mono) — MD uses `text-data-micro-l` (11px/500)
667
-
668
- **Dot** (indicator only):
669
-
670
- - **Base**: `.vd-dot`
671
- - **Variants**: `.vd-dot-warning`, `.vd-dot-critical`, `.vd-dot-success`, `.vd-dot-neutral`, `.vd-dot-primary`
672
- - **Sizes**: `.vd-dot-sm` (default, 5px), `.vd-dot-md` (7px)
673
- - **States**: `.vd-with-ring` (2px inset ring in `Primary/Main`, zero offset)
674
- - **Dimensions**: 5px × 5px circle (7px at MD)
675
-
676
- ```html
677
- <!-- Chip with dot -->
678
- <span class="vd-chip vd-chip-warning">
679
- <span class="vd-chip-dot"></span>
680
- <span>Warning</span>
681
- </span>
682
-
683
- <!-- Chip without dot -->
684
- <span class="vd-chip vd-chip-success">Approved</span>
685
-
686
- <!-- BG=no — same colour, unfilled -->
687
- <span class="vd-chip vd-chip-warning vd-chip-bg-no">
688
- <span class="vd-chip-dot"></span>
689
- <span>Warning</span>
690
- </span>
691
- <span class="vd-badge vd-badge-critical vd-badge-bg-no">3</span>
692
-
693
- <!-- Chip with ring state -->
694
- <span class="vd-chip vd-chip-critical vd-with-ring">
695
- <span class="vd-chip-dot"></span>
696
- <span>Critical</span>
697
- </span>
698
-
699
- <!-- Badge (circular number) -->
700
- <span class="vd-badge vd-badge-critical">3</span>
701
- <span class="vd-badge vd-badge-warning vd-with-ring">5</span>
702
-
703
- <!-- Dot (indicator only) -->
704
- <span class="vd-dot vd-dot-success"></span>
705
- <span class="vd-dot vd-dot-warning vd-with-ring"></span>
706
-
707
- <!-- MD size -->
708
- <span class="vd-chip vd-chip-warning vd-chip-md">
709
- <span class="vd-chip-dot"></span>
710
- <span>Warning</span>
711
- </span>
712
- <span class="vd-badge vd-badge-critical vd-badge-md">3</span>
713
- <span class="vd-dot vd-dot-success vd-dot-md"></span>
714
- ```
715
-
716
- #### Switch
717
-
718
- Toggle switch for binary on/off settings with smooth slide animation.
719
-
720
- - **Base**: `.vd-switch` (label wrapper)
721
- - **Parts**: `.vd-switch-input` (checkbox input, visually hidden but accessible)
722
- - **Dimensions**: 32px × 18px track, 14px knob diameter, 2px padding
723
- - **States**: `:hover`, `:focus-visible`, `:checked`, `:disabled`
724
- - **Animation**: Knob slides 14px on toggle with 150ms transition
725
- - **Colors**: Off state uses `Action/Focused`, on state uses `Primary/Main`
726
-
727
- ```html
728
- <!-- Basic switch (unchecked) -->
729
- <label class="vd-switch">
730
- <input type="checkbox" class="vd-switch-input" />
731
- </label>
732
-
733
- <!-- Checked switch -->
734
- <label class="vd-switch">
735
- <input type="checkbox" class="vd-switch-input" checked />
736
- </label>
737
-
738
- <!-- Disabled switches -->
739
- <label class="vd-switch">
740
- <input type="checkbox" class="vd-switch-input" disabled />
741
- </label>
742
- <label class="vd-switch">
743
- <input type="checkbox" class="vd-switch-input" checked disabled />
744
- </label>
745
-
746
- <!-- With label (common pattern) -->
747
- <label
748
- style="display: inline-flex; align-items: center; gap: 8px; cursor: pointer;"
749
- >
750
- <span>Enable feature</span>
751
- <div class="vd-switch">
752
- <input type="checkbox" class="vd-switch-input" checked />
753
- </div>
754
- </label>
755
- ```
756
-
757
- #### Tabs
758
-
759
- A tab item in three styles. Extracted from Figma Tabs (108:653) — Type × Size ×
760
- Hover × Active, 12 variants.
761
-
762
- > Underline was resized on **2026-08-22**: padding 2 → 6 horizontal and 5 → 8
763
- > (lg) / 5 → 6 (sm) vertical, and the height dropped from 44/40 to **32/26**.
764
- > Figma now authors no height on it at all — those fall out of padding plus the
765
- > line box — but they are pinned here because lg's line box comes from an Auto
766
- > line height, which is font-dependent.
767
-
768
- - **Container**: `.vd-tabs` (structural only — see below)
769
- - **Item**: `.vd-tab` **plus a required type class**
770
- - **Types**: `.vd-tab-underline` (32px), `.vd-tab-chip` (26px, 6px radius),
771
- `.vd-tab-segment` (26px, 2px radius)
772
- - **Size**: `.vd-tab-sm` (26px) — **underline only**, Figma draws no small chip or segment
773
- - **Parts**: `.vd-tab-subtitle`; the badge slot is `.vd-badge vd-badge-neutral` from Chip
774
- - **States**: `:hover`, `:focus-visible`, `[aria-selected="true"]` /
775
- `[aria-checked="true"]`, `:disabled`, `.vd-with-ring`
776
-
777
- **Selector or navigator — same styling, different contract:**
778
-
779
- | | markup | ARIA |
780
- | ------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------- |
781
- | navigator (swaps a panel) | `.vd-tabs` › `.vd-tab` | `role="tablist"` › `role="tab"` › `aria-selected`, `aria-controls` → `role="tabpanel"` |
782
- | selector (sets a value) | `.vd-segment-selector` › `.vd-tab vd-tab-segment` | `role="radiogroup"` › `role="radio"` › `aria-checked` |
783
-
784
- Both attributes drive the active styling. Pick the one matching what the control
785
- actually does.
786
-
787
- > **A tab always needs an explicit type class.** Type is a required axis in
788
- > Figma with no default. Giving `.vd-tab` a built-in default meant `:not()` chains
789
- > whose specificity then outranked `.vd-tab-sm`, so small active tabs rendered at
790
- > the large size. Explicit beats clever.
791
-
792
- > **`.vd-tab` must not set `border-none`.** That sets `--tw-border-style: none`,
793
- > which the underline's active rule inherits through
794
- > `border-bottom-style: var(--tw-border-style)` — computing the 2px rule to
795
- > zero. Preflight already gives buttons a 0-width border.
796
-
797
- > **chip and segment are one control with two skins**, differing in exactly two
798
- > declarations: radius (6px vs 2px) and active fill (grey tint vs white).
799
- > Height, padding, gap, every text colour, hover and the active hairline are
800
- > identical. Modifiers, never two components.
801
-
802
- > **Only underline changes weight when active** (500 → 600). chip and segment
803
- > keep 500.
804
-
805
- **Containers.** Figma's Navigation set (994:31364) defines one per type:
806
-
807
- | Figma variant | class | chrome |
808
- | -------------------- | ------------------- | --------------------------------------- |
809
- | Navigation / Tab | `.vd-tabs` | bare row, 8px gap |
810
- | Navigation / chip | `.vd-tabs vd-tabs-chip` | bare row, 12px gap + 12/6 inset padding |
811
- | Navigation / Segment | `.vd-segment-selector` | filled frame, 4px radius, 1px padding |
812
-
813
- > `.vd-tabs` defaults to the underline row since that is the common case;
814
- > `.vd-tabs-chip` overrides it.
815
- >
816
- > **Not encoded:** Figma's Tab variant frame is a fixed 409×35 with 18px
817
- > horizontal and 3px vertical slack it has no padding to account for, and its
818
- > children stretch to 35px rather than their natural 32. That reads as a
819
- > hand-resized frame rather than intent, so the row is derived from gap plus
820
- > item height. Raised with the designer.
821
-
822
- > **Underline hover reaches the active colour** (`Content/Primary`) while
823
- > keeping rest's weight and gaining no rule — it previews the active state
824
- > without asserting it.
825
- >
826
- > This was a no-op until 2026-08-22: hover bound `Content/Secondary`, which
827
- > resolves to the same `#5b5b68` as rest's `Secondary/Main`, so the two were
828
- > indistinguishable and the visual spec could not assert them apart. The
829
- > designer rebound it, and the spec now pins the difference.
830
-
831
- ```html
832
- <!-- Navigator -->
833
- <div class="vd-tabs" role="tablist" aria-label="Sections" style="gap: 16px">
834
- <button
835
- class="vd-tab vd-tab-underline"
836
- role="tab"
837
- aria-selected="true"
838
- aria-controls="p1"
839
- >
840
- Overview<span class="vd-badge vd-badge-neutral">3</span>
841
- </button>
842
- <button
843
- class="vd-tab vd-tab-underline"
844
- role="tab"
845
- aria-selected="false"
846
- aria-controls="p2"
847
- >
848
- Documents
849
- </button>
850
- </div>
851
- <div id="p1" role="tabpanel">…</div>
852
-
853
- <!-- Small underline -->
854
- <button class="vd-tab vd-tab-underline vd-tab-sm" role="tab" aria-selected="true">
855
- Overview
856
- </button>
857
-
858
- <!-- With a subtitle -->
859
- <button class="vd-tab vd-tab-underline" role="tab" aria-selected="true">
860
- <span>Overview<span class="vd-tab-subtitle">APPLICANT</span></span>
861
- </button>
862
-
863
- <!-- Chip -->
864
- <button class="vd-tab vd-tab-chip" role="tab" aria-selected="true">Overview</button>
865
- ```
866
-
867
- #### SegmentSelector
868
-
869
- The framed container that wraps segment tabs. Extracted from Figma Segment
870
- Selector (784:34686): _"Horizontal segmented control combining multiple filter
871
- segments. Use for toggling between 2-5 mutually exclusive options."_
872
-
873
- - **Base**: `.vd-segment-selector` (`surface-frame` fill, 4px radius, 1px padding, no gap)
874
- - **Modifier**: `.vd-segment-selector-fill` — equal-width segments, **not from Figma**
875
- - **Children**: `.vd-tab vd-tab-segment`
876
- - **States**: `:focus-visible`, `.vd-with-ring`
877
-
878
- It is a **parent of Tabs, not a variant of it** — Figma composes it literally
879
- from `Tabs Type=segment` instances.
880
-
881
- > **There is no sliding thumb.** The selected state is styling on the selected
882
- > child — white fill, 0.5px hairline, darker text — and Figma models no
883
- > indicator layer. No shadow either; most segmented controls elevate the active
884
- > thumb, this one uses the hairline. Any slide animation would be invented.
885
-
886
- > **Children hug their labels and do not shrink.** Figma's 160px example is
887
- > content-driven — its two segments are 79px only because both labels are the
888
- > string "Overview". Adding segments **grows the container**; there is no
889
- > overflow handling, which is why the description caps it at 2–5. Use
890
- > `.vd-segment-selector-fill` when you want equal widths.
891
-
892
- > Deliberately no `:focus-within` on the frame — focus lands on a segment,
893
- > which rings itself, and ringing the frame too would double it.
894
-
895
- ```html
896
- <div class="vd-segment-selector" role="radiogroup" aria-label="Density">
897
- <button class="vd-tab vd-tab-segment" role="radio" aria-checked="true">
898
- Compact
899
- </button>
900
- <button class="vd-tab vd-tab-segment" role="radio" aria-checked="false">
901
- Comfortable
902
- </button>
903
- </div>
904
-
905
- <!-- Equal-width -->
906
- <div
907
- class="vd-segment-selector vd-segment-selector-fill"
908
- role="radiogroup"
909
- aria-label="View"
910
- >
911
- <button class="vd-tab vd-tab-segment" role="radio" aria-checked="true">All</button>
912
- <button class="vd-tab vd-tab-segment" role="radio" aria-checked="false">
913
- Needs review
914
- </button>
915
- </div>
916
- ```
917
-
918
- #### Breadcrumbs
919
-
920
- Hierarchical navigation path. **Rebuilt 2026-08-25** against a restructured
921
- Figma design, which splits the component across three nodes: Breadcrumb Item
922
- (1046:22649), Breadcrumb Separator (1046:22654) and the Breadcrumbs container
923
- (880:31218).
924
-
925
- - **Base**: `.vd-breadcrumbs` (the row, 8px gap)
926
- - **Crumbs**: `.vd-breadcrumb`, `.vd-breadcrumb-current`, `.vd-breadcrumb-home`
927
- - **Separators**: `.vd-breadcrumb-separator`, `+ -dot`
928
- - **States**: `:hover`, `:focus-visible`
929
-
930
- | Item state | treatment |
931
- | ---------------- | ------------------------------------------------------- |
932
- | ancestor | `text-body-1` (13/19.5/400), `Content/Secondary` |
933
- | `-current` | `text-body-1-bold` (13/19.5/**500**), `Content/Primary` |
934
- | `:hover` | 0.5px rule under the label in **`currentColor`** |
935
- | `:focus-visible` | `focus-ring` — 2px `Primary/Main` |
936
-
937
- > **The crumb is a box now, not a bare text node.** Figma gives it 2px/4px
938
- > padding and a 4px radius (`Radius/XS`) — which is what gives the focus ring
939
- > something to draw around. Height stays content-driven (2 + 19.5 + 2 = 23.5
940
- > against Figma's 24px frame); there is no border, so the hairline trap that
941
- > forces explicit heights elsewhere does not apply.
942
-
943
- > **The type is bound now.** The previous revision documented it as "raw
944
- > throughout"; Figma now binds `Body Content/Body 1` and `Body 1 - Bold`, which
945
- > map exactly onto `--text-body-1` and `--text-body-1-bold`. So the current crumb
946
- > steps its **weight** as well as its colour, and the old `leading: normal` is
947
- > gone — 19.5px is authored. The visual spec used to assert the exact opposite.
948
-
949
- > **Hover is painted as a gradient band, not `text-decoration` — and that is
950
- > forced.** Chrome renders `text-decoration-thickness: 0.5px` as a full 1px;
951
- > measured at 1x and 2x, the 0.5 and 1 cases came out byte-identical. A
952
- > background gradient antialiases and carries the authored 0.5 exactly (verified:
953
- > 0.500px painted at both densities). Same trap, same fix, as LoadingIndicator's
954
- > ring. Because the rule is `currentColor`, one declaration reproduces both of
955
- > Figma's hover colours — `#5b5b68` on an ancestor, `#16161a` on a current item.
956
-
957
- > **Figma draws focus as a 2px inside border; we use the outline ring.** Same
958
- > width, same `Primary/Main`, same position (the ring's offset is negative). It
959
- > also keeps focus from reflowing the row, which a real border would do by adding
960
- > 4px to a content-driven box.
961
-
962
- > **The separators are uniform now** — both chevron and slash are 12px Inter
963
- > Regular in `Content/Tertiary`. The previous revision documented three
964
- > inconsistent treatments (13 Regular / 12 Regular / 13 Bold) and reproduced them
965
- > as deliberate optical corrections; the designer has since regularised them.
966
- > `.vd-breadcrumb-separator-chevron` is **retained as a no-op** so existing markup
967
- > keeps working — it restates the base and is safe to drop.
968
-
969
- > **Separators must carry `aria-hidden="true"`.** They are decorative text;
970
- > without it a screen reader announces "greater than" / "slash" / "middot"
971
- > between every crumb.
972
-
973
- > **The middot is not a Separator instance.** In the slash variant Figma draws it
974
- > as a loose text node at 13px Inter **Regular** — a different size from the 12px
975
- > separators, and Regular where it used to be Bold. It joins two facets of one
976
- > location rather than two levels of hierarchy.
977
-
978
- > **Colour and weight mark depth, not position.** In the slash variant **both**
979
- > trailing items are current, because the ID and the business name are two halves
980
- > of one location — so `-current` is not "the last child".
981
-
982
- > **The home icon is `Content/Tertiary`**, a step lighter than the crumbs beside
983
- > it. Previously inferred from a render; now confirmed by sampling the
984
- > restructured container at full opacity.
985
-
986
- > **`.breadcrumb-mono` was removed in this rebuild** — a breaking change, see
987
- > [CHANGELOG.md](CHANGELOG.md). The redesign renders `#BA-204417` as an ordinary
988
- > current item in Inter Medium, so the JetBrains Mono 700 treatment has no basis
989
- > in Figma any more. Add `font-mono` at the call site if you still want it.
990
-
991
- > **Still class-only:** `aria-current="page"` is documented and correct for
992
- > assistive tech, but nothing selects it — `.vd-breadcrumb-current` drives the
993
- > styling. Parked for the accessibility pass.
994
-
995
- ```html
996
- <nav class="vd-breadcrumbs" aria-label="Breadcrumb">
997
- <svg class="vd-breadcrumb-home vd-icon vd-icon-size-14" aria-hidden="true">
998
- <use href="#home" />
999
- </svg>
1000
- <span class="vd-breadcrumb-separator" aria-hidden="true">&gt;</span>
1001
- <a class="vd-breadcrumb" href="/applications">Applications</a>
1002
- <span class="vd-breadcrumb-separator" aria-hidden="true">&gt;</span>
1003
- <span class="vd-breadcrumb vd-breadcrumb-current" aria-current="page"
1004
- >#BA-204417</span
1005
- >
1006
- </nav>
1007
-
1008
- <!-- slash variant: two current items joined by the loose middot -->
1009
- <nav class="vd-breadcrumbs" aria-label="Breadcrumb">
1010
- <a class="vd-breadcrumb" href="/queue">Queue</a>
1011
- <span class="vd-breadcrumb-separator" aria-hidden="true">/</span>
1012
- <span class="vd-breadcrumb vd-breadcrumb-current">#BA-204417</span>
1013
- <span class="vd-breadcrumb-separator vd-breadcrumb-separator-dot" aria-hidden="true"
1014
- >&middot;</span
1015
- >
1016
- <span class="vd-breadcrumb vd-breadcrumb-current" aria-current="page"
1017
- >Northwind Freight LLC</span
1018
- >
1019
- </nav>
1020
- ```
1021
-
1022
- #### Step
1023
-
1024
- A single marker in a stepped progression. Extracted from Figma Step (1032:2012)
1025
- — 3 variants on a `State` axis, plus a Step Title boolean.
1026
-
1027
- - **Base**: `.vd-step` (the `completed` state — Figma's default)
1028
- - **States**: `.vd-step-active`, `.vd-step-upcoming`
1029
- - **Parts**: `.vd-step-marker` (24px circle), `.vd-step-label`
1030
-
1031
- | State | marker fill | marker border | content | label |
1032
- | ----------- | --------------- | ----------------------- | ------------- | -------------------------- |
1033
- | completed | `Primary/Main` | none | 12px `#check` | `Content/Tertiary`, Medium |
1034
- | `-active` | `Surface/Paper` | **2px** `Primary/Main` | number | `Primary/Main`, Medium |
1035
- | `-upcoming` | `Surface/Paper` | **1px** `Content/Faint` | number | `Neutral/Strong`, Regular |
1036
-
1037
- > **The label ramp is inverted, and that is not a transcription error.** A
1038
- > completed step's label is `Content/Tertiary` (#727280) while an upcoming one is
1039
- > `Neutral/Strong` (#4e4e59) — so the step you have _finished_ is drawn lighter
1040
- > than the one you have not reached. The weights disagree in the other direction
1041
- > (Medium vs Regular). Reproduced faithfully and pinned in the spec; on the
1042
- > designer list, because one of the two looks like it was meant to go the other
1043
- > way.
1044
-
1045
- > **The border widths are different tokens**, not one value at two sizes —
1046
- > active binds `Stroke/Micro` (2px), upcoming `Stroke/Line` (1px). Completed
1047
- > draws none; a transparent border keeps all three markers at 24px under
1048
- > border-box so a mixed row shares a baseline.
1049
-
1050
- > Figma writes the marker fill as a literal white rather than binding
1051
- > `Surface/Paper`. The value is identical, so it is mapped to the token.
1052
-
1053
- #### Stepper
1054
-
1055
- A row of Steps joined by progress connectors. Extracted from Figma Stepper
1056
- (1032:2013) — one symbol with a Stepper Title boolean.
1057
-
1058
- - **Base**: `.vd-stepper`
1059
- - **Parts**: `.vd-stepper-title`, `.vd-stepper-steps`, `.vd-stepper-connector`,
1060
- `.vd-stepper-connector-complete`
1061
- - **Slots (reused components)**: `.vd-step`
1062
-
1063
- > **The connectors carry the progress, not the steps.** Each is `flex-1`, so it
1064
- > absorbs whatever the labels leave — which is why Figma's step instances are
1065
- > 38 / 38 / 41 / 51px wide while every connector is the same 70.67px. Its colour
1066
- > says whether that _segment_ is behind you: `Primary/Main` when passed,
1067
- > `Stroke/Border` when not. Incomplete is the default even though Figma's first
1068
- > two instances are filled, so an empty stepper implies no progress it has not
1069
- > made.
1070
-
1071
- > **The connectors sit 9px below the marker centres**, and that is faithful: the
1072
- > row is `items-center` over a 42px step (24 marker + 6 gap + 12 label), so a 2px
1073
- > line centres at y=21 while the marker centres at y=12. Figma places its lines
1074
- > at exactly y=20 for the same reason. Most steppers align the two, so this may
1075
- > be unintended — but it is what the file draws.
1076
-
1077
- > **The step number is a text slot, and the design file still shows the wrong
1078
- > ones.** As of 2026-08-25 Figma does expose a `Stepper Number` text property on
1079
- > Step (1032:2012), defaulting to `"1"` — but the Stepper's own four instances
1080
- > (1032:2013) pass only `label` and `state` and never set it, so every marker
1081
- > falls back to the default and the design file renders **"1" four times**. The
1082
- > property exists; it is simply not applied. Our stories pass real numbers
1083
- > (`i + 1`, so the active and upcoming markers read 3 and 4), which is what the
1084
- > flow should look like. No CSS is involved either way — the number is the
1085
- > marker's text content. **Do not copy the numbering from the design file.**
1086
-
1087
- > **The root's white fill and 8px radius are not reproduced.** Figma sets both on
1088
- > a frame with no padding, border or shadow, so the fill hugs the content exactly
1089
- > and the radius clips nothing — the white would be wrong on any surface that is
1090
- > not already white. Same call as Progress Bar's root radius.
1091
-
1092
- > **The title is `Content/Secondary`** where Progress Bar's otherwise identical
1093
- > 11px uppercase title is `Content/Primary`. Both raw; the difference may be
1094
- > unintentional, and the spec pins it either way.
1095
-
1096
- ```html
1097
- <div class="vd-stepper">
1098
- <p class="vd-stepper-title">Stepped progression flow</p>
1099
- <div class="vd-stepper-steps">
1100
- <div class="vd-step">
1101
- <span class="vd-step-marker">
1102
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
1103
- <use href="#check" />
1104
- </svg>
1105
- </span>
1106
- <span class="vd-step-label">Intake</span>
1107
- </div>
1108
- <span class="vd-stepper-connector vd-stepper-connector-complete"></span>
1109
- <div class="vd-step vd-step-active" aria-current="step">
1110
- <span class="vd-step-marker">2</span>
1111
- <span class="vd-step-label">Review</span>
1112
- </div>
1113
- <span class="vd-stepper-connector"></span>
1114
- <div class="vd-step vd-step-upcoming">
1115
- <span class="vd-step-marker">3</span>
1116
- <span class="vd-step-label">Decision</span>
1117
- </div>
1118
- </div>
1119
- </div>
1120
- ```
1121
-
1122
- #### ProgressBar
1123
-
1124
- Extracted from Figma Progress Bar (1032:1991) — 2 variants, plus Top Content and
1125
- Bottom Content booleans.
1126
-
1127
- - **Base**: `.vd-progress-bar` (the Primary colour scheme)
1128
- - **Scheme**: `.vd-progress-bar-success` (the Approved ramp)
1129
- - **Parts**: `.vd-progress-bar-header`, `-title`, `-value`, `-track`, `-fill`,
1130
- `-legend`, `-legend-item`, `-legend-swatch`, `-legend-swatch-neutral`,
1131
- `-legend-label`
1132
-
1133
- > **Figma's variant property is misnamed.** The axis is called `Has Legend`, but
1134
- > it does not control the legend — **both** variants render the legend row,
1135
- > which is gated by a separate `Bottom Content` boolean that is true in each.
1136
- > What it actually swaps is the colour scheme, so it ships as a colour modifier
1137
- > and is renamed: a class called `has-legend` that changes colour would be worse
1138
- > than the original mistake. On the designer list.
1139
-
1140
- | Scheme | value text | fill + first swatch |
1141
- | ---------- | ------------------------ | --------------------- |
1142
- | base | `Primary/Main` | `Primary/Main` |
1143
- | `-success` | `Approved/`**`Content`** | `Approved/`**`Main`** |
1144
-
1145
- > **The success scheme splits two Approved tokens** — `Approved/Content` for the
1146
- > value text, `Approved/Main` for the fill and swatch. The same split Modal's
1147
- > positive variant has.
1148
-
1149
- > **The `false` variant contradicts itself three ways**, so do not treat its
1150
- > numbers as a spec: its value label reads 92%, its fill is 260 of 360 (72%),
1151
- > and its legend says 68%. The `true` variant is consistent at 92/92/92, so the
1152
- > blue one looks like an un-updated duplicate. Also on the designer list.
1153
-
1154
- > **The track is full width here.** Figma fixes it at 360px inside a 400px frame
1155
- > while the label and legend rows are both full width, so the bar stops 40px
1156
- > short of everything above and below it, with no padding to explain it. Treated
1157
- > as a slip — a progress track that does not span its container is not
1158
- > shippable. Same judgement as Alert's 828px.
1159
-
1160
- > **The root's 8px radius is vestigial** and is not reproduced: Figma sets it on
1161
- > a frame with no fill and no border, so it clips nothing and paints nothing.
1162
-
1163
- > **The type is raw** — Figma binds no text style to any of the three. The
1164
- > value's 13px Inter Medium happens to equal `--text-action-l`, but that is a
1165
- > Button & Actions token, and coupling a progress readout to it would mean a
1166
- > button change silently moved this.
1167
-
1168
- > **The fill width is the consumer's** — set it inline or with a utility, and
1169
- > mirror it in `aria-valuenow`.
1170
-
1171
- ```html
1172
- <div class="vd-progress-bar vd-progress-bar-success">
1173
- <div class="vd-progress-bar-header">
1174
- <span class="vd-progress-bar-title">Review completion</span>
1175
- <span class="vd-progress-bar-value">92%</span>
1176
- </div>
1177
-
1178
- <div
1179
- class="vd-progress-bar-track"
1180
- role="progressbar"
1181
- aria-valuenow="92"
1182
- aria-valuemin="0"
1183
- aria-valuemax="100"
1184
- aria-label="Review completion"
1185
- >
1186
- <div class="vd-progress-bar-fill" style="width: 92%"></div>
1187
- </div>
1188
-
1189
- <div class="vd-progress-bar-legend">
1190
- <span class="vd-progress-bar-legend-item">
1191
- <span class="vd-progress-bar-legend-swatch"></span>
1192
- <span class="vd-progress-bar-legend-label">92% verified</span>
1193
- </span>
1194
- <span class="vd-progress-bar-legend-item">
1195
- <span
1196
- class="vd-progress-bar-legend-swatch vd-progress-bar-legend-swatch-neutral"
1197
- ></span>
1198
- <span class="vd-progress-bar-legend-label">8% unaccounted</span>
1199
- </span>
1200
- </div>
1201
- </div>
1202
- ```
1203
-
1204
- #### LoadingIndicator
1205
-
1206
- Extracted from Figma Loading Indicator (1028:1992) — 8 variants across Type
1207
- (Circle / Dots) × Size (XS / SM / MD / LG).
1208
-
1209
- - **Base**: `.vd-loading-indicator` (Circle, XS)
1210
- - **Type**: `.vd-loading-indicator-dots` + three `.vd-loading-indicator-dot` children
1211
- - **Sizes**: `.vd-loading-indicator-sm` (16), `-md` (24), `-lg` (32); XS (12) is default
1212
-
1213
- | Size | box | ring |
1214
- | ---- | --- | ---- |
1215
- | XS | 12 | 1.5 |
1216
- | SM | 16 | 2 |
1217
- | MD | 24 | 2.52 |
1218
- | LG | 32 | 3.04 |
1219
-
1220
- > **Both types were flattened to SVG in Figma** — `get_design_context` returns an
1221
- > `<img>` and no variables at all — so every value was read out of the exported
1222
- > asset and cross-checked against the rendered PNG.
1223
-
1224
- > **The circle is a masked conic-gradient, not a border**, and that is what lets
1225
- > it carry Figma's authored values exactly. Chrome **floors** fractional
1226
- > `border-width` — measured at 1x and 2x, `1.5px` computes to `1px` — so a
1227
- > bordered ring cannot express 1.5 or 2.52 at all. An earlier revision shipped
1228
- > integers (2/2/3/3) to compensate, on the strength of a pixel trace that was
1229
- > wrong; the result was an XS ring a third thicker than the design, on the
1230
- > default size and the one embedded in every Loading Inline variant. Tracing by
1231
- > pixel _coverage_ rather than a binary test gives Figma 1.56 / 2.00 / 2.50 /
1232
- > 3.11 — the authored values. A mask has no rounding, so those ship verbatim.
1233
- >
1234
- > One coloured quarter of a conic-gradient is the same 90° arc a single coloured
1235
- > border side used to draw — `Primary/Main` over a `Stroke/Divider` track.
1236
-
1237
- > **The dots' diameter and gap are always the same number**, which is why each
1238
- > Figma frame is exactly 5× its height. One custom property drives both. Fill is
1239
- > `Secondary/Main` — _not_ the circle's Primary.
1240
-
1241
- > **The animation is not in Figma.** Both types are static vectors there: no
1242
- > prototype, no timing, no easing. The motion is a library decision — 0.8s
1243
- > linear spin, 1.4s staggered opacity pulse — and is on the designer list.
1244
- > `prefers-reduced-motion: reduce` stops both, which is why every usage needs
1245
- > `role="status"` and a label.
1246
-
1247
- > **Motion is unasserted in the visual spec** by necessity: the harness injects
1248
- > `animation: none !important` so mid-animation values cannot corrupt colour
1249
- > checks. It is exercised in the Motion story instead.
1250
-
1251
- ```html
1252
- <span
1253
- class="vd-loading-indicator vd-loading-indicator-md"
1254
- role="status"
1255
- aria-label="Loading"
1256
- ></span>
1257
-
1258
- <span
1259
- class="vd-loading-indicator vd-loading-indicator-dots"
1260
- role="status"
1261
- aria-label="Loading"
1262
- >
1263
- <span class="vd-loading-indicator-dot"></span>
1264
- <span class="vd-loading-indicator-dot"></span>
1265
- <span class="vd-loading-indicator-dot"></span>
1266
- </span>
1267
- ```
1268
-
1269
- #### LoadingInline
1270
-
1271
- A loading indicator paired with a label. Extracted from Figma Loading Inline
1272
- (1028:2013) — 4 variants on a single `Size` axis.
1273
-
1274
- - **Base**: `.vd-loading-inline` (XS)
1275
- - **Sizes**: `.vd-loading-inline-sm`, `-md`, `-lg`
1276
- - **Slots (reused components)**: `.vd-loading-indicator`
1277
-
1278
- | Size | gap | label / leading |
1279
- | ---- | --- | --------------- |
1280
- | XS | 6 | 11 / 17 |
1281
- | SM | 8 | 12 / 18 |
1282
- | MD | 10 | 14 / 21 |
1283
- | LG | 12 | 16 / 24 |
1284
-
1285
- > **The indicator is 12px at every size.** Figma embeds a `Size=XS` Loading
1286
- > Indicator instance in all four variants while the gap and label scale around
1287
- > it — visible in the rendered frames as a constant spinner beside growing text.
1288
- > Reproduced faithfully, which is why the nested `.vd-loading-indicator` needs no
1289
- > size class: its own default is already 12px. Flagged for the designer, since
1290
- > at LG it reads small against 16px text.
1291
-
1292
- > **Only SM maps to a token.** Its 12/18 is exactly `--text-caption`; 11/17,
1293
- > 14/21 and 16/24 have no equivalent, and `--text-subtitle` is the nearest 14px
1294
- > but carries 19.6px leading and Medium weight. All four are written directly so
1295
- > they read consistently. On the designer list.
1296
-
1297
- ```html
1298
- <span class="vd-loading-inline vd-loading-inline-md" role="status">
1299
- <span class="vd-loading-indicator"></span>
1300
- Loading...
1301
- </span>
1302
- ```
1303
-
1304
- #### Divider
1305
-
1306
- Content separator for visual breaks between sections. Extracted from Figma
1307
- Divider (880:31270) — 3 variants on a single `Type` axis.
1308
-
1309
- - **Simple**: `.vd-divider` (a 1px rule; works on an `<hr>`)
1310
- - **Labeled**: `.vd-divider-labeled` + `.vd-divider-label`, flanked by two `.vd-divider`s
1311
- - **Metadata**: `.vd-divider-metadata`, `-item`, `-key`, `-value`, `-separator`
1312
-
1313
- > **The three types are structurally incompatible**, so they are not modifiers
1314
- > of one base. `simple` is a single element; `labeled` and `metadata` are flex
1315
- > rows with children. `.vd-divider-labeled` and `.vd-divider-metadata` stand alone and
1316
- > do **not** take `.vd-divider` — the same shape as `.vd-link-inline`.
1317
-
1318
- > **`.vd-divider` is the simple type**, which is a deliberate departure: Figma's
1319
- > default variant is `labeled`, but a bare `.vd-divider` cannot render it — labeled
1320
- > needs three children. Naming the plainest form after the component is the only
1321
- > reading that works, and it is what makes the reuse below possible.
1322
-
1323
- > **Labeled is built from two `.vd-divider`s**, exactly as Figma models it: the
1324
- > variant contains two Line children flanking the text. They flex, so the label
1325
- > stays centred at any container width.
1326
-
1327
- > **Two different stroke tokens, easy to conflate:**
1328
- >
1329
- > | | token | |
1330
- > | ------------------------ | ---------------- | --------------------- |
1331
- > | horizontal rules | `Stroke/Divider` | `rgba(20,20,40,0.08)` |
1332
- > | metadata's vertical bars | `Stroke/Border` | `rgba(20,20,40,0.13)` |
1333
- >
1334
- > The vertical separators really are the heavier of the two.
1335
-
1336
- > **The rules are backgrounds, not borders.** Figma draws them as 1px lines on
1337
- > zero-height frames; here they are a 1px box with a background, which sidesteps
1338
- > the border-box hairline trap entirely — nothing in this component needs a
1339
- > pinned height.
1340
-
1341
- > **No text style is bound anywhere in this component**, on either type —
1342
- > verified. The labeled label's _values_ match `Label S Sans - Bold`
1343
- > (10px/12px/600/0.1em) but nothing binds it, so it uses `text-label-s-bold`.
1344
-
1345
- > **Casing is the consumer's.** It previously used the `type-label-*` form, which
1346
- > adds `text-transform: uppercase` — but Figma applies no transform; the caps are
1347
- > typed into the sample string. Forcing them meant a label passed as "Beneficial
1348
- > owners" came back shouted. Chip leaves casing alone for the same reason; both
1349
- > now agree.
1350
-
1351
- > **The metadata type is raw too**: keys are 12px Inter Regular and values 12px
1352
- > Inter Medium, both with Auto leading, so `--text-caption` is the wrong fit
1353
- > despite matching the size — its 18px line-height would make the row 18px where
1354
- > Figma is 16.
1355
-
1356
- > **Mono is a call-site choice.** Figma's sample renders its _date_ value in
1357
- > JetBrains Mono Medium while the other two are Inter Medium — an instance
1358
- > override for data, not a rule. `.vd-divider-metadata-value` stays Inter; add
1359
- > `font-mono` where the value is data.
1360
-
1361
- ```html
1362
- <hr class="vd-divider" />
1363
-
1364
- <div class="vd-divider-labeled">
1365
- <hr class="vd-divider" />
1366
- <span class="vd-divider-label">Beneficial owners</span>
1367
- <hr class="vd-divider" />
1368
- </div>
1369
-
1370
- <div class="vd-divider-metadata">
1371
- <span class="vd-divider-metadata-item">
1372
- <span class="vd-divider-metadata-key">Updated</span>
1373
- <span class="vd-divider-metadata-value font-mono">Jul 17</span>
1374
- </span>
1375
- <span class="vd-divider-metadata-separator"></span>
1376
- <span class="vd-divider-metadata-item">
1377
- <span class="vd-divider-metadata-key">Reviewer</span>
1378
- <span class="vd-divider-metadata-value">M. Carden</span>
1379
- </span>
1380
- </div>
1381
- ```
1382
-
1383
- #### Link
1384
-
1385
- Hyperlink styles for navigation and inline references. Extracted from Figma Link
1386
- (880:31368) — 15 variants across Style × State (default / hover / pressed).
1387
-
1388
- - **Base**: `.vd-link` (the `strong` style)
1389
- - **Styles**: `.vd-link-strong`, `.vd-link-quiet`, `.vd-link-monospace`, `.vd-link-critical`
1390
- - **Prose**: `.vd-link-inline` — a paragraph class, **not** used with `.vd-link`
1391
- - **States**: `:hover`, `:active`, `:focus-visible`, `[aria-disabled="true"]`
1392
-
1393
- | Style | type | rest | hover | pressed |
1394
- | ------------ | --------------------------- | ------------------- | ----------------- | ------------------ |
1395
- | `strong` | Inter SemiBold 14 | `Primary/Main` | `Primary/Dark` | `Primary/Pressed` |
1396
- | `-quiet` | Inter Regular 14 | `Content/Secondary` | `Primary/Main` | `Primary/Dark` |
1397
- | `-monospace` | JetBrains Mono Medium 13 | `Content/Primary` | `Primary/Main` | `Primary/Dark` |
1398
- | `-critical` | Inter Medium 14 + 12px icon | `Critical/Main` | `Critical/Strong` | `Critical/Content` |
1399
- | `-inline` | Inter Regular 12 (Caption) | `Primary/Main` | `Primary/Dark` | `Primary/Pressed` |
1400
-
1401
- > **`strong` is the only style whose underline is a state.** It has none at rest
1402
- > and gains one on hover and pressed; the other three are underlined throughout.
1403
- > That is the most surprising thing about this component.
1404
-
1405
- > **The ramps differ in length.** `strong` and `inline` run Main → Dark →
1406
- > Pressed; `quiet` and `monospace` only reach Dark, because they _start_ outside
1407
- > the primary ramp. Do not regularise them.
1408
-
1409
- > **`inline` is a paragraph, not a link.** Figma draws body copy carrying
1410
- > anchors, so the class goes on the block and its `<a>` children are styled as
1411
- > descendants. It deliberately does not take `.vd-link`.
1412
-
1413
- > **The type is raw.** Figma binds no text style to the four standalone styles —
1414
- > only `inline` carries one (`Body Content/Caption` → `--text-caption`). The
1415
- > nearest token to 14px Inter is `--text-subtitle`, but it is Medium/500 with a
1416
- > 19.6px line-height where these are Auto in a 17px box, so two of its three
1417
- > properties would need overriding. Sizes and weights are written directly
1418
- > rather than force-fitted. On the designer list.
1419
-
1420
- > **`Critical/Content` was added to the theme for this component** — a real
1421
- > Figma variable that was missing because nothing had applied it. See the token
1422
- > section's note on `get_variable_defs`.
1423
-
1424
- ```html
1425
- <a class="vd-link" href="/report">Open full report →</a>
1426
- <a class="vd-link vd-link-quiet" href="/log">View activity log</a>
1427
- <a class="vd-link vd-link-monospace" href="/case">#BA-204417</a>
1428
-
1429
- <a class="vd-link vd-link-critical" href="/fix">
1430
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
1431
- <use href="#alert-triangle" />
1432
- </svg>
1433
- Resolve mismatch
1434
- </a>
1435
-
1436
- <!-- inline: a paragraph, styled on its anchors -->
1437
- <p class="vd-link-inline">
1438
- Valiify utilizes <a href="/middesk">Middesk</a> for instant background
1439
- screenings.
1440
- </p>
1441
- ```
1442
-
1443
- #### FilterSegment
1444
-
1445
- Individual segment within a segmented filter control. Extracted from Figma
1446
- Filter Segment (678:21020) — 18 variants across Position × Hover × Selected ×
1447
- Size, plus Text, Icon and Ring booleans.
1448
-
1449
- - **Base**: `.vd-filter-segment` (the `middle` position, sm)
1450
- - **Position**: `.vd-filter-segment-first`, `.vd-filter-segment-last`
1451
- - **Size**: `.vd-filter-segment-md` (28px); sm (21px) is the default
1452
- - **Group**: `.vd-filter-segments`
1453
- - **States**: `:hover`, `[aria-pressed="true"]` / `[aria-selected="true"]`,
1454
- `:focus-visible`, `:disabled`, `.vd-with-ring`
1455
- - **Slots (reused components)**: `.vd-icon-button vd-icon-button-md`
1456
-
1457
- **Segments share their edges**, which is the whole point of the position axis:
1458
-
1459
- | Position | borders | radius |
1460
- | ------------- | ------------------------------- | ------------- |
1461
- | middle (base) | top / right / bottom | none |
1462
- | `-first` | top / right / bottom / **left** | rounded left |
1463
- | `-last` | top / right / bottom | rounded right |
1464
-
1465
- Each segment's right border is the divider to the next, so no pair ever doubles
1466
- up. `first` adds the group's left edge; `last` needs nothing extra, because its
1467
- own right border closes the group.
1468
-
1469
- > **Middle is the base** because it is Figma's default variant. A lone segment
1470
- > therefore renders square and open on the left — correct for the model, rarely
1471
- > what you want. Mark the ends explicitly.
1472
-
1473
- > **Position is three booleans in Figma**, not one enum: `First`, `Middle` and
1474
- > `Last` are separate yes/no properties with exactly one ever set. That is an
1475
- > authoring choice rather than a real distinction, so it collapses to two
1476
- > modifier classes here. On the designer list.
1477
-
1478
- > **Both heights are pinned** (21 / 28px). Figma fixes them, and the 0.5px
1479
- > hairlines would each add 2px under border-box. The two sizes share padding,
1480
- > gap and type entirely — md is purely a taller box.
1481
-
1482
- > **Hover and selected replace the fill**, they do not tint it. Rest is the
1483
- > opaque `Surface/Card`; both other states drop to a translucent `Action` token,
1484
- > so the page shows through rather than the card. Figma draws no
1485
- > hover-and-selected combination, and the hover rule excludes selected by name.
1486
-
1487
- > **The Figma example expresses "label vs value" through text overrides, not
1488
- > states.** In 1018:33960 every segment keeps the _rest_ background; the
1489
- > operator is `Content/Secondary`, the values are `Content/Primary`, and the
1490
- > chosen one steps to `Micro L - Bold`. That is a usage pattern, so it lives in
1491
- > the story rather than in a class.
1492
-
1493
- > **Every segment is a control.** Use a `<button>` (or `<a>`) for each, so the
1494
- > whole group is keyboard-reachable and each segment can carry its own action —
1495
- > a filter row where only some segments tab is worse than one where none do. An
1496
- > earlier revision used `<div>` for the value segments, which silently dropped
1497
- > the first and third out of the tab order. The icon segment stays a non-button
1498
- > element wrapping the Icon Button, because nesting a button inside a button is
1499
- > invalid HTML; the icon button is itself focusable.
1500
-
1501
- ```html
1502
- <div class="vd-filter-segments">
1503
- <button
1504
- class="vd-filter-segment vd-filter-segment-first vd-filter-segment-md text-content-primary"
1505
- >
1506
- Product
1507
- </button>
1508
- <button class="vd-filter-segment vd-filter-segment-md">Is any of</button>
1509
- <button
1510
- class="vd-filter-segment vd-filter-segment-md text-micro-l-bold text-content-primary"
1511
- >
1512
- Deposit Account
1513
- </button>
1514
- <span class="vd-filter-segment vd-filter-segment-last vd-filter-segment-md">
1515
- <button class="vd-icon-button vd-icon-button-md" aria-label="Remove filter">
1516
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#x" /></svg>
1517
- </button>
1518
- </span>
1519
- </div>
1520
-
1521
- <!-- as a toggle group -->
1522
- <div class="vd-filter-segments" role="group" aria-label="Match mode">
1523
- <button class="vd-filter-segment vd-filter-segment-first" aria-pressed="true">
1524
- All
1525
- </button>
1526
- <button class="vd-filter-segment" aria-pressed="false">Any</button>
1527
- <button class="vd-filter-segment vd-filter-segment-last" aria-pressed="false">
1528
- None
1529
- </button>
1530
- </div>
1531
- ```
1532
-
1533
- #### Pagination
1534
-
1535
- Page navigation controls for multi-page data sets. Extracted from Figma
1536
- Pagination (880:31248) — 2 variants on a single `Type` axis.
1537
-
1538
- - **Base**: `.vd-pagination` (the bar — both types share it)
1539
- - **Numbered parts**: `.vd-pagination-pages`, `.vd-pagination-summary`
1540
- - **Simple parts**: `.vd-pagination-status`, `.vd-pagination-status-current`
1541
- - **Slots (reused components)**: `.vd-pagination-item` cells (numbered),
1542
- `.vd-btn vd-btn-outline vd-btn-sm` (simple's Prev / Next)
1543
-
1544
- > **Both types share the same root, so there is no modifier class.** Figma draws
1545
- > `flex items-center justify-between` at full width for each; only the children
1546
- > differ. A `.pagination-simple` that set nothing would be noise.
1547
-
1548
- > **Everything interactive is an existing component.** Simple's Prev and Next
1549
- > are literal Button instances, and their Figma geometry — 24px tall, 8px/5px
1550
- > padding, 5px gap, 6px radius, 0.5px `Stroke/Divider`, `Action S` 12/500 in
1551
- > `Content/Primary` — is `.vd-btn vd-btn-outline vd-btn-sm` down to the pixel, with a
1552
- > 13px icon.
1553
-
1554
- > **Two Figma oddities, reported rather than reproduced.** The numbered bar's
1555
- > _trailing_ nav cell points **left**, identical to the leading one — the
1556
- > instance was never flipped; ours points right, because a "next" arrow that
1557
- > points backwards is not a design decision. And the two types use different
1558
- > arrow families: numbered cells carry chevrons, simple's buttons carry true
1559
- > arrows. Both on the designer list.
1560
-
1561
- > **Width is not pinned** — Figma's 1208px is the artboard's content width, and
1562
- > a pagination bar spans its table.
1563
-
1564
- > The 4px cell gap is `Spacing/4` and belongs to the bar, not the cell:
1565
- > `.vd-pagination-item` sets no margin, so cells used elsewhere space themselves.
1566
-
1567
- ```html
1568
- <!-- numbered -->
1569
- <nav class="vd-pagination" aria-label="Pagination">
1570
- <div class="vd-pagination-pages">
1571
- <button
1572
- class="vd-pagination-item vd-pagination-item-nav"
1573
- aria-label="Previous page"
1574
- >
1575
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1576
- <use href="#chevron-left" />
1577
- </svg>
1578
- </button>
1579
- <button class="vd-pagination-item vd-pagination-item-active" aria-current="page">
1580
- 1
1581
- </button>
1582
- <button class="vd-pagination-item">2</button>
1583
- <span class="vd-pagination-item vd-pagination-item-ellipsis" aria-hidden="true"
1584
- >...</span
1585
- >
1586
- <button class="vd-pagination-item">18</button>
1587
- <button class="vd-pagination-item vd-pagination-item-nav" aria-label="Next page">
1588
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1589
- <use href="#chevron-right" />
1590
- </svg>
1591
- </button>
1592
- </div>
1593
- <p class="vd-pagination-summary">1-20 of 352</p>
1594
- </nav>
1595
-
1596
- <!-- simple -->
1597
- <nav class="vd-pagination" aria-label="Pagination">
1598
- <button class="vd-btn vd-btn-outline vd-btn-sm">
1599
- <svg class="vd-icon vd-icon-size-13" aria-hidden="true">
1600
- <use href="#arrow-left" />
1601
- </svg>
1602
- Prev
1603
- </button>
1604
- <p class="vd-pagination-status">
1605
- Page <span class="vd-pagination-status-current">7</span> of 18
1606
- </p>
1607
- <button class="vd-btn vd-btn-outline vd-btn-sm">
1608
- Next
1609
- <svg class="vd-icon vd-icon-size-13" aria-hidden="true">
1610
- <use href="#arrow-right" />
1611
- </svg>
1612
- </button>
1613
- </nav>
1614
- ```
1615
-
1616
- #### PaginationItem
1617
-
1618
- Individual pagination cell — page number, ellipsis, or navigation arrow.
1619
- Extracted from Figma Pagination Item (894:1495) — 10 variants on a single
1620
- `State` axis. Composes inside the Pagination bar.
1621
-
1622
- - **Base**: `.vd-pagination-item` (the `default` kind — a 32×32 cell)
1623
- - **Kinds**: `.vd-pagination-item-active`, `.vd-pagination-item-ellipsis`,
1624
- `.vd-pagination-item-nav`
1625
- - **States**: `:hover`, `:active`, `:focus-visible`, `:disabled`
1626
-
1627
- | Kind | box | content |
1628
- | ----------- | ------------------------------------- | ----------------------------------- |
1629
- | default | `Surface/Paper` + 1px `Stroke/Border` | 13px mono, `Content/Secondary` |
1630
- | `-active` | `Primary/Main`, **no stroke** | `Content/Contrast` |
1631
- | `-ellipsis` | no fill, no stroke | `Content/Tertiary`, a literal `...` |
1632
- | `-nav` | same as default | 14px icon, `Secondary/Main` |
1633
-
1634
- > **The six hover and pressed states are not tokenised.** `get_variable_defs`
1635
- > returns only `Stroke/Line` for those variants, so their fills and strokes are
1636
- > raw values, read by sampling the render. The fills ship on the Action ramp,
1637
- > which is what the progression intends and lands within a few units:
1638
- >
1639
- > | state | Figma raw | shipped | Δ |
1640
- > | --------------- | --------- | ----------------- | --- |
1641
- > | default-hover | `#f2f2f5` | `Action/Hover` | 3.3 |
1642
- > | default-pressed | `#e6e6eb` | `Action/Selected` | 5.7 |
1643
- >
1644
- > On the designer list.
1645
-
1646
- > **Active hover goes _lighter_ in Figma** (`#295c9e` against `Primary/Main`'s
1647
- > `#1e4d8c`), where Button, TextButton and Pill all darken to `Primary/Dark`.
1648
- > No lighter-primary token exists, so this darkens like the rest of the library
1649
- > — a deliberate divergence, not a match.
1650
-
1651
- > **The border darkens through three un-tokenised greys**: `#e1e1e3` at rest
1652
- > (which _is_ exactly `Stroke/Border`), then `#c6c6cc` and `#b1b1ba` — roughly
1653
- > `Stroke/Border` at 0.24 and 0.33 alpha. The stroke ramp has no such steps, so
1654
- > the border is held at `Stroke/Border` throughout and the fill carries the
1655
- > state.
1656
-
1657
- > **Ellipsis is a label, not a control.** Figma draws no hover or pressed for
1658
- > it, so it ships as a `<span>` and the shared hover rule excludes it by name —
1659
- > `:hover` matches spans too, so the exclusion is load-bearing.
1660
-
1661
- > **No disabled variant exists in Figma**, but the nav arrows need one at the
1662
- > first and last page. Added with tokens rather than a blanket opacity, and
1663
- > scoped away from `active` so a disabled current page keeps its fill.
1664
-
1665
- > **The label weight varies by kind**, which is easy to miss because the size
1666
- > and family do not: default is **Medium (500)**, active **Bold (700)**, and
1667
- > ellipsis **Regular (400)**. None is a named Figma text style, and
1668
- > `--text-data-s` is Regular, so the token supplies family and size while each
1669
- > kind steps its own weight.
1670
-
1671
- > The 4px radius is raw in Figma but equals `--radius-tight` exactly.
1672
-
1673
- ```html
1674
- <div role="navigation" aria-label="Pagination" style="display: flex; gap: 6px;">
1675
- <button
1676
- class="vd-pagination-item vd-pagination-item-nav"
1677
- aria-label="Previous page"
1678
- disabled
1679
- >
1680
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1681
- <use href="#chevron-left" />
1682
- </svg>
1683
- </button>
1684
- <button class="vd-pagination-item vd-pagination-item-active" aria-current="page">
1685
- 1
1686
- </button>
1687
- <button class="vd-pagination-item">2</button>
1688
- <span class="vd-pagination-item vd-pagination-item-ellipsis" aria-hidden="true"
1689
- >...</span
1690
- >
1691
- <button class="vd-pagination-item">24</button>
1692
- <button class="vd-pagination-item vd-pagination-item-nav" aria-label="Next page">
1693
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1694
- <use href="#chevron-right" />
1695
- </svg>
1696
- </button>
1697
- </div>
1698
- ```
1699
-
1700
- #### FieldVerification
1701
-
1702
- Inline field-level verification indicator. Extracted from Figma Field
1703
- Verification (142:350) — 5 variants on a single `State` axis, plus a Ring
1704
- boolean.
1705
-
1706
- - **Base**: `.vd-field-verification`
1707
- - **States**: `.vd-field-verification-verified`, `-pending`, `-none`, `-mismatch`
1708
- - **Parts**: `.vd-field-verification-icon` (mismatch only), `-label`, `-details`,
1709
- `-detail`, `-action`
1710
- - **Slots (reused components)**: `.vd-section-marker` (verified, pending, none)
1711
- - **States**: `.vd-with-ring`
1712
-
1713
- **Four states are one-line rows; the fifth is a stacked panel.** Every value
1714
- below was measured from the Figma render, because Figma flattens the glyphs to
1715
- vectors:
1716
-
1717
- | State | mark | colours |
1718
- | -------------------- | ---------------------------------------- | -------------------------------------------------- |
1719
- | `verified` | Section Marker + 14px `#check` | `Approved/Main` icon, `Content/Tertiary` label |
1720
- | `pending` | Section Marker + 14px `#circle` | `Content/Tertiary` throughout |
1721
- | `none` | Section Marker + 14px `#minus`, no label | `Content/Tertiary` |
1722
- | `mismatch` (preview) | bare 15px `#triangle-alert` | `Critical/Main` throughout |
1723
- | `mismatch` (details) | same icon + stacked block | `Critical/Main`, one `Content/Secondary` mono line |
1724
-
1725
- > **Three of the five icons are Section Marker instances.** Figma nests a 16×16
1726
- > instance at y=1 for verified, pending _and_ none — each is an `<instance>` in
1727
- > the node metadata, and pending's label starts at x=23 (16 + the 7px gap).
1728
- > Only mismatch uses a bare 15px glyph, in a 15×18 frame.
1729
- >
1730
- > That 16px box is load-bearing: a bare 14px icon shifts the label 2px left and
1731
- > misaligns pending and none against verified in a column.
1732
- >
1733
- > Only the **colour** differs — pending and none bind `Content/Tertiary` where
1734
- > Section Marker's own `unverified` binds `Secondary/Main`.
1735
-
1736
- > **`State=none` is a `#minus` glyph**, not a rule and not a hyphen character.
1737
- > An earlier revision built it as a 10×1px bar from the `Spacing/10` and
1738
- > `Spacing/1` bindings — but `Spacing/10` appears in pending and mismatch too,
1739
- > so it was never none-specific.
1740
-
1741
- > **The expanded state tops-aligns while the rows centre.** Driven off the
1742
- > presence of `.vd-field-verification-details` with `:has()`, so there is no extra
1743
- > modifier class to remember.
1744
-
1745
- > **The outer widths are not pinned** — Figma's 83 / 111 / 16 / 159px are its
1746
- > sample strings and this sits inline beside a field value. **The 137px details
1747
- > column is different**: Figma authors it as a fixed width, which is why its
1748
- > mono line wraps to two rows. Left unpinned here so the block adapts, at the
1749
- > cost of that line running on where Figma wraps it.
1750
-
1751
- > **The mismatch action row is not a Text Button.** It looks like one, but Figma
1752
- > draws plain text plus an arrow rather than an instance, and its colour is
1753
- > `Critical/Main` where every Text Button type is Content or Primary. On the
1754
- > designer list.
1755
-
1756
- ```html
1757
- <!-- verified — the icon is a Section Marker -->
1758
- <span class="vd-field-verification vd-field-verification-verified">
1759
- <span class="vd-section-marker vd-section-marker-approve">
1760
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1761
- <use href="#check" />
1762
- </svg>
1763
- </span>
1764
- <span class="vd-field-verification-label">Matches X</span>
1765
- </span>
1766
-
1767
- <!-- none — a #minus glyph in a Section Marker, not a character -->
1768
- <span
1769
- class="vd-field-verification vd-field-verification-none"
1770
- role="img"
1771
- aria-label="No status"
1772
- >
1773
- <span class="vd-section-marker">
1774
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
1775
- <use href="#minus" />
1776
- </svg>
1777
- </span>
1778
- </span>
1779
-
1780
- <!-- mismatch, expanded -->
1781
- <span class="vd-field-verification vd-field-verification-mismatch">
1782
- <svg class="vd-field-verification-icon vd-icon vd-icon-size-15" aria-hidden="true">
1783
- <use href="#triangle-alert" />
1784
- </svg>
1785
- <span class="vd-field-verification-details">
1786
- <span class="vd-field-verification-label">Does not match KYC</span>
1787
- <span class="vd-field-verification-detail">Reported: 04/12/1988</span>
1788
- <span class="vd-field-verification-action">
1789
- Review discrepancy
1790
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true">
1791
- <use href="#arrow-right" />
1792
- </svg>
1793
- </span>
1794
- </span>
1795
- </span>
1796
- ```
1797
-
1798
- #### SectionMarker
1799
-
1800
- Visual marker indicating the verification status of a document section.
1801
- Extracted from Figma Section Marker (141:1071) — 4 variants on a single
1802
- `Status` axis, plus a Ring boolean.
1803
-
1804
- - **Base**: `.vd-section-marker` (a fixed 16×16 box)
1805
- - **Statuses**: `.vd-section-marker-approve`, `.vd-section-marker-mismatch`,
1806
- `.vd-section-marker-unverified` — and `na`, which takes **no class**
1807
- - **Parts**: `.vd-section-marker-dot` (mismatch's 8px filled circle)
1808
- - **States**: `.vd-with-ring`
1809
-
1810
- **What goes inside the box is not uniform** — two glyphs, one shape, one nothing:
1811
-
1812
- | Status | mark | colour |
1813
- | ------------ | ------------------------- | ---------------- |
1814
- | `approve` | 14px `#check` | `Approved/Main` |
1815
- | `mismatch` | 8px `.vd-section-marker-dot` | `Critical/Main` |
1816
- | `unverified` | 14px `#circle` | `Secondary/Main` |
1817
- | `na` | nothing at all | — |
1818
-
1819
- > **`Status=na` draws nothing.** Not a dash, not a hollow box — the variant is
1820
- > empty. It still occupies 16px so a column of markers stays aligned, which is
1821
- > presumably the intent but is equally consistent with an unfinished variant.
1822
- > On the designer list. There is deliberately no `.section-marker-na` class:
1823
- > with no colour to set it would be an empty rule.
1824
-
1825
- > **Measured, not assumed.** Figma flattens these to vectors, so the geometry
1826
- > was read by tracing the exported PNG — approve's ink is 12×8, the mismatch dot
1827
- > is exactly 8×8 centred with a 4px inset (matching its `Spacing/4` binding),
1828
- > unverified's ring fills 14×14, and na's box is uniformly blank.
1829
-
1830
- > **`unverified` binds `Secondary/Main`, not `Content/Secondary`.** They resolve
1831
- > to the same `#5b5b68`, but the spec pins the token Figma actually uses.
1832
-
1833
- > **The ring is square here.** Every other `.vd-with-ring` sits on a rounded
1834
- > element and inherits its radius; this box has none, which matches Figma's
1835
- > `inset-0` with no corner rounding.
1836
-
1837
- > **It carries meaning, so it needs a name.** Give the container `role="img"`
1838
- > and an `aria-label`, and leave the glyph `aria-hidden`. `na` needs one too, or
1839
- > a screen reader announces nothing at all.
1840
-
1841
- ```html
1842
- <span
1843
- class="vd-section-marker vd-section-marker-approve"
1844
- role="img"
1845
- aria-label="Approved"
1846
- >
1847
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#check" /></svg>
1848
- </span>
1849
-
1850
- <span
1851
- class="vd-section-marker vd-section-marker-mismatch"
1852
- role="img"
1853
- aria-label="Mismatch"
1854
- >
1855
- <span class="vd-section-marker-dot"></span>
1856
- </span>
1857
-
1858
- <span
1859
- class="vd-section-marker vd-section-marker-unverified"
1860
- role="img"
1861
- aria-label="Unverified"
1862
- >
1863
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#circle" /></svg>
1864
- </span>
1865
-
1866
- <!-- na: no status class, no child -->
1867
- <span class="vd-section-marker" role="img" aria-label="Not applicable"></span>
1868
- ```
1869
-
1870
- #### Alert
1871
-
1872
- Contextual feedback banner for inline status messages. Extracted from Figma
1873
- Alert (880:31080) — 5 variants on a single `Type` axis, plus three booleans
1874
- (Icon, Action Button, Dismiss).
1875
-
1876
- - **Base**: `.vd-alert` — layout only, **a type class is required**
1877
- - **Types**: `.vd-alert-critical`, `.vd-alert-warning`, `.vd-alert-success`,
1878
- `.vd-alert-info`, `.vd-alert-neutral`
1879
- - **Parts**: `.vd-alert-body`, `.vd-alert-icon`, `.vd-alert-content`, `.vd-alert-title`,
1880
- `.vd-alert-message`
1881
- - **Slots (reused components)**: `.vd-text-button vd-text-button-primary` (action),
1882
- `.vd-icon-button vd-icon-button-md` (dismiss)
1883
-
1884
- > **A type class is required.** Figma's `Type` axis has no default, and baking
1885
- > one into the base class is the mistake Tabs already taught us. A bare `.vd-alert`
1886
- > renders transparent, which reads as the authoring error it is.
1887
-
1888
- Type drives the fill, the 3px rail and the icon — one pattern, one exception:
1889
-
1890
- | Type | fill | rail | icon |
1891
- | ----------------- | --------------- | --------------- | --------------------- |
1892
- | `.vd-alert-critical` | `Critical/Soft` | `Critical/Main` | `Critical/Main` |
1893
- | `.vd-alert-warning` | `Warning/Soft` | `Warning/Main` | `Warning/Main` |
1894
- | `.vd-alert-success` | `Approved/Soft` | `Approved/Main` | `Approved/Main` |
1895
- | `.vd-alert-info` | `Primary/Soft` | `Primary/Main` | `Primary/Main` |
1896
- | `.vd-alert-neutral` | `Neutral/Soft` | `Neutral/Main` | **`Neutral/Content`** |
1897
-
1898
- > **Neutral's icon is the odd one out**, and this was verified by sampling the
1899
- > Figma render rather than assumed: its rail is `Neutral/Main` (#9999a6) while
1900
- > its glyph is `Neutral/Content` (#65656e). That is why `Neutral/Content`
1901
- > appears in that one variant's variable set and nowhere else.
1902
-
1903
- **The icon is a slot** — Type sets only its colour:
1904
-
1905
- | Type | glyph |
1906
- | -------- | --------------------------------------------- |
1907
- | critical | `#triangle-alert` |
1908
- | warning | `#info` (an info glyph on the _warning_ type) |
1909
- | success | `#check` |
1910
- | info | `#refresh-cw` (not an info glyph) |
1911
- | neutral | `#refresh-cw` |
1912
-
1913
- > **The rail is a left border, not a child element.** Figma models it as a
1914
- > rectangle clipped by an `overflow: clip` frame. Both renders were traced pixel
1915
- > by pixel down the corner arc: Figma reaches the full 3px seven rows down, ours
1916
- > on the eighth — a one-row antialiasing difference, identical either side.
1917
-
1918
- > **Width is not pinned.** Figma's 828px is the leftover of a 1007px artboard
1919
- > with 36px margins, not a spec — a banner spans its container. Contrast Modal
1920
- > (480) and Toast (356), which are genuinely fixed and _are_ pinned.
1921
-
1922
- > **The dismiss is not an instance in Figma** — it is a stray 10×16 raw vector,
1923
- > where Toast and Modal both use a real Icon Button. Treated as an authoring
1924
- > slip and implemented as `.vd-icon-button vd-icon-button-md`. On the designer list.
1925
-
1926
- ```html
1927
- <div class="vd-alert vd-alert-critical" role="alert">
1928
- <div class="vd-alert-body">
1929
- <svg class="vd-alert-icon vd-icon vd-icon-size-18" aria-hidden="true">
1930
- <use href="#triangle-alert" />
1931
- </svg>
1932
- <div class="vd-alert-content">
1933
- <p class="vd-alert-title">Business address mismatch</p>
1934
- <p class="vd-alert-message">Middesk returns a registered-agent address.</p>
1935
- <button class="vd-text-button vd-text-button-primary">Review Field</button>
1936
- </div>
1937
- <button class="vd-icon-button vd-icon-button-md" aria-label="Dismiss">
1938
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#x" /></svg>
1939
- </button>
1940
- </div>
1941
- </div>
1942
- ```
1943
-
1944
- #### Toast
1945
-
1946
- Transient floating notification for brief status feedback. Extracted from Figma
1947
- Toast (880:31121) — Type (success / error / info) × Style (Full / Simple).
1948
-
1949
- - **Base**: `.vd-toast` (Full — a 356px card)
1950
- - **Types**: `.vd-toast-success`, `.vd-toast-error`, `.vd-toast-info` (icon colour only)
1951
- - **Style**: `.vd-toast-simple` (a 280px dark pill)
1952
- - **Parts**: `.vd-toast-header`, `.vd-toast-main`, `.vd-toast-icon`, `.vd-toast-text`,
1953
- `.vd-toast-title`, `.vd-toast-message`, `.vd-toast-footer`, `.vd-toast-timestamp`
1954
- - **Slots (reused components)**: `.vd-icon-button vd-icon-button-md` (dismiss),
1955
- `.vd-text-button vd-text-button-primary` (footer action)
1956
-
1957
- > **The two styles share almost nothing.** Figma models them as one component,
1958
- > but Full is a white card and Simple is a dark pill — different background,
1959
- > radius, padding, direction, width, shadow and text colour. `.vd-toast-simple`
1960
- > overrides essentially all of `.vd-toast`.
1961
-
1962
- > **The action and dismiss are existing components, not new parts.** Figma's
1963
- > "Retry" is a literal Text Button instance (Type=Primary) and the close is an
1964
- > Icon Button. Nothing new is defined for either.
1965
-
1966
- **The icon is a slot** — Type sets only its colour. What Figma draws:
1967
-
1968
- | Type | glyph | colour |
1969
- | ---------------- | --------------------------------- | --------------------------- |
1970
- | `.vd-toast-success` | `#circle-check` | `Approved/Main` |
1971
- | `.vd-toast-error` | `#triangle-alert` | `Critical/Main` |
1972
- | `.vd-toast-info` | `#refresh-cw` (not an info glyph) | `Primary/Main` |
1973
- | `.vd-toast-simple` | `#check` | inherits `Content/Contrast` |
1974
-
1975
- > **Three Figma gaps, reported rather than papered over.** Simple exists only
1976
- > for `Type=info` — there is no success or error Simple, so `.vd-toast-simple`
1977
- > ignores the type classes rather than invent two. That one variant is typed
1978
- > `info` but draws a success check. And its Figma description is Tooltip's,
1979
- > copied verbatim. All three are on the designer list.
1980
-
1981
- > **Two shadows, deliberately.** Full uses a local effect, tokenised as
1982
- > `--shadow-toast`; Simple uses the named General Drop Shadow, already
1983
- > `--shadow-panel`. They are not interchangeable.
1984
-
1985
- > **Simple's 35px height is pinned.** Figma draws strokes without adding to the
1986
- > frame, so its 10 + 15 + 10 ignores the 1px border; border-box derives 37. Same
1987
- > trap `button.css` and `pill.css` document.
1988
-
1989
- ```html
1990
- <!-- Full -->
1991
- <div class="vd-toast vd-toast-success" role="status">
1992
- <div class="vd-toast-header">
1993
- <div class="vd-toast-main">
1994
- <svg class="vd-toast-icon vd-icon vd-icon-size-18" aria-hidden="true">
1995
- <use href="#circle-check" />
1996
- </svg>
1997
- <div class="vd-toast-text">
1998
- <p class="vd-toast-title">Document request sent</p>
1999
- <p class="vd-toast-message">
2000
- Client has been notified to upload their W-9.
2001
- </p>
2002
- </div>
2003
- </div>
2004
- <button class="vd-icon-button vd-icon-button-md" aria-label="Dismiss">
2005
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#x" /></svg>
2006
- </button>
2007
- </div>
2008
- <div class="vd-toast-footer">
2009
- <span class="vd-toast-timestamp">just now</span>
2010
- <button class="vd-text-button vd-text-button-primary">Retry</button>
2011
- </div>
2012
- </div>
2013
-
2014
- <!-- Simple -->
2015
- <div class="vd-toast vd-toast-simple" role="status">
2016
- <svg class="vd-icon vd-icon-size-15" aria-hidden="true"><use href="#check" /></svg>
2017
- Template Saved
2018
- </div>
2019
- ```
2020
-
2021
- #### TextButton
2022
-
2023
- Text-only button for inline or cell-level actions. Extracted from Figma Text
2024
- Button (679:21601) — 11 variants across Type × Hover × Pressed × Active, plus
2025
- Icon and Ring booleans.
2026
-
2027
- - **Base**: `.vd-text-button` (defaults to the `cell` type)
2028
- - **Types**: `.vd-text-button-cell`, `.vd-text-button-text`, `.vd-text-button-primary`
2029
- - **Icon**: `.vd-icon vd-icon-size-12` (Figma's Icon boolean, 4px gap)
2030
- - **States**: `:hover`, `:active`, `:focus-visible`, `[aria-pressed="true"]` /
2031
- `[aria-selected="true"]`, `:disabled`, `.vd-with-ring`
2032
-
2033
- > **This is not a `.vd-btn` variant.** Different Figma component, different type
2034
- > scale, different geometry — `.vd-btn` has fixed 24/28/32px heights, this hugs its
2035
- > text at 15px or 18px. Use `.vd-btn-empty` for a real button that happens to look
2036
- > bare; use `.vd-text-button` for an inline affordance inside a table cell or a
2037
- > line of copy.
2038
-
2039
- **The three types are not three skins of one control** — `cell` is a genuinely
2040
- different size:
2041
-
2042
- | Type | type | padding | height | rest | hover | pressed | active |
2043
- | --------- | ------------ | --------- | ------ | ------------------- | ---------------------------------- | ------------------------------------ | ------------------------------- |
2044
- | `cell` | 11px Micro L | 7px / 1px | 15px | `Content/Secondary` | `Content/Primary` + `Action/Hover` | `Content/Primary` + `Action/Focused` | `Primary/Main` + `Primary/Soft` |
2045
- | `text` | 12px Caption | none | 18px | `Content/Secondary` | `Content/Primary` | `Content/Primary` | `Primary/Main` |
2046
- | `primary` | 12px Caption | none | 18px | `Primary/Main` | `Primary/Dark` | `Primary/Pressed` | — |
2047
-
2048
- `cell` is the only type with padding or a background. `text` and `primary`
2049
- differ only in colour ramp.
2050
-
2051
- > **Active steps the weight 400 → 500**, via `Micro L - Bold` / `Caption - Bold`.
2052
- > Both Figma styles say "Bold" and both report Medium / 500 — do not map "-Bold"
2053
- > to 700. The whole type token is swapped rather than a bare `font-medium`,
2054
- > because `--text-*` also carries size and line-height.
2055
-
2056
- > **`cell`'s 15px height is pinned, and must be.** `Micro L` carries a Figma
2057
- > "Auto" line height, so the box is font-dependent: Figma resolves it to 13px
2058
- > and Chrome to 14px. Same trap `button.css` and `pill.css` document. `text` and
2059
- > `primary` need no pin — their 18px line-height is explicit.
2060
-
2061
- > **Two Figma oddities reproduced, not corrected.** `text` draws Hover and
2062
- > Pressed identically, so pressing gives no feedback; and `primary` has no
2063
- > Active variant, where the other two have one. Both are on the designer list.
2064
-
2065
- ```html
2066
- <!-- cell: inline action inside a table cell -->
2067
- <button class="vd-text-button vd-text-button-cell" aria-pressed="false">
2068
- Select all
2069
- </button>
2070
-
2071
- <!-- text: standalone link-style action -->
2072
- <button class="vd-text-button vd-text-button-text" aria-pressed="false">
2073
- View details
2074
- </button>
2075
-
2076
- <!-- primary, with the Icon boolean -->
2077
- <button class="vd-text-button vd-text-button-primary">
2078
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true"><use href="#plus" /></svg>
2079
- Add row
2080
- </button>
2081
-
2082
- <!-- selected -->
2083
- <button class="vd-text-button vd-text-button-cell" aria-pressed="true">
2084
- Select all
2085
- </button>
2086
- ```
2087
-
2088
- #### Modal
2089
-
2090
- Dialog for confirmations and focused workflows. Extracted from Figma Modal
2091
- (908:1580) — three variants on one `Action` axis, plus two booleans.
2092
-
2093
- - **Base**: `.vd-modal` (480px wide, height follows content)
2094
- - **Actions**: `.vd-modal-destructive`, `.vd-modal-positive`, `.vd-modal-neutral`
2095
- - **Parts**: `.vd-modal-header`, `.vd-modal-title-group`, `.vd-modal-icon`,
2096
- `.vd-modal-title`, `.vd-modal-subtitles`, `.vd-modal-subtitle`, `.vd-modal-description`,
2097
- `.vd-modal-context`, `.vd-modal-context-text`, `.vd-modal-footer`
2098
- - **Slots (reused components)**: `.vd-icon-button vd-icon-button-lg` (close),
2099
- `.vd-btn … vd-btn-lg` (footer)
2100
-
2101
- **Action drives three things**, and the CSS only styles the first — the icon and
2102
- the button are slots, exactly as in Figma:
2103
-
2104
- | Action | icon container | header icon | confirm button |
2105
- | -------------------- | ------------------------------------ | ----------------- | --------------- |
2106
- | `.vd-modal-destructive` | `Critical/Soft` + `Critical/Main` | `#triangle-alert` | `.vd-btn-critical` |
2107
- | `.vd-modal-positive` | `Approved/Soft` + `Approved/Content` | `#circle-check` | `.vd-btn-primary` |
2108
- | `.vd-modal-neutral` | `Surface/Neutral` + `Neutral/Main` | `#info` | `.vd-btn-outline` |
2109
-
2110
- > **Two of those three break the `{Action}/Soft` + `{Action}/Main` pattern** —
2111
- > positive uses `Approved/Content`, and neutral fills with `Surface/Neutral`
2112
- > rather than the `Neutral/Soft` that exists. Both are reproduced from Figma
2113
- > rather than corrected, and both are on the designer list.
2114
-
2115
- > **`.vd-btn-critical` is new, and is not in Figma's Button set** (73:180, which is
2116
- > primary / outline / empty only). It comes from this modal's destructive
2117
- > confirm button. It lives in [button.css](src/components/button.css) because a
2118
- > destructive confirm is not modal-specific. Figma specifies its rest state
2119
- > only; hover steps to `Critical/Strong` by our choice.
2120
-
2121
- > **The two 12px subtitle styles are not interchangeable.** `.vd-modal-subtitle` is
2122
- > `Body Content/Caption` (18px leading, `Content/Secondary`);
2123
- > `.vd-modal-description` is `Body & Supporting/Help & Caption` (14px leading,
2124
- > `Content/Tertiary`). Same size, different everything else. This modal is also
2125
- > the evidence that `Help & Caption` is still current — it was flagged as
2126
- > unconfirmed under **Still open** below.
2127
-
2128
- > **Height is content-driven.** Figma's 299px (positive) vs 317px (the other
2129
- > two) is the subtitle wrapping to a second line, not a spec difference. Only
2130
- > the 480px width is fixed.
2131
-
2132
- > **The 12px corner radius is past the end of our radius scale** and is
2133
- > hardcoded in Figma too, so it is written raw. The drop shadow is a local
2134
- > effect rather than a named style, but is tokenised as `--shadow-modal`,
2135
- > following the precedent of `--shadow-knob`.
2136
-
2137
- > **Positioning and the backdrop are yours**, as with Tooltip — Figma draws the
2138
- > dialog frame only. On a native `<dialog>` the browser supplies centring, the
2139
- > backdrop, focus trapping and Escape-to-close for free, and `.vd-modal` ships a
2140
- > `::backdrop` scrim for that case. That is the recommended way to use it.
2141
-
2142
- ```html
2143
- <dialog class="vd-modal vd-modal-destructive" aria-labelledby="decline-title">
2144
- <div class="vd-modal-header">
2145
- <div class="vd-modal-title-group">
2146
- <span class="vd-modal-icon">
2147
- <svg class="vd-icon vd-icon-size-20" aria-hidden="true">
2148
- <use href="#triangle-alert" />
2149
- </svg>
2150
- </span>
2151
- <h2 class="vd-modal-title" id="decline-title">Decline this application?</h2>
2152
- </div>
2153
- <button class="vd-icon-button vd-icon-button-lg" aria-label="Close">
2154
- <svg class="vd-icon vd-icon-size-16" aria-hidden="true"><use href="#x" /></svg>
2155
- </button>
2156
- </div>
2157
-
2158
- <div class="vd-modal-subtitles">
2159
- <p class="vd-modal-subtitle">The applicant is notified through the portal.</p>
2160
- <p class="vd-modal-description">Two blocking items remain unresolved.</p>
2161
- </div>
2162
-
2163
- <!-- Context Window boolean -->
2164
- <div class="vd-modal-context">
2165
- <p class="vd-modal-context-text">#BA-204417 &middot; Northwind Freight LLC</p>
2166
- </div>
2167
-
2168
- <div class="vd-modal-footer">
2169
- <button class="vd-btn vd-btn-empty vd-btn-lg">Cancel</button>
2170
- <button class="vd-btn vd-btn-critical vd-btn-lg">Decline application</button>
2171
- </div>
2172
- </dialog>
2173
-
2174
- <script>
2175
- // No component JS — <dialog> does the work.
2176
- dialog.showModal();
2177
- </script>
2178
- ```
2179
-
2180
- #### Tooltip
2181
-
2182
- Dark contextual popover for hover explanations and helper text. Extracted from
2183
- Figma Tooltip (880:31125) — a single symbol, no variants.
2184
-
2185
- - **Base**: `.vd-tooltip` (280px wide, dark)
2186
- - **Parts**: `.vd-tooltip-title`, `.vd-tooltip-content`, `.vd-tooltip-divider`, `.vd-tooltip-subtext`
2187
-
2188
- | part | type | colour |
2189
- | ------------------ | ----------------- | ------------------ |
2190
- | `.vd-tooltip-title` | 11px / 400 | `Content/Faint` |
2191
- | `.vd-tooltip-content` | 12px / 18px / 400 | `Content/Contrast` |
2192
- | `.vd-tooltip-subtext` | 11px / 400 | `Content/Faint` |
2193
-
2194
- > **The only dark surface in the library.** The fill is `Content/Primary` and
2195
- > the text tokens invert accordingly. Do not reach for the usual
2196
- > `content-primary` text colour inside it.
2197
-
2198
- > **The divider is `Content/Secondary`, not `Stroke/Divider`.** The latter is
2199
- > `rgba(20,20,40,0.08)` and would be invisible on this background. Read from
2200
- > the exported SVG, since the codegen renders the rule as an asset and does not
2201
- > expose its stroke.
2202
- >
2203
- > The 1px border, however, _is_ `Stroke/Divider` — near-black at 8% on a
2204
- > near-black fill, so it contributes nothing visually. Implemented faithfully;
2205
- > looks vestigial.
2206
-
2207
- > **All four parts are optional in markup.** Figma models title / content /
2208
- > subtext as text properties rather than boolean toggles, so it always draws
2209
- > them, but a body-only tooltip is the common case and nothing depends on the
2210
- > siblings being present.
2211
-
2212
- > **Positioning is the consumer's job** — Figma models the bubble only. No
2213
- > arrow, no placement, no collision handling, and no caret layer exists in the
2214
- > component.
2215
-
2216
- ```html
2217
- <!-- Full, as drawn in Figma -->
2218
- <div class="vd-tooltip" role="tooltip" id="tt-naics">
2219
- <p class="vd-tooltip-title">INDUSTRY / NAICS</p>
2220
- <p class="vd-tooltip-content">
2221
- Six digits used to classify business establishments.
2222
- </p>
2223
- <hr class="vd-tooltip-divider" />
2224
- <p class="vd-tooltip-subtext">Middesk · Secretary of State</p>
2225
- </div>
2226
-
2227
- <!-- Body only — the common case -->
2228
- <div class="vd-tooltip" role="tooltip">
2229
- <p class="vd-tooltip-content">
2230
- Six digits used to classify business establishments.
2231
- </p>
2232
- </div>
2233
-
2234
- <!-- Anchored to a trigger; positioning is yours -->
2235
- <span style="position: relative; display: inline-block;">
2236
- <button
2237
- class="vd-icon-button vd-icon-button-xs"
2238
- aria-describedby="tt-naics"
2239
- aria-label="What is NAICS?"
2240
- >
2241
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
2242
- <use href="#custom-help" />
2243
- </svg>
2244
- </button>
2245
- <span
2246
- style="position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;"
2247
- >
2248
- <!-- .tooltip -->
2249
- </span>
2250
- </span>
2251
- ```
2252
-
2253
- #### Tag
2254
-
2255
- Compact label for categorization and filtering — a label that happens to be
2256
- clickable. Extracted from Figma Tag (79:251): Hover × Active × Disabled × Size,
2257
- plus four boolean slots.
2258
-
2259
- - **Base**: `.vd-tag` (defaults to sm)
2260
- - **Sizes**: `.vd-tag-sm` (21px, default), `.vd-tag-md` (24px)
2261
- - **Parts**: `.vd-tag-count` (trailing count, md only)
2262
- - **Slots (reused components)**: `.vd-avatar vd-avatar-xs` (leading, md only),
2263
- `.vd-dot vd-dot-warning` (trailing, both sizes)
2264
- - **States**: `:hover`, `:focus-visible`, `[aria-pressed="true"]` /
2265
- `[aria-selected="true"]`, `:disabled`, `.vd-with-ring`
2266
-
2267
- > **The slots are existing components, not new parts.** Figma's avatar slot is
2268
- > a literal instance of Avatar `Size=xs` — byte-identical class list — so it
2269
- > uses `.vd-avatar vd-avatar-xs`. The status dot is a 5px `Warning/Main` circle,
2270
- > which is exactly `.vd-dot vd-dot-warning`. Only the count needed a new class,
2271
- > because despite Figma calling it a "count badge" it is **not a badge**: bare
2272
- > JetBrains Mono text, no circle, no fill, no border.
2273
-
2274
- > **Avatar and count are md-only.** Figma draws neither on any sm variant —
2275
- > the layers do not exist there, they are not merely hidden.
2276
-
2277
- > **Disabled dims the label and nothing else** — not the border, not the
2278
- > background, not the slots. A disabled Tag keeps a fully enabled Avatar.
2279
-
2280
- > Two Figma oddities reproduced rather than corrected: md's active state bumps
2281
- > the label to weight 500 while sm's stays 400, and the gap is _larger_ on the
2282
- > smaller size (sm 10px, md 8px). Both look like authoring slips — raised with
2283
- > the designer.
2284
- >
2285
- > Figma draws no active-without-hover variant, so a non-hovered active is
2286
- > unconfirmed. The spec asserts only the four combinations that exist.
2287
-
2288
- #### Tag vs Pill
2289
-
2290
- Both descriptions say "filtering". They are not the same control:
2291
-
2292
- | | Tag | Pill |
2293
- | --------- | -------------------------------- | ------------------------------------------- |
2294
- | reads as | content | chrome |
2295
- | rest | transparent + hairline | always filled, borderless |
2296
- | active | solid `Primary/Main`, white text | soft `Primary/Soft` tint |
2297
- | height | 21 / 24px | 17px |
2298
- | slots | avatar, count, status dot | optional dropdown chevron |
2299
- | disabled | yes | not modelled |
2300
- | use it to | label a record inline in content | offer a choice in a filter or segmented bar |
2301
-
2302
- ```html
2303
- <!-- Simple label -->
2304
- <button class="vd-tag" aria-pressed="false">Design</button>
2305
-
2306
- <!-- Selected -->
2307
- <button class="vd-tag" aria-pressed="true">Approved</button>
2308
-
2309
- <!-- md with every slot -->
2310
- <button class="vd-tag vd-tag-md" aria-pressed="false">
2311
- <span class="vd-avatar vd-avatar-xs">JS</span>
2312
- Design
2313
- <span class="vd-tag-count">1</span>
2314
- <span class="vd-dot vd-dot-warning"></span>
2315
- </button>
2316
-
2317
- <!-- Disabled — label dims, nothing else -->
2318
- <button class="vd-tag" aria-pressed="false" disabled>Archived</button>
2319
- ```
2320
-
2321
- #### Pill
2322
-
2323
- Compact rounded control — a filter toggle, or a dropdown trigger when it carries
2324
- a chevron. Extracted from Figma Pill (91:505) — 6 variants (State × Dropdown),
2325
- plus a Ring boolean.
2326
-
2327
- - **Base**: `.vd-pill` (17px tall, hug width)
2328
- - **Parts**: `.vd-pill-chevron` (13px trailing chevron)
2329
- - **States**: `:hover`, `:focus-visible`, `[aria-expanded="true"]` /
2330
- `[aria-pressed="true"]` / `[aria-selected="true"]`, `:disabled`, `.vd-with-ring`
2331
- - **Type**: `text-statecap` (9.5px / 600)
2332
-
2333
- > **Active means two things, and the chevron decides which.** Figma draws one
2334
- > active treatment but ships both a Dropdown=Yes and a Dropdown=No variant:
2335
- >
2336
- > | | attribute | meaning | chevron |
2337
- > | ------------ | ---------------------- | --------- | ---------- |
2338
- > | with chevron | `aria-expanded="true"` | menu open | flips 180° |
2339
- > | without | `aria-pressed="true"` | selected | n/a |
2340
- >
2341
- > Both give the same `primary-soft` fill and `primary` text. Only
2342
- > `aria-expanded` rotates anything.
2343
-
2344
- > **The token names are off by one — do not "fix" them.** Rest uses the token
2345
- > literally named `Action/Hover`; hover uses `Action/Focused`. It reads like a
2346
- > bug in review. It is what the design file specifies.
2347
-
2348
- > **"Statecap" is not uppercase.** Despite the style name, Figma renders the
2349
- > label mixed-case with no transform. The visual spec asserts
2350
- > `text-transform: none` so nobody adds it back.
2351
-
2352
- > Height is pinned at 17px. Without a chevron the 9.5px Auto line box alone
2353
- > would give ~15.5px, but Figma is 17 either way.
2354
- >
2355
- > Width hugs the label — Figma's 88px and 70px are just the widths of its
2356
- > sample strings, not fixed sizes.
2357
-
2358
- ```html
2359
- <!-- Dropdown trigger -->
2360
- <button class="vd-pill" aria-haspopup="listbox" aria-expanded="false">
2361
- John Smith
2362
- <svg class="vd-pill-chevron vd-icon vd-icon-size-13" aria-hidden="true">
2363
- <use href="#chevron-down" />
2364
- </svg>
2365
- </button>
2366
-
2367
- <!-- Filter toggle, no chevron -->
2368
- <button class="vd-pill" aria-pressed="false">Overdue</button>
2369
- <button class="vd-pill" aria-pressed="true">Approved</button>
2370
-
2371
- <!-- Ring -->
2372
- <button class="vd-pill vd-with-ring" aria-pressed="false">Overdue</button>
2373
- ```
2374
-
2375
- `.vd-pill` the component is unrelated to `rounded-pill` the radius utility — the
2376
- latter is Figma's `Radius/Rounded` and is used by Avatar, Chip and Switch too.
2377
-
2378
- #### Avatar
2379
-
2380
- Circular user marker showing initials. Extracted from Figma Avatar (79:230) —
2381
- 8 variants (4 sizes × Disabled), plus a Ring boolean.
2382
-
2383
- - **Base**: `.vd-avatar` (defaults to md)
2384
- - **Sizes**: `.vd-avatar-xs` (16px), `.vd-avatar-sm` (18px), `.vd-avatar-md` (20px, default), `.vd-avatar-lg` (34px)
2385
- - **States**: `.vd-avatar-disabled`, `.vd-with-ring` (shared with Chip — 2px inset ring in `Primary/Main`)
2386
- - **Colors**: `Primary/Main` fill, `Content/Contrast` initials, 0.5px `Stroke/Divider` hairline
2387
-
2388
- | Size | Diameter | Type style | |
2389
- | ---- | -------- | ------------------- | ---------------- |
2390
- | xs | 16px | `text-micro-s-bold` | 8px / 600 / 0.4% |
2391
- | sm | 18px | `text-micro-s-bold` | 8px / 600 / 0.4% |
2392
- | md | 20px | `text-micro-m-bold` | 8.5px / 500 |
2393
- | lg | 34px | `text-micro-l-bold` | 11px / 500 |
2394
-
2395
- > **Four sizes, three type styles.** xs and sm both use Micro S - Bold; only md
2396
- > and lg step up. Do not assume one style per size.
2397
- >
2398
- > **Disabled changes the fill and nothing else.** The initials stay
2399
- > `Content/Contrast` — they do not dim with the background.
2400
- >
2401
- > Figma names the md and lg styles "- Bold" but both report Medium / 500. Only
2402
- > Micro S - Bold is genuinely 600. Do not map "-Bold" to 700.
2403
-
2404
- > **Initials only.** Figma's component description says _"User profile image
2405
- > displayed as a circle"_, but no image layer, image fill, or swap slot exists
2406
- > in any of the 8 variants — the children are the initials text and a hidden
2407
- > Ring. No image support is implemented rather than invent one. Open with the
2408
- > designer: was an image variant planned and dropped, or is the description
2409
- > stale?
2410
-
2411
- ```html
2412
- <!-- Default (md) -->
2413
- <span class="vd-avatar vd-avatar-md">NC</span>
2414
-
2415
- <!-- Every size -->
2416
- <span class="vd-avatar vd-avatar-xs">NC</span>
2417
- <span class="vd-avatar vd-avatar-sm">NC</span>
2418
- <span class="vd-avatar vd-avatar-lg">NC</span>
2419
-
2420
- <!-- Disabled — fill dims, initials do not -->
2421
- <span class="vd-avatar vd-avatar-md vd-avatar-disabled">NC</span>
2422
-
2423
- <!-- Ring -->
2424
- <span class="vd-avatar vd-avatar-lg vd-with-ring">NC</span>
2425
- ```
2426
-
2427
- Avatar is the shared primitive behind the initials bubbles in MenuItem and
2428
- DropdownField. Both previously hand-rolled their own copies; those were retired
2429
- in favour of this component. Pick the size at the call site, the same way you
2430
- pick `.icon-size-*`.
2431
-
2432
- #### IconButton
2433
-
2434
- Compact button displaying only an icon. Use for toolbar actions, close buttons, and secondary actions where space is limited. Extracted from Figma (78:210).
2435
-
2436
- - **Base**: `.vd-icon-button` (transparent background, defaults to LG size)
2437
- - **Sizes**: `.vd-icon-button-xs` (12×12px), `.vd-icon-button-md` (18×18px), `.vd-icon-button-lg` (28×28px, default)
2438
- - **Icon Sizes**: XS uses 12px icons, MD uses 14px icons, LG uses 16px icons
2439
- - **Glyph colour**: `Secondary/Main` at rest, `Secondary/Strong` on hover/active,
2440
- `Secondary/Disabled` when disabled — icons inherit it via `currentColor`
2441
- - **States**: `:hover` (bg-action-hover), `:active` (bg-action-focused), `:disabled`
2442
- - **Optional**: `.vd-icon-ring` (adds 2px ring in primary color for selected state)
2443
-
2444
- ```html
2445
- <!-- Extra small (12px - for labels) -->
2446
- <button class="vd-icon-button vd-icon-button-xs" aria-label="Help">
2447
- <svg class="vd-icon vd-icon-size-12" aria-hidden="true">
2448
- <use href="#custom-help" />
2449
- </svg>
2450
- </button>
2451
-
2452
- <!-- Medium (18px - compact actions) -->
2453
- <button class="vd-icon-button vd-icon-button-md" aria-label="Close">
2454
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2455
- <use href="#x" />
2456
- </svg>
2457
- </button>
2458
-
2459
- <!-- Large (28px - default, primary actions) -->
2460
- <button class="vd-icon-button vd-icon-button-lg" aria-label="Settings">
2461
- <svg class="vd-icon vd-icon-size-16" aria-hidden="true">
2462
- <use href="#settings" />
2463
- </svg>
2464
- </button>
2465
-
2466
- <!-- Disabled -->
2467
- <button class="vd-icon-button vd-icon-button-md" disabled aria-label="Disabled">
2468
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2469
- <use href="#x" />
2470
- </svg>
2471
- </button>
2472
-
2473
- <!-- With ring state (selected) -->
2474
- <button class="vd-icon-button vd-icon-button-md vd-icon-ring" aria-label="Active filter">
2475
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2476
- <use href="#filter" />
2477
- </svg>
2478
- </button>
2479
- ```
2480
-
2481
- #### Icon
2482
-
2483
- Wrapper container for icons at standardized sizes. Maintains consistent icon dimensions across the UI. Icons inherit the current text color by default.
2484
-
2485
- - **Base**: `.vd-icon` (inline-flex container, defaults to 16px size)
2486
- - **Sizes**: `.vd-icon-size-10`, `.vd-icon-size-11`, `.vd-icon-size-12`, `.vd-icon-size-13`, `.vd-icon-size-14`, `.vd-icon-size-15`, `.vd-icon-size-16`, `.vd-icon-size-18`, `.vd-icon-size-20`, `.vd-icon-size-22`, `.vd-icon-size-24`
2487
- - **State**: `.vd-icon-ring` (adds circular border with 2px width in primary color)
2488
- - **Layout**: Flex container with centered content, prevents squashing in flex layouts
2489
- - **Color**: Inherits current text color via `currentColor`
2490
- - **Stroke**: scales with size via `--icon-stroke` — see below
2491
-
2492
- **Stroke weight scales with size, and not proportionally.** Read from the Figma
2493
- Icon Container (69:6944) exports on 2026-08-25 — each size variant exports at
2494
- its own viewBox with a hand-set `stroke-width`, so the declared number _is_ the
2495
- rendered pixel width:
2496
-
2497
- | Icon size | Rendered stroke |
2498
- | ---------- | --------------- |
2499
- | 10, 11 | 0.75px |
2500
- | 12, 13 | 1.00px |
2501
- | 14 | 1.25px |
2502
- | 15, 16, 18 | 1.25px |
2503
- | 20, 22 | 1.50px |
2504
- | 24 | 2.00px |
2505
-
2506
- > **The CSS numbers are user units, not pixels.** The sprite is one 24-unit
2507
- > viewBox, so `stroke-width: 2` renders `2 × size / 24` px. Each size class sets
2508
- > `--icon-stroke = target × 24 / size`, which is why the values are **not
2509
- > monotonic**: 18px needs a _smaller_ user-unit value (1.667) than 16px (1.875)
2510
- > to draw the same 1.25px, because its box is bigger. Do not tidy them into a
2511
- > sequence.
2512
-
2513
- > **This replaced a flat `stroke-width: 2`**, a strictly linear `size/12` ramp —
2514
- > exact at 12, 15 and 24, but up to 22% too thick elsewhere (1.83px against
2515
- > Figma's 1.50 at 22px). Note the direction: an earlier audit claimed our strokes
2516
- > were "roughly half" Figma's, on the grounds that Figma exports
2517
- > `stroke-width="2"` at every size. Both halves are false — only the 24px variant
2518
- > declares 2, the 12px variant declares nothing at all (SVG default 1), and our
2519
- > strokes were too **thick**, never thin. Verified by measuring painted output in
2520
- > Chromium against the Figma exports at all eleven sizes.
2521
-
2522
- > **14px was the one open value, and is now resolved at 1.25px.** Figma declares
2523
- > 1.1px there; the designer confirmed that was an authoring mistake and specified
2524
- > **1.25px**, so 14 joins the 15 / 16 / 18 plateau rather than extending the 1.0
2525
- > run at 12 / 13. Its user-unit value (2.142857) is the largest in the ramp — as
2526
- > it should be, since 14px is the smallest box that has to reach 1.25px.
2527
-
2528
- > **Sizing with a raw utility skips the ramp.** `.icon-size-*` carries the
2529
- > weight, so an icon sized with `w-5 h-5` instead of `.vd-icon-size-20` keeps the
2530
- > base 1.25px-at-16px value. Set `--icon-stroke` yourself in that case.
2531
-
2532
- > **One symbol is exempt**: `custom-help` is the sprite's only non-24 viewBox
2533
- > (22×22) and its only symbol with a `stroke-width` presentation attribute. An
2534
- > element's own presentation attribute beats an inherited CSS value, so the ramp
2535
- > does not reach it.
2536
-
2537
- ```html
2538
- <!-- Basic icon with sprite (14px - common for buttons) -->
2539
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2540
- <use href="#save" />
2541
- </svg>
2542
-
2543
- <!-- Small icon (13px) -->
2544
- <svg class="vd-icon vd-icon-size-13" aria-hidden="true">
2545
- <use href="#search" />
2546
- </svg>
2547
-
2548
- <!-- Icon with ring state (selected/active) -->
2549
- <svg class="vd-icon vd-icon-size-14 vd-icon-ring" role="img" aria-label="Active">
2550
- <use href="#check" />
2551
- </svg>
2552
-
2553
- <!-- Icon with status color -->
2554
- <svg class="vd-icon vd-icon-size-13 text-approved" aria-hidden="true">
2555
- <use href="#check-circle" />
2556
- </svg>
2557
-
2558
- <!-- Button with icon (see Button section above for full examples) -->
2559
- <button class="vd-btn vd-btn-primary">
2560
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2561
- <use href="#save" />
2562
- </svg>
2563
- Save Changes
2564
- </button>
2565
-
2566
- <!-- Custom icon (prefixed with 'custom-') -->
2567
- <svg class="vd-icon vd-icon-size-24" aria-hidden="true">
2568
- <use href="#custom-valiify-logo" />
2569
- </svg>
2570
- ```
2571
-
2572
- **Icon System Documentation**:
2573
-
2574
- - Sprite system: `src/icons/README.md` (2,035 icons, build process)
2575
- - Integration guide: `src/components/ICON-SYSTEM.md` (complete usage patterns)
2576
- - Icon list: `src/icons/icon-list.txt` (searchable names)
2577
-
2578
- #### SensitiveData
2579
-
2580
- A masked value with a toggle that reveals it — an SSN, an account number, a date
2581
- of birth. Extracted from Figma Sensitive Data (296:5303) — 2 variants on a
2582
- `Checked` boolean, plus `obscuredData` / `unobscuredData` text properties and a
2583
- Ring boolean.
2584
-
2585
- - **Base**: `.vd-sensitive-data` (the row, 4px gap)
2586
- - **Parts**: `.vd-sensitive-data-value` (Caption, `Content/Primary`)
2587
- - **Slots (reused components)**: `.vd-icon-button vd-icon-button-md` + `.vd-icon vd-icon-size-14`
2588
- - **States**: `.vd-with-ring`
2589
-
2590
- > **The toggle is an Icon Button, not a new part.** Figma nests an 18×18 box
2591
- > around a 14px glyph, which is `.vd-icon-button vd-icon-button-md` down to the pixel —
2592
- > including the 6px radius (`Radius/SM`) and the `Secondary/Main` glyph. Alert,
2593
- > Modal and Toast reuse Icon Button the same way for their dismiss controls.
2594
-
2595
- > **State is `aria-pressed`, and the CSS deliberately has no state rule.** The
2596
- > two Figma variants are visually **identical** — same box, same colours, same
2597
- > type. Only the value string and the glyph change, and both are the consumer's
2598
- > to supply, so there is nothing for CSS to select on. Inventing an
2599
- > `[aria-pressed]` rule to justify the attribute would be styling Figma does not
2600
- > draw. The attribute still matters: it tells assistive tech the control is a
2601
- > toggle and which way it is set, matching Pill, Tag and Tabs.
2602
-
2603
- > **`Checked` is not used as a class name, on purpose.** In Figma `Checked=yes`
2604
- > means the data is **hidden**, which reads backwards — a
2605
- > `.sensitive-data-checked` class would be actively misleading. Pair
2606
- > `aria-pressed="true"` with `#eye-off` and the obscured string; `false` with
2607
- > `#eye` and the plain one.
2608
-
2609
- > **No hover, focus or disabled variants are modelled** — the axis is `Checked`
2610
- > alone. All of them arrive from Icon Button, which carries its own hover,
2611
- > active, disabled and `:focus-visible`. The row itself is not interactive.
2612
-
2613
- > **Four Figma authoring artefacts are noted, not reproduced.** The component
2614
- > description is a **checkbox's**, pasted onto a masked-data toggle (same class
2615
- > of error as Toast carrying Tooltip's). `Radius/XS` (4px) is bound in the
2616
- > variant set but appears nowhere in the structure — the same phantom binding as
2617
- > FilterSegment's. The toggle's `Spacing/6` padding cannot contain its own glyph
2618
- > (18 − 12 leaves 6px for a 14px icon), so `.vd-icon-button-md`'s 2px is used
2619
- > instead. And `Spacing/10` is set as a gap on a box with one child. All on the
2620
- > designer list.
2621
-
2622
- ```html
2623
- <!-- hidden — Figma's Checked=yes -->
2624
- <span class="vd-sensitive-data">
2625
- <span class="vd-sensitive-data-value">***-**-1234</span>
2626
- <button
2627
- class="vd-icon-button vd-icon-button-md"
2628
- aria-pressed="true"
2629
- aria-label="Show full value"
2630
- >
2631
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2632
- <use href="#eye-off" />
2633
- </svg>
2634
- </button>
2635
- </span>
2636
-
2637
- <!-- revealed — Checked=no -->
2638
- <span class="vd-sensitive-data">
2639
- <span class="vd-sensitive-data-value">123-12-1234</span>
2640
- <button
2641
- class="vd-icon-button vd-icon-button-md"
2642
- aria-pressed="false"
2643
- aria-label="Hide value"
2644
- >
2645
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true"><use href="#eye" /></svg>
2646
- </button>
2647
- </span>
2648
- ```
2649
-
2650
- #### DataRow
2651
-
2652
- One labelled field in a review panel: field name, value, verification status,
2653
- and actions that appear on hover. Extracted from Figma Data Row (165:678) — 4
2654
- variants across `Hover` × `Icon`, plus `comment`, `help` and `ring` booleans.
2655
-
2656
- - **Base**: `.vd-data-row` (38px, 16px column gap)
2657
- - **Columns**: `.vd-data-row-field` (200px, truncating), `.vd-data-row-value` (400px)
2658
- - **Slot modifier**: `.vd-data-row-status` — additive, stretches the Field Verification slot
2659
- - **Actions**: `.vd-data-row-action` — additive on an Icon Button, revealed on hover/focus
2660
- - **States**: `:hover`, `.vd-with-ring`
2661
- - **Slots (reused components)**: `.vd-field-verification`, `.vd-sensitive-data`, `.vd-icon-button vd-icon-button-md`
2662
-
2663
- > **This component is mostly composition.** Figma builds it from three components
2664
- > we already ship, and so does the CSS — nothing is rebuilt. The status column is
2665
- > `.vd-field-verification vd-field-verification-verified` (an exact match: 7px gap, 16px
2666
- > Section Marker, 14px `#check` in `Approved/Main`, Caption label); the `Icon=yes`
2667
- > value is a literal `.vd-sensitive-data` instance; the trailing actions are
2668
- > `.vd-icon-button vd-icon-button-md`. Only four classes are new, three of which carry
2669
- > nothing but column geometry.
2670
-
2671
- > **`.vd-data-row-status` is an additive class, not a wrapper.** Figma stretches its
2672
- > Field Verification instance to `flex-1`, which `.vd-field-verification` does not do
2673
- > on its own. Rather than a descendant selector reaching into another component —
2674
- > the mistake DropdownField's avatar sizing made and had retired — it ships as a
2675
- > modifier you add alongside, the same shape as `.vd-segment-selector-fill`.
2676
-
2677
- > **The Sensitive Data type override is Data Row's, not the caller's.**
2678
- > Standalone, `.vd-sensitive-data-value` is `Body Content/Caption` (12/18). Inside a
2679
- > Data Row, Figma overrides it to `Body 2` (12.5/12.5) so it lines up with the
2680
- > field label. That is a fixed fact of the composition rather than a per-instance
2681
- > choice, so it is scoped in `data-row.css` — and it has to be, because a utility
2682
- > at the call site would not exist for consumers on the prebuilt entry.
2683
-
2684
- > **Actions are revealed by hover AND focus.** Figma draws the rest action at
2685
- > `opacity: 0` — laid out but invisible. Reproduced, except a button that is
2686
- > invisible and still focusable is a keyboard trap in all but name, so
2687
- > `:focus-within` reveals it too. That is a superset of Figma: identical on hover,
2688
- > and a keyboard user can now see what they tabbed to. Every action is icon-only
2689
- > and needs an `aria-label`.
2690
-
2691
- > **No focus, disabled or selected state is modelled** — the axis is `Hover`
2692
- > alone. The row is not interactive; only its actions are, and those bring Icon
2693
- > Button's own states.
2694
-
2695
- > **Three Figma artefacts, noted and not copied.** The description says "optional
2696
- > **leading** icon", but the `Icon` axis swaps the value cell for a Sensitive Data
2697
- > with a **trailing** eye toggle. `Neutral/Main` is bound in the variant set but
2698
- > appears nowhere in the structure — the same phantom binding as Sensitive Data's
2699
- > and FilterSegment's. And the 12.5px vertical padding cannot contain the row's
2700
- > own contents: 38 − 25 leaves 13px for an 18px Icon Button, so the vertical
2701
- > padding is vestigial; both are reproduced because `items-center` makes the
2702
- > overflow symmetrical and the rendered 38px is what matters.
2703
-
2704
- > **The 932px frame width is not reproduced** — it is the artboard's content
2705
- > width, with slack absorbed by the `flex-1` status column. Same call as Alert's
2706
- > 828 and Pagination's 1208. A data row spans its table.
2707
-
2708
- ```html
2709
- <div class="vd-data-row">
2710
- <span class="vd-data-row-field">First Name</span>
2711
- <span class="vd-data-row-value">John</span>
2712
-
2713
- <span class="vd-field-verification vd-field-verification-verified vd-data-row-status">
2714
- <span
2715
- class="vd-section-marker vd-section-marker-approve"
2716
- role="img"
2717
- aria-label="Verified"
2718
- >
2719
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2720
- <use href="#check" />
2721
- </svg>
2722
- </span>
2723
- <span class="vd-field-verification-label">Matches Plaid KYC</span>
2724
- </span>
2725
-
2726
- <button
2727
- class="vd-icon-button vd-icon-button-md vd-data-row-action"
2728
- aria-label="Field help"
2729
- >
2730
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2731
- <use href="#circle-question-mark" />
2732
- </svg>
2733
- </button>
2734
- </div>
2735
- ```
2736
-
2737
- #### Checkbox
2738
-
2739
- A native checkbox with a label, plus optional mono subtitle and trailing action.
2740
- Extracted from Figma Checkbox (108:607) — 4 variants across `Active` × `Hover` ×
2741
- `Disabled`, plus `label`, `subtitle`, `icon` and `ring` booleans.
2742
-
2743
- - **Base**: `.vd-checkbox` (a `<label>`, 9px gap)
2744
- - **Control**: `.vd-checkbox-control` (15px positioning box), `.vd-checkbox-input`, `.vd-checkbox-check`
2745
- - **Parts**: `.vd-checkbox-label`, `.vd-checkbox-subtitle`
2746
- - **Slots (reused components)**: `.vd-icon-button vd-icon-button-md`
2747
- - **States**: `:hover`, `:checked`, `:focus-visible`, `:disabled`, `.vd-with-ring`
2748
-
2749
- | State | box |
2750
- | ------------------ | -------------------------------------------------------------- |
2751
- | unchecked | 1px `Stroke/Divider`, no fill |
2752
- | unchecked hover | 1px `Stroke/Border`, `Action/Hover` fill |
2753
- | unchecked disabled | 1px `Stroke/Disabled`, no fill |
2754
- | checked | 1px + fill `Primary/Main`, 10px `#check` in `Content/Contrast` |
2755
-
2756
- > **The control is a real `<input type="checkbox">` inside a real `<label>`.**
2757
- > That is not incidental. Form-control accessible names are the most repeated
2758
- > defect in the accessibility audit — 20 nodes across Input, Switch and Textarea
2759
- > — and the cause every time was `<div class="…-label">`, which is styling with
2760
- > no programmatic association. A wrapping `<label>` names this control for free.
2761
- > If the visible text must sit outside, associate it with `for` / `id`; do not
2762
- > drop to a `<div>`.
2763
-
2764
- > **Everything is driven by native state** — `:checked`, `:disabled`,
2765
- > `:focus-visible`, `:hover`. There is no `checked` or `disabled` class to fall
2766
- > out of sync with the input, and the control submits with a form and works with
2767
- > the keyboard and a screen reader without any JavaScript.
2768
-
2769
- > **The checkmark is the sprite glyph, which is why there is a wrapper.** Figma
2770
- > draws Lucide `check` at 10px. A pseudo-element cannot render
2771
- > `<use href="#check">`, and a CSS-drawn tick would not be the same mark, so
2772
- > `.vd-checkbox-control` exists purely to give the input and the glyph a shared 15px
2773
- > positioning context. RadioSelect needs no wrapper because its inner mark is a
2774
- > plain circle it can draw with `::before`.
2775
-
2776
- > **The label goes _lighter_ when checked, and that is not a transcription
2777
- > error.** Unchecked it is `Content/Primary`; checked it is `Content/Tertiary` —
2778
- > the same colour as disabled. So a ticked row reads dimmer than an unticked one,
2779
- > and identical to one you cannot interact with. Reproduced faithfully and pinned
2780
- > in the spec; on the designer list, because a checked box reading as disabled is
2781
- > the opposite of the usual convention. Same shape as Step's inverted label ramp.
2782
-
2783
- > **Four things Figma does not model, none invented here:**
2784
- >
2785
- > - **No indeterminate state.** The axis is `Active`, a boolean — this is a
2786
- > two-state checkbox. `:indeterminate` is deliberately unstyled, so
2787
- > `input.indeterminate = true` currently renders as unchecked. A "select all"
2788
- > header has nothing to draw. Needs a designer decision; see the
2789
- > `IndeterminateGap` story.
2790
- > - **No focus state.** `:focus-visible` uses the library-wide `focus-ring`, as
2791
- > RadioSelect does.
2792
- > - **No error / invalid state.**
2793
- > - **No checked+hover and no checked+disabled** — only 4 of 8 combinations are
2794
- > drawn. Checked+disabled is the consequential one: with nothing drawn, a
2795
- > disabled ticked box keeps its full `Primary/Main` fill and reads as enabled.
2796
- > RadioSelect invented a treatment for exactly this gap; Checkbox does **not**,
2797
- > so the two components currently answer the same question differently.
2798
-
2799
- > **Two quirks that did _not_ appear**, worth recording because the components
2800
- > built alongside it all had them: the Figma description is **accurate**, and
2801
- > `Radius/XS` is genuinely the box radius rather than a phantom binding. The
2802
- > checked box's `Spacing/1` padding also fits its own glyph (15 − 2 ≥ 10), unlike
2803
- > Sensitive Data's and Data Row's.
2804
-
2805
- ```html
2806
- <label class="vd-checkbox">
2807
- <span class="vd-checkbox-control">
2808
- <input type="checkbox" class="vd-checkbox-input" />
2809
- <svg class="vd-checkbox-check vd-icon vd-icon-size-10" aria-hidden="true">
2810
- <use href="#check" />
2811
- </svg>
2812
- </span>
2813
- <span class="vd-checkbox-label">Content</span>
2814
- </label>
2815
-
2816
- <!-- with the subtitle and trailing-action booleans -->
2817
- <label class="vd-checkbox">
2818
- <span class="vd-checkbox-control">
2819
- <input type="checkbox" class="vd-checkbox-input" checked />
2820
- <svg class="vd-checkbox-check vd-icon vd-icon-size-10" aria-hidden="true">
2821
- <use href="#check" />
2822
- </svg>
2823
- </span>
2824
- <span class="vd-checkbox-label">Beneficial owner</span>
2825
- <span class="vd-checkbox-subtitle">TYPE</span>
2826
- <button
2827
- type="button"
2828
- class="vd-icon-button vd-icon-button-md"
2829
- aria-label="Open beneficial owner"
2830
- >
2831
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
2832
- <use href="#chevron-right" />
2833
- </svg>
2834
- </button>
2835
- </label>
2836
- ```
2837
-
2838
- #### Skeleton
2839
-
2840
- A placeholder that mimics the shape and size of content while it loads,
2841
- previewing page structure and preventing layout shift. Extracted from Figma
2842
- Skeleton (1063:24034) — 15 variants across `Shape` × `Size` — with a written
2843
- usage spec at 1081:1986.
2844
-
2845
- - **Base**: `.vd-skeleton` (fill + motion only — no dimensions)
2846
- - **Shapes**: `.vd-skeleton-line`, `.vd-skeleton-heading`, `.vd-skeleton-circle`, `.vd-skeleton-rectangle`, `.vd-skeleton-button`
2847
- - **Sizes**: `.vd-skeleton-sm`, `.vd-skeleton-md`, `.vd-skeleton-lg`
2848
-
2849
- **Both a shape and a size class are required.** Neither axis has a default in
2850
- Figma, and the dimensions are a 5×3 matrix rather than one box with three
2851
- scales — a Line SM is 120×12 while a Circle SM is 32×32.
2852
-
2853
- | Shape | radius | SM | MD | LG |
2854
- | --------- | --------------------- | ------ | ------- | ------- |
2855
- | Line | `rounded-tight` 4px | 120×12 | 200×16 | 320×20 |
2856
- | Heading | `rounded-tight` 4px | 160×20 | 240×24 | 360×32 |
2857
- | Circle | `rounded-pill` | 32 | 40 | 56 |
2858
- | Rectangle | `rounded-surface` 8px | 120×80 | 200×120 | 320×180 |
2859
- | Button | `rounded-control` 6px | 64×32 | 96×36 | 128×40 |
2860
-
2861
- > **Shape carries the radius, size carries the dimensions.** This is the only
2862
- > component in the library that uses four of the five radius tokens. Every one of
2863
- > the 15 pairs maps to a standard Tailwind step — 120px is `w-30`, 180px is
2864
- > `h-45` — so none needs arbitrary syntax.
2865
-
2866
- > **The defaults are starting points, not a spec.** The usage node is explicit:
2867
- > "stretch instances with fill in auto-layout to match real content widths",
2868
- > while "heights should generally stay close to defaults to match the replaced
2869
- > element". A consumer utility beats a component class under our layer order, so
2870
- > `class="vd-skeleton vd-skeleton-line vd-skeleton-md w-full"` just works.
2871
-
2872
- > **The animation is a pulse, and Figma specifies it precisely** — unusually,
2873
- > since it draws no motion itself ("Animation is handled in code, not in Figma"):
2874
- > **2s per cycle, ease-in-out, opacity 1.0 → 0.4 → 1.0**.
2875
-
2876
- > **It is deliberately not Tailwind's `animate-pulse`, though the node suggests
2877
- > it.** The usage spec offers `class="animate-pulse"` as a shortcut, but
2878
- > Tailwind's built-in keyframe is `50% { opacity: 0.5 }` on a
2879
- > `cubic-bezier(0.4, 0, 0.6, 1)` curve — neither the 0.4 floor nor the ease-in-out
2880
- > the same document specifies four bullets later. Custom keyframes are the only
2881
- > way to honour the written spec.
2882
-
2883
- > **Instances pulse in sync, and that falls out for free.** Figma asks that "all
2884
- > skeleton instances within a single container should pulse in sync (same
2885
- > animation start time)". Identical animations on elements rendered together
2886
- > share a start time, so they do. The thing to avoid is the opposite instinct —
2887
- > do **not** add per-element `animation-delay` to stagger them; that is exactly
2888
- > the effect the spec rules out.
2889
-
2890
- > **Reduced motion is guarded from the start, and the guard sits _inside_
2891
- > `@layer components`.** That placement is deliberate: `loading-indicator.css`
2892
- > puts its `prefers-reduced-motion` block outside the layer, which makes it the
2893
- > one rule in `dist` that outranks a consumer's utilities — the single place the
2894
- > overlay contract breaks. This file does not repeat it. The `@keyframes` stay
2895
- > outside the layer, as they do there, because `@keyframes` is name-scoped rather
2896
- > than cascaded.
2897
-
2898
- > **Accessibility: the skeleton is decorative, and this is a library decision** —
2899
- > Figma specifies nothing. A screen reader announcing five grey boxes is worse
2900
- > than silence, so each `.vd-skeleton` takes `aria-hidden="true"` and the
2901
- > **container** carries `role="status"`, `aria-busy="true"` and a label: one clear
2902
- > "Loading…" instead of N meaningless nodes. That differs from LoadingIndicator,
2903
- > where the spinner _is_ the announcement and carries `role="status"` itself.
2904
- > Markup is the consumer's, so CSS cannot enforce it.
2905
-
2906
- **Composition patterns**, from the usage node:
2907
-
2908
- | Pattern | compose |
2909
- | -------------- | --------------------------------------------------------- |
2910
- | Card | 1× Rectangle MD · 1× Heading MD · 2× Line MD · 1× Line SM |
2911
- | List item | 1× Circle SM · 1× Heading SM · 1× Line MD |
2912
- | Table row | multiple Line SM — one per column |
2913
- | Profile header | 1× Circle LG · 1× Heading LG · 1× Line MD |
2914
-
2915
- ```html
2916
- <div role="status" aria-busy="true" aria-label="Loading profile">
2917
- <span class="vd-skeleton vd-skeleton-circle vd-skeleton-lg" aria-hidden="true"></span>
2918
- <span class="vd-skeleton vd-skeleton-heading vd-skeleton-lg" aria-hidden="true"></span>
2919
- <span class="vd-skeleton vd-skeleton-line vd-skeleton-md" aria-hidden="true"></span>
2920
- </div>
2921
-
2922
- <!-- widths stretch; heights stay near the defaults -->
2923
- <span
2924
- class="vd-skeleton vd-skeleton-line vd-skeleton-md w-full"
2925
- aria-hidden="true"
2926
- ></span>
2927
- ```
2928
-
2929
- #### NavigationRail
2930
-
2931
- The sidebar family. Four sub-components in one file, composed together to build
2932
- the rail. **The rail container's own Figma reference has not been extracted yet**
2933
- — `.vd-nav-rail` is layout-only scaffolding (a flex column) and deliberately
2934
- declares no width, padding, surface or border until that spec arrives.
2935
-
2936
- - **Container**: `.vd-nav-rail` (provisional — see above)
2937
- - **Sub-components**:
2938
- - `.vd-nav-title` — 46px header. Parts: `.vd-nav-title-logo` (30px tile, put your own
2939
- `<img>`/`<svg>` inside), `.vd-nav-title-details`, `.vd-nav-title-name`,
2940
- `.vd-nav-title-subtitle`, `.vd-nav-title-action` (18px hit box)
2941
- - `.vd-nav-group` — 26px group header. Parts: `.vd-nav-group-label`,
2942
- `.vd-nav-group-chevron`, `.vd-nav-group-rule` (the collapsed-rail divider)
2943
- - `.vd-nav-item` — 32px row. Parts: `.vd-nav-item-icon` (16px),
2944
- `.vd-nav-item-label`, `.vd-nav-item-count` (mono), `.vd-nav-item-status` (5px dot)
2945
- - `.vd-nav-badge` — 14px "Beta" pill; slots inside a nav item
2946
- - **Collapsed rail**: `.vd-nav-title-collapsed`, `.vd-nav-group-collapsed`,
2947
- `.vd-nav-item-collapsed` — per-part for now, so each is independently renderable
2948
- and verifiable. A rail-level switch should drive them once the rail lands.
2949
- - **Nav item states**: `:hover`, `:active`, `:focus-visible`,
2950
- `[aria-current="page"]` (current page, blue), `.vd-nav-item-active` (ancestor
2951
- section, grey), `:disabled` / `[aria-disabled="true"]`
2952
- - **Group disclosure**: `aria-expanded` on the `.vd-nav-group` button rotates the
2953
- chevron **and hides the rows it controls**. Two markup shapes work:
2954
- `.vd-nav-group` + `.vd-nav-rail-items` (recommended — the wrapper gives
2955
- `aria-controls` a target), or flat `.vd-nav-group ~ .vd-nav-item` siblings.
2956
- Deliberately **inert in a collapsed rail**, where the header is a bare rule
2957
- with no chevron: hiding rows there would strand them with no way back.
2958
-
2959
- > **The library ships no JavaScript, so flipping `aria-expanded` is yours.** The
2960
- > whole integration is one handler; the CSS does the rest:
2961
- >
2962
- > ```js
2963
- > rail.addEventListener("click", (e) => {
2964
- > const header = e.target.closest(".nav-group");
2965
- > if (!header) return;
2966
- > header.setAttribute(
2967
- > "aria-expanded",
2968
- > header.getAttribute("aria-expanded") === "true" ? "false" : "true",
2969
- > );
2970
- > });
2971
- > ```
2972
- >
2973
- > Because the header is a real `<button>` with `aria-controls`, Enter/Space and
2974
- > screen-reader state announcement come for free. Verified both keys work.
2975
-
2976
- > **Give the rail a height.** `.vd-nav-rail` is `h-full` (`height: 100%`), so in an
2977
- > auto-height parent it resolves to content height (measured: 64px for a two-row
2978
- > rail) and `justify-between` has no slack — the footer stops being
2979
- > bottom-pinned. Put it in an `h-screen` wrapper, a grid row, or a sized flex
2980
- > parent.
2981
-
2982
- > **Keep the label and details in the DOM when collapsed.** They are `sr-only`,
2983
- > not removed. `.vd-nav-item-label`, `.vd-nav-item-count` and `.vd-nav-title-details` are
2984
- > what give those links their accessible names — omit them and you ship
2985
- > anonymous links in the tab order. Before this was fixed, axe found **16 of 21
2986
- > focusable nodes in the collapsed rail with no accessible name**.
2987
-
2988
- > **Figma's state names are inverted from intuition.** In the Nav Item set,
2989
- > **"Passive" is the blue current-page look** (`Primary/Soft` + `Primary/Main`)
2990
- > and **"Active" is a neutral grey highlight** (`Action/Selected` +
2991
- > `Content/Primary`). Mapped here to what they describe — `aria-current="page"`
2992
- > for the page you are on, `.vd-nav-item-active` for the section containing it.
2993
- > That pairing is a **reading**, not a fact from the file; confirm
2994
- > `.vd-nav-item-active` with the designer before relying on it.
2995
-
2996
- > **The group chevron is hover-only in Figma.** In the standalone component that
2997
- > makes the row grow 58 → 77px on pointer enter. **Inside the rail it does not
2998
- > grow** — the in-rail group fills, so it is 224px either way and the chevron
2999
- > just appears within it. Measured 224 at rest and 224 on hover. Touch users get
3000
- > no chevron; `:focus-visible` was added so keyboard users reach parity with
3001
- > mouse users, which is an addition to the design rather than a reading of it.
3002
-
3003
- Four more things the file gets wrong or leaves undone, reproduced as drawn rather
3004
- than silently corrected:
3005
-
3006
- | Finding | What we did |
3007
- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3008
- | Nav Badge declares `micro` / `md` sizes that are **pixel-identical** | Ship one `.vd-nav-badge`. No size modifiers — synonyms would encode a distinction the design does not make. |
3009
- | Collapsed group is **38.5px** wide (8 + a raw 22.5px rule + 8), which does not line up with the 44px collapsed nav item beside it | Reproduced at 38.5px; flagged as a suspected authoring artefact. |
3010
- | Collapsed Nav Title frame is **44px** but its contents measure 46 (8 + 30 + 8) | Width held at Figma's 44, padding tightened to 7px so the tile fits. |
3011
- | Status dot exists **only on the collapsed** nav item, though the description mentions a status indicator | Available in both, in **three colours** — Neutral/Main default, `.vd-nav-item-status-warning`, `.vd-nav-item-status-primary` — since the composed rail uses all three. |
3012
- | Collapsed Nav Group hugs to that **38.5px** half-pixel standalone | **Resolved by the rail spec**: inside the rail all three headers are set to fill, rendering 44px like everything else. 38.5 was only ever the hug width of a component nobody uses standalone. |
3013
-
3014
- **Audit findings (2026-08-27).** Reviewed with axe-core 4.13 over all 11 nav
3015
- stories, Playwright `ariaSnapshot` for accessible names, real Tab-key traversal
3016
- for focus, and the 89-check visual spec.
3017
-
3018
- | Finding | Status |
3019
- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
3020
- | Group disclosure rotated the chevron but **did not hide the rows** — a disclosure control that disclosed nothing | **Fixed.** Rows now hide, in both markup shapes. |
3021
- | Collapsed rail: **16 of 21 focusable nodes had no accessible name** (`display:none` on the only text of each link) | **Fixed.** Labels/counts/details are `sr-only`, not hidden. Re-measured: 0 unnamed. |
3022
- | Collapsed rail: `.vd-nav-badge` stayed visible, rendering 30.4px in a 44px row — **7px overflow** (scrollWidth 51 vs 44) | **Fixed.** Dropped when collapsed, as Figma does. |
3023
- | `.vd-nav-group-label` and `.vd-nav-item-count` are **Content/Tertiary**, which fails WCAG AA on two of four surfaces | **Open — designer.** See below. |
3024
- | Chevron is hover-only, so touch users get no disclosure affordance | **Open — designer.** Mitigated: rows hiding now signals state, and `:focus-visible` covers keyboard. |
3025
-
3026
- Everything else passed: focus rings are Primary/Main at 2px on all three
3027
- interactive parts (verified after the 150ms `transition-colors` settles — measured
3028
- mid-transition it reads as an in-flight blend), tab order follows document order,
3029
- Enter and Space both toggle, and all 26 classes ship in `dist`.
3030
-
3031
- **Contrast, measured.** Content/Tertiary `#727280` against the four surfaces —
3032
- 11px and 12px text both need 4.5:1:
3033
-
3034
- | Surface | Ratio | |
3035
- | ----------------- | ----- | -------- |
3036
- | Paper `#ffffff` | 4.74 | pass |
3037
- | Card `#fafafb` | 4.54 | pass |
3038
- | Neutral `#f1f1f4` | 4.20 | **fail** |
3039
- | Frame `#f0f3f7` | 4.26 | **fail** |
3040
-
3041
- Short by 0.24 at worst. It is a **token-wide** issue, not a nav one — the same
3042
- token is used across the library, and `docs/accessibility-audit.md` already
3043
- flagged it. Not changed here: it is Figma's specified colour and a designer's
3044
- call. Darkening the token to `#6d6d7a` would clear all four surfaces (4.58 on
3045
- Frame). Note the rail is transparent, so whether this fails at all depends on
3046
- the surface a consumer puts it on.
3047
-
3048
- Also note the `Beta` axis on Nav Item is declared but undrawn — every variant is
3049
- `Beta=no`, and the Beta visual comes from the badge slot instead. Not modelled.
3050
- And two text styles are named "- Bold" while resolving to Medium/500
3051
- (`Body 1 - Bold`, `Micro L - Bold`); 500 is what ships.
3052
-
3053
- ```html
3054
- <nav class="vd-nav-rail">
3055
- <a href="#" class="vd-nav-title">
3056
- <span class="vd-nav-title-logo"><img src="/logo.svg" alt="" /></span>
3057
- <span class="vd-nav-title-details">
3058
- <span class="vd-nav-title-name">Central Williamette</span>
3059
- <span class="vd-nav-title-subtitle">Main st branch</span>
3060
- </span>
3061
- <span class="vd-nav-title-action">
3062
- <svg class="vd-icon vd-icon-size-14" aria-hidden="true">
3063
- <use href="#chevron-down" />
3064
- </svg>
3065
- </span>
3066
- </a>
3067
-
3068
- <!-- Current page — Figma calls this "Passive" -->
3069
- <a href="#" class="vd-nav-item" aria-current="page">
3070
- <svg class="vd-nav-item-icon vd-icon vd-icon-size-16" aria-hidden="true">
3071
- <use href="#inbox" />
3072
- </svg>
3073
- <span class="vd-nav-item-label">Inbox</span>
3074
- <span class="vd-nav-item-count">41</span>
3075
- </a>
3076
-
3077
- <!-- Group header; chevron only appears on hover -->
3078
- <button class="vd-nav-group" aria-expanded="true">
3079
- <span class="vd-nav-group-label">Analyze</span>
3080
- <svg class="vd-nav-group-chevron vd-icon vd-icon-size-16" aria-hidden="true">
3081
- <use href="#chevron-down" />
3082
- </svg>
3083
- </button>
3084
-
3085
- <!-- Ancestor section — Figma calls this "Active" -->
3086
- <a href="#" class="vd-nav-item vd-nav-item-active">
3087
- <svg class="vd-nav-item-icon vd-icon vd-icon-size-16" aria-hidden="true">
3088
- <use href="#users" />
3089
- </svg>
3090
- <span class="vd-nav-item-label">Businesses</span>
3091
- <span class="vd-nav-badge">Beta</span>
3092
- </a>
3093
- </nav>
3094
-
3095
- <!-- Collapsed rail: same markup, plus the -collapsed classes -->
3096
- <nav class="vd-nav-rail">
3097
- <div class="vd-nav-group vd-nav-group-collapsed">
3098
- <span class="vd-nav-group-rule"></span>
3099
- </div>
3100
- <a href="#" class="vd-nav-item vd-nav-item-collapsed">
3101
- <svg class="vd-nav-item-icon vd-icon vd-icon-size-16" aria-hidden="true">
3102
- <use href="#bell" />
3103
- </svg>
3104
- <span class="vd-nav-item-label">Alerts</span>
3105
- <span class="vd-nav-item-status"></span>
3106
- </a>
3107
- </nav>
3108
- ```
3109
-
3110
- ### Design Tokens (real values, extracted from Figma)
3111
-
3112
- Tokens are **generated** — do not edit [src/themes/valiify.css](src/themes/valiify.css)
3113
- by hand:
3114
-
3115
- ```
3116
- tokens/figma-tokens.json ──scripts/build-theme.mjs──> src/themes/valiify.css
3117
- ```
3118
-
3119
- Regenerate with `npm run build:theme` (also runs as part of `npm run build`).
3120
- To pick up Figma changes, re-extract into the JSON, then regenerate.
3121
-
3122
- They live in a Tailwind `@theme` block, so **each one generates utilities** —
3123
- that is the intended way to consume them:
3124
-
3125
- | Token | Generates |
3126
- | --------------------------- | --------------------------------------------------- |
3127
- | `--color-primary` | `bg-primary`, `text-primary`, `border-primary` |
3128
- | `--color-content-secondary` | `text-content-secondary` |
3129
- | `--radius-control` | `rounded-control` |
3130
- | `--text-body-1` | `text-body-1` (size + line-height + weight + track) |
3131
-
3132
- Prefer those over hand-written `var(--color-…)`. Browse the whole set in
3133
- Storybook under **Foundations → Design Tokens**.
3134
-
3135
- **Colors** — 40 tokens. `Main` is unsuffixed (`Primary/Main` → `--color-primary`):
3136
-
3137
- - Primary: `--color-primary` / `-dark` / `-pressed` / `-soft` / `-disabled`
3138
- - Secondary: `--color-secondary` / `-strong` / `-soft` / `-disabled`
3139
- - Content: `--color-content-primary` / `-secondary` / `-tertiary` / `-faint` / `-contrast`
3140
- - Surface: `--color-surface-frame` / `-neutral` / `-card` / `-paper`
3141
- - Stroke (colors): `--color-stroke-divider` / `-border` / `-disabled`
3142
- - Action: `--color-action-subtle` / `-hover` / `-selected` / `-focused`
3143
- - Status: `--color-approved` / `-soft` / `-strong` / `-content`,
3144
- `--color-critical` / `-soft` / `-strong` / `-content`, `--color-warning` / `-soft`,
3145
- `--color-neutral` / `-soft` / `-strong` / `-content`
3146
- - One-off: `--color-misc-purple`
3147
-
3148
- **The surface stack is four deep**, back to front:
3149
-
3150
- | Token | Hex | Use |
3151
- | ------------------------- | --------- | --------------------------------------- |
3152
- | `--color-surface-frame` | `#f0f3f7` | app background |
3153
- | `--color-surface-neutral` | `#f1f1f4` | recessed regions |
3154
- | `--color-surface-card` | `#fafafb` | form fields on the `BG=Neutral` variant |
3155
- | `--color-surface-paper` | `#ffffff` | cards, panels, default field background |
3156
-
3157
- > **`surface-card` was missing until 2026-08-22, and this doc used to claim it
3158
- > did not exist.** It was absent from every extraction because
3159
- > `get_variable_defs` only returns variables _applied to a layer_, and nothing
3160
- > used it yet. The Text Input Container's new `BG=Neutral` variant applies it,
3161
- > and `search_design_system` confirms it as a real variable in Collection 1.
3162
- > The three field components previously mapped `BG=Neutral` onto
3163
- > `surface-neutral` (`#f1f1f4`), which rendered visibly darker than the design.
3164
- >
3165
- > **Lesson: use `search_design_system` — not `get_variable_defs` — to audit
3166
- > whether a token group is complete.**
3167
- >
3168
- > **It has now bitten twice.** `Critical/Content` (`#b73943`) was missing for
3169
- > exactly the same reason until Link (880:31368) applied it to its critical
3170
- > pressed state on **2026-08-24** — `Approved/Content` and `Neutral/Content`
3171
- > were both present, so it was a lone gap in an otherwise complete ramp.
3172
- > Confirmed as a real Collection 1 variable with `search_design_system` before
3173
- > being added. The colour group still has not been swept end-to-end.
3174
- >
3175
- > **There are no `info-*` colors.** Those were invented placeholders and are gone.
3176
-
3177
- **Radii** — named by role, because Tailwind v4 ships `--radius-xs`/`-sm`/`-md`
3178
- and redefining those silently changes `rounded-xs`/`-sm`/`-md` for consumers:
3179
-
3180
- | Token | px | Figma | Use |
3181
- | ------------------ | ---- | -------------- | ---------------- |
3182
- | `--radius-micro` | 2 | Radius/Micro | indicators, bars |
3183
- | `--radius-tight` | 4 | Radius/XS | tags, badges |
3184
- | `--radius-control` | 6 | Radius/SM | buttons, inputs |
3185
- | `--radius-surface` | 8 | Radius/MD | cards, panels |
3186
- | `--radius-pill` | 9999 | Radius/Rounded | avatars, pills |
3187
-
3188
- **Border widths** — no Tailwind namespace, so they need an explicit `var()`:
3189
-
3190
- - `--border-thin` 0.5px, `--border-line` 1px, `--border-micro` 2px
3191
- - `@apply border border-[length:var(--border-thin)];`
3192
-
3193
- > **Chrome renders the 0.5px hairline as a full 1px** — measured, at both 1x and
3194
- > 2x DPI. `getComputedStyle` reports `border-top-width: 1px` and the extra pixel
3195
- > is really in the layout box, so a 0.5px border adds **2px** to an element's
3196
- > height, not 1px.
3197
- >
3198
- > Consequence: **never size a bordered component with `min-height`** — it lands
3199
- > 1–2px past its Figma frame, because Figma draws its stroke _inside_ the frame.
3200
- > Use an explicit `height`, as `button.css`, `input.css`, and
3201
- > `dropdown-field.css` do. Verified in Storybook: all three field sizes then
3202
- > measure exactly 25 / 29 / 35.
3203
- >
3204
- > **Side-specific hairlines need the side-specific length utility.**
3205
- > `border-[length:…]` sets all four sides, so `border-t border-[length:var(--border-thin)]`
3206
- > silently produces a 0.5px box plus a 1px top. Write
3207
- > `border-t border-t-[length:var(--border-thin)]` instead.
3208
-
3209
- **Typography** — 37 composite `--text-*` tokens carrying size, line-height,
3210
- weight, and tracking in one utility. Roles: `text-display`, `text-h1`/`h2`,
3211
- `text-subtitle`, `text-body-1`/`-2` (±`-bold`), `text-caption`,
3212
- `text-action-l`/`m`/`s` (±`-bold`), `text-micro-l`/`m`/`s` (±`-bold`),
3213
- `text-statecap`, `text-label-*`, `text-data-*`, `text-help-caption`.
3214
-
3215
- > **`--text-*` carries neither `font-family` nor `text-transform`.** This is the
3216
- > most repeatable trap in the token system, and it fails silently:
3217
- >
3218
- > - JetBrains Mono styles need `font-mono` or they render in Inter:
3219
- > `@apply text-data-m font-mono;`
3220
- > - Label styles are uppercase in Figma. Use the generated `type-label-*`
3221
- > utilities, which bundle casing (and the mono family) into one class:
3222
- > `@apply type-label-l;`
3223
-
3224
- **Line height** — `normal` on 12 styles is Figma's **"Auto"**: the font's own
3225
- metrics, ~1.21x for Inter. The Figma API reports Auto as the sentinel `100`,
3226
- which does **not** mean 100%. Emitting `1` for it makes those styles visibly too
3227
- tight; an earlier version of this pipeline got that wrong.
3228
-
3229
- Because Auto makes the line box font-dependent, **component heights must not be
3230
- derived from it.** `button.css` sets explicit heights (24 / 28 / 32px, measured
3231
- from the Figma variant frames) for exactly this reason.
3232
-
3233
- **Letter spacing** — every Figma letter-spacing value is a **percentage** of font
3234
- size, never px, so tokens are emitted in `em`: `10%` → `0.1em`, `0.4%` →
3235
- `0.004em`.
3236
-
3237
- **Spacing** — no tokens defined, on purpose. Tailwind v4's scale is a multiplier
3238
- of `--spacing` (0.25rem), so Figma's whole-pixel values all map to standard
3239
- steps. Use native utilities:
3240
-
3241
- | Figma | px | Tailwind | Figma | px | Tailwind |
3242
- | ------------- | --- | ----------- | -------------- | ---- | ------------ |
3243
- | `Spacing/1` | 1 | `p-0.25` | `Spacing/11` | 11 | `p-2.75` |
3244
- | `Spacing/2` | 2 | `p-0.5` | `Spacing/12` | 12 | `p-3` |
3245
- | `Spacing/3` | 3 | `p-0.75` | `Spacing/12-5` | 12.5 | `p-[12.5px]` |
3246
- | `Spacing/4` | 4 | `p-1` | `Spacing/14` | 14 | `p-3.5` |
3247
- | `Spacing/5` | 5 | `p-1.25` | `Spacing/16` | 16 | `p-4` |
3248
- | `Spacing/6` | 6 | `p-1.5` | `Spacing/20` | 20 | `p-5` |
3249
- | `Spacing/7` | 7 | `p-1.75` | `Spacing/22` | 22 | `p-5.5` |
3250
- | `Spacing/7-5` | 7.5 | `p-[7.5px]` | `Spacing/24` | 24 | `p-6` |
3251
- | `Spacing/8` | 8 | `p-2` | `Spacing/28` | 28 | `p-7` |
3252
- | `Spacing/9` | 9 | `p-2.25` | `Spacing/32` | 32 | `p-8` |
3253
- | `Spacing/10` | 10 | `p-2.5` | | | |
3254
-
3255
- > Never define `--spacing-8: 8px`. It would make `p-8` mean 8px instead of 32px
3256
- > and break existing usage.
3257
- >
3258
- > **Half-pixel values need arbitrary syntax.** Tailwind's multiplier must be a
3259
- > multiple of 0.25 (= 1px steps), so it can express any whole pixel but no
3260
- > half-pixel. The multiplier forms `p-1.875` and `p-3.125` do **not** compile —
3261
- > verified against the compiler, not assumed. Use the arbitrary values
3262
- > `p-[7.5px]` and `p-[12.5px]` for Figma's two fractional spacing tokens.
3263
-
3264
- **Elevation** — `--shadow-panel` → `shadow-panel` (Figma General Drop Shadow).
3265
-
3266
- **Focus ring** — the shared tab-through affordance, from Figma Menu Item → Ring.
3267
- Apply the `focus-ring` utility on `:focus-visible`:
3268
-
3269
- ```css
3270
- .btn:focus-visible {
3271
- @apply focus-ring;
3272
- }
3273
- ```
3274
-
3275
- - `--ring-focus-width` 2px, `--ring-focus-color` `Primary/Main`
3276
- - Defined with `@utility` in [src/utilities/index.css](src/utilities/index.css).
3277
- Only `@utility` registers a real Tailwind utility; a plain class in
3278
- `@layer utilities` cannot be `@apply`-ed.
3279
- - Uses a negative `outline-offset` so the ring's outer edge aligns with the
3280
- component's own outer edge, matching Figma's full-size overlay frame.
3281
- - Needs no radius — `outline` follows the element's `border-radius`.
3282
-
3283
- ### Token readings — resolved
3284
-
3285
- Verified against the Figma **Text Preview** section (`929:28132`), which labels
3286
- every style with its spec. Recorded in `tokens/figma-tokens.json` under
3287
- `$meta.resolved`:
3288
-
3289
- - `lineHeight: 100` is Figma **"Auto"**, not 100% → `line-height: normal`
3290
- - `letterSpacing` values are **percentages**, not px → emitted as `em`
3291
- - The six Label styles are **uppercase** → `type-label-*` utilities
3292
-
3293
- ### Still open
3294
-
3295
- - **`get_variable_defs` only returns variables applied to a layer.** Typography
3296
- is exhaustive (it comes from the Text Preview section), but a colour or number
3297
- token defined in Figma and not yet used could still be missing. **This has now
3298
- bitten once** — `Surface/Card` was absent for exactly this reason until
3299
- 2026-08-22. Audit with `search_design_system`, which lists variables whether
3300
- or not anything uses them. The colour group has not yet been swept that way
3301
- end-to-end, so other unused tokens may still be missing.
3302
- - **Duplicate Figma style names silently drop tokens.** The API returns a keyed
3303
- object, so two styles sharing a name collapse into one — and the survivor's
3304
- values get attributed to the wrong style. This already happened once with
3305
- `Label S Sans`. If a token looks wrong, check for a name collision first.
3306
- - ~~`Body & Supporting/Help & Caption` is applied to component layers but
3307
- absent from the Text Preview section~~ — **resolved 2026-08-23**: Modal
3308
- (908:1580) applies it to `.vd-modal-description`, so it is current.
3309
- - `--radius-micro` and `--radius-tight` role names are provisional.
3310
- - Component **horizontal** padding is still inferred; heights are now exact.
3311
-
3312
- ## Installation
3313
-
3314
- ```bash
3315
- npm install @valiify/dashboard-ui tailwindcss
3316
- ```
3317
-
3318
- ## Configuration
3319
-
3320
- CSS-only — there is no Tailwind plugin to register, and no `tailwind.config.js`.
3321
- **Two supported entry points**, and the difference is load-bearing:
3322
-
3323
- | Entry | You get | You do NOT get |
3324
- | --------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------- |
3325
- | `@valiify/dashboard-ui` (prebuilt) | `.vd-*` classes + tokens as CSS custom properties, **plus Preflight and an `html` rule** | token-derived utilities |
3326
- | `@valiify/dashboard-ui/styles.css` | `.vd-*` classes + tokens + a **closed** `vd:` utility set, **no Preflight, no `html` rule, unlayered** | utilities outside the closed set |
3327
- | `@valiify/dashboard-ui/source` | the classes **plus** every token utility — `bg-approved`, `rounded-pill`, `type-label-l`, … | — |
3328
- | `@valiify/dashboard-ui/reset.css` | **optional, opt-in**: the ~20-line floor `./styles.css` needs on a page with no other stylesheet | anything a host is entitled to own |
3329
-
3330
- ```css
3331
- /* into a host app that already has a reset (Tailwind 3 + daisyUI, etc.) */
3332
- @import "@valiify/dashboard-ui/styles.css"; /* FIRST — CSS discards a later @import */
3333
-
3334
- /* a standalone page on the host-safe bundle — add the reset, in this order */
3335
- @import "@valiify/dashboard-ui/reset.css";
3336
- @import "@valiify/dashboard-ui/styles.css";
3337
-
3338
- /* standalone page, our Preflight is welcome */
3339
- @import "tailwindcss";
3340
- @import "@valiify/dashboard-ui";
3341
-
3342
- /* source — consumer's Tailwind processes our @theme */
3343
- @import "tailwindcss";
3344
- @import "@valiify/dashboard-ui/source";
3345
- ```
3346
-
3347
- > **`./reset.css` is opt-in and nothing pulls it in for you** (new in 0.3.0). It is
3348
- > not part of `./styles.css`, because dropping Preflight from that bundle was the
3349
- > whole point — a reset that arrives uninvited in a daisyUI app is the problem it was
3350
- > built to avoid. Load it only when the bundle is the ONLY stylesheet on the page;
3351
- > inside an app that already resets, its first eight rules are redundant and its
3352
- > ninth (`html { color; background-color }`) would repaint a page the host owns.
3353
- > Order matters: the reset first, so the bundle's `.vd-*` classes (0,1,0) sit after
3354
- > and above its element rules (0,0,1). `verify:reset` measures both halves of that
3355
- > claim in a browser; see **Host verification** below.
3356
-
3357
- > **`.` is not host-safe, and that is deliberate.** `dist/index.css` ships full
3358
- > Tailwind Preflight plus `html { color; background-color }`. Dropped into an app
3359
- > that has its own reset it zeroes every element's margin, padding and border and
3360
- > repaints the page. `./styles.css` is the same components with neither, built by
3361
- > `scripts/build-styles.mjs` as a separate artifact. `verify:bundle` asserts the
3362
- > absence of both, and `verify:package` re-asserts it on the packed tarball.
3363
-
3364
- > **The prebuilt bundle is UNLAYERED; source, `./source` and `dist/index.css`
3365
- > keep their layers** (decided 2026-09-16). Inside `@layer components`, every
3366
- > component rule loses to any unlayered host rule before specificity or source
3367
- > order is consulted — Tailwind 3 preflight (`* { border-width: 0 }`, `button {
3368
- > background-color: transparent }`, `input, textarea { color: inherit }`), daisyUI
3369
- > 4, a Svelte `:global()` reset. Measured on the 0.2.0 artifact: `.vd-btn-primary`
3370
- > lost its fill, ink, hairline, padding and type; every field lost its hairline;
3371
- > the active tab lost its rule. The `vd-` rename could never have fixed this; it is
3372
- > not a name collision. `build-styles.mjs` unwraps pass A at build time so
3373
- > `src/components` stays layered for the Tailwind-v4 entries, where the layer IS
3374
- > the contract (`verify:layers`' original assertion). There was no `@layer base`
3375
- > to relocate — pass A never imported `../base`, and the build now fails if it
3376
- > does. `build-manifest.mjs` walks every rule's selector instead of the bodies of
3377
- > `@layer components`, which no longer exist in the bundle.
3378
- >
3379
- > **It was invisible on the common path.** A host that `@import`s the bundle into
3380
- > its `@tailwind` file has Tailwind 3 consume the layer blocks and re-emit the
3381
- > rules unlayered — the bug vanishes, the library looks correct. It broke on a raw
3382
- > `<link>`, and Tailwind 3 refused a lone `@import` of the file outright.
3383
- > `examples/daisyui-starter` passed 10/10 with the bug present because it tested
3384
- > only the import path and only properties preflight never touches; it now tests
3385
- > all three paths per control and fails the 0.2.0 artifact 40/54.
3386
- >
3387
- > **The two-clause host contract** (consumers: README, GETTING_STARTED):
3388
- >
3389
- > 1. _Defends against_ any host rule of lower specificity, wherever it sits in
3390
- > source order, provided the bundle loads after the host's reset.
3391
- > 2. _Cannot defend against_ a host rule of higher specificity — a Svelte scoped
3392
- > `button { }` compiles to `button.svelte-hash` (0,1,1) and beats our 0,1,0 —
3393
- > or a host that wraps its own CSS in a layer. Remedy: scope element resets by
3394
- > class or exclude library controls (`button:not([class*="vd-"])`).
3395
- > `examples/sveltekit-starter` asserts the limit as a loss on purpose.
3396
- >
3397
- > **Behaviour change for consumers**: a single-class override still wins by
3398
- > source order when it loads after us; overriding a compound state rule now needs
3399
- > matching specificity. Our own `vd:` utilities are consumers too — they beat the
3400
- > 295 single-class component selectors by source order and lose to the 273
3401
- > compound ones; `verify:utility-precedence` fails when generated markup relies on
3402
- > the latter (today: none).
3403
-
3404
- > **The `vd:` utility set is CLOSED.** It is generated from
3405
- > `design-methodology/dashboard.md` by `build-utility-surface.mjs` — whatever the
3406
- > methodology does not cite is not emitted, so a page using it renders unstyled
3407
- > with nothing failing. Add the utility to the methodology, rebuild, and it ships.
3408
- > Consumers on `./source` are unaffected; they compile their own.
3409
-
3410
- > **Custom utilities differ between the two.** `focus-ring` and the six
3411
- > `type-label-*` are `@apply`-inlined, so they never appear as classes in a bundle.
3412
- > On `./source` you can write all seven unprefixed. On `./styles.css` you get only
3413
- > `vd:focus-ring`, `vd:type-label-l-bold` and `vd:type-label-s-bold` — the three the
3414
- > methodology cites. `class-manifest.json` records both lists.
3415
-
3416
- `./source` maps to [src/library.css](src/library.css), which deliberately omits
3417
- `@import "tailwindcss"` so the consumer's config stays in charge. Verified against
3418
- a real packed install that our internal `source(none)` does not disable a
3419
- consumer's content detection.
3420
-
3421
- **Fonts are not bundled.** CSS requires every `@import` to precede all other
3422
- rules, so a font import inside `dist/index.css` is discarded as soon as a
3423
- consumer imports that bundle (measured: it landed after 44 rules). Opt in with
3424
- `@import "@valiify/dashboard-ui/fonts";` as the **first** line, or self-host.
3425
-
3426
- There is no `data-theme` attribute to set. V1 is a single light theme applied at
3427
- the root.
3428
-
3429
- > **Token names are public API.** Renaming or removing a token is a breaking
3430
- > change — consumers write `bg-approved` and `var(--radius-control)` in their own
3431
- > code. Changing a token's _value_ is fine; changing its _name_ is not. See
3432
- > [CHANGELOG.md](CHANGELOG.md).
3433
-
3434
- ## Development Status
3435
-
3436
- **Current Phase**: Phase 3 — the component set is built out
3437
- **Next Phase**: Accessibility remediation, then publish
3438
-
3439
- Completed:
3440
-
3441
- - ✅ Project infrastructure (build pipeline, TypeScript, PostCSS)
3442
- - ✅ Real design tokens extracted from Figma (40 colors, 5 radii, 3 border
3443
- widths, 37 text styles, 6 label utilities and 4 shadows) via a generated
3444
- pipeline
3445
- - ✅ **39 components**, each extracted from a Figma node and documented above.
3446
- 38 carry a visual spec; Card is the one exclusion, and is placeholder
3447
- scaffolding rather than a real component
3448
- - ✅ Token showcase in Storybook (Foundations → Design Tokens)
3449
- - ✅ Component generator (`npm run new:component`)
3450
- - ✅ Storybook 10 with interactive documentation
3451
- - ✅ TypeScript definitions
3452
- - ✅ **Twelve verification gates**, eleven wired into CI
3453
- ([.github/workflows/ci.yml](.github/workflows/ci.yml)): `build:theme:check`,
3454
- `verify:layers`, `verify:vocabulary`, `verify:bundle`, `verify:markup`,
3455
- `verify:layer-defeat`, `verify:utility-precedence`, `verify:reset`,
3456
- `verify:package`, `audit`, `verify:component`, `verify:visual` — plus the two
3457
- example host checks
3458
- (`examples/daisyui-starter`, `examples/sveltekit-starter`), which render the
3459
- prebuilt bundle inside Tailwind 3 + daisyUI 4 and SvelteKit.
3460
- `verify:a11y` exists and is deliberately **not** wired — it reports 182
3461
- pre-existing violation groups, identical to a pre-rename baseline, dominated by
3462
- the designer-blocked `Content/Tertiary` contrast pair. Wiring a permanently red
3463
- gate trains people to ignore it; wire it when the token decision lands.
3464
-
3465
- Pending:
3466
-
3467
- - ⏳ **Contrast tokens fail WCAG AA** on high-traffic labels and placeholders.
3468
- Designer-blocked; no CSS resolves a token pair below AA. This blocks
3469
- accessibility sign-off — see [docs/handoff-report.md](docs/handoff-report.md) §4a
3470
- - ⏳ Accessibility remediation: five code-fixable bugs and three ARIA defects in
3471
- documented markup (§3b, §3c of the same report)
3472
- - ⏳ Confirm the unconfirmed token readings with the designer (see **Still open**)
3473
- - ⏳ Component **horizontal** padding is still inferred; heights are exact
3474
- - ⏳ Re-audit Checkbox, DataRow and SensitiveData — all three were built after
3475
- the audit passes ran, so neither axe nor the Figma sweep has covered them
3476
- - ⏳ Code Connect mappings
3477
- - ⏳ NPM publishing
3478
- - ⏳ Storybook deployment
3479
-
3480
- ## Building a Component
3481
-
3482
- **The full process is [docs/component-process.md](docs/component-process.md).
3483
- Read it before starting.** It covers locating the component in Figma, the
3484
- subagent extraction brief, the CSS traps, and what Figma routinely gets wrong.
3485
-
3486
- The short version:
3487
-
3488
- ```bash
3489
- # 1. sweep the component's metadata first — one cheap call, gives the variant
3490
- # matrix and catches changes the designer did not mention
3491
- # 2. extract the spec with a subagent (cheapest tool per question — see the doc)
3492
- npm run new:component Badge # scaffold — one name only
3493
- # populate badge.css by hand
3494
- # add an entry to scripts/visual-specs.mjs <- not optional
3495
- # document the classes in the Quick Reference above
3496
- npm run build && npm run typecheck
3497
- npm run verify:component Badge
3498
- npm run verify:visual -- Badge # scoped while iterating; full suite before commit
3499
- npm run audit # coverage across the library
3500
- ```
3501
-
3502
- **Revising a component that already ships?** Do not re-run the whole sequence —
3503
- `get_metadata` plus a targeted agent answers most revisions for about a tenth
3504
- of the cost. See _Revising an existing component_ in the process doc.
3505
-
3506
- Three rules that are load-bearing:
3507
-
3508
- 1. **Scaffold first** — `npm run new:component` writes the CSS from the
3509
- template, registers the `@import` alphabetically, creates the story, and
3510
- adds the class type. Creating those by hand gets one of them wrong.
3511
- 2. **Every component needs a visual spec.** A component with no entry in
3512
- [scripts/visual-specs.mjs](scripts/visual-specs.mjs) is unverified however
3513
- good its CSS looks. The harness has caught four defects in components that
3514
- already looked finished.
3515
- 3. **Size bordered components with `height`, not `min-height`** — Chrome rounds
3516
- the 0.5px hairline up to a full 1px, so a hairline adds 2px of height and
3517
- the component lands past its Figma frame.
3518
-
3519
- The reference implementations are [button.css](src/components/button.css)
3520
- (variants, sizes, states) and [input.css](src/components/input.css) (nested
3521
- state selectors).
3522
-
3523
- ### Visual verification — the check that actually catches things
3524
-
3525
- ```bash
3526
- npm run storybook # in one terminal
3527
- npm run verify:visual # every component with a spec
3528
- npm run verify:visual -- Input Button
3529
- npm run verify:visual -- --url http://localhost:6007
3530
- ```
3531
-
3532
- Renders each story in headless Chromium and asserts **computed** styles against
3533
- values extracted from Figma. This is the only check that catches a component
3534
- which compiles cleanly, uses every right token, and still renders at the wrong
3535
- size — which has now happened four times:
3536
-
3537
- | Caught | Component |
3538
- | ----------------------------------------------------------------------------------------- | -------------------- |
3539
- | Rendered 1–2px oversized (`min-height` + a hairline Chrome rounds to 1px) | Input, DropdownField |
3540
- | `sm` and `md` shipped the wrong text style — the three sizes are three styles, not one | Button |
3541
- | `.vd-with-ring` was outset in the variant's own colour; Figma has it inset in `Primary/Main` | Chip |
3542
- | Disabled faded the whole button with `opacity-50` instead of using `Secondary/Disabled` | IconButton |
3543
-
3544
- - Expected values live in [scripts/visual-specs.mjs](scripts/visual-specs.mjs);
3545
- the runner is [scripts/visual-verify.mjs](scripts/visual-verify.mjs).
3546
- - Compare colours with `{ token: '--color-x' }`, never a literal — the theme
3547
- emits `oklch()`, so a hardcoded `rgb()` fails even when the colour is right.
3548
- - Default tolerance is exact. Widen it only where the delta is understood and
3549
- written down next to the check; a loose tolerance hides regressions.
3550
- - **Add a spec entry whenever you build a component.** A component with no spec
3551
- is unverified, however good its CSS looks. The one deliberate omission is
3552
- Card, which is placeholder scaffolding rather than a real component.
3553
-
3554
- ### Accessibility verification
3555
-
3556
- ```bash
3557
- npm run verify:a11y # every story
3558
- npm run verify:a11y -- NavigationRail # one component
3559
- ```
3560
-
3561
- axe-core over each story in headless Chromium, with the same five harness-level
3562
- rules disabled that `docs/accessibility-audit.md` used, so runs stay comparable.
3563
- Exits non-zero when anything fires.
3564
-
3565
- This is the third lens and it sees what the other two cannot — names, roles,
3566
- ARIA wiring and contrast. It earned its place immediately: it found that every
3567
- nav item in the collapsed rail was an **unnamed link in the tab order**, which
3568
- the 89-check visual spec passed clean, because `display:none` on a label is
3569
- invisible to a geometry assertion and fatal to a screen reader.
3570
-
3571
- > **Do not check accessible names with `textContent`.** It reads through
3572
- > `display:none`, so a hidden label still looks present — a probe built that way
3573
- > reported names for all 21 controls in the collapsed rail while axe reported 16
3574
- > with none. axe was right. Use this script or Playwright's `ariaSnapshot()`.
3575
-
3576
- > **Let transitions settle before measuring computed colour.** `transition-colors`
3577
- > covers `outline-color`, so a focus ring read immediately after `Tab` returns an
3578
- > in-flight blend between the old and new colour. Measured mid-transition it
3579
- > looks like a broken ring; after ~400ms it is correct. This cost a false-alarm
3580
- > investigation.
3581
-
3582
- ### Static verification
3583
-
3584
- ```bash
3585
- npm run verify:component Avatar
3586
- ```
3587
-
3588
- Reads the source rather than rendering it: hardcoded colours / radii / type,
3589
- `@layer components` wrapper, `:hover` guarded against disabled, import
3590
- registered and alphabetical, and whether the component is typed, storied and
3591
- present in `dist`.
3592
-
3593
- The two checks are complementary and neither replaces the other — this one
3594
- cannot see a 1px height error, and the visual harness cannot see a hardcoded
3595
- hex that happens to match its token.
3596
-
3597
- ### Host verification — computed styles inside a foreign app
3598
-
3599
- Every gate above checks class NAMES or the bundle's own text. None of them can
3600
- see a host stylesheet win over a component rule, which is how 0.2.0 shipped a
3601
- bundle whose every control lost its border to Tailwind 3 preflight. These render
3602
- the bundle and read computed styles:
3603
-
3604
- ```bash
3605
- npm run verify:layer-defeat # the 0.2.0 repro; tests/fixtures/layer-defeat.html
3606
- npm run verify:utility-precedence # no vd: utility in generated markup loses to a compound selector
3607
- cd examples/daisyui-starter && npm run check # Tailwind 3 + daisyUI 4, three load paths
3608
- cd examples/sveltekit-starter && npm run check # Svelte scoped styles, incl. the documented limit
3609
- ```
3610
-
3611
- All carry canaries and run in CI. `verify:layer-defeat` takes `--file <bundle>` so
3612
- a released artifact can be re-measured; `verify:layers` asserts the inverse layer
3613
- contract on `dist/dashboard-ui.css` every run, with the layered `dist/index.css`
3614
- as its canary.
3615
-
3616
- > **A test that cannot fail when the fix is reverted is not a test.** Each of
3617
- > these was run against the saved 0.2.0 bundle before it was trusted:
3618
- > verify:layer-defeat 2/3, verify:layers red on the inverse block, daisyui 40/54
3619
- > with the fingerprint named on all three controls, sveltekit 4/6. The previous
3620
- > daisyui check read 10/10 on the same file.
3621
-
3622
- ```bash
3623
- npm run verify:reset # src/reset.css: 0 defeats, and it still closes the gap
3624
- npm run verify:reset -- --file <bundle.css> # re-measure a released artifact
3625
- ```
3626
-
3627
- > **The reset is still not IN the bundle, and that has not changed.**
3628
- > `dist/dashboard-ui.css` ships no element reset and no `html` rule — its only
3629
- > unlayered non-`vd-` rules are the `:root, :host` token blocks, and
3630
- > `verify:bundle` fails the build on either. `src/reset.css` is a **separate,
3631
- > optional, opt-in** file that no entry imports for you (0.3.0). It exists because
3632
- > a page whose only stylesheet is the bundle gets the browser defaults, and those
3633
- > break the library: measured over the documented markup, 479 of 582 elements
3634
- > rendered content-box and 52 of 146 Figma-pinned dimensions were wrong — the sm
3635
- > input at 38px against a designed 25, Alert 55% too tall on UA `<p>` margins, every
3636
- > underline tab 4px too wide on the UA `<button>` border, the whole document in
3637
- > Times.
3638
- >
3639
- > **It ships with `verify:reset`, and it could not ship without it.** The sibling
3640
- > shortapp library shipped the same file in its 1.0.0 with 50 self-inflicted
3641
- > defeats against its own layered bundle — its `button { color: inherit }` beat the
3642
- > white ink on its own primary button, and nothing they owned could see it, because every
3643
- > gate they had checked class names rather than computed styles. Gate 1 asserts the
3644
- > reset overrides nothing the bundle declares; gate 2 asserts it still does its job,
3645
- > by rendering the documented markup identically to `dist/index.css` — the entry
3646
- > that carries Preflight. Both carry canaries, and each of the reset's nine rules
3647
- > was proven load-bearing by deleting it and watching gate 2 go red. Run against a
3648
- > deliberately re-layered copy of the bundle, gate 1 reports **343** defeats.
3649
- >
3650
- > One divergence from `dist/index.css` is deliberate and asserted by name:
3651
- > `<dialog>` keeps the UA's `margin: auto`. Preflight zeroes it, which pins a
3652
- > `showModal()`ed `.vd-modal` to the top-left corner (measured: x=0, y=0 against
3653
- > x=360 centred) — contradicting what the Modal section promises. Matching the
3654
- > reference there would reproduce a defect, so the reset leaves `<dialog>` alone and
3655
- > `KNOWN_DIVERGENCES` in the gate records why. That list fails in both directions: an
3656
- > unlisted difference fails the gate, and a listed one that stops being observed
3657
- > fails it too.
3658
-
3659
- ## Storybook
3660
-
3661
- Run locally:
3662
-
3663
- ```bash
3664
- npm run storybook
3665
- ```
3666
-
3667
- View all components with interactive controls and documentation at http://localhost:6006
3668
-
3669
- ## Build
3670
-
3671
- ```bash
3672
- npm run build # Regenerate theme, then compile src/index.css -> dist/index.css
3673
- npm run build:theme # Regenerate src/themes/valiify.css from tokens/figma-tokens.json
3674
- npm run dev # Same, in watch mode
3675
- npm run typecheck # tsc --noEmit over types/, stories/, .storybook/
3676
- npm run format # Format code with Prettier
3677
- ```
3678
-
3679
- Output:
3680
-
3681
- - `dist/index.css` - the entire published artifact (tokens + component styles)
3682
-
3683
- `dist/index.css` deliberately contains **no Tailwind utility classes** — a
3684
- component library shouldn't ship an app's utilities. Consumers generate their own.
3685
- Storybook gets utilities via `@source` globs in
3686
- [.storybook/preview.css](.storybook/preview.css).
3687
-
3688
- Type definitions are hand-maintained in [types/](types/) and shipped as-is; they
3689
- are not generated.
3690
-
3691
- `src/themes/valiify.css` IS generated — from `tokens/figma-tokens.json` via
3692
- `scripts/build-theme.mjs`. Edit the JSON, not the CSS.
3693
-
3694
- ## Architecture
3695
-
3696
- - **CSS-only** - Zero JavaScript dependencies, no Tailwind plugin, no `tailwind.config.js`
3697
- - **Tailwind v4 `@theme`** - Tokens generate utilities automatically
3698
- - **Single light theme** - V1 only; no dark mode or per-tenant theming
3699
- - **Framework-agnostic** - Works with React, Vue, Svelte, vanilla HTML, etc.
3700
-
3701
- > **Tailwind v4, not v3.** Several v3 idioms silently produce invalid CSS here.
3702
- > Notably `rounded-[--token]` and `border-[length:--token]` — the implicit-var
3703
- > shorthand was dropped, so those compile to `border-radius: --token`, which
3704
- > browsers discard without warning. Always write `var()` explicitly, and check
3705
- > `dist/index.css` when a style mysteriously doesn't apply.
3706
-
3707
- - **Modular** - Import only what you need
3708
-
3709
- ## Design System
3710
-
3711
- Based on Valiify design system from Figma (Commercial-Designs file, key: FdcEV83HPv44bzLPAQU1hR).
3712
-
3713
- **Typography:**
3714
-
3715
- - Inter (UI text)
3716
- - JetBrains Mono (data/code)
3717
-
3718
- **Color System:**
3719
-
3720
- - OKLch color notation for perceptually uniform colors
3721
- - Status ramps: Approved, Critical, Warning, Info
3722
- - Surface stack: Frame → Neutral → Card → Paper (back to front)
3723
-
3724
- **Component Categories (planned):**
3725
-
3726
- - Foundation: Button, Input, Checkbox, Radio, Switch, Badge
3727
- - Data Display: Card, Cell, Data Row, Avatar, Tag
3728
- - Navigation: Tabs, Dropdown, Modal, Icon Button
3729
- - Review-Specific: Field Verification, Section Marker, Secure, Rule, Event
3730
-
3731
- ## Links
3732
-
3733
- - **Repository**: TBD
3734
- - **NPM Package**: [@valiify/dashboard-ui](https://www.npmjs.com/package/@valiify/dashboard-ui)
3735
- - **Figma**: Commercial-Designs (fileKey: FdcEV83HPv44bzLPAQU1hR)
3736
- - **Storybook**: TBD (will be deployed)
3737
-
3738
- ## License
3739
-
3740
- MIT © Valiify