@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,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter Segment Component
|
|
3
|
+
*
|
|
4
|
+
* Individual segment within a segmented filter control. Extracted from Figma
|
|
5
|
+
* Filter Segment (678:21020) — 18 variants across Position x Hover x Selected
|
|
6
|
+
* x Size, plus Text, Icon and Ring booleans.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <div class="filter-segments">
|
|
10
|
+
* <button class="filter-segment filter-segment-first">Product</button>
|
|
11
|
+
* <button class="filter-segment">Is any of</button>
|
|
12
|
+
* <button class="filter-segment">Deposit Account</button>
|
|
13
|
+
* <span class="filter-segment filter-segment-last">
|
|
14
|
+
* <button class="icon-button icon-button-md" aria-label="Remove filter">
|
|
15
|
+
* <svg class="icon icon-size-14" aria-hidden="true"><use href="#x" /></svg>
|
|
16
|
+
* </button>
|
|
17
|
+
* </span>
|
|
18
|
+
* </div>
|
|
19
|
+
*
|
|
20
|
+
* SEGMENTS SHARE THEIR EDGES, which is the whole point of the position axis.
|
|
21
|
+
* Each segment draws top, right and bottom only, so the right border of one is
|
|
22
|
+
* the divider to the next and no pair ever doubles up. `first` adds the left
|
|
23
|
+
* border — the group's left edge — and `last` needs nothing extra because the
|
|
24
|
+
* group's right edge is its own right border.
|
|
25
|
+
*
|
|
26
|
+
* middle (base) t / r / b no radius
|
|
27
|
+
* first t / r / b / l rounded left
|
|
28
|
+
* last t / r / b rounded right
|
|
29
|
+
*
|
|
30
|
+
* MIDDLE IS THE BASE because it is Figma's default variant (678:21019, the
|
|
31
|
+
* set's top-left). A lone segment therefore renders square and open on the
|
|
32
|
+
* left, which is correct for the model but rarely what you want — mark the ends
|
|
33
|
+
* explicitly.
|
|
34
|
+
*
|
|
35
|
+
* POSITION IS THREE BOOLEANS IN FIGMA, not one enum: `First`, `Middle` and
|
|
36
|
+
* `Last` are separate yes/no properties and exactly one is ever `yes`. That is
|
|
37
|
+
* an authoring choice rather than a meaningful distinction, so it collapses to
|
|
38
|
+
* two modifier classes here. On the designer list.
|
|
39
|
+
*
|
|
40
|
+
* HEIGHTS ARE PINNED at 21 / 28px. Figma fixes both, and the 0.5px hairlines
|
|
41
|
+
* would otherwise add 2px apiece under border-box — the trap button.css and
|
|
42
|
+
* pill.css already document. Note the two sizes share their padding, gap and
|
|
43
|
+
* type entirely: md is purely a taller box, so its extra height is slack rather
|
|
44
|
+
* than anything derived.
|
|
45
|
+
*
|
|
46
|
+
* HOVER AND SELECTED REPLACE THE FILL rather than tinting it. Rest is the
|
|
47
|
+
* opaque `Surface/Card`; both other states drop to a translucent Action token,
|
|
48
|
+
* so what shows through is the page, not the card. Figma draws no
|
|
49
|
+
* hover-and-selected combination.
|
|
50
|
+
*
|
|
51
|
+
* EVERY SEGMENT IS A CONTROL, including the one carrying the remove icon. Use a
|
|
52
|
+
* `<button>` (or `<a>`) for each so the whole group is keyboard-reachable and
|
|
53
|
+
* each segment can take its own action — a filter row where only some segments
|
|
54
|
+
* tab is worse than one where none do. An earlier revision described the icon
|
|
55
|
+
* segment as "a container rather than a control" and its usage snippet used a
|
|
56
|
+
* `<div>`, which silently dropped the first and third segments out of the tab
|
|
57
|
+
* order; only the middle segment and the icon button were reachable.
|
|
58
|
+
*
|
|
59
|
+
* THE ICON SLOT IS AN ICON BUTTON INSTANCE — 18px box, 14px glyph — so it is
|
|
60
|
+
* `.icon-button icon-button-md`, not a new part. Note that nesting it inside a
|
|
61
|
+
* `<button>` segment is invalid HTML, so that one segment stays a non-button
|
|
62
|
+
* element wrapping the icon button, which is itself focusable. Whether the icon
|
|
63
|
+
* should take over the segment's own action is deliberately left open.
|
|
64
|
+
*
|
|
65
|
+
* NOT ENCODED — the Figma example (1018:33960) expresses "label vs value"
|
|
66
|
+
* through instance overrides on the text, not through the component's states:
|
|
67
|
+
* its operator reads `Content/Secondary` while its values read `Content/Primary`
|
|
68
|
+
* and the chosen one steps to `Micro L - Bold`. All three keep the REST
|
|
69
|
+
* background. That is a usage pattern, so it lives in the story rather than in
|
|
70
|
+
* a class.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
@layer components {
|
|
74
|
+
.filter-segment {
|
|
75
|
+
/* Layout */
|
|
76
|
+
@apply inline-flex shrink-0 items-center justify-center gap-2.5; /* 10px */
|
|
77
|
+
@apply px-2 py-1; /* 8px / 4px */
|
|
78
|
+
@apply h-[21px]; /* sm — pinned, see the header */
|
|
79
|
+
|
|
80
|
+
/* Borders. Side-specific widths need the side-specific length utility, or
|
|
81
|
+
`border-[length:…]` silently sets all four — see CLAUDE.md. Left is
|
|
82
|
+
omitted so neighbours share an edge. */
|
|
83
|
+
@apply border-t border-t-[length:var(--border-thin)] border-t-stroke-divider;
|
|
84
|
+
@apply border-r border-r-[length:var(--border-thin)] border-r-stroke-divider;
|
|
85
|
+
@apply border-b border-b-[length:var(--border-thin)] border-b-stroke-divider;
|
|
86
|
+
|
|
87
|
+
/* Reset so the class works on button / div / a alike */
|
|
88
|
+
@apply appearance-none text-left no-underline;
|
|
89
|
+
|
|
90
|
+
/* Colors — rest */
|
|
91
|
+
@apply bg-surface-card text-content-secondary;
|
|
92
|
+
|
|
93
|
+
/* Type */
|
|
94
|
+
@apply text-micro-l; /* 11px / 400 / Auto */
|
|
95
|
+
|
|
96
|
+
/* Interaction */
|
|
97
|
+
@apply cursor-pointer transition-colors duration-150;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* --- Position ----------------------------------------------------------- */
|
|
101
|
+
|
|
102
|
+
/* The group's left edge — the only segment that draws a left border. */
|
|
103
|
+
.filter-segment-first {
|
|
104
|
+
@apply border-l border-l-[length:var(--border-thin)] border-l-stroke-divider;
|
|
105
|
+
@apply rounded-l-control; /* 6px */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Its own right border already closes the group. */
|
|
109
|
+
.filter-segment-last {
|
|
110
|
+
@apply rounded-r-control; /* 6px */
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* --- Size --------------------------------------------------------------- */
|
|
114
|
+
|
|
115
|
+
/* Padding, gap and type are identical to sm — md is only a taller box. */
|
|
116
|
+
.filter-segment-md {
|
|
117
|
+
@apply h-[28px];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* --- States ------------------------------------------------------------- */
|
|
121
|
+
|
|
122
|
+
/* Both states swap the opaque card fill for a translucent Action token, so
|
|
123
|
+
the page shows through rather than the card. Selected is excluded from
|
|
124
|
+
hover by name rather than by source order. */
|
|
125
|
+
.filter-segment:not([aria-pressed="true"]):not(
|
|
126
|
+
[aria-selected="true"]
|
|
127
|
+
):hover:not(:disabled):not([aria-disabled="true"]) {
|
|
128
|
+
@apply bg-action-hover text-content-primary;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.filter-segment[aria-pressed="true"],
|
|
132
|
+
.filter-segment[aria-selected="true"] {
|
|
133
|
+
@apply bg-action-selected text-content-primary;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.filter-segment:focus-visible {
|
|
137
|
+
@apply focus-ring;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Not in Figma — house convention, so a disabled segment is not silently
|
|
141
|
+
clickable. Tokens rather than a blanket opacity, per the IconButton fix. */
|
|
142
|
+
.filter-segment:disabled,
|
|
143
|
+
.filter-segment[aria-disabled="true"] {
|
|
144
|
+
@apply cursor-not-allowed text-content-faint;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Figma boolean, hidden by default. Its inset is asymmetric there (-0.5px on
|
|
148
|
+
three sides, 0 on the left) to sit over the borders each position actually
|
|
149
|
+
draws; a plain inset ring is within half a pixel and cannot overflow the
|
|
150
|
+
layout, the same normalisation Avatar documents. */
|
|
151
|
+
.filter-segment.with-ring {
|
|
152
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* --- Group -------------------------------------------------------------- */
|
|
156
|
+
|
|
157
|
+
/* Figma's example composition is exactly this and nothing more: a bare row
|
|
158
|
+
with no gap, no padding and no fill of its own. The segments' shared edges
|
|
159
|
+
do all the work. */
|
|
160
|
+
.filter-segments {
|
|
161
|
+
@apply inline-flex items-center;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Button Component
|
|
3
|
+
*
|
|
4
|
+
* Compact button displaying only an icon. Use for toolbar actions, close buttons,
|
|
5
|
+
* and secondary actions where space is limited. Extracted from Figma (78:210).
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <button class="icon-button icon-button-xs" aria-label="Close">
|
|
9
|
+
* <svg class="icon icon-size-12" aria-hidden="true">
|
|
10
|
+
* <use href="#x" />
|
|
11
|
+
* </svg>
|
|
12
|
+
* </button>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@layer components {
|
|
16
|
+
.icon-button {
|
|
17
|
+
/* Layout */
|
|
18
|
+
@apply inline-flex items-center justify-center;
|
|
19
|
+
|
|
20
|
+
/* Shape */
|
|
21
|
+
@apply rounded-control; /* 6px */
|
|
22
|
+
|
|
23
|
+
/* Background - transparent by default */
|
|
24
|
+
@apply bg-transparent;
|
|
25
|
+
|
|
26
|
+
/* Icon colour — icons inherit currentColor */
|
|
27
|
+
@apply text-secondary; /* Secondary/Main */
|
|
28
|
+
|
|
29
|
+
/* No border */
|
|
30
|
+
@apply border-none;
|
|
31
|
+
|
|
32
|
+
/* Interaction */
|
|
33
|
+
@apply cursor-pointer;
|
|
34
|
+
@apply transition-colors duration-150;
|
|
35
|
+
|
|
36
|
+
/* Default size: Large (28×28px with 6px padding) */
|
|
37
|
+
@apply size-7 p-1.5; /* 28px, 6px padding */
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* --- Size Variants -------------------------------------------------- */
|
|
41
|
+
|
|
42
|
+
.icon-button-xs {
|
|
43
|
+
@apply size-3 p-0; /* 12×12px, no padding (icon fills button) */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-button-md {
|
|
47
|
+
@apply size-[18px] p-0.5; /* 18×18px, 2px padding */
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-button-lg {
|
|
51
|
+
@apply size-7 p-1.5; /* 28×28px, 6px padding (same as default) */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* --- States --------------------------------------------------------- */
|
|
55
|
+
|
|
56
|
+
.icon-button:hover:not(:disabled) {
|
|
57
|
+
@apply bg-action-hover text-secondary-strong;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon-button:active:not(:disabled) {
|
|
61
|
+
@apply bg-action-focused text-secondary-strong;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* The shared tab-through affordance. Deliberately on the base rather than a
|
|
65
|
+
size modifier, so every size gets it — and because Icon Button is the
|
|
66
|
+
dismiss control in Alert, Modal and Toast, those three inherit it too.
|
|
67
|
+
Figma models no focus state for this component; `focus-ring` is the
|
|
68
|
+
library-wide convention, not an invention for this file. */
|
|
69
|
+
.icon-button:focus-visible {
|
|
70
|
+
@apply focus-ring;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Figma dims the glyph with its own token rather than fading the whole
|
|
74
|
+
button — an earlier version used opacity-50, which is not the design. */
|
|
75
|
+
.icon-button:disabled {
|
|
76
|
+
@apply cursor-not-allowed text-secondary-disabled;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Optional ring state (for selected/active state) */
|
|
80
|
+
.icon-button.icon-ring {
|
|
81
|
+
@apply ring-2 ring-primary;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Component
|
|
3
|
+
*
|
|
4
|
+
* Standardized icon sizing and styling for the Valiify Dashboard UI.
|
|
5
|
+
* Works with SVG sprite system (src/icons/sprite.svg).
|
|
6
|
+
*
|
|
7
|
+
* Usage with SVG sprite:
|
|
8
|
+
* <svg class="icon icon-size-20" aria-hidden="true">
|
|
9
|
+
* <use href="#search" />
|
|
10
|
+
* </svg>
|
|
11
|
+
*
|
|
12
|
+
* With ring state (selected/active):
|
|
13
|
+
* <svg class="icon icon-size-20 icon-ring" aria-label="Active">
|
|
14
|
+
* <use href="#check" />
|
|
15
|
+
* </svg>
|
|
16
|
+
*
|
|
17
|
+
* In buttons/components:
|
|
18
|
+
* <button class="btn btn-primary">
|
|
19
|
+
* <svg class="icon icon-size-20" aria-hidden="true">
|
|
20
|
+
* <use href="#save" />
|
|
21
|
+
* </svg>
|
|
22
|
+
* Save
|
|
23
|
+
* </button>
|
|
24
|
+
*
|
|
25
|
+
* STROKE WEIGHT SCALES WITH SIZE, AND NOT PROPORTIONALLY. Extracted from Figma
|
|
26
|
+
* Icon Container (69:6944) on 2026-08-25 by reading the exported SVG of all 11
|
|
27
|
+
* size variants — each exports at its own viewBox with a hand-set stroke-width,
|
|
28
|
+
* so the RENDERED width is the declared number in device px:
|
|
29
|
+
*
|
|
30
|
+
* 10, 11 -> 0.75px 15, 16, 18 -> 1.25px
|
|
31
|
+
* 12, 13 -> 1.00px 20, 22 -> 1.50px
|
|
32
|
+
* 24 -> 2.00px
|
|
33
|
+
*
|
|
34
|
+
* The sprite is a single 24-unit viewBox, so `stroke-width` here is in USER
|
|
35
|
+
* UNITS, not pixels: a value of 2 renders `2 * size / 24` px. Each size class
|
|
36
|
+
* therefore sets `--icon-stroke = target * 24 / size`, which is why the numbers
|
|
37
|
+
* below look arbitrary and are NOT monotonic — 18px needs a *smaller* user-unit
|
|
38
|
+
* value (1.667) than 16px (1.875) to draw the same 1.25px, because its box is
|
|
39
|
+
* bigger. Do not "tidy" them into a sequence.
|
|
40
|
+
*
|
|
41
|
+
* This replaced a flat `stroke-width: 2`, which rendered a strictly linear
|
|
42
|
+
* `size/12` ramp: exact at 12, 15 and 24 but up to 22% too thick elsewhere
|
|
43
|
+
* (1.83px against Figma's 1.50 at 22px). Note the direction — an earlier audit
|
|
44
|
+
* claimed our strokes were "roughly half" Figma's, on the grounds that Figma
|
|
45
|
+
* exports `stroke-width="2"` at every size. Both are false: only the 24px
|
|
46
|
+
* variant declares 2, the 12px variant declares nothing at all (SVG default 1),
|
|
47
|
+
* and our strokes were too THICK, never thin.
|
|
48
|
+
*
|
|
49
|
+
* 14px IS RESOLVED. Figma declares 1.1px there, which the designer confirmed was
|
|
50
|
+
* an authoring mistake, and has since specified 1.25px — so 14 joins the 15 / 16
|
|
51
|
+
* / 18 plateau rather than extending the 1.0 run at 12 / 13. Its user-unit value
|
|
52
|
+
* (2.142857) is the largest in the ramp, which is correct: 14px is the smallest
|
|
53
|
+
* box that has to reach 1.25px.
|
|
54
|
+
*
|
|
55
|
+
* `--icon-stroke` is a custom property so a consumer sizing an icon with raw
|
|
56
|
+
* utilities (`w-5 h-5`) instead of `.icon-size-20` can set the matching weight.
|
|
57
|
+
*
|
|
58
|
+
* ONE SYMBOL IS EXEMPT: `custom-help` is the sprite's only non-24 viewBox
|
|
59
|
+
* (22x22) and its only symbol carrying a `stroke-width` presentation attribute.
|
|
60
|
+
* An element's own presentation attribute beats an inherited CSS value, so the
|
|
61
|
+
* ramp does not reach it.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
@layer components {
|
|
65
|
+
.icon {
|
|
66
|
+
/* Layout */
|
|
67
|
+
@apply inline-flex items-center justify-center;
|
|
68
|
+
@apply shrink-0; /* Prevent flex containers from squashing icons */
|
|
69
|
+
|
|
70
|
+
/* Default to 16px size if no size class is specified */
|
|
71
|
+
@apply w-4 h-4;
|
|
72
|
+
|
|
73
|
+
/* SVG styling - uses currentColor to inherit text color */
|
|
74
|
+
/* 1.875 user units over a 24 viewBox = 1.25px at the 16px default box,
|
|
75
|
+
which is Figma's size-16 stroke. See the header. */
|
|
76
|
+
--icon-stroke: 1.875;
|
|
77
|
+
stroke-width: var(--icon-stroke);
|
|
78
|
+
fill: none;
|
|
79
|
+
stroke: currentColor;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* --- Size Variants -------------------------------------------------- */
|
|
83
|
+
|
|
84
|
+
.icon-size-10 {
|
|
85
|
+
@apply w-[10px] h-[10px];
|
|
86
|
+
--icon-stroke: 1.8; /* 0.75px */
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.icon-size-11 {
|
|
90
|
+
@apply w-[11px] h-[11px];
|
|
91
|
+
--icon-stroke: 1.636364; /* 0.75px */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.icon-size-12 {
|
|
95
|
+
@apply w-3 h-3; /* 12px */
|
|
96
|
+
--icon-stroke: 2; /* 1px */
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.icon-size-13 {
|
|
100
|
+
@apply w-[13px] h-[13px];
|
|
101
|
+
--icon-stroke: 1.846154; /* 1px */
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.icon-size-14 {
|
|
105
|
+
@apply w-3.5 h-3.5; /* 14px */
|
|
106
|
+
--icon-stroke: 2.142857; /* 1.25px */
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.icon-size-15 {
|
|
110
|
+
@apply w-[15px] h-[15px];
|
|
111
|
+
--icon-stroke: 2; /* 1.25px */
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.icon-size-16 {
|
|
115
|
+
@apply w-4 h-4; /* 16px */
|
|
116
|
+
--icon-stroke: 1.875; /* 1.25px */
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.icon-size-18 {
|
|
120
|
+
@apply w-[18px] h-[18px];
|
|
121
|
+
--icon-stroke: 1.666667; /* 1.25px */
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.icon-size-20 {
|
|
125
|
+
@apply w-5 h-5; /* 20px */
|
|
126
|
+
--icon-stroke: 1.8; /* 1.5px */
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.icon-size-22 {
|
|
130
|
+
@apply w-5.5 h-5.5; /* 22px */
|
|
131
|
+
--icon-stroke: 1.636364; /* 1.5px */
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.icon-size-24 {
|
|
135
|
+
@apply w-6 h-6; /* 24px */
|
|
136
|
+
--icon-stroke: 2; /* 2px */
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* --- States --------------------------------------------------------- */
|
|
140
|
+
|
|
141
|
+
.icon-ring {
|
|
142
|
+
@apply rounded-full;
|
|
143
|
+
@apply border border-[length:var(--border-micro)] border-primary;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Index
|
|
3
|
+
*
|
|
4
|
+
* Imports all component stylesheets.
|
|
5
|
+
* Components are loaded in alphabetical order for consistency.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
@import "./alert.css";
|
|
9
|
+
@import "./avatar.css";
|
|
10
|
+
@import "./breadcrumbs.css";
|
|
11
|
+
@import "./button.css";
|
|
12
|
+
@import "./card.css";
|
|
13
|
+
@import "./checkbox.css";
|
|
14
|
+
@import "./chip.css";
|
|
15
|
+
@import "./data-row.css";
|
|
16
|
+
@import "./divider.css";
|
|
17
|
+
@import "./dropdown-field.css";
|
|
18
|
+
@import "./dropdown-menu.css";
|
|
19
|
+
@import "./field-verification.css";
|
|
20
|
+
@import "./filter-segment.css";
|
|
21
|
+
@import "./icon.css";
|
|
22
|
+
@import "./icon-button.css";
|
|
23
|
+
@import "./input.css";
|
|
24
|
+
@import "./link.css";
|
|
25
|
+
@import "./loading-indicator.css";
|
|
26
|
+
@import "./loading-inline.css";
|
|
27
|
+
@import "./menu-item.css";
|
|
28
|
+
@import "./modal.css";
|
|
29
|
+
@import "./navigation-rail.css";
|
|
30
|
+
@import "./pagination.css";
|
|
31
|
+
@import "./pagination-item.css";
|
|
32
|
+
@import "./pill.css";
|
|
33
|
+
@import "./progress-bar.css";
|
|
34
|
+
@import "./radio-select.css";
|
|
35
|
+
@import "./section-marker.css";
|
|
36
|
+
@import "./segment-selector.css";
|
|
37
|
+
@import "./sensitive-data.css";
|
|
38
|
+
@import "./skeleton.css";
|
|
39
|
+
@import "./step.css";
|
|
40
|
+
@import "./stepper.css";
|
|
41
|
+
@import "./switch.css";
|
|
42
|
+
@import "./tabs.css";
|
|
43
|
+
@import "./tag.css";
|
|
44
|
+
@import "./text-button.css";
|
|
45
|
+
@import "./textarea.css";
|
|
46
|
+
@import "./toast.css";
|
|
47
|
+
@import "./tooltip.css";
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Component
|
|
3
|
+
*
|
|
4
|
+
* Complete form input system with labels, help text, icons, and error messages.
|
|
5
|
+
* Extracted from Figma Text Input Container (854:24665) — 96 variants
|
|
6
|
+
* (state × error × filled × size × BG).
|
|
7
|
+
*
|
|
8
|
+
* Sizes are 35 / 29 / 25px (lg / md / sm), aligned with DropdownField after
|
|
9
|
+
* the 2026-08-22 design update. Each size carries its own padding AND type:
|
|
10
|
+
* lg and md are Body 1 (13px) at different padding, sm drops to Micro L (11px).
|
|
11
|
+
*
|
|
12
|
+
* Heights are pinned with an explicit `height`, not `min-height`: the sm line
|
|
13
|
+
* box comes from an Auto line height (font-dependent), and Chrome rounds the
|
|
14
|
+
* 0.5px `--border-thin` hairline up to a full 1px, which would otherwise push
|
|
15
|
+
* every field 1-2px past its Figma frame. Figma draws its stroke inside the
|
|
16
|
+
* frame, so the border must not add height. Same precedent as button.css.
|
|
17
|
+
*
|
|
18
|
+
* Structure:
|
|
19
|
+
* <div class="input-container">
|
|
20
|
+
* <div class="input-label">...</div> <!-- Optional -->
|
|
21
|
+
* <div class="input-field">...</div> <!-- Required -->
|
|
22
|
+
* <div class="input-error-message">...</div> <!-- Optional -->
|
|
23
|
+
* </div>
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* <div class="input-container">
|
|
27
|
+
* <div class="input-field">
|
|
28
|
+
* <input type="text" class="input" placeholder="Enter text..." />
|
|
29
|
+
* </div>
|
|
30
|
+
* </div>
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
@layer components {
|
|
34
|
+
/* --- Container ---------------------------------------------------- */
|
|
35
|
+
|
|
36
|
+
.input-container {
|
|
37
|
+
@apply flex flex-col items-start w-full;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* --- Label ------------------------------------------------------- */
|
|
41
|
+
|
|
42
|
+
.input-label {
|
|
43
|
+
@apply flex items-center w-full pb-1.5; /* 6px bottom padding */
|
|
44
|
+
@apply text-[10px] font-semibold uppercase tracking-[1px] leading-[12px];
|
|
45
|
+
@apply text-content-tertiary;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.input-label > span {
|
|
49
|
+
@apply flex-1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Note: Help button uses .icon-button .icon-button-xs from icon-button.css */
|
|
53
|
+
|
|
54
|
+
/* --- Input Field ------------------------------------------------- */
|
|
55
|
+
|
|
56
|
+
.input-field {
|
|
57
|
+
/* Layout */
|
|
58
|
+
@apply flex items-center gap-2 w-full; /* 8px gap, every size */
|
|
59
|
+
|
|
60
|
+
/* Default size: Large — 12px / 7px padding, 35px tall */
|
|
61
|
+
@apply px-3 py-1.75;
|
|
62
|
+
@apply h-[35px];
|
|
63
|
+
|
|
64
|
+
/* Shape */
|
|
65
|
+
@apply rounded-control; /* 6px */
|
|
66
|
+
|
|
67
|
+
/* Border */
|
|
68
|
+
@apply border border-[length:var(--border-thin)] border-stroke-divider;
|
|
69
|
+
|
|
70
|
+
/* Background - default: white */
|
|
71
|
+
@apply bg-surface-paper;
|
|
72
|
+
|
|
73
|
+
/* Interaction */
|
|
74
|
+
@apply transition-colors duration-150;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* --- Actual Input Element ---------------------------------------- */
|
|
78
|
+
|
|
79
|
+
.input {
|
|
80
|
+
/* Layout */
|
|
81
|
+
@apply flex-1;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
|
|
84
|
+
/* Remove default styling */
|
|
85
|
+
@apply appearance-none bg-transparent border-none outline-none;
|
|
86
|
+
@apply p-0 m-0;
|
|
87
|
+
|
|
88
|
+
/* Typography */
|
|
89
|
+
@apply text-body-1; /* 13px / 19.5px / 400 */
|
|
90
|
+
@apply text-content-primary;
|
|
91
|
+
|
|
92
|
+
/* Placeholder — Figma's Filled=no variants use Content/Tertiary.
|
|
93
|
+
Note DropdownField's placeholder is Content/Faint; the two field types
|
|
94
|
+
genuinely differ in the design file. */
|
|
95
|
+
&::placeholder {
|
|
96
|
+
@apply text-content-tertiary;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* --- Icon Wrappers ----------------------------------------------- */
|
|
101
|
+
|
|
102
|
+
.input-icon-left,
|
|
103
|
+
.input-icon-right {
|
|
104
|
+
@apply shrink-0;
|
|
105
|
+
@apply text-content-secondary; /* Icon color */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* --- Size Variants ----------------------------------------------- */
|
|
109
|
+
|
|
110
|
+
.input-sm {
|
|
111
|
+
@apply px-2 py-[5.5px]; /* 8px / 5.5px */
|
|
112
|
+
@apply h-[25px];
|
|
113
|
+
@apply text-micro-l; /* 11px / normal / 400 */
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.input-md {
|
|
117
|
+
@apply px-2.5 py-1; /* 10px / 4px */
|
|
118
|
+
@apply h-[29px];
|
|
119
|
+
@apply text-body-1; /* 13px / 19.5px / 400 */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.input-lg {
|
|
123
|
+
@apply px-3 py-1.75; /* 12px / 7px — same as default */
|
|
124
|
+
@apply h-[35px];
|
|
125
|
+
@apply text-body-1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* The input inherits the row's type so the size variants reach it */
|
|
129
|
+
.input-sm .input,
|
|
130
|
+
.input-md .input,
|
|
131
|
+
.input-lg .input {
|
|
132
|
+
font-size: inherit;
|
|
133
|
+
line-height: inherit;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* --- Background Variants ----------------------------------------- */
|
|
137
|
+
|
|
138
|
+
.input-bg-neutral {
|
|
139
|
+
@apply bg-surface-card; /* Figma BG=Neutral is Surface/Card #fafafb */
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* --- States ------------------------------------------------------ */
|
|
143
|
+
|
|
144
|
+
/* Hover */
|
|
145
|
+
.input-field:hover:not(:has(:disabled)):not(.input-disabled) {
|
|
146
|
+
@apply border-stroke-border;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Focus */
|
|
150
|
+
.input-field:focus-within {
|
|
151
|
+
@apply focus-ring;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Error */
|
|
155
|
+
.input-field.input-error {
|
|
156
|
+
@apply border-critical;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Disabled */
|
|
160
|
+
.input-field:has(:disabled),
|
|
161
|
+
.input-field.input-disabled {
|
|
162
|
+
@apply bg-action-subtle border-stroke-divider cursor-not-allowed;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.input:disabled {
|
|
166
|
+
@apply cursor-not-allowed;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* --- Error Message ----------------------------------------------- */
|
|
170
|
+
|
|
171
|
+
.input-error-message {
|
|
172
|
+
@apply flex items-center w-full pt-1.5; /* 6px top padding */
|
|
173
|
+
@apply text-[11px] leading-[normal] font-normal;
|
|
174
|
+
@apply text-critical-strong;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Multi-line entry is the Textarea component (textarea.css), not a variant
|
|
178
|
+
of .input. The old `textarea.input` shim is gone — it pinned an 80px
|
|
179
|
+
min-height that fought the field's own sizing. */
|
|
180
|
+
}
|