@valiify/dashboard-ui 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/LICENSE +21 -0
- package/README.md +373 -0
- package/dist/index.css +3743 -0
- package/package.json +82 -0
- package/src/base/index.css +21 -0
- package/src/components/ICON-SYSTEM.md +425 -0
- package/src/components/_template.css +109 -0
- package/src/components/alert.css +156 -0
- package/src/components/avatar.css +87 -0
- package/src/components/breadcrumbs.css +158 -0
- package/src/components/button.css +177 -0
- package/src/components/card.css +63 -0
- package/src/components/checkbox.css +181 -0
- package/src/components/chip.css +234 -0
- package/src/components/data-row.css +142 -0
- package/src/components/divider.css +143 -0
- package/src/components/dropdown-field.css +185 -0
- package/src/components/dropdown-menu.css +80 -0
- package/src/components/field-verification.css +156 -0
- package/src/components/filter-segment.css +163 -0
- package/src/components/icon-button.css +83 -0
- package/src/components/icon.css +145 -0
- package/src/components/index.css +47 -0
- package/src/components/input.css +180 -0
- package/src/components/link.css +183 -0
- package/src/components/loading-indicator.css +184 -0
- package/src/components/loading-inline.css +75 -0
- package/src/components/menu-item.css +138 -0
- package/src/components/modal.css +203 -0
- package/src/components/navigation-rail.css +558 -0
- package/src/components/pagination-item.css +196 -0
- package/src/components/pagination.css +108 -0
- package/src/components/pill.css +108 -0
- package/src/components/progress-bar.css +157 -0
- package/src/components/radio-select.css +97 -0
- package/src/components/section-marker.css +96 -0
- package/src/components/segment-selector.css +78 -0
- package/src/components/sensitive-data.css +77 -0
- package/src/components/skeleton.css +184 -0
- package/src/components/step.css +106 -0
- package/src/components/stepper.css +93 -0
- package/src/components/switch.css +99 -0
- package/src/components/tabs.css +213 -0
- package/src/components/tag.css +133 -0
- package/src/components/text-button.css +170 -0
- package/src/components/textarea.css +156 -0
- package/src/components/toast.css +182 -0
- package/src/components/tooltip.css +70 -0
- package/src/fonts.css +23 -0
- package/src/icons/README.md +297 -0
- package/src/icons/custom/help.svg +3 -0
- package/src/icons/custom/valiify-logo.svg +6 -0
- package/src/icons/icon-list.txt +2036 -0
- package/src/icons/sprite.svg +12223 -0
- package/src/index.css +35 -0
- package/src/library.css +34 -0
- package/src/themes/valiify.css +319 -0
- package/src/utilities/index.css +35 -0
- package/types/components.d.ts +630 -0
- package/types/index.d.ts +15 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox Component
|
|
3
|
+
*
|
|
4
|
+
* A native checkbox with a label, and optional mono subtitle and trailing
|
|
5
|
+
* action. Extracted from Figma Checkbox (108:607) — 4 variants across
|
|
6
|
+
* `Active` x `Hover` x `Disabled`, plus `label`, `subtitle`, `icon` and `ring`
|
|
7
|
+
* booleans.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <label class="checkbox">
|
|
11
|
+
* <span class="checkbox-control">
|
|
12
|
+
* <input type="checkbox" class="checkbox-input" />
|
|
13
|
+
* <svg class="checkbox-check icon icon-size-10" aria-hidden="true">
|
|
14
|
+
* <use href="#check" />
|
|
15
|
+
* </svg>
|
|
16
|
+
* </span>
|
|
17
|
+
* <span class="checkbox-label">Content</span>
|
|
18
|
+
* </label>
|
|
19
|
+
*
|
|
20
|
+
* THE CONTROL IS A REAL `<input type="checkbox">`, and the label is a real
|
|
21
|
+
* `<label>` wrapping it. That is not incidental: form-control accessible names
|
|
22
|
+
* are the most repeated defect in the accessibility audit — 20 nodes across
|
|
23
|
+
* Input, Switch and Textarea — and the cause in every case was the library
|
|
24
|
+
* using `<div class="…-label">`, which is styling with no programmatic
|
|
25
|
+
* association. A wrapping `<label>` names this control for free. If the visible
|
|
26
|
+
* text must live outside the label, associate it with `for` / `id` instead;
|
|
27
|
+
* do not drop to a `<div>`.
|
|
28
|
+
*
|
|
29
|
+
* Everything is driven by native state — `:checked`, `:disabled`,
|
|
30
|
+
* `:focus-visible`, `:hover` — so there is no `checked` or `disabled` class to
|
|
31
|
+
* fall out of sync with the input, and the control works with a form, with the
|
|
32
|
+
* keyboard, and with a screen reader without any JavaScript.
|
|
33
|
+
*
|
|
34
|
+
* THE CHECKMARK IS THE SPRITE GLYPH, WHICH IS WHY THERE IS A WRAPPER. Figma
|
|
35
|
+
* draws Lucide `check` at 10px in `Content/Contrast`. A pseudo-element cannot
|
|
36
|
+
* render `<use href="#check">`, and a CSS-drawn tick would not be the same mark,
|
|
37
|
+
* so `.checkbox-control` exists purely to give the input and the glyph a shared
|
|
38
|
+
* 15px positioning context. RadioSelect needs no such wrapper because its inner
|
|
39
|
+
* mark is a plain circle it can draw with `::before`.
|
|
40
|
+
*
|
|
41
|
+
* WHAT FIGMA DRAWS, PER STATE:
|
|
42
|
+
*
|
|
43
|
+
* unchecked 1px `Stroke/Divider`, no fill
|
|
44
|
+
* unchecked hover 1px `Neutral/Main`, `Action/Hover` fill
|
|
45
|
+
* unchecked disabled 1px `Stroke/Disabled`, no fill
|
|
46
|
+
* checked 1px `Primary/Main`, `Primary/Main` fill, 10px check
|
|
47
|
+
* checked hover 1px `Primary/Dark`, `Primary/Dark` fill, 10px check
|
|
48
|
+
*
|
|
49
|
+
* THE LABEL GOES *LIGHTER* WHEN CHECKED, and that is not a transcription error.
|
|
50
|
+
* Unchecked it is `Content/Primary`; checked it is `Content/Tertiary` — the same
|
|
51
|
+
* colour as disabled. So a ticked row reads dimmer than an unticked one, and
|
|
52
|
+
* identical to one you cannot interact with. Reproduced faithfully and pinned in
|
|
53
|
+
* the spec; on the designer list, because a checked box reading as disabled is
|
|
54
|
+
* the opposite of the usual convention.
|
|
55
|
+
*
|
|
56
|
+
* FOUR THINGS FIGMA DOES NOT MODEL. None is invented here:
|
|
57
|
+
*
|
|
58
|
+
* - NO INDETERMINATE STATE. The axis is `Active`, a boolean — this is a
|
|
59
|
+
* two-state checkbox. There is no third variant and no mixed mark. A
|
|
60
|
+
* "select all" header checkbox has nothing to render, so `:indeterminate`
|
|
61
|
+
* is deliberately unstyled: setting `input.indeterminate = true` currently
|
|
62
|
+
* shows the unchecked box. Needs a designer decision before it can ship.
|
|
63
|
+
* - NO FOCUS STATE. `:focus-visible` uses the library-wide `focus-ring`
|
|
64
|
+
* convention, as RadioSelect does.
|
|
65
|
+
* - NO ERROR / INVALID STATE.
|
|
66
|
+
* - NO checked+disabled variant. With nothing drawn for checked+disabled, a
|
|
67
|
+
* disabled ticked box keeps its full `Primary/Main` fill and reads as
|
|
68
|
+
* enabled. RadioSelect invented a treatment for exactly this gap
|
|
69
|
+
* (`:disabled:checked::before` drops to `Stroke/Divider`); this file does
|
|
70
|
+
* NOT, so the two components answer the same question differently. Flagged
|
|
71
|
+
* rather than guessed.
|
|
72
|
+
*
|
|
73
|
+
* Two things worth recording because the last three components trained the eye
|
|
74
|
+
* for them, and both come out clean here: the Figma description is ACCURATE
|
|
75
|
+
* ("Checkbox input with optional label, subtitle, and icon…"), the first in four
|
|
76
|
+
* components; and `Radius/XS` is genuinely used as the box radius rather than
|
|
77
|
+
* being a phantom binding. The checked box's `Spacing/1` padding also fits its
|
|
78
|
+
* own glyph (15 - 2 >= 10), unlike Sensitive Data's and Data Row's.
|
|
79
|
+
*
|
|
80
|
+
* The 108px frame width is not reproduced — the label is `flex-1`, so that is
|
|
81
|
+
* the sample string's width, not a spec.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
@layer components {
|
|
85
|
+
.checkbox {
|
|
86
|
+
@apply inline-flex items-center gap-2.25; /* 9px — Spacing/9 */
|
|
87
|
+
@apply cursor-pointer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* --- Control -------------------------------------------------------- */
|
|
91
|
+
|
|
92
|
+
/* Shared 15px positioning context for the input and its checkmark. */
|
|
93
|
+
.checkbox-control {
|
|
94
|
+
@apply relative inline-flex size-[15px] shrink-0 items-center justify-center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.checkbox-input {
|
|
98
|
+
/* Reset, then draw the box ourselves. */
|
|
99
|
+
@apply absolute inset-0 m-0 appearance-none p-0;
|
|
100
|
+
@apply cursor-pointer;
|
|
101
|
+
|
|
102
|
+
/* Shape — Radius/XS, 1px Stroke/Line. */
|
|
103
|
+
@apply rounded-tight;
|
|
104
|
+
@apply border border-[length:var(--border-line)];
|
|
105
|
+
|
|
106
|
+
/* Rest */
|
|
107
|
+
@apply border-stroke-divider;
|
|
108
|
+
|
|
109
|
+
@apply transition-colors duration-150;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Lucide `check`, 10px, Content/Contrast — hidden until checked. */
|
|
113
|
+
.checkbox-check {
|
|
114
|
+
@apply pointer-events-none relative;
|
|
115
|
+
@apply text-content-contrast opacity-0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* --- States --------------------------------------------------------- */
|
|
119
|
+
|
|
120
|
+
.checkbox-input:hover:not(:disabled) {
|
|
121
|
+
@apply border-neutral bg-action-hover;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.checkbox-input:checked {
|
|
125
|
+
@apply border-primary bg-primary;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.checkbox-input:checked:hover:not(:disabled) {
|
|
129
|
+
@apply border-primary-dark bg-primary-dark;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.checkbox-input:checked ~ .checkbox-check {
|
|
133
|
+
@apply opacity-100;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Figma models no focus state; this is the library-wide convention, applied
|
|
137
|
+
to the real focusable element rather than a wrapper. */
|
|
138
|
+
.checkbox-input:focus-visible {
|
|
139
|
+
@apply focus-ring;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Token swap, never opacity — fading the box would take the whole control
|
|
143
|
+
out of contrast compliance. See icon-button.css and _template.css. */
|
|
144
|
+
.checkbox-input:disabled {
|
|
145
|
+
@apply cursor-not-allowed;
|
|
146
|
+
@apply border-stroke-disabled;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.checkbox:has(.checkbox-input:disabled) {
|
|
150
|
+
@apply cursor-not-allowed;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* --- Label and slots ------------------------------------------------- */
|
|
154
|
+
|
|
155
|
+
.checkbox-label {
|
|
156
|
+
@apply min-w-0 flex-1;
|
|
157
|
+
@apply text-caption text-content-primary; /* 12px / 18px / 400 */
|
|
158
|
+
@apply select-none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Checked and disabled share a colour — see the header; the checked case is
|
|
162
|
+
the surprising one. */
|
|
163
|
+
.checkbox:has(.checkbox-input:checked) .checkbox-label,
|
|
164
|
+
.checkbox:has(.checkbox-input:disabled) .checkbox-label {
|
|
165
|
+
@apply text-content-tertiary;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Figma's subtitle boolean — Data/Data xs needs font-mono, since --text-*
|
|
169
|
+
carries no family. */
|
|
170
|
+
.checkbox-subtitle {
|
|
171
|
+
@apply shrink-0 select-none;
|
|
172
|
+
@apply text-data-xs font-mono; /* 12px / 16.5px / 400, JetBrains Mono */
|
|
173
|
+
@apply text-content-tertiary;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Figma's Ring boolean, hidden by default. Square, like Section Marker's —
|
|
177
|
+
this row has no radius of its own. */
|
|
178
|
+
.checkbox.with-ring {
|
|
179
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chip Component — Figma "Status" (79:275)
|
|
3
|
+
*
|
|
4
|
+
* Status indicator available as chip, dot, or badge to communicate semantic
|
|
5
|
+
* states. 54 variants across Type x Color x BG x Size, plus a Ring boolean.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <!-- Chip with optional dot -->
|
|
9
|
+
* <span class="chip chip-warning">
|
|
10
|
+
* <span class="chip-dot"></span>
|
|
11
|
+
* <span>Warning</span>
|
|
12
|
+
* </span>
|
|
13
|
+
*
|
|
14
|
+
* <!-- Badge (circular number) -->
|
|
15
|
+
* <span class="badge badge-critical">3</span>
|
|
16
|
+
*
|
|
17
|
+
* <!-- Dot (indicator only) -->
|
|
18
|
+
* <span class="dot dot-success"></span>
|
|
19
|
+
*
|
|
20
|
+
* <!-- BG=no: the same colour, unfilled -->
|
|
21
|
+
* <span class="chip chip-warning chip-bg-no">
|
|
22
|
+
* <span class="chip-dot"></span>
|
|
23
|
+
* <span>Warning</span>
|
|
24
|
+
* </span>
|
|
25
|
+
* <span class="badge badge-critical badge-bg-no">3</span>
|
|
26
|
+
*
|
|
27
|
+
* THE BG AXIS. Figma ships every colour both filled (`BG=yes`) and unfilled
|
|
28
|
+
* (`BG=no`). Only the fill changes — the text and dot keep the same colour
|
|
29
|
+
* token either way, and there is NO hairline or border in the unfilled form.
|
|
30
|
+
* Verified by sampling the Figma render: a warning chip is #faf4eb filled
|
|
31
|
+
* (Warning/Soft over white, exact) and #ffffff unfilled.
|
|
32
|
+
*
|
|
33
|
+
* `BG=yes` IS THE DEFAULT, so it needs no class and the pre-existing markup is
|
|
34
|
+
* unchanged. Read from the variant set rather than assumed: the three
|
|
35
|
+
* lowest-id variants (79:272, 79:273, 79:274 — one per Type) are all `BG=yes`,
|
|
36
|
+
* and the BG=yes group occupies the left half of the set frame with BG=no
|
|
37
|
+
* starting at x=515. The naming mirrors the `-bg-*` convention already used by
|
|
38
|
+
* Input, Textarea and DropdownField, where the default value takes no class and
|
|
39
|
+
* the other value is named after its Figma value.
|
|
40
|
+
*
|
|
41
|
+
* BG IS A NO-OP FOR `dot`, so no `.dot-bg-no` exists. Figma draws all 18 dot
|
|
42
|
+
* variants, but a dot IS its fill: sampling `BG=yes` and `BG=no` returns
|
|
43
|
+
* byte-identical pixels (#c9881f both). Nine of those variants are therefore
|
|
44
|
+
* redundant. On the designer list.
|
|
45
|
+
*
|
|
46
|
+
* `primary` EXISTS ONLY AT BG=no in Figma — there is no filled primary — which
|
|
47
|
+
* is why `.chip-primary` and `.badge-primary` are already transparent. Adding
|
|
48
|
+
* `.chip-bg-no` to a primary chip is harmless but redundant.
|
|
49
|
+
*
|
|
50
|
+
* CASING IS THE CALLER'S — CONFIRMED 2026-08-26. Figma renders the labels
|
|
51
|
+
* UPPERCASE (REVIEW, FLAGGED), and for a long time nothing distinguished a
|
|
52
|
+
* `text-transform` on the component from the casing of the sample strings. The
|
|
53
|
+
* designer has since bound a text style to the label — `Micro Text/Micro S -
|
|
54
|
+
* Bold` — and it applies NO text-case: the rendered variant emits `REVIEW` with
|
|
55
|
+
* no `uppercase`. So the caps are typed into the sample strings, and leaving
|
|
56
|
+
* casing alone was right. A label passed as "Review" stays "Review".
|
|
57
|
+
*
|
|
58
|
+
* There is still deliberately no `text-transform: none` assertion, because
|
|
59
|
+
* nothing sets one to guard against. Contrast Pill, where the same question was
|
|
60
|
+
* answered differently and the spec does pin it. Divider reached the same
|
|
61
|
+
* behaviour from the other direction, by dropping the `type-label-*` form.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
@layer components {
|
|
65
|
+
/* --- Chip (text with optional dot) --------------------------------- */
|
|
66
|
+
|
|
67
|
+
.chip {
|
|
68
|
+
/* Layout */
|
|
69
|
+
@apply inline-flex items-center gap-1;
|
|
70
|
+
@apply px-2.25 py-1.25; /* 9px x 5px from Figma */
|
|
71
|
+
@apply h-5; /* 20px — pinned, not derived from the 8px Auto line box */
|
|
72
|
+
|
|
73
|
+
/* Shape */
|
|
74
|
+
@apply rounded-pill; /* 9999px */
|
|
75
|
+
|
|
76
|
+
/* Type */
|
|
77
|
+
@apply text-micro-s-bold; /* 8px/600/normal/0.4% */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Chip dot indicator (optional child element) */
|
|
81
|
+
.chip-dot {
|
|
82
|
+
@apply size-[5px] rounded-pill;
|
|
83
|
+
@apply bg-current; /* Inherits text color from parent chip variant */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* --- Chip Variants -------------------------------------------------- */
|
|
87
|
+
|
|
88
|
+
.chip-warning {
|
|
89
|
+
@apply bg-warning-soft text-warning;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.chip-critical {
|
|
93
|
+
@apply bg-critical-soft text-critical;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.chip-success {
|
|
97
|
+
@apply bg-approved-soft text-approved;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.chip-neutral {
|
|
101
|
+
@apply bg-neutral-soft text-neutral-strong;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.chip-primary {
|
|
105
|
+
@apply bg-transparent text-primary;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* --- Badge (circular number indicator) ------------------------------ */
|
|
109
|
+
|
|
110
|
+
.badge {
|
|
111
|
+
/* Layout */
|
|
112
|
+
@apply inline-flex items-center justify-center;
|
|
113
|
+
@apply size-[15px] p-1; /* 15px x 15px, 4px padding */
|
|
114
|
+
|
|
115
|
+
/* Shape */
|
|
116
|
+
@apply rounded-pill; /* 9999px */
|
|
117
|
+
|
|
118
|
+
/* Type */
|
|
119
|
+
@apply text-data-micro-s font-mono; /* 8px/500/normal, JetBrains Mono */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* --- Badge Variants ------------------------------------------------- */
|
|
123
|
+
|
|
124
|
+
.badge-warning {
|
|
125
|
+
@apply bg-warning-soft text-warning;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.badge-critical {
|
|
129
|
+
@apply bg-critical-soft text-critical;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.badge-success {
|
|
133
|
+
@apply bg-approved-soft text-approved;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.badge-neutral {
|
|
137
|
+
@apply bg-neutral-soft text-neutral-strong;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.badge-primary {
|
|
141
|
+
@apply bg-transparent text-primary;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* --- Dot (indicator only) ------------------------------------------- */
|
|
145
|
+
|
|
146
|
+
.dot {
|
|
147
|
+
@apply inline-block size-[5px] rounded-pill;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* --- Dot Variants --------------------------------------------------- */
|
|
151
|
+
|
|
152
|
+
.dot-warning {
|
|
153
|
+
@apply bg-warning;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.dot-critical {
|
|
157
|
+
@apply bg-critical;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dot-success {
|
|
161
|
+
@apply bg-approved;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.dot-neutral {
|
|
165
|
+
@apply bg-neutral-strong;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.dot-primary {
|
|
169
|
+
@apply bg-primary;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* --- Sizes ----------------------------------------------------------- */
|
|
173
|
+
/* Figma's Size property, added 2026-08-22. SM is the pre-existing default,
|
|
174
|
+
so bare .chip / .badge / .dot stay SM and nothing breaks.
|
|
175
|
+
What MD actually changes is narrower than you would guess:
|
|
176
|
+
chip — gap 4->6 and type 8px->11px. Padding is IDENTICAL (9 / 5), and
|
|
177
|
+
the inner .chip-dot stays 5px at both sizes.
|
|
178
|
+
badge — box 15 -> 19px, padding 4 -> 6px, type 8px -> 11px.
|
|
179
|
+
dot — size only, 5px -> 7px. */
|
|
180
|
+
|
|
181
|
+
.chip-sm {
|
|
182
|
+
@apply h-5 gap-1; /* 20px, 4px gap */
|
|
183
|
+
@apply text-micro-s-bold; /* 8px / 600 / 0.4% */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.chip-md {
|
|
187
|
+
@apply h-[23px] gap-1.5; /* 23px, 6px gap */
|
|
188
|
+
@apply text-micro-l-bold; /* 11px / 500, Inter Medium */
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.badge-sm {
|
|
192
|
+
@apply text-data-micro-s font-mono; /* 8px / 500, JetBrains Mono */
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.badge-md {
|
|
196
|
+
@apply size-[19px] p-1.5; /* 19px box, 6px padding */
|
|
197
|
+
@apply text-data-micro-l font-mono; /* 11px / 500, JetBrains Mono */
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.dot-sm {
|
|
201
|
+
@apply size-[5px];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.dot-md {
|
|
205
|
+
@apply size-[7px];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* --- BG (Figma's BG axis) -------------------------------------------- */
|
|
209
|
+
|
|
210
|
+
/* BG=yes is the default and lives on the colour variants above. This is the
|
|
211
|
+
opt-out: it removes the fill and nothing else — same text colour, same dot
|
|
212
|
+
colour, and deliberately NO border, which the Figma render confirms.
|
|
213
|
+
|
|
214
|
+
Written as a compound selector so it beats `.chip-warning` on specificity
|
|
215
|
+
rather than on source order, matching how `.chip.with-ring` is written
|
|
216
|
+
below. `dot` is absent on purpose — see the header. */
|
|
217
|
+
.chip.chip-bg-no,
|
|
218
|
+
.badge.badge-bg-no {
|
|
219
|
+
@apply bg-transparent;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* --- States (with-ring variant) ------------------------------------- */
|
|
223
|
+
|
|
224
|
+
/* Figma's Ring layer is `inset: 0` with a 2px Primary/Main border — drawn
|
|
225
|
+
INSIDE the component's own bounds, at zero offset, in primary regardless
|
|
226
|
+
of the status colour. An earlier version used the variant's own colour and
|
|
227
|
+
pushed the ring 2px outward; both were wrong.
|
|
228
|
+
Ring is orthogonal to the BG property — it combines with either. */
|
|
229
|
+
.chip.with-ring,
|
|
230
|
+
.badge.with-ring,
|
|
231
|
+
.dot.with-ring {
|
|
232
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataRow Component
|
|
3
|
+
*
|
|
4
|
+
* One labelled field in a review panel: the field name, its value, and its
|
|
5
|
+
* verification status, with actions that appear on hover. Extracted from Figma
|
|
6
|
+
* Data Row (165:678) — 4 variants across `Hover` x `Icon`, plus `comment`,
|
|
7
|
+
* `help` and `ring` booleans and `dataField` / `data` text properties.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <div class="data-row">
|
|
11
|
+
* <span class="data-row-field">First Name</span>
|
|
12
|
+
* <span class="data-row-value">John</span>
|
|
13
|
+
* <span class="field-verification field-verification-verified data-row-status">
|
|
14
|
+
* <span class="section-marker section-marker-approve">
|
|
15
|
+
* <svg class="icon icon-size-14" aria-hidden="true"><use href="#check" /></svg>
|
|
16
|
+
* </span>
|
|
17
|
+
* <span class="field-verification-label">Matches Plaid KYC</span>
|
|
18
|
+
* </span>
|
|
19
|
+
* <button class="icon-button icon-button-md data-row-action" aria-label="Field help">
|
|
20
|
+
* <svg class="icon icon-size-14" aria-hidden="true"><use href="#circle-question-mark" /></svg>
|
|
21
|
+
* </button>
|
|
22
|
+
* </div>
|
|
23
|
+
*
|
|
24
|
+
* THIS COMPONENT IS MOSTLY COMPOSITION. Figma builds it from three components we
|
|
25
|
+
* already ship, and so does this file — nothing is rebuilt:
|
|
26
|
+
*
|
|
27
|
+
* Verification status -> `.field-verification field-verification-verified`
|
|
28
|
+
* (7px gap, 16px Section Marker, 14px #check in
|
|
29
|
+
* Approved/Main, Caption label — an exact match)
|
|
30
|
+
* Value, when Icon=yes -> `.sensitive-data` (a literal instance of 296:5303)
|
|
31
|
+
* Trailing actions -> `.icon-button icon-button-md`
|
|
32
|
+
*
|
|
33
|
+
* Only four classes are new, and three of them carry nothing but the row's own
|
|
34
|
+
* column geometry.
|
|
35
|
+
*
|
|
36
|
+
* `.data-row-status` IS AN ADDITIVE CLASS, NOT A WRAPPER. Figma stretches its
|
|
37
|
+
* Field Verification instance to `flex-1`, which `.field-verification` does not
|
|
38
|
+
* do on its own (it is `inline-flex`). Rather than a descendant selector reaching
|
|
39
|
+
* into another component — the mistake DropdownField's avatar sizing made and
|
|
40
|
+
* had retired — this ships as a modifier you add alongside, the same shape as
|
|
41
|
+
* `.segment-selector-fill`.
|
|
42
|
+
*
|
|
43
|
+
* THE SENSITIVE DATA TYPE OVERRIDE IS REAL, AND IS DATA ROW'S, NOT THE CALLER'S.
|
|
44
|
+
* Standalone, Sensitive Data's value is `Body Content/Caption` (12 / 18). Inside
|
|
45
|
+
* a Data Row Figma overrides it to `Body Content/Body 2` (12.5 / 12.5) so it
|
|
46
|
+
* lines up with the field label beside it. That is a fixed fact of this
|
|
47
|
+
* composition rather than a per-instance choice, so it is scoped here — and it
|
|
48
|
+
* has to be, because a utility at the call site would not exist for consumers on
|
|
49
|
+
* the prebuilt entry.
|
|
50
|
+
*
|
|
51
|
+
* ACTIONS ARE REVEALED BY HOVER **AND FOCUS**. Figma draws the rest-state action
|
|
52
|
+
* at `opacity: 0`, laid out but invisible. Reproduced — except that a button
|
|
53
|
+
* which is invisible and still focusable is a keyboard trap in all but name, so
|
|
54
|
+
* `:focus-within` reveals it too. That is a superset of what Figma draws: the
|
|
55
|
+
* hover appearance is identical, and a keyboard user can now see what they have
|
|
56
|
+
* tabbed to. Every action needs an `aria-label`; they have no visible text.
|
|
57
|
+
*
|
|
58
|
+
* NO FOCUS, DISABLED OR SELECTED STATE IS MODELLED for the row. The axis is
|
|
59
|
+
* `Hover` alone. The row itself is not interactive — only its actions are, and
|
|
60
|
+
* those bring Icon Button's own hover, active, disabled and `:focus-visible`.
|
|
61
|
+
*
|
|
62
|
+
* THREE FIGMA ARTEFACTS ARE NOTED, NOT COPIED:
|
|
63
|
+
*
|
|
64
|
+
* - The description says "optional leading icon". The `Icon` axis does not add
|
|
65
|
+
* a leading icon; it swaps the value cell for a Sensitive Data with a
|
|
66
|
+
* TRAILING eye toggle. Inaccurate rather than pasted from elsewhere.
|
|
67
|
+
* - `Neutral/Main` (#9999a6) is bound in the variant set but appears nowhere
|
|
68
|
+
* in the rendered structure — the same phantom binding as `Radius/XS` on
|
|
69
|
+
* Sensitive Data and FilterSegment.
|
|
70
|
+
* - The 12.5px vertical padding cannot contain the row's own contents: 38 -
|
|
71
|
+
* (12.5 * 2) leaves 13px for an 18px Icon Button. Both are reproduced because
|
|
72
|
+
* `items-center` makes the overflow symmetrical and the rendered height is
|
|
73
|
+
* what matters, but the vertical padding is effectively vestigial. Third
|
|
74
|
+
* component in a row with this shape.
|
|
75
|
+
*
|
|
76
|
+
* The 932px frame width is NOT reproduced — it is the artboard's content width,
|
|
77
|
+
* with the slack absorbed by the `flex-1` status column, the same call as
|
|
78
|
+
* Alert's 828 and Pagination's 1208. A data row spans its table.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
@layer components {
|
|
82
|
+
.data-row {
|
|
83
|
+
/* Layout — 16px (Spacing/16) between columns. */
|
|
84
|
+
@apply flex w-full items-center gap-4;
|
|
85
|
+
@apply h-[38px] px-1 py-[12.5px]; /* 4px / 12.5px — see the header */
|
|
86
|
+
|
|
87
|
+
/* Shape */
|
|
88
|
+
@apply rounded-tight; /* 4px — Radius/XS */
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Figma's Hover axis. The only state the row itself has. */
|
|
92
|
+
.data-row:hover {
|
|
93
|
+
@apply bg-action-subtle;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* --- Columns --------------------------------------------------------- */
|
|
97
|
+
|
|
98
|
+
/* Body 2, truncating — Figma fixes the label column and clips overflow. */
|
|
99
|
+
.data-row-field {
|
|
100
|
+
@apply w-[200px] shrink-0 truncate;
|
|
101
|
+
@apply text-body-2 text-content-tertiary;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.data-row-value {
|
|
105
|
+
@apply w-[400px] shrink-0;
|
|
106
|
+
@apply text-body-2 text-content-primary;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Data Row overrides Sensitive Data's Caption to Body 2 so the masked value
|
|
110
|
+
sits on the same baseline as the field label. See the header. */
|
|
111
|
+
.data-row-value .sensitive-data-value {
|
|
112
|
+
@apply text-body-2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Additive, for the Field Verification slot — Figma stretches it. */
|
|
116
|
+
.data-row-status {
|
|
117
|
+
@apply flex-1;
|
|
118
|
+
min-width: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* --- Actions --------------------------------------------------------- */
|
|
122
|
+
|
|
123
|
+
/* Laid out but invisible at rest, exactly as Figma draws it. Revealed by
|
|
124
|
+
hover AND focus, so a keyboard user can see the control they reached. */
|
|
125
|
+
.data-row-action {
|
|
126
|
+
@apply shrink-0 opacity-0;
|
|
127
|
+
@apply transition-opacity duration-150;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.data-row:hover .data-row-action,
|
|
131
|
+
.data-row:focus-within .data-row-action {
|
|
132
|
+
@apply opacity-100;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* --- States ---------------------------------------------------------- */
|
|
136
|
+
|
|
137
|
+
/* Figma's Ring boolean, hidden by default — 2px Primary/Main, and the only
|
|
138
|
+
ring in the library that follows a radius, since the row has one. */
|
|
139
|
+
.data-row.with-ring {
|
|
140
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
141
|
+
}
|
|
142
|
+
}
|