@threadlabs/looma 0.5.2 → 0.6.0-rc.2

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 (177) hide show
  1. package/components/shared/overlay.js +3 -0
  2. package/components/ui-button/ui-button.html +46 -26
  3. package/components/ui-callout/ui-callout.html +1 -1
  4. package/components/ui-checkbox/ui-checkbox.html +1 -1
  5. package/components/ui-cluster/ui-cluster.html +6 -6
  6. package/components/ui-combobox/ui-combobox.html +23 -23
  7. package/components/ui-container/ui-container.html +4 -4
  8. package/components/ui-context-menu/ui-context-menu.html +2 -2
  9. package/components/ui-dialog/ui-dialog.html +12 -12
  10. package/components/ui-disclosure/ui-disclosure.html +19 -4
  11. package/components/ui-editable/ui-editable.html +6 -6
  12. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +20 -20
  13. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +25 -25
  14. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +39 -39
  15. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +20 -20
  16. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +48 -48
  17. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +34 -34
  18. package/components/ui-editor-toolbar/ui-editor-toolbar.html +9 -9
  19. package/components/ui-floating-action-button/ui-floating-action-button.html +16 -22
  20. package/components/ui-grid/ui-grid.html +6 -6
  21. package/components/ui-icon-button/ui-icon-button.html +45 -40
  22. package/components/ui-input/ui-input.html +2 -2
  23. package/components/ui-menu/ui-menu.html +15 -4
  24. package/components/ui-menu-item/ui-menu-item.html +5 -5
  25. package/components/ui-popover/ui-popover.html +3 -3
  26. package/components/ui-reel/ui-reel.html +6 -6
  27. package/components/ui-search-result-row/ui-search-result-row.html +9 -9
  28. package/components/ui-search-shell/ui-search-shell.html +3 -3
  29. package/components/ui-select/ui-select.html +2 -2
  30. package/components/ui-sidebar/ui-sidebar.html +11 -11
  31. package/components/ui-stack/ui-stack.html +6 -6
  32. package/components/ui-switcher/ui-switcher.html +6 -6
  33. package/components/ui-tabs/ui-tabs.html +18 -4
  34. package/components/ui-textarea/ui-textarea.html +2 -2
  35. package/components/ui-toast-region/ui-toast-region.html +2 -2
  36. package/components/ui-tooltip/ui-tooltip.html +1 -1
  37. package/components/ui-top-bar/ui-top-bar.html +5 -5
  38. package/components/ui-tree/ui-tree.html +7 -0
  39. package/components/ui-tree-item/ui-tree-item.html +15 -7
  40. package/dist/index.js +1 -1
  41. package/package.json +1 -1
  42. package/styles/ui-button.css +47 -26
  43. package/styles/ui-callout.css +1 -1
  44. package/styles/ui-checkbox.css +1 -1
  45. package/styles/ui-cluster.css +6 -6
  46. package/styles/ui-combobox.css +23 -23
  47. package/styles/ui-container.css +4 -4
  48. package/styles/ui-context-menu.css +2 -2
  49. package/styles/ui-dialog.css +12 -12
  50. package/styles/ui-disclosure.css +22 -6
  51. package/styles/ui-editable.css +6 -6
  52. package/styles/ui-editor-insert-table-grid.css +20 -20
  53. package/styles/ui-editor-mention-menu.css +25 -25
  54. package/styles/ui-editor-slash-menu.css +39 -39
  55. package/styles/ui-editor-table-context-menu.css +20 -20
  56. package/styles/ui-editor-table-overlay.css +48 -48
  57. package/styles/ui-editor-table-toolbar.css +34 -34
  58. package/styles/ui-editor-toolbar.css +9 -9
  59. package/styles/ui-floating-action-button.css +16 -22
  60. package/styles/ui-grid.css +6 -6
  61. package/styles/ui-icon-button.css +45 -40
  62. package/styles/ui-input.css +2 -2
  63. package/styles/ui-menu-item.css +5 -5
  64. package/styles/ui-menu.css +18 -6
  65. package/styles/ui-popover.css +3 -3
  66. package/styles/ui-reel.css +6 -6
  67. package/styles/ui-search-result-row.css +9 -9
  68. package/styles/ui-search-shell.css +3 -3
  69. package/styles/ui-select.css +2 -2
  70. package/styles/ui-sidebar.css +11 -11
  71. package/styles/ui-stack.css +6 -6
  72. package/styles/ui-switcher.css +6 -6
  73. package/styles/ui-tabs.css +20 -6
  74. package/styles/ui-textarea.css +2 -2
  75. package/styles/ui-toast-region.css +2 -2
  76. package/styles/ui-tooltip.css +1 -1
  77. package/styles/ui-top-bar.css +5 -5
  78. package/styles/ui-tree-item.css +21 -8
  79. package/styles/ui-tree.css +7 -1
  80. package/theme-dark.css +46 -103
  81. package/theme-high-contrast.css +22 -22
  82. package/theme-light.css +17 -41
  83. package/tokens.css +154 -201
  84. package/vanilla/UiButton.d.ts +1 -0
  85. package/vanilla/UiButton.js +1 -1
  86. package/vanilla/UiDisclosure.d.ts +1 -0
  87. package/vanilla/UiDisclosure.js +1 -1
  88. package/vanilla/UiMenu.d.ts +1 -0
  89. package/vanilla/UiMenu.js +1 -1
  90. package/vanilla/UiTabs.d.ts +1 -0
  91. package/vanilla/UiTabs.js +1 -1
  92. package/vanilla/UiTree.d.ts +1 -0
  93. package/vanilla/UiTree.js +1 -1
  94. package/vue/UiButton.d.ts +2 -0
  95. package/vue/UiButton.vue +56 -41
  96. package/vue/UiCallout.vue +1 -1
  97. package/vue/UiCheckbox.vue +1 -1
  98. package/vue/UiCluster.vue +6 -6
  99. package/vue/UiCombobox.vue +23 -23
  100. package/vue/UiContainer.vue +4 -4
  101. package/vue/UiContextMenu.vue +2 -2
  102. package/vue/UiDialog.vue +12 -12
  103. package/vue/UiDisclosure.d.ts +2 -0
  104. package/vue/UiDisclosure.vue +21 -4
  105. package/vue/UiEditable.vue +6 -6
  106. package/vue/UiEditorInsertTableGrid.vue +20 -20
  107. package/vue/UiEditorMentionMenu.vue +25 -25
  108. package/vue/UiEditorSlashMenu.vue +39 -39
  109. package/vue/UiEditorTableContextMenu.vue +20 -20
  110. package/vue/UiEditorTableOverlay.vue +48 -57
  111. package/vue/UiEditorTableToolbar.vue +34 -34
  112. package/vue/UiEditorToolbar.vue +9 -9
  113. package/vue/UiFloatingActionButton.vue +17 -22
  114. package/vue/UiGrid.vue +6 -6
  115. package/vue/UiIconButton.vue +45 -55
  116. package/vue/UiInput.vue +2 -2
  117. package/vue/UiMenu.d.ts +2 -0
  118. package/vue/UiMenu.vue +17 -7
  119. package/vue/UiMenuItem.vue +6 -5
  120. package/vue/UiPopover.vue +3 -3
  121. package/vue/UiReel.vue +6 -6
  122. package/vue/UiSearchResultRow.vue +10 -13
  123. package/vue/UiSearchShell.vue +3 -3
  124. package/vue/UiSelect.vue +2 -2
  125. package/vue/UiSidebar.vue +11 -16
  126. package/vue/UiStack.vue +6 -6
  127. package/vue/UiSwitcher.vue +6 -6
  128. package/vue/UiTabs.d.ts +2 -0
  129. package/vue/UiTabs.vue +21 -4
  130. package/vue/UiTextarea.vue +2 -2
  131. package/vue/UiToastRegion.vue +2 -2
  132. package/vue/UiTooltip.vue +1 -1
  133. package/vue/UiTopBar.vue +5 -5
  134. package/vue/UiTree.d.ts +2 -0
  135. package/vue/UiTree.vue +24 -1
  136. package/vue/UiTreeItem.vue +16 -8
  137. package/vue/chunks/UiButton.js +4 -2
  138. package/vue/chunks/UiCallout.js +1 -1
  139. package/vue/chunks/UiCheckbox.js +1 -1
  140. package/vue/chunks/UiCluster.js +1 -1
  141. package/vue/chunks/UiCombobox.js +1 -1
  142. package/vue/chunks/UiContainer.js +1 -1
  143. package/vue/chunks/UiContextMenu.js +1 -1
  144. package/vue/chunks/UiDialog.js +1 -1
  145. package/vue/chunks/UiDisclosure.js +3 -2
  146. package/vue/chunks/UiEditable.js +1 -1
  147. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  148. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  149. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  150. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  151. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  152. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  153. package/vue/chunks/UiEditorToolbar.js +1 -1
  154. package/vue/chunks/UiFloatingActionButton.js +1 -1
  155. package/vue/chunks/UiGrid.js +1 -1
  156. package/vue/chunks/UiIconButton.js +1 -1
  157. package/vue/chunks/UiInput.js +1 -1
  158. package/vue/chunks/UiMenu.js +3 -2
  159. package/vue/chunks/UiMenuItem.js +1 -1
  160. package/vue/chunks/UiPopover.js +1 -1
  161. package/vue/chunks/UiReel.js +1 -1
  162. package/vue/chunks/UiSearchResultRow.js +1 -1
  163. package/vue/chunks/UiSearchShell.js +1 -1
  164. package/vue/chunks/UiSelect.js +1 -1
  165. package/vue/chunks/UiSidebar.js +1 -1
  166. package/vue/chunks/UiStack.js +1 -1
  167. package/vue/chunks/UiSwitcher.js +1 -1
  168. package/vue/chunks/UiTabs.js +7 -2
  169. package/vue/chunks/UiTextarea.js +1 -1
  170. package/vue/chunks/UiToastRegion.js +1 -1
  171. package/vue/chunks/UiTooltip.js +1 -1
  172. package/vue/chunks/UiTopBar.js +1 -1
  173. package/vue/chunks/UiTree.js +8 -2
  174. package/vue/chunks/UiTreeItem.js +1 -1
  175. package/vue/components.css +1114 -1090
  176. package/vue/editor/LoomaEditor.d.ts +11 -0
  177. package/vue/editor/index.js +17 -0
