@threadlabs/looma 0.44.1 → 0.44.3

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 (89) hide show
  1. package/components/shared/icons.js +1 -0
  2. package/components/ui-badge/ui-badge.html +7 -6
  3. package/components/ui-button/ui-button.html +47 -2
  4. package/components/ui-card/ui-card.html +6 -6
  5. package/components/ui-color-picker/ui-color-picker.html +12 -5
  6. package/components/ui-color-picker/ui-color-picker.js +20 -6
  7. package/components/ui-dialog/ui-dialog.html +5 -6
  8. package/components/ui-disclosure/ui-disclosure.html +1 -1
  9. package/components/ui-icon/ui-icon.html +1 -0
  10. package/components/ui-icon-button/ui-icon-button.html +59 -4
  11. package/components/ui-menu/ui-menu.html +5 -6
  12. package/components/ui-number-input/ui-number-input.html +7 -0
  13. package/components/ui-popover/ui-popover.html +5 -6
  14. package/components/ui-slider/ui-slider.html +6 -0
  15. package/components/ui-tooltip/ui-tooltip.html +8 -5
  16. package/components/ui-tree-item/ui-tree-item.html +7 -1
  17. package/dist/index.js +1 -1
  18. package/docs/README.md +18 -4
  19. package/docs/catalog.json +474 -3705
  20. package/docs/customizer-render.mjs +55 -36
  21. package/docs/customizer.js +48 -33
  22. package/docs/fonts.mjs +28 -0
  23. package/docs/index.d.ts +1 -1
  24. package/docs/navigation.mjs +26 -0
  25. package/docs/site.mjs +5 -1
  26. package/docs/theme.mjs +39 -14
  27. package/editor/icons.d.ts +1 -0
  28. package/editor/index.js +2 -1
  29. package/package.json +1 -1
  30. package/styles/ui-badge.css +11 -10
  31. package/styles/ui-button.css +47 -2
  32. package/styles/ui-card.css +4 -4
  33. package/styles/ui-color-picker.css +105 -2
  34. package/styles/ui-dialog.css +10 -12
  35. package/styles/ui-disclosure.css +1 -1
  36. package/styles/ui-icon-button.css +59 -4
  37. package/styles/ui-menu.css +5 -6
  38. package/styles/ui-number-input.css +6 -0
  39. package/styles/ui-popover.css +5 -6
  40. package/styles/ui-slider.css +3 -0
  41. package/styles/ui-tooltip.css +8 -5
  42. package/styles/ui-tree-item.css +12 -2
  43. package/theme-system.css +28 -16
  44. package/tokens.css +7 -0
  45. package/vanilla/UiColorPicker.d.ts +1 -0
  46. package/vanilla/UiColorPicker.js +32 -28
  47. package/vanilla/UiIcon.js +1 -1
  48. package/vanilla/UiNumberInput.d.ts +1 -0
  49. package/vanilla/UiNumberInput.js +53 -43
  50. package/vanilla/UiSlider.d.ts +1 -0
  51. package/vanilla/UiSlider.js +65 -57
  52. package/vanilla/UiTreeItem.js +1 -1
  53. package/vue/UiBadge.vue +7 -9
  54. package/vue/UiButton.vue +56 -2
  55. package/vue/UiCard.vue +13 -5
  56. package/vue/UiColorPicker.d.ts +6 -0
  57. package/vue/UiColorPicker.vue +156 -6
  58. package/vue/UiDialog.vue +22 -12
  59. package/vue/UiDisclosure.vue +1 -1
  60. package/vue/UiIcon.vue +1 -0
  61. package/vue/UiIconButton.vue +62 -4
  62. package/vue/UiMenu.vue +11 -6
  63. package/vue/UiNumberInput.d.ts +6 -0
  64. package/vue/UiNumberInput.vue +47 -1
  65. package/vue/UiPopover.vue +11 -6
  66. package/vue/UiSlider.d.ts +6 -0
  67. package/vue/UiSlider.vue +37 -1
  68. package/vue/UiTooltip.vue +11 -5
  69. package/vue/UiTreeItem.vue +19 -3
  70. package/vue/chunks/UiBadge.js +1 -1
  71. package/vue/chunks/UiButton.js +1 -1
  72. package/vue/chunks/UiCard.js +2 -2
  73. package/vue/chunks/UiColorPicker.js +60 -11
  74. package/vue/chunks/UiDialog.js +1 -1
  75. package/vue/chunks/UiDisclosure.js +1 -1
  76. package/vue/chunks/UiIcon.js +5 -1
  77. package/vue/chunks/UiIconButton.js +1 -1
  78. package/vue/chunks/UiMenu.js +1 -1
  79. package/vue/chunks/UiNumberInput.js +31 -2
  80. package/vue/chunks/UiPopover.js +1 -1
  81. package/vue/chunks/UiSlider.js +33 -2
  82. package/vue/chunks/UiTooltip.js +1 -1
  83. package/vue/chunks/UiTreeItem.js +3 -3
  84. package/vue/components.css +459 -86
  85. package/vue/editor/index.js +4 -0
  86. package/docs/examples/ui-editor-footnote-editor/examples/01-note.behavior.js +0 -9
  87. package/docs/examples/ui-editor-mention-menu/examples/00-preview.behavior.js +0 -1
  88. package/docs/examples/ui-editor-slash-menu/examples/00-preview.behavior.js +0 -81
  89. package/docs/examples/ui-editor-table-overlay/examples/00-preview.behavior.js +0 -24
