@tangible/ui 0.2.52 → 0.2.54

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/components/Accordion/Accordion.js +10 -4
  2. package/components/Checkbox/Checkbox.js +7 -2
  3. package/components/ColorPicker/ColorField.js +15 -4
  4. package/components/DatePicker/DatePicker.js +2 -1
  5. package/components/DatePicker/DateRangePicker.js +2 -1
  6. package/components/DatePicker/PickerTrigger.js +2 -1
  7. package/components/Field/Field.js +19 -0
  8. package/components/Pager/Pager.d.ts +2 -1
  9. package/components/Pager/Pager.js +3 -114
  10. package/components/Switch/Switch.js +2 -0
  11. package/components/index.d.ts +2 -0
  12. package/components/index.js +3 -0
  13. package/figma-tokens.json +1 -1
  14. package/icons/icons.svg +1 -1
  15. package/icons/sprite-version.js +1 -1
  16. package/icons/sprite.php +1 -1
  17. package/package.json +9 -1
  18. package/skills/building-with-tui/SKILL.md +48 -2
  19. package/styles/all.css +1 -1
  20. package/styles/all.expanded.css +65 -25
  21. package/styles/all.expanded.unlayered.css +65 -25
  22. package/styles/all.unlayered.css +1 -1
  23. package/styles/components/checkbox.scss +53 -12
  24. package/styles/components/color-picker.scss +4 -1
  25. package/styles/components/move-handle.scss +17 -5
  26. package/styles/core.css +1 -1
  27. package/styles/core.unlayered.css +1 -1
  28. package/styles/index.scss +14 -0
  29. package/tui-manifest.json +5 -3
  30. package/utils/focus-trap.js +9 -2
  31. package/utils/pager.d.ts +49 -0
  32. package/utils/pager.js +129 -0
  33. package/utils/self-labelling.d.ts +12 -0
  34. package/utils/self-labelling.js +18 -0
  35. package/utils/tabbable.d.ts +1 -1
  36. package/utils/tabbable.js +20 -5
  37. package/vanilla/accordion.d.ts +94 -0
  38. package/vanilla/accordion.js +317 -0
  39. package/vanilla/accordion.min.js +1 -0
  40. package/vanilla/modal.js +2 -2
  41. package/vanilla/modal.min.js +1 -1
  42. package/vanilla/styles.css +1 -1
  43. package/vanilla/styles.unlayered.css +1 -1
@@ -62,6 +62,7 @@
62
62
  */
63
63
  /* @tui-tokens
64
64
  --tui-checkbox-accent
65
+ --tui-checkbox-icon
65
66
  --tui-checkbox-border
66
67
  --tui-checkbox-border-hover
67
68
  --tui-checkbox-border-invalid
@@ -290,6 +291,7 @@
290
291
  --tui-move-handle-bg
291
292
  --tui-move-handle-fg-interact
292
293
  --tui-move-handle-bg-interact
294
+ --tui-move-handle-fg-disabled
293
295
  */
