@tangible/ui 0.2.18 → 0.2.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.
Files changed (34) 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/Modal/Modal.d.ts +36 -2
  9. package/components/Modal/Modal.js +40 -11
  10. package/components/Modal/index.d.ts +1 -1
  11. package/components/MoveHandle/MoveHandle.js +25 -11
  12. package/components/MoveHandle/types.d.ts +9 -3
  13. package/components/Notice/Notice.js +7 -0
  14. package/components/Toast/Toast.d.ts +134 -0
  15. package/components/Toast/Toast.js +234 -0
  16. package/components/Toast/ToastContext.d.ts +11 -0
  17. package/components/Toast/ToastContext.js +9 -0
  18. package/components/Toast/index.d.ts +4 -0
  19. package/components/Toast/index.js +2 -0
  20. package/components/index.d.ts +5 -3
  21. package/components/index.js +2 -1
  22. package/figma-tokens.json +1 -1
  23. package/package.json +5 -1
  24. package/skills/building-with-tui/SKILL.md +16 -2
  25. package/styles/all.css +1 -1
  26. package/styles/all.expanded.css +114 -9
  27. package/styles/all.expanded.unlayered.css +114 -9
  28. package/styles/all.unlayered.css +1 -1
  29. package/styles/components/_bundle.scss +5 -0
  30. package/styles/components/modal.scss +31 -1
  31. package/styles/components/move-handle.scss +20 -4
  32. package/styles/components/notice.scss +13 -0
  33. package/styles/components/toast.scss +183 -0
  34. package/tui-manifest.json +157 -12
@@ -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
@@ -250,6 +251,8 @@
250
251
  --tui-notice-icon
251
252
  --tui-notice-title-size
252
253
  --tui-notice-foot-basis
254
+ --tui-notice-dismiss-bg-interact
255
+ --tui-notice-dismiss-bg-pressed
253
256
  */
254
257
  /* @tui-tokens
255
258
  --tui-overlap-stack-overlap
@@ -419,6 +422,14 @@
419
422
  --tui-input-group-gap
420
423
  */
421
424
  /* @tui-tokens
425
+ --tui-toast-width
426
+ --tui-toast-fg
427
+ --tui-toast-gap
428
+ --tui-toast-inset
429
+ --tui-toast-shadow
430
+ --tui-toast-z
431
+ */
432
+ /* @tui-tokens
422
433
  --tui-toolbar-gap
423
434
  --tui-toolbar-padding
424
435
  */
@@ -5055,9 +5066,22 @@
5055
5066
  padding-inline-end: calc(var(--_padding) + var(--tui-spacing-xl));
5056
5067
  }
5057
5068
  .tui-modal__dialog .tui-modal__foot {
5069
+ --_foot-gap: var(--tui-modal-foot-gap, var(--tui-spacing-sm));
5070
+ --_foot-justify: flex-end;
5058
5071
  padding-block: var(--_padding);
5059
5072
  padding-inline: var(--_padding);
5060
5073
  width: 100%;
5074
+ display: flex;
5075
+ flex-wrap: wrap;
5076
+ align-items: center;
5077
+ justify-content: var(--_foot-justify);
5078
+ gap: var(--_foot-gap);
5079
+ }
5080
+ .tui-modal__dialog .tui-modal__foot[data-justify=start] {
5081
+ --_foot-justify: flex-start;
5082
+ }
5083
+ .tui-modal__dialog .tui-modal__foot[data-justify=between] > :first-child {
5084
+ margin-inline-end: auto;
5061
5085
  }
5062
5086
  .tui-modal__dialog.is-size-sm {
5063
5087
  --_max: var(--tui-modal-max, 480px);
@@ -5251,27 +5275,27 @@
5251
5275
  .tui-interface .tui-move-handle__center {
5252
5276
  position: relative;
5253
5277
  }
5254
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5278
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5255
5279
  opacity: 1;
5256
5280
  }
5257
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5281
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5258
5282
  position: absolute;