@@ -32,6 +32,9 @@ function ensureListeners(document, state) {
32
32
  const top = state.records.at(-1);
33
33
  if (!top || top.dismissible === false) return;
34
34
  const boundary = [top.element, ...(top.relatedElements ?? [])];
35
+ // Light dismiss needs a press it can place: an activation with no pointer (assistive technology,
36
+ // or a synthetic event) reports 0,0 and would otherwise read as a press outside the overlay.
37
+ if (event.clientX === 0 && event.clientY === 0) return;
35
38
  // A modal dialog's ::backdrop reports the dialog itself as the target; a press outside its box is outside.
36
39
  const rect = top.element.getBoundingClientRect();
37
40
  const onBackdrop = event.target === top.element
@@ -3,6 +3,8 @@
3
3
  <prop name="variant" type="outline | solid | danger | ghost | link" default="outline"
4
4
  >Visual emphasis and semantic intent. link is an inline text action that reads as a link.</prop>
5
5
  <prop name="size" type="sm | md | lg" default="md">Control size.</prop>
6
+ <prop name="tone" type="neutral | accent" default="neutral"
7
+ >Intent of an outline, ghost, or link button. accent tints it with the accent colour, for a secondary action that still reads as the primary path.</prop>
6
8
  <prop name="disabled" type="boolean" default="false">disabled token.</prop>
7
9
  <prop name="align" type="center | start" default="center"
8
10
  >Content alignment. start lays the content out like a list option: from the start edge, with start-aligned text.</prop>
@@ -34,16 +36,16 @@
34
36
 
35
37
  :host {
36
38
  appearance: none;
37
- min-block-size: var(--ui-button-min-block-size, var(--ui-control-size-md, 2.5rem));
39
+ min-block-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
38
40
  border: 1px solid var(--ui-button-border, var(--ui-border-strong));
39
- border-radius: var(--ui-button-radius, var(--ui-radius-2));
41
+ border-radius: var(--ui-button-radius, var(--ui-radius-md));
40
42
  background: var(--ui-button-surface, var(--ui-surface-elevated));
41
43
  color: var(--ui-button-text, var(--ui-action-secondary-text, var(--ui-text-primary)));
42
44
  font: inherit;
43
- font-weight: var(--ui-font-medium, 500);
45
+ font-weight: var(--ui-font-medium);
44
46
  line-height: var(--ui-line-height-tight);
45
47
  padding: var(--ui-space-2) var(--ui-space-3);
46
- background-image: var(--ui-raised-highlight, none);
48
+ background-image: var(--ui-raised-highlight);
47
49
  box-shadow: var(--ui-button-shadow, var(--ui-raised, var(--ui-shadow-xs)));
48
50
  cursor: pointer;
49
51
  transition:
@@ -63,13 +65,13 @@
63
65
  }
64
66
 
65
67
  :host-state([size="sm"]) {
66
- min-block-size: var(--ui-control-size-sm, 2rem);
68
+ min-block-size: var(--ui-control-size-sm);
67
69
  padding: var(--ui-space-1) var(--ui-space-2);
68
70
  font-size: 0.875rem;
69
71
  }
70
72
 
71
73
  :host-state([size="lg"]) {
72
- min-block-size: var(--ui-control-size-lg, 3rem);
74
+ min-block-size: var(--ui-control-size-lg);
73
75
  padding: var(--ui-space-3) var(--ui-space-4);
74
76
  font-size: 1rem;
75
77
  }
@@ -123,6 +125,23 @@
123
125
  transform: translateY(0);
124
126
  }
