@tangible/ui 0.2.23 → 0.2.25
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/Checkbox/Checkbox.js +1 -1
- package/components/DatePicker/DateRangePicker.js +1 -1
- package/components/Dropdown/Dropdown.js +1 -1
- package/components/GradientPicker/GradientPicker.js +3 -3
- package/components/NavMenu/NavMenu.d.ts +32 -0
- package/components/NavMenu/NavMenu.js +230 -0
- package/components/NavMenu/index.d.ts +3 -0
- package/components/NavMenu/index.js +2 -0
- package/components/NavMenu/types.d.ts +103 -0
- package/components/NavMenu/types.js +6 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/figma-tokens.json +90 -1
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +10 -6
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +546 -64
- package/styles/all.expanded.unlayered.css +546 -64
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/checkbox.scss +13 -2
- package/styles/components/color-picker.scss +12 -4
- package/styles/components/combobox.scss +7 -6
- package/styles/components/date-picker.scss +8 -6
- package/styles/components/dropdown.scss +3 -5
- package/styles/components/gradient-picker.scss +3 -5
- package/styles/components/input/index.scss +16 -6
- package/styles/components/multi-combobox.scss +6 -6
- package/styles/components/multi-select.scss +10 -7
- package/styles/components/nav-menu.scss +385 -0
- package/styles/components/radio.scss +11 -3
- package/styles/components/search-select.scss +7 -7
- package/styles/components/select.scss +7 -6
- package/styles/components/slider.scss +1 -1
- package/styles/components/switch.scss +1 -1
- package/styles/components/text-input.scss +15 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/index.scss +18 -0
- package/styles/system/_constants.scss +0 -6
- package/styles/system/_palettes.scss +6 -0
- package/styles/system/_text-styles.scss +200 -0
- package/styles/system/_tokens.scss +7 -0
- package/styles/system/index.scss +3 -1
- package/tui-manifest.json +115 -3
- package/utils/listbox/group.js +3 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-nav-menu-group-gap
|
|
5
|
+
--tui-nav-menu-item-gap
|
|
6
|
+
--tui-nav-menu-item-height
|
|
7
|
+
--tui-nav-menu-item-padding-inline
|
|
8
|
+
--tui-nav-menu-item-radius
|
|
9
|
+
--tui-nav-menu-item-font-size
|
|
10
|
+
--tui-nav-menu-item-fg
|
|
11
|
+
--tui-nav-menu-item-weight
|
|
12
|
+
--tui-nav-menu-item-bg-hover
|
|
13
|
+
--tui-nav-menu-item-fg-hover
|
|
14
|
+
--tui-nav-menu-item-bg-current
|
|
15
|
+
--tui-nav-menu-item-fg-current
|
|
16
|
+
--tui-nav-menu-item-weight-current
|
|
17
|
+
--tui-nav-menu-item-fg-ancestor
|
|
18
|
+
--tui-nav-menu-item-weight-ancestor
|
|
19
|
+
--tui-nav-menu-item-fg-disabled
|
|
20
|
+
--tui-nav-menu-icon-size
|
|
21
|
+
--tui-nav-menu-indicator-width
|
|
22
|
+
--tui-nav-menu-indicator-color
|
|
23
|
+
--tui-nav-menu-sub-indent
|
|
24
|
+
--tui-nav-menu-sub-border
|
|
25
|
+
--tui-nav-menu-bar-gap
|
|
26
|
+
--tui-nav-menu-bar-bg-current
|
|
27
|
+
--tui-nav-menu-underline-width
|
|
28
|
+
--tui-nav-menu-underline-color
|
|
29
|
+
--tui-nav-menu-flyout-bg
|
|
30
|
+
--tui-nav-menu-flyout-fg
|
|
31
|
+
--tui-nav-menu-flyout-border
|
|
32
|
+
--tui-nav-menu-flyout-radius
|
|
33
|
+
--tui-nav-menu-flyout-shadow
|
|
34
|
+
--tui-nav-menu-flyout-min-width
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
@mixin styles() {
|
|
38
|
+
// ==========================================================================
|
|
39
|
+
// NavMenu
|
|
40
|
+
// ==========================================================================
|
|
41
|
+
//
|
|
42
|
+
// Rows for app navigation: groups with an overline heading, the current
|
|
43
|
+
// page, an ancestor of it, inert items, one level of nested items. Not a
|
|
44
|
+
// landmark: it sits inside Sidebar.Nav or the consumer's own <nav>.
|
|
45
|
+
//
|
|
46
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
47
|
+
// --tui-nav-menu-group-gap Space above each group after the first
|
|
48
|
+
// --tui-nav-menu-item-gap Space between rows
|
|
49
|
+
// --tui-nav-menu-item-height Row min-height (default: control md)
|
|
50
|
+
// --tui-nav-menu-item-padding-inline Row inline padding; the group heading
|
|
51
|
+
// aligns its text to it
|
|
52
|
+
// --tui-nav-menu-item-radius Row radius
|
|
53
|
+
// --tui-nav-menu-item-font-size Row font size
|
|
54
|
+
// --tui-nav-menu-item-fg Row text
|
|
55
|
+
// --tui-nav-menu-item-weight Row weight (default: normal)
|
|
56
|
+
// --tui-nav-menu-item-bg-hover / -fg-hover
|
|
57
|
+
// --tui-nav-menu-item-bg-current / -fg-current / -weight-current
|
|
58
|
+
// The current page (aria-current="page")
|
|
59
|
+
// --tui-nav-menu-item-fg-ancestor / -weight-ancestor
|
|
60
|
+
// An ancestor of it (any other aria-current)
|
|
61
|
+
// --tui-nav-menu-item-fg-disabled Inert items
|
|
62
|
+
// --tui-nav-menu-icon-size Icon size (default: icon-size-sm, 16px)
|
|
63
|
+
// --tui-nav-menu-indicator-width Leading bar on the current page.
|
|
64
|
+
// Opt-in: 0 by default, try 3px.
|
|
65
|
+
// --tui-nav-menu-indicator-color That bar's colour
|
|
66
|
+
// --tui-nav-menu-sub-indent / -border Nested list indent and guide line
|
|
67
|
+
//
|
|
68
|
+
// Horizontal (orientation="horizontal"):
|
|
69
|
+
// --tui-nav-menu-bar-gap Space between bar items and clusters
|
|
70
|
+
// --tui-nav-menu-bar-bg-current Current bar item fill (default: none)
|
|
71
|
+
// --tui-nav-menu-underline-width / -color
|
|
72
|
+
// The current bar item's underline
|
|
73
|
+
// (default 2px, primary-base). Also marks
|
|
74
|
+
// an ancestor, since its page is in the
|
|
75
|
+
// flyout.
|
|
76
|
+
// --tui-nav-menu-flyout-{bg,fg,border,radius,shadow,min-width}
|
|
77
|
+
// The flyout panel (an elevated surface
|
|
78
|
+
// that owns its fg)
|
|
79
|
+
//
|
|
80
|
+
// !important on the row's color, font-weight and text-decoration, the
|
|
81
|
+
// Button precedent: rows are usually <a>, and hosts (WordPress themes, and
|
|
82
|
+
// Storybook's own preview.css) style bare `a` unlayered, which beats every
|
|
83
|
+
// layered rule regardless of specificity. Values still come from tokens.
|
|
84
|
+
//
|
|
85
|
+
// The group heading uses the overline text style, so --tui-text-overline-*
|
|
86
|
+
// and `.tui-text-style-overline` configure it like every other group label.
|
|
87
|
+
// ==========================================================================
|
|
88
|
+
|
|
89
|
+
// --_item-pad is set on the root and read by the heading and rows (each
|
|
90
|
+
// falls back to the same chain, so a Group used without the root still works).
|
|
91
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu {
|
|
92
|
+
--_item-pad: var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm));
|
|
93
|
+
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
gap: var(--#{sys.$prefix}nav-menu-group-gap, var(--#{sys.$prefix}spacing-md));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__group-label {
|
|
100
|
+
@include sys.text-style(sys.$prefix, overline);
|
|
101
|
+
margin: 0;
|
|
102
|
+
// Text lines up with the rows' label text, not their padding box.
|
|
103
|
+
padding-block: var(--#{sys.$prefix}spacing-xxs);
|
|
104
|
+
padding-inline: var(--_item-pad, var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm)));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__list,
|
|
108
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__sub {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: var(--#{sys.$prefix}nav-menu-item-gap, 2px);
|
|
112
|
+
margin: 0;
|
|
113
|
+
padding: 0;
|
|
114
|
+
list-style: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__entry {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Row. Full specificity on .tui-interface: it's a themed element (a, button),
|
|
122
|
+
// and host button/link styles must not win.
|
|
123
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item {
|
|
124
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg, var(--#{sys.$prefix}color-fg));
|
|
125
|
+
--_weight: var(--#{sys.$prefix}nav-menu-item-weight, var(--#{sys.$prefix}typography-weight-normal, 400));
|
|
126
|
+
--_bg: transparent;
|
|
127
|
+
--_indicator: var(--#{sys.$prefix}nav-menu-indicator-width, 0px);
|
|
128
|
+
|
|
129
|
+
position: relative;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
inline-size: 100%;
|
|
135
|
+
min-block-size: var(--#{sys.$prefix}nav-menu-item-height, var(--#{sys.$prefix}control-height-md, 2.5rem));
|
|
136
|
+
margin: 0;
|
|
137
|
+
padding-block: var(--#{sys.$prefix}spacing-xxs);
|
|
138
|
+
padding-inline: var(--_item-pad, var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm)));
|
|
139
|
+
border: 0;
|
|
140
|
+
border-radius: var(--#{sys.$prefix}nav-menu-item-radius, var(--#{sys.$prefix}radius-sm));
|
|
141
|
+
background: var(--_bg);
|
|
142
|
+
color: var(--_fg) !important;
|
|
143
|
+
font: inherit;
|
|
144
|
+
font-weight: var(--_weight) !important;
|
|
145
|
+
font-size: var(--#{sys.$prefix}nav-menu-item-font-size, var(--#{sys.$prefix}typography-size-md));
|
|
146
|
+
line-height: 1.4;
|
|
147
|
+
text-align: start;
|
|
148
|
+
text-decoration: none !important;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
--_bg: var(--#{sys.$prefix}nav-menu-item-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
|
|
154
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg-hover, var(--#{sys.$prefix}nav-menu-item-fg, var(--#{sys.$prefix}color-fg)));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Inset, so adjacent rows and the sidebar edge don't clip it.
|
|
158
|
+
&:focus-visible {
|
|
159
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
160
|
+
outline-offset: calc(-1 * var(--#{sys.$prefix}focus-ring-width));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// An ancestor of the current page (aria-current="true", or any value
|
|
164
|
+
// other than "page"): emphasis without the fill.
|
|
165
|
+
&[aria-current]:not([aria-current="page"]) {
|
|
166
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg-ancestor, var(--#{sys.$prefix}color-fg));
|
|
167
|
+
--_weight: var(--#{sys.$prefix}nav-menu-item-weight-ancestor, var(--#{sys.$prefix}typography-weight-semibold, 600));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// The current page. Fill + strong text + weight, so it never relies on
|
|
171
|
+
// colour alone. primary-strong measures 4.81:1 on primary-subtlest in dark.
|
|
172
|
+
&[aria-current="page"] {
|
|
173
|
+
--_bg: var(--#{sys.$prefix}nav-menu-item-bg-current, var(--#{sys.$prefix}theme-primary-subtlest));
|
|
174
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg-current, var(--#{sys.$prefix}theme-primary-strong));
|
|
175
|
+
--_weight: var(--#{sys.$prefix}nav-menu-item-weight-current, var(--#{sys.$prefix}typography-weight-semibold, 600));
|
|
176
|
+
|
|
177
|
+
// Opt-in leading bar. Zero-width (invisible) unless the token is set.
|
|
178
|
+
&::before {
|
|
179
|
+
content: "";
|
|
180
|
+
position: absolute;
|
|
181
|
+
inset-inline-start: 0;
|
|
182
|
+
inset-block: 25%;
|
|
183
|
+
inline-size: var(--_indicator);
|
|
184
|
+
border-start-end-radius: var(--#{sys.$prefix}radius-xs);
|
|
185
|
+
border-end-end-radius: var(--#{sys.$prefix}radius-xs);
|
|
186
|
+
background: var(--#{sys.$prefix}nav-menu-indicator-color, var(--#{sys.$prefix}theme-primary-base));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&[aria-disabled="true"] {
|
|
191
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg-disabled, var(--#{sys.$prefix}color-fg-muted));
|
|
192
|
+
--_bg: transparent;
|
|
193
|
+
cursor: default;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__icon {
|
|
198
|
+
display: inline-flex;
|
|
199
|
+
flex: none;
|
|
200
|
+
font-size: var(--#{sys.$prefix}nav-menu-icon-size, var(--#{sys.$prefix}icon-size-sm, 1rem));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__label {
|
|
204
|
+
flex: 1;
|
|
205
|
+
min-inline-size: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Nested items: indented under a guide line.
|
|
209
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__sub {
|
|
210
|
+
margin-block-start: var(--#{sys.$prefix}nav-menu-item-gap, 2px);
|
|
211
|
+
margin-inline-start: var(--#{sys.$prefix}nav-menu-sub-indent, var(--#{sys.$prefix}spacing-sm));
|
|
212
|
+
padding-inline-start: var(--#{sys.$prefix}spacing-xs);
|
|
213
|
+
border-inline-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}nav-menu-sub-border, var(--#{sys.$prefix}color-border));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ==========================================================================
|
|
217
|
+
// Horizontal bar
|
|
218
|
+
// ==========================================================================
|
|
219
|
+
// Bar rows carry .is-bar (set by the component on top-level rows only), so
|
|
220
|
+
// nothing below reaches the rows inside a flyout, which keep the vertical
|
|
221
|
+
// treatment.
|
|
222
|
+
|
|
223
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu.is-horizontal {
|
|
224
|
+
flex-direction: row;
|
|
225
|
+
flex-wrap: wrap;
|
|
226
|
+
align-items: center;
|
|
227
|
+
gap: var(--#{sys.$prefix}nav-menu-bar-gap, var(--#{sys.$prefix}spacing-xs));
|
|
228
|
+
|
|
229
|
+
// Wraps rather than overflowing (SC 1.4.10). The small-screen pattern is
|
|
230
|
+
// still to swap the bar for a Sidebar drawer; this keeps it from
|
|
231
|
+
// scrolling sideways meanwhile.
|
|
232
|
+
> .#{sys.$prefix}nav-menu__group > .#{sys.$prefix}nav-menu__list {
|
|
233
|
+
flex-direction: row;
|
|
234
|
+
flex-wrap: wrap;
|
|
235
|
+
align-items: center;
|
|
236
|
+
gap: var(--#{sys.$prefix}nav-menu-bar-gap, var(--#{sys.$prefix}spacing-xs));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__entry.has-flyout {
|
|
241
|
+
position: relative;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__entry.is-split {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item.is-bar {
|
|
250
|
+
inline-size: auto;
|
|
251
|
+
white-space: nowrap;
|
|
252
|
+
|
|
253
|
+
// Current page, or an ancestor of it (whose page is inside the flyout):
|
|
254
|
+
// strong text, weight and an underline. No fill by default.
|
|
255
|
+
&[aria-current] {
|
|
256
|
+
--_bg: var(--#{sys.$prefix}nav-menu-bar-bg-current, transparent);
|
|
257
|
+
--_fg: var(--#{sys.$prefix}nav-menu-item-fg-current, var(--#{sys.$prefix}theme-primary-strong));
|
|
258
|
+
--_weight: var(--#{sys.$prefix}nav-menu-item-weight-current, var(--#{sys.$prefix}typography-weight-semibold, 600));
|
|
259
|
+
|
|
260
|
+
// The vertical leading bar doesn't apply in a bar.
|
|
261
|
+
&::before { content: none; }
|
|
262
|
+
|
|
263
|
+
&::after {
|
|
264
|
+
content: "";
|
|
265
|
+
position: absolute;
|
|
266
|
+
inset-inline: var(--_item-pad, var(--#{sys.$prefix}nav-menu-item-padding-inline, var(--#{sys.$prefix}spacing-sm)));
|
|
267
|
+
inset-block-end: 0;
|
|
268
|
+
block-size: var(--#{sys.$prefix}nav-menu-underline-width, 2px);
|
|
269
|
+
border-radius: var(--#{sys.$prefix}radius-full, 9999px);
|
|
270
|
+
background: var(--#{sys.$prefix}nav-menu-underline-color, var(--#{sys.$prefix}theme-primary-base));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// The row-is-the-toggle chevron, and the separate toggle of a link parent.
|
|
276
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__chevron {
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
flex: none;
|
|
279
|
+
font-size: var(--#{sys.$prefix}nav-menu-icon-size, var(--#{sys.$prefix}icon-size-sm, 1rem));
|
|
280
|
+
transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
:where(.#{sys.$prefix}interface) [aria-expanded="true"] > .#{sys.$prefix}nav-menu__chevron {
|
|
284
|
+
transform: rotate(180deg);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__toggle {
|
|
288
|
+
display: inline-flex;
|
|
289
|
+
align-items: center;
|
|
290
|
+
justify-content: center;
|
|
291
|
+
box-sizing: border-box;
|
|
292
|
+
// At least the 24px target minimum (SC 2.5.8), as tall as the row.
|
|
293
|
+
min-inline-size: 1.5rem;
|
|
294
|
+
min-block-size: var(--#{sys.$prefix}nav-menu-item-height, var(--#{sys.$prefix}control-height-md, 2.5rem));
|
|
295
|
+
margin: 0;
|
|
296
|
+
padding-inline: var(--#{sys.$prefix}spacing-xxs);
|
|
297
|
+
border: 0;
|
|
298
|
+
border-radius: var(--#{sys.$prefix}nav-menu-item-radius, var(--#{sys.$prefix}radius-sm));
|
|
299
|
+
background: transparent;
|
|
300
|
+
color: var(--#{sys.$prefix}nav-menu-item-fg, var(--#{sys.$prefix}color-fg)) !important;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
|
|
303
|
+
&:hover {
|
|
304
|
+
background: var(--#{sys.$prefix}nav-menu-item-bg-hover, var(--#{sys.$prefix}color-fill-subtle));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&:focus-visible {
|
|
308
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
309
|
+
outline-offset: calc(-1 * var(--#{sys.$prefix}focus-ring-width));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ==========================================================================
|
|
314
|
+
// Flyout panel
|
|
315
|
+
// ==========================================================================
|
|
316
|
+
// Positioned by Floating UI (inline styles), not portaled, so the DOM and
|
|
317
|
+
// tab order run toggle -> panel. An elevated surface, so it owns its fg.
|
|
318
|
+
|
|
319
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__flyout {
|
|
320
|
+
z-index: var(--#{sys.$prefix}layer-overlay, 100);
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: column;
|
|
323
|
+
gap: var(--#{sys.$prefix}nav-menu-group-gap, var(--#{sys.$prefix}spacing-sm));
|
|
324
|
+
box-sizing: border-box;
|
|
325
|
+
min-inline-size: var(--#{sys.$prefix}nav-menu-flyout-min-width, 14rem);
|
|
326
|
+
padding: var(--#{sys.$prefix}spacing-xxs);
|
|
327
|
+
border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}nav-menu-flyout-border, var(--#{sys.$prefix}color-border));
|
|
328
|
+
border-radius: var(--#{sys.$prefix}nav-menu-flyout-radius, var(--#{sys.$prefix}radius-md));
|
|
329
|
+
background: var(--#{sys.$prefix}nav-menu-flyout-bg, var(--#{sys.$prefix}color-bg-elevated));
|
|
330
|
+
color: var(--#{sys.$prefix}nav-menu-flyout-fg, var(--#{sys.$prefix}color-fg));
|
|
331
|
+
box-shadow: var(--#{sys.$prefix}nav-menu-flyout-shadow, var(--#{sys.$prefix}shadow-dropdown));
|
|
332
|
+
|
|
333
|
+
// `display: flex` above would otherwise override the hidden attribute.
|
|
334
|
+
&[hidden] {
|
|
335
|
+
display: none;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// The Sub inside a flyout is the panel's content, not an indented branch.
|
|
339
|
+
> .#{sys.$prefix}nav-menu__sub {
|
|
340
|
+
margin: 0;
|
|
341
|
+
padding: 0;
|
|
342
|
+
border: 0;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.#{sys.$prefix}nav-menu__sub.has-groups {
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-direction: column;
|
|
348
|
+
gap: var(--#{sys.$prefix}nav-menu-group-gap, var(--#{sys.$prefix}spacing-sm));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@media (forced-colors: active) {
|
|
353
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item[aria-current="page"] {
|
|
354
|
+
outline: 2px solid Highlight;
|
|
355
|
+
outline-offset: -2px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// The bar's underline is a background, which forced colours strip; it's
|
|
359
|
+
// the only current cue for an ancestor, so keep it as Highlight.
|
|
360
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item.is-bar[aria-current]::after {
|
|
361
|
+
forced-color-adjust: none;
|
|
362
|
+
background: Highlight;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Expanded state had no cue but the chevron's rotation. Before the focus
|
|
366
|
+
// rule below, so focus still wins.
|
|
367
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item.is-toggle[aria-expanded="true"],
|
|
368
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__toggle[aria-expanded="true"] {
|
|
369
|
+
outline: 2px solid Highlight;
|
|
370
|
+
outline-offset: -2px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Focus must stay distinct from the current row's outline: thicker and
|
|
374
|
+
// outside the row. Without this, the two tie and the current-row rule
|
|
375
|
+
// wins on order, so focus vanished on the row users land on most (SC 2.4.7).
|
|
376
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item:focus-visible {
|
|
377
|
+
outline: 3px solid CanvasText;
|
|
378
|
+
outline-offset: 1px;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.#{sys.$prefix}interface .#{sys.$prefix}nav-menu__item[aria-disabled="true"] {
|
|
382
|
+
color: GrayText !important;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--tui-radio-accent
|
|
5
5
|
--tui-radio-size
|
|
6
6
|
--tui-radio-border
|
|
7
|
+
--tui-radio-border-hover
|
|
7
8
|
--tui-radio-border-invalid
|
|
8
9
|
--tui-radio-bg
|
|
9
10
|
--tui-radio-gap
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
// --tui-radio-accent Accent color for selected state
|
|
23
24
|
// --tui-radio-size Indicator size (falls back to 1.15em)
|
|
24
25
|
// --tui-radio-border Indicator border color (unchecked)
|
|
26
|
+
// --tui-radio-border-hover Hover border (opt-in; default: no change)
|
|
25
27
|
// --tui-radio-border-invalid Indicator border color when the group is invalid
|
|
26
28
|
// --tui-radio-bg Indicator background color
|
|
27
29
|
// --tui-radio-gap Gap between indicator and label
|
|
@@ -62,7 +64,9 @@
|
|
|
62
64
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}radio {
|
|
63
65
|
// Internal tokens
|
|
64
66
|
--_accent: var(--#{sys.$prefix}radio-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
|
|
65
|
-
--_border: var(--#{sys.$prefix}radio-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
|
|
67
|
+
--_border: var(--#{sys.$prefix}radio-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
|
|
68
|
+
// No hover change unless a consumer opts in (house rule for form controls).
|
|
69
|
+
--_border-hover: var(--#{sys.$prefix}radio-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border)));
|
|
66
70
|
--_bg: var(--#{sys.$prefix}radio-bg, var(--#{sys.$prefix}color-bg));
|
|
67
71
|
--_size: var(--#{sys.$prefix}radio-size, 1.15em);
|
|
68
72
|
--_gap: var(--#{sys.$prefix}radio-gap, var(--#{sys.$prefix}spacing-xs));
|
|
@@ -102,8 +106,12 @@
|
|
|
102
106
|
cursor: pointer;
|
|
103
107
|
appearance: none;
|
|
104
108
|
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
// Opt-in hover, resting border by default. It skips the checked item, which
|
|
110
|
+
// keeps its accent border. The :not sits in :where() so this rule's
|
|
111
|
+
// specificity is unchanged: the invalid rule below is written to out-weigh
|
|
112
|
+
// it.
|
|
113
|
+
&:hover:not(:disabled):not([aria-disabled="true"]):where(:not([aria-checked="true"])) .#{sys.$prefix}radio__indicator {
|
|
114
|
+
border-color: var(--_border-hover);
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
// Focus ring delegated to indicator — intentional (tightly wraps circle
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--tui-search-select-trigger-bg
|
|
5
5
|
--tui-search-select-trigger-fg
|
|
6
6
|
--tui-search-select-trigger-border
|
|
7
|
+
--tui-search-select-trigger-border-hover
|
|
7
8
|
--tui-search-select-trigger-border-focus
|
|
8
9
|
--tui-search-select-trigger-radius
|
|
9
10
|
--tui-search-select-panel-bg
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
// Component API tokens (never defined here, only read via fallback — the
|
|
35
36
|
// fallback chain runs through Select's tokens so context remaps of the
|
|
36
37
|
// select family carry over automatically):
|
|
37
|
-
// --tui-search-select-trigger-bg / -fg / -border / -border-focus / -radius
|
|
38
|
+
// --tui-search-select-trigger-bg / -fg / -border / -border-hover / -border-focus / -radius
|
|
38
39
|
// --tui-search-select-panel-bg / -fg / -border / -shadow / -radius
|
|
39
40
|
// --tui-search-select-panel-width Panel inline-size (default: reference
|
|
40
41
|
// width via the floating min-width)
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
// triggers still carries SearchSelect with it.
|
|
62
63
|
--_bg: var(--#{sys.$prefix}search-select-trigger-bg, var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface))));
|
|
63
64
|
--_fg: var(--#{sys.$prefix}search-select-trigger-fg, var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg))));
|
|
64
|
-
--_border: var(--#{sys.$prefix}search-select-trigger-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border))));
|
|
65
|
+
--_border-rest: var(--#{sys.$prefix}search-select-trigger-border, var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control))));
|
|
66
|
+
--_border-hover: var(--#{sys.$prefix}search-select-trigger-border-hover, var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest))));
|
|
65
67
|
--_border-focus: var(--#{sys.$prefix}search-select-trigger-border-focus, var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base))));
|
|
66
68
|
--_radius: var(--#{sys.$prefix}search-select-trigger-radius, var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md))));
|
|
67
69
|
|
|
@@ -240,11 +242,9 @@
|
|
|
240
242
|
|
|
241
243
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}search-select__label {
|
|
242
244
|
padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
text-transform: uppercase;
|
|
247
|
-
letter-spacing: sys.$label-letter-spacing;
|
|
245
|
+
// The overline text style. The mixin keeps static markup styled; the
|
|
246
|
+
// component also renders .tui-text-style-overline as the override hook.
|
|
247
|
+
@include sys.text-style(sys.$prefix, overline);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// High-contrast mode: keep highlighted/selected legible
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
--tui-select-trigger-bg
|
|
6
6
|
--tui-select-trigger-fg
|
|
7
7
|
--tui-select-trigger-border
|
|
8
|
+
--tui-select-trigger-border-hover
|
|
8
9
|
--tui-select-trigger-border-focus
|
|
9
10
|
--tui-select-trigger-radius
|
|
10
11
|
--tui-select-content-bg
|
|
@@ -48,6 +49,7 @@ $_min-width: 160px;
|
|
|
48
49
|
// --tui-select-trigger-bg
|
|
49
50
|
// --tui-select-trigger-fg
|
|
50
51
|
// --tui-select-trigger-border
|
|
52
|
+
// --tui-select-trigger-border-hover
|
|
51
53
|
// --tui-select-trigger-border-focus
|
|
52
54
|
// --tui-select-trigger-radius
|
|
53
55
|
//
|
|
@@ -94,7 +96,8 @@ $_min-width: 160px;
|
|
|
94
96
|
// wins, and the shared --tui-input-* default moves in underneath it.
|
|
95
97
|
--_bg: var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface)));
|
|
96
98
|
--_fg: var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg)));
|
|
97
|
-
--_border: var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border)));
|
|
99
|
+
--_border-rest: var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control)));
|
|
100
|
+
--_border-hover: var(--#{sys.$prefix}select-trigger-border-hover, var(--#{sys.$prefix}input-border-hover, var(--_border-rest)));
|
|
98
101
|
--_border-focus: var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base)));
|
|
99
102
|
--_radius: var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)));
|
|
100
103
|
--_min-width: var(--#{sys.$prefix}select-min-width, #{$_min-width});
|
|
@@ -341,11 +344,9 @@ $_min-width: 160px;
|
|
|
341
344
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__label {
|
|
342
345
|
padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
|
|
343
346
|
padding-bottom: var(--#{sys.$prefix}spacing-xxs);
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
text-transform: uppercase;
|
|
348
|
-
letter-spacing: sys.$label-letter-spacing;
|
|
347
|
+
// The overline text style. The mixin keeps static markup styled; the
|
|
348
|
+
// component also renders .tui-text-style-overline as the override hook.
|
|
349
|
+
@include sys.text-style(sys.$prefix, overline);
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
// ---------------------------------------------------------------------------
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}slider {
|
|
39
39
|
--_track-height: var(--#{sys.$prefix}slider-track-height, 4px);
|
|
40
|
-
--_track-bg: var(--#{sys.$prefix}slider-track-bg, var(--#{sys.$prefix}color-
|
|
40
|
+
--_track-bg: var(--#{sys.$prefix}slider-track-bg, var(--#{sys.$prefix}color-border-control));
|
|
41
41
|
--_fill: var(--#{sys.$prefix}slider-fill, var(--#{sys.$prefix}theme-primary-base));
|
|
42
42
|
--_gap: var(--#{sys.$prefix}slider-gap, var(--#{sys.$prefix}spacing-xxs));
|
|
43
43
|
--_segment-radius: var(--#{sys.$prefix}slider-segment-radius, var(--#{sys.$prefix}radius-full));
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}switch__track {
|
|
88
88
|
// Internal tokens
|
|
89
89
|
--_accent: var(--#{sys.$prefix}switch-accent, var(--#{sys.$prefix}input-accent, var(--#{sys.$prefix}theme-primary-base)));
|
|
90
|
-
--_bg: var(--#{sys.$prefix}switch-bg, var(--#{sys.$prefix}color-
|
|
90
|
+
--_bg: var(--#{sys.$prefix}switch-bg, var(--#{sys.$prefix}color-border-control));
|
|
91
91
|
--_border: var(--#{sys.$prefix}switch-border, var(--_bg));
|
|
92
92
|
--_thumb-bg: var(--#{sys.$prefix}switch-thumb-bg, var(--#{sys.$prefix}color-bg));
|
|
93
93
|
--_track-height: var(--#{sys.$prefix}switch-track-height, #{$_track-height});
|
|
@@ -24,7 +24,14 @@
|
|
|
24
24
|
--_gap: var(--#{sys.$prefix}input-group-gap, var(--#{sys.$prefix}spacing-xs));
|
|
25
25
|
--_bg: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
26
26
|
--_fg: var(--#{sys.$prefix}input-fg, var(--#{sys.$prefix}color-fg));
|
|
27
|
-
|
|
27
|
+
// Resting border, named so hover can fall back to it: a custom property
|
|
28
|
+
// can't reference its own earlier value. Hosts set --_border-rest, not
|
|
29
|
+
// --_border.
|
|
30
|
+
--_border-rest: var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border-control));
|
|
31
|
+
// No hover change by default (house rule for form controls). Consumers
|
|
32
|
+
// opt in with --tui-input-border-hover, and hosts expose their own.
|
|
33
|
+
--_border-hover: var(--#{sys.$prefix}input-border-hover, var(--_border-rest));
|
|
34
|
+
--_border: var(--_border-rest);
|
|
28
35
|
--_border-focus: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
|
|
29
36
|
--_radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
|
|
30
37
|
|
|
@@ -103,6 +110,13 @@
|
|
|
103
110
|
// trade-off (over-application, not under-application, so WCAG 2.4.11 is met).
|
|
104
111
|
// On a <button> host :focus-within is simply :focus, which is what the select
|
|
105
112
|
// family wants anyway: native selects ring on mouse focus too.
|
|
113
|
+
// Hover sits FIRST among the border states, so focus, open and invalid all
|
|
114
|
+
// out-order it at equal specificity. Its default is the resting border, so
|
|
115
|
+
// nothing changes unless a consumer sets --tui-input-border-hover.
|
|
116
|
+
.#{sys.$prefix}interface .#{sys.$prefix}input-group:hover {
|
|
117
|
+
--_border: var(--_border-hover);
|
|
118
|
+
}
|
|
119
|
+
|
|
106
120
|
.#{sys.$prefix}interface .#{sys.$prefix}input-group:focus-within {
|
|
107
121
|
--_border: var(--_border-focus);
|
|
108
122
|
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|