@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
@@ -23,19 +23,42 @@
23
23
  </defs>
24
24
  <div role="tree"><slot></slot></div>
25
25
  <style>
26
+ /* This component's hooks style the element they are set on, and never a nested one. */
27
+ @property --ui-tree-drop-color {
28
+ syntax: "*";
29
+ inherits: false;
30
+ }
31
+ @property --ui-tree-gutter {
32
+ syntax: "*";
33
+ inherits: false;
34
+ }
35
+ @property --ui-tree-indent {
36
+ syntax: "*";
37
+ inherits: false;
38
+ }
39
+
26
40
  /* Reaches the items the way density does, so the setting lives on the tree the way a reader
27
41
  thinks about it: this list scrolls its long names. */
28
42
  :host-state([marquee]) {
29
- --ui-tree-item-marquee: 1;
43
+ --_ui-default-tree-item-marquee: 1;
30
44
  }
31
45
 
46
+ /* The items' defaults for this density: an item's own hook still wins. */
32
47
  :host-state([density="compact"]) {
33
- --ui-tree-item-min-block-size: var(--ui-control-size-sm);
34
- --ui-tree-item-font-size: var(--ui-font-size-sm);
35
- --ui-tree-item-label-padding-block: 0;
48
+ --_ui-default-tree-item-min-block-size: var(--ui-control-size-sm);
49
+ --_ui-default-tree-item-font-size: var(--ui-font-size-sm);
50
+ --_ui-default-tree-item-label-padding-block: 0;
36
51
  }
37
52
 
38
53
  :host {
54
+ /* Hooks do not inherit: the tree hands its own to its items here, and a tree nested in an item
55
+ starts again from its own settings. */
56
+ --_ui-tree-indent: var(--ui-tree-indent);
57
+ --_ui-tree-drop-color: var(--ui-tree-drop-color);
58
+ --_ui-default-tree-item-marquee: initial;
59
+ --_ui-default-tree-item-min-block-size: initial;
60
+ --_ui-default-tree-item-font-size: initial;
61
+ --_ui-default-tree-item-label-padding-block: initial;
39
62
  display: block;
40
63
  min-inline-size: 0;
41
64
  padding-inline-start: var(--ui-tree-gutter, 0px);
@@ -94,14 +94,43 @@
94
94
  <span class="drop-indicator subtree-drop-indicator" aria-hidden="true"></span>
95
95
  </div>
96
96
  <style>
97
+ /* This component's hooks style the element they are set on, and never a nested one. */
98
+ @property --ui-tree-item-depth {
99
+ syntax: "*";
100
+ inherits: false;
101
+ }
102
+ @property --ui-tree-item-font-size {
103
+ syntax: "*";
104
+ inherits: false;
105
+ }
106
+ @property --ui-tree-item-label-padding-block {
107
+ syntax: "*";
108
+ inherits: false;
109
+ }
110
+ @property --ui-tree-item-label-padding-inline {
111
+ syntax: "*";
112
+ inherits: false;
113
+ }
114
+ @property --ui-tree-item-min-block-size {
115
+ syntax: "*";
116
+ inherits: false;
117
+ }
118
+
97
119
  :host {
120
+ /* Hooks do not inherit, so the parts below read them from the root. The tree's density
121
+ sets the defaults, in --_ui-default-*. */
122
+ --_ui-tree-item-min-block-size: var(--ui-tree-item-min-block-size, var(--_ui-default-tree-item-min-block-size));
123
+ --_ui-tree-item-font-size: var(--ui-tree-item-font-size, var(--_ui-default-tree-item-font-size));
124
+ --_ui-tree-item-label-padding-block: var(--ui-tree-item-label-padding-block, var(--_ui-default-tree-item-label-padding-block));
125
+ --_ui-tree-item-label-padding-inline: var(--ui-tree-item-label-padding-inline);
126
+
98
127
  --_tree-row-min-height: 32px;
99
128
  --_tree-disclosure-size: 16px;
100
129
 
101
130
  position: relative;
102
131
  display: block;
103
132
  min-inline-size: 0;
104
- margin-inline-start: calc(var(--ui-tree-item-depth, 0) * var(--ui-tree-indent, 16px));
133
+ margin-inline-start: calc(var(--ui-tree-item-depth, 0) * var(--_ui-tree-indent, 16px));
105
134
  }
106
135
 
107
136
  .row {
@@ -109,9 +138,9 @@
109
138
  display: grid;
110
139
  grid-template-columns: var(--_tree-disclosure-size) auto minmax(0, 1fr);
111
140
  align-items: center;
112
- min-block-size: var(--ui-tree-item-min-block-size, var(--_tree-row-min-height));
141
+ min-block-size: var(--_ui-tree-item-min-block-size, var(--_tree-row-min-height));
113
142
  min-inline-size: 0;
114
- font-size: var(--ui-tree-item-font-size, var(--ui-font-size-sm));
143
+ font-size: var(--_ui-tree-item-font-size, var(--ui-font-size-sm));
115
144
  border-radius: var(--ui-radius-md);
116
145
  color: var(--ui-text-secondary);
117
146
  transition:
@@ -148,7 +177,7 @@
148
177
  /* Child combinators: drop feedback belongs to this item's own row, not the rows nested in it. */
149
178
  :host[data-drop-position="inside"] > .row {
150
179
  background: var(--ui-accent-subtle);
151
- box-shadow: inset 0 0 0 1px var(--ui-tree-drop-color, var(--ui-accent-solid));
180
+ box-shadow: inset 0 0 0 1px var(--_ui-tree-drop-color, var(--ui-accent-solid));
152
181
  }
153
182
 
154
183
  .disclosure,
@@ -250,7 +279,7 @@
250
279
  min-inline-size: 0;
251
280
  /* The cell clips: a name longer than the row slides inside it rather than over its icons. */
252
281
  overflow: hidden;
253
- padding: var(--ui-tree-item-label-padding-block, var(--ui-space-1)) var(--ui-tree-item-label-padding-inline, var(--ui-space-2));
282
+ padding: var(--_ui-tree-item-label-padding-block, var(--ui-space-1)) var(--_ui-tree-item-label-padding-inline, var(--ui-space-2));
254
283
  /* The length of the fade before the controls. The label's one flex child lays out no gap; this
255
284
  is where the controller reads the length in pixels to stop a sliding name before the fade. */
256
285
  column-gap: var(--ui-space-3);
@@ -312,11 +341,11 @@
312
341
  under the icon rather than stopping at a hard edge beside it. */
313
342
  .row[data-ui-marquee] > .label {
314
343
  margin-inline-start: calc(-1 * var(--_marquee-lead, 0px));
315
- padding-inline-start: calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2)));
344
+ padding-inline-start: calc(var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2)));
316
345
  mask-image: linear-gradient(
317
346
  to right,
318
347
  transparent calc(var(--_marquee-lead, 0px) / 2),
319
- #000 calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))),
348
+ #000 calc(var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2))),
320
349
  #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
321
350
  transparent calc(100% - var(--_tree-actions-width, 1.75rem))
322
351
  );
