@threadlabs/looma 0.12.6 → 0.13.0

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 (199) hide show
  1. package/components/ui-action-bar/ui-action-bar.html +10 -1
  2. package/components/ui-avatar/ui-avatar.html +18 -0
  3. package/components/ui-avatar-group/ui-avatar-group.html +16 -2
  4. package/components/ui-badge/ui-badge.html +42 -0
  5. package/components/ui-button/ui-button.html +70 -0
  6. package/components/ui-callout/ui-callout.html +55 -4
  7. package/components/ui-checkbox/ui-checkbox.html +16 -3
  8. package/components/ui-cluster/ui-cluster.html +7 -1
  9. package/components/ui-combobox/ui-combobox.html +66 -12
  10. package/components/ui-container/ui-container.html +12 -1
  11. package/components/ui-context-menu/ui-context-menu.html +10 -1
  12. package/components/ui-dialog/ui-dialog.html +21 -4
  13. package/components/ui-disclosure/ui-disclosure.html +23 -4
  14. package/components/ui-editable/ui-editable.html +1 -1
  15. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +2 -2
  16. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +2 -2
  17. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +8 -8
  18. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +3 -3
  19. package/components/ui-floating-action-button/ui-floating-action-button.html +14 -0
  20. package/components/ui-form-field/ui-form-field.html +10 -1
  21. package/components/ui-grid/ui-grid.html +11 -1
  22. package/components/ui-icon/ui-icon.html +17 -3
  23. package/components/ui-icon-button/ui-icon-button.html +81 -3
  24. package/components/ui-input/ui-input.html +68 -13
  25. package/components/ui-input-group/ui-input-group.html +14 -13
  26. package/components/ui-list/ui-list.html +10 -0
  27. package/components/ui-list-item/ui-list-item.html +22 -1
  28. package/components/ui-menu/ui-menu.html +17 -5
  29. package/components/ui-menu-item/ui-menu-item.html +30 -3
  30. package/components/ui-nav-item/ui-nav-item.html +14 -0
  31. package/components/ui-popover/ui-popover.html +6 -0
  32. package/components/ui-radio/ui-radio.html +16 -3
  33. package/components/ui-reel/ui-reel.html +15 -2
  34. package/components/ui-search-result-row/ui-search-result-row.html +34 -0
  35. package/components/ui-search-shell/ui-search-shell.html +65 -11
  36. package/components/ui-select/ui-select.html +15 -1
  37. package/components/ui-separator/ui-separator.html +9 -2
  38. package/components/ui-sidebar/ui-sidebar.html +22 -1
  39. package/components/ui-stack/ui-stack.html +7 -1
  40. package/components/ui-switch/ui-switch.html +21 -3
  41. package/components/ui-switcher/ui-switcher.html +18 -5
  42. package/components/ui-tabs/ui-tabs.html +21 -2
  43. package/components/ui-textarea/ui-textarea.html +15 -1
  44. package/components/ui-toast-region/ui-toast-region.html +16 -2
  45. package/components/ui-tooltip/ui-tooltip.html +62 -13
  46. package/components/ui-top-bar/ui-top-bar.html +34 -1
  47. package/components/ui-tree/ui-tree.html +27 -4
  48. package/components/ui-tree-item/ui-tree-item.html +39 -10
  49. package/components/ui-tree-item/ui-tree-item.js +1 -1
  50. package/dist/index.js +1 -1
  51. package/package.json +1 -1
  52. package/styles/ui-action-bar.css +14 -3
  53. package/styles/ui-avatar-group.css +20 -4
  54. package/styles/ui-avatar.css +22 -2
  55. package/styles/ui-badge.css +46 -2
  56. package/styles/ui-button.css +74 -2
  57. package/styles/ui-callout.css +59 -6
  58. package/styles/ui-checkbox.css +20 -5
  59. package/styles/ui-cluster.css +10 -2
  60. package/styles/ui-combobox.css +69 -14
  61. package/styles/ui-container.css +14 -2
  62. package/styles/ui-context-menu.css +14 -3
  63. package/styles/ui-dialog.css +25 -6
  64. package/styles/ui-disclosure.css +27 -6
  65. package/styles/ui-editable.css +1 -1
  66. package/styles/ui-editor-slash-menu.css +2 -2
  67. package/styles/ui-editor-table-context-menu.css +2 -2
  68. package/styles/ui-editor-table-overlay.css +8 -8
  69. package/styles/ui-editor-table-toolbar.css +3 -3
  70. package/styles/ui-floating-action-button.css +18 -2
  71. package/styles/ui-form-field.css +14 -3
  72. package/styles/ui-grid.css +14 -2
  73. package/styles/ui-icon-button.css +85 -5
  74. package/styles/ui-icon.css +21 -5
  75. package/styles/ui-input-group.css +14 -13
  76. package/styles/ui-input.css +73 -15
  77. package/styles/ui-list-item.css +26 -3
  78. package/styles/ui-list.css +14 -2
  79. package/styles/ui-menu-item.css +34 -5
  80. package/styles/ui-menu.css +21 -6
  81. package/styles/ui-nav-item.css +18 -2
  82. package/styles/ui-popover.css +10 -2
  83. package/styles/ui-radio.css +20 -5
  84. package/styles/ui-reel.css +18 -3
  85. package/styles/ui-search-result-row.css +38 -2
  86. package/styles/ui-search-shell.css +69 -13
  87. package/styles/ui-select.css +19 -3
  88. package/styles/ui-separator.css +14 -2
  89. package/styles/ui-sidebar.css +26 -3
  90. package/styles/ui-stack.css +10 -2
  91. package/styles/ui-switch.css +25 -5
  92. package/styles/ui-switcher.css +21 -6
  93. package/styles/ui-tabs.css +25 -4
  94. package/styles/ui-textarea.css +19 -3
  95. package/styles/ui-toast-region.css +20 -4
  96. package/styles/ui-tooltip.css +66 -15
  97. package/styles/ui-top-bar.css +38 -3
  98. package/styles/ui-tree-item.css +43 -12
  99. package/styles/ui-tree.css +33 -6
  100. package/theme-dark.css +1 -1
  101. package/theme-light.css +1 -1
  102. package/tokens.css +8 -6
  103. package/vue/UiActionBar.vue +12 -3
  104. package/vue/UiAvatar.vue +18 -0
  105. package/vue/UiAvatarGroup.vue +16 -2
  106. package/vue/UiBadge.vue +42 -0
  107. package/vue/UiButton.vue +70 -0
  108. package/vue/UiCallout.vue +55 -4
  109. package/vue/UiCheckbox.vue +16 -3
  110. package/vue/UiCluster.vue +6 -0
  111. package/vue/UiCombobox.vue +66 -12
  112. package/vue/UiContainer.vue +10 -0
  113. package/vue/UiContextMenu.vue +10 -1
  114. package/vue/UiDialog.vue +21 -4
  115. package/vue/UiDisclosure.vue +23 -4
  116. package/vue/UiEditable.vue +1 -1
  117. package/vue/UiEditorSlashMenu.vue +2 -2
  118. package/vue/UiEditorTableContextMenu.vue +2 -2
  119. package/vue/UiEditorTableOverlay.vue +8 -8
  120. package/vue/UiEditorTableToolbar.vue +3 -3
  121. package/vue/UiFloatingActionButton.vue +14 -0
  122. package/vue/UiFormField.vue +10 -1
  123. package/vue/UiGrid.vue +10 -0
  124. package/vue/UiIcon.vue +17 -3
  125. package/vue/UiIconButton.vue +81 -3
  126. package/vue/UiInput.vue +90 -15
  127. package/vue/UiInputGroup.vue +14 -13
  128. package/vue/UiList.vue +12 -2
  129. package/vue/UiListItem.vue +30 -9
  130. package/vue/UiMenu.vue +17 -5
  131. package/vue/UiMenuItem.vue +42 -4
  132. package/vue/UiNavItem.vue +17 -3
  133. package/vue/UiPopover.vue +6 -0
  134. package/vue/UiRadio.vue +16 -3
  135. package/vue/UiReel.vue +14 -1
  136. package/vue/UiSearchResultRow.vue +34 -0
  137. package/vue/UiSearchShell.vue +66 -12
  138. package/vue/UiSelect.vue +15 -1
  139. package/vue/UiSeparator.vue +9 -2
  140. package/vue/UiSidebar.vue +22 -1
  141. package/vue/UiStack.vue +6 -0
  142. package/vue/UiSwitch.vue +21 -3
  143. package/vue/UiSwitcher.vue +17 -4
  144. package/vue/UiTabs.vue +22 -3
  145. package/vue/UiTextarea.vue +15 -1
  146. package/vue/UiToastRegion.vue +16 -2
  147. package/vue/UiTooltip.vue +62 -13
  148. package/vue/UiTopBar.vue +34 -1
  149. package/vue/UiTree.vue +28 -5
  150. package/vue/UiTreeItem.vue +46 -11
  151. package/vue/chunks/UiActionBar.js +1 -1
  152. package/vue/chunks/UiAvatar.js +1 -1
  153. package/vue/chunks/UiAvatarGroup.js +1 -1
  154. package/vue/chunks/UiBadge.js +1 -1
  155. package/vue/chunks/UiButton.js +1 -1
  156. package/vue/chunks/UiCallout.js +1 -1
  157. package/vue/chunks/UiCheckbox.js +1 -1
  158. package/vue/chunks/UiCluster.js +1 -1
  159. package/vue/chunks/UiCombobox.js +1 -1
  160. package/vue/chunks/UiContainer.js +1 -1
  161. package/vue/chunks/UiContextMenu.js +1 -1
  162. package/vue/chunks/UiDialog.js +1 -1
  163. package/vue/chunks/UiDisclosure.js +1 -1
  164. package/vue/chunks/UiEditable.js +1 -1
  165. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  166. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  167. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  168. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  169. package/vue/chunks/UiFloatingActionButton.js +1 -1
  170. package/vue/chunks/UiFormField.js +1 -1
  171. package/vue/chunks/UiGrid.js +1 -1
  172. package/vue/chunks/UiIcon.js +1 -1
  173. package/vue/chunks/UiIconButton.js +1 -1
  174. package/vue/chunks/UiInput.js +1 -1
  175. package/vue/chunks/UiInputGroup.js +1 -1
  176. package/vue/chunks/UiList.js +1 -1
  177. package/vue/chunks/UiListItem.js +1 -1
  178. package/vue/chunks/UiMenu.js +1 -1
  179. package/vue/chunks/UiMenuItem.js +1 -1
  180. package/vue/chunks/UiNavItem.js +1 -1
  181. package/vue/chunks/UiPopover.js +1 -1
  182. package/vue/chunks/UiRadio.js +1 -1
  183. package/vue/chunks/UiReel.js +1 -1
  184. package/vue/chunks/UiSearchResultRow.js +1 -1
  185. package/vue/chunks/UiSearchShell.js +1 -1
  186. package/vue/chunks/UiSelect.js +1 -1
  187. package/vue/chunks/UiSeparator.js +1 -1
  188. package/vue/chunks/UiSidebar.js +1 -1
  189. package/vue/chunks/UiStack.js +1 -1
  190. package/vue/chunks/UiSwitch.js +1 -1
  191. package/vue/chunks/UiSwitcher.js +1 -1
  192. package/vue/chunks/UiTabs.js +1 -1
  193. package/vue/chunks/UiTextarea.js +1 -1
  194. package/vue/chunks/UiToastRegion.js +1 -1
  195. package/vue/chunks/UiTooltip.js +1 -1
  196. package/vue/chunks/UiTopBar.js +1 -1
  197. package/vue/chunks/UiTree.js +1 -1
  198. package/vue/chunks/UiTreeItem.js +1 -1
  199. package/vue/components.css +1959 -927