294
296
  /* @tui-tokens
295
297
  --tui-notice-bg
@@ -1203,6 +1205,10 @@
1203
1205
  .tui-interface[data-theme] {
1204
1206
  color: var(--tui-color-fg);
1205
1207
  }
1208
+ .tui-interface[hidden]:not([hidden=until-found i]),
1209
+ .tui-interface [hidden]:not([hidden=until-found i]) {
1210
+ display: none !important;
1211
+ }
1206
1212
  .tui-interface,
1207
1213
  .tui-interface *,
1208
1214
  .tui-interface *::before,
@@ -2353,10 +2359,12 @@
2353
2359
  --_border: var(--_border-rest);
2354
2360
  --_radius: var(--tui-checkbox-radius, var(--tui-radius-sm));
2355
2361
  --_bg: var(--tui-checkbox-bg, var(--tui-color-bg));
2362
+ --_icon: var(--tui-checkbox-icon, var(--tui-theme-primary-on-base));
2356
2363
  appearance: none;
2357
2364
  margin: 0;
2358
2365
  font-size: inherit;
2359
2366
  display: inline-block;
2367
+ position: relative;
2360
2368
  width: 1em;
2361
2369
  min-width: 1em;
2362
2370
  height: 1em;
@@ -2365,10 +2373,25 @@
2365
2373
  border: var(--tui-border-width) solid var(--_border);
2366
2374
  border-radius: var(--_radius);
2367
2375
  background-color: var(--_bg);
2368
- background-size: 75%;
2369
- background-position: center;
2370
- background-repeat: no-repeat;
2371
2376
  cursor: pointer;
2377
+ print-color-adjust: exact;
2378
+ }
2379
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2380
+ .tui-inline-choice input[type=checkbox])::before {
2381
+ content: "";
2382
+ position: absolute;
2383
+ inset: 0;
2384
+ margin: auto;
2385
+ width: 75%;
2386
+ height: 75%;
2387
+ background-color: var(--_icon);
2388
+ print-color-adjust: exact;
2389
+ -webkit-mask: var(--_icon-shape, none) center/contain no-repeat;
2390
+ mask: var(--_icon-shape, none) center/contain no-repeat;
2391
+ visibility: hidden;
2392
+ }
2393
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2394
+ .tui-inline-choice input[type=checkbox]) {
2372
2395
  transition-duration: var(--tui-motion-duration);
2373
2396
  transition-timing-function: var(--tui-motion-timing);
2374
2397
  transition-property: background-color, border-color;
@@ -2377,13 +2400,21 @@
2377
2400
  .tui-inline-choice input[type=checkbox]):checked {
2378
2401
  background-color: var(--_accent);
2379
2402
  border-color: var(--_accent);
2380
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
2403
+ }
2404
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2405
+ .tui-inline-choice input[type=checkbox]):checked::before {
2406
+ --_icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
2407
+ visibility: visible;
2381
2408
  }
2382
2409
  .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2383
2410
  .tui-inline-choice input[type=checkbox]):indeterminate {
2384
2411
  background-color: var(--_accent);
2385
2412
  border-color: var(--_accent);
2386
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
2413
+ }
2414
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2415
+ .tui-inline-choice input[type=checkbox]):indeterminate::before {
2416
+ --_icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
2417
+ visibility: visible;
2387
2418
  }
2388
2419
  .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2389
2420
  .tui-inline-choice input[type=checkbox]):hover:not(:disabled) {
@@ -2430,6 +2461,11 @@
2430
2461
  .tui-inline-choice input[type=checkbox]) {
2431
2462
  forced-color-adjust: auto;
2432
2463
  }
2464
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2465
+ .tui-inline-choice input[type=checkbox])::before {
2466
+ forced-color-adjust: none;
2467
+ background-color: CanvasText;
2468
+ }
2433
2469
  .tui-interface .tui-inline-choice.is-disabled:has(input[type=checkbox]) > :not(input) {
2434
2470
  color: GrayText;
2435
2471
  }
@@ -6260,6 +6296,10 @@
6260
6296
  --tui-move-handle-bg-interact,
6261
6297
  var(--tui-theme-primary-subtlest)
6262
6298
  );
6299
+ --_fg-disabled: var(
6300
+ --tui-move-handle-fg-disabled,
6301
+ color-mix(in srgb, var(--_fg) 40%, transparent)
6302
+ );
6263
6303
  --_center-height: calc(var(--_size) * 0.6);
6264
6304
  display: inline-flex;
6265
6305
  flex-direction: column;
@@ -6310,7 +6350,7 @@
6310
6350
  }
6311
6351
  .tui-interface .tui-move-handle__up:disabled, .tui-interface .tui-move-handle__down:disabled {
6312
6352
  pointer-events: none;
6313
- opacity: var(--tui-opacity-disabled);
6353
+ color: var(--_fg-disabled);
6314
6354
  }
6315
6355
  .tui-interface .tui-move-handle__center {
6316
6356
  display: flex;
@@ -6471,34 +6511,34 @@
6471
6511
  min-height: 24px;
6472
6512
  }
6473
6513
  @media (forced-colors: active) {
6474
- .tui-move-handle__up,
6475
- .tui-move-handle__down,
6476
- .tui-move-handle__handle,
6477
- .tui-move-handle.is-handle {
6514
+ .tui-interface .tui-move-handle__up,
6515
+ .tui-interface .tui-move-handle__down,
6516
+ .tui-interface .tui-move-handle__handle,
6517
+ .tui-interface .tui-move-handle.is-handle {
6478
6518
  forced-color-adjust: none;
6479
6519
  color: CanvasText;
6480
6520
  }
6481
- .tui-move-handle__up:hover, .tui-move-handle__up:active,
6482
- .tui-move-handle__down:hover,
6483
- .tui-move-handle__down:active,
6484
- .tui-move-handle__handle:hover,
6485
- .tui-move-handle__handle:active,
6486
- .tui-move-handle.is-handle:hover,
6487
- .tui-move-handle.is-handle:active {
6521
+ .tui-interface .tui-move-handle__up:hover, .tui-interface .tui-move-handle__up:active,
6522
+ .tui-interface .tui-move-handle__down:hover,
6523
+ .tui-interface .tui-move-handle__down:active,
6524
+ .tui-interface .tui-move-handle__handle:hover,
6525
+ .tui-interface .tui-move-handle__handle:active,
6526
+ .tui-interface .tui-move-handle.is-handle:hover,
6527
+ .tui-interface .tui-move-handle.is-handle:active {
6488
6528
  background-color: Highlight;
6489
6529
  color: Canvas;
6490
6530
  }
6491
- .tui-move-handle__up:focus-visible,
6492
- .tui-move-handle__down:focus-visible,
6493
- .tui-move-handle__handle:focus-visible,
6494
- .tui-move-handle.is-handle:focus-visible {
6531
+ .tui-interface .tui-move-handle__up:focus-visible,
6532
+ .tui-interface .tui-move-handle__down:focus-visible,
6533
+ .tui-interface .tui-move-handle__handle:focus-visible,
6534
+ .tui-interface .tui-move-handle.is-handle:focus-visible {
6495
6535
  outline: 2px solid Highlight;
6496
6536
  outline-offset: 2px;
6497
6537
  }
6498
- .tui-move-handle__up:disabled,
6499
- .tui-move-handle__down:disabled,
6500
- .tui-move-handle__handle:disabled,
6501
- .tui-move-handle.is-handle:disabled {
6538
+ .tui-interface .tui-move-handle__up:disabled,
6539
+ .tui-interface .tui-move-handle__down:disabled,
6540
+ .tui-interface .tui-move-handle__handle:disabled,
6541
+ .tui-interface .tui-move-handle.is-handle:disabled {
6502
6542
  color: GrayText;
6503
6543
  }
6504
6544
  }
@@ -62,6 +62,7 @@
62
62
  */