125
127
 
128
+ /* An accent-tinted secondary action: the outline, ghost, and link variants in the accent colour.
129
+ Solid and danger already carry their own intent. */
130
+ :host-state([tone="accent"]):host-state([variant="outline"]) {
131
+ border-color: var(--ui-button-accent-border, var(--ui-accent));
132
+ background: var(--ui-button-accent-surface, var(--ui-accent-subtle));
133
+ color: var(--ui-button-accent-text, var(--ui-accent-active));
134
+ }
135
+
136
+ :host-state([tone="accent"]):host-state([variant="outline"]):hover:enabled {
137
+ border-color: var(--ui-button-accent-hover-border, var(--ui-accent-hover));
138
+ background: var(--ui-button-accent-hover-surface, color-mix(in srgb, var(--ui-accent) 16%, var(--ui-surface)));
139
+ }
140
+
141
+ :host-state([tone="accent"]):is(:host-state([variant="ghost"]), :host-state([variant="link"])) {
142
+ color: var(--ui-button-accent-text, var(--ui-accent-active));
143
+ }
144
+
126
145
  :host-state([variant="ghost"]) {
127
146
  border-color: transparent;
128
147
  background: transparent;
@@ -132,12 +151,12 @@
132
151
 
133
152
  /* Tints derive from the text colour, not a surface token, so hover and press show on any background. */
134
153
  :host-state([variant="ghost"]):hover:enabled {
135
- background: var(--ui-button-ghost-hover, color-mix(in srgb, currentColor 8%, transparent));
154
+ background: var(--ui-button-ghost-hover-surface, color-mix(in srgb, currentColor 8%, transparent));
136
155
  border-color: transparent;
137
156
  }
138
157
 
139
158
  :host-state([variant="ghost"]):active:enabled {
140
- background: var(--ui-button-ghost-active, color-mix(in srgb, currentColor 14%, transparent));
159
+ background: var(--ui-button-ghost-active-surface, color-mix(in srgb, currentColor 14%, transparent));
141
160
  border-color: transparent;
142
161
  }
143
162
 
@@ -157,34 +176,34 @@
157
176
 
158
177
  /* Disabled colours fall back to each variant's own; ghost and link take only the text colour. */
159
178
  :host:disabled {
160
- opacity: var(--ui-button-disabled-opacity, 0.6);
179
+ opacity: var(--ui-button-disabled-opacity, 1);
161
180
  cursor: not-allowed;
162
- border-color: var(--ui-button-disabled-border, var(--ui-button-border, var(--ui-border-strong)));
163
- background-color: var(--ui-button-disabled-surface, var(--ui-button-surface, var(--ui-surface-elevated)));
164
- color: var(--ui-button-disabled-text, var(--ui-button-text, var(--ui-action-secondary-text, var(--ui-text-primary))));
181
+ border-color: var(--ui-button-disabled-border, var(--ui-border));
182
+ background-color: var(--ui-button-disabled-surface, var(--ui-disabled-surface));
183
+ color: var(--ui-button-disabled-text, var(--ui-disabled-text));
165
184
  }
166
185
 
167
186
  :host-state([variant="solid"]):disabled {
168
- border-color: var(--ui-button-disabled-border, var(--ui-action-primary-surface, var(--ui-accent-solid)));
169
- background-color: var(--ui-button-disabled-surface, var(--ui-action-primary-surface, var(--ui-accent-solid)));
170
- color: var(--ui-button-disabled-text, var(--ui-action-primary-text, var(--ui-text-on-accent)));
187
+ border-color: var(--ui-button-disabled-border, var(--ui-border));
188
+ background-color: var(--ui-button-disabled-surface, var(--ui-disabled-surface));
189
+ color: var(--ui-button-disabled-text, var(--ui-disabled-text));
171
190
  }
172
191
 
173
192
  :host-state([variant="danger"]):disabled {
174
- border-color: var(--ui-button-disabled-border, var(--ui-danger-solid));
175
- background-color: var(--ui-button-disabled-surface, var(--ui-danger-solid));
176
- color: var(--ui-button-disabled-text, var(--ui-text-on-accent));
193
+ border-color: var(--ui-button-disabled-border, var(--ui-border));
194
+ background-color: var(--ui-button-disabled-surface, var(--ui-disabled-surface));
195
+ color: var(--ui-button-disabled-text, var(--ui-disabled-text));
177
196
  }
178
197
 
179
198
  :host-state([variant="ghost"]):disabled {
199
+ background: none;
180
200
  border-color: transparent;
181
- background-color: transparent;
182
- color: var(--ui-button-disabled-text, var(--ui-button-ghost-text, var(--ui-action-secondary-text, var(--ui-text-primary))));
201
+ color: var(--ui-button-disabled-text, var(--ui-disabled-text));
183
202
  }
184
203
 
185
204
  @media (pointer: coarse) {
186
205
  :host {
187
- min-block-size: var(--ui-control-min-block-size, 2.75rem);
206
+ min-block-size: var(--ui-control-min-block-size);
188
207
  }
189
208
  }
190
209
 
@@ -195,11 +214,11 @@
195
214
  min-block-size: 0;
196
215
  padding: 0;
197
216
  border: 0;
198
- border-radius: var(--ui-radius-sm, 4px);
217
+ border-radius: var(--ui-radius-sm);
199
218
  background: none;
200
219
  box-shadow: none;
201
220
  font: inherit;
202
- color: var(--ui-button-link-color, var(--ui-text-secondary));
221
+ color: var(--ui-button-link-text, var(--ui-text-secondary));
203
222
  text-decoration-line: underline;
204
223
  text-decoration-thickness: 1px;
205
224
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
@@ -208,7 +227,7 @@
208
227
  }
