@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
@@ -64,6 +64,7 @@ export const icons = {
64
64
  "rows": [["rect",{"width":"18","height":"18","x":"3","y":"3","rx":"2"}],["path",{"d":"M21 9H3"}],["path",{"d":"M21 15H3"}]],
65
65
  "search": [["path",{"d":"m21 21-4.34-4.34"}],["circle",{"cx":"11","cy":"11","r":"8"}]],
66
66
  "settings": [["path",{"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"}],["circle",{"cx":"12","cy":"12","r":"3"}]],
67
+ "slash": [["path",{"d":"M22 2 2 22"}]],
67
68
  "split": [["path",{"d":"M16 3h5v5"}],["path",{"d":"M8 3H3v5"}],["path",{"d":"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3"}],["path",{"d":"m15 9 6-6"}]],
68
69
  "strikethrough": [["path",{"d":"M16 4H9a3 3 0 0 0-2.83 4"}],["path",{"d":"M14 12a4 4 0 0 1 0 8H6"}],["line",{"x1":"4","x2":"20","y1":"12","y2":"12"}]],
69
70
  "sun": [["circle",{"cx":"12","cy":"12","r":"4"}],["path",{"d":"M12 2v2"}],["path",{"d":"M12 20v2"}],["path",{"d":"m4.93 4.93 1.41 1.41"}],["path",{"d":"m17.66 17.66 1.41 1.41"}],["path",{"d":"M2 12h2"}],["path",{"d":"M20 12h2"}],["path",{"d":"m6.34 17.66-1.41 1.41"}],["path",{"d":"m19.07 4.93-1.41 1.41"}]],
@@ -245,21 +245,22 @@
245
245
  --_badge-color-text: color-mix(in oklab, var(--_ui-badge-color) 0%, var(--ui-surface-default));
246
246
  }
247
247
 
248
- /* A translucent inverse surface picks up its filled control's tone. Deepen the tone ink
249
- toward the theme text to retain contrast against that composed surface. */
248
+ /* The inverse ink opposes the tone's on-fill ink, independently of the document scheme.
249
+ A bright pigment can use dark on-fill ink even in a light document. */
250
250
  :host([variant="inverse"]) {
251
+ --_badge-inverse-ink: oklch(from var(--_badge-text) clamp(0, calc((0.5 - l) * 1000), 1) 0 h);
251
252
  --_badge-color-surface: color-mix(in srgb, color-mix(in oklab, var(--_ui-badge-color) 0%, var(--ui-surface-default)) 88%, transparent);
252
253
  --_badge-color-border: var(--_badge-color-surface);
253
254
  --_badge-color-text: color-mix(in srgb, var(--_badge-color-ink) 85%, var(--ui-text-primary));
254
255
  --_badge-outline-surface: var(--ui-badge-surface, var(--_badge-color-surface, color-mix(in srgb, var(--_badge-text) 88%, transparent)));
255
256
  border-color: var(--ui-badge-border, var(--_badge-color-border, color-mix(in srgb, var(--_badge-text) 88%, transparent)));
256
- color: var(--ui-badge-text, var(--_badge-color-text, color-mix(in srgb, var(--_badge-surface) 85%, var(--ui-text-primary))));
257
+ color: var(--ui-badge-text, var(--_badge-color-text, color-mix(in srgb, var(--_badge-surface) 85%, var(--_badge-inverse-ink))));
257
258
  /* Paint each translucent layer once, including the border, without a bright double-painted ring. */
258
259
  background-clip: padding-box;
259
260
  }
260
261
 
261
- /* A circular count has a tone-tinted surface, a separate lighter rim and readable tone ink.
262
- Dark controls retain a shaded surface and theme ink with a quieter rim. */
262
+ /* A circular count retains its translucent surface and quiet rim. Bound the pigment
263
+ in its foreground so either on-fill polarity remains readable through that surface. */
263
264
  :host([variant="inverse"][shape="circle"]) {
264
265
  --_badge-color-surface: light-dark(
265
266
  color-mix(in srgb, color-mix(in oklab, var(--_ui-badge-color) 0%, var(--ui-surface-default)) var(--ui-badge-circle-opacity, 66%), transparent),
@@ -284,7 +285,7 @@
284
285
  );
285
286
  color: var(
286
287
  --ui-badge-text,
287
- var(--_badge-color-text, light-dark(color-mix(in srgb, var(--_badge-surface) 65%, var(--ui-text-primary)), var(--ui-text-primary)))
288
+ var(--_badge-color-text, color-mix(in srgb, var(--_badge-surface) 35%, var(--_badge-inverse-ink)))
288
289
  );
289
290
  box-shadow: 0 1px 1px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.12));
290
291
  }
@@ -128,6 +128,8 @@
128
128
  --_tone-hover-border: var(--ui-accent-hover-border, var(--ui-accent-hover));
129
129
  --_tone-active-border: var(--ui-accent-active-border, var(--ui-accent-active));
130
130
  --_tone-highlight: var(--ui-accent-highlight, none);
131
+ --_tone-hover-highlight: var(--ui-accent-hover-highlight, none);
132
+ --_tone-outline-border: var(--ui-accent-outline-border, var(--ui-accent-subtle-text));
131
133
  --_tone-glow: var(--ui-accent-glow, 0 0 transparent);
132
134
  --_hue: var(--ui-accent);
133
135
  --_hue-hover: var(--ui-accent-hover);