package/vue/UiButton.vue CHANGED
@@ -1028,6 +1028,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1028
1028
  --_tone-hover-border: var(--ui-accent-hover-border, var(--ui-accent-hover));
1029
1029
  --_tone-active-border: var(--ui-accent-active-border, var(--ui-accent-active));
1030
1030
  --_tone-highlight: var(--ui-accent-highlight, none);
1031
+ --_tone-hover-highlight: var(--ui-accent-hover-highlight, none);
1032
+ --_tone-outline-border: var(--ui-accent-outline-border, var(--ui-accent-subtle-text));
1031
1033
  --_tone-glow: var(--ui-accent-glow, 0 0 transparent);
1032
1034
  --_hue: var(--ui-accent);
1033
1035
  --_hue-hover: var(--ui-accent-hover);
@@ -1201,11 +1203,30 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1201
1203
  align-items: center !important;
1202
1204
  align-self: center;
1203
1205
  }
1206
+
1207
+ :global(:scope[data-appearance="outline"]:not([data-tone="neutral"]):where([data-hn-ui-button])) {
1208
+ --_outline-wash: oklch(from var(--_tone-text) l c h / calc(4% * var(--ui-tonal-opacity, 1)));
1209
+ border-color: var(--ui-button-border, var(--_tone-outline-border, var(--_tone-text)));
1210
+ background-color: var(--ui-button-surface, transparent);
1211
+ box-shadow: var(--ui-button-shadow, var(--ui-neutral-shadow));
1212
+ background-image:
1213
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
1214
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
1215
+ }
1216
+
1217
+ :global(:scope[data-appearance="outline"]:not([data-tone="neutral"]):hover:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1218
+ --_outline-wash: oklch(from var(--_tone-text) l c h / calc(9% * var(--ui-tonal-opacity, 1)));
1219
+ background-color: var(--ui-button-hover-surface, transparent);
1220
+ border-color: var(
1221
+ --ui-button-hover-border,
1222
+ color-mix(in srgb, var(--_tone-text) 35%, var(--_tone-outline-border))
1223
+ );
1224
+ }
1204
1225
  :global(:scope:hover:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1205
1226
  border-color: var(--ui-button-hover-border, var(--_tone-text));
1206
1227
  background-color: var(
1207
1228
  --ui-button-hover-surface,
1208
- oklch(from var(--_tone) l c h / calc(12% * var(--ui-tonal-opacity, 1)))
1229
+ oklch(from var(--_tone-text) l c h / calc(12% * var(--ui-tonal-opacity, 1)))
1209
1230
  );
1210
1231
  }
1211
1232
 
@@ -1222,7 +1243,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1222
1243
  border-color: var(--ui-selection-border);
1223
1244
  color: var(--ui-selection-text);
1224
1245
  }
1225
- :global(:scope:active:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1246
+ :global(:scope:active:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])),
1247
+ :global(:scope[data-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1226
1248
  scale: var(--ui-press-scale, 1);
1227
1249
  background-color: var(
1228
1250
  --ui-button-active-surface,
@@ -1246,6 +1268,7 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1246
1268
  :global(:scope[data-appearance="solid"]:hover:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])),
1247
1269
  :global(:scope[data-appearance="danger"]:hover:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1248
1270
  background-color: var(--_tone-hover);
1271
+ background-image: var(--_tone-hover-highlight);
1249
1272
  border-color: var(--ui-button-hover-border, var(--_tone-hover-border));
1250
1273
  }
1251
1274
 
@@ -1263,6 +1286,11 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1263
1286
  var(--ui-accent-secondary-active)
1264
1287
  );
1265
1288
  --_tone-highlight: var(--ui-accent-secondary-highlight, none);
