@tangible/ui 0.0.18 → 0.0.19

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.
Files changed (43) hide show
  1. package/README.md +31 -1
  2. package/package.json +3 -1
  3. package/styles/components/_bundle.scss +98 -71
  4. package/styles/components/accordion.scss +289 -0
  5. package/styles/components/avatar.scss +346 -0
  6. package/styles/components/button.scss +468 -0
  7. package/styles/components/card.scss +261 -0
  8. package/styles/components/checkbox.scss +184 -0
  9. package/styles/components/chip-group.scss +49 -0
  10. package/styles/components/chip.scss +472 -0
  11. package/styles/components/combobox.scss +378 -0
  12. package/styles/components/content-indicator.scss +114 -0
  13. package/styles/components/dropdown.scss +179 -0
  14. package/styles/components/field.scss +120 -0
  15. package/styles/components/icon-button.scss +311 -0
  16. package/styles/components/icon.scss +42 -0
  17. package/styles/components/modal.scss +312 -0
  18. package/styles/components/move-handle.scss +383 -0
  19. package/styles/components/multi-select.scss +449 -0
  20. package/styles/components/notice.scss +430 -0
  21. package/styles/components/overlap-stack.scss +81 -0
  22. package/styles/components/pager.scss +83 -0
  23. package/styles/components/popover.scss +70 -0
  24. package/styles/components/progress.scss +391 -0
  25. package/styles/components/radio.scss +259 -0
  26. package/styles/components/rating.scss +142 -0
  27. package/styles/components/segmented-control.scss +285 -0
  28. package/styles/components/select.scss +386 -0
  29. package/styles/components/sidebar.scss +240 -0
  30. package/styles/components/step-indicator.scss +118 -0
  31. package/styles/components/step-list.scss +130 -0
  32. package/styles/components/switch.scss +229 -0
  33. package/styles/components/table.scss +139 -0
  34. package/styles/components/tabs.scss +297 -0
  35. package/styles/components/text-input.scss +142 -0
  36. package/styles/components/textarea.scss +35 -0
  37. package/styles/components/toolbar.scss +62 -0
  38. package/styles/components/tooltip.scss +102 -0
  39. package/styles/core.css +1 -0
  40. package/styles/core.scss +12 -0
  41. package/styles/core.unlayered.css +1 -0
  42. package/styles/index.scss +29 -4
  43. package/tui-manifest.json +2 -2