@@ -312,11 +314,27 @@
312
314
  align-self: center;
313
315
  }
314
316
 
317
+ :host[data-appearance="outline"]:not([data-tone="neutral"]) {
318
+ --_outline-wash: oklch(from var(--_tone-text) l c h / calc(4% * var(--ui-tonal-opacity, 1)));
319
+ border-color: var(--ui-button-border, var(--_tone-outline-border, var(--_tone-text)));
320
+ background-color: var(--ui-button-surface, transparent);
321
+ box-shadow: var(--ui-button-shadow, var(--ui-neutral-shadow));
322
+ background-image:
323
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
324
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
325
+ }
326
+
327
+ :host[data-appearance="outline"]:not([data-tone="neutral"]):hover:not(:disabled, [aria-disabled="true"]) {
328
+ --_outline-wash: oklch(from var(--_tone-text) l c h / calc(9% * var(--ui-tonal-opacity, 1)));
329
+ background-color: var(--ui-button-hover-surface, transparent);
330
+ border-color: var(--ui-button-hover-border, color-mix(in srgb, var(--_tone-text) 35%, var(--_tone-outline-border)));
331
+ }
332
+
315
333
  /* A link is never :enabled, so interactive states test "not unavailable" instead: for a button that
316
334
  is exactly :enabled, at the same specificity, and it also matches a link that can be followed. */
317
335
  :host:hover:not(:disabled, [aria-disabled="true"]) {
318
336
  border-color: var(--ui-button-hover-border, var(--_tone-text));
319
- background-color: var(--ui-button-hover-surface, oklch(from var(--_tone) l c h / calc(12% * var(--ui-tonal-opacity, 1))));
337
+ background-color: var(--ui-button-hover-surface, oklch(from var(--_tone-text) l c h / calc(12% * var(--ui-tonal-opacity, 1))));
320
338
  }
321
339
 
322
340
  :host[data-appearance="card"][data-tone="neutral"] {
@@ -334,7 +352,8 @@
334
352
  }
335
353
 
336
354
  /* Pressed reads as pressed in: the highlight goes, and the shadow moves inside. */
337
- :host:active:not(:disabled, [aria-disabled="true"]) {
355
+ :host:active:not(:disabled, [aria-disabled="true"]),
356
+ :host[data-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]) {
338
357
  scale: var(--ui-press-scale, 1);
339
358
  background-color: var(--ui-button-active-surface, oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1))));
340
359
  background-image: none;
@@ -354,6 +373,7 @@
354
373
  :host[data-appearance="solid"]:hover:not(:disabled, [aria-disabled="true"]),
355
374
  :host[data-appearance="danger"]:hover:not(:disabled, [aria-disabled="true"]) {
356
375
  background-color: var(--_tone-hover);
376
+ background-image: var(--_tone-hover-highlight);
357
377
  border-color: var(--ui-button-hover-border, var(--_tone-hover-border));
358
378
  }
359
379
 
@@ -371,6 +391,8 @@
371
391
  --_tone-hover-border: var(--ui-accent-secondary-hover-border, var(--ui-accent-secondary-hover));
372
392
  --_tone-active-border: var(--ui-accent-secondary-active-border, var(--ui-accent-secondary-active));
373
393
  --_tone-highlight: var(--ui-accent-secondary-highlight, none);
394
+ --_tone-hover-highlight: var(--ui-accent-secondary-hover-highlight, none);
395
+ --_tone-outline-border: var(--ui-accent-secondary-outline-border, var(--ui-accent-secondary-subtle-text));
374
396
  --_tone-glow: var(--ui-accent-secondary-glow, 0 0 transparent);
375
397
  --_hue: var(--ui-accent-secondary);
376
398
  --_hue-hover: var(--ui-accent-secondary-hover);
@@ -384,6 +406,8 @@
384
406
  --_tone-hover-border: var(--ui-accent-tertiary-hover-border, var(--ui-accent-tertiary-hover));
385
407
  --_tone-active-border: var(--ui-accent-tertiary-active-border, var(--ui-accent-tertiary-active));
386
408
  --_tone-highlight: var(--ui-accent-tertiary-highlight, none);
409
+ --_tone-hover-highlight: var(--ui-accent-tertiary-hover-highlight, none);
410
+ --_tone-outline-border: var(--ui-accent-tertiary-outline-border, var(--ui-accent-tertiary-subtle-text));
387
411
  --_tone-glow: var(--ui-accent-tertiary-glow, 0 0 transparent);
388
412
  --_hue: var(--ui-accent-tertiary);
389
413
  --_hue-hover: var(--ui-accent-tertiary-hover);
@@ -397,6 +421,8 @@
397
421
  --_tone-hover-border: var(--ui-control-border-hover, var(--ui-neutral-hover));
398
422
  --_tone-active-border: var(--ui-control-border-hover, var(--ui-neutral-active));
399
423
  --_tone-highlight: var(--ui-neutral-highlight, none);
424
+ --_tone-hover-highlight: var(--ui-neutral-highlight, var(--_tone-highlight));
425
+ --_tone-outline-border: var(--ui-control-border);
400
426
  --_tone-glow: var(--ui-neutral-glow, 0 0 transparent);
401
427
  --_hue: var(--ui-text);
402
428
  --_hue-hover: var(--ui-text);