1289
+ --_tone-hover-highlight: var(--ui-accent-secondary-hover-highlight, none);
1290
+ --_tone-outline-border: var(
1291
+ --ui-accent-secondary-outline-border,
1292
+ var(--ui-accent-secondary-subtle-text)
1293
+ );
1266
1294
  --_tone-glow: var(--ui-accent-secondary-glow, 0 0 transparent);
1267
1295
  --_hue: var(--ui-accent-secondary);
1268
1296
  --_hue-hover: var(--ui-accent-secondary-hover);
@@ -1279,6 +1307,11 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1279
1307
  var(--ui-accent-tertiary-active)
1280
1308
  );
1281
1309
  --_tone-highlight: var(--ui-accent-tertiary-highlight, none);
1310
+ --_tone-hover-highlight: var(--ui-accent-tertiary-hover-highlight, none);
1311
+ --_tone-outline-border: var(
1312
+ --ui-accent-tertiary-outline-border,
1313
+ var(--ui-accent-tertiary-subtle-text)
1314
+ );
1282
1315
  --_tone-glow: var(--ui-accent-tertiary-glow, 0 0 transparent);
1283
1316
  --_hue: var(--ui-accent-tertiary);
1284
1317
  --_hue-hover: var(--ui-accent-tertiary-hover);
@@ -1292,6 +1325,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1292
1325
  --_tone-hover-border: var(--ui-control-border-hover, var(--ui-neutral-hover));
1293
1326
  --_tone-active-border: var(--ui-control-border-hover, var(--ui-neutral-active));
1294
1327
  --_tone-highlight: var(--ui-neutral-highlight, none);
1328
+ --_tone-hover-highlight: var(--ui-neutral-highlight, var(--_tone-highlight));
1329
+ --_tone-outline-border: var(--ui-control-border);
1295
1330
  --_tone-glow: var(--ui-neutral-glow, 0 0 transparent);
1296
1331
  --_hue: var(--ui-text);
1297
1332
  --_hue-hover: var(--ui-text);
@@ -1314,8 +1349,13 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1314
1349
  :global(:scope[data-tone="neutral"][data-appearance="outline"]:hover:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1315
1350
  border-color: var(--ui-button-hover-border, var(--ui-control-border-hover));
1316
1351
  background-color: var(--ui-button-hover-surface, var(--ui-neutral-hover));
1352
+ --_outline-wash: oklch(from var(--ui-text) l c h / 5%);
1353
+ background-image:
1354
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
1355
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
1317
1356
  }
1318
1357
  :global(:scope[data-tone="neutral"][data-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]):where([data-hn-ui-button])) {
1358
+ background-image: none;
1319
1359
  border-color: var(--ui-button-hover-border, var(--ui-control-border-hover));
1320
1360
  background-color: var(--ui-button-active-surface, var(--ui-neutral-active));
1321
1361
  }
@@ -1334,6 +1374,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1334
1374
  --_tone-hover-border: var(--ui-danger-hover-border, var(--ui-danger-hover));
1335
1375
  --_tone-active-border: var(--ui-danger-active-border, var(--ui-danger-active));
1336
1376
  --_tone-highlight: var(--ui-danger-highlight, none);
1377
+ --_tone-hover-highlight: var(--ui-danger-hover-highlight, none);
1378
+ --_tone-outline-border: var(--ui-danger-outline-border, var(--ui-danger-subtle-text));
1337
1379
  --_tone-glow: var(--ui-danger-glow, 0 0 transparent);
1338
1380
  --_hue: var(--ui-danger);
1339
1381
  --_hue-hover: var(--ui-danger-hover);
@@ -1347,6 +1389,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1347
1389
  --_tone-hover-border: var(--ui-success-hover-border, var(--ui-success-hover));
1348
1390
  --_tone-active-border: var(--ui-success-active-border, var(--ui-success-active));
1349
1391
  --_tone-highlight: var(--ui-success-highlight, none);
1392
+ --_tone-hover-highlight: var(--ui-success-hover-highlight, none);
1393
+ --_tone-outline-border: var(--ui-success-outline-border, var(--ui-success-subtle-text));
1350
1394
  --_tone-glow: var(--ui-success-glow, 0 0 transparent);
1351
1395
  --_hue: var(--ui-success);
1352
1396
  --_hue-hover: var(--ui-success-hover);
@@ -1360,6 +1404,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1360
1404
  --_tone-hover-border: var(--ui-warning-hover-border, var(--ui-warning-hover));
1361
1405
  --_tone-active-border: var(--ui-warning-active-border, var(--ui-warning-active));
1362
1406
  --_tone-highlight: var(--ui-warning-highlight, none);
1407
+ --_tone-hover-highlight: var(--ui-warning-hover-highlight, none);
1408
+ --_tone-outline-border: var(--ui-warning-outline-border, var(--ui-warning-subtle-text));
1363
1409
  --_tone-glow: var(--ui-warning-glow, 0 0 transparent);