209
228
 
210
229
  :host-state([variant="link"]):hover:enabled {
211
- color: var(--ui-button-link-hover-color, var(--ui-text-primary));
230
+ color: var(--ui-button-link-hover-text, var(--ui-text-primary));
212
231
  text-decoration-color: currentColor;
213
232
  background: none;
214
233
  transform: none;
@@ -221,13 +240,14 @@
221
240
 
222
241
  :host-state([variant="link"]):disabled {
223
242
  background: none;
224
- color: var(--ui-button-disabled-text, var(--ui-button-link-color, var(--ui-text-secondary)));
243
+ border-color: transparent;
244
+ color: var(--ui-button-disabled-text, var(--ui-disabled-text));
225
245
  }
226
246
 
227
247
  :host-state([variant="link"]):focus-visible {
228
248
  box-shadow: none;
229
249
  /* Fallback keeps the ring if the token is missing: an unresolved var() would void the outline. */
230
- outline: 2px solid var(--ui-focus-ring, currentColor);
250
+ outline: 2px solid var(--ui-focus-ring);
231
251
  outline-offset: 2px;
232
252
  }
233
253
 
@@ -45,7 +45,7 @@
45
45
  padding: var(--ui-callout-padding-block, var(--ui-space-2)) var(--ui-callout-padding-inline, var(--ui-space-3));
46
46
  border: var(--ui-callout-border-width, 1px) solid color-mix(in srgb, var(--ui-callout-border, var(--_callout-border)) 35%, transparent);
47
47
  border-inline-start: var(--ui-callout-leading-border-width, 4px) solid var(--ui-callout-border, var(--_callout-border));
48
- border-radius: var(--ui-radius-2);
48
+ border-radius: var(--ui-radius-md);
49
49
  background: var(--ui-callout-surface, var(--_callout-surface));
50
50
  color: var(--ui-callout-text, var(--ui-text-primary));
51
51
  font-family: var(--ui-font-family-sans);
@@ -36,7 +36,7 @@
36
36
  block-size: var(--ui-checkbox-size, 1.125rem);
37
37
  margin: 0.125em 0 0;
38
38
  border: 1px solid var(--ui-control-border-hover, var(--ui-border-strong));
39
- border-radius: var(--ui-radius-1);
39
+ border-radius: var(--ui-radius-sm);
40
40
  background: var(--ui-control-surface, var(--ui-surface-default));
41
41
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ui-text-primary) 8%, transparent);
42
42
  cursor: pointer;
