@valiify/dashboard-ui 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/LICENSE +21 -0
  3. package/README.md +373 -0
  4. package/dist/index.css +3743 -0
  5. package/package.json +82 -0
  6. package/src/base/index.css +21 -0
  7. package/src/components/ICON-SYSTEM.md +425 -0
  8. package/src/components/_template.css +109 -0
  9. package/src/components/alert.css +156 -0
  10. package/src/components/avatar.css +87 -0
  11. package/src/components/breadcrumbs.css +158 -0
  12. package/src/components/button.css +177 -0
  13. package/src/components/card.css +63 -0
  14. package/src/components/checkbox.css +181 -0
  15. package/src/components/chip.css +234 -0
  16. package/src/components/data-row.css +142 -0
  17. package/src/components/divider.css +143 -0
  18. package/src/components/dropdown-field.css +185 -0
  19. package/src/components/dropdown-menu.css +80 -0
  20. package/src/components/field-verification.css +156 -0
  21. package/src/components/filter-segment.css +163 -0
  22. package/src/components/icon-button.css +83 -0
  23. package/src/components/icon.css +145 -0
  24. package/src/components/index.css +47 -0
  25. package/src/components/input.css +180 -0
  26. package/src/components/link.css +183 -0
  27. package/src/components/loading-indicator.css +184 -0
  28. package/src/components/loading-inline.css +75 -0
  29. package/src/components/menu-item.css +138 -0
  30. package/src/components/modal.css +203 -0
  31. package/src/components/navigation-rail.css +558 -0
  32. package/src/components/pagination-item.css +196 -0
  33. package/src/components/pagination.css +108 -0
  34. package/src/components/pill.css +108 -0
  35. package/src/components/progress-bar.css +157 -0
  36. package/src/components/radio-select.css +97 -0
  37. package/src/components/section-marker.css +96 -0
  38. package/src/components/segment-selector.css +78 -0
  39. package/src/components/sensitive-data.css +77 -0
  40. package/src/components/skeleton.css +184 -0
  41. package/src/components/step.css +106 -0
  42. package/src/components/stepper.css +93 -0
  43. package/src/components/switch.css +99 -0
  44. package/src/components/tabs.css +213 -0
  45. package/src/components/tag.css +133 -0
  46. package/src/components/text-button.css +170 -0
  47. package/src/components/textarea.css +156 -0
  48. package/src/components/toast.css +182 -0
  49. package/src/components/tooltip.css +70 -0
  50. package/src/fonts.css +23 -0
  51. package/src/icons/README.md +297 -0
  52. package/src/icons/custom/help.svg +3 -0
  53. package/src/icons/custom/valiify-logo.svg +6 -0
  54. package/src/icons/icon-list.txt +2036 -0
  55. package/src/icons/sprite.svg +12223 -0
  56. package/src/index.css +35 -0
  57. package/src/library.css +34 -0
  58. package/src/themes/valiify.css +319 -0
  59. package/src/utilities/index.css +35 -0
  60. package/types/components.d.ts +630 -0
  61. package/types/index.d.ts +15 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Switch Component