1364
1410
  --_hue: var(--ui-warning);
1365
1411
  --_hue-hover: var(--ui-warning-hover);
@@ -1373,6 +1419,8 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1373
1419
  --_tone-hover-border: var(--ui-info-hover-border, var(--ui-info-hover));
1374
1420
  --_tone-active-border: var(--ui-info-active-border, var(--ui-info-active));
1375
1421
  --_tone-highlight: var(--ui-info-highlight, none);
1422
+ --_tone-hover-highlight: var(--ui-info-hover-highlight, none);
1423
+ --_tone-outline-border: var(--ui-info-outline-border, var(--ui-info-subtle-text));
1376
1424
  --_tone-glow: var(--ui-info-glow, 0 0 transparent);
1377
1425
  --_hue: var(--ui-info);
1378
1426
  --_hue-hover: var(--ui-info-hover);
@@ -1443,6 +1491,12 @@ useComponentHost(() => import('../components/ui-button/ui-button.js'), {
1443
1491
  var(--ui-focus-halo);
1444
1492
  }
1445
1493
 
1494
+ :global(:scope[data-appearance="outline"]:focus-visible:where([data-hn-ui-button])) {
1495
+ box-shadow:
1496
+ var(--ui-button-shadow, var(--ui-neutral-shadow)),
1497
+ var(--ui-focus-halo);
1498
+ }
1499
+
1446
1500
  :global(:scope[data-appearance="solid"]:focus-visible:where([data-hn-ui-button])) {
1447
1501
  box-shadow:
1448
1502
  var(--ui-button-solid-shadow, var(--ui-action-shadow, var(--_ui-action-shadow))),
package/vue/UiCard.vue CHANGED
@@ -69,7 +69,7 @@ const propValidityContract = {
69
69
  required: false,
70
70
  target: { attribute: 'treatment' },
71
71
  description:
72
- 'How much of the theme\'s decorative material the surface expresses. standard preserves its restrained treatment; expressive uses the full material\n treatment. Its glass rim can transmit and frost the surrounding scene while content remains opaque. Surface separation controls the rim, independently of\n frosting. This does not add elevation or require glass.',
72
+ 'How much of the theme\'s decorative material the surface expresses. standard preserves its restrained treatment; expressive uses the full material\n treatment. Its glass rim can transmit and frost the surrounding scene while content stays nearly opaque. Surface separation controls the rim,\n independently of frosting. This does not add elevation or require glass.',
73
73
  values: ['standard', 'expressive'],
74
74
  default: 'standard',
75
75
  },
@@ -361,19 +361,27 @@ const hostState = computed(() =>
361
361
  }
362
362
 
363
363
  :global(:scope[data-ui-card-state~="treatment=expressive"]:where([data-hn-ui-card])) {
364
+ --_ui-card-material-content: color-mix(
365
+ in srgb,
366
+ var(--_ui-card-surface) calc(var(--_ui-material-content-alpha, 1) * 100%),
367
+ transparent
368
+ );
364
369
  --_ui-panel-glass: clamp(0, var(--ui-glassiness, 0), 1);
365
370
  --_ui-panel-separation: clamp(0, var(--ui-surface-separation, 0), 1);
366
371
  --_ui-panel-rim: calc(var(--_ui-panel-separation) * 8px);
367
372
  border-width: calc(var(--ui-border-width) + var(--_ui-panel-rim));
368
373
  border-color: transparent;
369
374
  background:
370
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
371
- linear-gradient(var(--_ui-card-surface), var(--_ui-card-surface)) padding-box,
375
+ var(
376
+ --ui-material-highlight,
377
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent))
378
+ ) padding-box,
379
+ linear-gradient(var(--_ui-card-material-content), var(--_ui-card-material-content))
380
+ padding-box,
372
381
  linear-gradient(
373
382
  var(--ui-material-glass, var(--ui-surface-raised)),
374
383
  var(--ui-material-glass, var(--ui-surface-raised))
375
- ) border-box,
376
- var(--_ui-card-surface) padding-box;
384
+ ) border-box;
377
385
  box-shadow:
378
386
  var(--_ui-card-elevation),
379
387
  var(--ui-material-glow, 0 0 transparent),
@@ -1,6 +1,9 @@
1
1
  import type { PropType } from 'vue';
2
2
  import { type InputBindings } from './props.js';
3
3
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ clearable: {
5
+ type: PropType<boolean | null>;
6
+ };
4
7
  disabled: {
5
8
  type: PropType<boolean | null>;
6
9
  };