@@ -6,7 +6,7 @@
6
6
  <div><slot></slot></div>
7
7
  <style>
8
8
  :host {
9
- --_layout-gap: var(--ui-space-3, 0.75rem);
9
+ --_layout-gap: var(--ui-space-3);
10
10
  display: flex;
11
11
  flex-wrap: wrap;
12
12
  align-items: center;
@@ -17,19 +17,19 @@
17
17
  }
18
18
 
19
19
  :host-state([gap="xs"]) {
20
- --_layout-gap: var(--ui-space-2, 0.5rem);
20
+ --_layout-gap: var(--ui-space-2);
21
21
  }
22
22
  :host-state([gap="s"]) {
23
- --_layout-gap: var(--ui-space-3, 0.75rem);
23
+ --_layout-gap: var(--ui-space-3);
24
24
  }
25
25
  :host-state([gap="m"]) {
26
- --_layout-gap: var(--ui-space-4, 1rem);
26
+ --_layout-gap: var(--ui-space-4);
27
27
  }
28
28
  :host-state([gap="l"]) {
29
- --_layout-gap: var(--ui-space-5, 1.5rem);
29
+ --_layout-gap: var(--ui-space-5);
30
30
  }
31
31
  :host-state([gap="xl"]) {
32
- --_layout-gap: var(--ui-space-6, 2rem);
32
+ --_layout-gap: var(--ui-space-6);
33
33
  }
34
34
  :host-state([align="start"]) {
35
35
  align-items: flex-start;
@@ -189,15 +189,15 @@
189
189
  font: inherit;
190
190
  }
191
191
  label {
192
- color: var(--ui-field-label-color, var(--ui-text-primary));
193
- font-size: var(--ui-field-label-size, 0.875rem);
194
- font-weight: var(--ui-field-label-weight, 500);
192
+ color: var(--ui-combobox-label-text, var(--ui-text-primary));
193
+ font-size: var(--ui-combobox-label-font-size, 0.875rem);
194
+ font-weight: 500;
195
195
  }
196
196
  .field {
197
197
  display: flex;
198
198
  min-inline-size: 0;
199
199
  border: 1px solid var(--ui-control-border, var(--ui-border-default));
200
- border-radius: var(--ui-radius-2);
200
+ border-radius: var(--ui-radius-md);
201
201
  background: var(--ui-control-surface, var(--ui-surface-default));
202
202
  box-shadow: var(--ui-control-inset);
203
203
  transition: border-color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease);
@@ -216,7 +216,7 @@
216
216
  appearance: none;
217
217
  width: 100%;
218
218
  min-inline-size: 0;
219
- min-block-size: calc(var(--ui-control-size-md, 2.5rem) - 2px);
219
+ min-block-size: calc(var(--ui-control-size-md) - 2px);
220
220
  box-sizing: border-box;
221
221
  border: 0;
222
222
  border-radius: inherit;
@@ -229,7 +229,7 @@
229
229
  outline: none;
230
230
  }
231
231
  :host-state([size="sm"]) input {
232
- min-block-size: calc(var(--ui-field-compact-size, var(--ui-control-size-sm, 2rem)) - 2px);
232
+ min-block-size: calc(var(--ui-control-size-sm) - 2px);
233
233
  padding: var(--ui-space-1) var(--ui-space-2);
234
234
  }
235
235
  button {
@@ -238,19 +238,19 @@
238
238
  place-items: center;
239
239
  align-self: stretch;
240
240
  border: 0;
241
- border-radius: var(--ui-radius-2);
241
+ border-radius: var(--ui-radius-md);
242
242
  background: transparent;
243
- color: var(--ui-field-affordance-color, var(--ui-text-secondary));
243
+ color: var(--ui-combobox-affordance-text, var(--ui-text-secondary));
244
244
  font: inherit;
245
- font-weight: var(--ui-field-affordance-weight, 400);
245
+ font-weight: 400;
246
246
  min-inline-size: 2rem;
247
247
  padding: 0 var(--ui-space-1);
248
248
  cursor: pointer;
249
249
  }
250
250
  .affordance-icon {
251
251
  display: block;
252
- inline-size: var(--ui-icon-size-sm, 1rem);
253
- block-size: var(--ui-icon-size-sm, 1rem);
252
+ inline-size: var(--ui-icon-size-sm);
253
+ block-size: var(--ui-icon-size-sm);
254
254
  }
255
255
  button:hover:enabled {
256
256
  background: var(--ui-surface-muted);
@@ -280,7 +280,7 @@
280
280
  margin: 0;
281
281
  padding: var(--ui-space-1);
282
282
  border: 1px solid var(--ui-border-default);
283
- border-radius: var(--ui-radius-2);
283
+ border-radius: var(--ui-radius-md);
284
284
  background: var(--ui-surface-elevated);
285
285
  color: var(--ui-text-primary);
286
286
  box-shadow: var(--ui-elevation-overlay, var(--ui-shadow-lg));
@@ -290,13 +290,13 @@
290
290
  }