5259
5283
  opacity: 0;
5260
5284
  pointer-events: none;
5261
5285
  }
5262
- .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 {
5286
+ .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 {
5263
5287
  display: none;
5264
5288
  }
5265
- .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 {
5289
+ .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 {
5266
5290
  position: static;
5267
5291
  opacity: 1;
5268
5292
  pointer-events: auto;
5269
5293
  }
5270
5294
  @media (hover: none) {
5271
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5295
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5272
5296
  display: none;
5273
5297
  }
5274
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5298
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5275
5299
  position: static;
5276
5300
  opacity: 1;
5277
5301
  pointer-events: auto;
@@ -5283,11 +5307,15 @@
5283
5307
  .tui-interface .tui-move-handle.is-locked {
5284
5308
  pointer-events: none;
5285
5309
  }
5286
- .tui-interface .tui-move-handle.is-arrows {
5310
+ .tui-interface .tui-move-handle.is-arrows:focus-visible {
5311
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
5312
+ outline-offset: var(--tui-focus-ring-offset);
5313
+ }
5314
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) {
5287
5315
  min-height: calc(2 * 16px);
5288
5316
  }
5289
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__up,
5290
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__down {
5317
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__up,
5318
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__down {
5291
5319
  flex: 1;
5292
5320
  min-height: 16px;
5293
5321
  }
@@ -5652,6 +5680,8 @@
5652
5680
  position: absolute;
5653
5681
  inset-block-start: var(--tui-notice-padding, var(--tui-spacing-md));
5654
5682
  inset-inline-end: var(--tui-notice-padding, var(--tui-spacing-md));
5683
+ --tui-icon-button-bg-interact: var(--tui-notice-dismiss-bg-interact, color-mix(in srgb, var(--tui-color-fg) 12%, transparent));
5684
+ --tui-icon-button-bg-pressed: var(--tui-notice-dismiss-bg-pressed, color-mix(in srgb, var(--tui-color-fg) 20%, transparent));
5655
5685
  }
5656
5686
  .tui-notice.is-layout-inline .tui-notice__dismiss {
5657
5687
  position: static;
@@ -7554,6 +7584,81 @@
7554
7584
  :where(.tui-interface) .tui-input-group:has(> .tui-input-group__suffix.is-text) {
7555
7585
  padding-inline-end: 0;
7556
7586
  }
7587
+ :where(.tui-interface) .tui-toast-region {
7588
+ --_gap: var(--tui-toast-gap, var(--tui-spacing-sm));
7589
+ --_inset: var(--tui-toast-inset, var(--tui-spacing-lg));
7590
+ --_enter-from: 0.5rem;
7591
+ position: fixed;
7592
+ z-index: var(--tui-toast-z, var(--tui-layer-top, 9999));
7593
+ display: flex;
7594
+ flex-direction: column;
7595
+ gap: var(--_gap);
7596
+ padding: var(--_inset);
7597
+ width: min(var(--tui-toast-width, 26rem) + var(--_inset) * 2, 100%);
7598
+ pointer-events: none;
7599
+ }
7600
+ :where(.tui-interface) .tui-toast-region:focus-visible {
7601
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
7602
+ outline-offset: calc(-1 * var(--tui-focus-ring-width));
7603
+ }
7604
+ :where(.tui-interface) .tui-toast-region.is-placement-top, :where(.tui-interface) .tui-toast-region.is-placement-bottom {
7605
+ inset-inline: 0;
7606
+ margin-inline: auto;
7607
+ }
7608
+ :where(.tui-interface) .tui-toast-region.is-placement-top-start, :where(.tui-interface) .tui-toast-region.is-placement-top, :where(.tui-interface) .tui-toast-region.is-placement-top-end {
7609
+ --_enter-from: -0.5rem;
7610
+ inset-block-start: 0;
7611
+ flex-direction: column-reverse;
7612
+ }
7613
+ :where(.tui-interface) .tui-toast-region.is-placement-bottom-start, :where(.tui-interface) .tui-toast-region.is-placement-bottom, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7614
+ inset-block-end: 0;
7615
+ }
7616
+ :where(.tui-interface) .tui-toast-region.is-placement-top-start, :where(.tui-interface) .tui-toast-region.is-placement-bottom-start {
7617
+ inset-inline-start: 0;
7618
+ }
7619
+ :where(.tui-interface) .tui-toast-region.is-placement-top-end, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7620
+ inset-inline-end: 0;
7621
+ }
7622
+ .tui-interface .tui-toast {
7623
+ --tui-notice-fg: var(--tui-toast-fg, var(--tui-color-fg));
7624
+ --tui-notice-foot-basis: max-content;
7625
+ box-shadow: var(--tui-toast-shadow, var(--tui-shadow-lg));
7626
+ pointer-events: auto;
7627
+ }
7628
+ .tui-interface .tui-toast .tui-toast__title {
7629
+ font-weight: var(--tui-typography-weight-semibold, 600);
7630
+ }
7631
+ .tui-interface .tui-toast .tui-toast__description {
7632
+ font-size: var(--tui-typography-size-sm);
7633
+ }
7634
+ .tui-interface .tui-toast .tui-notice__foot {
7635
+ flex-shrink: 0;
7636
+ }
7637
+ @media (forced-colors: active) {
7638
+ .tui-interface .tui-toast {
7639
+ background-color: Canvas;
7640
+ color: CanvasText;
7641
+ border: 1px solid CanvasText;
7642
+ }
7643
+ }
7644
+ :where(.tui-interface) .tui-toast {
7645
+ animation: tui-toastEnter var(--tui-motion-duration) var(--tui-motion-timing);
7646
+ }
7647
+ @media (prefers-reduced-motion: reduce) {
7648
+ :where(.tui-interface) .tui-toast {
7649
+ animation: none;
7650
+ }
7651
+ }
7652
+ @keyframes tui-toastEnter {
7653
+ from {
7654
+ opacity: 0;
7655
+ translate: 0 var(--_enter-from, 0.5rem);
7656
+ }
7657
+ to {
7658
+ opacity: 1;
7659
+ translate: 0 0;
7660
+ }
7661
+ }
7557
7662
  :where(.tui-interface) .tui-toolbar {
7558
7663
  --_gap: var(--tui-toolbar-gap, var(--tui-spacing-sm));
7559
7664
  --_padding: var(--tui-toolbar-padding, 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
@@ -250,6 +251,8 @@
250
251
  --tui-notice-icon
251
252
  --tui-notice-title-size
252
253
  --tui-notice-foot-basis
254
+ --tui-notice-dismiss-bg-interact
255
+ --tui-notice-dismiss-bg-pressed
253
256
  */
254
257
  /* @tui-tokens
255
258
  --tui-overlap-stack-overlap
@@ -419,6 +422,14 @@
419
422
  --tui-input-group-gap
420
423
  */
421
424
  /* @tui-tokens
425
+ --tui-toast-width
426
+ --tui-toast-fg
427
+ --tui-toast-gap
428
+ --tui-toast-inset
429
+ --tui-toast-shadow
430
+ --tui-toast-z
431
+ */
432
+ /* @tui-tokens
422
433
  --tui-toolbar-gap
423
434
  --tui-toolbar-padding
424
435
  */
@@ -5055,9 +5066,22 @@
5055
5066
  padding-inline-end: calc(var(--_padding) + var(--tui-spacing-xl));
5056
5067
  }
5057
5068
  .tui-modal__dialog .tui-modal__foot {
5069
+ --_foot-gap: var(--tui-modal-foot-gap, var(--tui-spacing-sm));
5070
+ --_foot-justify: flex-end;
5058
5071
  padding-block: var(--_padding);
5059
5072
  padding-inline: var(--_padding);
5060
5073
  width: 100%;
5074
+ display: flex;
5075
+ flex-wrap: wrap;
5076
+ align-items: center;
5077
+ justify-content: var(--_foot-justify);
5078
+ gap: var(--_foot-gap);
5079
+ }
5080
+ .tui-modal__dialog .tui-modal__foot[data-justify=start] {
5081
+ --_foot-justify: flex-start;
5082
+ }
5083
+ .tui-modal__dialog .tui-modal__foot[data-justify=between] > :first-child {
5084
+ margin-inline-end: auto;
5061
5085
  }
5062
5086
  .tui-modal__dialog.is-size-sm {
5063
5087
  --_max: var(--tui-modal-max, 480px);
@@ -5251,27 +5275,27 @@
5251
5275
  .tui-interface .tui-move-handle__center {
5252
5276
  position: relative;
5253
5277
  }
5254
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5278
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5255
5279
  opacity: 1;
5256
5280
  }
5257
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5281
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5258
5282
  position: absolute;
5259
5283
  opacity: 0;
5260
5284
  pointer-events: none;
5261
5285
  }
5262
- .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 {
5286
+ .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 {
5263
5287
  display: none;
5264
5288
  }
5265
- .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 {
5289
+ .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 {
5266
5290
  position: static;
5267
5291
  opacity: 1;
5268
5292
  pointer-events: auto;
5269
5293
  }
5270
5294
  @media (hover: none) {
5271
- .tui-interface .tui-move-handle.has-index .tui-move-handle__index {
5295
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__index {
5272
5296
  display: none;
5273
5297
  }
5274
- .tui-interface .tui-move-handle.has-index .tui-move-handle__handle {
5298
+ .tui-interface .tui-move-handle.has-index:not(.is-arrows) .tui-move-handle__handle {
5275
5299
  position: static;
5276
5300
  opacity: 1;
5277
5301
  pointer-events: auto;
@@ -5283,11 +5307,15 @@
5283
5307
  .tui-interface .tui-move-handle.is-locked {
5284
5308
  pointer-events: none;
5285
5309
  }
5286
- .tui-interface .tui-move-handle.is-arrows {
5310
+ .tui-interface .tui-move-handle.is-arrows:focus-visible {
5311
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
5312
+ outline-offset: var(--tui-focus-ring-offset);
5313
+ }
5314
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) {
5287
5315
  min-height: calc(2 * 16px);
5288
5316
  }
5289
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__up,
5290
- .tui-interface .tui-move-handle.is-arrows .tui-move-handle__down {
5317
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__up,
5318
+ .tui-interface .tui-move-handle.is-arrows:not(.has-index) .tui-move-handle__down {
5291
5319
  flex: 1;
5292
5320
  min-height: 16px;
5293
5321
  }
@@ -5652,6 +5680,8 @@
5652
5680
  position: absolute;
5653
5681
  inset-block-start: var(--tui-notice-padding, var(--tui-spacing-md));
5654
5682
  inset-inline-end: var(--tui-notice-padding, var(--tui-spacing-md));
5683
+ --tui-icon-button-bg-interact: var(--tui-notice-dismiss-bg-interact, color-mix(in srgb, var(--tui-color-fg) 12%, transparent));
5684
+ --tui-icon-button-bg-pressed: var(--tui-notice-dismiss-bg-pressed, color-mix(in srgb, var(--tui-color-fg) 20%, transparent));
5655
5685
  }
5656
5686
  .tui-notice.is-layout-inline .tui-notice__dismiss {
5657
5687
  position: static;
@@ -7554,6 +7584,81 @@
7554
7584
  :where(.tui-interface) .tui-input-group:has(> .tui-input-group__suffix.is-text) {
7555
7585
  padding-inline-end: 0;
7556
7586
  }
7587
+ :where(.tui-interface) .tui-toast-region {
7588
+ --_gap: var(--tui-toast-gap, var(--tui-spacing-sm));
7589
+ --_inset: var(--tui-toast-inset, var(--tui-spacing-lg));
7590
+ --_enter-from: 0.5rem;
7591
+ position: fixed;
7592
+ z-index: var(--tui-toast-z, var(--tui-layer-top, 9999));
7593
+ display: flex;
7594
+ flex-direction: column;
7595
+ gap: var(--_gap);
7596
+ padding: var(--_inset);
7597
+ width: min(var(--tui-toast-width, 26rem) + var(--_inset) * 2, 100%);
7598
+ pointer-events: none;
7599
+ }
7600
+ :where(.tui-interface) .tui-toast-region:focus-visible {
7601
+ outline: var(--tui-focus-ring-width) solid var(--tui-focus-ring-color);
7602
+ outline-offset: calc(-1 * var(--tui-focus-ring-width));
7603
+ }
7604
+ :where(.tui-interface) .tui-toast-region.is-placement-top, :where(.tui-interface) .tui-toast-region.is-placement-bottom {
7605
+ inset-inline: 0;
7606
+ margin-inline: auto;
7607
+ }
7608
+ :where(.tui-interface) .tui-toast-region.is-placement-top-start, :where(.tui-interface) .tui-toast-region.is-placement-top, :where(.tui-interface) .tui-toast-region.is-placement-top-end {
7609
+ --_enter-from: -0.5rem;
7610
+ inset-block-start: 0;
7611
+ flex-direction: column-reverse;
7612
+ }
7613
+ :where(.tui-interface) .tui-toast-region.is-placement-bottom-start, :where(.tui-interface) .tui-toast-region.is-placement-bottom, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7614
+ inset-block-end: 0;
7615
+ }
7616
+ :where(.tui-interface) .tui-toast-region.is-placement-top-start, :where(.tui-interface) .tui-toast-region.is-placement-bottom-start {
7617
+ inset-inline-start: 0;
7618
+ }
7619
+ :where(.tui-interface) .tui-toast-region.is-placement-top-end, :where(.tui-interface) .tui-toast-region.is-placement-bottom-end {
7620
+ inset-inline-end: 0;
7621
+ }
7622
+ .tui-interface .tui-toast {
7623
+ --tui-notice-fg: var(--tui-toast-fg, var(--tui-color-fg));
7624
+ --tui-notice-foot-basis: max-content;
7625
+ box-shadow: var(--tui-toast-shadow, var(--tui-shadow-lg));
7626
+ pointer-events: auto;
7627
+ }
7628
+ .tui-interface .tui-toast .tui-toast__title {
7629
+ font-weight: var(--tui-typography-weight-semibold, 600);
7630
+ }
7631
+ .tui-interface .tui-toast .tui-toast__description {
7632
+ font-size: var(--tui-typography-size-sm);
7633
+ }
7634
+ .tui-interface .tui-toast .tui-notice__foot {
7635
+ flex-shrink: 0;
7636
+ }
7637
+ @media (forced-colors: active) {
7638
+ .tui-interface .tui-toast {
7639
+ background-color: Canvas;
7640
+ color: CanvasText;
7641
+ border: 1px solid CanvasText;
7642
+ }
7643
+ }
7644
+ :where(.tui-interface) .tui-toast {
7645
+ animation: tui-toastEnter var(--tui-motion-duration) var(--tui-motion-timing);
7646
+ }
7647
+ @media (prefers-reduced-motion: reduce) {
7648
+ :where(.tui-interface) .tui-toast {
7649
+ animation: none;
7650
+ }
7651
+ }
7652
+ @keyframes tui-toastEnter {
7653
+ from {
7654
+ opacity: 0;
7655
+ translate: 0 var(--_enter-from, 0.5rem);
7656
+ }
7657
+ to {
7658
+ opacity: 1;
7659
+ translate: 0 0;
7660
+ }
7661
+ }
7557
7662
  :where(.tui-interface) .tui-toolbar {
7558
7663
  --_gap: var(--tui-toolbar-gap, var(--tui-spacing-sm));
7559
7664
  --_padding: var(--tui-toolbar-padding, 0);