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