@@ -190,8 +190,8 @@
190
190
  }
191
191
 
192
192
  .handle {
193
- --ui-icon-size: 14px;
194
- --ui-icon-stroke-width: 2;
193
+ --_ui-default-icon-size: 14px;
194
+ --_ui-default-icon-stroke-width: 2;
195
195
  }
196
196
 
197
197
  .handle[data-ui-proximity="near"],
@@ -339,8 +339,8 @@
339
339
 
340
340
  .selector:hover,
341
341
  .cell-menu:hover {
342
- background: var(--ui-icon-button-hover-surface, var(--ui-surface-muted));
343
- color: var(--ui-icon-button-hover-text, var(--ui-text-primary));
342
+ background: var(--ui-surface-muted);
343
+ color: var(--ui-text-primary);
344
344
  box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
345
345
  }
346
346
 
@@ -364,8 +364,8 @@
364
364
  display: block;
365
365
  width: 14px;
366
366
  height: 14px;
367
- --ui-icon-size: 14px;
368
- --ui-icon-stroke-width: 2;
367
+ --_ui-default-icon-size: 14px;
368
+ --_ui-default-icon-stroke-width: 2;
369
369
  opacity: 0;
370
370
  transform: scale(0.72);
371
371
  transition:
@@ -427,8 +427,8 @@
427
427
  }