@@ -326,7 +355,7 @@
326
355
  mask-image: linear-gradient(
327
356
  to left,
328
357
  transparent calc(var(--_marquee-lead, 0px) / 2),
329
- #000 calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))),
358
+ #000 calc(var(--_marquee-lead, 0px) + var(--_ui-tree-item-label-padding-inline, var(--ui-space-2))),
330
359
  #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
331
360
  transparent calc(100% - var(--_tree-actions-width, 1.75rem))
332
361
  );
@@ -444,7 +473,7 @@
444
473
  display: none;
445
474
  block-size: 2px;
446
475
  border-radius: 999px;
447
- background: var(--ui-tree-drop-color, var(--ui-accent-solid));
476
+ background: var(--_ui-tree-drop-color, var(--ui-accent-solid));
448
477
  pointer-events: none;
449
478
  }
450
479
 
@@ -455,7 +484,7 @@
455
484
  inset-block-start: 50%;
456
485
  inline-size: 7px;
457
486
  block-size: 7px;
458
- border: 2px solid var(--ui-tree-drop-color, var(--ui-accent-solid));
487
+ border: 2px solid var(--_ui-tree-drop-color, var(--ui-accent-solid));
459
488
  border-radius: 999px;
460
489
  background: var(--ui-surface-elevated);
461
490
  transform: translateY(-50%);
@@ -105,7 +105,7 @@ export default function controller(host) {
105
105
  const MARQUEE_SPEED = 36; // CSS pixels per second, for every name: a clamped duration made short slides crawl.
106
106
  // The tree sets this for its items; an item's own prop overrides it either way.
107
107
  const marqueeWanted = () => host.state.marquee
108
- || getComputedStyle(element).getPropertyValue("--ui-tree-item-marquee").trim() === "1";
108
+ || getComputedStyle(element).getPropertyValue("--_ui-default-tree-item-marquee").trim() === "1";
109
109
  const startMarquee = () => {
110
110
  if (!labelText || !label || !marqueeWanted()) return;
111
111
  labelText.style.flex = "none";