@tangible/ui 0.2.32 → 0.2.33
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/components/StepIndicator/StepIndicator.js +13 -28
- package/components/StepIndicator/label.d.ts +13 -0
- package/components/StepIndicator/label.js +29 -0
- package/components/StepIndicator/types.d.ts +13 -0
- package/components/StepIndicator/types.js +1 -0
- package/components/StepList/StepList.js +38 -11
- package/components/StepList/index.d.ts +2 -1
- package/components/StepList/index.js +1 -0
- package/components/StepList/types.d.ts +33 -1
- package/components/StepList/types.js +11 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +2 -2
- package/figma-tokens.json +1 -1
- package/package.json +1 -1
- package/skills/building-with-tui/SKILL.md +4 -3
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +53 -7
- package/styles/all.expanded.unlayered.css +53 -7
- package/styles/all.unlayered.css +1 -1
- package/styles/components/step-indicator.scss +74 -11
- package/styles/components/step-list.scss +27 -1
- package/tui-manifest.json +18 -3
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
@use "../system" as sys;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Attention dot geometry, relative to the circle
|
|
4
|
+
$_dot-size: 36%;
|
|
5
|
+
$_dot-offset: 20%; // how far it overhangs the top-end edge
|
|
6
|
+
$_dot-min-size: 6px; // floor at xs (16px circle), a visual floor, not a target
|
|
7
|
+
$_dot-gap: 1.5px; // surface-coloured ring separating it from the track
|
|
8
|
+
|
|
9
|
+
/* @tui-tokens
|
|
10
|
+
--tui-step-indicator-track
|
|
11
|
+
--tui-step-indicator-attention
|
|
12
|
+
--tui-step-indicator-surface
|
|
13
|
+
*/
|
|
4
14
|
|
|
5
15
|
@mixin styles() {
|
|
6
16
|
// ==========================================================================
|
|
@@ -18,12 +28,29 @@
|
|
|
18
28
|
// This component is tightly coupled to Progress circle mode internals.
|
|
19
29
|
// Changes to Progress may require updates here.
|
|
20
30
|
//
|
|
31
|
+
// ### Component API tokens:
|
|
32
|
+
// --tui-step-indicator-track Ring track colour (then --tui-progress-track,
|
|
33
|
+
// then the control border)
|
|
34
|
+
// --tui-step-indicator-attention Attention dot colour (default: warning base)
|
|
35
|
+
// --tui-step-indicator-surface What the indicator sits on (default: color-bg),
|
|
36
|
+
// painted as a gap around the dot so it reads
|
|
37
|
+
// apart from the ring
|
|
38
|
+
//
|
|
21
39
|
// ### Inherits from Progress:
|
|
22
|
-
// --tui-progress-track Ring track color
|
|
23
40
|
// --tui-progress-fill Ring fill color
|
|
41
|
+
// --tui-progress-track Ring track color, below --tui-step-indicator-track
|
|
42
|
+
//
|
|
43
|
+
// ### Hand-offs from a host (StepList), private, read below the public tokens
|
|
44
|
+
// for the track and above them for the surface:
|
|
45
|
+
// --_indicator-track A darker track where the row paints a fill
|
|
46
|
+
// --_indicator-surface The row's own fill, for the dot's gap
|
|
24
47
|
//
|
|
25
48
|
// ### Manipulates Progress:
|
|
26
|
-
// - Sets --
|
|
49
|
+
// - Sets Progress's internal --_track. A not-started step is only its
|
|
50
|
+
// track, so it needs 3:1 (SC 1.4.11); Progress's own default, color-fill,
|
|
51
|
+
// measures about 1.2:1. Written to the internal rather than to
|
|
52
|
+
// --tui-progress-track, which would have to read itself (a cycle) to
|
|
53
|
+
// keep a consumer's value in the chain.
|
|
27
54
|
// - Overrides label font-size to fit icons
|
|
28
55
|
// - Uses variant="solid" for complete state (removes hollow centre)
|
|
29
56
|
//
|
|
@@ -31,6 +58,15 @@
|
|
|
31
58
|
|
|
32
59
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}step-indicator {
|
|
33
60
|
display: inline-flex;
|
|
61
|
+
position: relative;
|
|
62
|
+
|
|
63
|
+
// Out-specifies Progress's own (0,1,0) declaration of --_track.
|
|
64
|
+
.#{sys.$prefix}progress {
|
|
65
|
+
--_track: var(
|
|
66
|
+
--#{sys.$prefix}step-indicator-track,
|
|
67
|
+
var(--_indicator-track, var(--#{sys.$prefix}progress-track, var(--#{sys.$prefix}color-border-control)))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
34
70
|
|
|
35
71
|
// Size overrides — StepIndicator uses fixed pixel sizes
|
|
36
72
|
// rather than Progress's em-based scaling
|
|
@@ -54,12 +90,10 @@
|
|
|
54
90
|
// Static icon states: hide the progress fill, show only track
|
|
55
91
|
// Note: complete handles its own background (solid green), so not included here
|
|
56
92
|
// Note: in-progress with custom icon should still show progress fill
|
|
57
|
-
&.is-status-locked.has-icon,
|
|
58
|
-
&.is-status-not-started.has-icon {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
// no !important arms race with Progress's own declaration.
|
|
62
|
-
--#{sys.$prefix}progress-fill: var(--#{sys.$prefix}progress-track, var(--#{sys.$prefix}color-border));
|
|
93
|
+
&.is-status-locked.has-icon .#{sys.$prefix}progress,
|
|
94
|
+
&.is-status-not-started.has-icon .#{sys.$prefix}progress {
|
|
95
|
+
// Uniform circle: fill matches track
|
|
96
|
+
--_fill: var(--_track);
|
|
63
97
|
}
|
|
64
98
|
|
|
65
99
|
// Center the icon properly within the progress circle
|
|
@@ -108,11 +142,40 @@
|
|
|
108
142
|
}
|
|
109
143
|
|
|
110
144
|
&.is-status-locked {
|
|
111
|
-
--#{sys.$prefix}progress-track: var(--#{sys.$prefix}color-border);
|
|
112
|
-
|
|
113
145
|
.#{sys.$prefix}icon {
|
|
114
146
|
color: var(--#{sys.$prefix}color-fg-muted);
|
|
115
147
|
}
|
|
116
148
|
}
|
|
149
|
+
|
|
150
|
+
// -------------------------------------------------------------------------
|
|
151
|
+
// Attention: a dot on the ring's top-end edge. Its presence is the cue (no
|
|
152
|
+
// colour-only meaning), and warning-base clears 3:1 on the page in both
|
|
153
|
+
// modes. The name carries it for AT; the dot is aria-hidden.
|
|
154
|
+
// -------------------------------------------------------------------------
|
|
155
|
+
&__attention {
|
|
156
|
+
position: absolute;
|
|
157
|
+
inset-block-start: 0;
|
|
158
|
+
inset-inline-end: 0;
|
|
159
|
+
inline-size: $_dot-size;
|
|
160
|
+
aspect-ratio: 1;
|
|
161
|
+
min-inline-size: $_dot-min-size;
|
|
162
|
+
border-radius: 50%;
|
|
163
|
+
background-color: var(--#{sys.$prefix}step-indicator-attention, var(--#{sys.$prefix}theme-warning-base));
|
|
164
|
+
box-shadow: 0 0 0 $_dot-gap var(--_indicator-surface, var(--#{sys.$prefix}step-indicator-surface, var(--#{sys.$prefix}color-bg)));
|
|
165
|
+
translate: $_dot-offset (-$_dot-offset);
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
|
|
168
|
+
// Forced colours strip the fill and the shadow, leaving a bite out of
|
|
169
|
+
// the ring. Keep a text-coloured dot with a canvas gap.
|
|
170
|
+
@media (forced-colors: active) {
|
|
171
|
+
forced-color-adjust: none;
|
|
172
|
+
background-color: CanvasText;
|
|
173
|
+
box-shadow: 0 0 0 $_dot-gap Canvas;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:dir(rtl) .#{sys.$prefix}step-indicator__attention {
|
|
178
|
+
translate: (-$_dot-offset) (-$_dot-offset);
|
|
179
|
+
}
|
|
117
180
|
}
|
|
118
181
|
}
|
|
@@ -82,8 +82,14 @@
|
|
|
82
82
|
transition-duration: var(--#{sys.$prefix}motion-duration);
|
|
83
83
|
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
// Rows that paint a fill hand two private values to the StepIndicator:
|
|
86
|
+
// the fill itself, so the attention dot's gap matches the row, and on the
|
|
87
|
+
// current row a darker track (control-border measures 2.87:1 on the light
|
|
88
|
+
// current fill; fg-muted measures 3.99:1). A consumer's
|
|
89
|
+
// --tui-step-indicator-track still wins over the hand-off.
|
|
90
|
+
&:hover:not([aria-disabled="true"]):not(:disabled):not(.is-static) {
|
|
86
91
|
background-color: var(--_hover-bg);
|
|
92
|
+
--_indicator-surface: var(--_hover-bg);
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
&:focus-visible {
|
|
@@ -97,6 +103,25 @@
|
|
|
97
103
|
&[aria-current] {
|
|
98
104
|
background-color: var(--_current-bg);
|
|
99
105
|
border-left-color: var(--_current-border);
|
|
106
|
+
--_indicator-surface: var(--_current-bg);
|
|
107
|
+
--_indicator-track: var(--#{sys.$prefix}color-fg-muted);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Forced colours repaint the transparent accent border on every row, so
|
|
111
|
+
// the current row stopped standing out. Rest rows match the canvas; the
|
|
112
|
+
// current row takes Highlight.
|
|
113
|
+
@media (forced-colors: active) {
|
|
114
|
+
border-left-color: Canvas;
|
|
115
|
+
|
|
116
|
+
&.is-current,
|
|
117
|
+
&[aria-current] {
|
|
118
|
+
border-left-color: Highlight;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Status-only row (no href, no onSelect): nothing to activate
|
|
123
|
+
&.is-static {
|
|
124
|
+
cursor: default;
|
|
100
125
|
}
|
|
101
126
|
|
|
102
127
|
// Disabled styling
|
|
@@ -113,6 +138,7 @@
|
|
|
113
138
|
// ---------------------------------------------------------------------------
|
|
114
139
|
|
|
115
140
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}steplist__indicator {
|
|
141
|
+
display: flex;
|
|
116
142
|
flex-shrink: 0;
|
|
117
143
|
margin-top: 0.325em; // Slight offset to align with text baseline
|
|
118
144
|
}
|
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"generated": "2026-10-
|
|
2
|
+
"version": "0.2.33",
|
|
3
|
+
"generated": "2026-10-25T19:41:05.565Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -3545,6 +3545,12 @@
|
|
|
3545
3545
|
"defaultValue": "false",
|
|
3546
3546
|
"description": "Show percentage text in center (only visible for in-progress status)."
|
|
3547
3547
|
},
|
|
3548
|
+
"attention": {
|
|
3549
|
+
"type": "boolean",
|
|
3550
|
+
"required": false,
|
|
3551
|
+
"defaultValue": "false",
|
|
3552
|
+
"description": "Flag the step as needing attention (its inputs changed, it's stale, it\nneeds review). Adds a warning dot and appends \"needs attention\" to the\naccessible name via `labels.withAttention`.\n\nSeparate from `status` on purpose: a complete step can still need\nattention."
|
|
3553
|
+
},
|
|
3548
3554
|
"label": {
|
|
3549
3555
|
"type": "string",
|
|
3550
3556
|
"required": false,
|
|
@@ -3561,7 +3567,11 @@
|
|
|
3561
3567
|
"description": "Override default English strings for i18n.\nCovers status display names and the aria-label template."
|
|
3562
3568
|
}
|
|
3563
3569
|
},
|
|
3564
|
-
"cssTokens": [
|
|
3570
|
+
"cssTokens": [
|
|
3571
|
+
"--tui-step-indicator-track",
|
|
3572
|
+
"--tui-step-indicator-attention",
|
|
3573
|
+
"--tui-step-indicator-surface"
|
|
3574
|
+
],
|
|
3565
3575
|
"story": {
|
|
3566
3576
|
"title": "Primitives/StepIndicator",
|
|
3567
3577
|
"tags": [
|
|
@@ -3591,6 +3601,11 @@
|
|
|
3591
3601
|
"required": false,
|
|
3592
3602
|
"description": "Value of the currently active step.\nThe matching StepList.Item will receive `aria-current` and current styling."
|
|
3593
3603
|
},
|
|
3604
|
+
"labels": {
|
|
3605
|
+
"type": "StepListLabels",
|
|
3606
|
+
"required": false,
|
|
3607
|
+
"description": "Override the strings each item announces after its label\n(\"Complete\", \"needs attention\", \"current step\")."
|
|
3608
|
+
},
|
|
3594
3609
|
"children": {
|
|
3595
3610
|
"type": "ReactNode",
|
|
3596
3611
|
"required": true,
|