@tangible/ui 0.2.19 → 0.2.21

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 (36) hide show
  1. package/components/Accordion/Accordion.d.ts +1 -1
  2. package/components/Accordion/Accordion.js +40 -12
  3. package/components/Accordion/AccordionContext.d.ts +2 -1
  4. package/components/Accordion/AccordionContext.js +25 -2
  5. package/components/Accordion/index.d.ts +2 -1
  6. package/components/Accordion/index.js +1 -0
  7. package/components/Accordion/types.d.ts +42 -3
  8. package/components/ColorPicker/ColorField.d.ts +25 -1
  9. package/components/ColorPicker/ColorField.js +9 -3
  10. package/components/ColorPicker/index.d.ts +1 -1
  11. package/components/Modal/Modal.d.ts +36 -2
  12. package/components/Modal/Modal.js +40 -11
  13. package/components/Modal/index.d.ts +1 -1
  14. package/components/MoveHandle/MoveHandle.js +25 -11
  15. package/components/MoveHandle/types.d.ts +9 -3
  16. package/components/Toast/Toast.d.ts +14 -0
  17. package/components/Toast/Toast.js +85 -19
  18. package/components/index.d.ts +4 -4
  19. package/components/index.js +1 -1
  20. package/figma-tokens.json +2 -2
  21. package/package.json +9 -1
  22. package/skills/building-with-tui/SKILL.md +29 -2
  23. package/styles/all.css +1 -1
  24. package/styles/all.expanded.css +65 -14
  25. package/styles/all.expanded.unlayered.css +65 -14
  26. package/styles/all.unlayered.css +1 -1
  27. package/styles/components/color-picker.scss +58 -4
  28. package/styles/components/modal.scss +31 -1
  29. package/styles/components/move-handle.scss +20 -4
  30. package/styles/components/toast.scss +16 -0
  31. package/styles/core.css +1 -1
  32. package/styles/core.unlayered.css +1 -1
  33. package/styles/index.scss +7 -1
  34. package/tui-manifest.json +49 -7
  35. package/utils/color/contrast.d.ts +17 -0
  36. package/utils/color/contrast.js +26 -0
@@ -227,6 +227,7 @@
227
227
  --tui-modal-radius
228
228
  --tui-modal-padding
229
229
  --tui-modal-shadow
230
+ --tui-modal-foot-gap
230
231
  */