291
291
  .option {
292
292
  padding: var(--ui-space-2) var(--ui-space-3);
293
- border-radius: var(--ui-radius-1);
293
+ border-radius: var(--ui-radius-sm);
294
294
  cursor: pointer;
295
295
  overflow-wrap: anywhere;
296
296
  }
297
297
  .option:hover, .option.active {
298
298
  background: var(--ui-surface-muted);
299
- outline: 1px solid var(--ui-focus-ring, currentColor);
299
+ outline: 1px solid var(--ui-focus-ring);
300
300
  outline-offset: -1px;
301
301
  }
302
302
  .option[aria-disabled="true"] {
@@ -305,12 +305,12 @@
305
305
  }
306
306
  .primary {
307
307
  display: block;
308
- color: var(--ui-option-primary-color, var(--ui-text-primary));
309
- font-weight: var(--ui-option-primary-weight, 500);
308
+ color: var(--ui-combobox-option-text, var(--ui-text-primary));
309
+ font-weight: 500;
310
310
  }
311
311
  .message, .group {
312
- color: var(--ui-field-message-color, var(--ui-text-secondary));
313
- font-weight: var(--ui-field-message-weight, 400);
312
+ color: var(--ui-combobox-message-text, var(--ui-text-secondary));
313
+ font-weight: 400;
314
314
  font-size: var(--ui-font-size-sm);
315
315
  line-height: var(--ui-line-height-md);
316
316
  overflow-wrap: anywhere;
@@ -346,11 +346,11 @@
346
346
  flex-wrap: wrap;
347
347
  align-items: center;
348
348
  gap: var(--ui-space-1);
349
- min-block-size: var(--ui-multi-combobox-min-block-size, 2.5rem);
349
+ min-block-size: var(--ui-combobox-item-min-block-size, 2.5rem);
350
350
  padding: var(--ui-space-1);
351
351
  }
352
352
  :host-state([multiple]) input {
353
- flex: 1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);
353
+ flex: 1 0 var(--ui-combobox-item-input-min-inline-size, 5rem);
354
354
  width: auto;
355
355
  min-block-size: 1.75rem;
356
356
  padding: var(--ui-space-0-5) var(--ui-space-1);
@@ -359,18 +359,18 @@
359
359
  appearance: none;
360
360
  display: inline-flex;
361
361
  min-inline-size: 0;
362
- max-inline-size: min(100%, var(--ui-multi-combobox-item-max-inline-size, 12rem));
362
+ max-inline-size: min(100%, var(--ui-combobox-item-item-max-inline-size, 12rem));
363
363
  overflow: hidden;
364
364
  padding: 0;
365
365
  border: 0;
366
- border-radius: var(--ui-radius-1);
366
+ border-radius: var(--ui-radius-sm);
367
367
  background: transparent;
368
368
  color: inherit;
369
369
  font: inherit;
370
370
  cursor: default;
371
371
  }
372
372
  .item:focus-visible {
373
- outline: 2px solid var(--ui-focus-ring, currentColor);
373
+ outline: 2px solid var(--ui-focus-ring);
374
374
  outline-offset: 1px;
375
375
  }
376
376
  .item:disabled {
@@ -7,7 +7,7 @@
7
7
  <style>
8
8
  :host {
9
9
  --_container-measure: 65ch;
10
- --_container-gutters: var(--ui-space-4, 1rem);
10
+ --_container-gutters: var(--ui-space-4);
11
11
  display: block;
12
12
  inline-size: 100%;
13
13
  max-inline-size: var(--ui-container-measure, var(--_container-measure));
@@ -22,13 +22,13 @@
22
22
  --_container-measure: 80ch;
23
23
  }
24
24
  :host-state([gutters="s"]) {
25
- --_container-gutters: var(--ui-space-3, 0.75rem);
25
+ --_container-gutters: var(--ui-space-3);
26
26
  }
27
27
  :host-state([gutters="m"]) {
28
- --_container-gutters: var(--ui-space-4, 1rem);
28
+ --_container-gutters: var(--ui-space-4);
29
29
  }
30
30
  :host-state([gutters="l"]) {
31
- --_container-gutters: var(--ui-space-5, 1.5rem);
31
+ --_container-gutters: var(--ui-space-5);
32
32
  }
33
33
 
34
34
  /* A component that sets its display still honours the hidden attribute on its root. */
@@ -29,11 +29,11 @@
29
29
  padding: var(--ui-space-1);
30
30
  background: var(--ui-surface-elevated);
31
31
  border: 1px solid var(--ui-border-default);
32
- border-radius: var(--ui-radius-3);
32
+ border-radius: var(--ui-radius-lg);
33
33
  box-shadow: var(--ui-elevation-overlay, var(--ui-shadow-lg));
34
34
  outline: 0;
35
35
  overflow: auto;
36
- z-index: var(--ui-z-overlay, 1000);
36
+ z-index: var(--ui-context-menu-z-index, 1000);
37
37
  min-width: 12rem;
38
38
  opacity: 0;
39
39
  transform: translateY(-4px) scale(0.99);
@@ -27,11 +27,11 @@
27
27
  inset: 0;
28
28
  box-sizing: border-box;
29
29
  inline-size: min(
30
- calc(100% - var(--ui-dialog-viewport-gap, var(--ui-space-4, 1rem)) * 2),
30
+ calc(100% - var(--ui-dialog-viewport-gap, var(--ui-space-4)) * 2),
31
31
  var(--ui-dialog-max-width, 440px)
32
32
  );
33
33
  max-inline-size: none;
34
- max-block-size: calc(100dvh - var(--ui-dialog-viewport-gap, var(--ui-space-4, 1rem)) * 2);
34
+ max-block-size: calc(100dvh - var(--ui-dialog-viewport-gap, var(--ui-space-4)) * 2);
35
35
  margin: auto;
36
36
  padding: 0;
37
37
  overflow: hidden;
@@ -80,8 +80,8 @@
80
80
  border: 0;
81
81
  color: var(--ui-text-primary);
82
82
  letter-spacing: normal;
83
- font-size: var(--ui-font-size-lg, 1.125rem);
84
- font-weight: var(--ui-font-semibold, 600);
83
+ font-size: var(--ui-font-size-lg);
84
+ font-weight: var(--ui-font-semibold);
85
85
  line-height: var(--ui-line-height-tight);
86
86
  }