3
+ *
4
+ * Toggle switch for binary on/off settings with hover, disabled, and focus states.
5
+ * Token-exact implementation from Figma.
6
+ *
7
+ * Specifications:
8
+ * - Track: 32px × 18px, pill-shaped
9
+ * - Knob: 14px diameter circle with shadow
10
+ * - Padding: 2px
11
+ * - States: off (default), on (:checked), hover, disabled, focus
12
+ *
13
+ * Usage:
14
+ * <label class="switch">
15
+ * <input type="checkbox" class="switch-input" />
16
+ * </label>
17
+ */
18
+
19
+ @layer components {
20
+ .switch {
21
+ /* Layout */
22
+ @apply inline-flex items-center;
23
+ @apply relative;
24
+ @apply w-8 h-[18px]; /* 32px × 18px exact */
25
+
26
+ /* Shape */
27
+ @apply rounded-pill;
28
+
29
+ /* Colors - off state default */
30
+ @apply bg-action-focused;
31
+
32
+ /* Interaction */
33
+ @apply cursor-pointer;
34
+ @apply transition-colors duration-150;
35
+
36
+ /* Padding for knob positioning */
37
+ @apply p-0.5; /* 2px */
38
+ }
39
+
40
+ /* The actual checkbox input - visually hidden but accessible */
41
+ .switch-input {
42
+ @apply sr-only;
43
+ }
44
+
45
+ /* Knob - implemented as ::before pseudo-element */
46
+ .switch::before {
47
+ content: "";
48
+ @apply block;
49
+ @apply w-[14px] h-[14px]; /* Exact 14px knob */
50
+ @apply rounded-pill;
51
+ @apply bg-surface-paper;
52
+
53
+ /* Knob shadow from Figma */
54
+ box-shadow: var(--shadow-knob);
55
+
56
+ /* Smooth slide animation */
57
+ @apply transition-transform duration-150;
58
+ transform: translateX(0);
59
+ }
60
+
61
+ /* --- States --------------------------------------------------------- */
62
+
63
+ /* Hover - off state */
64
+ .switch:has(.switch-input:hover:not(:disabled):not(:checked)) {
65
+ @apply bg-content-faint;
66
+ }
67
+
68
+ /* Disabled - off state */
69
+ .switch:has(.switch-input:disabled:not(:checked)) {
70
+ @apply bg-secondary-soft;
71
+ @apply cursor-not-allowed;
72
+ }
73
+
74
+ /* Checked (on) - default */
75
+ .switch:has(.switch-input:checked) {
76
+ @apply bg-primary;
77
+ }
78
+
79
+ /* Checked (on) - hover */
80
+ .switch:has(.switch-input:checked:hover:not(:disabled)) {
81
+ @apply bg-primary-dark;
82
+ }
83
+
84
+ /* Checked (on) - disabled */
85
+ .switch:has(.switch-input:checked:disabled) {
86
+ @apply bg-primary-disabled;
87
+ @apply cursor-not-allowed;
88
+ }
89
+
90
+ /* Knob position when checked - slide to end */
91
+ .switch:has(.switch-input:checked)::before {
92
+ transform: translateX(14px); /* Slide exactly one knob width */
93
+ }
94
+
95
+ /* Focus ring - keyboard navigation */
96
+ .switch:has(.switch-input:focus-visible) {
97
+ @apply focus-ring;
98
+ }
99
+ }
@@ -0,0 +1,213 @@
1
+ /**
2
+ * Tabs Component
3
+ *
4
+ * A tab item, in three styles. Extracted from Figma Tabs (108:653) — 12
5
+ * variants: Type (underline | chip | segment) × Size × Hover × Active.
6
+ * Figma's description: "Tab navigation item available as underline, chip, or
7
+ * segment style. Supports optional subtitle and badge for notification counts."
8
+ *
9
+ * SELECTOR OR NAVIGATOR — the markup differs, the styling does not.
10
+ *
11
+ * Navigator (switches views):
12
+ * <div class="tabs" role="tablist">
13
+ * <button class="tab" role="tab" aria-selected="true" aria-controls="p1">Overview</button>
14
+ * </div>
15
+ * <div id="p1" role="tabpanel">…</div>
16
+ *
17
+ * Selector (picks a value):
18
+ * <div class="tabs" role="radiogroup" aria-label="View">
19
+ * <button class="tab tab-segment" role="radio" aria-checked="true">Overview</button>
20
+ * </div>
21
+ *
22
+ * Both `aria-selected` and `aria-checked` drive the active styling, so the
23
+ * same CSS serves either contract. Pick the one that matches what the control
24
+ * actually does — a tab that swaps a panel is a tablist; one that sets a form
25
+ * value is a radiogroup.
26
+ *
27
+ * CHIP AND SEGMENT ARE ONE CONTROL WITH TWO SKINS. They differ in exactly two
28
+ * declarations — radius (6px vs 2px) and active fill (a grey tint vs white).
29
+ * Height, padding, gap, every text colour, the hover fill and the active
30
+ * border are byte-identical. Modifiers, never two components.
31
+ *
32
+ * Size=sm exists for underline ONLY. Figma draws no small chip or segment.
33
+ *
34
+ * Underline is 32px (lg) / 26px (sm). Figma authors no height on it any more —
35
+ * those fall out of padding plus the line box — but they are pinned here
36
+ * because lg's line box comes from an Auto line height, which is
37
+ * font-dependent. See CLAUDE.md.
38
+ *
39
+ * The badge slot is the existing Chip component — `.badge badge-neutral` maps
40
+ * onto it byte-for-byte. Do not build a new part for it. There is no icon slot
41
+ * and no status dot; Tag has those, Tabs does not.
42
+ */
43
+
44
+ @layer components {
45
+ /* --- Container -------------------------------------------------------- */
46
+
47
+ /* Figma's Navigation set (994:31364) defines a container for each type. The
48
+ three map on as:
49
+ Navigation / Tab -> .tabs (bare row, 8px gap)
50
+ Navigation / chip -> .tabs tabs-chip (bare row, 12px gap + inset padding)
51
+ Navigation / Segment -> .segment-selector (the framed one, its own file)
52
+
53
+ Only Segment has chrome; the other two are bare rows that differ in
54
+ spacing. `.tabs` defaults to the underline row because it is the common
55
+ case; `.tabs-chip` overrides it.
56
+
57
+ Deliberately NOT encoded: Figma's Tab variant frame is a fixed 409×35 with
58
+ 18px horizontal and 3px vertical slack it has no padding to account for,
59
+ and its children stretch to 35px rather than their natural 32. That reads
60
+ as a hand-resized frame, not intent, so the row is derived from gap + item
61
+ height instead. Raised with the designer. */
62
+ .tabs {
63
+ @apply inline-flex items-center gap-2; /* 8px */
64
+ }
65
+
66
+ .tabs-chip {
67
+ @apply gap-3 px-3 py-1.5; /* 12px gap, 12px / 6px inset padding */
68
+ }
69
+
70
+ /* --- Item (defaults to underline, lg) ---------------------------------- */
71
+
72
+ /* Shared chrome only. A tab ALWAYS needs one of the three type classes —
73
+ Type is a required axis in Figma with no default, and giving `.tab` a
74
+ built-in default forced `:not()` chains whose specificity then outranked
75
+ `.tab-sm`. Explicit is cheaper than clever here.
76
+
77
+ Note there is deliberately no `border-none`: it sets `--tw-border-style:
78
+ none`, which the underline's active rule then inherits through
79
+ `border-bottom-style: var(--tw-border-style)`, computing the 2px rule to
80
+ zero. Tailwind's preflight already gives buttons a 0-width border. */
81
+ .tab {
82
+ /* Layout */
83
+ @apply inline-flex shrink-0 items-center justify-center;
84
+
85
+ /* Reset so the class works on button / a / div alike */
86
+ @apply appearance-none bg-transparent no-underline;
87
+
88
+ /* Interaction */
89
+ @apply cursor-pointer transition-colors duration-150;
90
+ }
91
+
92
+ /* --- Parts ------------------------------------------------------------- */
93
+
94
+ /* Optional second line. 8px semibold in primary — note it is NOT the muted
95
+ colour you would expect of a subtitle. */
96
+ .tab-subtitle {
97
+ @apply block;
98
+ @apply text-micro-s-bold text-primary; /* 8px / 600 / 0.4% */
99
+ }
100
+
101
+ /* The badge slot is `.badge badge-neutral` from chip.css — no part here. */
102
+
103
+ /* --- Types ------------------------------------------------------------- */
104
+
105
+ .tab-underline {
106
+ @apply h-8 gap-2 px-1.5 py-2; /* 32px, 8px gap, 6px / 8px */
107
+ @apply rounded-none;
108
+ @apply text-action-l text-secondary; /* 13px / 500 */
109
+ }
110
+
111
+ /* chip and segment share everything but radius and active fill */
112
+ .tab-chip,
113
+ .tab-segment {
114
+ @apply h-[26px] gap-1 px-3; /* 26px, 4px gap, 12px padding-x */
115
+ @apply text-action-s; /* 12px / 14px / 500 — no weight change when active */
116
+ @apply text-content-tertiary;
117
+ }
118
+
119
+ .tab-chip {
120
+ @apply rounded-control; /* 6px */
121
+ }
122
+
123
+ .tab-segment {
124
+ @apply rounded-micro; /* 2px */
125
+ }
126
+
127
+ /* --- Sizes ------------------------------------------------------------- */
128
+
129
+ /* underline only — Figma draws no small chip or segment. Changes height and
130
+ the type ramp; padding and indicator thickness are untouched. */
131
+ /* underline only — Figma draws no small chip or segment. Changes height and
132
+ the type ramp; padding and indicator thickness are untouched.
133
+ Must stay AFTER .tab-underline: both this and its active rule tie on
134
+ specificity with the underline rules, so source order decides. */
135
+ .tab-sm {
136
+ @apply h-[26px] gap-2.5 py-1.5; /* 26px, 10px gap, 6px */
137
+ @apply text-action-s; /* 12px / 14px / 500 */
138
+ }
139
+
140
+ /* --- States ------------------------------------------------------------ */
141
+
142
+ /* Underline hover reaches the ACTIVE colour but keeps rest's weight and gains
143
+ no rule — so hover previews the active state without asserting it.
144
+ This was a no-op until 2026-08-22: hover used to bind `Content/Secondary`,
145
+ which resolves to the same #5b5b68 as rest's `Secondary/Main`. The designer
146
+ rebound it to `Content/Primary`, so the visual spec now asserts hover and
147
+ rest differ, which it previously could not. */
148
+ .tab-underline:hover:not(:disabled):not([aria-disabled="true"]) {
149
+ @apply gap-2.5 text-content-primary; /* 10px — lg widens on hover too */
150
+ }
151
+
152
+ .tab-chip:hover:not(:disabled):not([aria-disabled="true"]),
153
+ .tab-segment:hover:not(:disabled):not([aria-disabled="true"]) {
154
+ @apply bg-action-subtle text-content-secondary;
155
+ }
156
+
157
+ .tab:focus-visible {
158
+ @apply focus-ring;
159
+ }
160
+
161
+ /* Active — `aria-selected` for a tablist, `aria-checked` for a radiogroup. */
162
+ .tab[aria-selected="true"],
163
+ .tab[aria-checked="true"] {
164
+ @apply text-content-primary;
165
+ }
166
+
167
+ /* Underline: a 2px bottom rule, and the label steps up to semibold. */
168
+ .tab-underline[aria-selected="true"],
169
+ .tab-underline[aria-checked="true"] {
170
+ @apply gap-2.5; /* 10px — Figma widens the gap when active */
171
+ @apply border-b border-b-[length:var(--border-micro)] border-primary;
172
+ @apply text-action-l-bold; /* 13px / 600 */
173
+ }
174
+
175
+ .tab-sm[aria-selected="true"],
176
+ .tab-sm[aria-checked="true"] {
177
+ @apply text-action-s-bold; /* 12px / 600 */
178
+ }
179
+
180
+ /* chip and segment: a fill swap plus a hairline. No weight change. */
181
+ .tab-chip[aria-selected="true"],
182
+ .tab-chip[aria-checked="true"],
183
+ .tab-segment[aria-selected="true"],
184
+ .tab-segment[aria-checked="true"] {
185
+ @apply border border-[length:var(--border-thin)] border-stroke-border;
186
+ }
187
+
188
+ .tab-chip[aria-selected="true"],
189
+ .tab-chip[aria-checked="true"] {
190
+ @apply bg-action-selected; /* grey tint */
191
+ }
192
+
193
+ .tab-segment[aria-selected="true"],
194
+ .tab-segment[aria-checked="true"] {
195
+ @apply bg-surface-paper; /* white */
196
+ }
197
+
198
+ /* Not in Figma — house convention, so a disabled tab is not silently
199
+ clickable. */
200
+ .tab:disabled,
201
+ .tab[aria-disabled="true"] {
202
+ @apply cursor-not-allowed opacity-50;
203
+ }
204
+
205
+ /* Ring — Figma boolean, hidden by default.
206
+ Simplified: Figma's inset is state-dependent (0 at rest, `0 0 -2px 0` on
207
+ active underline so the ring wraps the rule, `-0.5px` on active chip and
208
+ segment so it clears the hairline). A uniform inset ring is close enough
209
+ for a rarely-used affordance; flagged rather than silently claimed exact. */
210
+ .tab.with-ring {
211
+ @apply ring-[length:var(--border-micro)] ring-inset ring-primary;
212
+ }
213
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Tag Component
3
+ *
4
+ * Compact label for categorization and filtering — a label that happens to be
5
+ * clickable, as distinct from Pill, which is a toggle. Extracted from Figma
6
+ * Tag (79:251): Hover × Active × Disabled × Size, plus four boolean slots.
7
+ *
8
+ * Usage:
9
+ * <button class="tag" aria-pressed="false">Design</button>
10
+ *
11
+ * <button class="tag tag-md" aria-pressed="false">
12
+ * <span class="avatar avatar-xs">JS</span>
13
+ * Design
14
+ * <span class="tag-count">1</span>
15
+ * <span class="dot dot-warning"></span>
16
+ * </button>
17
+ *
18
+ * THE SLOTS ARE EXISTING COMPONENTS, NOT NEW PARTS. Figma's avatar slot is a
19
+ * literal instance of Avatar `Size=xs` — byte-identical class list — so it uses
20
+ * `.avatar avatar-xs`. The status dot is a 5px `Warning/Main` circle, which is
21
+ * exactly `.dot dot-warning`. Only the count needed a new class, because
22
+ * despite the description calling it a "count badge" it is not a badge at all:
23
+ * plain JetBrains Mono text, no circle, no fill, no border.
24
+ *
25
+ * AVATAR AND COUNT ARE md-ONLY. Figma draws neither on any sm variant. They
26
+ * are not merely hidden at sm — the layers do not exist.
27
+ *
28
+ * TAG vs PILL — both descriptions say "filtering", so:
29
+ * Tag is a label. Transparent with a hairline at rest, so it reads as
30
+ * content. Carries metadata (avatar, count, status). Two sizes, a disabled
31
+ * state, and a solid high-contrast active fill — a hard on/off applied
32
+ * filter. Reach for it to label a record inline in content.
33
+ *
34
+ * Pill is chrome. Always filled, borderless, no slots, optional dropdown
35
+ * chevron, and a soft-tint active — a selected item in a set. Reach for it
36
+ * in a filter or segmented bar.
37
+ *
38
+ * Two Figma oddities reproduced rather than corrected:
39
+ * - md's active state bumps the label to weight 500; sm's stays 400.
40
+ * - gap is LARGER on the smaller size (sm 10px, md 8px).
41
+ * Both look like authoring slips. Flagged with the designer; faithful here.
42
+ *
43
+ * Disabled changes the label colour and nothing else — not the border, not the
44
+ * background, and not the slots. A disabled Tag keeps a fully enabled Avatar.
45
+ */
46
+
47
+ @layer components {
48
+ .tag {
49
+ /* Layout */
50
+ @apply inline-flex shrink-0 items-center gap-2.5; /* 10px at sm */
51
+ @apply px-2.25 py-1; /* 9px / 4px */
52
+ @apply h-[21px];
53
+
54
+ /* Shape */
55
+ @apply rounded-pill;
56
+ @apply border border-[length:var(--border-thin)] border-stroke-divider;
57
+
58
+ /* Reset so the class works on button / a / span alike */
59
+ @apply appearance-none text-left no-underline;
60
+
61
+ /* Colors — rest is transparent, not white. It reads as content. */
62
+ @apply bg-transparent text-content-primary;
63
+
64
+ /* Type — sm */
65
+ @apply text-micro-l; /* 11px / 400 */
66
+
67
+ /* Interaction */
68
+ @apply cursor-pointer transition-colors duration-150;
69
+ }
70
+
71
+ /* --- Parts ------------------------------------------------------------ */
72
+
73
+ /* Not a badge, despite the Figma description — bare mono text. md only. */
74
+ .tag-count {
75
+ @apply shrink-0;
76
+ @apply text-data-xs font-mono; /* 12px / 16.5px / 400, JetBrains Mono */
77
+ @apply text-content-tertiary;
78
+ }
79
+
80
+ /* --- Sizes ------------------------------------------------------------ */
81
+
82
+ .tag-sm {
83
+ @apply h-[21px] gap-2.5; /* 10px gap */
84
+ @apply text-micro-l; /* 11px / 400 */
85
+ }
86
+
87
+ /* 24px is fixed in Figma and wins over its own nominal 4px padding, which
88
+ would compute to 26px. Pinned, as button.css does. */
89
+ .tag-md {
90
+ @apply h-[24px] gap-2; /* 8px gap */
91
+ @apply text-caption; /* 12px / 18px / 400 */
92
+ }
93
+
94
+ /* --- States ----------------------------------------------------------- */
95
+
96
+ .tag:hover:not(:disabled):not([aria-disabled="true"]) {
97
+ @apply bg-action-subtle;
98
+ }
99
+
100
+ .tag:focus-visible {
101
+ @apply focus-ring;
102
+ }
103
+
104
+ /* Active — a solid, full-contrast fill, unlike Pill's soft tint. */
105
+ .tag[aria-pressed="true"],
106
+ .tag[aria-selected="true"] {
107
+ @apply bg-primary text-content-contrast;
108
+ }
109
+
110
+ .tag[aria-pressed="true"] .tag-count,
111
+ .tag[aria-selected="true"] .tag-count {
112
+ @apply text-content-contrast;
113
+ }
114
+
115
+ /* Only md bumps the weight when active. sm has no equivalent step. */
116
+ .tag-md[aria-pressed="true"],
117
+ .tag-md[aria-selected="true"] {
118
+ @apply text-caption-bold; /* 12px / 18px / 500 */
119
+ }
120
+
121
+ /* Disabled dims the label ONLY — border, background and slots are untouched,
122
+ which is what Figma draws. No blanket opacity. */
123
+ .tag:disabled,
124
+ .tag[aria-disabled="true"] {
125
+ @apply cursor-not-allowed text-content-tertiary;
126
+ }
127
+
128
+ /* Ring — Figma boolean, hidden by default. Same treatment as Chip, Avatar
129
+ and Pill. */
130
+ .tag.with-ring {
131
+ @apply ring-[length:var(--border-micro)] ring-inset ring-primary;
132
+ }
133
+ }
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Text Button Component
3
+ *
4
+ * Text-only button for inline or cell-level actions. Extracted from Figma Text
5
+ * Button (679:21601) — 11 variants across Type x Hover x Pressed x Active,
6
+ * plus Icon and Ring booleans.
7
+ *
8
+ * Usage:
9
+ * <button class="text-button text-button-cell">Select all</button>
10
+ *
11
+ * <button class="text-button text-button-primary">
12
+ * <svg class="icon icon-size-12" aria-hidden="true"><use href="#plus" /></svg>
13
+ * Add row
14
+ * </button>
15
+ *
16
+ * THIS IS NOT A .btn VARIANT. Different Figma component, different type scale,
17
+ * different geometry — .btn has fixed 24/28/32px heights, this hugs its text at
18
+ * 15px or 18px. Reach for .btn-empty when you want a real button that happens
19
+ * to look bare; reach for .text-button for an inline affordance inside a table
20
+ * cell or a line of copy.
21
+ *
22
+ * THE THREE TYPES ARE NOT THREE SKINS OF ONE CONTROL — cell is a genuinely
23
+ * different size from the other two:
24
+ *
25
+ * cell 11px Micro L 7px/1px padding pill background on hover
26
+ * text 12px Caption no padding colour-only states
27
+ * Primary 12px Caption no padding colour-only states
28
+ *
29
+ * `text` and `Primary` differ ONLY in colour ramp. `cell` is the odd one out,
30
+ * and it is the Figma default, so the base class carries its geometry.
31
+ *
32
+ * TWO FIGMA ODDITIES REPRODUCED, not corrected:
33
+ * - `text` draws Hover and Pressed identically (both Content/Primary, no
34
+ * background), so pressing a text button gives no feedback. cell and
35
+ * Primary both step to a distinct pressed value.
36
+ * - `Primary` has no Active variant. cell and text both do. Nothing is
37
+ * invented here to fill the gap: aria-pressed on a Primary text button
38
+ * inherits the bold weight only, matching the closest thing Figma draws.
39
+ * Both are flagged with the designer.
40
+ *
41
+ * ACTIVE ALSO CHANGES WEIGHT, from 400 to 500 — `Micro L - Bold` for cell and
42
+ * `Caption - Bold` for text. Careful: both Figma styles say "Bold" and both
43
+ * report Medium / 500. Do not map "-Bold" to 700. Because the type token also
44
+ * carries size and line-height, this cannot be a bare `font-medium`.
45
+ *
46
+ * CELL'S HEIGHT IS PINNED AT 15px, and must be. `Micro L` carries a Figma
47
+ * "Auto" line height, so the line box is font-dependent — Figma resolves it to
48
+ * 13px and Chrome to 14px, which would ship the control a pixel tall. This is
49
+ * the same trap button.css and pill.css already document. `text` and `Primary`
50
+ * need no pin: their 18px line-height is explicit, so the box lands on 18
51
+ * either way.
52
+ *
53
+ * NO DISABLED VARIANT EXISTS in Figma. The rule below is the house convention,
54
+ * so a disabled control is not silently clickable.
55
+ */
56
+
57
+ @layer components {
58
+ .text-button {
59
+ /* Layout — shared by all three types */
60
+ @apply inline-flex shrink-0 items-center justify-center gap-1; /* 4px */
61
+
62
+ /* Shape — the radius only shows on cell, which is the only type with a
63
+ background, but Figma sets it on all three (the Ring uses it too). */
64
+ @apply rounded-pill;
65
+
66
+ /* Reset so the class works on button / a / span alike */
67
+ @apply appearance-none border-none bg-transparent text-left no-underline;
68
+
69
+ /* Default geometry and type: cell, which is Figma's default variant */
70
+ @apply px-1.75 py-0.25; /* 7px / 1px */
71
+ @apply h-[15px]; /* pinned — see the header */
72
+ @apply text-micro-l; /* 11px / 400 / Auto */
73
+ @apply text-content-secondary;
74
+
75
+ /* Interaction */
76
+ @apply cursor-pointer transition-colors duration-150;
77
+ }
78
+
79
+ /* --- Types -------------------------------------------------------------- */
80
+
81
+ /* Explicit form of the default. */
82
+ .text-button-cell {
83
+ @apply px-1.75 py-0.25; /* 7px / 1px */
84
+ @apply h-[15px]; /* pinned — see the header */
85
+ @apply text-micro-l; /* 11px / 400 / Auto */
86
+ @apply text-content-secondary;
87
+ }
88
+
89
+ /* No padding at all — 52x18 in Figma is exactly the 12px/18px line box. */
90
+ .text-button-text {
91
+ @apply h-auto px-0 py-0;
92
+ @apply text-caption; /* 12px / 18px / 400 */
93
+ @apply text-content-secondary;
94
+ }
95
+
96
+ .text-button-primary {
97
+ @apply h-auto px-0 py-0;
98
+ @apply text-caption; /* 12px / 18px / 400 */
99
+ @apply text-primary;
100
+ }
101
+
102
+ /* --- States ------------------------------------------------------------- */
103
+
104
+ /* Shared: hover and press darken the label. Primary overrides both below. */
105
+ .text-button:hover:not(:disabled):not([aria-disabled="true"]) {
106
+ @apply text-content-primary;
107
+ }
108
+
109
+ .text-button:active:not(:disabled):not([aria-disabled="true"]) {
110
+ @apply text-content-primary;
111
+ }
112
+
113
+ /* cell is the only type that grows a background. */
114
+ .text-button-cell:hover:not(:disabled):not([aria-disabled="true"]) {
115
+ @apply bg-action-hover;
116
+ }
117
+
118
+ .text-button-cell:active:not(:disabled):not([aria-disabled="true"]) {
119
+ @apply bg-action-focused;
120
+ }
121
+
122
+ /* Primary rides the Primary ramp instead of the Content ramp. Same
123
+ specificity as the shared rules above, so it must stay after them —
124
+ the ordering is load-bearing, exactly as in button.css. */
125
+ .text-button-primary:hover:not(:disabled):not([aria-disabled="true"]) {
126
+ @apply text-primary-dark;
127
+ }
128
+
129
+ .text-button-primary:active:not(:disabled):not([aria-disabled="true"]) {
130
+ @apply text-primary-pressed;
131
+ }
132
+
133
+ /* Active — the selected/applied state. Weight steps 400 -> 500, and because
134
+ the type token carries size and line-height too, the whole token is
135
+ swapped rather than just the weight. */
136
+ .text-button-cell[aria-pressed="true"],
137
+ .text-button-cell[aria-selected="true"] {
138
+ @apply bg-primary-soft text-primary;
139
+ @apply text-micro-l-bold; /* 11px / 500 / Auto */
140
+ }
141
+
142
+ .text-button-text[aria-pressed="true"],
143
+ .text-button-text[aria-selected="true"] {
144
+ @apply text-primary;
145
+ @apply text-caption-bold; /* 12px / 18px / 500 */
146
+ }
147
+
148
+ /* Figma draws no Active for Primary. It already sits at Primary/Main, so the
149
+ only thing left to express selection with is the weight. Nothing invented. */
150
+ .text-button-primary[aria-pressed="true"],
151
+ .text-button-primary[aria-selected="true"] {
152
+ @apply text-caption-bold; /* 12px / 18px / 500 */
153
+ }
154
+
155
+ .text-button:focus-visible {
156
+ @apply focus-ring;
157
+ }
158
+
159
+ /* Not in Figma — house convention. */
160
+ .text-button:disabled,
161
+ .text-button[aria-disabled="true"] {
162
+ @apply cursor-not-allowed text-content-tertiary;
163
+ }
164
+
165
+ /* Ring — Figma boolean, hidden by default. Same 2px inset Primary/Main
166
+ treatment as Chip, Avatar, Pill and Tag. */
167
+ .text-button.with-ring {
168
+ @apply ring-[length:var(--border-micro)] ring-inset ring-primary;
169
+ }
170
+ }