@valiify/dashboard-ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +933 -10
- package/COMPONENTS.md +185 -79
- package/GETTING_STARTED.md +116 -54
- package/QUICK_REFERENCE.md +48 -30
- package/README.md +107 -85
- package/TROUBLESHOOTING.md +52 -34
- package/class-manifest.json +140 -71
- package/design-methodology/dashboard.md +92 -80
- package/dist/dashboard-ui.css +1525 -1078
- package/dist/index.css +1246 -732
- package/package.json +17 -10
- package/scripts/codemods/0.5.0-chip-sizes.mjs +437 -0
- package/src/build/utilities.css +7 -10
- package/src/components/_template.css +12 -8
- package/src/components/alert.css +35 -8
- package/src/components/avatar.css +42 -30
- package/src/components/breadcrumbs.css +39 -22
- package/src/components/button.css +84 -14
- package/src/components/card.css +2 -2
- package/src/components/checkbox.css +16 -11
- package/src/components/chip.css +155 -79
- package/src/components/composer.css +145 -0
- package/src/components/data-row.css +10 -6
- package/src/components/divider.css +17 -22
- package/src/components/dropdown-field.css +83 -43
- package/src/components/dropdown-menu.css +80 -14
- package/src/components/field-verification.css +21 -5
- package/src/components/filter-segment.css +27 -8
- package/src/components/icon-button.css +49 -10
- package/src/components/index.css +2 -0
- package/src/components/input.css +88 -32
- package/src/components/link.css +27 -16
- package/src/components/loading-inline.css +15 -21
- package/src/components/menu-item.css +149 -49
- package/src/components/modal.css +8 -5
- package/src/components/navigation-rail.css +67 -31
- package/src/components/pagination-item.css +29 -28
- package/src/components/pagination.css +9 -14
- package/src/components/pill.css +16 -10
- package/src/components/progress-bar.css +8 -10
- package/src/components/radio-select.css +9 -2
- package/src/components/recipient-input.css +119 -0
- package/src/components/section-marker.css +5 -5
- package/src/components/segment-selector.css +9 -3
- package/src/components/sensitive-data.css +7 -5
- package/src/components/skeleton.css +18 -6
- package/src/components/step.css +15 -4
- package/src/components/stepper.css +3 -2
- package/src/components/switch.css +7 -0
- package/src/components/tabs.css +108 -28
- package/src/components/tag.css +156 -51
- package/src/components/text-button.css +54 -59
- package/src/components/textarea.css +87 -22
- package/src/components/toast.css +41 -15
- package/src/components/tooltip.css +13 -2
- package/src/fonts.css +2 -1
- package/src/library.css +1 -1
- package/src/reset.css +1 -1
- package/src/themes/valiify-tokens.css +101 -126
- package/src/themes/valiify.css +258 -157
- package/src/utility-surface.css +51 -49
- package/types/components.d.ts +142 -24
- package/CLAUDE.md +0 -3740
- package/examples/README.md +0 -198
- package/examples/basic/index.html +0 -155
- package/examples/daisyui-starter/README.md +0 -58
- package/examples/daisyui-starter/check-no-bleed.mjs +0 -249
- package/examples/daisyui-starter/index.html +0 -72
- package/examples/daisyui-starter/linked.html +0 -74
- package/examples/daisyui-starter/package-lock.json +0 -2221
- package/examples/daisyui-starter/package.json +0 -22
- package/examples/daisyui-starter/postcss.config.js +0 -1
- package/examples/daisyui-starter/src/host.css +0 -14
- package/examples/daisyui-starter/src/only-import.css +0 -4
- package/examples/daisyui-starter/src/styles.css +0 -36
- package/examples/daisyui-starter/tailwind.config.js +0 -13
- package/examples/postcss-starter/README.md +0 -47
- package/examples/postcss-starter/index.html +0 -54
- package/examples/postcss-starter/package.json +0 -19
- package/examples/postcss-starter/postcss.config.js +0 -5
- package/examples/postcss-starter/src/styles.css +0 -17
- package/examples/sveltekit-starter/README.md +0 -32
- package/examples/sveltekit-starter/check-scoped-styles.mjs +0 -103
- package/examples/sveltekit-starter/package-lock.json +0 -1300
- package/examples/sveltekit-starter/package.json +0 -24
- package/examples/sveltekit-starter/src/app.css +0 -17
- package/examples/sveltekit-starter/src/app.html +0 -11
- package/examples/sveltekit-starter/src/lib/GlobalReset.svelte +0 -20
- package/examples/sveltekit-starter/src/lib/ScopedRemedy.svelte +0 -27
- package/examples/sveltekit-starter/src/lib/ScopedReset.svelte +0 -22
- package/examples/sveltekit-starter/src/routes/+layout.svelte +0 -6
- package/examples/sveltekit-starter/src/routes/+page.svelte +0 -10
- package/examples/sveltekit-starter/svelte.config.js +0 -4
- package/examples/sveltekit-starter/vite.config.js +0 -6
- package/examples/vite-starter/README.md +0 -125
- package/examples/vite-starter/index.html +0 -12
- package/examples/vite-starter/package.json +0 -19
- package/examples/vite-starter/src/main.js +0 -188
- package/examples/vite-starter/src/styles.css +0 -22
- package/examples/vite-starter/vite.config.js +0 -6
- package/src/themes/valiify-type-prefixed.css +0 -37
package/src/components/input.css
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Input Component
|
|
2
|
+
* Input Component — Figma Input Field 854:24665 (was Text Input Container)
|
|
3
3
|
*
|
|
4
4
|
* Complete form input system with labels, help text, icons, and error messages.
|
|
5
|
-
*
|
|
6
|
-
* (
|
|
5
|
+
* 160 variants (state x error x filled x size x BG); the Search Field 854:24901
|
|
6
|
+
* (120 variants) is the same row with a fixed leading glyph and a fainter
|
|
7
|
+
* placeholder, shipped here as the `.vd-input-search` modifier.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* HEIGHTS ARE THE CONTROL LADDER. Figma binds Height/Control/XS..XL on the
|
|
10
|
+
* Input Row of every variant (2026-09-24): xs 20 / sm 24 / md 28 / lg 32 /
|
|
11
|
+
* xl 40, applied as `h-control-*`. Vertical padding is 0 — the box is the
|
|
12
|
+
* token and `items-center` centres the text. Before this the ladder was
|
|
13
|
+
* 25 / 29 / 35 (sm / md / lg) with per-size padding-y, which left `.vd-input-lg`
|
|
14
|
+
* 3px taller than `.vd-btn-lg` in the same form row. Horizontal padding is
|
|
15
|
+
* Figma's per size: 6 / 8 / 10 / 12 / 16.
|
|
11
16
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
+
* BASE = md. The bare `.vd-input-field` was lg (35); it now renders md (28),
|
|
18
|
+
* the library-wide convention. Every size has an explicit class.
|
|
19
|
+
*
|
|
20
|
+
* REV3 TYPE (2026-09-30). Entry text is Supporting/Caption (12/18) at xs/sm
|
|
21
|
+
* and Body/Dense (13/18) from md up — the old Micro L / Body 1 pair is gone,
|
|
22
|
+
* and with it the Auto-line-height trap. The field LABEL is Label/Compact
|
|
23
|
+
* (12/16/600, 0.08em tracking) and is MIXED-CASE now — the old 10px
|
|
24
|
+
* uppercase Label S died with the Rev3 scale. Icon slots unchanged (14px at
|
|
25
|
+
* sm–xl, search glyph 12 at xs).
|
|
26
|
+
*
|
|
27
|
+
* PLACEHOLDERS ARE Content/Tertiary FAMILY-WIDE (requester decision
|
|
28
|
+
* 2026-09-30): Figma still draws the Search Field's placeholder Content/Faint,
|
|
29
|
+
* which measures 1.73:1 on Paper — a pinned DIVERGENCE, designer-list item.
|
|
30
|
+
* Disabled fills are Rev3: Action/Subtle on the White BG, Surface/Neutral on
|
|
31
|
+
* the Neutral BG.
|
|
32
|
+
*
|
|
33
|
+
* Heights are pinned with `height`, not `min-height`: Chrome rounds the 0.5px
|
|
34
|
+
* `--border-thin` hairline up to a full 1px and ADDS it to the box, and every
|
|
35
|
+
* bound Figma frame has strokesIncludedInLayout=false, so the token is the
|
|
36
|
+
* border-box height. Same precedent as button.css.
|
|
17
37
|
*
|
|
18
38
|
* Structure:
|
|
19
39
|
* <div class="vd-input-container">
|
|
@@ -24,10 +44,16 @@
|
|
|
24
44
|
*
|
|
25
45
|
* Usage:
|
|
26
46
|
* <div class="vd-input-container">
|
|
27
|
-
* <div class="vd-input-field">
|
|
47
|
+
* <div class="vd-input-field vd-input-lg">
|
|
28
48
|
* <input type="text" class="vd-input" placeholder="Enter text..." />
|
|
29
49
|
* </div>
|
|
30
50
|
* </div>
|
|
51
|
+
*
|
|
52
|
+
* <!-- Search Field: fixed leading glyph, Content/Faint placeholder -->
|
|
53
|
+
* <div class="vd-input-field vd-input-search">
|
|
54
|
+
* <svg class="vd-input-icon-left vd-icon vd-icon-size-14" aria-hidden="true"><use href="#search" /></svg>
|
|
55
|
+
* <input type="search" class="vd-input" placeholder="Search" />
|
|
56
|
+
* </div>
|
|
31
57
|
*/
|
|
32
58
|
|
|
33
59
|
@layer components {
|
|
@@ -41,7 +67,9 @@
|
|
|
41
67
|
|
|
42
68
|
.vd-input-label {
|
|
43
69
|
@apply flex items-center w-full pb-1.5; /* 6px bottom padding */
|
|
44
|
-
|
|
70
|
+
/* Label/Compact — 12/16/600, 0.08em. MIXED CASE since Rev3: the style
|
|
71
|
+
carries no transform and the old uppercase died with Label S. */
|
|
72
|
+
@apply text-label-compact;
|
|
45
73
|
@apply text-content-tertiary;
|
|
46
74
|
}
|
|
47
75
|
|
|
@@ -57,9 +85,8 @@
|
|
|
57
85
|
/* Layout */
|
|
58
86
|
@apply flex items-center gap-2 w-full; /* 8px gap, every size */
|
|
59
87
|
|
|
60
|
-
/* Default size:
|
|
61
|
-
@apply
|
|
62
|
-
@apply h-[35px];
|
|
88
|
+
/* Default size: md — Height/Control/MD, 10px padding-x, no padding-y */
|
|
89
|
+
@apply h-control-md px-2.5;
|
|
63
90
|
|
|
64
91
|
/* Shape */
|
|
65
92
|
@apply rounded-control; /* 6px */
|
|
@@ -85,13 +112,13 @@
|
|
|
85
112
|
@apply appearance-none bg-transparent border-none outline-none;
|
|
86
113
|
@apply p-0 m-0;
|
|
87
114
|
|
|
88
|
-
/* Typography */
|
|
89
|
-
@apply text-body-
|
|
115
|
+
/* Typography — Body/Dense (13/18) */
|
|
116
|
+
@apply text-body-dense;
|
|
90
117
|
@apply text-content-primary;
|
|
91
118
|
|
|
92
|
-
/* Placeholder —
|
|
93
|
-
|
|
94
|
-
|
|
119
|
+
/* Placeholder — Content/Tertiary, and since Rev3 that is the FAMILY-WIDE
|
|
120
|
+
value by decision: Figma draws Search/Dropdown/Textarea placeholders
|
|
121
|
+
Content/Faint (1.73:1 on Paper), diverged to Tertiary. Designer list. */
|
|
95
122
|
&::placeholder {
|
|
96
123
|
@apply text-content-tertiary;
|
|
97
124
|
}
|
|
@@ -106,33 +133,56 @@
|
|
|
106
133
|
}
|
|
107
134
|
|
|
108
135
|
/* --- Size Variants ----------------------------------------------- */
|
|
136
|
+
/* One Height/Control step each; padding-y is 0 everywhere. */
|
|
137
|
+
|
|
138
|
+
.vd-input-xs {
|
|
139
|
+
@apply h-control-xs px-1.5; /* 20px, 6px */
|
|
140
|
+
@apply text-supporting-caption; /* 12 / 18 / 400 */
|
|
141
|
+
}
|
|
109
142
|
|
|
110
143
|
.vd-input-sm {
|
|
111
|
-
@apply px-2
|
|
112
|
-
@apply
|
|
113
|
-
@apply text-micro-l; /* 11px / normal / 400 */
|
|
144
|
+
@apply h-control-sm px-2; /* 24px, 8px */
|
|
145
|
+
@apply text-supporting-caption; /* 12 / 18 / 400 */
|
|
114
146
|
}
|
|
115
147
|
|
|
148
|
+
/* Identical to the bare base — md IS the default. */
|
|
116
149
|
.vd-input-md {
|
|
117
|
-
@apply px-2.5
|
|
118
|
-
@apply
|
|
119
|
-
@apply text-body-1; /* 13px / 19.5px / 400 */
|
|
150
|
+
@apply h-control-md px-2.5; /* 28px, 10px */
|
|
151
|
+
@apply text-body-dense; /* 13 / 18 / 400 */
|
|
120
152
|
}
|
|
121
153
|
|
|
122
154
|
.vd-input-lg {
|
|
123
|
-
@apply px-3
|
|
124
|
-
@apply
|
|
125
|
-
|
|
155
|
+
@apply h-control-lg px-3; /* 32px, 12px — equals .vd-btn-lg */
|
|
156
|
+
@apply text-body-dense;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.vd-input-xl {
|
|
160
|
+
@apply h-control-xl px-4; /* 40px, 16px */
|
|
161
|
+
@apply text-body-dense;
|
|
126
162
|
}
|
|
127
163
|
|
|
128
164
|
/* The input inherits the row's type so the size variants reach it */
|
|
165
|
+
.vd-input-xs .vd-input,
|
|
129
166
|
.vd-input-sm .vd-input,
|
|
130
167
|
.vd-input-md .vd-input,
|
|
131
|
-
.vd-input-lg .vd-input
|
|
168
|
+
.vd-input-lg .vd-input,
|
|
169
|
+
.vd-input-xl .vd-input {
|
|
132
170
|
font-size: inherit;
|
|
133
171
|
line-height: inherit;
|
|
134
172
|
}
|
|
135
173
|
|
|
174
|
+
/* --- Search Field (854:24901) ------------------------------------ */
|
|
175
|
+
/* The same row with a fixed leading search glyph (12px at xs, 14px at
|
|
176
|
+
sm–xl — markup, .vd-input-icon-left). Figma draws its placeholder
|
|
177
|
+
Content/Faint (1.73:1 on Paper); by decision (2026-09-30) it ships
|
|
178
|
+
Content/Tertiary like the rest of the family, so the modifier no longer
|
|
179
|
+
recolours the placeholder — kept for the glyph contract and the class
|
|
180
|
+
vocabulary. Designer-list divergence. */
|
|
181
|
+
|
|
182
|
+
.vd-input-search .vd-input::placeholder {
|
|
183
|
+
@apply text-content-tertiary;
|
|
184
|
+
}
|
|
185
|
+
|
|
136
186
|
/* --- Background Variants ----------------------------------------- */
|
|
137
187
|
|
|
138
188
|
.vd-input-bg-neutral {
|
|
@@ -156,12 +206,18 @@
|
|
|
156
206
|
@apply border-critical;
|
|
157
207
|
}
|
|
158
208
|
|
|
159
|
-
/* Disabled
|
|
209
|
+
/* Disabled — Rev3 fills: Action/Subtle on the White BG, Surface/Neutral on
|
|
210
|
+
the Neutral BG (each one step below its rest fill). */
|
|
160
211
|
.vd-input-field:has(:disabled),
|
|
161
212
|
.vd-input-field.vd-input-disabled {
|
|
162
213
|
@apply bg-action-subtle border-stroke-divider cursor-not-allowed;
|
|
163
214
|
}
|
|
164
215
|
|
|
216
|
+
.vd-input-bg-neutral:has(:disabled),
|
|
217
|
+
.vd-input-bg-neutral.vd-input-disabled {
|
|
218
|
+
@apply bg-surface-neutral;
|
|
219
|
+
}
|
|
220
|
+
|
|
165
221
|
.vd-input:disabled {
|
|
166
222
|
@apply cursor-not-allowed;
|
|
167
223
|
}
|
package/src/components/link.css
CHANGED
|
@@ -30,6 +30,19 @@
|
|
|
30
30
|
* here: "underlined" is a per-style constant everywhere except strong, where it
|
|
31
31
|
* is a state.
|
|
32
32
|
*
|
|
33
|
+
* REV3 (2026-10-01) DRAWS NO UNDERLINES AT ALL — no text decoration and no
|
|
34
|
+
* underline layer, in any style or state (read from every variant's text
|
|
35
|
+
* segments). The library KEEPS the underline behaviour above, as a pinned
|
|
36
|
+
* divergence pending a decision (designer question in the 0.5.0 list),
|
|
37
|
+
* because one half of it is not optional: an inline link without an
|
|
38
|
+
* underline is marked by colour alone, and Primary/Main against the
|
|
39
|
+
* surrounding Content/Primary text is 2.14:1 (1.59 on hover) where WCAG
|
|
40
|
+
* 1.4.1 needs 3:1. Standalone styles could follow the file safely; that is
|
|
41
|
+
* the open question. The Rev3 type moves are shipped: strong and critical
|
|
42
|
+
* Body/Default Strong (14/20/500 — strong drops from SemiBold 600), quiet
|
|
43
|
+
* Body/Default, monospace Data/Dense (Regular, was Medium), inline
|
|
44
|
+
* Body/Default (14, grew from the 12px Caption).
|
|
45
|
+
*
|
|
33
46
|
* style type rest hover pressed
|
|
34
47
|
* strong Inter SemiBold 14 Primary/Main Primary/Dark Primary/Pressed
|
|
35
48
|
* quiet Inter Regular 14 Content/Secondary Primary/Main Primary/Dark
|
|
@@ -49,14 +62,8 @@
|
|
|
49
62
|
* this blind spot has bitten; the colour group still has not been swept
|
|
50
63
|
* end-to-end.
|
|
51
64
|
*
|
|
52
|
-
* THE TYPE IS
|
|
53
|
-
*
|
|
54
|
-
* `--text-caption`). The nearest token to 14px Inter is `--text-subtitle`, but
|
|
55
|
-
* it is Medium/500 with a 19.6px line-height where these are Auto in a 17px
|
|
56
|
-
* box, so two of its three properties would need overriding. Sizes and weights
|
|
57
|
-
* are therefore written directly rather than force-fitted to a token that
|
|
58
|
-
* carries the wrong leading. On the designer list: these five styles deserve
|
|
59
|
-
* real text styles.
|
|
65
|
+
* THE TYPE IS BOUND since Rev3 — before it, the four standalone styles were
|
|
66
|
+
* raw and only `inline` carried a style. The bindings are listed above.
|
|
60
67
|
*
|
|
61
68
|
* The gap differs between the two styles that have one: strong sits in a 4px
|
|
62
69
|
* flex row, critical in a 6px one. Only critical actually draws an icon.
|
|
@@ -67,9 +74,9 @@
|
|
|
67
74
|
/* Layout — strong's container; critical widens the gap below. */
|
|
68
75
|
@apply inline-flex items-center gap-1; /* 4px */
|
|
69
76
|
|
|
70
|
-
/* Type — strong.
|
|
71
|
-
|
|
72
|
-
@apply
|
|
77
|
+
/* Type — strong. Rev3 binds Body/Default Strong: 14 / 20 / 500 (it was a
|
|
78
|
+
raw 14px SemiBold 600 with an Auto line). */
|
|
79
|
+
@apply text-body-default-strong;
|
|
73
80
|
|
|
74
81
|
/* Colors — strong, the only style with no underline at rest */
|
|
75
82
|
@apply text-primary no-underline;
|
|
@@ -81,17 +88,17 @@
|
|
|
81
88
|
|
|
82
89
|
/* Explicit form of the base. */
|
|
83
90
|
.vd-link-strong {
|
|
84
|
-
@apply text-
|
|
91
|
+
@apply text-body-default-strong; /* 14 / 20 / 500 */
|
|
85
92
|
@apply text-primary no-underline;
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
.vd-link-quiet {
|
|
89
|
-
@apply text-
|
|
96
|
+
@apply text-body-default; /* Rev3: 14 / 20 / 400 */
|
|
90
97
|
@apply text-content-secondary underline;
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
.vd-link-monospace {
|
|
94
|
-
@apply
|
|
101
|
+
@apply text-data-dense font-mono; /* Rev3 Data/Dense: 13 / 19.5, JetBrains Mono — Regular, was Medium */
|
|
95
102
|
@apply text-content-primary underline;
|
|
96
103
|
}
|
|
97
104
|
|
|
@@ -99,7 +106,7 @@
|
|
|
99
106
|
gap. The glyph is a slot, as everywhere else in the library. */
|
|
100
107
|
.vd-link-critical {
|
|
101
108
|
@apply gap-1.5; /* 6px */
|
|
102
|
-
@apply text-
|
|
109
|
+
@apply text-body-default-strong; /* Rev3: 14 / 20 / 500 */
|
|
103
110
|
@apply text-critical underline;
|
|
104
111
|
}
|
|
105
112
|
|
|
@@ -160,10 +167,14 @@
|
|
|
160
167
|
Deliberately does NOT take `.vd-link`. This is the one style with a real Figma
|
|
161
168
|
text style behind it. */
|
|
162
169
|
.vd-link-inline {
|
|
163
|
-
@apply text-
|
|
170
|
+
@apply text-body-default; /* Rev3 Body/Default: 14 / 20 / 400 — grew from the 12px Caption */
|
|
164
171
|
@apply text-content-primary;
|
|
165
172
|
}
|
|
166
173
|
|
|
174
|
+
/* The underline STAYS, and must: without it an inline link is marked by
|
|
175
|
+
colour alone, and Primary/Main against the surrounding Content/Primary
|
|
176
|
+
text is 2.14:1 — WCAG 1.4.1 needs 3:1 for that (axe link-in-text-block).
|
|
177
|
+
Rev3's Figma draws no underlines at all; see the header. */
|
|
167
178
|
.vd-link-inline a {
|
|
168
179
|
@apply text-primary underline;
|
|
169
180
|
@apply cursor-pointer transition-colors duration-150;
|
|
@@ -33,43 +33,37 @@
|
|
|
33
33
|
*
|
|
34
34
|
* XS IS THE DEFAULT, matching Figma's first variant.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* and `--text-subtitle` is the nearest 14px but carries 19.6px leading and
|
|
39
|
-
* Medium weight. Sizes are therefore written directly rather than force-fitted,
|
|
40
|
-
* and SM uses the raw pair too so the four read consistently. On the designer
|
|
41
|
-
* list: this component deserves real text styles.
|
|
36
|
+
* ALL FOUR SIZES ARE BOUND since Rev3 (only SM mapped to a token before):
|
|
37
|
+
* XS/SM Supporting/Caption, MD/LG Body/Default.
|
|
42
38
|
*
|
|
43
39
|
* The label colour is `Content/Secondary` at every size, and it is set on the
|
|
44
40
|
* container so the text can be a bare child rather than needing its own class.
|
|
45
41
|
*/
|
|
46
42
|
|
|
47
43
|
@layer components {
|
|
44
|
+
/* Rev3 binds all four sizes (only SM mapped to a token before): XS and SM
|
|
45
|
+
Supporting/Caption (12/18), MD and LG Body/Default (14/20), each in a row
|
|
46
|
+
with 2px padding — 22 / 22 / 24 / 24. XS grows 11 -> 12; LG SHRINKS
|
|
47
|
+
16 -> 14 (it shares MD's style now — only the gap still steps). */
|
|
48
48
|
.vd-loading-inline {
|
|
49
|
-
@apply inline-flex items-center;
|
|
50
|
-
gap
|
|
51
|
-
|
|
52
|
-
/* Label — raw type; see the header. */
|
|
53
|
-
@apply text-[11px] font-normal;
|
|
54
|
-
line-height: 17px;
|
|
49
|
+
@apply inline-flex items-center py-0.5; /* 2px */
|
|
50
|
+
@apply gap-1.5; /* XS 6px */
|
|
51
|
+
@apply text-supporting-caption; /* 12 / 18 / 400 */
|
|
55
52
|
@apply text-content-secondary;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.vd-loading-inline-sm {
|
|
59
|
-
gap
|
|
60
|
-
@apply text-
|
|
61
|
-
line-height: 18px;
|
|
56
|
+
@apply gap-2; /* 8px */
|
|
57
|
+
@apply text-supporting-caption;
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
.vd-loading-inline-md {
|
|
65
|
-
gap
|
|
66
|
-
@apply text-
|
|
67
|
-
line-height: 21px;
|
|
61
|
+
@apply gap-2.5; /* 10px */
|
|
62
|
+
@apply text-body-default; /* 14 / 20 / 400 */
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
.vd-loading-inline-lg {
|
|
71
|
-
gap
|
|
72
|
-
@apply text-
|
|
73
|
-
line-height: 24px;
|
|
66
|
+
@apply gap-3; /* 12px */
|
|
67
|
+
@apply text-body-default; /* 14 / 20 / 400 — was 16/24 */
|
|
74
68
|
}
|
|
75
69
|
}
|
|
@@ -1,36 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Menu Item Component
|
|
2
|
+
* Menu Item Component — Figma Menu Item 1304:35667 (new set; replaces 114:805)
|
|
3
3
|
*
|
|
4
|
-
* Single row within a dropdown menu or navigation list.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Single row within a dropdown menu or navigation list. 24 variants: Size
|
|
5
|
+
* (sm / md / lg) x State (rest / hover / active / disabled) x Tone (default /
|
|
6
|
+
* critical), plus Leading / Trailing / Subtitle / Meta booleans. The slots are
|
|
7
|
+
* the internal sets _Menu Leading 1304:4764 (Icon / Tile / Avatar / Checkbox)
|
|
8
|
+
* and _Menu Trailing 1304:4844 (Right Text / Check / Chevron / Action).
|
|
9
|
+
*
|
|
10
|
+
* THIS IS A FLOOR COMPONENT. Figma binds Height/Control/SM / MD / LG to the
|
|
11
|
+
* row's MIN-height with the frame on Hug: sm 24 / md 28 / lg 32, applied as
|
|
12
|
+
* `min-h-control-*`. A one-line row sits exactly on its floor (there is no
|
|
13
|
+
* border to add); a subtitle grows it. Before this the row was content-driven
|
|
14
|
+
* (25 / 29 / 42 with a right icon) from per-size padding-y alone. Padding is
|
|
15
|
+
* Figma's measured value per size — x 10 / 12 / 12, y 2 / 4 / 6 — and gap is
|
|
16
|
+
* 10 at every size. verify:height-scale rule 3 REQUIRES min-h-control-* here.
|
|
17
|
+
*
|
|
18
|
+
* ICON SLOTS DO NOT SCALE (Figma inconsistency, reproduced): the leading icon
|
|
19
|
+
* is 16px and the trailing icon 14px at every size — `.vd-icon-size-16` and
|
|
20
|
+
* `.vd-icon-size-14` in the markup. The leading Avatar is Avatar xs (16); the
|
|
21
|
+
* Tile is 20 (sm) or 28 (lg); the Checkbox is the 15px Checkbox control; the
|
|
22
|
+
* trailing Action is an Icon Button inline (18).
|
|
7
23
|
*
|
|
8
24
|
* Structure:
|
|
9
|
-
* <button class="vd-menu-item">
|
|
10
|
-
* <
|
|
11
|
-
* <svg class="vd-icon vd-icon-size-15">…</svg> <!-- Optional left icon -->
|
|
25
|
+
* <button class="vd-menu-item vd-menu-item-lg" role="menuitem">
|
|
26
|
+
* <svg class="vd-menu-item-icon vd-icon vd-icon-size-16">…</svg> <!-- Leading: -icon | -tile | -avatar | -checkbox -->
|
|
12
27
|
* <span class="vd-menu-item-text">
|
|
13
|
-
* <span class="vd-menu-item-title">
|
|
14
|
-
* <span class="vd-menu-item-subtitle">
|
|
28
|
+
* <span class="vd-menu-item-title">Nicholas Cooper</span>
|
|
29
|
+
* <span class="vd-menu-item-subtitle">Primary applicant</span> <!-- Subtitle boolean -->
|
|
15
30
|
* </span>
|
|
16
|
-
* <span class="vd-menu-item-
|
|
17
|
-
* <svg class="vd-icon vd-icon-size-
|
|
31
|
+
* <span class="vd-menu-item-meta">2h</span> <!-- Meta boolean -->
|
|
32
|
+
* <svg class="vd-menu-item-check vd-icon vd-icon-size-14">…</svg> <!-- Trailing: -right-text | -check | -chevron | -chevron-left | -shortcut | -action -->
|
|
18
33
|
* </button>
|
|
19
34
|
*
|
|
20
|
-
*
|
|
35
|
+
* TONE — `.vd-menu-item-critical` recolours the title Critical/Main and
|
|
36
|
+
* nothing else; meta and subtitle stay Content/Tertiary.
|
|
21
37
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
38
|
+
* REMOVED IN 0.5.0 (deprecated in 0.4.0): `.vd-menu-item-badge`, now
|
|
39
|
+
* `.vd-menu-item-tile` (identical rule; the codemod renames it), and
|
|
40
|
+
* `.vd-menu-item-combined`, the old emphasised row, which the new set models as
|
|
41
|
+
* a tile plus the subtitle at default tone (the codemod reports it).
|
|
25
42
|
*/
|
|
26
43
|
|
|
27
44
|
@layer components {
|
|
28
|
-
/* --- Base (
|
|
45
|
+
/* --- Base (md — the size Dropdown Menu uses) ------------------------ */
|
|
29
46
|
|
|
30
47
|
.vd-menu-item {
|
|
31
|
-
/* Layout */
|
|
32
|
-
@apply flex w-full items-center gap-2.5; /* 10px gap */
|
|
33
|
-
@apply px-3 py-1
|
|
48
|
+
/* Layout — a FLOOR of Height/Control/MD, 12px / 4px padding */
|
|
49
|
+
@apply flex w-full items-center gap-2.5; /* 10px gap, every size */
|
|
50
|
+
@apply min-h-control-md px-3 py-1;
|
|
34
51
|
|
|
35
52
|
/* Shape */
|
|
36
53
|
@apply rounded-control; /* 6px */
|
|
@@ -39,7 +56,10 @@
|
|
|
39
56
|
@apply appearance-none border-none bg-transparent text-left no-underline;
|
|
40
57
|
|
|
41
58
|
/* Type */
|
|
42
|
-
|
|
59
|
+
/* Body/Dense since Rev3 (was Body 2 12.5). Figma binds the title to a
|
|
60
|
+
RAW #000000 rather than a Content token — shipped as Content/Primary,
|
|
61
|
+
the system ink; the unbound black is on the designer list. */
|
|
62
|
+
@apply text-body-dense text-content-primary; /* 13 / 18 / 400 */
|
|
43
63
|
|
|
44
64
|
/* Interaction */
|
|
45
65
|
@apply cursor-pointer transition-colors duration-150;
|
|
@@ -57,72 +77,143 @@
|
|
|
57
77
|
}
|
|
58
78
|
|
|
59
79
|
.vd-menu-item-subtitle {
|
|
60
|
-
|
|
80
|
+
/* Supporting/Caption 12 since Rev3 (was 11). Figma binds Content/Tertiary,
|
|
81
|
+
which measures 4.19:1 on a hovered row's Action/Hover fill — shipped as
|
|
82
|
+
Content/Secondary (5.92 everywhere) by decision; designer list. */
|
|
83
|
+
@apply w-full text-supporting-caption text-content-secondary;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Meta boolean — a trailing secondary text (a time, a count) */
|
|
87
|
+
.vd-menu-item-meta {
|
|
88
|
+
/* Matches the title's style per size since Rev3 (12 at sm, 13 at md/lg —
|
|
89
|
+
inherits the row's font-size). Content/Secondary for the same contrast
|
|
90
|
+
decision as the subtitle. */
|
|
91
|
+
@apply shrink-0 text-content-secondary;
|
|
92
|
+
font-size: inherit;
|
|
93
|
+
line-height: inherit;
|
|
61
94
|
}
|
|
62
95
|
|
|
63
96
|
.vd-menu-item-right-text {
|
|
64
|
-
@apply shrink-0 text-right text-
|
|
97
|
+
@apply shrink-0 text-right text-supporting-caption-strong text-primary; /* 12 / 18 / 500 */
|
|
65
98
|
}
|
|
66
99
|
|
|
67
|
-
/*
|
|
68
|
-
|
|
100
|
+
/* --- Leading slots (_Menu Leading 1304:4764) ------------------------- */
|
|
101
|
+
|
|
102
|
+
/* 16px glyph at every size — pair with .vd-icon-size-16 */
|
|
103
|
+
.vd-menu-item-icon {
|
|
104
|
+
@apply shrink-0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* 20px tinted icon tile (Kind=Tile, Size=sm); 28 for the lg tile */
|
|
108
|
+
.vd-menu-item-tile {
|
|
69
109
|
@apply flex size-5 shrink-0 items-center justify-center;
|
|
70
110
|
@apply rounded-control bg-primary-soft text-primary;
|
|
71
111
|
}
|
|
72
112
|
|
|
73
|
-
|
|
113
|
+
.vd-menu-item-tile-lg {
|
|
114
|
+
@apply size-7; /* 28px — Kind=Tile, Size=lg */
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Wrappers that mark the slot; the Avatar (xs, 16) and Checkbox (15) are the
|
|
118
|
+
existing components inside them */
|
|
119
|
+
.vd-menu-item-avatar,
|
|
120
|
+
.vd-menu-item-checkbox {
|
|
121
|
+
@apply flex shrink-0 items-center;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* --- Trailing slots (_Menu Trailing 1304:4844) ----------------------- */
|
|
125
|
+
|
|
126
|
+
/* 14px glyphs at every size — pair with .vd-icon-size-14. Check inherits
|
|
127
|
+
the row's colour (primary when selected); chevrons are Content/Secondary. */
|
|
128
|
+
.vd-menu-item-check {
|
|
129
|
+
@apply shrink-0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.vd-menu-item-chevron,
|
|
133
|
+
.vd-menu-item-chevron-left {
|
|
134
|
+
@apply shrink-0 text-content-secondary;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Submenu back affordance — leads the row despite being a Trailing kind */
|
|
138
|
+
.vd-menu-item-chevron-left {
|
|
139
|
+
@apply order-first;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Keyboard shortcut — the Right Text style */
|
|
143
|
+
.vd-menu-item-shortcut {
|
|
144
|
+
@apply shrink-0 text-right text-supporting-caption-strong text-content-tertiary; /* 12 / 18 / 500 */
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Trailing action — an Icon Button inline (18) sits inside. A row carrying
|
|
148
|
+
one must NOT be a <button>: a button inside a button is invalid HTML and
|
|
149
|
+
the browser drops the inner one (the visual harness caught exactly this).
|
|
150
|
+
Use a <div role="menuitem"> or <a>; the Icon Button is the focusable. */
|
|
151
|
+
.vd-menu-item-action {
|
|
152
|
+
@apply flex shrink-0 items-center;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* --- Sizes (min-height floors) --------------------------------------- */
|
|
74
156
|
|
|
75
157
|
.vd-menu-item-sm {
|
|
76
|
-
@apply px-2.5 py-
|
|
77
|
-
@apply text-
|
|
158
|
+
@apply min-h-control-sm px-2.5 py-0.5; /* floor 24, 10px / 2px */
|
|
159
|
+
@apply text-supporting-caption; /* 12 / 18 / 400 (was Micro L 11) */
|
|
78
160
|
}
|
|
79
161
|
|
|
80
|
-
.vd-menu-item-sm .vd-menu-item-right-text
|
|
81
|
-
|
|
162
|
+
.vd-menu-item-sm .vd-menu-item-right-text,
|
|
163
|
+
.vd-menu-item-sm .vd-menu-item-shortcut {
|
|
164
|
+
@apply text-supporting-caption-strong; /* 12 / 18 / 500 (was Micro M 8.5) */
|
|
82
165
|
}
|
|
83
166
|
|
|
167
|
+
/* Identical to the bare base — md IS the default (Figma's own default
|
|
168
|
+
variant is sm since the re-cut; the md base is the library convention —
|
|
169
|
+
divergence noted with the designer). */
|
|
84
170
|
.vd-menu-item-md {
|
|
85
|
-
@apply px-3 py-1
|
|
86
|
-
@apply text-body-
|
|
171
|
+
@apply min-h-control-md px-3 py-1; /* floor 28, 12px / 4px */
|
|
172
|
+
@apply text-body-dense; /* 13 / 18 / 400 */
|
|
87
173
|
}
|
|
88
174
|
|
|
89
|
-
.vd-menu-item-md .vd-menu-item-right-text
|
|
90
|
-
|
|
175
|
+
.vd-menu-item-md .vd-menu-item-right-text,
|
|
176
|
+
.vd-menu-item-md .vd-menu-item-shortcut {
|
|
177
|
+
@apply text-supporting-caption-strong; /* 12 / 18 / 500 */
|
|
91
178
|
}
|
|
92
179
|
|
|
93
180
|
.vd-menu-item-lg {
|
|
94
|
-
@apply px-3 py-
|
|
95
|
-
@apply text-body-
|
|
181
|
+
@apply min-h-control-lg px-3 py-1.5; /* floor 32, 12px / 6px */
|
|
182
|
+
@apply text-body-dense; /* 13 / 18 / 400 */
|
|
96
183
|
}
|
|
97
184
|
|
|
98
|
-
.vd-menu-item-lg .vd-menu-item-right-text
|
|
99
|
-
|
|
185
|
+
.vd-menu-item-lg .vd-menu-item-right-text,
|
|
186
|
+
.vd-menu-item-lg .vd-menu-item-shortcut {
|
|
187
|
+
@apply text-body-dense-strong; /* 13 / 18 / 500 (was Body 2 - Bold) */
|
|
100
188
|
}
|
|
101
189
|
|
|
102
|
-
/* ---
|
|
103
|
-
/* Emphasised row: medium-weight primary title over a tertiary subtitle.
|
|
104
|
-
Primary is set on the row so the trailing check inherits it too, the way
|
|
105
|
-
Figma's Combined variant renders. The subtitle keeps its own colour. */
|
|
190
|
+
/* --- Tone ------------------------------------------------------------ */
|
|
106
191
|
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.vd-menu-item-combined .vd-menu-item-title {
|
|
112
|
-
@apply text-body-1-bold; /* 13px / 19.5px / 500 */
|
|
192
|
+
/* Critical recolours the title only. */
|
|
193
|
+
.vd-menu-item-critical .vd-menu-item-title {
|
|
194
|
+
@apply text-critical;
|
|
113
195
|
}
|
|
114
196
|
|
|
115
197
|
/* --- States ---------------------------------------------------------- */
|
|
116
198
|
|
|
199
|
+
/* Hover AND Figma's active state are the same Action/Hover fill in the
|
|
200
|
+
re-cut — no distinct pressed fill is drawn. The critical tone tints
|
|
201
|
+
Critical/Soft instead. */
|
|
117
202
|
.vd-menu-item:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
118
203
|
@apply bg-action-hover;
|
|
119
204
|
}
|
|
120
205
|
|
|
206
|
+
.vd-menu-item-critical:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
207
|
+
@apply bg-critical-soft;
|
|
208
|
+
}
|
|
209
|
+
|
|
121
210
|
.vd-menu-item:focus-visible {
|
|
122
211
|
@apply focus-ring;
|
|
123
212
|
}
|
|
124
213
|
|
|
125
|
-
/* Selected — aria-selected for
|
|
214
|
+
/* Selected — aria-selected for role="option" rows in a listbox; aria-checked
|
|
215
|
+
for role="menuitemcheckbox" / "menuitemradio" toggles in a menu. Plain
|
|
216
|
+
role="menuitem" supports NEITHER attribute (0.5.0 markup correction).
|
|
126
217
|
Set on the row so the title AND any icons (which use currentColor) turn
|
|
127
218
|
primary together, the way the Figma check mark renders. The subtitle and
|
|
128
219
|
right text keep their own explicit colors. */
|
|
@@ -131,8 +222,17 @@
|
|
|
131
222
|
@apply text-primary;
|
|
132
223
|
}
|
|
133
224
|
|
|
225
|
+
/* Figma's Rev3 disabled variants draw NO dimming at all (the title stays
|
|
226
|
+
full ink) — on the designer list. The house convention keeps a visible
|
|
227
|
+
disabled treatment: label to Content/Tertiary, no blanket opacity (the
|
|
228
|
+
rule Chip/Tag/Button follow; the old opacity-50 washed the slots too). */
|
|
134
229
|
.vd-menu-item:disabled,
|
|
135
230
|
.vd-menu-item[aria-disabled="true"] {
|
|
136
|
-
@apply cursor-not-allowed
|
|
231
|
+
@apply cursor-not-allowed text-content-tertiary;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.vd-menu-item:disabled .vd-menu-item-title,
|
|
235
|
+
.vd-menu-item[aria-disabled="true"] .vd-menu-item-title {
|
|
236
|
+
@apply text-content-tertiary;
|
|
137
237
|
}
|
|
138
238
|
}
|