@@ -419,8 +445,13 @@
419
445
  :host[data-tone="neutral"][data-appearance="outline"]:hover:not(:disabled, [aria-disabled="true"]) {
420
446
  border-color: var(--ui-button-hover-border, var(--ui-control-border-hover));
421
447
  background-color: var(--ui-button-hover-surface, var(--ui-neutral-hover));
448
+ --_outline-wash: oklch(from var(--ui-text) l c h / 5%);
449
+ background-image:
450
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
451
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
422
452
  }
423
453
  :host[data-tone="neutral"][data-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]) {
454
+ background-image: none;
424
455
  border-color: var(--ui-button-hover-border, var(--ui-control-border-hover));
425
456
  background-color: var(--ui-button-active-surface, var(--ui-neutral-active));
426
457
  }
@@ -438,6 +469,8 @@
438
469
  --_tone-hover-border: var(--ui-danger-hover-border, var(--ui-danger-hover));
439
470
  --_tone-active-border: var(--ui-danger-active-border, var(--ui-danger-active));
440
471
  --_tone-highlight: var(--ui-danger-highlight, none);
472
+ --_tone-hover-highlight: var(--ui-danger-hover-highlight, none);
473
+ --_tone-outline-border: var(--ui-danger-outline-border, var(--ui-danger-subtle-text));
441
474
  --_tone-glow: var(--ui-danger-glow, 0 0 transparent);
442
475
  --_hue: var(--ui-danger);
443
476
  --_hue-hover: var(--ui-danger-hover);
@@ -451,6 +484,8 @@
451
484
  --_tone-hover-border: var(--ui-success-hover-border, var(--ui-success-hover));
452
485
  --_tone-active-border: var(--ui-success-active-border, var(--ui-success-active));
453
486
  --_tone-highlight: var(--ui-success-highlight, none);
487
+ --_tone-hover-highlight: var(--ui-success-hover-highlight, none);
488
+ --_tone-outline-border: var(--ui-success-outline-border, var(--ui-success-subtle-text));
454
489
  --_tone-glow: var(--ui-success-glow, 0 0 transparent);
455
490
  --_hue: var(--ui-success);
456
491
  --_hue-hover: var(--ui-success-hover);
@@ -464,6 +499,8 @@
464
499
  --_tone-hover-border: var(--ui-warning-hover-border, var(--ui-warning-hover));
465
500
  --_tone-active-border: var(--ui-warning-active-border, var(--ui-warning-active));
466
501
  --_tone-highlight: var(--ui-warning-highlight, none);
502
+ --_tone-hover-highlight: var(--ui-warning-hover-highlight, none);
503
+ --_tone-outline-border: var(--ui-warning-outline-border, var(--ui-warning-subtle-text));
467
504
  --_tone-glow: var(--ui-warning-glow, 0 0 transparent);
468
505
  --_hue: var(--ui-warning);
469
506
  --_hue-hover: var(--ui-warning-hover);
@@ -477,6 +514,8 @@
477
514
  --_tone-hover-border: var(--ui-info-hover-border, var(--ui-info-hover));
478
515
  --_tone-active-border: var(--ui-info-active-border, var(--ui-info-active));
479
516
  --_tone-highlight: var(--ui-info-highlight, none);
517
+ --_tone-hover-highlight: var(--ui-info-hover-highlight, none);
518
+ --_tone-outline-border: var(--ui-info-outline-border, var(--ui-info-subtle-text));
480
519
  --_tone-glow: var(--ui-info-glow, 0 0 transparent);
481
520
  --_hue: var(--ui-info);
482
521
  --_hue-hover: var(--ui-info-hover);
@@ -539,6 +578,12 @@
539
578
  var(--ui-focus-halo);
540
579
  }
541
580
 
581
+ :host[data-appearance="outline"]:focus-visible {
582
+ box-shadow:
583
+ var(--ui-button-shadow, var(--ui-neutral-shadow)),
584
+ var(--ui-focus-halo);
585
+ }
586
+
542
587
  :host[data-appearance="solid"]:focus-visible {
543
588
  box-shadow:
544
589
  var(--ui-button-solid-shadow, var(--ui-action-shadow, var(--_ui-action-shadow))),
@@ -7,8 +7,8 @@
7
7
  elevated adds a subtle lift above the page, for a view's one card, such as sign-in. Treatment independently controls decorative material.</prop>
8
8
  <prop name="treatment" type="keyword" values="standard, expressive" default="standard"
9
9
  >How much of the theme's decorative material the surface expresses. standard preserves its restrained treatment; expressive uses the full material
10
- treatment. Its glass rim can transmit and frost the surrounding scene while content remains opaque. Surface separation controls the rim, independently of
11
- frosting. This does not add elevation or require glass.</prop>
10
+ treatment. Its glass rim can transmit and frost the surrounding scene while content stays nearly opaque. Surface separation controls the rim,
11
+ independently of frosting. This does not add elevation or require glass.</prop>
12
12
  <prop name="padding" type="keyword" values="xs, sm, md, lg" default="md"
13
13
  >The space inside the card: xs is compact (0.5rem), sm is snug (0.75rem), md is the default (1.5rem), and lg is roomy (2rem).</prop>
14
14
  <prop name="tone" type="keyword" values="neutral, accent, accent-secondary, accent-tertiary, info, success, warning, danger" default="neutral"
@@ -71,16 +71,16 @@
71
71
  }
72
72
 