231
232
  /* @tui-tokens
232
233
  --tui-move-handle-size
@@ -843,7 +844,7 @@
843
844
  --tui-motion-duration: 0ms;
844
845
  }
845
846
  }
846
- .tui-interface {
847
+ :where(.tui-interface) {
847
848
  --tui-spacing-base: 4px;
848
849
  --tui-palette-spacing-1: calc(var(--tui-spacing-base) * 1);
849
850
  --tui-palette-spacing-2: calc(var(--tui-spacing-base) * 2);
@@ -2630,8 +2631,8 @@
2630
2631
  gap: var(--tui-spacing-xxs);
2631
2632
  min-height: var(--tui-control-height-md, 2.5rem);
2632
2633
  padding-inline: var(--tui-spacing-xxs);
2633
- border: var(--tui-border-width) solid var(--tui-color-border);
2634
- border-radius: var(--tui-radius-md);
2634
+ border: var(--tui-border-width) solid var(--tui-input-border, var(--tui-color-border));
2635
+ border-radius: var(--tui-input-radius, var(--tui-radius-md));
2635
2636
  background: var(--tui-input-bg, var(--tui-color-bg-surface));
2636
2637
  font-size: var(--tui-typography-size-xs);
2637
2638
  }
@@ -2713,8 +2714,8 @@
2713
2714
  min-block-size: var(--tui-control-height-md, 2.5rem);
2714
2715
  padding: var(--tui-spacing-xxs);
2715
2716
  padding-inline-end: var(--tui-spacing-sm);
2716
- border: var(--tui-border-width) solid var(--tui-color-border);
2717
- border-radius: var(--tui-radius-md);
2717
+ border: var(--tui-border-width) solid var(--tui-input-border, var(--tui-color-border));
2718
+ border-radius: var(--tui-input-radius, var(--tui-radius-md));
2718
2719
  background: var(--tui-input-bg, var(--tui-color-bg-surface));
2719
2720
  color: var(--tui-color-fg);
2720
2721
  font: inherit;
@@ -2732,6 +2733,15 @@
2732
2733
  .tui-interface .tui-color-field.is-swatch-only {
2733
2734
  padding-inline-end: var(--tui-spacing-xxs);
2734
2735
  }
2736
+ .tui-interface .tui-color-field.is-label-only {
2737
+ padding-inline-start: var(--tui-spacing-sm);
2738
+ }
2739
+ .tui-interface .tui-color-field.is-variant-bare {
2740
+ padding: 0;
2741
+ border: 0;
2742
+ background: transparent;
2743
+ min-block-size: 0;
2744
+ }
2735
2745
  .tui-interface .tui-color-field:hover {
2736
2746
  border-color: var(--tui-color-border-strong, var(--tui-color-border));
2737
2747
  }
@@ -2765,6 +2775,16 @@
2765
2775
  .tui-interface .tui-color-field.is-size-lg .tui-color-field__swatch {
2766
2776
  --_size: calc(var(--tui-control-height-lg, 3rem) - 2 * var(--tui-spacing-xxs) - 2 * var(--tui-border-width));
2767
2777
  }
2778
+ .tui-interface .tui-color-field.is-variant-bare .tui-color-field__swatch {
2779
+ --_size: var(--tui-control-height-md, 2.5rem);
2780
+ border-radius: inherit;
2781
+ }
2782
+ .tui-interface .tui-color-field.is-variant-bare.is-size-sm .tui-color-field__swatch {
2783
+ --_size: var(--tui-control-height-sm, 2rem);
2784
+ }
2785
+ .tui-interface .tui-color-field.is-variant-bare.is-size-lg .tui-color-field__swatch {
2786
+ --_size: var(--tui-control-height-lg, 3rem);
2787
+ }
2768
2788
  .tui-interface .tui-color-field__swatch-icon {
2769
2789
  font-size: 1.25rem;
2770
2790
  color: var(--_swatch-icon, #fff);
@@ -2789,6 +2809,9 @@
2789
2809
  max-inline-size: calc(100vw - 2rem);
2790
2810
  }
2791
2811
  @media (forced-colors: active) {
2812
+ .tui-interface .tui-color-field.is-variant-bare {
2813
+ border: var(--tui-border-width) solid ButtonText;
2814
+ }
2792
2815
  .tui-interface .tui-color-area:focus-visible,
2793
2816
  .tui-interface .tui-color-slider:focus-visible {
2794
2817
  outline-color: Highlight;
@@ -5065,9 +5088,22 @@
5065
5088
  padding-inline-end: calc(var(--_padding) + var(--tui-spacing-xl));
5066
5089
  }
5067
5090
  .tui-modal__dialog .tui-modal__foot {
5091
+ --_foot-gap: var(--tui-modal-foot-gap, var(--tui-spacing-sm));
5092
+ --_foot-justify: flex-end;
5068
5093
  padding-block: var(--_padding);
5069
5094
  padding-inline: var(--_padding);
5070
5095
  width: 100%;
5096
+ display: flex;
5097
+ flex-wrap: wrap;
5098
+ align-items: center;
5099
+ justify-content: var(--_foot-justify);
5100
+ gap: var(--_foot-gap);
5101
+ }
5102
+ .tui-modal__dialog .tui-modal__foot[data-justify=start] {
5103
+ --_foot-justify: flex-start;
5104
+ }
5105
+ .tui-modal__dialog .tui-modal__foot[data-justify=between] > :first-child {
5106
+ margin-inline-end: auto;
5071
5107
  }
5072
5108
  .tui-modal__dialog.is-size-sm {
5073
5109
  --_max: var(--tui-modal-max, 480px);
@@ -5261,27 +5297,27 @@
5261
5297
  .tui-interface .tui-move-handle__center {
5262
5298
  position: relative;
5263
5299
  }
5264
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5300
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5265
5301
  opacity: 1;
5266
5302
  }
5267
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5303
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5268
5304
  position: absolute;
5269
5305
  opacity: 0;
5270
5306
  pointer-events: none;
5271
5307
  }
5272
- .tui-interface .tui-move-handle.has-index:hover .tui-move-handle__index, .tui-interface .tui-move-handle.has-index:focus-within .tui-move-handle__index {
5308
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows):hover .tui-move-handle__index, .tui-interface .tui-move-handle.has-index:not(.is-arrows):focus-within .tui-move-handle__index {
5273
5309
  display: none;
5274
5310
  }
5275
- .tui-interface .tui-move-handle.has-index:hover .tui-move-handle__handle, .tui-interface .tui-move-handle.has-index:focus-within .tui-move-handle__handle {
5311
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows):hover .tui-move-handle__handle, .tui-interface .tui-move-handle.has-index:not(.is-arrows):focus-within .tui-move-handle__handle {
5276
5312
  position: static;
5277
5313
  opacity: 1;
5278
5314
  pointer-events: auto;
5279
5315
  }
5280
5316
  @media (hover: none) {
5281
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5317
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5282
5318
  display: none;
5283
5319
  }
5284
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5320
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5285
5321
  position: static;
5286
5322
  opacity: 1;
5287
5323
  pointer-events: auto;
@@ -5293,11 +5329,15 @@
5293
5329
  .tui-interface .tui-move-handle.is-locked {
5294
5330
  pointer-events: none;
5295
5331
  }
5296
- .tui-interface .tui-move-handle.is-arrows {
5332
+ .tui-interface .tui-move-handle.is-arrows:focus-visible {
5333
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
5334
+ outline-offset: var(--tui-focus-ring-offset);
5335
+ }
5336
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) {
5297
5337
  min-height: calc(2 * 16px);
5298
5338
  }
5299
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__up,
5300
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__down {
5339
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__up,
5340
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__down {
5301
5341
  flex: 1;
5302
5342
  min-height: 16px;
5303
5343
  }
@@ -7601,6 +7641,17 @@
7601
7641
  :where(.tui-interface) .tui-toast-region.is-placement-top-end, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7602
7642
  inset-inline-end: 0;
7603
7643
  }
7644
+ :where(.tui-interface) .tui-toast-region__announcer {
7645
+ position: absolute;
7646
+ width: 1px;
7647
+ height: 1px;
7648
+ padding: 0;
7649
+ margin: -1px;
7650
+ overflow: hidden;
7651
+ clip: rect(0 0 0 0);
7652
+ white-space: nowrap;
7653
+ border: 0;
7654
+ }
7604
7655
  .tui-interface .tui-toast {
7605
7656
  --tui-notice-fg: var(--tui-toast-fg, var(--tui-color-fg));
7606
7657
  --tui-notice-foot-basis: max-content;
@@ -227,6 +227,7 @@
227
227
  --tui-modal-radius
228
228
  --tui-modal-padding
229
229
  --tui-modal-shadow
230
+ --tui-modal-foot-gap
230
231
  */