63
63
  /* @tui-tokens
64
64
  --tui-checkbox-accent
65
+ --tui-checkbox-icon
65
66
  --tui-checkbox-border
66
67
  --tui-checkbox-border-hover
67
68
  --tui-checkbox-border-invalid
@@ -290,6 +291,7 @@
290
291
  --tui-move-handle-bg
291
292
  --tui-move-handle-fg-interact
292
293
  --tui-move-handle-bg-interact
294
+ --tui-move-handle-fg-disabled
293
295
  */
294
296
  /* @tui-tokens
295
297
  --tui-notice-bg
@@ -1203,6 +1205,10 @@
1203
1205
  .tui-interface[data-theme] {
1204
1206
  color: var(--tui-color-fg);
1205
1207
  }
1208
+ .tui-interface[hidden]:not([hidden=until-found i]),
1209
+ .tui-interface [hidden]:not([hidden=until-found i]) {
1210
+ display: none !important;
1211
+ }
1206
1212
  .tui-interface,
1207
1213
  .tui-interface *,
1208
1214
  .tui-interface *::before,
@@ -2353,10 +2359,12 @@
2353
2359
  --_border: var(--_border-rest);
2354
2360
  --_radius: var(--tui-checkbox-radius, var(--tui-radius-sm));
2355
2361
  --_bg: var(--tui-checkbox-bg, var(--tui-color-bg));
2362
+ --_icon: var(--tui-checkbox-icon, var(--tui-theme-primary-on-base));
2356
2363
  appearance: none;
2357
2364
  margin: 0;
2358
2365
  font-size: inherit;
2359
2366
  display: inline-block;
2367
+ position: relative;
2360
2368
  width: 1em;
2361
2369
  min-width: 1em;
2362
2370
  height: 1em;
@@ -2365,10 +2373,25 @@
2365
2373
  border: var(--tui-border-width) solid var(--_border);
2366
2374
  border-radius: var(--_radius);
2367
2375
  background-color: var(--_bg);
2368
- background-size: 75%;
2369
- background-position: center;
2370
- background-repeat: no-repeat;
2371
2376
  cursor: pointer;
2377
+ print-color-adjust: exact;
2378
+ }
2379
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2380
+ .tui-inline-choice input[type=checkbox])::before {
2381
+ content: "";
2382
+ position: absolute;
2383
+ inset: 0;
2384
+ margin: auto;
2385
+ width: 75%;
2386
+ height: 75%;
2387
+ background-color: var(--_icon);
2388
+ print-color-adjust: exact;
2389
+ -webkit-mask: var(--_icon-shape, none) center/contain no-repeat;
2390
+ mask: var(--_icon-shape, none) center/contain no-repeat;
2391
+ visibility: hidden;
2392
+ }
2393
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2394
+ .tui-inline-choice input[type=checkbox]) {
2372
2395
  transition-duration: var(--tui-motion-duration);
2373
2396
  transition-timing-function: var(--tui-motion-timing);
2374
2397
  transition-property: background-color, border-color;
@@ -2377,13 +2400,21 @@
2377
2400
  .tui-inline-choice input[type=checkbox]):checked {
2378
2401
  background-color: var(--_accent);
2379
2402
  border-color: var(--_accent);
2380
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
2403
+ }
2404
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2405
+ .tui-inline-choice input[type=checkbox]):checked::before {
2406
+ --_icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
2407
+ visibility: visible;
2381
2408
  }
2382
2409
  .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2383
2410
  .tui-inline-choice input[type=checkbox]):indeterminate {
2384
2411
  background-color: var(--_accent);
2385
2412
  border-color: var(--_accent);
2386
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
2413
+ }
2414
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2415
+ .tui-inline-choice input[type=checkbox]):indeterminate::before {
2416
+ --_icon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
2417
+ visibility: visible;
2387
2418
  }
2388
2419
  .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2389
2420
  .tui-inline-choice input[type=checkbox]):hover:not(:disabled) {
@@ -2430,6 +2461,11 @@
2430
2461
  .tui-inline-choice input[type=checkbox]) {
2431
2462
  forced-color-adjust: auto;
2432
2463
  }
2464
+ .tui-interface :is(.tui-inline-choice__control[type=checkbox],
2465
+ .tui-inline-choice input[type=checkbox])::before {
2466
+ forced-color-adjust: none;
2467
+ background-color: CanvasText;
2468
+ }
2433
2469
  .tui-interface .tui-inline-choice.is-disabled:has(input[type=checkbox]) > :not(input) {
2434
2470
  color: GrayText;
2435
2471
  }
@@ -6260,6 +6296,10 @@
6260
6296
  --tui-move-handle-bg-interact,
6261
6297
  var(--tui-theme-primary-subtlest)
6262
6298
  );
6299
+ --_fg-disabled: var(
6300
+ --tui-move-handle-fg-disabled,
6301
+ color-mix(in srgb, var(--_fg) 40%, transparent)
6302
+ );
6263
6303
  --_center-height: calc(var(--_size) * 0.6);
6264
6304
  display: inline-flex;
6265
6305
  flex-direction: column;
@@ -6310,7 +6350,7 @@
6310
6350
  }
6311
6351
  .tui-interface .tui-move-handle__up:disabled, .tui-interface .tui-move-handle__down:disabled {
6312
6352
  pointer-events: none;
6313
- opacity: var(--tui-opacity-disabled);
6353
+ color: var(--_fg-disabled);
6314
6354
  }
6315
6355
  .tui-interface .tui-move-handle__center {
6316
6356
  display: flex;
@@ -6471,34 +6511,34 @@
6471
6511
  min-height: 24px;
6472
6512
  }
6473
6513
  @media (forced-colors: active) {
6474
- .tui-move-handle__up,
6475
- .tui-move-handle__down,
6476
- .tui-move-handle__handle,
6477
- .tui-move-handle.is-handle {
6514
+ .tui-interface .tui-move-handle__up,
6515
+ .tui-interface .tui-move-handle__down,
6516
+ .tui-interface .tui-move-handle__handle,
6517
+ .tui-interface .tui-move-handle.is-handle {
6478
6518
  forced-color-adjust: none;
6479
6519
  color: CanvasText;
6480
6520
  }
6481
- .tui-move-handle__up:hover, .tui-move-handle__up:active,
6482
- .tui-move-handle__down:hover,
6483
- .tui-move-handle__down:active,
6484
- .tui-move-handle__handle:hover,
6485
- .tui-move-handle__handle:active,
6486
- .tui-move-handle.is-handle:hover,
6487
- .tui-move-handle.is-handle:active {
6521
+ .tui-interface .tui-move-handle__up:hover, .tui-interface .tui-move-handle__up:active,
6522
+ .tui-interface .tui-move-handle__down:hover,
6523
+ .tui-interface .tui-move-handle__down:active,
6524
+ .tui-interface .tui-move-handle__handle:hover,
6525
+ .tui-interface .tui-move-handle__handle:active,
6526
+ .tui-interface .tui-move-handle.is-handle:hover,
6527
+ .tui-interface .tui-move-handle.is-handle:active {
6488
6528
  background-color: Highlight;
6489
6529
  color: Canvas;
6490
6530
  }
6491
- .tui-move-handle__up:focus-visible,
6492
- .tui-move-handle__down:focus-visible,
6493
- .tui-move-handle__handle:focus-visible,
6494
- .tui-move-handle.is-handle:focus-visible {
6531
+ .tui-interface .tui-move-handle__up:focus-visible,
6532
+ .tui-interface .tui-move-handle__down:focus-visible,
6533
+ .tui-interface .tui-move-handle__handle:focus-visible,
6534
+ .tui-interface .tui-move-handle.is-handle:focus-visible {
6495
6535
  outline: 2px solid Highlight;
6496
6536
  outline-offset: 2px;
6497
6537
  }
6498
- .tui-move-handle__up:disabled,
6499
- .tui-move-handle__down:disabled,
6500
- .tui-move-handle__handle:disabled,
6501
- .tui-move-handle.is-handle:disabled {
6538
+ .tui-interface .tui-move-handle__up:disabled,
6539
+ .tui-interface .tui-move-handle__down:disabled,
6540
+ .tui-interface .tui-move-handle__handle:disabled,
6541
+ .tui-interface .tui-move-handle.is-handle:disabled {
6502
6542
  color: GrayText;
6503
6543
  }
6504
6544
  }