428
428
 
429
429
  .cell-menu {
430
- --ui-icon-size: 15px;
431
- --ui-icon-stroke-width: 2;
430
+ --_ui-default-icon-size: 15px;
431
+ --_ui-default-icon-stroke-width: 2;
432
432
  }
433
433
 
434
434
  :host[hidden] {
@@ -186,13 +186,13 @@
186
186
  }
187
187
 
188
188
  :host {
189
- --ui-icon-size: var(--ui-editor-toolbar-icon-size, 1rem);
190
- --ui-icon-stroke-width: var(--ui-editor-toolbar-icon-stroke-width, 1.75);
189
+ --_ui-default-icon-size: var(--ui-editor-toolbar-icon-size, 1rem);
190
+ --_ui-default-icon-stroke-width: var(--ui-editor-toolbar-icon-stroke-width, 1.75);
191
191
  }
192
192
 
193
193
  .chevron {
194
194
  display: inline-flex;
195
- --ui-icon-size: 0.875rem;
195
+ --_ui-default-icon-size: 0.875rem;
196
196
  }
197
197
 
198
198
  :host .icon-button {
@@ -8,6 +8,20 @@
8
8
  </defs>
9
9
  <button type="button" :aria-label="label" :disabled="disabled"><slot></slot></button>
10
10
  <style>
11
+ /* This component's hooks style the element they are set on, and never a nested one. */
12
+ @property --ui-floating-action-button-inset-block-end {
13
+ syntax: "*";
14
+ inherits: false;
15
+ }
16
+ @property --ui-floating-action-button-inset-inline-end {
17
+ syntax: "*";
18
+ inherits: false;
19
+ }
20
+ @property --ui-floating-action-button-z-index {
21
+ syntax: "*";
22
+ inherits: false;
23
+ }
24
+
11
25
  :host {
12
26
  position: fixed;
13
27
  inset-block-end: calc(var(--ui-floating-action-button-inset-block-end, var(--ui-space-6)) + env(safe-area-inset-bottom));
@@ -17,7 +17,16 @@
17
17
  <div class="error"><slot name="error"></slot></div>
18
18
  </div>
19
19
  <style>
20
+ /* This component's hooks style the element they are set on, and never a nested one. */
21
+ @property --ui-form-field-help-min-block-size {
22
+ syntax: "*";
23
+ inherits: false;
24
+ }
25
+
20
26
  :host {
27
+ /* Hooks do not inherit, so the parts below read them from the root. */
28
+ --_ui-form-field-help-min-block-size: var(--ui-form-field-help-min-block-size);
29
+
21
30
  display: grid;
22
31
  gap: var(--ui-space-2);
23
32
  min-inline-size: 0;
@@ -45,7 +54,7 @@
45
54
  }
46
55
 
47
56
  .help > :slotted(*) {
48
- min-block-size: var(--ui-form-field-help-min-block-size, 0);
57
+ min-block-size: var(--_ui-form-field-help-min-block-size, 0);
49
58
  }
50
59
 
51
60
  /* An error reads in the danger colour, the one the invalid control's border takes. */
@@ -2,13 +2,23 @@
2
2
  <defs>
3
3
  <prop name="gap" type="xs | s | m | l | xl"
4
4
  >Space between cells, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-grid-gap custom property,
5
- when set, overrides it.</prop>
5
+ set on the grid itself, overrides it; set on an ancestor, it does nothing.</prop>
6
6
  <prop name="min" type="sm | md | lg"
7
7
  >The narrowest a column may get before the grid drops to fewer columns: sm is 12rem (also the default), md is 16rem, and lg is 20rem. The grid fits as many
8
8
  equal columns as its width allows, and a single column never overflows a narrower container.</prop>
9
9
  </defs>
10
10
  <div><slot></slot></div>
11
11
  <style>
12
+ /* This component's hooks style the element they are set on, and never a nested one. */
13
+ @property --ui-grid-gap {
14
+ syntax: "*";
15
+ inherits: false;
16
+ }
17
+ @property --ui-grid-min {
18
+ syntax: "*";
19
+ inherits: false;
20
+ }
21
+
12
22
  :host {
13
23
  --_grid-gap: var(--ui-space-4);
14
24
  --_grid-min: 12rem;
@@ -20,17 +20,31 @@
20
20
  </svg>
21
21
  </span>
22
22
  <style>
23
+ /* This component's hooks style the element they are set on, and never a nested one. */
24
+ @property --ui-icon-size {
25
+ syntax: "*";
26
+ inherits: false;
27
+ }
28
+ @property --ui-icon-stroke-width {
29
+ syntax: "*";
30
+ inherits: false;
31
+ }
32
+
23
33
  :host {
34
+ /* Hooks do not inherit, so the svg reads the stroke from the root. A Looma component that
35
+ sizes the icons it renders sets --_ui-default-icon-*, which the icon's own hooks override. */
36
+ --_ui-icon-stroke-width: var(--ui-icon-stroke-width, var(--_ui-default-icon-stroke-width));
37
+
24
38
  display: inline-flex;
25
39
  flex: none;
26
- inline-size: var(--ui-icon-size, 1em);
27
- block-size: var(--ui-icon-size, 1em);
40
+ inline-size: var(--ui-icon-size, var(--_ui-default-icon-size, 1em));
41
+ block-size: var(--ui-icon-size, var(--_ui-default-icon-size, 1em));
28
42
  }
29
43
 
30
44
  svg {
31
45
  inline-size: 100%;
32
46
  block-size: 100%;
33
- stroke-width: var(--ui-icon-stroke-width, 2);
47
+ stroke-width: var(--_ui-icon-stroke-width, 2);
34
48
  }
35
49
 
36
50
  /* A component that sets its display still honours the hidden attribute on its root. */
@@ -16,7 +16,85 @@
16
16
  </defs>
17
17
  <button :disabled="disabled" type="button" :aria-label="label"><slot></slot></button>
18
18
  <style>
19
+ /* This component's hooks style the element they are set on, and never a nested one. */
20
+ @property --ui-icon-button-active-scale {
21
+ syntax: "*";
22
+ inherits: false;
23
+ }
24
+ @property --ui-icon-button-border {
25
+ syntax: "*";
26
+ inherits: false;
27
+ }
28
+ @property --ui-icon-button-disabled-filter {
29
+ syntax: "*";
30
+ inherits: false;
31
+ }
32
+ @property --ui-icon-button-disabled-opacity {
33
+ syntax: "*";
34
+ inherits: false;
35
+ }
36
+ @property --ui-icon-button-hover-border {
37
+ syntax: "*";
38
+ inherits: false;
39
+ }
40
+ @property --ui-icon-button-hover-surface {
41
+ syntax: "*";
42
+ inherits: false;
43
+ }
44
+ @property --ui-icon-button-hover-text {
45
+ syntax: "*";
46
+ inherits: false;
47
+ }
48
+ @property --ui-icon-button-icon-size {
49
+ syntax: "*";
50
+ inherits: false;
51
+ }
52
+ @property --ui-icon-button-icon-stroke-width {
53
+ syntax: "*";
54
+ inherits: false;
55
+ }
56
+ @property --ui-icon-button-outline-surface {
57
+ syntax: "*";
58
+ inherits: false;
59
+ }
60
+ @property --ui-icon-button-outline-text {
61
+ syntax: "*";
62
+ inherits: false;
63
+ }
64
+ @property --ui-icon-button-radius {
65
+ syntax: "*";
66
+ inherits: false;
67
+ }
68
+ @property --ui-icon-button-size {
69
+ syntax: "*";
70
+ inherits: false;
71
+ }
72
+ @property --ui-icon-button-solid-hover-surface {
73
+ syntax: "*";
74
+ inherits: false;
75
+ }
76
+ @property --ui-icon-button-solid-shadow {
77
+ syntax: "*";
78
+ inherits: false;
79
+ }
80
+ @property --ui-icon-button-solid-surface {
81
+ syntax: "*";
82
+ inherits: false;
83
+ }
84
+ @property --ui-icon-button-solid-text {
85
+ syntax: "*";
86
+ inherits: false;
87
+ }
88
+ @property --ui-icon-button-surface {
89
+ syntax: "*";
90
+ inherits: false;
91
+ }
92
+
19
93
  :host {
94
+ /* Hooks do not inherit, so the parts below read them from the root. */
95
+ --_ui-icon-button-icon-size: var(--ui-icon-button-icon-size);
96
+ --_ui-icon-button-icon-stroke-width: var(--ui-icon-button-icon-stroke-width);
97
+
20
98
  display: inline-flex;
21
99
  color: var(--ui-text-secondary);
22
100
  }
@@ -198,10 +276,10 @@
198
276
  }
199
277
 
200
278
  :slotted(svg) {
201
- inline-size: var(--ui-icon-button-icon-size, var(--_icon-button-icon-default));
202
- block-size: var(--ui-icon-button-icon-size, var(--_icon-button-icon-default));
279
+ inline-size: var(--_ui-icon-button-icon-size, var(--_icon-button-icon-default));
280
+ block-size: var(--_ui-icon-button-icon-size, var(--_icon-button-icon-default));
203
281
  flex-shrink: 0;
204
- stroke-width: var(--ui-icon-button-icon-stroke-width, 1.75);
282
+ stroke-width: var(--_ui-icon-button-icon-stroke-width, 1.75);
205
283
  }
206
284
 
207
285
  /* A component that sets its display still honours the hidden attribute on its root. */
@@ -10,22 +10,74 @@
10
10
  </defs>
11
11
  <input :value="value" :disabled="disabled" :readonly="readonly" :required="required" :aria-invalid="invalid">
12
12
  <style>
13
+ /* This component's hooks style the element they are set on, and never a nested one. An Input
14
+ Group sets --_ui-default-input-* for the input inside it, below the input's own hooks. */
15
+ @property --ui-input-border {
16
+ syntax: "*";
17
+ inherits: false;
18
+ }
19
+ @property --ui-input-border-hover {
20
+ syntax: "*";
21
+ inherits: false;
22
+ }
23
+ @property --ui-input-border-width {
24
+ syntax: "*";
25
+ inherits: false;
26
+ }
27
+ @property --ui-input-focus-border {
28
+ syntax: "*";
29
+ inherits: false;
30
+ }
31
+ @property --ui-input-focus-outline {
32
+ syntax: "*";
33
+ inherits: false;
34
+ }
35
+ @property --ui-input-focus-shadow {
36
+ syntax: "*";
37
+ inherits: false;
38
+ }
39
+ @property --ui-input-invalid-border {
40
+ syntax: "*";
41
+ inherits: false;
42
+ }
43
+ @property --ui-input-invalid-focus-shadow {
44
+ syntax: "*";
45
+ inherits: false;
46
+ }
47
+ @property --ui-input-min-block-size {
48
+ syntax: "*";
49
+ inherits: false;
50
+ }
51
+ @property --ui-input-radius {
52
+ syntax: "*";
53
+ inherits: false;
54
+ }
55
+ @property --ui-input-shadow {
56
+ syntax: "*";
57
+ inherits: false;
58
+ }
59
+ @property --ui-input-surface {
60
+ syntax: "*";
61
+ inherits: false;
62
+ }
63
+
13
64
  :host {
14
65
  box-sizing: border-box;
15
66
  display: inline-block;
16
67
  inline-size: 100%;
17
68
  min-inline-size: 0;
18
- min-block-size: var(--ui-input-min-block-size, var(--ui-control-size-md));
69
+ min-block-size: var(--ui-input-min-block-size, var(--_ui-default-input-min-block-size, var(--ui-control-size-md)));
19
70
  margin: 0;
20
71
  padding: var(--ui-space-2) var(--ui-space-3);
21
72
  appearance: none;
22
- border: var(--ui-input-border-width, 1px) solid var(--ui-input-border, var(--ui-control-border, var(--ui-border-strong)));
23
- border-radius: var(--ui-input-radius, var(--ui-radius-md));
24
- background: var(--ui-input-surface, var(--ui-control-surface, var(--ui-surface-elevated)));
73
+ border: var(--ui-input-border-width, var(--_ui-default-input-border-width, 1px)) solid
74
+ var(--ui-input-border, var(--_ui-default-input-border, var(--ui-control-border, var(--ui-border-strong))));
75
+ border-radius: var(--ui-input-radius, var(--_ui-default-input-radius, var(--ui-radius-md)));
76
+ background: var(--ui-input-surface, var(--_ui-default-input-surface, var(--ui-control-surface, var(--ui-surface-elevated))));
25
77
  color: var(--ui-text-primary);
26
78
  font: inherit;
27
79
  line-height: var(--ui-line-height-md);
28
- box-shadow: var(--ui-input-shadow, var(--ui-control-inset));
80
+ box-shadow: var(--ui-input-shadow, var(--_ui-default-input-shadow, var(--ui-control-inset)));
29
81
  transition:
30
82
  border-color var(--ui-motion-fast) var(--ui-motion-ease),
31
83
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease),
@@ -44,32 +96,35 @@
44
96
  }
45
97
 
46
98
  :host:hover:not(:focus):not(:disabled) {
47
- border-color: var(--ui-input-border-hover, var(--ui-control-border-hover, var(--ui-text-secondary)));
99
+ border-color: var(--ui-input-border-hover, var(--_ui-default-input-border-hover, var(--ui-control-border-hover, var(--ui-text-secondary))));
48
100
  }
49
101
 
50
102
  :host:focus-visible {
51
- border-color: var(--ui-input-focus-border, var(--ui-control-focus, var(--ui-accent-solid)));
103
+ border-color: var(--ui-input-focus-border, var(--_ui-default-input-focus-border, var(--ui-control-focus, var(--ui-accent-solid))));
52
104
  outline: none;
53
- box-shadow: var(--ui-input-focus-shadow, var(--ui-control-inset), var(--ui-control-focus-halo-shadow));
105
+ box-shadow: var(--ui-input-focus-shadow, var(--_ui-default-input-focus-shadow, var(--ui-control-inset), var(--ui-control-focus-halo-shadow)));
54
106
  }
55
107
 
56
108
  /* The app's invalid flag, or the browser's own verdict once the user has left an invalid field. */
57
109
  :host[aria-invalid="true"],
58
110
  :host:user-invalid {
59
- border-color: var(--ui-input-invalid-border, var(--ui-danger-solid));
111
+ border-color: var(--ui-input-invalid-border, var(--_ui-default-input-invalid-border, var(--ui-danger-solid)));
60
112
  }
61
113
 
62
114
  :host:is([aria-invalid="true"], :user-invalid):focus-visible {
63
115
  box-shadow: var(
64
116
  --ui-input-invalid-focus-shadow,
65
- var(--ui-control-inset),
66
- 0 0 0 3px color-mix(in srgb, var(--ui-danger-solid) 22%, transparent)
117
+ var(
118
+ --_ui-default-input-invalid-focus-shadow,
119
+ var(--ui-control-inset),
120
+ 0 0 0 3px color-mix(in srgb, var(--ui-danger-solid) 22%, transparent)
121
+ )
67
122
  );
68
123
  }
69
124
 
70
125
  :host:disabled {
71
126
  background: var(--ui-control-surface-disabled, var(--ui-surface-muted));
72
- color: var(--ui-text-muted);
127
+ color: var(--ui-disabled-text);
73
128
  box-shadow: none;
74
129
  cursor: not-allowed;
75
130
  }
@@ -77,7 +132,7 @@
77
132
  /* Forced colors drop box shadows, so the focus ring becomes an outline. */
78
133
  @media (forced-colors: active) {
79
134
  :host:focus-visible {
80
- outline: var(--ui-input-focus-outline, 2px solid Highlight);
135
+ outline: var(--ui-input-focus-outline, var(--_ui-default-input-focus-outline, 2px solid Highlight));
81
136
  outline-offset: 1px;
82
137
  }
83
138
  }
@@ -18,19 +18,20 @@
18
18
  thing the field is for ("Continue" after a site's address), so it reads as the field's action
19
19
  and not the form's. */
20
20
  :host {
21
- /* The group's own border and height stand for the input's, so the group is a lone Input's height. */
22
- --ui-input-border-width: 0;
23
- --ui-input-min-block-size: 0;
24
- --ui-input-border: transparent;
25
- --ui-input-border-hover: transparent;
26
- --ui-input-focus-border: transparent;
27
- --ui-input-invalid-border: transparent;
28
- --ui-input-invalid-focus-shadow: none;
29
- --ui-input-shadow: none;
30
- --ui-input-focus-shadow: none;
31
- --ui-input-focus-outline: none;
32
- --ui-input-radius: 0;
33
- --ui-input-surface: transparent;
21
+ /* The group's own border and height stand for the input's, so the group is a lone Input's height.
22
+ Hooks do not inherit, so these are defaults for the input; its own hooks still win. */
23
+ --_ui-default-input-border-width: 0;
24
+ --_ui-default-input-min-block-size: 0;
25
+ --_ui-default-input-border: transparent;
26
+ --_ui-default-input-border-hover: transparent;
27
+ --_ui-default-input-focus-border: transparent;
28
+ --_ui-default-input-invalid-border: transparent;
29
+ --_ui-default-input-invalid-focus-shadow: none;
30
+ --_ui-default-input-shadow: none;
31
+ --_ui-default-input-focus-shadow: none;
32
+ --_ui-default-input-focus-outline: none;
33
+ --_ui-default-input-radius: 0;
34
+ --_ui-default-input-surface: transparent;
34
35
 
35
36
  display: flex;
36
37
  align-items: stretch;
@@ -9,6 +9,16 @@
9
9
  </defs>
10
10
  <ul role="list"><slot></slot></ul>
11
11
  <style>
12
+ /* This component's hooks style the element they are set on, and never a nested one. */
13
+ @property --ui-list-gap {
14
+ syntax: "*";
15
+ inherits: false;
16
+ }
17
+ @property --ui-list-min-item-width {
18
+ syntax: "*";
19
+ inherits: false;
20
+ }
21
+
12
22
  /* A list of items (ui-list-item). It owns the spacing between them, so a view never sets it. The
13
23
  explicit list role keeps the list announced as one: some browsers drop it from a list with no
14
24
  markers. */
@@ -16,6 +16,24 @@
16
16
  <span class="trailing"><slot name="trailing"></slot></span>
17
17
  </li>
18
18
  <style>
19
+ /* This component's hooks style the element they are set on, and never a nested one. */
20
+ @property --ui-list-item-gap {
21
+ syntax: "*";
22
+ inherits: false;
23
+ }
24
+ @property --ui-list-item-icon-size {
25
+ syntax: "*";
26
+ inherits: false;
27
+ }
28
+ @property --ui-list-item-padding-block {
29
+ syntax: "*";
30
+ inherits: false;
31
+ }
32
+ @property --ui-list-item-padding-inline {
33
+ syntax: "*";
34
+ inherits: false;
35
+ }
36
+
19
37
  /* One entry in a list: something to recognise (leading, usually an icon), its name (the default
20
38
  slot), one line about it (description), and what it offers (trailing, such as a button or a
21
39
  badge). The title and description are one line each and end in an ellipsis, so every item in a
@@ -26,6 +44,9 @@
26
44
  a router, a modified click, and "open in new tab" all work. Trailing controls sit above it and
27
45
  stay their own. */
28
46
  :host {
47
+ /* Hooks do not inherit, so the parts below read them from the root. */
48
+ --_ui-list-item-icon-size: var(--ui-list-item-icon-size);
49
+
29
50
  position: relative;
30
51
  box-sizing: border-box;
31
52
  display: flex;
@@ -74,7 +95,7 @@
74
95
 
75
96
  .leading {
76
97
  color: var(--ui-text-muted);
77
- font-size: var(--ui-list-item-icon-size, var(--ui-font-size-lg));
98
+ font-size: var(--_ui-list-item-icon-size, var(--ui-font-size-lg));
78
99
  }
79
100
 
80
101
  /* Trailing controls take their own clicks, above the title link's stretched hit area. */
@@ -14,17 +14,29 @@
14
14
  </defs>
15
15
  <div role="menu" aria-orientation="vertical"><div class="surface"><slot></slot></div></div>
16
16
  <style>
17
- /* Compact sets the part tokens its items read, so nothing has to rescale a global. */
17
+ /* This component's hooks style the element they are set on, and never a nested one. */
18
+ @property --ui-menu-viewport-gap {
19
+ syntax: "*";
20
+ inherits: false;
21
+ }
22
+
23
+ /* Compact sets its items' defaults, so nothing has to rescale a global; an item's own hooks
24
+ still win. */
18
25
  :host-state([density="compact"]) {
19
- --ui-menu-item-padding-block: var(--ui-space-1);
20
- --ui-menu-item-padding-inline: var(--ui-space-2);
21
- --ui-menu-item-font-size: var(--ui-font-size-sm);
22
- --ui-menu-item-radius: var(--ui-radius-sm);
26
+ --_ui-default-menu-item-padding-block: var(--ui-space-1);
27
+ --_ui-default-menu-item-padding-inline: var(--ui-space-2);
28
+ --_ui-default-menu-item-font-size: var(--ui-font-size-sm);
29
+ --_ui-default-menu-item-radius: var(--ui-radius-sm);
23
30
  padding: var(--ui-space-1);
24
31
  gap: 0;
25
32
  }
26
33
 
27
34
  :host {
35
+ /* A menu nested in a compact one starts again from its own density. */
36
+ --_ui-default-menu-item-padding-block: initial;
37
+ --_ui-default-menu-item-padding-inline: initial;
38
+ --_ui-default-menu-item-font-size: initial;
39
+ --_ui-default-menu-item-radius: initial;
28
40
  display: flex;
29
41
  flex-direction: column;
30
42
  box-sizing: border-box;
@@ -8,15 +8,42 @@
8
8
  </defs>
9
9
  <div role="menuitem" tabindex="-1" :aria-disabled="disabled" :data-value="value"><slot></slot></div>
10
10
  <style>
11
+ /* This component's hooks style the element they are set on, and never a nested one. */
12
+ @property --ui-menu-item-font-size {
13
+ syntax: "*";
14
+ inherits: false;
15
+ }
16
+ @property --ui-menu-item-hover-surface {
17
+ syntax: "*";
18
+ inherits: false;
19
+ }
20
+ @property --ui-menu-item-min-block-size {
21
+ syntax: "*";
22
+ inherits: false;
23
+ }
24
+ @property --ui-menu-item-padding-block {
25
+ syntax: "*";
26
+ inherits: false;
27
+ }
28
+ @property --ui-menu-item-padding-inline {
29
+ syntax: "*";
30
+ inherits: false;
31
+ }
32
+ @property --ui-menu-item-radius {
33
+ syntax: "*";
34
+ inherits: false;
35
+ }
36
+
11
37
  :host {
12
38
  display: block;
13
39
  box-sizing: border-box;
14
40
  width: 100%;
15
- padding: var(--ui-menu-item-padding-block, var(--ui-space-2)) var(--ui-menu-item-padding-inline, var(--ui-space-3));
41
+ padding: var(--ui-menu-item-padding-block, var(--_ui-default-menu-item-padding-block, var(--ui-space-2)))
42
+ var(--ui-menu-item-padding-inline, var(--_ui-default-menu-item-padding-inline, var(--ui-space-3)));
16
43
  text-align: left;
17
- border-radius: var(--ui-menu-item-radius, var(--ui-radius-md));
44
+ border-radius: var(--ui-menu-item-radius, var(--_ui-default-menu-item-radius, var(--ui-radius-md)));
18
45
  color: var(--ui-text-primary);
19
- font-size: var(--ui-menu-item-font-size, var(--ui-font-size-md));
46
+ font-size: var(--ui-menu-item-font-size, var(--_ui-default-menu-item-font-size, var(--ui-font-size-md)));
20
47
  font-weight: var(--ui-font-medium);
21
48
  cursor: pointer;
22
49
  outline: none;
@@ -29,6 +29,20 @@
29
29
  </span>
30
30
  </button>
31
31
  <style>
32
+ /* This component's hooks style the element they are set on, and never a nested one. */
33
+ @property --ui-nav-item-current-surface {
34
+ syntax: "*";
35
+ inherits: false;
36
+ }
37
+ @property --ui-nav-item-indicator-color {
38
+ syntax: "*";
39
+ inherits: false;
40
+ }
41
+ @property --ui-nav-item-indicator-width {
42
+ syntax: "*";
43
+ inherits: false;
44
+ }
45
+
32
46
  /* One destination in a side or rail navigation: an icon to find it by (leading), its name (the
33
47
  default slot), and an optional line under it (description), such as the record a section
34
48
  belongs to. Label and description are one line each and end in an ellipsis, so every item in a
@@ -15,6 +15,12 @@
15
15
  </defs>
16
16
  <span><div class="surface"><slot></slot></div></span>
17
17
  <style>
18
+ /* This component's hooks style the element they are set on, and never a nested one. */
19
+ @property --ui-popover-viewport-gap {
20
+ syntax: "*";
21
+ inherits: false;
22
+ }
23
+
18
24
  :host {
19
25
  box-sizing: border-box;
20
26
  max-inline-size: min(
@@ -23,7 +23,20 @@
23
23
  </span>
24
24
  </label>
25
25
  <style>
26
+ /* This component's hooks style the element they are set on, and never a nested one. */
27
+ @property --ui-radio-gap {
28
+ syntax: "*";
29
+ inherits: false;
30
+ }
31
+ @property --ui-radio-size {
32
+ syntax: "*";
33
+ inherits: false;
34
+ }
35
+
26
36
  :host {
37
+ /* Hooks do not inherit, so the parts below read them from the root. */
38
+ --_ui-radio-size: var(--ui-radio-size);
39
+
27
40
  display: inline-flex;
28
41
  align-items: flex-start;
29
42
  gap: var(--ui-radio-gap, var(--ui-space-2));
@@ -57,8 +70,8 @@
57
70
 
58
71
  input {
59
72
  flex: 0 0 auto;
60
- inline-size: var(--ui-radio-size, 1.125rem);
61
- block-size: var(--ui-radio-size, 1.125rem);
73
+ inline-size: var(--_ui-radio-size, 1.125rem);
74
+ block-size: var(--_ui-radio-size, 1.125rem);
62
75
  margin: 0.125em 0 0;
63
76
  accent-color: var(--ui-accent-solid);
64
77
  cursor: pointer;
@@ -70,7 +83,7 @@
70
83
  }
71
84
 
72
85
  :host-state([disabled]) {
73
- color: var(--ui-text-muted);
86
+ color: var(--ui-disabled-text);
74
87
  cursor: not-allowed;
75
88
  }
76
89
  :host-state([disabled]) input {