231
232
  /* @tui-tokens
232
233
  --tui-move-handle-size
@@ -843,7 +844,7 @@
843
844
  --tui-motion-duration: 0ms;
844
845
  }
845
846
  }
846
- .tui-interface {
847
+ :where(.tui-interface) {
847
848
  --tui-spacing-base: 4px;
848
849
  --tui-palette-spacing-1: calc(var(--tui-spacing-base) * 1);
849
850
  --tui-palette-spacing-2: calc(var(--tui-spacing-base) * 2);
@@ -2630,8 +2631,8 @@
2630
2631
  gap: var(--tui-spacing-xxs);
2631
2632
  min-height: var(--tui-control-height-md, 2.5rem);
2632
2633
  padding-inline: var(--tui-spacing-xxs);
2633
- border: var(--tui-border-width) solid var(--tui-color-border);
2634
- border-radius: var(--tui-radius-md);
2634
+ border: var(--tui-border-width) solid var(--tui-input-border, var(--tui-color-border));
2635
+ border-radius: var(--tui-input-radius, var(--tui-radius-md));
2635
2636
  background: var(--tui-input-bg, var(--tui-color-bg-surface));
2636
2637
  font-size: var(--tui-typography-size-xs);
2637
2638
  }
@@ -2713,8 +2714,8 @@
2713
2714
  min-block-size: var(--tui-control-height-md, 2.5rem);
2714
2715
  padding: var(--tui-spacing-xxs);
2715
2716
  padding-inline-end: var(--tui-spacing-sm);
2716
- border: var(--tui-border-width) solid var(--tui-color-border);
2717
- border-radius: var(--tui-radius-md);
2717
+ border: var(--tui-border-width) solid var(--tui-input-border, var(--tui-color-border));
2718
+ border-radius: var(--tui-input-radius, var(--tui-radius-md));
2718
2719
  background: var(--tui-input-bg, var(--tui-color-bg-surface));
2719
2720
  color: var(--tui-color-fg);
2720
2721
  font: inherit;
@@ -2732,6 +2733,15 @@
2732
2733
  .tui-interface .tui-color-field.is-swatch-only {
2733
2734
  padding-inline-end: var(--tui-spacing-xxs);
2734
2735
  }
2736
+ .tui-interface .tui-color-field.is-label-only {
2737
+ padding-inline-start: var(--tui-spacing-sm);
2738
+ }
2739
+ .tui-interface .tui-color-field.is-variant-bare {
2740
+ padding: 0;
2741
+ border: 0;
2742
+ background: transparent;
2743
+ min-block-size: 0;
2744
+ }
2735
2745
  .tui-interface .tui-color-field:hover {
2736
2746
  border-color: var(--tui-color-border-strong, var(--tui-color-border));
2737
2747
  }
@@ -2765,6 +2775,16 @@
2765
2775
  .tui-interface .tui-color-field.is-size-lg .tui-color-field__swatch {
2766
2776
  --_size: calc(var(--tui-control-height-lg, 3rem) - 2 * var(--tui-spacing-xxs) - 2 * var(--tui-border-width));
2767
2777
  }
2778
+ .tui-interface .tui-color-field.is-variant-bare .tui-color-field__swatch {
2779
+ --_size: var(--tui-control-height-md, 2.5rem);
2780
+ border-radius: inherit;
2781
+ }
2782
+ .tui-interface .tui-color-field.is-variant-bare.is-size-sm .tui-color-field__swatch {
2783
+ --_size: var(--tui-control-height-sm, 2rem);
2784
+ }
2785
+ .tui-interface .tui-color-field.is-variant-bare.is-size-lg .tui-color-field__swatch {
2786
+ --_size: var(--tui-control-height-lg, 3rem);
2787
+ }
2768
2788
  .tui-interface .tui-color-field__swatch-icon {
2769
2789
  font-size: 1.25rem;
2770
2790
  color: var(--_swatch-icon, #fff);
@@ -2789,6 +2809,9 @@
2789
2809
  max-inline-size: calc(100vw - 2rem);
2790
2810
  }
2791
2811
  @media (forced-colors: active) {
2812
+ .tui-interface .tui-color-field.is-variant-bare {
2813
+ border: var(--tui-border-width) solid ButtonText;
2814
+ }
2792
2815
  .tui-interface .tui-color-area:focus-visible,
2793
2816
  .tui-interface .tui-color-slider:focus-visible {
2794
2817
  outline-color: Highlight;
@@ -5065,9 +5088,22 @@
5065
5088
  padding-inline-end: calc(var(--_padding) + var(--tui-spacing-xl));
5066
5089
  }
5067
5090
  .tui-modal__dialog .tui-modal__foot {
5091
+ --_foot-gap: var(--tui-modal-foot-gap, var(--tui-spacing-sm));
5092
+ --_foot-justify: flex-end;
5068
5093
  padding-block: var(--_padding);
5069
5094
  padding-inline: var(--_padding);
5070
5095
  width: 100%;
5096
+ display: flex;
5097
+ flex-wrap: wrap;
5098
+ align-items: center;
5099
+ justify-content: var(--_foot-justify);
5100
+ gap: var(--_foot-gap);
5101
+ }
5102
+ .tui-modal__dialog .tui-modal__foot[data-justify=start] {
5103
+ --_foot-justify: flex-start;
5104
+ }
5105
+ .tui-modal__dialog .tui-modal__foot[data-justify=between] > :first-child {
5106
+ margin-inline-end: auto;
5071
5107
  }
5072
5108
  .tui-modal__dialog.is-size-sm {
5073
5109
  --_max: var(--tui-modal-max, 480px);
@@ -5261,27 +5297,27 @@
5261
5297
  .tui-interface .tui-move-handle__center {
5262
5298
  position: relative;
5263
5299
  }
5264
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5300
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5265
5301
  opacity: 1;
5266
5302
  }
5267
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5303
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5268
5304
  position: absolute;
5269
5305
  opacity: 0;
5270
5306
  pointer-events: none;
5271
5307
  }
5272
- .tui-interface .tui-move-handle.has-index:hover .tui-move-handle__index, .tui-interface .tui-move-handle.has-index:focus-within .tui-move-handle__index {
5308
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows):hover .tui-move-handle__index, .tui-interface .tui-move-handle.has-index:not(.is-arrows):focus-within .tui-move-handle__index {
5273
5309
  display: none;
5274
5310
  }
5275
- .tui-interface .tui-move-handle.has-index:hover .tui-move-handle__handle, .tui-interface .tui-move-handle.has-index:focus-within .tui-move-handle__handle {
5311
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows):hover .tui-move-handle__handle, .tui-interface .tui-move-handle.has-index:not(.is-arrows):focus-within .tui-move-handle__handle {
5276
5312
  position: static;
5277
5313
  opacity: 1;
5278
5314
  pointer-events: auto;
5279
5315
  }
5280
5316
  @media (hover: none) {
5281
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5317
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5282
5318
  display: none;
5283
5319
  }
5284
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5320
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5285
5321
  position: static;
5286
5322
  opacity: 1;
5287
5323
  pointer-events: auto;
@@ -5293,11 +5329,15 @@
5293
5329
  .tui-interface .tui-move-handle.is-locked {
5294
5330
  pointer-events: none;
5295
5331
  }
5296
- .tui-interface .tui-move-handle.is-arrows {
5332
+ .tui-interface .tui-move-handle.is-arrows:focus-visible {
5333
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
5334
+ outline-offset: var(--tui-focus-ring-offset);
5335
+ }
5336
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) {
5297
5337
  min-height: calc(2 * 16px);
5298
5338
  }
5299
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__up,
5300
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__down {
5339
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__up,
5340
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__down {
5301
5341
  flex: 1;
5302
5342
  min-height: 16px;
5303
5343
  }
@@ -7601,6 +7641,17 @@
7601
7641
  :where(.tui-interface) .tui-toast-region.is-placement-top-end, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7602
7642
  inset-inline-end: 0;
7603
7643
  }
7644
+ :where(.tui-interface) .tui-toast-region__announcer {
7645
+ position: absolute;
7646
+ width: 1px;
7647
+ height: 1px;
7648
+ padding: 0;
7649
+ margin: -1px;
7650
+ overflow: hidden;
7651
+ clip: rect(0 0 0 0);
7652
+ white-space: nowrap;
7653
+ border: 0;
7654
+ }
7604
7655
  .tui-interface .tui-toast {
7605
7656
  --tui-notice-fg: var(--tui-toast-fg, var(--tui-color-fg));
7606
7657
  --tui-notice-foot-basis: max-content;