@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,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Marker Component
|
|
3
|
+
*
|
|
4
|
+
* Visual marker indicating the verification status of a document section.
|
|
5
|
+
* Extracted from Figma Section Marker (141:1071) — 4 variants on a single
|
|
6
|
+
* `Status` axis, plus a Ring boolean.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <span class="section-marker section-marker-approve" role="img" aria-label="Approved">
|
|
10
|
+
* <svg class="icon icon-size-14" aria-hidden="true"><use href="#check" /></svg>
|
|
11
|
+
* </span>
|
|
12
|
+
*
|
|
13
|
+
* <span class="section-marker section-marker-mismatch" role="img" aria-label="Mismatch">
|
|
14
|
+
* <span class="section-marker-dot"></span>
|
|
15
|
+
* </span>
|
|
16
|
+
*
|
|
17
|
+
* A 16x16 box in every status. What goes inside it is NOT uniform, which is the
|
|
18
|
+
* one thing to know before using this:
|
|
19
|
+
*
|
|
20
|
+
* approve a 14px #check glyph Approved/Main
|
|
21
|
+
* mismatch an 8px filled dot Critical/Main
|
|
22
|
+
* unverified a 14px #circle glyph Secondary/Main
|
|
23
|
+
* na nothing at all —
|
|
24
|
+
*
|
|
25
|
+
* Two of the four are icon glyphs and one is a shape, so this component styles
|
|
26
|
+
* the box and the colour and leaves the mark itself a slot, as Alert and Toast
|
|
27
|
+
* do. `.section-marker-dot` exists because mismatch's mark is a filled circle
|
|
28
|
+
* that no icon in the sprite provides.
|
|
29
|
+
*
|
|
30
|
+
* MEASURED, NOT ASSUMED. Figma renders these as flattened vectors, so the
|
|
31
|
+
* geometry was read by tracing the exported PNG: approve's ink is 12x8, the
|
|
32
|
+
* mismatch dot is exactly 8x8 centred with a 4px inset (matching its
|
|
33
|
+
* `Spacing/4` binding), unverified's ring fills 14x14, and na's 16x16 box is
|
|
34
|
+
* uniformly blank.
|
|
35
|
+
*
|
|
36
|
+
* `Status=na` DRAWS NOTHING. Not a dash, not a hollow box — the variant is
|
|
37
|
+
* empty. It still occupies its 16px so a column of markers stays aligned, which
|
|
38
|
+
* is presumably the intent, but it is equally consistent with an unfinished
|
|
39
|
+
* variant. On the designer list. There is deliberately no `.section-marker-na`
|
|
40
|
+
* class: with no colour to set it would be an empty rule, so `na` is a bare
|
|
41
|
+
* `.section-marker` with no child.
|
|
42
|
+
*
|
|
43
|
+
* THE RING IS SQUARE HERE. Every other `.with-ring` in the library sits on a
|
|
44
|
+
* rounded element and inherits its radius; this box has no radius, so the ring
|
|
45
|
+
* is a 2px square. That falls out of the shared implementation and matches
|
|
46
|
+
* Figma, which draws `inset-0` with no corner rounding.
|
|
47
|
+
*
|
|
48
|
+
* ACCESSIBILITY: the marker carries meaning, so it needs an accessible name.
|
|
49
|
+
* Give the container `role="img"` and an `aria-label`, and leave the inner
|
|
50
|
+
* glyph `aria-hidden`. `na` needs one too, or a reader announces nothing.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
@layer components {
|
|
54
|
+
.section-marker {
|
|
55
|
+
/* A fixed 16x16 box in every status, so a column of markers aligns. */
|
|
56
|
+
@apply inline-flex size-4 shrink-0 items-center justify-center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* --- Parts -------------------------------------------------------------- */
|
|
60
|
+
|
|
61
|
+
/* mismatch's mark. A filled 8px circle — not an icon, and not `.dot`, whose
|
|
62
|
+
Figma sizes are 5px and 7px. Colour comes from the status class. */
|
|
63
|
+
.section-marker-dot {
|
|
64
|
+
@apply size-2; /* 8px, leaving Figma's 4px inset in the 16px box */
|
|
65
|
+
@apply rounded-pill;
|
|
66
|
+
@apply bg-current;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* --- Statuses ----------------------------------------------------------- */
|
|
70
|
+
|
|
71
|
+
/* Each sets only a colour; icons inherit it through currentColor, and
|
|
72
|
+
`.section-marker-dot` picks it up via bg-current. */
|
|
73
|
+
|
|
74
|
+
.section-marker-approve {
|
|
75
|
+
@apply text-approved;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.section-marker-mismatch {
|
|
79
|
+
@apply text-critical;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Secondary/Main, not Content/Secondary — they resolve to the same #5b5b68,
|
|
83
|
+
but Figma binds the Secondary ramp here. */
|
|
84
|
+
.section-marker-unverified {
|
|
85
|
+
@apply text-secondary;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* --- States ------------------------------------------------------------- */
|
|
89
|
+
|
|
90
|
+
/* Figma boolean, hidden by default. Same 2px inset Primary/Main treatment as
|
|
91
|
+
Chip, Avatar, Pill, Tag and TextButton — square here, since the box has no
|
|
92
|
+
radius. */
|
|
93
|
+
.section-marker.with-ring {
|
|
94
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Segment Selector Component
|
|
3
|
+
*
|
|
4
|
+
* The framed container that wraps segment tabs. Extracted from Figma Segment
|
|
5
|
+
* Selector (784:34686), whose description reads: "Horizontal segmented control
|
|
6
|
+
* combining multiple filter segments. Use for toggling between 2-5 mutually
|
|
7
|
+
* exclusive options."
|
|
8
|
+
*
|
|
9
|
+
* It is a PARENT of Tabs, not a variant of it — Figma composes it literally
|
|
10
|
+
* from `Tabs Type=segment` instances. So its children are `.tab tab-segment`;
|
|
11
|
+
* this file only styles the frame.
|
|
12
|
+
*
|
|
13
|
+
* <div class="segment-selector" role="radiogroup" aria-label="View">
|
|
14
|
+
* <button class="tab tab-segment" role="radio" aria-checked="true">Overview</button>
|
|
15
|
+
* <button class="tab tab-segment" role="radio" aria-checked="false">Detail</button>
|
|
16
|
+
* </div>
|
|
17
|
+
*
|
|
18
|
+
* Use `role="tablist"` + `role="tab"` + `aria-selected` instead when the
|
|
19
|
+
* segments swap panels rather than set a value.
|
|
20
|
+
*
|
|
21
|
+
* THERE IS NO SLIDING THUMB. Many segmented controls animate a floating
|
|
22
|
+
* indicator; this one does not. The selected state is styling on the selected
|
|
23
|
+
* child — white fill, a 0.5px hairline, darker text — and Figma models no
|
|
24
|
+
* indicator layer. Any slide animation would be invented.
|
|
25
|
+
*
|
|
26
|
+
* CHILDREN HUG THEIR LABELS; they do not stretch. Figma's 160px example is
|
|
27
|
+
* content-driven — both segments are 79px only because both labels are the
|
|
28
|
+
* string "Overview". Adding a fourth or fifth segment GROWS the container
|
|
29
|
+
* rather than compressing the segments, and there is no overflow handling,
|
|
30
|
+
* which is why the description caps it at 2-5 options.
|
|
31
|
+
*
|
|
32
|
+
* `.segment-selector-fill` is an addition, not from Figma: it distributes the
|
|
33
|
+
* segments equally, which is what most people expect of a segmented control
|
|
34
|
+
* and what you want when the labels differ in length. Opt in.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
@layer components {
|
|
38
|
+
.segment-selector {
|
|
39
|
+
/* Layout — 1px frame around the segments, no gap between them */
|
|
40
|
+
@apply inline-flex items-center gap-0;
|
|
41
|
+
@apply p-0.25; /* 1px */
|
|
42
|
+
|
|
43
|
+
/* Shape */
|
|
44
|
+
@apply rounded-tight; /* Radius/XS, 4px */
|
|
45
|
+
@apply border-none;
|
|
46
|
+
|
|
47
|
+
/* Colors */
|
|
48
|
+
@apply bg-surface-frame;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* --- Equal-width segments (NOT from Figma) ---------------------------- */
|
|
52
|
+
|
|
53
|
+
.segment-selector-fill {
|
|
54
|
+
@apply flex w-full;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.segment-selector-fill > .tab {
|
|
58
|
+
@apply flex-1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* --- States ----------------------------------------------------------- */
|
|
62
|
+
|
|
63
|
+
/* The container has no hover or disabled state of its own — every
|
|
64
|
+
interactive state lives on the children. Deliberately no :focus-within —
|
|
65
|
+
focus lands on a segment, which rings itself; ringing the frame too would
|
|
66
|
+
double it. :focus-visible is here only for a roving-tabindex group where
|
|
67
|
+
the container itself takes focus.
|
|
68
|
+
|
|
69
|
+
It does carry Figma's Ring boolean, at the container's own 4px radius
|
|
70
|
+
rather than the segments' 2px. */
|
|
71
|
+
.segment-selector:focus-visible {
|
|
72
|
+
@apply focus-ring;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.segment-selector.with-ring {
|
|
76
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SensitiveData Component
|
|
3
|
+
*
|
|
4
|
+
* A masked value with a toggle that reveals it — an SSN, an account number, a
|
|
5
|
+
* date of birth. Extracted from Figma Sensitive Data (296:5303) — 2 variants on
|
|
6
|
+
* a `Checked` boolean, plus `obscuredData` / `unobscuredData` text properties
|
|
7
|
+
* and the usual hidden Ring boolean.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <span class="sensitive-data">
|
|
11
|
+
* <span class="sensitive-data-value">***-**-1234</span>
|
|
12
|
+
* <button class="icon-button icon-button-md" aria-pressed="true"
|
|
13
|
+
* aria-label="Show full value">
|
|
14
|
+
* <svg class="icon icon-size-14" aria-hidden="true"><use href="#eye-off" /></svg>
|
|
15
|
+
* </button>
|
|
16
|
+
* </span>
|
|
17
|
+
*
|
|
18
|
+
* THE TOGGLE IS AN ICON BUTTON, NOT A NEW PART. Figma nests an 18x18 box around
|
|
19
|
+
* a 14px glyph, which is `.icon-button icon-button-md` down to the pixel —
|
|
20
|
+
* including the 6px radius (`Radius/SM`) and the `Secondary/Main` glyph. Alert,
|
|
21
|
+
* Modal and Toast reuse Icon Button the same way for their dismiss controls.
|
|
22
|
+
*
|
|
23
|
+
* STATE IS `aria-pressed`, AND THIS FILE DELIBERATELY HAS NO STATE RULE.
|
|
24
|
+
* The two Figma variants are visually IDENTICAL — same box, same colours, same
|
|
25
|
+
* type. Only the value string and the glyph change, and both are the consumer's
|
|
26
|
+
* to supply. So there is nothing for CSS to select on, and inventing an
|
|
27
|
+
* `[aria-pressed]` rule to justify the attribute would be styling that Figma
|
|
28
|
+
* does not draw.
|
|
29
|
+
*
|
|
30
|
+
* The attribute still matters: it is what tells assistive tech the control is a
|
|
31
|
+
* toggle and which way it is set. Pill, Tag and Tabs use the same convention.
|
|
32
|
+
*
|
|
33
|
+
* `Checked` IS NOT USED AS A CLASS NAME, on purpose. In Figma `Checked=yes`
|
|
34
|
+
* means the data is HIDDEN, which reads backwards — a `.sensitive-data-checked`
|
|
35
|
+
* class would be actively misleading. Pair `aria-pressed="true"` with `#eye-off`
|
|
36
|
+
* and the obscured string; `false` with `#eye` and the plain one.
|
|
37
|
+
*
|
|
38
|
+
* FOUR THINGS IN THE FIGMA NODE ARE NOT REPRODUCED, and none is a judgement call
|
|
39
|
+
* about styling — they are authoring artefacts:
|
|
40
|
+
*
|
|
41
|
+
* - The component description is a CHECKBOX's ("Visual indicator for checkbox
|
|
42
|
+
* checked/unchecked state... internal building block within checkbox
|
|
43
|
+
* components"). This component is a masked-data toggle. Same class of error
|
|
44
|
+
* as Toast carrying Tooltip's description. On the designer list.
|
|
45
|
+
* - `Radius/XS` (4px) is bound in the variant set but appears nowhere in the
|
|
46
|
+
* rendered structure — the same phantom binding as FilterSegment's, which is
|
|
47
|
+
* already an open designer question.
|
|
48
|
+
* - The toggle's `Spacing/6` padding cannot contain its own glyph: 18 - (6*2)
|
|
49
|
+
* leaves 6px for a 14px icon. `.icon-button-md`'s 2px fits exactly, so
|
|
50
|
+
* Figma's value is treated as vestigial.
|
|
51
|
+
* - `Spacing/10` is set as a gap on the toggle, which has one child.
|
|
52
|
+
*
|
|
53
|
+
* NO HOVER, FOCUS OR DISABLED VARIANTS ARE MODELLED for this component — the
|
|
54
|
+
* axis is `Checked` alone. All four arrive from Icon Button, which carries its
|
|
55
|
+
* own hover, active, disabled and (as of this change) `:focus-visible`. The row
|
|
56
|
+
* itself is not interactive and needs none.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
@layer components {
|
|
60
|
+
.sensitive-data {
|
|
61
|
+
/* Layout — 4px (Spacing/4) between the value and its toggle. */
|
|
62
|
+
@apply inline-flex items-center gap-1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Body Content/Caption, 12px / 18px / 400. */
|
|
66
|
+
.sensitive-data-value {
|
|
67
|
+
@apply text-caption text-content-primary;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* --- States --------------------------------------------------------- */
|
|
71
|
+
|
|
72
|
+
/* Figma's Ring boolean, hidden by default — 2px Primary/Main drawn inside the
|
|
73
|
+
row's own bounds, matching Chip, Avatar and Tag. */
|
|
74
|
+
.sensitive-data.with-ring {
|
|
75
|
+
@apply ring-[length:var(--border-micro)] ring-inset ring-primary;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton Component
|
|
3
|
+
*
|
|
4
|
+
* A placeholder that mimics the shape and size of content while it loads,
|
|
5
|
+
* previewing the page structure and preventing layout shift. Extracted from
|
|
6
|
+
* Figma Skeleton (1063:24034) — 15 variants across `Shape` x `Size` — with the
|
|
7
|
+
* usage spec at 1081:1986.
|
|
8
|
+
*
|
|
9
|
+
* Usage — a skeleton is decorative; the CONTAINER announces the loading state:
|
|
10
|
+
* <div role="status" aria-busy="true" aria-label="Loading profile">
|
|
11
|
+
* <span class="skeleton skeleton-circle skeleton-lg" aria-hidden="true"></span>
|
|
12
|
+
* <span class="skeleton skeleton-heading skeleton-lg" aria-hidden="true"></span>
|
|
13
|
+
* <span class="skeleton skeleton-line skeleton-md" aria-hidden="true"></span>
|
|
14
|
+
* </div>
|
|
15
|
+
*
|
|
16
|
+
* BOTH A SHAPE AND A SIZE CLASS ARE REQUIRED. Neither axis has a default in
|
|
17
|
+
* Figma, and the dimensions are a 5x3 matrix rather than one box with three
|
|
18
|
+
* scales — a Line SM is 120x12 while a Circle SM is 32x32. Baking a default
|
|
19
|
+
* into `.skeleton` would mean every other combination overriding two
|
|
20
|
+
* properties, which is the `:not()`-chain specificity trap Tabs already walked
|
|
21
|
+
* into. A bare `.skeleton` therefore has fill and motion but no size, which
|
|
22
|
+
* reads as the authoring error it is.
|
|
23
|
+
*
|
|
24
|
+
* SHAPE CARRIES THE RADIUS, and it is a different token per shape — this is the
|
|
25
|
+
* only component in the library that uses four of the five:
|
|
26
|
+
*
|
|
27
|
+
* Line, Heading 4px Radius/XS -> rounded-tight
|
|
28
|
+
* Button 6px Radius/SM -> rounded-control
|
|
29
|
+
* Rectangle 8px Radius/MD -> rounded-surface
|
|
30
|
+
* Circle full Radius/Rounded -> rounded-pill
|
|
31
|
+
*
|
|
32
|
+
* SIZE CARRIES THE DIMENSIONS, which is why the size classes are compound
|
|
33
|
+
* (`.skeleton-line.skeleton-sm`) rather than standalone. Every one of the 15
|
|
34
|
+
* pairs maps to a standard Tailwind step — 120px is `w-30`, 180px is `h-45` —
|
|
35
|
+
* so none needs arbitrary syntax.
|
|
36
|
+
*
|
|
37
|
+
* THE DEFAULTS ARE STARTING POINTS, NOT A SPEC. The usage node is explicit:
|
|
38
|
+
* "stretch instances with fill in auto-layout to match real content widths",
|
|
39
|
+
* while "heights should generally stay close to defaults to match the replaced
|
|
40
|
+
* element". A consumer utility beats a component class under our layer order,
|
|
41
|
+
* so `class="skeleton skeleton-line skeleton-md w-full"` just works.
|
|
42
|
+
*
|
|
43
|
+
* THE ANIMATION IS A PULSE, AND FIGMA SPECIFIES IT PRECISELY — unusually, since
|
|
44
|
+
* it draws no motion itself ("Animation is handled in code, not in Figma"):
|
|
45
|
+
* 2s per cycle, ease-in-out, opacity 1.0 -> 0.4 -> 1.0.
|
|
46
|
+
*
|
|
47
|
+
* IT IS NOT TAILWIND'S `animate-pulse`, THOUGH THE FIGMA NODE SUGGESTS IT.
|
|
48
|
+
* The usage spec offers `class="animate-pulse"` as a shortcut, but Tailwind's
|
|
49
|
+
* built-in keyframe is `50% { opacity: 0.5 }` on a `cubic-bezier(0.4, 0, 0.6, 1)`
|
|
50
|
+
* curve — neither the 0.4 floor nor the ease-in-out the same document specifies
|
|
51
|
+
* four bullets later. Custom keyframes are the only way to honour the written
|
|
52
|
+
* spec, so the shortcut is deliberately not used.
|
|
53
|
+
*
|
|
54
|
+
* INSTANCES PULSE IN SYNC, and that falls out for free rather than needing
|
|
55
|
+
* work. Figma asks that "all skeleton instances within a single container
|
|
56
|
+
* should pulse in sync (same animation start time) to avoid a scattered,
|
|
57
|
+
* chaotic feel". Identical animations on elements rendered together share a
|
|
58
|
+
* start time, so they do. The thing to avoid is the opposite instinct — do NOT
|
|
59
|
+
* add per-element `animation-delay` to stagger them; that is the effect the
|
|
60
|
+
* spec rules out.
|
|
61
|
+
*
|
|
62
|
+
* REDUCED MOTION IS GUARDED FROM THE START, and the guard sits INSIDE
|
|
63
|
+
* `@layer components`. That placement is deliberate: `loading-indicator.css`
|
|
64
|
+
* puts its `prefers-reduced-motion` block outside the layer, which makes it the
|
|
65
|
+
* one rule in `dist` that outranks a consumer's utilities — the single place
|
|
66
|
+
* the overlay contract breaks. This file does not repeat that. The keyframes
|
|
67
|
+
* themselves stay outside the layer, as they do there, because `@keyframes` is
|
|
68
|
+
* name-scoped rather than cascaded and nothing should be able to drop it.
|
|
69
|
+
*
|
|
70
|
+
* ACCESSIBILITY: THE SKELETON IS DECORATIVE. Figma specifies nothing here, so
|
|
71
|
+
* this is a library decision. A screen reader announcing five grey boxes is
|
|
72
|
+
* worse than silence, so each `.skeleton` takes `aria-hidden="true"` and the
|
|
73
|
+
* CONTAINER carries `role="status"` with `aria-busy="true"` and a label — one
|
|
74
|
+
* clear "Loading…" instead of N meaningless nodes. That differs from Loading
|
|
75
|
+
* Indicator, where the spinner IS the announcement and carries `role="status"`
|
|
76
|
+
* itself; here there are many elements and only the region is meaningful.
|
|
77
|
+
* Markup is the consumer's, so this cannot be enforced in CSS — see the story
|
|
78
|
+
* and CLAUDE.md.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
@layer components {
|
|
82
|
+
.skeleton {
|
|
83
|
+
@apply block shrink-0;
|
|
84
|
+
@apply bg-surface-neutral; /* Surface/Neutral #f1f1f4 — the only bound token */
|
|
85
|
+
|
|
86
|
+
/* 2s / ease-in-out / 1.0 -> 0.4, per the usage node. */
|
|
87
|
+
animation: valiify-skeleton-pulse 2s ease-in-out infinite;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* --- Shape: radius only ---------------------------------------------- */
|
|
91
|
+
|
|
92
|
+
.skeleton-line,
|
|
93
|
+
.skeleton-heading {
|
|
94
|
+
@apply rounded-tight; /* 4px — Radius/XS */
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.skeleton-button {
|
|
98
|
+
@apply rounded-control; /* 6px — Radius/SM */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.skeleton-rectangle {
|
|
102
|
+
@apply rounded-surface; /* 8px — Radius/MD */
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.skeleton-circle {
|
|
106
|
+
@apply rounded-pill; /* Radius/Rounded */
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* --- Shape x Size: dimensions ---------------------------------------- */
|
|
110
|
+
/* Defaults, not a spec — override the width with a utility. See the header. */
|
|
111
|
+
|
|
112
|
+
.skeleton-line.skeleton-sm {
|
|
113
|
+
@apply h-3 w-30; /* 120 x 12 */
|
|
114
|
+
}
|
|
115
|
+
.skeleton-line.skeleton-md {
|
|
116
|
+
@apply h-4 w-50; /* 200 x 16 */
|
|
117
|
+
}
|
|
118
|
+
.skeleton-line.skeleton-lg {
|
|
119
|
+
@apply h-5 w-80; /* 320 x 20 */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.skeleton-heading.skeleton-sm {
|
|
123
|
+
@apply h-5 w-40; /* 160 x 20 */
|
|
124
|
+
}
|
|
125
|
+
.skeleton-heading.skeleton-md {
|
|
126
|
+
@apply h-6 w-60; /* 240 x 24 */
|
|
127
|
+
}
|
|
128
|
+
.skeleton-heading.skeleton-lg {
|
|
129
|
+
@apply h-8 w-90; /* 360 x 32 */
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.skeleton-circle.skeleton-sm {
|
|
133
|
+
@apply size-8; /* 32 */
|
|
134
|
+
}
|
|
135
|
+
.skeleton-circle.skeleton-md {
|
|
136
|
+
@apply size-10; /* 40 */
|
|
137
|
+
}
|
|
138
|
+
.skeleton-circle.skeleton-lg {
|
|
139
|
+
@apply size-14; /* 56 */
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.skeleton-rectangle.skeleton-sm {
|
|
143
|
+
@apply h-20 w-30; /* 120 x 80 */
|
|
144
|
+
}
|
|
145
|
+
.skeleton-rectangle.skeleton-md {
|
|
146
|
+
@apply h-30 w-50; /* 200 x 120 */
|
|
147
|
+
}
|
|
148
|
+
.skeleton-rectangle.skeleton-lg {
|
|
149
|
+
@apply h-45 w-80; /* 320 x 180 */
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.skeleton-button.skeleton-sm {
|
|
153
|
+
@apply h-8 w-16; /* 64 x 32 */
|
|
154
|
+
}
|
|
155
|
+
.skeleton-button.skeleton-md {
|
|
156
|
+
@apply h-9 w-24; /* 96 x 36 */
|
|
157
|
+
}
|
|
158
|
+
.skeleton-button.skeleton-lg {
|
|
159
|
+
@apply h-10 w-32; /* 128 x 40 */
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* --- Reduced motion --------------------------------------------------- */
|
|
163
|
+
|
|
164
|
+
/* INSIDE the layer, unlike loading-indicator.css — see the header. A static
|
|
165
|
+
placeholder still communicates "loading" through the container's
|
|
166
|
+
role="status"; the pulse is decoration, so it is safe to drop entirely. */
|
|
167
|
+
@media (prefers-reduced-motion: reduce) {
|
|
168
|
+
.skeleton {
|
|
169
|
+
animation: none;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Outside @layer, matching loading-indicator.css: @keyframes is name-scoped
|
|
175
|
+
rather than cascaded, so nothing should be able to drop it. */
|
|
176
|
+
@keyframes valiify-skeleton-pulse {
|
|
177
|
+
0%,
|
|
178
|
+
100% {
|
|
179
|
+
opacity: 1;
|
|
180
|
+
}
|
|
181
|
+
50% {
|
|
182
|
+
opacity: 0.4;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Step Component
|
|
3
|
+
*
|
|
4
|
+
* A single marker in a stepped progression. Extracted from Figma Step
|
|
5
|
+
* (1032:2012) — 3 variants on a `State` axis, plus a Step Title boolean.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <div class="step">
|
|
9
|
+
* <span class="step-marker">
|
|
10
|
+
* <svg class="icon icon-size-12" aria-hidden="true"><use href="#check" /></svg>
|
|
11
|
+
* </span>
|
|
12
|
+
* <span class="step-label">Intake</span>
|
|
13
|
+
* </div>
|
|
14
|
+
*
|
|
15
|
+
* <div class="step step-active" aria-current="step">
|
|
16
|
+
* <span class="step-marker">3</span>
|
|
17
|
+
* <span class="step-label">Review</span>
|
|
18
|
+
* </div>
|
|
19
|
+
*
|
|
20
|
+
* COMPLETED IS THE BASE, being Figma's default variant. A bare `.step` is a
|
|
21
|
+
* finished step, which reads oddly in isolation but is what the design file
|
|
22
|
+
* specifies — mark the others explicitly.
|
|
23
|
+
*
|
|
24
|
+
* WHAT EACH STATE DRAWS. The marker is always a 24px circle and the label always
|
|
25
|
+
* 10px uppercase at 0.5px tracking; everything else moves:
|
|
26
|
+
*
|
|
27
|
+
* state marker fill marker border content label
|
|
28
|
+
* completed Primary/Main none 12px check Content/Tertiary, Medium
|
|
29
|
+
* -active Surface/Paper 2px Primary/Main number Primary/Main, Medium
|
|
30
|
+
* -upcoming Surface/Paper 1px Content/Faint number Neutral/Strong, Regular
|
|
31
|
+
*
|
|
32
|
+
* THE LABEL RAMP IS INVERTED AND THAT IS NOT A TRANSCRIPTION ERROR. A completed
|
|
33
|
+
* step's label is `Content/Tertiary` (#727280) while an upcoming one is
|
|
34
|
+
* `Neutral/Strong` (#4e4e59) — so the step you have already finished is drawn
|
|
35
|
+
* LIGHTER than the one you have not reached. The weights disagree in the other
|
|
36
|
+
* direction: completed and active are Medium, upcoming is Regular. Reproduced
|
|
37
|
+
* faithfully; on the designer list, because either the colour or the weight
|
|
38
|
+
* looks like it was meant to go the other way.
|
|
39
|
+
*
|
|
40
|
+
* THE BORDER WIDTHS ARE DIFFERENT TOKENS, not one value at two sizes — active
|
|
41
|
+
* binds `Stroke/Micro` (2px) and upcoming `Stroke/Line` (1px). Completed draws
|
|
42
|
+
* none at all; a transparent border keeps all three boxes at 24px under
|
|
43
|
+
* border-box, so they line up in a row.
|
|
44
|
+
*
|
|
45
|
+
* Figma writes the marker fill as a literal white rather than binding
|
|
46
|
+
* `Surface/Paper`. The value is identical, so it is mapped to the token here.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
@layer components {
|
|
50
|
+
.step {
|
|
51
|
+
@apply inline-flex shrink-0 flex-col items-center gap-1.5; /* 6px */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* --- Marker --------------------------------------------------------- */
|
|
55
|
+
|
|
56
|
+
/* Completed: a filled circle. The transparent border keeps the outer box at
|
|
57
|
+
24px so all three states align on a shared baseline. */
|
|
58
|
+
.step-marker {
|
|
59
|
+
@apply inline-flex size-6 shrink-0 items-center justify-center overflow-hidden;
|
|
60
|
+
@apply rounded-pill;
|
|
61
|
+
|
|
62
|
+
border-style: solid;
|
|
63
|
+
@apply border-transparent;
|
|
64
|
+
border-width: var(--border-micro); /* 2px, matching the active ring */
|
|
65
|
+
|
|
66
|
+
@apply bg-primary text-content-contrast;
|
|
67
|
+
|
|
68
|
+
/* The number the other two states show; completed swaps in a 12px icon. */
|
|
69
|
+
@apply text-[11px] font-medium leading-[normal];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.step-label {
|
|
73
|
+
@apply text-[10px] font-medium leading-[normal];
|
|
74
|
+
@apply text-center uppercase tracking-[0.5px];
|
|
75
|
+
@apply text-content-tertiary;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* --- State = active --------------------------------------------------- */
|
|
79
|
+
|
|
80
|
+
.step-active .step-marker {
|
|
81
|
+
@apply bg-surface-paper text-primary;
|
|
82
|
+
border-width: var(--border-micro); /* 2px — Stroke/Micro */
|
|
83
|
+
@apply border-primary;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.step-active .step-label {
|
|
87
|
+
@apply text-primary;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* --- State = upcoming -------------------------------------------------- */
|
|
91
|
+
|
|
92
|
+
.step-upcoming .step-marker {
|
|
93
|
+
@apply bg-surface-paper text-neutral-strong;
|
|
94
|
+
border-width: var(
|
|
95
|
+
--border-line
|
|
96
|
+
); /* 1px — Stroke/Line, NOT the active 2px */
|
|
97
|
+
@apply border-content-faint;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Regular, where completed and active are Medium — and DARKER than
|
|
101
|
+
completed's label. See the header. */
|
|
102
|
+
.step-upcoming .step-label {
|
|
103
|
+
@apply font-normal;
|
|
104
|
+
@apply text-neutral-strong;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stepper Component
|
|
3
|
+
*
|
|
4
|
+
* A row of Steps joined by progress connectors. Extracted from Figma Stepper
|
|
5
|
+
* (1032:2013) — a single symbol with a Stepper Title boolean.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <div class="stepper">
|
|
9
|
+
* <p class="stepper-title">Stepped progression flow</p>
|
|
10
|
+
* <div class="stepper-steps">
|
|
11
|
+
* <div class="step"><span class="step-marker">…</span><span class="step-label">Intake</span></div>
|
|
12
|
+
* <span class="stepper-connector stepper-connector-complete"></span>
|
|
13
|
+
* <div class="step"><span class="step-marker">…</span><span class="step-label">Verify</span></div>
|
|
14
|
+
* <span class="stepper-connector stepper-connector-complete"></span>
|
|
15
|
+
* <div class="step step-active"><span class="step-marker">3</span><span class="step-label">Review</span></div>
|
|
16
|
+
* <span class="stepper-connector"></span>
|
|
17
|
+
* <div class="step step-upcoming"><span class="step-marker">4</span><span class="step-label">Decision</span></div>
|
|
18
|
+
* </div>
|
|
19
|
+
* </div>
|
|
20
|
+
*
|
|
21
|
+
* THE CONNECTORS CARRY THE PROGRESS, not the steps. Each is `flex-1`, so it
|
|
22
|
+
* absorbs whatever space the steps leave — which is why Figma's step instances
|
|
23
|
+
* are 38 / 38 / 41 / 51px wide (their labels) while every connector is the same
|
|
24
|
+
* 70.67px. Its colour says whether that SEGMENT is behind you:
|
|
25
|
+
*
|
|
26
|
+
* default `Stroke/Border` not yet reached
|
|
27
|
+
* `-complete` `Primary/Main` passed
|
|
28
|
+
*
|
|
29
|
+
* Incomplete is the default deliberately, even though Figma's first two
|
|
30
|
+
* instances are filled — an empty stepper should not imply progress it has not
|
|
31
|
+
* made.
|
|
32
|
+
*
|
|
33
|
+
* THE ROW HAS 10px OF SIDE PADDING, which is what stops the first and last
|
|
34
|
+
* markers sitting flush against the container edge. It is also why Figma's step
|
|
35
|
+
* instances start at x=10 rather than 0.
|
|
36
|
+
*
|
|
37
|
+
* THE ROOT'S WHITE FILL AND 8px RADIUS ARE NOT REPRODUCED. Figma sets both on a
|
|
38
|
+
* frame with no padding, no border and no shadow, so the fill hugs the content
|
|
39
|
+
* exactly and the radius clips nothing — the white would simply be wrong on any
|
|
40
|
+
* surface that is not already white. Treated as vestigial, the same call as
|
|
41
|
+
* Progress Bar's root radius. On the designer list.
|
|
42
|
+
*
|
|
43
|
+
* THE TITLE IS `Content/Secondary` HERE where Progress Bar's otherwise identical
|
|
44
|
+
* 11px uppercase title is `Content/Primary`. Both are raw — neither binds a text
|
|
45
|
+
* style — so the difference may be unintentional. Reproduced as drawn.
|
|
46
|
+
*
|
|
47
|
+
* THE CONNECTORS SIT BELOW THE MARKER CENTRES, by 9px, and that is faithful
|
|
48
|
+
* rather than a bug here: the row is `items-center` over a 42px step (24px
|
|
49
|
+
* marker + 6px gap + 12px label), so a 2px line centres at y=21 while the
|
|
50
|
+
* marker centres at y=12. Figma places its lines at exactly y=20 for the same
|
|
51
|
+
* reason. Most steppers align the connector with the marker centre, so this may
|
|
52
|
+
* not be intended — but it is what the file draws, confirmed against the render.
|
|
53
|
+
*
|
|
54
|
+
* FIGMA'S OWN INSTANCES SHOW THE WRONG NUMBERS: both the active and upcoming
|
|
55
|
+
* markers read "1", because those Step instances kept the component's default
|
|
56
|
+
* label instead of being overridden to 3 and 4. The number is a text slot, so
|
|
57
|
+
* nothing in the CSS is affected — but do not copy the numbering from the
|
|
58
|
+
* design file.
|
|
59
|
+
*
|
|
60
|
+
* The connector's 1px radius is exactly half its 2px height, so `rounded-pill`
|
|
61
|
+
* renders it identically and is used instead of a raw value.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
@layer components {
|
|
65
|
+
.stepper {
|
|
66
|
+
@apply flex w-full flex-col items-start gap-4; /* 16px */
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.stepper-title {
|
|
70
|
+
@apply w-full;
|
|
71
|
+
@apply text-[11px] font-medium leading-[normal];
|
|
72
|
+
@apply uppercase tracking-[0.5px];
|
|
73
|
+
@apply text-content-secondary;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* 10px of side padding keeps the end markers off the container edge. */
|
|
77
|
+
.stepper-steps {
|
|
78
|
+
@apply flex w-full items-center overflow-hidden;
|
|
79
|
+
@apply px-2.5; /* 10px */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Fills the space between two steps, so the row distributes itself however
|
|
83
|
+
wide the labels turn out to be. */
|
|
84
|
+
.stepper-connector {
|
|
85
|
+
@apply h-0.5 min-w-px flex-1; /* 2px tall */
|
|
86
|
+
@apply rounded-pill; /* 1px in Figma = half the height, so identical */
|
|
87
|
+
@apply bg-stroke-border;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.stepper-connector-complete {
|
|
91
|
+
@apply bg-primary;
|
|
92
|
+
}
|
|
93
|
+
}
|