@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,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link Component
|
|
3
|
+
*
|
|
4
|
+
* Hyperlink styles for navigation and inline references. Extracted from Figma
|
|
5
|
+
* Link (880:31368) — 15 variants across Style x State (default / hover /
|
|
6
|
+
* pressed).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <a class="link" href="/report">Open full report →</a>
|
|
10
|
+
* <a class="link link-quiet" href="/log">View activity log</a>
|
|
11
|
+
* <a class="link link-monospace" href="/case">#BA-204417</a>
|
|
12
|
+
* <a class="link link-critical" href="/fix">
|
|
13
|
+
* <svg class="icon icon-size-12" aria-hidden="true"><use href="#alert-triangle" /></svg>
|
|
14
|
+
* Resolve mismatch
|
|
15
|
+
* </a>
|
|
16
|
+
*
|
|
17
|
+
* <p class="link-inline">
|
|
18
|
+
* Valiify utilizes <a href="/middesk">Middesk</a> for instant screenings.
|
|
19
|
+
* </p>
|
|
20
|
+
*
|
|
21
|
+
* FOUR STANDALONE STYLES PLUS ONE THAT IS NOT A LINK AT ALL. `strong`, `quiet`,
|
|
22
|
+
* `monospace` and `critical` are `<a>` classes; `inline` is a PARAGRAPH whose
|
|
23
|
+
* anchors are styled as descendants, because Figma draws it as body copy with
|
|
24
|
+
* links inside rather than as a link with a body. It therefore does not take
|
|
25
|
+
* `.link` — see the block at the foot of the file.
|
|
26
|
+
*
|
|
27
|
+
* STRONG IS THE BASE, being Figma's default variant, and it is the only style
|
|
28
|
+
* with NO underline at rest — it gains one on hover and pressed. The other
|
|
29
|
+
* three are underlined throughout. That is the single most surprising thing
|
|
30
|
+
* here: "underlined" is a per-style constant everywhere except strong, where it
|
|
31
|
+
* is a state.
|
|
32
|
+
*
|
|
33
|
+
* style type rest hover pressed
|
|
34
|
+
* strong Inter SemiBold 14 Primary/Main Primary/Dark Primary/Pressed
|
|
35
|
+
* quiet Inter Regular 14 Content/Secondary Primary/Main Primary/Dark
|
|
36
|
+
* monospace JetBrains Mono Medium 13 Content/Primary Primary/Main Primary/Dark
|
|
37
|
+
* critical Inter Medium 14 + 12px icon Critical/Main Critical/Strong Critical/Content
|
|
38
|
+
* inline Inter Regular 12 (Caption) Primary/Main Primary/Dark Primary/Pressed
|
|
39
|
+
*
|
|
40
|
+
* NOTE THE RAMPS DIFFER IN LENGTH. strong and inline run Main -> Dark ->
|
|
41
|
+
* Pressed; quiet and monospace only reach Dark, because they START outside the
|
|
42
|
+
* primary ramp. Do not "regularise" them.
|
|
43
|
+
*
|
|
44
|
+
* `Critical/Content` DID NOT EXIST IN OUR THEME until this component needed it.
|
|
45
|
+
* It is a real Figma variable in Collection 1 — confirmed with
|
|
46
|
+
* `search_design_system` — and was missing for the same reason `Surface/Card`
|
|
47
|
+
* was: `get_variable_defs` only reports variables actually applied to a layer,
|
|
48
|
+
* and nothing had used it. It is now in tokens/figma-tokens.json. Second time
|
|
49
|
+
* this blind spot has bitten; the colour group still has not been swept
|
|
50
|
+
* end-to-end.
|
|
51
|
+
*
|
|
52
|
+
* THE TYPE IS RAW. Figma binds no text style to any of the four standalone
|
|
53
|
+
* styles — only `inline` carries one (`Body Content/Caption`, which maps to
|
|
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.
|
|
60
|
+
*
|
|
61
|
+
* The gap differs between the two styles that have one: strong sits in a 4px
|
|
62
|
+
* flex row, critical in a 6px one. Only critical actually draws an icon.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
@layer components {
|
|
66
|
+
.link {
|
|
67
|
+
/* Layout — strong's container; critical widens the gap below. */
|
|
68
|
+
@apply inline-flex items-center gap-1; /* 4px */
|
|
69
|
+
|
|
70
|
+
/* Type — strong. Raw, not a token; see the header. */
|
|
71
|
+
@apply text-[14px] font-semibold;
|
|
72
|
+
@apply leading-[normal]; /* Figma Auto — NOT Tailwind's leading-normal (1.5) */
|
|
73
|
+
|
|
74
|
+
/* Colors — strong, the only style with no underline at rest */
|
|
75
|
+
@apply text-primary no-underline;
|
|
76
|
+
|
|
77
|
+
@apply cursor-pointer transition-colors duration-150;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* --- Styles ------------------------------------------------------------- */
|
|
81
|
+
|
|
82
|
+
/* Explicit form of the base. */
|
|
83
|
+
.link-strong {
|
|
84
|
+
@apply text-[14px] font-semibold;
|
|
85
|
+
@apply text-primary no-underline;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.link-quiet {
|
|
89
|
+
@apply text-[14px] font-normal;
|
|
90
|
+
@apply text-content-secondary underline;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.link-monospace {
|
|
94
|
+
@apply font-mono text-[13px] font-medium;
|
|
95
|
+
@apply text-content-primary underline;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* The only style Figma draws with an icon — a 12px alert-triangle at a 6px
|
|
99
|
+
gap. The glyph is a slot, as everywhere else in the library. */
|
|
100
|
+
.link-critical {
|
|
101
|
+
@apply gap-1.5; /* 6px */
|
|
102
|
+
@apply text-[14px] font-medium;
|
|
103
|
+
@apply text-critical underline;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* --- States ------------------------------------------------------------- */
|
|
107
|
+
|
|
108
|
+
/* Each style owns its whole ramp, and they are excluded from one another by
|
|
109
|
+
name rather than by source order — equal-specificity ordering is the
|
|
110
|
+
fragility the library audit found in seven components. */
|
|
111
|
+
|
|
112
|
+
.link:not(.link-quiet):not(.link-monospace):not(.link-critical):hover:not(
|
|
113
|
+
:disabled
|
|
114
|
+
):not([aria-disabled="true"]) {
|
|
115
|
+
@apply text-primary-dark underline;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.link:not(.link-quiet):not(.link-monospace):not(.link-critical):active:not(
|
|
119
|
+
:disabled
|
|
120
|
+
):not([aria-disabled="true"]) {
|
|
121
|
+
@apply text-primary-pressed underline;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* quiet and monospace share a ramp: they start outside the primary scale, so
|
|
125
|
+
hover only reaches Main and pressed only reaches Dark. */
|
|
126
|
+
.link-quiet:hover:not(:disabled):not([aria-disabled="true"]),
|
|
127
|
+
.link-monospace:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
128
|
+
@apply text-primary;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.link-quiet:active:not(:disabled):not([aria-disabled="true"]),
|
|
132
|
+
.link-monospace:active:not(:disabled):not([aria-disabled="true"]) {
|
|
133
|
+
@apply text-primary-dark;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.link-critical:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
137
|
+
@apply text-critical-strong;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.link-critical:active:not(:disabled):not([aria-disabled="true"]) {
|
|
141
|
+
@apply text-critical-content;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.link:focus-visible {
|
|
145
|
+
@apply focus-ring;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Not in Figma — house convention. An <a> cannot be :disabled, so
|
|
149
|
+
aria-disabled is the real guard here; :disabled is carried alongside it so
|
|
150
|
+
the class also behaves on a <button>. Every state rule above excludes both. */
|
|
151
|
+
.link:disabled,
|
|
152
|
+
.link[aria-disabled="true"] {
|
|
153
|
+
@apply cursor-not-allowed text-content-faint no-underline;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* --- Style = inline ----------------------------------------------------- */
|
|
157
|
+
|
|
158
|
+
/* A PARAGRAPH, not a link. Figma models this as body copy carrying anchors,
|
|
159
|
+
so the class goes on the block and the anchors are styled as descendants.
|
|
160
|
+
Deliberately does NOT take `.link`. This is the one style with a real Figma
|
|
161
|
+
text style behind it. */
|
|
162
|
+
.link-inline {
|
|
163
|
+
@apply text-caption; /* 12px / 18px / 400 — Body Content/Caption */
|
|
164
|
+
@apply text-content-primary;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.link-inline a {
|
|
168
|
+
@apply text-primary underline;
|
|
169
|
+
@apply cursor-pointer transition-colors duration-150;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.link-inline a:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
173
|
+
@apply text-primary-dark;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.link-inline a:active:not(:disabled):not([aria-disabled="true"]) {
|
|
177
|
+
@apply text-primary-pressed;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.link-inline a:focus-visible {
|
|
181
|
+
@apply focus-ring;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loading Indicator Component
|
|
3
|
+
*
|
|
4
|
+
* Extracted from Figma Loading Indicator (1028:1992) — 8 variants across
|
|
5
|
+
* Type (Circle / Dots) x Size (XS / SM / MD / LG).
|
|
6
|
+
*
|
|
7
|
+
* Usage — circle:
|
|
8
|
+
* <span class="loading-indicator" role="status" aria-label="Loading"></span>
|
|
9
|
+
* <span class="loading-indicator loading-indicator-lg" role="status" aria-label="Loading"></span>
|
|
10
|
+
*
|
|
11
|
+
* Usage — dots:
|
|
12
|
+
* <span class="loading-indicator loading-indicator-dots" role="status" aria-label="Loading">
|
|
13
|
+
* <span class="loading-indicator-dot"></span>
|
|
14
|
+
* <span class="loading-indicator-dot"></span>
|
|
15
|
+
* <span class="loading-indicator-dot"></span>
|
|
16
|
+
* </span>
|
|
17
|
+
*
|
|
18
|
+
* XS IS THE DEFAULT — Figma's first variant is `Type=Circle, Size=XS`, and the
|
|
19
|
+
* Loading Inline component embeds a 12px indicator at every one of its sizes,
|
|
20
|
+
* so 12px really is the norm rather than a small option.
|
|
21
|
+
*
|
|
22
|
+
* BOTH TYPES WERE FLATTENED TO SVG in Figma — `get_design_context` returns an
|
|
23
|
+
* `<img>` and no variables at all — so every value below was read out of the
|
|
24
|
+
* exported asset and cross-checked against the rendered PNG.
|
|
25
|
+
*
|
|
26
|
+
* THE CIRCLE IS A TRACK RING PLUS A 90 DEGREE ARC:
|
|
27
|
+
*
|
|
28
|
+
* size box ring track arc
|
|
29
|
+
* XS 12 1.5 Stroke/Divider Primary/Main
|
|
30
|
+
* SM 16 2 Stroke/Divider Primary/Main
|
|
31
|
+
* MD 24 2.52 Stroke/Divider Primary/Main
|
|
32
|
+
* LG 32 3.04 Stroke/Divider Primary/Main
|
|
33
|
+
*
|
|
34
|
+
* Those are the annulus thicknesses in the exported Track paths (XS outer r=6
|
|
35
|
+
* inner r=4.5; MD 12/9.48; LG 16/12.96) and they are what Figma renders —
|
|
36
|
+
* tracing its 1x PNG by pixel COVERAGE, rather than by a binary is-it-white
|
|
37
|
+
* test, gives 1.56 / 2.00 / 2.50 / 3.11.
|
|
38
|
+
*
|
|
39
|
+
* IT IS A MASKED CONIC-GRADIENT, NOT A BORDER, and that is the whole reason the
|
|
40
|
+
* authored values can be carried exactly. Chrome FLOORS fractional
|
|
41
|
+
* `border-width` — measured at 1x and 2x, 1.5px computes to 1px and 2.5px to
|
|
42
|
+
* 2px — so a bordered ring cannot express 1.5 or 2.52 at all. An earlier
|
|
43
|
+
* revision shipped integers (2/2/3/3) to compensate, justified by a claim that
|
|
44
|
+
* Figma's PNG rendered 2/2/3/3; that trace was wrong, and the result was an XS
|
|
45
|
+
* ring a third thicker than the design, on the default size and the one
|
|
46
|
+
* embedded in every Loading Inline variant. A mask has no such rounding.
|
|
47
|
+
*
|
|
48
|
+
* One coloured quarter of a conic-gradient is the same 90-degree arc a single
|
|
49
|
+
* coloured border side used to draw, with square ends in both cases.
|
|
50
|
+
*
|
|
51
|
+
* It is built from a border rather than an SVG: one coloured side of a round
|
|
52
|
+
* border IS a quarter arc, which is what Figma draws. The only difference is
|
|
53
|
+
* that the border's ends are mitred at 45 degrees where the SVG's are radial —
|
|
54
|
+
* invisible at 12-32px, and it spins, so the start angle does not matter.
|
|
55
|
+
*
|
|
56
|
+
* THE DOTS ARE THREE CIRCLES WHOSE DIAMETER AND GAP ARE THE SAME NUMBER, which
|
|
57
|
+
* is why the frames are exactly 5x their height: 2/3/4/5px dots at 2/3/4/5px
|
|
58
|
+
* gaps give 10x2, 15x3, 20x4, 25x5. Fill is `Secondary/Main`, not the primary
|
|
59
|
+
* used by the circle's arc. Sized through a custom property so one value drives
|
|
60
|
+
* both the dot and the gap.
|
|
61
|
+
*
|
|
62
|
+
* THE ANIMATION IS NOT IN FIGMA. Both types are static vectors there — no
|
|
63
|
+
* prototype, no timing, no easing. A loading indicator that does not move is
|
|
64
|
+
* useless, so the motion below is a library decision: 0.8s linear for the spin,
|
|
65
|
+
* and a 1.4s staggered opacity pulse for the dots. Both are conventional
|
|
66
|
+
* defaults rather than anything the design file specifies, and both are on the
|
|
67
|
+
* designer list.
|
|
68
|
+
*
|
|
69
|
+
* REDUCED MOTION IS RESPECTED. Under `prefers-reduced-motion: reduce` the
|
|
70
|
+
* animations stop. The indicator then conveys nothing on its own, which is why
|
|
71
|
+
* every usage needs `role="status"` and a label — or a visible one, as Loading
|
|
72
|
+
* Inline provides.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
@layer components {
|
|
76
|
+
.loading-indicator {
|
|
77
|
+
@apply inline-flex shrink-0 items-center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* --- Type = Circle (the default) ---------------------------------------- */
|
|
81
|
+
|
|
82
|
+
/* Excluded from the dots type by name rather than by source order.
|
|
83
|
+
|
|
84
|
+
A conic-gradient masked to a ring, NOT a border — see the header. The arc
|
|
85
|
+
runs 0-90deg, which is 12 to 3 o'clock, exactly where Figma draws it. */
|
|
86
|
+
.loading-indicator:not(.loading-indicator-dots) {
|
|
87
|
+
--loading-ring: 1.5px; /* XS */
|
|
88
|
+
@apply size-3; /* 12px */
|
|
89
|
+
@apply rounded-pill;
|
|
90
|
+
|
|
91
|
+
background: conic-gradient(
|
|
92
|
+
from 0deg,
|
|
93
|
+
var(--color-primary) 0deg 90deg,
|
|
94
|
+
var(--color-stroke-divider) 90deg 360deg
|
|
95
|
+
);
|
|
96
|
+
mask: radial-gradient(
|
|
97
|
+
farthest-side,
|
|
98
|
+
transparent calc(100% - var(--loading-ring)),
|
|
99
|
+
black calc(100% - var(--loading-ring))
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
animation: valiify-loading-spin 0.8s linear infinite;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.loading-indicator-sm:not(.loading-indicator-dots) {
|
|
106
|
+
--loading-ring: 2px;
|
|
107
|
+
@apply size-4; /* 16px */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.loading-indicator-md:not(.loading-indicator-dots) {
|
|
111
|
+
--loading-ring: 2.52px;
|
|
112
|
+
@apply size-6; /* 24px */
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.loading-indicator-lg:not(.loading-indicator-dots) {
|
|
116
|
+
--loading-ring: 3.04px;
|
|
117
|
+
@apply size-8; /* 32px */
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* --- Type = Dots -------------------------------------------------------- */
|
|
121
|
+
|
|
122
|
+
/* One custom property drives both the dot diameter and the gap, because in
|
|
123
|
+
Figma they are always the same number. */
|
|
124
|
+
.loading-indicator-dots {
|
|
125
|
+
--loading-dot: 2px; /* XS */
|
|
126
|
+
gap: var(--loading-dot);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.loading-indicator-dots.loading-indicator-sm {
|
|
130
|
+
--loading-dot: 3px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.loading-indicator-dots.loading-indicator-md {
|
|
134
|
+
--loading-dot: 4px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.loading-indicator-dots.loading-indicator-lg {
|
|
138
|
+
--loading-dot: 5px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Secondary/Main, NOT the Primary the circle's arc uses. */
|
|
142
|
+
.loading-indicator-dot {
|
|
143
|
+
@apply block shrink-0 rounded-pill;
|
|
144
|
+
width: var(--loading-dot);
|
|
145
|
+
height: var(--loading-dot);
|
|
146
|
+
@apply bg-secondary;
|
|
147
|
+
|
|
148
|
+
animation: valiify-loading-pulse 1.4s ease-in-out infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.loading-indicator-dot:nth-child(2) {
|
|
152
|
+
animation-delay: 0.16s;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.loading-indicator-dot:nth-child(3) {
|
|
156
|
+
animation-delay: 0.32s;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Keyframes sit outside @layer components so nothing can cascade them away.
|
|
161
|
+
Prefixed to avoid colliding with a consumer's own `spin`. */
|
|
162
|
+
@keyframes valiify-loading-spin {
|
|
163
|
+
to {
|
|
164
|
+
transform: rotate(360deg);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@keyframes valiify-loading-pulse {
|
|
169
|
+
0%,
|
|
170
|
+
80%,
|
|
171
|
+
100% {
|
|
172
|
+
opacity: 0.3;
|
|
173
|
+
}
|
|
174
|
+
40% {
|
|
175
|
+
opacity: 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@media (prefers-reduced-motion: reduce) {
|
|
180
|
+
.loading-indicator:not(.loading-indicator-dots),
|
|
181
|
+
.loading-indicator-dot {
|
|
182
|
+
animation: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loading Inline Component
|
|
3
|
+
*
|
|
4
|
+
* A loading indicator paired with a label. Extracted from Figma Loading Inline
|
|
5
|
+
* (1028:2013) — 4 variants on a single `Size` axis.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <span class="loading-inline" role="status">
|
|
9
|
+
* <span class="loading-indicator"></span>
|
|
10
|
+
* Loading...
|
|
11
|
+
* </span>
|
|
12
|
+
*
|
|
13
|
+
* <span class="loading-inline loading-inline-lg" role="status">
|
|
14
|
+
* <span class="loading-indicator"></span>
|
|
15
|
+
* Loading...
|
|
16
|
+
* </span>
|
|
17
|
+
*
|
|
18
|
+
* THE INDICATOR IS 12px AT EVERY SIZE. That is not an oversight in this
|
|
19
|
+
* implementation — Figma embeds a `Size=XS` Loading Indicator instance in all
|
|
20
|
+
* four variants while the gap and label scale around it, which is clearly
|
|
21
|
+
* visible in the rendered frames as a constant spinner beside growing text. It
|
|
22
|
+
* is reproduced faithfully, and it means the nested `.loading-indicator` needs
|
|
23
|
+
* no size class: its own default is already 12px. Flagged for the designer,
|
|
24
|
+
* because at LG the spinner reads small against 16px text.
|
|
25
|
+
*
|
|
26
|
+
* What actually scales:
|
|
27
|
+
*
|
|
28
|
+
* size gap label leading frame
|
|
29
|
+
* XS 6 11px 17px 69x17
|
|
30
|
+
* SM 8 12px 18px 76x18
|
|
31
|
+
* MD 10 14px 21px 87x21
|
|
32
|
+
* LG 12 16px 24px 98x24
|
|
33
|
+
*
|
|
34
|
+
* XS IS THE DEFAULT, matching Figma's first variant.
|
|
35
|
+
*
|
|
36
|
+
* ONLY SM MAPS TO A TOKEN. Its 12px/18px is exactly `--text-caption`; the other
|
|
37
|
+
* three are raw — 11/17, 14/21 and 16/24 have no equivalent in the type scale,
|
|
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.
|
|
42
|
+
*
|
|
43
|
+
* The label colour is `Content/Secondary` at every size, and it is set on the
|
|
44
|
+
* container so the text can be a bare child rather than needing its own class.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
@layer components {
|
|
48
|
+
.loading-inline {
|
|
49
|
+
@apply inline-flex items-center;
|
|
50
|
+
gap: 6px; /* XS */
|
|
51
|
+
|
|
52
|
+
/* Label — raw type; see the header. */
|
|
53
|
+
@apply text-[11px] font-normal;
|
|
54
|
+
line-height: 17px;
|
|
55
|
+
@apply text-content-secondary;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.loading-inline-sm {
|
|
59
|
+
gap: 8px;
|
|
60
|
+
@apply text-[12px];
|
|
61
|
+
line-height: 18px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.loading-inline-md {
|
|
65
|
+
gap: 10px;
|
|
66
|
+
@apply text-[14px];
|
|
67
|
+
line-height: 21px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.loading-inline-lg {
|
|
71
|
+
gap: 12px;
|
|
72
|
+
@apply text-[16px];
|
|
73
|
+
line-height: 24px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu Item Component
|
|
3
|
+
*
|
|
4
|
+
* Single row within a dropdown menu or navigation list. Supports left icon,
|
|
5
|
+
* avatar, subtitle, right icon, and right text slots.
|
|
6
|
+
* Extracted from Figma Menu Item (114:805) — 7 variants.
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* <button class="menu-item">
|
|
10
|
+
* <span class="avatar avatar-md">NC</span> <!-- Optional avatar -->
|
|
11
|
+
* <svg class="icon icon-size-15">…</svg> <!-- Optional left icon -->
|
|
12
|
+
* <span class="menu-item-text">
|
|
13
|
+
* <span class="menu-item-title">Combined</span>
|
|
14
|
+
* <span class="menu-item-subtitle">Both Applicants</span> <!-- Optional -->
|
|
15
|
+
* </span>
|
|
16
|
+
* <span class="menu-item-right-text">⌘K</span> <!-- Optional -->
|
|
17
|
+
* <svg class="icon icon-size-15">…</svg> <!-- Optional right icon -->
|
|
18
|
+
* </button>
|
|
19
|
+
*
|
|
20
|
+
* Icon sizes by menu size: sm = 12px, md / lg = 15px.
|
|
21
|
+
*
|
|
22
|
+
* Heights are content-driven (padding + line box), matching Figma's hug
|
|
23
|
+
* behaviour — 25px sm / 29px md / 42px lg with a right icon present. They are
|
|
24
|
+
* deliberately NOT hardcoded, because the sm title uses an Auto line height.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
@layer components {
|
|
28
|
+
/* --- Base (defaults to md, the size used by Dropdown Menu) ---------- */
|
|
29
|
+
|
|
30
|
+
.menu-item {
|
|
31
|
+
/* Layout */
|
|
32
|
+
@apply flex w-full items-center gap-2.5; /* 10px gap */
|
|
33
|
+
@apply px-3 py-1.75; /* 12px / 7px */
|
|
34
|
+
|
|
35
|
+
/* Shape */
|
|
36
|
+
@apply rounded-control; /* 6px */
|
|
37
|
+
|
|
38
|
+
/* Reset, so the class works on button / a / div / li alike */
|
|
39
|
+
@apply appearance-none border-none bg-transparent text-left no-underline;
|
|
40
|
+
|
|
41
|
+
/* Type */
|
|
42
|
+
@apply text-body-2 text-content-primary; /* 12.5px / 12.5px / 400 */
|
|
43
|
+
|
|
44
|
+
/* Interaction */
|
|
45
|
+
@apply cursor-pointer transition-colors duration-150;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* --- Parts ---------------------------------------------------------- */
|
|
49
|
+
|
|
50
|
+
.menu-item-text {
|
|
51
|
+
@apply flex flex-1 flex-col items-start;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.menu-item-title {
|
|
56
|
+
@apply w-full;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.menu-item-subtitle {
|
|
60
|
+
@apply w-full text-micro-l text-content-tertiary; /* 11px, all sizes */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.menu-item-right-text {
|
|
64
|
+
@apply shrink-0 text-right text-micro-l-bold text-primary; /* 11px / 500 */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* 20px tinted icon tile — the Combined variant's leading badge */
|
|
68
|
+
.menu-item-badge {
|
|
69
|
+
@apply flex size-5 shrink-0 items-center justify-center;
|
|
70
|
+
@apply rounded-control bg-primary-soft text-primary;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* --- Sizes ---------------------------------------------------------- */
|
|
74
|
+
|
|
75
|
+
.menu-item-sm {
|
|
76
|
+
@apply px-2.5 py-1.5; /* 10px / 6px */
|
|
77
|
+
@apply text-micro-l; /* 11px / normal / 400 */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.menu-item-sm .menu-item-right-text {
|
|
81
|
+
@apply text-micro-m-bold; /* 8.5px / 500 */
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.menu-item-md {
|
|
85
|
+
@apply px-3 py-1.75; /* 12px / 7px — same as default */
|
|
86
|
+
@apply text-body-2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.menu-item-md .menu-item-right-text {
|
|
90
|
+
@apply text-micro-l-bold;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.menu-item-lg {
|
|
94
|
+
@apply px-3 py-2.75; /* 12px / 11px */
|
|
95
|
+
@apply text-body-1; /* 13px / 19.5px / 400 */
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.menu-item-lg .menu-item-right-text {
|
|
99
|
+
@apply text-body-2-bold; /* 12.5px / 12.5px / 500 */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* --- Combined variant ----------------------------------------------- */
|
|
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. */
|
|
106
|
+
|
|
107
|
+
.menu-item-combined {
|
|
108
|
+
@apply text-primary;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.menu-item-combined .menu-item-title {
|
|
112
|
+
@apply text-body-1-bold; /* 13px / 19.5px / 500 */
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* --- States ---------------------------------------------------------- */
|
|
116
|
+
|
|
117
|
+
.menu-item:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
118
|
+
@apply bg-action-hover;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.menu-item:focus-visible {
|
|
122
|
+
@apply focus-ring;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Selected — aria-selected for listbox rows, aria-checked for menu radios.
|
|
126
|
+
Set on the row so the title AND any icons (which use currentColor) turn
|
|
127
|
+
primary together, the way the Figma check mark renders. The subtitle and
|
|
128
|
+
right text keep their own explicit colors. */
|
|
129
|
+
.menu-item[aria-selected="true"],
|
|
130
|
+
.menu-item[aria-checked="true"] {
|
|
131
|
+
@apply text-primary;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.menu-item:disabled,
|
|
135
|
+
.menu-item[aria-disabled="true"] {
|
|
136
|
+
@apply cursor-not-allowed opacity-50;
|
|
137
|
+
}
|
|
138
|
+
}
|