@tangible/ui 0.2.22 → 0.2.24
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 +26 -0
- package/components/NavMenu/NavMenu.js +113 -0
- package/components/NavMenu/index.d.ts +2 -0
- package/components/NavMenu/index.js +1 -0
- package/components/NavMenu/types.d.ts +75 -0
- package/components/NavMenu/types.js +4 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/figma-tokens.json +94 -5
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +24 -10
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +604 -125
- package/styles/all.expanded.unlayered.css +604 -125
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/accordion.scss +5 -0
- package/styles/components/button.scss +13 -9
- package/styles/components/card.scss +14 -0
- package/styles/components/checkbox.scss +13 -2
- package/styles/components/color-picker.scss +13 -4
- package/styles/components/combobox.scss +42 -16
- package/styles/components/date-picker.scss +9 -6
- package/styles/components/dropdown.scss +30 -13
- package/styles/components/gradient-picker.scss +4 -5
- package/styles/components/input/index.scss +16 -6
- package/styles/components/multi-combobox.scss +32 -17
- package/styles/components/multi-select.scss +41 -16
- package/styles/components/nav-menu.scss +212 -0
- package/styles/components/radio.scss +11 -3
- package/styles/components/search-select.scss +53 -17
- package/styles/components/segmented-control.scss +6 -0
- package/styles/components/select.scss +42 -16
- package/styles/components/sidebar.scss +4 -0
- package/styles/components/slider.scss +1 -1
- package/styles/components/switch.scss +1 -1
- package/styles/components/table.scss +8 -1
- package/styles/components/tabs.scss +4 -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 +9 -2
- package/styles/system/index.scss +3 -1
- package/tui-manifest.json +130 -6
- package/utils/listbox/group.js +3 -1
- package/utils/portal.js +34 -5
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:meta";
|
|
3
|
+
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Text styles
|
|
6
|
+
// =============================================================================
|
|
7
|
+
//
|
|
8
|
+
// Named typographic treatments, applied by class: `.tui-text-style-{name}`.
|
|
9
|
+
// Every element using a style renders that one class, so a consumer can
|
|
10
|
+
// restyle (or opt out of) a treatment everywhere with one selector:
|
|
11
|
+
//
|
|
12
|
+
// .tui-text-style-overline { text-transform: none; }
|
|
13
|
+
//
|
|
14
|
+
// Every property is also a knob. Knobs are never declared, only read with
|
|
15
|
+
// fallbacks (like component API tokens), so they can be set anywhere,
|
|
16
|
+
// including :root, and nothing is added to .tui-interface:
|
|
17
|
+
//
|
|
18
|
+
// --tui-text-{style}-{family,size,weight,line-height,tracking,transform,color}
|
|
19
|
+
//
|
|
20
|
+
// Leveled collections (display, headline) also read a collection-wide knob,
|
|
21
|
+
// so one line retunes every level:
|
|
22
|
+
//
|
|
23
|
+
// --tui-text-headline-weight: 700; all six headline levels
|
|
24
|
+
// --tui-text-headline-04-weight: 600; just level 04
|
|
25
|
+
//
|
|
26
|
+
// Colour defaults to `inherit` except for the muted treatments (caption,
|
|
27
|
+
// overline), because .tui-interface deliberately inherits the host's text
|
|
28
|
+
// colour in light mode.
|
|
29
|
+
// =============================================================================
|
|
30
|
+
|
|
31
|
+
// Font stacks. Read through knobs at use sites; never declared.
|
|
32
|
+
$font-stack-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default;
|
|
33
|
+
$font-stack-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !default;
|
|
34
|
+
|
|
35
|
+
// Single styles: name → property defaults.
|
|
36
|
+
// Values are raw CSS. A string starting with "@" names a layer-1 primitive
|
|
37
|
+
// (defined on .tui-interface) and resolves to var(--{prefix}{name}).
|
|
38
|
+
$text-styles: (
|
|
39
|
+
body: (
|
|
40
|
+
size: "@typography-size-md",
|
|
41
|
+
weight: 400,
|
|
42
|
+
line-height: 1.5,
|
|
43
|
+
),
|
|
44
|
+
body-sm: (
|
|
45
|
+
size: "@typography-size-sm",
|
|
46
|
+
weight: 400,
|
|
47
|
+
line-height: 1.45,
|
|
48
|
+
),
|
|
49
|
+
// Form labels. Matches the existing `label, .tui-label` treatment.
|
|
50
|
+
label: (
|
|
51
|
+
size: "@typography-size-sm",
|
|
52
|
+
weight: 700,
|
|
53
|
+
line-height: 1.4,
|
|
54
|
+
color: "@color-fg",
|
|
55
|
+
),
|
|
56
|
+
caption: (
|
|
57
|
+
size: "@typography-size-xs",
|
|
58
|
+
weight: 400,
|
|
59
|
+
line-height: 1.4,
|
|
60
|
+
color: "@color-fg-muted",
|
|
61
|
+
),
|
|
62
|
+
// The small uppercase group label: listbox and menu group labels, the
|
|
63
|
+
// Dropdown header, picker field labels, nav group headings.
|
|
64
|
+
overline: (
|
|
65
|
+
size: "@typography-size-xs",
|
|
66
|
+
weight: 600,
|
|
67
|
+
line-height: 1.4,
|
|
68
|
+
tracking: 0.05em,
|
|
69
|
+
transform: uppercase,
|
|
70
|
+
color: "@color-fg-muted",
|
|
71
|
+
),
|
|
72
|
+
) !default;
|
|
73
|
+
|
|
74
|
+
// Leveled collections: shared defaults + per-level overrides. Level 01 is the
|
|
75
|
+
// largest. A level value may be a bare size or a map of overrides.
|
|
76
|
+
$text-collections: (
|
|
77
|
+
display: (
|
|
78
|
+
shared: (weight: 700, line-height: 1.15, tracking: -0.01em),
|
|
79
|
+
levels: (
|
|
80
|
+
01: 4.5rem,
|
|
81
|
+
02: 3.75rem,
|
|
82
|
+
03: 3rem,
|
|
83
|
+
04: 2.5rem,
|
|
84
|
+
),
|
|
85
|
+
),
|
|
86
|
+
headline: (
|
|
87
|
+
shared: (weight: 600, line-height: 1.25),
|
|
88
|
+
levels: (
|
|
89
|
+
01: 2.25rem,
|
|
90
|
+
02: 2rem,
|
|
91
|
+
03: 1.75rem,
|
|
92
|
+
04: (size: 1.5rem, weight: 500, line-height: 1.3),
|
|
93
|
+
05: (size: 1.25rem, weight: 500, line-height: 1.35),
|
|
94
|
+
06: (size: 1.125rem, weight: 500, line-height: 1.4),
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
) !default;
|
|
98
|
+
|
|
99
|
+
$-props: (
|
|
100
|
+
family: font-family,
|
|
101
|
+
size: font-size,
|
|
102
|
+
weight: font-weight,
|
|
103
|
+
line-height: line-height,
|
|
104
|
+
tracking: letter-spacing,
|
|
105
|
+
transform: text-transform,
|
|
106
|
+
color: color,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
$-fallbacks: (
|
|
110
|
+
family: inherit,
|
|
111
|
+
tracking: normal,
|
|
112
|
+
transform: none,
|
|
113
|
+
color: inherit,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
@function -resolve($prefix, $value) {
|
|
117
|
+
@if meta.type-of($value) == string and str-slice($value, 1, 1) == "@" {
|
|
118
|
+
@return var(--#{$prefix}#{str-slice($value, 2)});
|
|
119
|
+
}
|
|
120
|
+
@return $value;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@function -pad($n) {
|
|
124
|
+
@return if($n < 10, "0#{$n}", "#{$n}");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Declarations for one style. $chain is the knob prefixes to try, most
|
|
128
|
+
// specific first (e.g. headline-04, then headline).
|
|
129
|
+
@mixin -declarations($prefix, $chain, $values) {
|
|
130
|
+
@each $key, $prop in $-props {
|
|
131
|
+
$default: map.get($values, $key);
|
|
132
|
+
@if $default == null { $default: map.get($-fallbacks, $key); }
|
|
133
|
+
@if $default != null {
|
|
134
|
+
$value: -resolve($prefix, $default);
|
|
135
|
+
// Size is per level: a collection-wide size would flatten the scale.
|
|
136
|
+
$depth: if($key == size, 1, length($chain));
|
|
137
|
+
@for $i from $depth through 1 {
|
|
138
|
+
$value: var(--#{$prefix}text-#{nth($chain, $i)}-#{$key}, #{$value});
|
|
139
|
+
}
|
|
140
|
+
#{$prop}: $value;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// One style's declarations, for component rules. Components use this AND
|
|
146
|
+
// render the class: the mixin keeps static (CSS-only, PHP-rendered) markup
|
|
147
|
+
// styled without the class, the class gives consumers one selector to
|
|
148
|
+
// override every use. Both read the same knobs.
|
|
149
|
+
//
|
|
150
|
+
// @include sys.text-style(sys.$prefix, overline);
|
|
151
|
+
// @include sys.text-style(sys.$prefix, headline, 4);
|
|
152
|
+
@mixin text-style($prefix, $name, $level: null) {
|
|
153
|
+
@if $level == null {
|
|
154
|
+
$values: map.get($text-styles, $name);
|
|
155
|
+
@if $values == null { @error "Unknown text style `#{$name}`."; }
|
|
156
|
+
@include -declarations($prefix, ($name,), $values);
|
|
157
|
+
} @else {
|
|
158
|
+
$collection: map.get($text-collections, $name);
|
|
159
|
+
@if $collection == null { @error "Unknown text collection `#{$name}`."; }
|
|
160
|
+
$spec: map.get(map.get($collection, levels), $level);
|
|
161
|
+
@if $spec == null { @error "Unknown level `#{$level}` for `#{$name}`."; }
|
|
162
|
+
$own: if(meta.type-of($spec) == map, $spec, (size: $spec));
|
|
163
|
+
@include -declarations($prefix, ("#{$name}-#{-pad($level)}", $name), map.merge(map.get($collection, shared), $own));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Emits every `.tui-text-style-*` class. Called inside the defaults layer, so
|
|
168
|
+
// component rules and utilities both win over it.
|
|
169
|
+
@mixin emit-text-styles($prefix) {
|
|
170
|
+
@each $name, $values in $text-styles {
|
|
171
|
+
:where(.#{$prefix}interface) .#{$prefix}text-style-#{$name} {
|
|
172
|
+
@include -declarations($prefix, ($name,), $values);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@each $name, $collection in $text-collections {
|
|
177
|
+
$shared: map.get($collection, shared);
|
|
178
|
+
@each $level, $spec in map.get($collection, levels) {
|
|
179
|
+
$id: "#{$name}-#{-pad($level)}";
|
|
180
|
+
$own: if(meta.type-of($spec) == map, $spec, (size: $spec));
|
|
181
|
+
:where(.#{$prefix}interface) .#{$prefix}text-style-#{$id} {
|
|
182
|
+
@include -declarations($prefix, ($id, $name), map.merge($shared, $own));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Opt-in font family utilities: the only way the knobs below take effect,
|
|
189
|
+
// since the knobs themselves are never declared.
|
|
190
|
+
@mixin emit-font-utilities($prefix) {
|
|
191
|
+
:where(.#{$prefix}interface).#{$prefix}font-sans,
|
|
192
|
+
:where(.#{$prefix}interface) .#{$prefix}font-sans {
|
|
193
|
+
font-family: var(--#{$prefix}font-family-sans, #{$font-stack-sans});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:where(.#{$prefix}interface).#{$prefix}font-mono,
|
|
197
|
+
:where(.#{$prefix}interface) .#{$prefix}font-mono {
|
|
198
|
+
font-family: var(--#{$prefix}font-family-mono, #{$font-stack-mono});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -87,6 +87,11 @@ $brand: 'blue';
|
|
|
87
87
|
|
|
88
88
|
/* Neutral: borders/dividers */
|
|
89
89
|
--#{$prefix}color-border: #{pf.tone($neutral, 300)};
|
|
90
|
+
/* Control boundaries — the border (or off-state fill) that identifies a
|
|
91
|
+
form control. WCAG 1.4.11 wants 3:1 against everything it sits on and
|
|
92
|
+
against the control's own fill. color-border is decorative and can't
|
|
93
|
+
carry that. 450 clears 3.16:1 against white, surface (25) and muted (100). */
|
|
94
|
+
--#{$prefix}color-border-control: #{pf.tone($neutral, 450)};
|
|
90
95
|
--#{$prefix}color-divider: #{pf.tone($neutral, 200)};
|
|
91
96
|
|
|
92
97
|
/* Neutral: control fills — hover washes, quiet fills, off-state tracks.
|
|
@@ -259,11 +264,13 @@ $generative-interact-shift: 0.05 !default; // hover/active darkens by this
|
|
|
259
264
|
|
|
260
265
|
/* Borders */
|
|
261
266
|
--#{$prefix}color-border: #{pf.tone($neutral, 750)};
|
|
267
|
+
/* 3.64:1+ against surface 975, faces 950 and elevated/muted 900. */
|
|
268
|
+
--#{$prefix}color-border-control: #{pf.tone($neutral, 500)};
|
|
262
269
|
--#{$prefix}color-divider: #{pf.tone($neutral, 800)};
|
|
263
270
|
|
|
264
271
|
/* Control fills */
|
|
265
|
-
--#{$prefix}color-fill-subtle: #{pf.tone($neutral,
|
|
266
|
-
--#{$prefix}color-fill: #{pf.tone($neutral,
|
|
272
|
+
--#{$prefix}color-fill-subtle: #{pf.tone($neutral, 800)};
|
|
273
|
+
--#{$prefix}color-fill: #{pf.tone($neutral, 750)};
|
|
267
274
|
--#{$prefix}color-fill-strong: #{pf.tone($neutral, 600)};
|
|
268
275
|
|
|
269
276
|
/* Input chrome */
|
package/styles/system/index.scss
CHANGED
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"generated": "2026-10-
|
|
2
|
+
"version": "0.2.24",
|
|
3
|
+
"generated": "2026-10-02T03:57:30.563Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"cssTokens": [
|
|
33
33
|
"--tui-accordion-bg",
|
|
34
34
|
"--tui-accordion-bg-open",
|
|
35
|
+
"--tui-accordion-fg",
|
|
35
36
|
"--tui-accordion-border",
|
|
36
37
|
"--tui-accordion-divider",
|
|
37
38
|
"--tui-accordion-radius",
|
|
@@ -459,6 +460,7 @@
|
|
|
459
460
|
},
|
|
460
461
|
"cssTokens": [
|
|
461
462
|
"--tui-card-bg",
|
|
463
|
+
"--tui-card-fg",
|
|
462
464
|
"--tui-card-bg-interact",
|
|
463
465
|
"--tui-card-border",
|
|
464
466
|
"--tui-card-border-width",
|
|
@@ -563,6 +565,7 @@
|
|
|
563
565
|
"cssTokens": [
|
|
564
566
|
"--tui-checkbox-accent",
|
|
565
567
|
"--tui-checkbox-border",
|
|
568
|
+
"--tui-checkbox-border-hover",
|
|
566
569
|
"--tui-checkbox-border-invalid",
|
|
567
570
|
"--tui-checkbox-radius",
|
|
568
571
|
"--tui-checkbox-bg",
|
|
@@ -1001,15 +1004,21 @@
|
|
|
1001
1004
|
"--tui-combobox-input-bg",
|
|
1002
1005
|
"--tui-combobox-input-fg",
|
|
1003
1006
|
"--tui-combobox-input-border",
|
|
1007
|
+
"--tui-combobox-input-border-hover",
|
|
1004
1008
|
"--tui-combobox-input-border-focus",
|
|
1005
1009
|
"--tui-combobox-input-radius",
|
|
1006
1010
|
"--tui-combobox-content-bg",
|
|
1011
|
+
"--tui-combobox-content-fg",
|
|
1007
1012
|
"--tui-combobox-content-border",
|
|
1008
1013
|
"--tui-combobox-content-shadow",
|
|
1009
1014
|
"--tui-combobox-content-radius",
|
|
1010
1015
|
"--tui-combobox-option-radius",
|
|
1011
1016
|
"--tui-combobox-option-bg-hover",
|
|
1012
1017
|
"--tui-combobox-option-bg-selected",
|
|
1018
|
+
"--tui-combobox-option-fg-hover",
|
|
1019
|
+
"--tui-combobox-option-fg-selected",
|
|
1020
|
+
"--tui-combobox-option-bg-selected-hover",
|
|
1021
|
+
"--tui-combobox-option-check",
|
|
1013
1022
|
"--tui-combobox-option-gap"
|
|
1014
1023
|
],
|
|
1015
1024
|
"story": {
|
|
@@ -1175,7 +1184,8 @@
|
|
|
1175
1184
|
"--tui-table-bg-head",
|
|
1176
1185
|
"--tui-table-fg",
|
|
1177
1186
|
"--tui-table-padding",
|
|
1178
|
-
"--tui-table-selected-bg"
|
|
1187
|
+
"--tui-table-selected-bg",
|
|
1188
|
+
"--tui-table-selected-fg"
|
|
1179
1189
|
],
|
|
1180
1190
|
"story": {
|
|
1181
1191
|
"title": "Components/DataTable",
|
|
@@ -1307,7 +1317,10 @@
|
|
|
1307
1317
|
"--tui-dropdown-z",
|
|
1308
1318
|
"--tui-dropdown-min-width",
|
|
1309
1319
|
"--tui-dropdown-item-bg-hover",
|
|
1310
|
-
"--tui-dropdown-item-bg-active"
|
|
1320
|
+
"--tui-dropdown-item-bg-active",
|
|
1321
|
+
"--tui-dropdown-item-fg",
|
|
1322
|
+
"--tui-dropdown-item-fg-hover",
|
|
1323
|
+
"--tui-dropdown-item-fg-active"
|
|
1311
1324
|
],
|
|
1312
1325
|
"story": {
|
|
1313
1326
|
"title": "Overlays/Dropdown",
|
|
@@ -1898,15 +1911,21 @@
|
|
|
1898
1911
|
"--tui-multicombobox-control-bg Token-field background",
|
|
1899
1912
|
"--tui-multicombobox-control-fg Text / icon colour in the control",
|
|
1900
1913
|
"--tui-multicombobox-control-border Control border colour (rest)",
|
|
1914
|
+
"--tui-multicombobox-control-border-hover Control border colour (hover; opt-in, default: no change)",
|
|
1901
1915
|
"--tui-multicombobox-control-border-focus Control border colour (focus / open)",
|
|
1902
1916
|
"--tui-multicombobox-control-radius Control border radius",
|
|
1903
1917
|
"--tui-multicombobox-content-bg Listbox background",
|
|
1918
|
+
"--tui-multicombobox-content-fg Listbox text colour",
|
|
1904
1919
|
"--tui-multicombobox-content-border Listbox border colour",
|
|
1905
1920
|
"--tui-multicombobox-content-shadow Listbox drop shadow",
|
|
1906
1921
|
"--tui-multicombobox-content-radius Listbox border radius",
|
|
1907
1922
|
"--tui-multicombobox-option-radius Option corner radius",
|
|
1908
1923
|
"--tui-multicombobox-option-bg-hover Option background (hover / highlighted)",
|
|
1909
1924
|
"--tui-multicombobox-option-bg-selected Option background (selected)",
|
|
1925
|
+
"--tui-multicombobox-option-fg-hover",
|
|
1926
|
+
"--tui-multicombobox-option-fg-selected",
|
|
1927
|
+
"--tui-multicombobox-option-bg-selected-hover",
|
|
1928
|
+
"--tui-multicombobox-option-check",
|
|
1910
1929
|
"--tui-multicombobox-option-gap Vertical gap between options"
|
|
1911
1930
|
],
|
|
1912
1931
|
"story": {
|
|
@@ -1993,15 +2012,20 @@
|
|
|
1993
2012
|
"--tui-multiselect-trigger-bg",
|
|
1994
2013
|
"--tui-multiselect-trigger-fg",
|
|
1995
2014
|
"--tui-multiselect-trigger-border",
|
|
2015
|
+
"--tui-multiselect-trigger-border-hover",
|
|
1996
2016
|
"--tui-multiselect-trigger-border-focus",
|
|
1997
2017
|
"--tui-multiselect-trigger-radius",
|
|
1998
2018
|
"--tui-multiselect-content-bg",
|
|
2019
|
+
"--tui-multiselect-content-fg",
|
|
1999
2020
|
"--tui-multiselect-content-border",
|
|
2000
2021
|
"--tui-multiselect-content-shadow",
|
|
2001
2022
|
"--tui-multiselect-content-radius",
|
|
2002
2023
|
"--tui-multiselect-option-radius",
|
|
2003
2024
|
"--tui-multiselect-option-bg-hover",
|
|
2004
2025
|
"--tui-multiselect-option-bg-selected",
|
|
2026
|
+
"--tui-multiselect-option-fg-hover",
|
|
2027
|
+
"--tui-multiselect-option-fg-selected",
|
|
2028
|
+
"--tui-multiselect-option-bg-selected-hover",
|
|
2005
2029
|
"--tui-multiselect-option-gap",
|
|
2006
2030
|
"--tui-multiselect-chip-bg",
|
|
2007
2031
|
"--tui-multiselect-chip-fg"
|
|
@@ -2022,6 +2046,79 @@
|
|
|
2022
2046
|
"use": null,
|
|
2023
2047
|
"notFor": null
|
|
2024
2048
|
},
|
|
2049
|
+
"NavMenu": {
|
|
2050
|
+
"props": {
|
|
2051
|
+
"style": {
|
|
2052
|
+
"type": "CSSProperties",
|
|
2053
|
+
"required": false
|
|
2054
|
+
},
|
|
2055
|
+
"title": {
|
|
2056
|
+
"type": "string",
|
|
2057
|
+
"required": false
|
|
2058
|
+
},
|
|
2059
|
+
"className": {
|
|
2060
|
+
"type": "string",
|
|
2061
|
+
"required": false
|
|
2062
|
+
},
|
|
2063
|
+
"id": {
|
|
2064
|
+
"type": "string",
|
|
2065
|
+
"required": false
|
|
2066
|
+
},
|
|
2067
|
+
"role": {
|
|
2068
|
+
"type": "AriaRole",
|
|
2069
|
+
"required": false
|
|
2070
|
+
},
|
|
2071
|
+
"rel": {
|
|
2072
|
+
"type": "string",
|
|
2073
|
+
"required": false
|
|
2074
|
+
},
|
|
2075
|
+
"onChange": {
|
|
2076
|
+
"type": "FormEventHandler<HTMLDivElement>",
|
|
2077
|
+
"required": false
|
|
2078
|
+
},
|
|
2079
|
+
"onClick": {
|
|
2080
|
+
"type": "MouseEventHandler<HTMLDivElement>",
|
|
2081
|
+
"required": false
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
"cssTokens": [
|
|
2085
|
+
"--tui-nav-menu-group-gap",
|
|
2086
|
+
"--tui-nav-menu-item-gap",
|
|
2087
|
+
"--tui-nav-menu-item-height",
|
|
2088
|
+
"--tui-nav-menu-item-padding-inline",
|
|
2089
|
+
"--tui-nav-menu-item-radius",
|
|
2090
|
+
"--tui-nav-menu-item-font-size",
|
|
2091
|
+
"--tui-nav-menu-item-fg",
|
|
2092
|
+
"--tui-nav-menu-item-weight",
|
|
2093
|
+
"--tui-nav-menu-item-bg-hover",
|
|
2094
|
+
"--tui-nav-menu-item-fg-hover",
|
|
2095
|
+
"--tui-nav-menu-item-bg-current",
|
|
2096
|
+
"--tui-nav-menu-item-fg-current",
|
|
2097
|
+
"--tui-nav-menu-item-weight-current",
|
|
2098
|
+
"--tui-nav-menu-item-fg-ancestor",
|
|
2099
|
+
"--tui-nav-menu-item-weight-ancestor",
|
|
2100
|
+
"--tui-nav-menu-item-fg-disabled",
|
|
2101
|
+
"--tui-nav-menu-icon-size",
|
|
2102
|
+
"--tui-nav-menu-indicator-width",
|
|
2103
|
+
"--tui-nav-menu-indicator-color",
|
|
2104
|
+
"--tui-nav-menu-sub-indent",
|
|
2105
|
+
"--tui-nav-menu-sub-border"
|
|
2106
|
+
],
|
|
2107
|
+
"story": {
|
|
2108
|
+
"title": "Components/NavMenu",
|
|
2109
|
+
"tags": [
|
|
2110
|
+
"autodocs",
|
|
2111
|
+
"stable"
|
|
2112
|
+
]
|
|
2113
|
+
},
|
|
2114
|
+
"subcomponents": null,
|
|
2115
|
+
"description": null,
|
|
2116
|
+
"gotchas": null,
|
|
2117
|
+
"examples": null,
|
|
2118
|
+
"related": null,
|
|
2119
|
+
"use": null,
|
|
2120
|
+
"notFor": null
|
|
2121
|
+
},
|
|
2025
2122
|
"Notice": {
|
|
2026
2123
|
"props": {
|
|
2027
2124
|
"inline": {
|
|
@@ -2559,6 +2656,7 @@
|
|
|
2559
2656
|
"--tui-radio-accent",
|
|
2560
2657
|
"--tui-radio-size",
|
|
2561
2658
|
"--tui-radio-border",
|
|
2659
|
+
"--tui-radio-border-hover",
|
|
2562
2660
|
"--tui-radio-border-invalid",
|
|
2563
2661
|
"--tui-radio-bg",
|
|
2564
2662
|
"--tui-radio-gap",
|
|
@@ -2814,15 +2912,21 @@
|
|
|
2814
2912
|
"--tui-search-select-trigger-bg",
|
|
2815
2913
|
"--tui-search-select-trigger-fg",
|
|
2816
2914
|
"--tui-search-select-trigger-border",
|
|
2915
|
+
"--tui-search-select-trigger-border-hover",
|
|
2817
2916
|
"--tui-search-select-trigger-border-focus",
|
|
2818
2917
|
"--tui-search-select-trigger-radius",
|
|
2819
2918
|
"--tui-search-select-panel-bg",
|
|
2919
|
+
"--tui-search-select-panel-fg",
|
|
2820
2920
|
"--tui-search-select-panel-border",
|
|
2821
2921
|
"--tui-search-select-panel-shadow",
|
|
2822
2922
|
"--tui-search-select-panel-radius",
|
|
2823
2923
|
"--tui-search-select-panel-width",
|
|
2824
2924
|
"--tui-search-select-option-bg-hover",
|
|
2825
|
-
"--tui-search-select-option-bg-selected"
|
|
2925
|
+
"--tui-search-select-option-bg-selected",
|
|
2926
|
+
"--tui-search-select-option-fg-hover",
|
|
2927
|
+
"--tui-search-select-option-fg-selected",
|
|
2928
|
+
"--tui-search-select-option-bg-selected-hover",
|
|
2929
|
+
"--tui-search-select-option-check"
|
|
2826
2930
|
],
|
|
2827
2931
|
"story": {
|
|
2828
2932
|
"title": "Forms/SearchSelect",
|
|
@@ -2995,6 +3099,7 @@
|
|
|
2995
3099
|
"--tui-segmented-padding",
|
|
2996
3100
|
"--tui-segmented-radius",
|
|
2997
3101
|
"--tui-segmented-bg",
|
|
3102
|
+
"--tui-segmented-fg",
|
|
2998
3103
|
"--tui-segmented-border",
|
|
2999
3104
|
"--tui-segmented-item-padding",
|
|
3000
3105
|
"--tui-segmented-item-radius",
|
|
@@ -3126,15 +3231,21 @@
|
|
|
3126
3231
|
"--tui-select-trigger-bg",
|
|
3127
3232
|
"--tui-select-trigger-fg",
|
|
3128
3233
|
"--tui-select-trigger-border",
|
|
3234
|
+
"--tui-select-trigger-border-hover",
|
|
3129
3235
|
"--tui-select-trigger-border-focus",
|
|
3130
3236
|
"--tui-select-trigger-radius",
|
|
3131
3237
|
"--tui-select-content-bg",
|
|
3238
|
+
"--tui-select-content-fg",
|
|
3132
3239
|
"--tui-select-content-border",
|
|
3133
3240
|
"--tui-select-content-shadow",
|
|
3134
3241
|
"--tui-select-content-radius",
|
|
3135
3242
|
"--tui-select-option-radius",
|
|
3136
3243
|
"--tui-select-option-bg-hover",
|
|
3137
3244
|
"--tui-select-option-bg-selected",
|
|
3245
|
+
"--tui-select-option-fg-hover",
|
|
3246
|
+
"--tui-select-option-fg-selected",
|
|
3247
|
+
"--tui-select-option-bg-selected-hover",
|
|
3248
|
+
"--tui-select-option-check",
|
|
3138
3249
|
"--tui-select-option-gap"
|
|
3139
3250
|
],
|
|
3140
3251
|
"story": {
|
|
@@ -3209,6 +3320,7 @@
|
|
|
3209
3320
|
"--tui-sidebar-width",
|
|
3210
3321
|
"--tui-sidebar-collapsed-width",
|
|
3211
3322
|
"--tui-sidebar-bg",
|
|
3323
|
+
"--tui-sidebar-fg",
|
|
3212
3324
|
"--tui-sidebar-border",
|
|
3213
3325
|
"--tui-sidebar-divider",
|
|
3214
3326
|
"--tui-sidebar-padding",
|
|
@@ -3534,6 +3646,7 @@
|
|
|
3534
3646
|
"cssTokens": [
|
|
3535
3647
|
"--tui-tabs-gap",
|
|
3536
3648
|
"--tui-tabs-list-bg",
|
|
3649
|
+
"--tui-tabs-list-fg",
|
|
3537
3650
|
"--tui-tabs-list-padding",
|
|
3538
3651
|
"--tui-tabs-list-radius",
|
|
3539
3652
|
"--tui-tabs-tab-padding",
|
|
@@ -4041,7 +4154,18 @@
|
|
|
4041
4154
|
"tui-text-success",
|
|
4042
4155
|
"tui-text-white",
|
|
4043
4156
|
"tui-text-contrast-high",
|
|
4044
|
-
"tui-text-contrast-low"
|
|
4157
|
+
"tui-text-contrast-low",
|
|
4158
|
+
"tui-font-sans",
|
|
4159
|
+
"tui-font-mono"
|
|
4160
|
+
],
|
|
4161
|
+
"textStyles": [
|
|
4162
|
+
"tui-text-style-display-{01|02|03|04}",
|
|
4163
|
+
"tui-text-style-headline-{01|02|03|04|05|06}",
|
|
4164
|
+
"tui-text-style-body",
|
|
4165
|
+
"tui-text-style-body-sm",
|
|
4166
|
+
"tui-text-style-label",
|
|
4167
|
+
"tui-text-style-caption",
|
|
4168
|
+
"tui-text-style-overline"
|
|
4045
4169
|
],
|
|
4046
4170
|
"borders": [
|
|
4047
4171
|
"tui-border",
|
package/utils/listbox/group.js
CHANGED
|
@@ -33,7 +33,9 @@ export function createListboxGroupComponents(config) {
|
|
|
33
33
|
}, [groupContext]);
|
|
34
34
|
// No aria-hidden — aria-labelledby on Group references this element,
|
|
35
35
|
// so screen readers need access to read the label text.
|
|
36
|
-
return (_jsx("div", { id: groupContext ? `${groupContext.groupId}-label` : undefined,
|
|
36
|
+
return (_jsx("div", { id: groupContext ? `${groupContext.groupId}-label` : undefined,
|
|
37
|
+
// Shared text style: one class restyles every group label at once.
|
|
38
|
+
className: cx(labelClass, 'tui-text-style-overline', className), children: children }));
|
|
37
39
|
}
|
|
38
40
|
LabelComponent.displayName = `${componentName}.Label`;
|
|
39
41
|
return { Group: GroupComponent, Label: LabelComponent };
|
package/utils/portal.js
CHANGED
|
@@ -31,6 +31,15 @@ function createPortalRoot(id) {
|
|
|
31
31
|
return root;
|
|
32
32
|
}
|
|
33
33
|
const GLOBAL_INTERFACE_ID = `${PREFIX}-global-interface`;
|
|
34
|
+
/**
|
|
35
|
+
* Where a portal root physically goes for a given interface. Normally the
|
|
36
|
+
* interface itself, but `<html class="tui-interface">` is legitimate and its
|
|
37
|
+
* only valid children are <head> and <body>, so the root goes in <body>.
|
|
38
|
+
* Body is inside <html>, so theme and token inheritance are unchanged (#109).
|
|
39
|
+
*/
|
|
40
|
+
function mountPoint(interfaceEl) {
|
|
41
|
+
return interfaceEl === document.documentElement ? document.body : interfaceEl;
|
|
42
|
+
}
|
|
34
43
|
/**
|
|
35
44
|
* Gets or creates a global .tui-interface wrapper at body level.
|
|
36
45
|
* Used as fallback when no interface wrapper exists in the DOM.
|
|
@@ -64,17 +73,37 @@ function getOrCreateGlobalInterface() {
|
|
|
64
73
|
* manufacturing the fallback next to a perfectly good interface). Re-home
|
|
65
74
|
* the root — moving the node keeps any mounted portals attached — and drop
|
|
66
75
|
* the empty fallback. Runs cheaply on every resolution.
|
|
76
|
+
*
|
|
77
|
+
* Only when the target is unambiguous (#88). The stranded root was made
|
|
78
|
+
* before any interface existed, so nothing says which one it belongs to.
|
|
79
|
+
* With several interfaces, adopting the first in document order would move
|
|
80
|
+
* its content under a wrapper whose data-theme and tokens it never asked
|
|
81
|
+
* for. And an interface that already has a root must keep it: overwriting
|
|
82
|
+
* its map entry made two surfaces render into one container. Two roots
|
|
83
|
+
* can't be merged either, because React holds the container nodes. In both
|
|
84
|
+
* cases the stranded root stays in the fallback, with the theme it was
|
|
85
|
+
* created under.
|
|
67
86
|
*/
|
|
68
87
|
function reconcileFallback() {
|
|
69
88
|
const fallback = document.getElementById(GLOBAL_INTERFACE_ID);
|
|
70
89
|
if (!fallback)
|
|
71
90
|
return;
|
|
72
|
-
|
|
73
|
-
|
|
91
|
+
if (fallback.childElementCount === 0) {
|
|
92
|
+
fallback.remove();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const reals = document.querySelectorAll(`.${INTERFACE_CLASS}:not(#${GLOBAL_INTERFACE_ID})`);
|
|
96
|
+
if (reals.length !== 1)
|
|
74
97
|
return;
|
|
98
|
+
const real = reals[0];
|
|
75
99
|
const strandedRoot = fallback.querySelector(`[id^="${PORTAL_ID}"]`);
|
|
76
100
|
if (strandedRoot) {
|
|
77
|
-
|
|
101
|
+
const ownRoot = portalRoots.get(real);
|
|
102
|
+
const hasRoot = (ownRoot && real.contains(ownRoot)) ||
|
|
103
|
+
real.querySelector(`[id^="${PORTAL_ID}"]`) !== null;
|
|
104
|
+
if (hasRoot)
|
|
105
|
+
return;
|
|
106
|
+
mountPoint(real).appendChild(strandedRoot);
|
|
78
107
|
portalRoots.set(real, strandedRoot);
|
|
79
108
|
}
|
|
80
109
|
if (fallback.childElementCount === 0)
|
|
@@ -93,7 +122,7 @@ export function getPortalRoot() {
|
|
|
93
122
|
}
|
|
94
123
|
// Create portal root inside the interface
|
|
95
124
|
const created = createPortalRoot(PORTAL_ID);
|
|
96
|
-
interfaceEl.appendChild(created);
|
|
125
|
+
mountPoint(interfaceEl).appendChild(created);
|
|
97
126
|
portalRoots.set(interfaceEl, created);
|
|
98
127
|
return created;
|
|
99
128
|
}
|
|
@@ -132,7 +161,7 @@ export function getPortalRootFor(element) {
|
|
|
132
161
|
const index = Array.from(allInterfaces).indexOf(interfaceEl);
|
|
133
162
|
const scopedId = index === 0 ? PORTAL_ID : `${PORTAL_ID}-${index}`;
|
|
134
163
|
const portalRoot = createPortalRoot(scopedId);
|
|
135
|
-
interfaceEl.appendChild(portalRoot);
|
|
164
|
+
mountPoint(interfaceEl).appendChild(portalRoot);
|
|
136
165
|
portalRoots.set(interfaceEl, portalRoot);
|
|
137
166
|
return portalRoot;
|
|
138
167
|
}
|