73
73
  :host([treatment="expressive"]) {
74
+ --_ui-card-material-content: color-mix(in srgb, var(--_ui-card-surface) calc(var(--_ui-material-content-alpha, 1) * 100%), transparent);
74
75
  --_ui-panel-glass: clamp(0, var(--ui-glassiness, 0), 1);
75
76
  --_ui-panel-separation: clamp(0, var(--ui-surface-separation, 0), 1);
76
77
  --_ui-panel-rim: calc(var(--_ui-panel-separation) * 8px);
77
78
  border-width: calc(var(--ui-border-width) + var(--_ui-panel-rim));
78
79
  border-color: transparent;
79
80
  background:
80
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
81
- linear-gradient(var(--_ui-card-surface), var(--_ui-card-surface)) padding-box,
82
- linear-gradient(var(--ui-material-glass, var(--ui-surface-raised)), var(--ui-material-glass, var(--ui-surface-raised))) border-box,
83
- var(--_ui-card-surface) padding-box;
81
+ var(--ui-material-highlight, var(--ui-surface-highlight, linear-gradient(transparent, transparent))) padding-box,
82
+ linear-gradient(var(--_ui-card-material-content), var(--_ui-card-material-content)) padding-box,
83
+ linear-gradient(var(--ui-material-glass, var(--ui-surface-raised)), var(--ui-material-glass, var(--ui-surface-raised))) border-box;
84
84
  box-shadow:
85
85
  var(--_ui-card-elevation),
86
86
  var(--ui-material-glow, 0 0 transparent),
@@ -1,9 +1,13 @@
1
1
  <link rel="component" href="../ui-input/ui-input.html">
2
+ <link rel="component" href="../ui-button/ui-button.html">
3
+ <link rel="component" href="../ui-icon/ui-icon.html">
2
4
  <template component="ui-color-picker" module="./ui-color-picker.js">
3
5
  <defs>
4
6
  <prop name="value" type="string" default="#000000"
5
- >An opaque sRGB colour as six hexadecimal digits prefixed with #. User edits emit input and change with detail.value. Invalid values are ignored. This
6
- control does not submit a named form value.</prop>
7
+ >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
8
+ detail.value. Invalid values are ignored. Set name to include the value in form submission.</prop>
9
+ <prop name="clearable" type="boolean" default="false"
10
+ >Allows None in the editor. An empty value shows a slashed swatch and emits the same input/change events with an empty string.</prop>
7
11
  <prop name="name" type="string" default="">The form field name. Leave empty to omit the colour from form submission. A form reset restores value.</prop>
8
12
  <prop name="label" type="string" default="Choose colour">Accessible name for the swatch button and editor.</prop>
9
13
  <prop name="size" type="keyword" values="sm, md, lg" default="md">Shared control height, matching Input and Button of the same size.</prop>
@@ -15,13 +19,14 @@
15
19
  <span>
16
20
  <input $ref="field" type="hidden" data-ui-field-value from:name="$name" from:disabled="$disabled">
17
21
  <button data-ui-field-control $ref="trigger" type="button" from:aria-label="$label" from:disabled="$disabled" aria-haspopup="dialog" aria-expanded="false">
18
- <span class="colour" $ref="colour"></span>
22
+ <span class="colour" $ref="colour"><ui-icon $ref="emptyMark" name="slash" hidden></ui-icon></span>
19
23
  </button>
20
24
  <span class="editor" $ref="editor" hidden role="dialog" from:aria-label="$label">
21
25
  <label class="channel">Red<input $ref="red" type="range" min="0" max="255" aria-label="Red"></label>
22
26
  <label class="channel">Green<input $ref="green" type="range" min="0" max="255" aria-label="Green"></label>
23
27
  <label class="channel">Blue<input $ref="blue" type="range" min="0" max="255" aria-label="Blue"></label>
24
28
  <ui-input $ref="hex" size="sm" aria-label="Hex colour" maxlength="7" spellcheck="false"></ui-input>
29
+ <ui-button $ref="clear" size="sm" variant="ghost" tone="neutral" hidden><ui-icon name="slash"></ui-icon>None</ui-button>
25
30
  </span>
26
31
  </span>
27
32
  <style>
@@ -49,7 +54,7 @@
49
54
  --_inset: min(calc(var(--ui-space-1) * 1.5), calc(var(--_size) / 5));
50
55
  box-sizing: border-box !important;
51
56
  display: inline-grid !important;
52
- place-items: center;
57
+ place-items: center !important;
53
58
  margin: 0 !important;
54
59
  padding: var(--_inset) !important;
55
60
  inline-size: max(var(--_size), calc(var(--_font) * var(--ui-line-height-tight) + var(--_padding) * 2 + var(--ui-border-width) * 2));
@@ -78,7 +83,9 @@
78
83
  cursor: not-allowed;
79
84
  }