@@ -31,6 +34,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
31
34
  }>) => any;
32
35
  "update:value": (value: string) => any;
33
36
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
37
+ clearable: {
38
+ type: PropType<boolean | null>;
39
+ };
34
40
  disabled: {
35
41
  type: PropType<boolean | null>;
36
42
  };
@@ -21,12 +21,22 @@ import {
21
21
  vPropValidity,
22
22
  vuePropInputs,
23
23
  } from './props'
24
+ import UiButton from './UiButton.vue'
25
+ import UiIcon from './UiIcon.vue'
24
26
  import UiInput from './UiInput.vue'
25
27
 
26
28
  defineOptions({ inheritAttrs: false })
27
29
 
28
30
  const propValidityContract = {
29
31
  props: {
32
+ clearable: {
33
+ type: { kind: 'terminal', name: 'boolean' },
34
+ required: false,
35
+ target: { attribute: 'clearable' },
36
+ description:
37
+ 'Allows None in the editor. An empty value shows a slashed swatch and emits the same input/change events with an empty string.',
38
+ default: false,
39
+ },
30
40
  disabled: {
31
41
  type: { kind: 'terminal', name: 'boolean' },
32
42
  required: false,
@@ -69,12 +79,13 @@ const propValidityContract = {
69
79
  required: false,
70
80
  target: { attribute: 'value' },
71
81
  description:
72
- 'An opaque sRGB colour as six hexadecimal digits prefixed with #. User edits emit input and change with detail.value. Invalid values are ignored. This\n control does not submit a named form value.',
82
+ 'An opaque sRGB colour as six hexadecimal digits prefixed with #, or an empty string for None when clearable. User edits emit input and change with\n detail.value. Invalid values are ignored. Set name to include the value in form submission.',
73
83
  default: '#000000',
74
84
  },
75
85
  },
76
86
  } as const
77
87
  const props = defineProps({
88
+ clearable: { type: null as unknown as PropType<boolean | null> },
78
89
  disabled: { type: null as unknown as PropType<boolean | null> },
79
90
  label: { type: null as unknown as PropType<string | null> },
80
91
  name: { type: null as unknown as PropType<string | null> },
@@ -84,6 +95,7 @@ const props = defineProps({
84
95
  [BINDING_INPUTS_PROP]: { type: null as unknown as PropType<InputBindings> },
85
96
  })
86
97
  const acceptedProps: Record<string, unknown> = {
98
+ clearable: false,
87
99
  disabled: false,
88
100
  label: 'Choose colour',
89
101
  name: '',
@@ -92,6 +104,7 @@ const acceptedProps: Record<string, unknown> = {
92
104
  value: '#000000',
93
105
  }
94
106
  const inputTracking = vuePropInputs(acceptedProps, {
107
+ clearable: false,
95
108
  disabled: false,
96
109
  label: 'Choose colour',
97
110
  name: '',
@@ -100,6 +113,8 @@ const inputTracking = vuePropInputs(acceptedProps, {
100
113
  value: '#000000',
101
114
  }, (name, value, source, values) => {
102
115
  switch (name) {
116
+ case 'clearable':
117
+ return checkPropInput(value, { kind: 'terminal', name: 'boolean' }, true, true)
103
118
  case 'disabled':
104
119
  return checkPropInput(value, { kind: 'terminal', name: 'boolean' }, true, true)
105
120
  case 'label':
@@ -122,6 +137,11 @@ const propInputs = inputTracking.inputs
122
137
  const checkedProps = computed(() => {
123
138
  void inputTracking.version.value
124
139
  return ({
140
+ clearable: propInputs.value<boolean | null>(
141
+ 'clearable',
142
+ props['clearable'],
143
+ props[BINDING_INPUTS_PROP],
144
+ ) as boolean,
125
145
  disabled: propInputs.value<boolean | null>(
126
146
  'disabled',
127
147
  props['disabled'],
@@ -175,11 +195,13 @@ const root = ref<HTMLElement | null>(null)
175
195
  const fieldElement = useTemplateRef<HTMLElement>('fieldElement')
176
196
  const triggerElement = useTemplateRef<HTMLElement>('triggerElement')
177
197
  const colourElement = useTemplateRef<HTMLElement>('colourElement')
198
+ const emptyMarkElement = useTemplateRef<HTMLElement>('emptyMarkElement')
178
199
  const editorElement = useTemplateRef<HTMLElement>('editorElement')
179
200
  const redElement = useTemplateRef<HTMLElement>('redElement')
180
201
  const greenElement = useTemplateRef<HTMLElement>('greenElement')
181
202
  const blueElement = useTemplateRef<HTMLElement>('blueElement')
182
203
  const hexElement = useTemplateRef<HTMLElement>('hexElement')
204
+ const clearElement = useTemplateRef<HTMLElement>('clearElement')
183
205
  checkHydratedRoot('span', 'ui-color-picker')
184
206
 
185
207
  /** The values the styles' :host() and :state() rules test. */
@@ -222,18 +244,20 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
222
244
  ? (incoming[name] ?? incoming[kebab] ?? null)
223
245
  : null
224
246
  },
225
- propNames: ['disabled', 'label', 'name', 'round', 'size', 'value'],
247
+ propNames: ['clearable', 'disabled', 'label', 'name', 'round', 'size', 'value'],
226
248
  propValidity: (name: string) =>
227
249
  propValidityState({ contract: propValidityContract, values: { ...props } }, name),
228
250
  refs: {
229
251
  field: fieldElement,
230
252
  trigger: triggerElement,
231
253
  colour: colourElement,
254
+ emptyMark: emptyMarkElement,
232
255
  editor: editorElement,
233
256
  red: redElement,
234
257
  green: greenElement,
235
258
  blue: blueElement,
236
259
  hex: hexElement,
260
+ clear: clearElement,
237
261
  },
238
262
  })
239
263
  </script>
@@ -244,6 +268,7 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
244
268
  v-bind="nativeAttrs($attrs)"
245
269
  data-hn
246
270
  v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
271
+ :data-ui-color-picker-prop-clearable="reflectedProp('clearable', 'clearable', checkedProps.clearable, undefined, false)"
247
272
  :data-ui-color-picker-prop-disabled="reflectedProp('disabled', 'disabled', checkedProps.disabled, undefined, false)"
248
273
  :data-ui-color-picker-prop-label="reflectedProp('label', 'label', checkedProps.label, undefined, false)"
249
274
  :data-ui-color-picker-prop-name="reflectedProp('name', 'name', checkedProps.name, undefined, false)"
@@ -267,7 +292,12 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
267
292
  :disabled="checkedProps.disabled ?? undefined"
268
293
  ref="triggerElement"
269
294
  >
270
- <span class="colour" ref="colourElement"></span>
295
+ <span class="colour" ref="colourElement"><UiIcon
296
+ class="ui-icon"
297
+ name="slash"
298
+ hidden=""
299
+ ref="emptyMarkElement"
300
+ /></span>
271
301
  </button>{{ ' ' }}<span
272
302
  class="editor"
273
303
  hidden=""
@@ -299,7 +329,14 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
299
329
  maxlength="7"
300
330
  spellcheck="false"
301
331
  ref="hexElement"
302
- /></span></span>
332
+ />{{ ' ' }}<UiButton
333
+ class="ui-button"
334
+ size="sm"
335
+ variant="ghost"
336
+ tone="neutral"
337
+ hidden=""
338
+ ref="clearElement"
339
+ ><UiIcon class="ui-icon" name="slash" />None</UiButton></span></span>
303
340
  </template>
304
341
 
305
342
  <style scoped>
@@ -328,7 +365,7 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
328
365
  --_inset: min(calc(var(--ui-space-1) * 1.5), calc(var(--_size) / 5));
329
366
  box-sizing: border-box !important;
330
367
  display: inline-grid !important;
331
- place-items: center;
368
+ place-items: center !important;
332
369
  margin: 0 !important;
333
370
  padding: var(--_inset) !important;
334
371
  inline-size: max(
@@ -365,7 +402,9 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
365
402
  cursor: not-allowed;
366
403
  }
367
404
  :global(.colour) {
368
- display: block !important;
405
+ display: grid !important;
406
+ place-items: center !important;
407
+ color: var(--ui-text-secondary);
369
408
  inline-size: 100%;
370
409
  block-size: 100%;
371
410
  border-radius: max(0px, calc(var(--_radius) - var(--_inset) - var(--ui-border-width)));
@@ -410,4 +449,115 @@ useComponentHost(() => import('../components/ui-color-picker/ui-color-picker.js'
410
449
  accent-color: var(--ui-accent-solid);
411
450
  }
412
451
  }
452
+ @scope ([data-slotted~="ui-color-picker"]:not([data-hn])) to ([data-hn], [data-slotted]) {
453
+ :global(:where(.ui-color-picker):where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-color-picker"])))) {
454
+ display: inline-flex !important;
455
+ flex: 0 0 auto;
456
+ margin: 0 !important;
457
+ padding: 0 !important;
458
+ --_size: var(--ui-control-size-md);
459
+ --_font: 1em;
460
+ --_padding: var(--ui-control-inset-block-md, var(--ui-space-2));
461
+ }
462
+ :global(:where(.ui-color-picker)[data-ui-color-picker-state~="size=sm"]:where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-color-picker"])))) {
463
+ --_size: var(--ui-control-size-sm);
464
+ --_font: var(--ui-font-size-sm);
465
+ --_padding: var(--ui-control-inset-block-sm, var(--ui-space-1));
466
+ }
467
+ :global(:where(.ui-color-picker)[data-ui-color-picker-state~="size=lg"]:where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-color-picker"])))) {
468
+ --_size: var(--ui-control-size-lg);
469
+ --_font: var(--ui-font-size-md);
470
+ --_padding: var(--ui-control-inset-block-lg, var(--ui-space-3));
471
+ }
472
+ :global(button:where(:scope, :scope *)) {
473
+ --_radius: min(var(--ui-field-radius, var(--ui-radius-md)), calc(var(--_size) / 4));
474
+ --_inset: min(calc(var(--ui-space-1) * 1.5), calc(var(--_size) / 5));
475
+ box-sizing: border-box !important;
476
+ display: inline-grid !important;
477
+ place-items: center !important;
478
+ margin: 0 !important;
479
+ padding: var(--_inset) !important;
480
+ inline-size: max(
481
+ var(--_size),
482
+ calc(
483
+ var(--_font) * var(--ui-line-height-tight) + var(--_padding) * 2 +
484
+ var(--ui-border-width) * 2
485
+ )
486
+ );
487
+ aspect-ratio: 1;
488
+ flex: 0 0 auto;
489
+ border: var(--ui-border-width) solid var(--ui-control-border, var(--ui-border-strong));
490
+ border-radius: var(--_radius);
491
+ background: var(--ui-control-surface, var(--ui-surface-elevated));
492
+ box-shadow: var(--ui-control-inset);
493
+ font: inherit;
494
+ cursor: pointer;
495
+ transition:
496
+ background-color var(--ui-motion-fast) var(--ui-motion-ease),
497
+ scale var(--ui-motion-press, var(--ui-motion-fast)) var(--ui-motion-ease);
498
+ }
499
+ :global(button:hover:not(:disabled):where(:scope, :scope *)) {
500
+ background: var(--ui-surface-subtle);
501
+ }
502
+ :global(button:active:not(:disabled):where(:scope, :scope *)) {
503
+ scale: var(--ui-press-scale, 0.96);
504
+ }
505
+ :global(button:focus-visible:where(:scope, :scope *)) {
506
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring, var(--ui-accent-solid));
507
+ outline-offset: var(--ui-focus-width);
508
+ }
509
+ :global(button:disabled:where(:scope, :scope *)) {
510
+ opacity: 0.5;
511
+ cursor: not-allowed;
512
+ }
513
+ :global(.colour:where(:scope, :scope *)) {
514
+ display: grid !important;
515
+ place-items: center !important;
516
+ color: var(--ui-text-secondary);
517
+ inline-size: 100%;
518
+ block-size: 100%;
519
+ border-radius: max(0px, calc(var(--_radius) - var(--_inset) - var(--ui-border-width)));
520
+ box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
521
+ }
522
+ :global(:where(.ui-color-picker)[data-ui-color-picker-state~="round"]
523
+ button:where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-color-picker"])))) {
524
+ border-radius: 50%;
525
+ }
526
+ :global(:where(.ui-color-picker)[data-ui-color-picker-state~="round"]
527
+ .colour:where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-color-picker"])))) {
528
+ border-radius: 50%;
529
+ }
530
+ :global(.editor:where(:scope, :scope *)) {
531
+ box-sizing: border-box !important;
532
+ display: grid !important;
533
+ gap: var(--ui-space-3) !important;
534
+ padding: var(--ui-space-4) !important;
535
+ margin: 0 !important;
536
+ inline-size: min(18rem, calc(100vw - 1rem));
537
+ border: var(--ui-border-width) solid var(--ui-border-strong);
538
+ border-radius: var(--ui-radius-md);
539
+ background: var(--ui-surface-elevated);
540
+ color: var(--ui-text-primary);
541
+ box-shadow: var(--ui-shadow-lg);
542
+ font: inherit;
543
+ }
544
+ :global(.editor[hidden]:where(:scope, :scope *)) {
545
+ display: none !important;
546
+ }
547
+ :global(.channel:where(:scope, :scope *)) {
548
+ display: grid !important;
549
+ grid-template-columns: 3.5em 1fr;
550
+ align-items: center !important;
551
+ gap: var(--ui-space-2) !important;
552
+ padding: 0 !important;
553
+ margin: 0 !important;
554
+ }
555
+ :global(input[type="range"]:where(:scope, :scope *)) {
556
+ inline-size: 100%;
557
+ min-inline-size: 0;
558
+ margin: 0 !important;
559
+ padding: 0 !important;
560
+ accent-color: var(--ui-accent-solid);
561
+ }
562
+ }
413
563
  </style>
package/vue/UiDialog.vue CHANGED
@@ -405,7 +405,10 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
405
405
  --_ui-material-rim: calc(var(--_ui-material-separation) * var(--_ui-material-scale, 1) * 8px);
406
406
  --_ui-material-content-color: var(
407
407
  --ui-dialog-surface,
408
- var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))
408
+ var(
409
+ --_ui-material-underpaint,
410
+ var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))
411
+ )
409
412
  );
410
413
  --_ui-material-rim-color: color-mix(
411
414
  in srgb,
@@ -413,11 +416,13 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
413
416
  transparent
414
417
  );
415
418
  background:
416
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
419
+ var(
420
+ --ui-material-highlight,
421
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent))
422
+ ) padding-box,
417
423
  linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color))
418
424
  padding-box,
419
- linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
420
- var(--_ui-material-content-color) padding-box;
425
+ linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box;
421
426
  border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
422
427
  border-color: var(
423
428
  --ui-dialog-border,
@@ -454,13 +459,13 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
454
459
 
455
460
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
456
461
  :global(:scope:where([data-hn-ui-dialog])) {
457
- background: var(--_ui-material-content-color);
462
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
458
463
  }
459
464
  }
460
465
 
461
466
  @media (prefers-reduced-transparency: reduce) {
462
467
  :global(:scope:where([data-hn-ui-dialog])) {
463
- background: var(--_ui-material-content-color);
468
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
464
469
  -webkit-backdrop-filter: none;
465
470
  backdrop-filter: none;
466
471
  }
@@ -625,7 +630,10 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
625
630
  --_ui-material-rim: calc(var(--_ui-material-separation) * var(--_ui-material-scale, 1) * 8px);
626
631
  --_ui-material-content-color: var(
627
632
  --ui-dialog-surface,
628
- var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))
633
+ var(
634
+ --_ui-material-underpaint,
635
+ var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))
636
+ )
629
637
  );