87
87
 
@@ -90,11 +90,11 @@
90
90
  place-items: center;
91
91
  flex: none;
92
92
  margin-inline-start: auto;
93
- inline-size: var(--ui-control-size-sm, 2rem);
94
- block-size: var(--ui-control-size-sm, 2rem);
93
+ inline-size: var(--ui-control-size-sm);
94
+ block-size: var(--ui-control-size-sm);
95
95
  padding: 0;
96
96
  border: 0;
97
- border-radius: var(--ui-radius-round, 999px);
97
+ border-radius: var(--ui-radius-round);
98
98
  background: transparent;
99
99
  color: var(--ui-text-secondary);
100
100
  cursor: pointer;
@@ -123,21 +123,21 @@
123
123
  }
124
124
 
125
125
  .close:focus-visible {
126
- outline: 2px solid var(--ui-focus-ring, currentColor);
126
+ outline: 2px solid var(--ui-focus-ring);
127
127
  outline-offset: 2px;
128
128
  }
129
129
 
130
130
  /* A touch target, like Button on coarse pointers. */
131
131
  @media (pointer: coarse) {
132
132
  .close {
133
- inline-size: var(--ui-control-min-block-size, 2.75rem);
134
- block-size: var(--ui-control-min-block-size, 2.75rem);
133
+ inline-size: var(--ui-control-min-block-size);
134
+ block-size: var(--ui-control-min-block-size);
135
135
  }
136
136
  }
137
137
 
138
138
  html[data-ui-input-modality="touch"] :host .close {
139
- inline-size: var(--ui-control-min-block-size, 2.75rem);
140
- block-size: var(--ui-control-min-block-size, 2.75rem);
139
+ inline-size: var(--ui-control-min-block-size);
140
+ block-size: var(--ui-control-min-block-size);
141
141
  }
142
142
 