80
85
  .colour {
81
- display: block !important;
86
+ display: grid !important;
87
+ place-items: center !important;
88
+ color: var(--ui-text-secondary);
82
89
  inline-size: 100%;
83
90
  block-size: 100%;
84
91
  border-radius: max(0px, calc(var(--_radius) - var(--_inset) - var(--ui-border-width)));
@@ -2,7 +2,7 @@ import { afterFormReset } from "../shared/form-reset.js";
2
2
  import { closeOverlay, createAnchoredSurface, openOverlay } from "../shared/overlay.js";
3
3
 
4
4
  export function connect(host) {
5
- const { trigger, editor, colour, hex, red, green, blue, field } = host.refs;
5
+ const { trigger, editor, colour, hex, red, green, blue, field, clear, emptyMark } = host.refs;
6
6
  const document = trigger.ownerDocument;
7
7
  const id = `ui-color-picker-${Math.random().toString(36).slice(2, 11)}`;
8
8
  editor.id = id;
@@ -12,17 +12,20 @@ export function connect(host) {
12
12
  let opened = false;
13
13
  let current = "#000000";
14
14
  let external;
15
+ let pigment = current;
15
16
  // A hidden input’s value writes also change defaultValue; reset needs the last valid external colour.
16
17
  let resetValue = "#000000";
17
- const valid = value => /^#[0-9a-f]{6}$/i.test(String(value));
18
+ const valid = value => /^#[0-9a-f]{6}$/i.test(String(value)) || host.props.clearable.value && value === "";
18
19
  const paint = value => {
19
20
  current = value.toLowerCase();
21
+ if (current) pigment = current;
20
22
  field.value = current;
21
23
  hex.removeAttribute("aria-invalid");
22
- colour.style.backgroundColor = current;
23
- trigger.title = current;
24
- hex.value = current;
25
- [red, green, blue].forEach((input, i) => { input.value = String(parseInt(current.slice(i * 2 + 1, i * 2 + 3), 16)); });
24
+ colour.style.backgroundColor = current || "transparent";
25
+ emptyMark.hidden = Boolean(current);
26
+ trigger.title = current || "None";
27
+ hex.value = pigment;
28
+ [red, green, blue].forEach((input, i) => { input.value = String(parseInt(pigment.slice(i * 2 + 1, i * 2 + 3), 16)); });
26
29
  };
27
30
  paint(current);
28
31
  const close = reason => {
@@ -51,10 +54,20 @@ export function connect(host) {
51
54
  const escape = event => {
52
55
  if (event.key === "Escape" && opened) { event.preventDefault(); close("escape"); }
53
56
  };
57
+ const clearColour = event => {
58
+ event.stopPropagation();
59
+ if (!host.props.clearable.value || host.props.disabled.value) return;
60
+ paint("");
61
+ host.dispatch("input", { value: "" });
62
+ host.dispatch("change", { value: "" });
63
+ close("escape");
64
+ };
65
+ clear.addEventListener("click", clearColour);
54
66
  trigger.addEventListener("click", toggle);
55
67
  editor.addEventListener("keydown", escape);
56
68
  for (const input of [hex, red, green, blue]) for (const type of ["input", "change"]) input.addEventListener(type, edit);
57
69
  const stop = host.effect(() => {
70
+ clear.hidden = !host.props.clearable.value;
58
71
  const value = host.props.value.value;
59
72
  if (value !== external) {
60
73
  external = value;
@@ -69,6 +82,7 @@ export function connect(host) {
69
82
  const stopReset = afterFormReset(field, () => { paint(resetValue); close("reset"); });
70
83
  return () => {
71
84
  stop(); stopReset(); close("disconnect"); surface.destroy();
85
+ clear.removeEventListener("click", clearColour);
72
86
  trigger.removeEventListener("click", toggle);
73
87
  editor.removeEventListener("keydown", escape);
74
88
  for (const input of [hex, red, green, blue]) for (const type of ["input", "change"]) input.removeEventListener(type, edit);
@@ -86,13 +86,12 @@
86
86
  --_ui-material-separation: clamp(0, var(--ui-surface-separation, 0), 1);
87
87
  --_ui-material-active: clamp(0, calc(var(--_ui-material-separation) * 100000), 1);
88
88
  --_ui-material-rim: calc(var(--_ui-material-separation) * var(--_ui-material-scale, 1) * 8px);
89
- --_ui-material-content-color: var(--ui-dialog-surface, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated))));
89
+ --_ui-material-content-color: var(--ui-dialog-surface, var(--_ui-material-underpaint, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))));
90
90
  --_ui-material-rim-color: color-mix(in srgb, var(--ui-material-glass, var(--ui-surface-elevated)) calc(var(--_ui-material-active) * 100%), transparent);
91
91
  background:
92
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
92
+ var(--ui-material-highlight, var(--ui-surface-highlight, linear-gradient(transparent, transparent))) padding-box,
93
93
  linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color)) padding-box,
94
- linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
95
- var(--_ui-material-content-color) padding-box;
94
+ linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box;
96
95
  border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
97
96
  border-color: var(
98
97
  --ui-dialog-border,
@@ -116,13 +115,13 @@
116
115
 
117
116
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
118
117
  :host {
119
- background: var(--_ui-material-content-color);
118
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
120
119
  }
121
120
  }
122
121
 
123
122
  @media (prefers-reduced-transparency: reduce) {
124
123
  :host {
125
- background: var(--_ui-material-content-color);
124
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
126
125
  -webkit-backdrop-filter: none;
127
126
  backdrop-filter: none;
128
127
  }
@@ -159,7 +159,7 @@
159
159
  grid-template-rows: 1fr;
160
160
  }
161
161
  :host(:state(internalOpen)) .panel-inner {
162
- padding-block: 0 var(--ui-space-3) !important;
162
+ padding-block: var(--ui-space-4) !important;
163
163
  }
164
164
 
165
165
  /* A bounded accordion owns one flexible body, so its trigger never scrolls away. The
@@ -73,6 +73,7 @@
73
73
  'rows': [{ tag: 'rect', width: '18', height: '18', x: '3', y: '3', rx: '2' }, { tag: 'path', d: 'M21 9H3' }, { tag: 'path', d: 'M21 15H3' }],
74
74
  'search': [{ tag: 'path', d: 'm21 21-4.34-4.34' }, { tag: 'circle', cx: '11', cy: '11', r: '8' }],
75
75
  'settings': [{ tag: 'path', 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' }, { tag: 'circle', cx: '12', cy: '12', r: '3' }],
76
+ 'slash': [{ tag: 'path', d: 'M22 2 2 22' }],
76
77
  'split': [{ tag: 'path', d: 'M16 3h5v5' }, { tag: 'path', d: 'M8 3H3v5' }, { tag: 'path', d: 'M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3' }, { tag: 'path', d: 'm15 9 6-6' }],
77
78
  'strikethrough': [{ tag: 'path', d: 'M16 4H9a3 3 0 0 0-2.83 4' }, { tag: 'path', d: 'M14 12a4 4 0 0 1 0 8H6' }, { tag: 'line', x1: '4', x2: '20', y1: '12', y2: '12' }],
78
79
  'sun': [{ tag: 'circle', cx: '12', cy: '12', r: '4' }, { tag: 'path', d: 'M12 2v2' }, { tag: 'path', d: 'M12 20v2' }, { tag: 'path', d: 'm4.93 4.93 1.41 1.41' }, { tag: 'path', d: 'm17.66 17.66 1.41 1.41' }, { tag: 'path', d: 'M2 12h2' }, { tag: 'path', d: 'M20 12h2' }, { tag: 'path', d: 'm6.34 17.66-1.41 1.41' }, { tag: 'path', d: 'm19.07 4.93-1.41 1.41' }],
@@ -61,6 +61,8 @@
61
61
  --_solid-active-border: var(--ui-accent-active-border, var(--ui-accent-active));
62
62
  --_solid-active-surface: var(--ui-accent-active, var(--ui-accent-hover));
63
63
  --_tone-highlight: var(--ui-accent-highlight, none);
64
+ --_tone-hover-highlight: var(--ui-accent-hover-highlight, none);
65
+ --_tone-outline-border: var(--ui-accent-outline-border, var(--ui-accent-subtle-text));
64
66
  --_tone-glow: var(--ui-accent-glow, 0 0 transparent);
65
67
  --_ui-action-start: 1px;
66
68
  --_ui-action-edge: var(
@@ -87,6 +89,8 @@
87
89
  --_solid-active-border: var(--ui-accent-secondary-active-border, var(--ui-accent-secondary-active));
88
90
  --_solid-active-surface: var(--ui-accent-secondary-active, var(--ui-accent-secondary-hover));
89
91
  --_tone-highlight: var(--ui-accent-secondary-highlight, none);
92
+ --_tone-hover-highlight: var(--ui-accent-secondary-hover-highlight, none);
93
+ --_tone-outline-border: var(--ui-accent-secondary-outline-border, var(--ui-accent-secondary-subtle-text));
90
94
  --_tone-glow: var(--ui-accent-secondary-glow, 0 0 transparent);
91
95
  --_icon-button-border: var(--ui-accent-secondary-subtle-text);
92
96
  --_icon-button-hover-border: var(--ui-accent-secondary-subtle-text);
@@ -104,6 +108,8 @@
104
108
  --_solid-active-border: var(--ui-accent-tertiary-active-border, var(--ui-accent-tertiary-active));
105
109
  --_solid-active-surface: var(--ui-accent-tertiary-active, var(--ui-accent-tertiary-hover));
106
110
  --_tone-highlight: var(--ui-accent-tertiary-highlight, none);
111
+ --_tone-hover-highlight: var(--ui-accent-tertiary-hover-highlight, none);
112
+ --_tone-outline-border: var(--ui-accent-tertiary-outline-border, var(--ui-accent-tertiary-subtle-text));
107
113
  --_tone-glow: var(--ui-accent-tertiary-glow, 0 0 transparent);
108
114
  --_icon-button-border: var(--ui-accent-tertiary-subtle-text);
109
115
  --_icon-button-hover-border: var(--ui-accent-tertiary-subtle-text);
@@ -121,6 +127,8 @@
121
127
  --_solid-active-border: var(--ui-accent-active-border, var(--ui-accent-active));
122
128
  --_solid-active-surface: var(--ui-accent-active, var(--ui-accent-hover));
123
129
  --_tone-highlight: var(--ui-accent-highlight, none);
130
+ --_tone-hover-highlight: var(--ui-accent-hover-highlight, none);
131
+ --_tone-outline-border: var(--ui-accent-outline-border, var(--ui-accent-subtle-text));
124
132
  --_tone-glow: var(--ui-accent-glow, 0 0 transparent);
125
133
  --_icon-button-border: var(--ui-accent-subtle-text);
126
134
  --_icon-button-hover-border: var(--ui-accent-subtle-text);
@@ -135,6 +143,8 @@
135
143
  --_solid-active-border: var(--ui-danger-active-border, var(--ui-danger-active));
136
144
  --_solid-active-surface: var(--ui-danger-active, var(--ui-danger-hover));
137
145
  --_tone-highlight: var(--ui-danger-highlight, none);
146
+ --_tone-hover-highlight: var(--ui-danger-hover-highlight, none);
147
+ --_tone-outline-border: var(--ui-danger-outline-border, var(--ui-danger-subtle-text));
138
148
  --_tone-glow: var(--ui-danger-glow, 0 0 transparent);
139
149
  --_icon-button-border: var(--ui-danger-subtle-text);
140
150
  --_icon-button-hover-border: var(--ui-danger-subtle-text);
@@ -152,6 +162,8 @@
152
162
  --_solid-active-border: var(--ui-success-active-border, var(--ui-success-active));
153
163
  --_solid-active-surface: var(--ui-success-active, var(--ui-success-hover));
154
164
  --_tone-highlight: var(--ui-success-highlight, none);
165
+ --_tone-hover-highlight: var(--ui-success-hover-highlight, none);
166
+ --_tone-outline-border: var(--ui-success-outline-border, var(--ui-success-subtle-text));
155
167
  --_tone-glow: var(--ui-success-glow, 0 0 transparent);
156
168
  --_icon-button-border: var(--ui-success-subtle-text);
157
169
  --_icon-button-hover-border: var(--ui-success-subtle-text);
@@ -169,6 +181,8 @@
169
181
  --_solid-active-border: var(--ui-warning-active-border, var(--ui-warning-active));
170
182
  --_solid-active-surface: var(--ui-warning-active, var(--ui-warning-hover));
171
183
  --_tone-highlight: var(--ui-warning-highlight, none);
184
+ --_tone-hover-highlight: var(--ui-warning-hover-highlight, none);
185
+ --_tone-outline-border: var(--ui-warning-outline-border, var(--ui-warning-subtle-text));
172
186
  --_tone-glow: var(--ui-warning-glow, 0 0 transparent);
173
187
  --_icon-button-border: var(--ui-warning-subtle-text);
174
188
  --_icon-button-hover-border: var(--ui-warning-subtle-text);
@@ -186,6 +200,8 @@
186
200
  --_solid-active-border: var(--ui-info-active-border, var(--ui-info-active));
187
201
  --_solid-active-surface: var(--ui-info-active, var(--ui-info-hover));
188
202
  --_tone-highlight: var(--ui-info-highlight, none);
203
+ --_tone-hover-highlight: var(--ui-info-hover-highlight, none);
204
+ --_tone-outline-border: var(--ui-info-outline-border, var(--ui-info-subtle-text));
189
205
  --_tone-glow: var(--ui-info-glow, 0 0 transparent);
190
206
  --_icon-button-border: var(--ui-info-subtle-text);
191
207
  --_icon-button-hover-border: var(--ui-info-subtle-text);
@@ -204,6 +220,8 @@
204
220
  --_solid-active-border: var(--ui-control-border-hover, var(--ui-neutral-active));
205
221
  --_solid-active-surface: var(--ui-neutral-active, var(--ui-neutral-hover));
206
222
  --_tone-highlight: var(--ui-neutral-highlight, none);
223
+ --_tone-hover-highlight: var(--ui-neutral-highlight, var(--_tone-highlight));
224
+ --_tone-outline-border: var(--ui-control-border);
207
225
  --_tone-glow: var(--ui-neutral-glow, 0 0 transparent);
208
226
  --_icon-button-outline-surface: transparent;
209
227
  --_icon-button-border: var(--ui-control-border);
@@ -373,9 +391,7 @@
373
391
  background-color: var(--ui-icon-button-outline-surface, var(--_icon-button-outline-surface, var(--ui-surface-default)));
374
392
  background-image: var(--ui-surface-highlight, none);
375
393
  color: var(--ui-icon-button-outline-text, var(--_icon-button-text, var(--ui-text-primary)));
376
- box-shadow:
377
- var(--ui-action-shadow, var(--_ui-action-shadow)),
378
- var(--_tone-glow);
394
+ box-shadow: var(--ui-neutral-shadow);
379
395
  }
380
396
 
381
397
  :host[data-appearance="solid"] {
@@ -402,11 +418,49 @@
402
418
  color: var(--ui-icon-button-hover-text, var(--_icon-button-text, var(--ui-text-primary)));
403
419
  }
404
420
 
421
+ :host[data-appearance="outline"]:not([data-tone="neutral"]) {
422
+ --_outline-wash: oklch(
423
+ from
424
+ var(--ui-icon-button-text, var(--_icon-button-text, var(--ui-accent-subtle-text)))
425
+ l
426
+ c
427
+ h
428
+ /
429
+ calc(4% * var(--ui-tonal-opacity, 1))
430
+ );
431
+ border-color: var(--ui-icon-button-border, var(--_tone-outline-border));
432
+ background-color: var(--ui-icon-button-outline-surface, var(--_icon-button-outline-surface, transparent));
433
+ background-image:
434
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
435
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
436
+ }
437
+
438
+ :host[data-appearance="outline"]:not([data-tone="neutral"]):hover:enabled:not([aria-disabled="true"]) {
439
+ --_outline-wash: oklch(
440
+ from
441
+ var(--ui-icon-button-text, var(--_icon-button-text, var(--ui-accent-subtle-text)))
442
+ l
443
+ c
444
+ h
445
+ /
446
+ calc(9% * var(--ui-tonal-opacity, 1))
447
+ );
448
+ background-color: var(--ui-icon-button-hover-surface, transparent);
449
+ border-color: var(
450
+ --ui-icon-button-hover-border,
451
+ color-mix(in srgb, var(--_icon-button-text, var(--ui-accent-subtle-text)) 35%, var(--_tone-outline-border))
452
+ );
453
+ }
454
+
405
455
  :host[data-appearance="outline"]:hover:enabled:not([aria-disabled="true"]) {
406
456
  border-color: var(--ui-icon-button-hover-border, var(--_icon-button-hover-border, var(--ui-control-border-hover, var(--ui-control-border))));
407
457
  }
408
458
  :host[data-tone="neutral"][data-appearance="outline"]:hover:enabled:not([aria-disabled="true"]) {
409
459
  background-color: var(--ui-icon-button-hover-surface, var(--ui-neutral-hover));
460
+ --_outline-wash: oklch(from var(--ui-text) l c h / 5%);
461
+ background-image:
462
+ linear-gradient(var(--_outline-wash), var(--_outline-wash)),
463
+ var(--ui-surface-highlight, linear-gradient(transparent, transparent));
410
464
  }
411
465
  :host[data-tone="neutral"][data-appearance="outline"]:active:enabled:not([aria-disabled="true"]) {
412
466
  background-color: var(--ui-icon-button-active-surface, var(--ui-neutral-active));
@@ -415,6 +469,7 @@
415
469
  :host[data-appearance="solid"]:hover:enabled:not([aria-disabled="true"]) {
416
470
  border-color: var(--ui-icon-button-hover-border, var(--_solid-hover-border));
417
471
  background-color: var(--ui-icon-button-solid-hover-surface, var(--_icon-button-solid-hover-surface, var(--ui-accent-hover)));
472
+ background-image: var(--_tone-hover-highlight);
418
473
  }
419
474
 
420
475
  :host[data-appearance="solid"]:hover:enabled:not([aria-disabled="true"]) {
@@ -465,7 +520,7 @@
465
520
 
466
521
  :host[data-appearance="outline"]:focus-visible {
467
522
  box-shadow:
468
- var(--ui-action-shadow, var(--_ui-action-shadow)),
523
+ var(--ui-neutral-shadow),
469
524
  var(--ui-focus-halo);
470
525
  }
471
526
 
@@ -111,13 +111,12 @@
111
111
  --_ui-material-separation: clamp(0, var(--ui-surface-separation, 0), 1);
112
112
  --_ui-material-active: clamp(0, calc(var(--_ui-material-separation) * 100000), 1);
113
113
  --_ui-material-rim: calc(var(--_ui-material-separation) * var(--_ui-material-scale, 0.28) * 8px);
114
- --_ui-material-content-color: var(--_ui-menu-surface, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated))));
114
+ --_ui-material-content-color: var(--_ui-menu-surface, var(--_ui-material-underpaint, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))));
115
115
  --_ui-material-rim-color: color-mix(in srgb, var(--ui-material-glass, var(--ui-surface-elevated)) calc(var(--_ui-material-active) * 100%), transparent);
116
116
  background:
117
- var(--ui-surface-highlight, linear-gradient(transparent, transparent)) padding-box,
117
+ var(--ui-material-highlight, var(--ui-surface-highlight, linear-gradient(transparent, transparent))) padding-box,
118
118
  linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color)) padding-box,
119
- linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
120
- var(--_ui-material-content-color) padding-box;
119
+ linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box;
121
120
  border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
122
121
  border-color: var(
123
122
  --_ui-menu-border,
@@ -141,13 +140,13 @@
141
140
 
142
141
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
143
142
  :host:not([inline]) .surface {
144
- background: var(--_ui-material-content-color);
143
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
145
144
  }
146
145
  }
147
146
 
148
147
  @media (prefers-reduced-transparency: reduce) {
149
148
  :host:not([inline]) .surface {
150
- background: var(--_ui-material-content-color);
149
+ background: oklch(from var(--_ui-material-content-color) l c h / 1);
151
150
  -webkit-backdrop-filter: none;
152
151
  backdrop-filter: none;
153
152
  }
@@ -14,6 +14,8 @@
14
14
  <prop name="name" type="string" default="">Optional form field name.</prop>
15
15
  <prop name="label" type="string" default="Value">Accessible name for the editing control.</prop>
16
16
  <prop name="size" type="keyword" values="sm, md, lg" default="md">Shared field and button height.</prop>
17
+ <prop name="compact" type="boolean" default="false"
18
+ >Shows just the exact field, retaining arrow-key stepping and arithmetic without separate step buttons.</prop>
17
19
  <prop name="disabled" type="boolean" default="false">Prevents typing, stepping and pointer or keyboard changes while keeping the value visible.</prop>
18
20
  <event name="input" type="object"><prop name="value" type="string" required></prop></event>
19
21
  <event name="change" type="object"><prop name="value" type="string" required></prop></event>
@@ -21,6 +23,7 @@
21
23
  <span>
22
24
  <ui-icon-button
23
25
  data-number-step="decrease"
26
+ from:hidden="$compact"
24
27
  match-button
25
28
  type="button"
26
29
  from:size="$size"
@@ -40,6 +43,7 @@
40
43
  ></ui-input>
41
44
  <ui-icon-button
42
45
  data-number-step="increase"
46
+ from:hidden="$compact"
43
47
  match-button
44
48
  type="button"
45
49
  from:size="$size"
@@ -56,6 +60,9 @@
56
60
  padding: 0 !important;
57
61
  min-inline-size: 0;
58
62
  }
63
+ :host([compact]) {
64
+ inline-size: 5rem;
65
+ }
59
66
  :host[hidden] {
60
67
  display: none !important;
61
68
  }