@@ -0,0 +1,449 @@
1
+ @use "../system" as sys;
2
+
3
+ /* @tui-tokens
4
+ --tui-multiselect-trigger-bg
5
+ --tui-multiselect-trigger-fg
6
+ --tui-multiselect-trigger-border
7
+ --tui-multiselect-trigger-border-focus
8
+ --tui-multiselect-trigger-radius
9
+ --tui-multiselect-content-bg
10
+ --tui-multiselect-content-border
11
+ --tui-multiselect-content-shadow
12
+ --tui-multiselect-content-radius
13
+ --tui-multiselect-option-radius
14
+ --tui-multiselect-option-bg-hover
15
+ --tui-multiselect-option-bg-selected
16
+ --tui-multiselect-chip-bg
17
+ --tui-multiselect-chip-fg
18
+ */
19
+
20
+ // Structural SCSS constants (compile away, not overridable)
21
+ $_min-width: 160px;
22
+ $_line-height: 1.4;
23
+ $_label-letter-spacing: 0.05em;
24
+ $_chip-padding: 0.125em 0.5em;
25
+ $_chip-max-width: 120px;
26
+
27
+ @mixin styles() {
28
+ // ==========================================================================
29
+ // MultiSelect Component
30
+ // ==========================================================================
31
+ //
32
+ // Component API tokens (never defined here, only read via fallback):
33
+ //
34
+ // Trigger:
35
+ // --tui-multiselect-trigger-bg
36
+ // --tui-multiselect-trigger-fg
37
+ // --tui-multiselect-trigger-border
38
+ // --tui-multiselect-trigger-border-focus
39
+ // --tui-multiselect-trigger-radius
40
+ //
41
+ // Content:
42
+ // --tui-multiselect-content-bg
43
+ // --tui-multiselect-content-border
44
+ // --tui-multiselect-content-shadow
45
+ // --tui-multiselect-content-radius
46
+ //
47
+ // Options:
48
+ // --tui-multiselect-option-radius
49
+ // --tui-multiselect-option-bg-hover
50
+ // --tui-multiselect-option-bg-selected
51
+ //
52
+ // Chips:
53
+ // --tui-multiselect-chip-bg
54
+ // --tui-multiselect-chip-fg
55
+ //
56
+ // ==========================================================================
57
+
58
+ // ---------------------------------------------------------------------------
59
+ // Trigger
60
+ // ---------------------------------------------------------------------------
61
+
62
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__trigger {
63
+ // Internal tokens with real fallbacks
64
+ --_bg: var(--#{sys.$prefix}multiselect-trigger-bg, var(--#{sys.$prefix}color-bg-surface));
65
+ --_fg: var(--#{sys.$prefix}multiselect-trigger-fg, var(--#{sys.$prefix}color-fg));
66
+ --_border: var(--#{sys.$prefix}multiselect-trigger-border, var(--#{sys.$prefix}color-border));
67
+ --_border-focus: var(--#{sys.$prefix}multiselect-trigger-border-focus, var(--#{sys.$prefix}theme-primary-base));
68
+ --_radius: var(--#{sys.$prefix}multiselect-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: $_line-height;
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
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__value {
122
+ flex: 1;
123
+ min-width: 0;
124
+ overflow: hidden;
125
+ }
126
+
127
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__placeholder {
128
+ color: var(--#{sys.$prefix}color-fg-muted);
129
+ white-space: nowrap;
130
+ overflow: hidden;
131
+ text-overflow: ellipsis;
132
+ }
133
+
134
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__count {
135
+ white-space: nowrap;
136
+ }
137
+
138
+ // ---------------------------------------------------------------------------
139
+ // Chips (visual only, inside trigger)
140
+ // ---------------------------------------------------------------------------
141
+
142
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__chips {
143
+ display: flex;
144
+ flex-wrap: wrap;
145
+ gap: var(--#{sys.$prefix}spacing-xxs);
146
+ min-width: 0;
147
+ }
148
+
149
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__chip {
150
+ // Internal tokens
151
+ --_chip-bg: var(--#{sys.$prefix}multiselect-chip-bg, var(--#{sys.$prefix}theme-secondary-subtlest));
152
+ --_chip-fg: var(--#{sys.$prefix}multiselect-chip-fg, var(--#{sys.$prefix}color-fg));
153
+
154
+ display: inline-flex;
155
+ align-items: center;
156
+ padding: $_chip-padding;
157
+ background-color: var(--_chip-bg);
158
+ color: var(--_chip-fg);
159
+ border-radius: var(--#{sys.$prefix}radius-sm);
160
+ font-size: var(--#{sys.$prefix}typography-size-xs);
161
+ line-height: $_line-height;
162
+ white-space: nowrap;
163
+ max-width: $_chip-max-width;
164
+ overflow: hidden;
165
+ text-overflow: ellipsis;
166
+ }
167
+
168
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__more {
169
+ display: inline-flex;
170
+ align-items: center;
171
+ padding: 0.125em 0.375em;
172
+ color: var(--#{sys.$prefix}color-fg-muted);
173
+ font-size: var(--#{sys.$prefix}typography-size-xs);
174
+ line-height: $_line-height;
175
+ white-space: nowrap;
176
+ }
177
+
178
+ // ---------------------------------------------------------------------------
179
+ // Clear button (visual span with pointer events)
180
+ // ---------------------------------------------------------------------------
181
+
182
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__clear {
183
+ display: flex;
184
+ align-items: center;
185
+ justify-content: center;
186
+ flex-shrink: 0;
187
+ width: 1.25em;
188
+ height: 1.25em;
189
+ border-radius: var(--#{sys.$prefix}radius-sm);
190
+ color: var(--#{sys.$prefix}color-fg-muted);
191
+ cursor: pointer;
192
+ transition: color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing),
193
+ background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
194
+
195
+ &:hover {
196
+ color: var(--#{sys.$prefix}color-fg);
197
+ background-color: var(--#{sys.$prefix}theme-secondary-subtlest);
198
+ }
199
+
200
+ [data-disabled] & {
201
+ pointer-events: none;
202
+ }
203
+ }
204
+
205
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__icon {
206
+ flex-shrink: 0;
207
+ color: var(--#{sys.$prefix}color-fg-muted);
208
+ transition: transform var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
209
+
210
+ [data-state="open"] & {
211
+ transform: rotate(180deg);
212
+ }
213
+ }
214
+
215
+ // ---------------------------------------------------------------------------
216
+ // Content (Listbox)
217
+ // ---------------------------------------------------------------------------
218
+
219
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__content {
220
+ // Internal tokens with real fallbacks
221
+ --_bg: var(--#{sys.$prefix}multiselect-content-bg, var(--#{sys.$prefix}color-bg-elevated));
222
+ --_border: var(--#{sys.$prefix}multiselect-content-border, var(--#{sys.$prefix}color-border));
223
+ --_shadow: var(--#{sys.$prefix}multiselect-content-shadow, var(--#{sys.$prefix}shadow-dropdown));
224
+ --_radius: var(--#{sys.$prefix}multiselect-content-radius, var(--#{sys.$prefix}radius-md));
225
+
226
+ // Layout
227
+ z-index: var(--#{sys.$prefix}layer-top);
228
+ min-width: $_min-width;
229
+ padding: var(--#{sys.$prefix}spacing-xxs);
230
+ overflow-y: auto;
231
+ overscroll-behavior: contain;
232
+ pointer-events: auto;
233
+
234
+ // Custom scrollbar
235
+ scrollbar-width: thin;
236
+ scrollbar-color: var(--#{sys.$prefix}color-fg-muted) transparent;
237
+
238
+ &::-webkit-scrollbar {
239
+ width: 8px;
240
+ }
241
+
242
+ &::-webkit-scrollbar-track {
243
+ background: transparent;
244
+ }
245
+
246
+ &::-webkit-scrollbar-thumb {
247
+ background-color: var(--#{sys.$prefix}color-fg-muted);
248
+ border-radius: 4px;
249
+ border: 2px solid transparent;
250
+ background-clip: content-box;
251
+ opacity: 0.5;
252
+
253
+ &:hover {
254
+ opacity: 1;
255
+ }
256
+ }
257
+
258
+ // Visual
259
+ background-color: var(--_bg);
260
+ border: var(--#{sys.$prefix}border-width) solid var(--_border);
261
+ border-radius: var(--_radius);
262
+ box-shadow: var(--_shadow);
263
+
264
+ // Animation
265
+ animation: #{sys.$prefix}fadeFromTransparent var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
266
+ }
267
+
268
+ // ---------------------------------------------------------------------------
269
+ // Option
270
+ // ---------------------------------------------------------------------------
271
+
272
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__option {
273
+ // Internal tokens with real fallbacks
274
+ --_option-radius: var(--#{sys.$prefix}multiselect-option-radius, var(--#{sys.$prefix}radius-sm));
275
+ --_bg-hover: var(--#{sys.$prefix}multiselect-option-bg-hover, var(--#{sys.$prefix}theme-secondary-subtlest));
276
+ --_bg-selected: var(--#{sys.$prefix}multiselect-option-bg-selected, var(--#{sys.$prefix}theme-primary-subtlest));
277
+
278
+ // Layout
279
+ display: flex;
280
+ align-items: center;
281
+ gap: var(--#{sys.$prefix}spacing-xs);
282
+ padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
283
+ border-radius: var(--_option-radius);
284
+ cursor: pointer;
285
+
286
+ // Typography
287
+ font-size: var(--#{sys.$prefix}typography-size-sm);
288
+ line-height: $_line-height;
289
+
290
+ &:hover:not([data-disabled]):not([data-blocked]),
291
+ &[data-highlighted]:not([data-disabled]):not([data-blocked]) {
292
+ background-color: var(--_bg-hover);
293
+ }
294
+
295
+ &[aria-selected="true"] {
296
+ background-color: var(--_bg-selected);
297
+ }
298
+
299
+ &[aria-selected="true"]:hover:not([data-disabled]):not([data-blocked]),
300
+ &[aria-selected="true"][data-highlighted]:not([data-disabled]):not([data-blocked]) {
301
+ background-color: var(--#{sys.$prefix}theme-primary-subtle);
302
+ }
303
+
304
+ // Intrinsically disabled (disabled prop)
305
+ &[data-disabled] {
306
+ opacity: var(--#{sys.$prefix}opacity-disabled);
307
+ cursor: not-allowed;
308
+ }
309
+
310
+ // Blocked by max constraint (not intrinsically disabled)
311
+ &[data-blocked] {
312
+ opacity: var(--#{sys.$prefix}opacity-disabled);
313
+ cursor: not-allowed;
314
+ }
315
+ }
316
+
317
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__option-content {
318
+ display: flex;
319
+ align-items: center;
320
+ gap: var(--#{sys.$prefix}spacing-xs);
321
+ flex: 1;
322
+ min-width: 0;
323
+ }
324
+
325
+ // ---------------------------------------------------------------------------
326
+ // Checkbox visual
327
+ // ---------------------------------------------------------------------------
328
+
329
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__checkbox {
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+ flex-shrink: 0;
334
+ width: 1em;
335
+ height: 1em;
336
+ border: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
337
+ border-radius: var(--#{sys.$prefix}radius-xs);
338
+ background-color: var(--#{sys.$prefix}color-bg);
339
+ color: var(--#{sys.$prefix}color-fg-on-accent);
340
+ transition: background-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing),
341
+ border-color var(--#{sys.$prefix}motion-duration) var(--#{sys.$prefix}motion-timing);
342
+
343
+ &.is-checked {
344
+ background-color: var(--#{sys.$prefix}theme-primary-base);
345
+ border-color: var(--#{sys.$prefix}theme-primary-base);
346
+ }
347
+
348
+ [data-disabled] & {
349
+ opacity: var(--#{sys.$prefix}opacity-disabled);
350
+ }
351
+ }
352
+
353
+ // ---------------------------------------------------------------------------
354
+ // Group
355
+ // ---------------------------------------------------------------------------
356
+
357
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__group {
358
+ & + & {
359
+ margin-top: var(--#{sys.$prefix}spacing-xxs);
360
+ padding-top: var(--#{sys.$prefix}spacing-xxs);
361
+ border-top: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-divider);
362
+ }
363
+ }
364
+
365
+ // ---------------------------------------------------------------------------
366
+ // Label
367
+ // ---------------------------------------------------------------------------
368
+
369
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__label {
370
+ padding: var(--#{sys.$prefix}spacing-xs) var(--#{sys.$prefix}spacing-sm);
371
+ padding-bottom: var(--#{sys.$prefix}spacing-xxs);
372
+ font-size: var(--#{sys.$prefix}typography-size-xs);
373
+ font-weight: var(--#{sys.$prefix}font-weight-semibold, 600);
374
+ color: var(--#{sys.$prefix}color-fg-muted);
375
+ text-transform: uppercase;
376
+ letter-spacing: $_label-letter-spacing;
377
+ }
378
+
379
+ // ---------------------------------------------------------------------------
380
+ // Reduced motion
381
+ // ---------------------------------------------------------------------------
382
+
383
+ @media (prefers-reduced-motion: reduce) {
384
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__trigger {
385
+ transition-duration: 0ms;
386
+ }
387
+
388
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__clear {
389
+ transition-duration: 0ms;
390
+ }
391
+
392
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__icon {
393
+ transition-duration: 0ms;
394
+ }
395
+
396
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__content {
397
+ animation-duration: 0ms;
398
+ }
399
+
400
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__checkbox {
401
+ transition-duration: 0ms;
402
+ }
403
+ }
404
+
405
+ // ---------------------------------------------------------------------------
406
+ // Forced colors (Windows High Contrast Mode)
407
+ // ---------------------------------------------------------------------------
408
+
409
+ @media (forced-colors: active) {
410
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__trigger {
411
+ background-color: Canvas;
412
+ color: CanvasText;
413
+ border-color: CanvasText;
414
+
415
+ &:focus-visible {
416
+ outline-color: Highlight;
417
+ }
418
+ }
419
+
420
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__content {
421
+ background-color: Canvas;
422
+ color: CanvasText;
423
+ border-color: CanvasText;
424
+ }
425
+
426
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__option {
427
+ &:hover:not([data-disabled]),
428
+ &[data-highlighted]:not([data-disabled]),
429
+ &[aria-selected="true"] {
430
+ background-color: Highlight;
431
+ color: HighlightText;
432
+ forced-color-adjust: none;
433
+ }
434
+ }
435
+
436
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}multiselect__checkbox {
437
+ border-color: CanvasText;
438
+
439
+ &.is-checked {
440
+ background-color: Highlight;
441
+ border-color: Highlight;
442
+ }
443
+ }
444
+
445
+ .#{sys.$prefix}interface .#{sys.$prefix}multiselect__chip {
446
+ border: 1px solid CanvasText;
447
+ }
448
+ }
449
+ }