630
638
  --_ui-material-rim-color: color-mix(
631
639
  in srgb,
@@ -633,11 +641,13 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
633
641
  transparent
634
642
  );
635
643
  background:
636
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
644
+ var(
645
+ --ui-material-highlight,
646
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent))
647
+ ) padding-box,
637
648
  linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color))
638
649
  padding-box,
639
- linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
640
- var(--_ui-material-content-color) padding-box;
650
+ linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box;
641
651
  border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
642
652
  border-color: var(
643
653
  --ui-dialog-border,
@@ -674,13 +684,13 @@ useComponentHost(() => import('../components/ui-dialog/ui-dialog.js'), {
674
684
 
675
685
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
676
686
  :global(:where(.ui-dialog):where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where([data-hn-ui-dialog])) {
677
- background: var(--_ui-material-content-color);
687
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
678
688
  }
679
689
  }
680
690
 
681
691
  @media (prefers-reduced-transparency: reduce) {
682
692
  :global(:where(.ui-dialog):where(:scope, :not([data-hn], [data-slotted]:not([data-slotted~="ui-dialog"]))):where([data-hn-ui-dialog])) {
683
- background: var(--_ui-material-content-color);
693
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
684
694
  -webkit-backdrop-filter: none;
685
695
  backdrop-filter: none;
686
696
  }
@@ -522,7 +522,7 @@ useComponentHost(() => import('../components/ui-disclosure/ui-disclosure.js'), {
522
522
  }
523
523
  :global(:scope[data-ui-disclosure-state~="internalOpen"]
524
524
  .panel-inner:where([data-hn-ui-disclosure])) {
525
- padding-block: 0 var(--ui-space-3) !important;
525
+ padding-block: var(--ui-space-4) !important;
526
526
  }
527
527
  :global(:scope[data-ui-disclosure-state~="fill"]:where([data-hn-ui-disclosure])) {
528
528
  display: flex !important;
package/vue/UiIcon.vue CHANGED
@@ -416,6 +416,7 @@ const shapes: ReturnType<typeof inputComputed<any>> = inputComputed<any>(
416
416
  tag: 'path',
417
417
  d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',
418
418
  }, { tag: 'circle', cx: '12', cy: '12', r: '3' }],
419
+ slash: [{ tag: 'path', d: 'M22 2 2 22' }],
419
420
  split: [{ tag: 'path', d: 'M16 3h5v5' }, { tag: 'path', d: 'M8 3H3v5' }, {
420
421
  tag: 'path',
421
422
  d: 'M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3',