143
143
  .body {
@@ -1,5 +1,6 @@
1
1
  <template component="ui-disclosure" controller="./ui-disclosure.js">
2
2
  <defs>
3
+ <prop name="density" type="comfortable | compact" default="comfortable">Compact trades padding and type size for rows that fit more on screen.</prop>
3
4
  <prop name="summary" type="string" default="Details">summary token.</prop>
4
5
  <prop name="open" type="boolean" default="false">open token.</prop>
5
6
  <prop name="disabled" type="boolean" default="false">disabled token.</prop>
@@ -22,6 +23,19 @@
22
23
  <div class="panel" :id="contentId" :inert="not internalOpen"><div class="panel-inner"><slot></slot></div></div>
23
24
  </div>
24
25
  <style>
26
+ /* Density resolves into the summary row's own values; the public tokens still override them. */
27
+ :host {
28
+ --_trigger-min-block-size: var(--ui-control-size);
29
+ --_trigger-padding-block: var(--ui-space-2);
30
+ --_trigger-padding-inline: var(--ui-space-3);
31
+ }
32
+
33
+ :host-state([density="compact"]) {
34
+ --_trigger-min-block-size: var(--ui-control-size-sm);
35
+ --_trigger-padding-block: var(--ui-space-1);
36
+ --_trigger-padding-inline: var(--ui-space-2);
37
+ }
38
+
25
39
  /* An accordion row, not a field: no enclosing box, just a divider, so it never reads as a
26
40
  * select or combobox. Stacked disclosures share their dividers. */
27
41
  :host {
@@ -38,16 +52,17 @@
38
52
  gap: var(--ui-space-3);
39
53
  align-items: center;
40
54
  inline-size: 100%;
41
- min-block-size: 2.5rem;
42
- padding: var(--ui-space-2) var(--ui-space-3);
55
+ min-block-size: var(--ui-disclosure-trigger-min-block-size, var(--_trigger-min-block-size));
56
+ padding: var(--ui-disclosure-trigger-padding-block, var(--_trigger-padding-block))
57
+ var(--ui-disclosure-trigger-padding-inline, var(--_trigger-padding-inline));
43
58
  border: 0;
44
59
  background: transparent;
45
60
  color: inherit;
46
61
  font: inherit;
47
- font-weight: var(--ui-font-semibold, 600);
62
+ font-weight: var(--ui-font-semibold);
48
63
  text-align: start;
49
64
  cursor: pointer;
50
- border-radius: var(--ui-radius-1);
65
+ border-radius: var(--ui-radius-sm);
51
66
  transition: background-color var(--ui-motion-fast) var(--ui-motion-ease);
52
67
  }
53
68
 
@@ -52,11 +52,11 @@
52
52
  .input {
53
53
  grid-area: 1 / 1;
54
54
  box-sizing: border-box;
55
- min-block-size: var(--ui-control-size-sm, 2rem);
55
+ min-block-size: var(--ui-control-size-sm);
56
56
  margin: 0;
57
57
  padding: var(--ui-space-1) var(--ui-space-2);
58
58
  border: 1px solid transparent;
59
- border-radius: var(--ui-radius-2);
59
+ border-radius: var(--ui-radius-md);
60
60
  font: inherit;
61
61
  line-height: var(--ui-line-height-md);
62
62
  color: inherit;
@@ -126,13 +126,13 @@
126
126
  }
127
127
 
128
128
  .actions button {
129
- min-block-size: var(--ui-control-size-sm, 2rem);
129
+ min-block-size: var(--ui-control-size-sm);
130
130
  padding: 0 var(--ui-space-3);
131
131
  border: 1px solid var(--ui-border-strong);
132
- border-radius: var(--ui-radius-2);
132
+ border-radius: var(--ui-radius-md);
133
133
  background: var(--ui-surface-elevated);
134
- background-image: var(--ui-raised-highlight, none);
135
- box-shadow: var(--ui-raised, none);
134
+ background-image: var(--ui-raised-highlight);
135
+ box-shadow: var(--ui-raised);
136
136
  color: inherit;
137
137
  font: inherit;
138
138
  font-size: var(--ui-font-size-sm);
@@ -32,17 +32,17 @@
32
32
  </div>
33
33
  <style>
34
34
  :host {
35
- padding: var(--ui-space-3, 12px);
36
- background: var(--ui-surface, #fff);
37
- border: 1px solid var(--ui-border, #e5e7eb);
38
- border-radius: var(--ui-radius-md, 6px);
35
+ padding: var(--ui-space-3);
36
+ background: var(--ui-surface);
37
+ border: 1px solid var(--ui-border);
38
+ border-radius: var(--ui-radius-md);
39
39
  box-shadow: var(--ui-shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
40
40
  }
41
41
 
42
42
  .hint {
43
- margin: 0 0 var(--ui-space-2, 8px);
44
- font-size: var(--ui-text-sm, 0.875rem);
45
- color: var(--ui-text-muted, #6b7280);
43
+ margin: 0 0 var(--ui-space-2);
44
+ font-size: var(--ui-font-size-sm);
45
+ color: var(--ui-text-muted);
46
46
  }
47
47
 
48
48
  .grid {
@@ -50,39 +50,39 @@
50
50
  grid-template-columns: repeat(var(--ui-editor-table-grid-cols, 8), 1.25rem);
51
51
  grid-template-rows: repeat(var(--ui-editor-table-grid-rows, 8), 1.25rem);
52
52
  gap: 2px;
53
- margin-bottom: var(--ui-space-2, 8px);
53
+ margin-bottom: var(--ui-space-2);
54
54
  }
55
55
 
56
56
  .cell {
57
57
  width: 1.25rem;
58
58
  height: 1.25rem;
59
59
  padding: 0;
60
- border: 1px solid var(--ui-border, #e5e7eb);
60
+ border: 1px solid var(--ui-border);
61
61
  border-radius: 2px;
62
- background: var(--ui-surface, #fff);
62
+ background: var(--ui-surface);
63
63
  cursor: pointer;
64
64
  }
65
65
 
66
66
  .cell.selected {
67
- background: var(--ui-accent-solid, var(--ui-accent, #0066cc));
68
- border-color: var(--ui-accent-solid, var(--ui-accent, #0066cc));
67
+ background: var(--ui-accent-solid, var(--ui-accent));
68
+ border-color: var(--ui-accent-solid, var(--ui-accent));
69
69
  }
70
70
 
71
71
  .header {
72
72
  display: block;
73
- margin-bottom: var(--ui-space-2, 8px);
74
- font-size: var(--ui-text-sm, 0.875rem);
73
+ margin-bottom: var(--ui-space-2);
74
+ font-size: var(--ui-font-size-sm);
75
75
  cursor: pointer;
76
76
  }
77
77
 
78
78
  :host .insert {
79
79
  width: 100%;
80
- padding: var(--ui-space-2, 8px) var(--ui-space-3, 12px);
81
- border: 1px solid var(--ui-border, #e5e7eb);
82
- border-radius: var(--ui-radius-sm, 4px);
83
- background: var(--ui-accent-solid, var(--ui-accent, #0066cc));
84
- color: var(--ui-accent-contrast, #fff);
85
- font-size: var(--ui-text-sm, 0.875rem);
80
+ padding: var(--ui-space-2) var(--ui-space-3);
81
+ border: 1px solid var(--ui-border);
82
+ border-radius: var(--ui-radius-sm);
83
+ background: var(--ui-accent-solid, var(--ui-accent));
84
+ color: var(--ui-accent-contrast);
85
+ font-size: var(--ui-font-size-sm);
86
86
  cursor: pointer;
87
87
  }
88
88