@tangible/ui 0.0.18 → 0.0.20
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/README.md +32 -1
- package/components/Avatar/Avatar.d.ts +3 -1
- package/components/Avatar/Avatar.js +6 -25
- package/components/Avatar/index.d.ts +2 -2
- package/components/Avatar/index.js +1 -1
- package/components/Avatar/types.d.ts +8 -8
- package/components/Avatar/types.js +0 -12
- package/components/Icon/Icon.d.ts +10 -1
- package/components/Icon/Icon.js +5 -1
- package/components/Modal/Modal.js +1 -1
- package/components/OverlapStack/OverlapStack.js +4 -2
- package/components/Pager/Pager.js +9 -3
- package/components/Pager/types.d.ts +9 -0
- package/components/Pager/types.js +2 -0
- package/components/Progress/Progress.js +3 -3
- package/components/Rating/Rating.js +4 -2
- package/components/Rating/types.d.ts +5 -1
- package/components/Rating/types.js +1 -0
- package/components/Select/Select.d.ts +1 -1
- package/components/Select/Select.js +5 -3
- package/components/Select/types.d.ts +5 -0
- package/components/StepIndicator/StepIndicator.js +6 -2
- package/components/StepIndicator/types.d.ts +3 -0
- package/components/StepIndicator/types.js +1 -0
- package/components/Table/BulkActionsBar.js +4 -1
- package/components/Table/DataTable.js +8 -5
- package/components/index.d.ts +3 -2
- package/components/index.js +2 -1
- package/package.json +3 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +220 -88
- package/styles/all.expanded.unlayered.css +220 -88
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +98 -71
- package/styles/components/accordion.scss +289 -0
- package/styles/components/avatar.scss +298 -0
- package/styles/components/button.scss +468 -0
- package/styles/components/card.scss +261 -0
- package/styles/components/checkbox.scss +184 -0
- package/styles/components/chip-group.scss +49 -0
- package/styles/components/chip.scss +472 -0
- package/styles/components/combobox.scss +378 -0
- package/styles/components/content-indicator.scss +114 -0
- package/styles/components/dropdown.scss +179 -0
- package/styles/components/field.scss +120 -0
- package/styles/components/icon-button.scss +311 -0
- package/styles/components/icon.scss +42 -0
- package/styles/components/input/index.scss +6 -1
- package/styles/components/modal.scss +312 -0
- package/styles/components/move-handle.scss +383 -0
- package/styles/components/multi-select.scss +449 -0
- package/styles/components/notice.scss +430 -0
- package/styles/components/overlap-stack.scss +82 -0
- package/styles/components/pager.scss +86 -0
- package/styles/components/popover.scss +70 -0
- package/styles/components/progress.scss +403 -0
- package/styles/components/radio.scss +259 -0
- package/styles/components/rating.scss +142 -0
- package/styles/components/segmented-control.scss +285 -0
- package/styles/components/select.scss +386 -0
- package/styles/components/sidebar.scss +240 -0
- package/styles/components/step-indicator.scss +118 -0
- package/styles/components/step-list.scss +130 -0
- package/styles/components/switch.scss +229 -0
- package/styles/components/table.scss +140 -0
- package/styles/components/tabs.scss +297 -0
- package/styles/components/text-input.scss +142 -0
- package/styles/components/textarea.scss +35 -0
- package/styles/components/toolbar.scss +62 -0
- package/styles/components/tooltip.scss +102 -0
- package/styles/core.css +1 -0
- package/styles/core.scss +12 -0
- package/styles/core.unlayered.css +1 -0
- package/styles/index.scss +34 -6
- package/styles/system/_constants.scss +2 -2
- package/styles/system/_motion.scss +20 -18
- package/styles/system/_tokens.scss +89 -10
- package/tui-manifest.json +10 -3
- package/utils/generative.d.ts +16 -0
- package/utils/generative.js +45 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-select-trigger-bg
|
|
5
|
+
--tui-select-trigger-fg
|
|
6
|
+
--tui-select-trigger-border
|
|
7
|
+
--tui-select-trigger-border-focus
|
|
8
|
+
--tui-select-trigger-radius
|
|
9
|
+
--tui-select-content-bg
|
|
10
|
+
--tui-select-content-border
|
|
11
|
+
--tui-select-content-shadow
|
|
12
|
+
--tui-select-content-radius
|
|
13
|
+
--tui-select-option-radius
|
|
14
|
+
--tui-select-option-bg-hover
|
|
15
|
+
--tui-select-option-bg-selected
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// Structural SCSS constants (compile away, not overridable)
|
|
19
|
+
$_min-width: 160px;
|
|
20
|
+
$_label-letter-spacing: 0.05em;
|
|
21
|
+
|
|
22
|
+
@mixin styles() {
|
|
23
|
+
// ==========================================================================
|
|
24
|
+
// Select Component
|
|
25
|
+
// ==========================================================================
|
|
26
|
+
//
|
|
27
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
28
|
+
//
|
|
29
|
+
// Trigger:
|
|
30
|
+
// --tui-select-trigger-bg
|
|
31
|
+
// --tui-select-trigger-fg
|
|
32
|
+
// --tui-select-trigger-border
|
|
33
|
+
// --tui-select-trigger-border-focus
|
|
34
|
+
// --tui-select-trigger-radius
|
|
35
|
+
//
|
|
36
|
+
// Content:
|
|
37
|
+
// --tui-select-content-bg
|
|
38
|
+
// --tui-select-content-border
|
|
39
|
+
// --tui-select-content-shadow
|
|
40
|
+
// --tui-select-content-radius
|
|
41
|
+
//
|
|
42
|
+
// Options:
|
|
43
|
+
// --tui-select-option-radius
|
|
44
|
+
// --tui-select-option-bg-hover
|
|
45
|
+
// --tui-select-option-bg-selected
|
|
46
|
+
//
|
|
47
|
+
// ==========================================================================
|
|
48
|
+
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Trigger wrapper (sibling layout for clear button — avoids button-in-button)
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__trigger-wrap {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Trigger
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__trigger {
|
|
63
|
+
// Internal tokens with real fallbacks
|
|
64
|
+
--_bg: var(--#{sys.$prefix}select-trigger-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
65
|
+
--_fg: var(--#{sys.$prefix}select-trigger-fg, var(--#{sys.$prefix}color-fg));
|
|
66
|
+
--_border: var(--#{sys.$prefix}select-trigger-border, var(--#{sys.$prefix}color-border));
|
|
67
|
+
--_border-focus: var(--#{sys.$prefix}select-trigger-border-focus, var(--#{sys.$prefix}theme-primary-base));
|
|
68
|
+
--_radius: var(--#{sys.$prefix}select-trigger-radius, var(--#{sys.$prefix}radius-md));
|
|
69
|
+
|
|
70
|
+
// Reset
|
|
71
|
+
appearance: none;
|
|
72
|
+
border: none;
|
|
73
|
+
font: inherit;
|
|
74
|
+
margin: 0;
|
|
75
|
+
|
|
76
|
+
// Unified sizing
|
|
77
|
+
@include sys.control-sizing(sys.$prefix);
|
|
78
|
+
|
|
79
|
+
// Layout
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
84
|
+
min-width: $_min-width;
|
|
85
|
+
width: 100%;
|
|
86
|
+
padding-inline: var(--#{sys.$prefix}spacing-sm);
|
|
87
|
+
|
|
88
|
+
// Visual
|
|
89
|
+
background-color: var(--_bg);
|
|
90
|
+
color: var(--_fg);
|
|
91
|
+
border: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
92
|
+
border-radius: var(--_radius);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
|
|
95
|
+
// Typography
|
|
96
|
+
line-height: 1.4;
|
|
97
|
+
text-align: left;
|
|
98
|
+
|
|
99
|
+
// Transitions
|
|
100
|
+
transition-duration: var(--#{sys.$prefix}motion-duration);
|
|
101
|
+
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
102
|
+
transition-property: border-color, background-color;
|
|
103
|
+
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
--_border: var(--_border-focus);
|
|
106
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
107
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&[data-state="open"] {
|
|
111
|
+
--_border: var(--_border-focus);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&[data-disabled],
|
|
115
|
+
&[disabled] {
|
|
116
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
117
|
+
cursor: not-allowed;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__value {
|
|
122
|
+
flex: 1;
|
|
123
|
+
min-width: 0;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__placeholder {
|
|
130
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__icon {
|
|
134
|
+
flex-shrink: 0;
|
|
135
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
136
|
+
transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
137
|
+
|
|
138
|
+
[data-state="open"] & {
|
|
139
|
+
transform: rotate(180deg);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
// Clear Button
|
|
145
|
+
// ---------------------------------------------------------------------------
|
|
146
|
+
|
|
147
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__clear {
|
|
148
|
+
// Reset (real <button>, sibling of trigger to avoid button-in-button)
|
|
149
|
+
appearance: none;
|
|
150
|
+
border: none;
|
|
151
|
+
background: none;
|
|
152
|
+
padding: 0;
|
|
153
|
+
font: inherit;
|
|
154
|
+
margin: 0;
|
|
155
|
+
|
|
156
|
+
// Position over the trigger's end area, between value text and chevron
|
|
157
|
+
position: absolute;
|
|
158
|
+
top: 50%;
|
|
159
|
+
// Offset from right: chevron width (~1em) + icon gap (spacing-xs) + own gap (spacing-xs)
|
|
160
|
+
right: calc(var(--#{sys.$prefix}spacing-sm) + 1em + var(--#{sys.$prefix}spacing-xs));
|
|
161
|
+
transform: translateY(-50%);
|
|
162
|
+
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
width: 1.25em;
|
|
167
|
+
height: 1.25em;
|
|
168
|
+
border-radius: var(--#{sys.$prefix}radius-sm);
|
|
169
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
transition: color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing),
|
|
172
|
+
background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
173
|
+
|
|
174
|
+
&:hover {
|
|
175
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
176
|
+
background-color: var(--#{sys.$prefix}theme-secondary-subtlest);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&:focus-visible {
|
|
180
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
181
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[data-disabled] &,
|
|
185
|
+
[disabled] & {
|
|
186
|
+
pointer-events: none;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// Content (Listbox)
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
|
|
194
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__content {
|
|
195
|
+
// Internal tokens with real fallbacks
|
|
196
|
+
--_bg: var(--#{sys.$prefix}select-content-bg, var(--#{sys.$prefix}color-bg-elevated));
|
|
197
|
+
--_border: var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border));
|
|
198
|
+
--_shadow: var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown));
|
|
199
|
+
--_radius: var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md));
|
|
200
|
+
|
|
201
|
+
// Layout
|
|
202
|
+
z-index: var(--#{sys.$prefix}layer-top);
|
|
203
|
+
min-width: $_min-width;
|
|
204
|
+
padding: var(--#{sys.$prefix}spacing-xxs);
|
|
205
|
+
overflow-y: auto;
|
|
206
|
+
overscroll-behavior: contain;
|
|
207
|
+
pointer-events: auto;
|
|
208
|
+
|
|
209
|
+
// Custom scrollbar - fg-muted is visible in both light/dark
|
|
210
|
+
scrollbar-width: thin;
|
|
211
|
+
scrollbar-color: var(--#{sys.$prefix}color-fg-muted) transparent;
|
|
212
|
+
|
|
213
|
+
&::-webkit-scrollbar {
|
|
214
|
+
width: 8px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&::-webkit-scrollbar-track {
|
|
218
|
+
background: transparent;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&::-webkit-scrollbar-thumb {
|
|
222
|
+
background-color: var(--#{sys.$prefix}color-fg-muted);
|
|
223
|
+
border-radius: 4px;
|
|
224
|
+
border: 2px solid transparent;
|
|
225
|
+
background-clip: content-box;
|
|
226
|
+
opacity: 0.5;
|
|
227
|
+
|
|
228
|
+
&:hover {
|
|
229
|
+
opacity: 1;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Visual
|
|
234
|
+
background-color: var(--_bg);
|
|
235
|
+
border: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
236
|
+
border-radius: var(--_radius);
|
|
237
|
+
box-shadow: var(--_shadow);
|
|
238
|
+
|
|
239
|
+
// Animation
|
|
240
|
+
animation: #{sys.$prefix}fadeFromTransparent var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ---------------------------------------------------------------------------
|
|
244
|
+
// Option
|
|
245
|
+
// ---------------------------------------------------------------------------
|
|
246
|
+
|
|
247
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option {
|
|
248
|
+
// Internal tokens with real fallbacks
|
|
249
|
+
--_option-radius: var(--#{sys.$prefix}select-option-radius, var(--#{sys.$prefix}radius-sm));
|
|
250
|
+
--_bg-hover: var(--#{sys.$prefix}select-option-bg-hover, var(--#{sys.$prefix}theme-secondary-subtlest));
|
|
251
|
+
--_bg-selected: var(--#{sys.$prefix}select-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest));
|
|
252
|
+
|
|
253
|
+
// Layout
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
257
|
+
padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
|
|
258
|
+
border-radius: var(--_option-radius);
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
|
|
261
|
+
// Typography
|
|
262
|
+
font-size: var(--#{sys.$prefix}typography-size-sm);
|
|
263
|
+
line-height: 1.4;
|
|
264
|
+
|
|
265
|
+
&:hover:not([data-disabled]),
|
|
266
|
+
&[data-highlighted]:not([data-disabled]) {
|
|
267
|
+
background-color: var(--_bg-hover);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&[aria-selected="true"] {
|
|
271
|
+
background-color: var(--_bg-selected);
|
|
272
|
+
font-weight: var(--#{sys.$prefix}typography-weight-medium, 500);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&[aria-selected="true"]:hover:not([data-disabled]),
|
|
276
|
+
&[aria-selected="true"][data-highlighted]:not([data-disabled]) {
|
|
277
|
+
background-color: var(--#{sys.$prefix}theme-primary-subtle);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&[data-disabled] {
|
|
281
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
282
|
+
cursor: not-allowed;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option-content {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
290
|
+
flex: 1;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option-check {
|
|
295
|
+
flex-shrink: 0;
|
|
296
|
+
color: var(--#{sys.$prefix}theme-primary-base);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
// Group
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
|
|
303
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__group {
|
|
304
|
+
& + & {
|
|
305
|
+
margin-top: var(--#{sys.$prefix}spacing-xxs);
|
|
306
|
+
padding-top: var(--#{sys.$prefix}spacing-xxs);
|
|
307
|
+
border-top: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-divider);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// ---------------------------------------------------------------------------
|
|
312
|
+
// Label
|
|
313
|
+
// ---------------------------------------------------------------------------
|
|
314
|
+
|
|
315
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__label {
|
|
316
|
+
padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
|
|
317
|
+
padding-bottom: var(--#{sys.$prefix}spacing-xxs);
|
|
318
|
+
font-size: var(--#{sys.$prefix}typography-size-xs);
|
|
319
|
+
font-weight: var(--#{sys.$prefix}typography-weight-semibold, 600);
|
|
320
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
321
|
+
text-transform: uppercase;
|
|
322
|
+
letter-spacing: $_label-letter-spacing;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// ---------------------------------------------------------------------------
|
|
326
|
+
// Reduced motion
|
|
327
|
+
// ---------------------------------------------------------------------------
|
|
328
|
+
|
|
329
|
+
@media (prefers-reduced-motion: reduce) {
|
|
330
|
+
.#{sys.$prefix}interface .#{sys.$prefix}select__trigger {
|
|
331
|
+
transition-duration: 0ms;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.#{sys.$prefix}interface .#{sys.$prefix}select__icon {
|
|
335
|
+
transition-duration: 0ms;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.#{sys.$prefix}interface .#{sys.$prefix}select__clear {
|
|
339
|
+
transition-duration: 0ms;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__content {
|
|
343
|
+
animation-duration: 0ms;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// ---------------------------------------------------------------------------
|
|
348
|
+
// Forced colors (Windows High Contrast Mode)
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
|
|
351
|
+
@media (forced-colors: active) {
|
|
352
|
+
.#{sys.$prefix}interface .#{sys.$prefix}select__trigger {
|
|
353
|
+
background-color: Canvas;
|
|
354
|
+
color: CanvasText;
|
|
355
|
+
border-color: CanvasText;
|
|
356
|
+
|
|
357
|
+
&:focus-visible {
|
|
358
|
+
outline-color: Highlight;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__content {
|
|
363
|
+
background-color: Canvas;
|
|
364
|
+
color: CanvasText;
|
|
365
|
+
border-color: CanvasText;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}select__option {
|
|
369
|
+
&:hover:not([data-disabled]),
|
|
370
|
+
&[data-highlighted]:not([data-disabled]),
|
|
371
|
+
&[aria-selected="true"] {
|
|
372
|
+
background-color: Highlight;
|
|
373
|
+
color: HighlightText;
|
|
374
|
+
forced-color-adjust: none;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.#{sys.$prefix}interface .#{sys.$prefix}select__clear {
|
|
379
|
+
color: CanvasText;
|
|
380
|
+
|
|
381
|
+
&:focus-visible {
|
|
382
|
+
outline-color: Highlight;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-sidebar-width
|
|
5
|
+
--tui-sidebar-bg
|
|
6
|
+
--tui-sidebar-border
|
|
7
|
+
--tui-sidebar-padding
|
|
8
|
+
--tui-sidebar-z
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@mixin styles() {
|
|
12
|
+
// ==========================================================================
|
|
13
|
+
// Sidebar Component
|
|
14
|
+
// ==========================================================================
|
|
15
|
+
//
|
|
16
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
17
|
+
// --tui-sidebar-width Fixed sidebar width
|
|
18
|
+
// --tui-sidebar-bg Background color
|
|
19
|
+
// --tui-sidebar-border Border color
|
|
20
|
+
// --tui-sidebar-padding Internal padding
|
|
21
|
+
// --tui-sidebar-z Z-index (drawer mode only)
|
|
22
|
+
//
|
|
23
|
+
// To override from consuming code:
|
|
24
|
+
// .my-context .tui-sidebar { --tui-sidebar-width: 400px; }
|
|
25
|
+
//
|
|
26
|
+
// ==========================================================================
|
|
27
|
+
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Sidebar (static mode)
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar {
|
|
33
|
+
// Internal tokens — read component API with fallback to primitives
|
|
34
|
+
--_width: var(--#{sys.$prefix}sidebar-width, 320px);
|
|
35
|
+
--_bg: var(--#{sys.$prefix}sidebar-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
36
|
+
--_border: var(--#{sys.$prefix}sidebar-border, var(--#{sys.$prefix}color-border));
|
|
37
|
+
--_padding: var(--#{sys.$prefix}sidebar-padding, var(--#{sys.$prefix}spacing-md));
|
|
38
|
+
|
|
39
|
+
width: var(--_width);
|
|
40
|
+
max-width: 100%;
|
|
41
|
+
background-color: var(--_bg);
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
height: 100%;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
|
|
47
|
+
// Left position (default): border on right
|
|
48
|
+
&[data-position="left"] {
|
|
49
|
+
border-right: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Right position: border on left
|
|
53
|
+
&[data-position="right"] {
|
|
54
|
+
border-left: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Focus visible (drawer mode fallback when no focusable children)
|
|
58
|
+
&:focus-visible {
|
|
59
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
60
|
+
outline-offset: calc(var(--#{sys.$prefix}focus-ring-offset) * -1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Header
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar__header {
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
padding: var(--_padding);
|
|
71
|
+
border-bottom: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
72
|
+
|
|
73
|
+
// Flex column layout for typical header content
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
77
|
+
|
|
78
|
+
// Heading resets
|
|
79
|
+
h1, h2, h3, h4, h5, h6 {
|
|
80
|
+
margin: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Footer
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar__footer {
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
margin-top: auto;
|
|
91
|
+
padding: var(--_padding);
|
|
92
|
+
border-top: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
93
|
+
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Nav
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar__nav {
|
|
104
|
+
flex: 1;
|
|
105
|
+
overflow-y: auto;
|
|
106
|
+
padding: var(--_padding);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
// Drawer Mode
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar-drawer {
|
|
114
|
+
// Internal tokens
|
|
115
|
+
--_z: var(--#{sys.$prefix}sidebar-z, var(--#{sys.$prefix}layer-modal, 1000));
|
|
116
|
+
|
|
117
|
+
position: fixed;
|
|
118
|
+
inset: 0;
|
|
119
|
+
z-index: var(--_z);
|
|
120
|
+
display: flex;
|
|
121
|
+
|
|
122
|
+
// Right position: align drawer to right
|
|
123
|
+
&[data-position="right"] {
|
|
124
|
+
justify-content: flex-end;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar-drawer__backdrop {
|
|
129
|
+
position: absolute;
|
|
130
|
+
inset: 0;
|
|
131
|
+
background-color: var(--#{sys.$prefix}color-bg-overlay);
|
|
132
|
+
animation: #{sys.$prefix}fadeFromTransparent var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
133
|
+
|
|
134
|
+
[data-state="closing"] > & {
|
|
135
|
+
animation: #{sys.$prefix}fadeToTransparent var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing) forwards;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar-drawer__panel {
|
|
140
|
+
position: relative;
|
|
141
|
+
z-index: 1;
|
|
142
|
+
max-width: 90vw;
|
|
143
|
+
height: 100%;
|
|
144
|
+
|
|
145
|
+
// Left position (default): slide in from left
|
|
146
|
+
[data-position="left"] > & {
|
|
147
|
+
animation: #{sys.$prefix}slideInFromLeft var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Right position: slide in from right
|
|
151
|
+
[data-position="right"] > & {
|
|
152
|
+
animation: #{sys.$prefix}slideInFromRight var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Closing: slide out
|
|
156
|
+
[data-state="closing"][data-position="left"] > & {
|
|
157
|
+
animation: #{sys.$prefix}slideOutToLeft var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing) forwards;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[data-state="closing"][data-position="right"] > & {
|
|
161
|
+
animation: #{sys.$prefix}slideOutToRight var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing) forwards;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Sidebar inside panel should fill height and remove side borders
|
|
165
|
+
.#{sys.$prefix}sidebar {
|
|
166
|
+
height: 100%;
|
|
167
|
+
border-left: none;
|
|
168
|
+
border-right: none;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// Slide-in Keyframes
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
|
|
176
|
+
@keyframes #{sys.$prefix}slideInFromLeft {
|
|
177
|
+
from {
|
|
178
|
+
transform: translateX(-100%);
|
|
179
|
+
}
|
|
180
|
+
to {
|
|
181
|
+
transform: translateX(0);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@keyframes #{sys.$prefix}slideInFromRight {
|
|
186
|
+
from {
|
|
187
|
+
transform: translateX(100%);
|
|
188
|
+
}
|
|
189
|
+
to {
|
|
190
|
+
transform: translateX(0);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@keyframes #{sys.$prefix}slideOutToLeft {
|
|
195
|
+
from {
|
|
196
|
+
transform: translateX(0);
|
|
197
|
+
}
|
|
198
|
+
to {
|
|
199
|
+
transform: translateX(-100%);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@keyframes #{sys.$prefix}slideOutToRight {
|
|
204
|
+
from {
|
|
205
|
+
transform: translateX(0);
|
|
206
|
+
}
|
|
207
|
+
to {
|
|
208
|
+
transform: translateX(100%);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@keyframes #{sys.$prefix}fadeToTransparent {
|
|
213
|
+
from {
|
|
214
|
+
opacity: 1;
|
|
215
|
+
}
|
|
216
|
+
to {
|
|
217
|
+
opacity: 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ---------------------------------------------------------------------------
|
|
222
|
+
// Reduced Motion
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
|
|
225
|
+
@media (prefers-reduced-motion: reduce) {
|
|
226
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar-drawer__backdrop,
|
|
227
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}sidebar-drawer__panel {
|
|
228
|
+
animation: none;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ---------------------------------------------------------------------------
|
|
233
|
+
// Body Scroll Lock
|
|
234
|
+
// ---------------------------------------------------------------------------
|
|
235
|
+
|
|
236
|
+
body.#{sys.$prefix}sidebar-drawer-open {
|
|
237
|
+
overflow: hidden;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
}
|