@threadlabs/looma 0.1.22 → 0.1.23

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 (248) hide show
  1. package/dist/{chunk-NIPNHZ5W.js → chunk-GDMQKT5F.js} +63 -31
  2. package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
  3. package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/looma.cjs.js +2 -2
  6. package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
  7. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  8. package/dist/cjs/ui-avatar-group.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/ui-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/ui-button.cjs.entry.js +16 -5
  12. package/dist/cjs/ui-checkbox.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
  14. package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
  15. package/dist/cjs/ui-dialog.cjs.entry.js +3 -3
  16. package/dist/cjs/ui-disclosure.cjs.entry.js +2 -2
  17. package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
  18. package/dist/cjs/ui-form-field.cjs.entry.js +3 -3
  19. package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
  20. package/dist/cjs/ui-input.cjs.entry.js +11 -6
  21. package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
  22. package/dist/cjs/ui-menu.cjs.entry.js +3 -3
  23. package/dist/cjs/ui-popover.cjs.entry.js +3 -3
  24. package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-radio.cjs.entry.js +3 -3
  26. package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
  27. package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
  28. package/dist/cjs/ui-select.cjs.entry.js +15 -7
  29. package/dist/cjs/ui-switch.cjs.entry.js +3 -3
  30. package/dist/cjs/ui-tabs.cjs.entry.js +2 -2
  31. package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
  32. package/dist/cjs/ui-toast-region.cjs.entry.js +2 -2
  33. package/dist/cjs/ui-tooltip.cjs.entry.js +52 -16
  34. package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
  35. package/dist/cjs/ui-tree-item.cjs.entry.js +7 -3
  36. package/dist/cjs/ui-tree.cjs.entry.js +81 -9
  37. package/dist/collection/collection-manifest.json +1 -0
  38. package/dist/collection/components/ui-button/ui-button.css +36 -26
  39. package/dist/collection/components/ui-button/ui-button.js +14 -3
  40. package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
  41. package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
  42. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  43. package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
  44. package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
  45. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  46. package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
  47. package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
  48. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  49. package/dist/collection/components/ui-input/ui-input.css +8 -6
  50. package/dist/collection/components/ui-input/ui-input.js +11 -7
  51. package/dist/collection/components/ui-menu/ui-menu.js +1 -1
  52. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  53. package/dist/collection/components/ui-popover/ui-popover.js +1 -1
  54. package/dist/collection/components/ui-radio/ui-radio.js +2 -2
  55. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  56. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  57. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  58. package/dist/collection/components/ui-select/ui-select.css +8 -6
  59. package/dist/collection/components/ui-select/ui-select.js +17 -11
  60. package/dist/collection/components/ui-switch/ui-switch.js +2 -2
  61. package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
  62. package/dist/collection/components/ui-textarea/ui-textarea.css +7 -6
  63. package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
  64. package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
  65. package/dist/collection/components/ui-tooltip/ui-tooltip.js +102 -15
  66. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  67. package/dist/collection/components/ui-tree/ui-tree.js +100 -8
  68. package/dist/collection/components/ui-tree-item/ui-tree-item.js +44 -2
  69. package/dist/collection/field/combobox.js +4 -0
  70. package/dist/collection/field/valibot.js +5 -0
  71. package/dist/collection/field/validation.js +62 -0
  72. package/dist/collection/overlay/manager.js +6 -7
  73. package/dist/components/index.d.ts +2 -0
  74. package/dist/components/index.js +1 -1
  75. package/dist/components/p-Bh_1GxOD.js +1 -0
  76. package/dist/components/p-C-0syqXZ.js +1 -0
  77. package/dist/components/p-CaietZcq.js +1 -0
  78. package/dist/components/p-DHd18bK7.js +1 -0
  79. package/dist/components/ui-affordance-scope.js +1 -1
  80. package/dist/components/ui-avatar-group.js +1 -1
  81. package/dist/components/ui-avatar.js +1 -1
  82. package/dist/components/ui-badge.js +1 -1
  83. package/dist/components/ui-button.js +1 -1
  84. package/dist/components/ui-checkbox.js +1 -1
  85. package/dist/components/ui-combobox.d.ts +11 -0
  86. package/dist/components/ui-combobox.js +1 -0
  87. package/dist/components/ui-context-menu.js +1 -1
  88. package/dist/components/ui-dialog.js +1 -1
  89. package/dist/components/ui-disclosure.js +1 -1
  90. package/dist/components/ui-floating-action-button.js +1 -1
  91. package/dist/components/ui-form-field.js +1 -1
  92. package/dist/components/ui-icon-button.js +1 -1
  93. package/dist/components/ui-input.js +1 -1
  94. package/dist/components/ui-menu-item.js +1 -1
  95. package/dist/components/ui-menu.js +1 -1
  96. package/dist/components/ui-popover.js +1 -1
  97. package/dist/components/ui-radio-group.js +1 -1
  98. package/dist/components/ui-radio.js +1 -1
  99. package/dist/components/ui-search-result-row.js +1 -1
  100. package/dist/components/ui-search-shell.js +1 -1
  101. package/dist/components/ui-select.js +1 -1
  102. package/dist/components/ui-switch.js +1 -1
  103. package/dist/components/ui-tabs.js +1 -1
  104. package/dist/components/ui-textarea.js +1 -1
  105. package/dist/components/ui-toast-region.js +1 -1
  106. package/dist/components/ui-tooltip.js +1 -1
  107. package/dist/components/ui-top-bar.js +1 -1
  108. package/dist/components/ui-tree-item.js +2 -2
  109. package/dist/components/ui-tree.js +1 -1
  110. package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
  111. package/dist/esm/loader.js +3 -3
  112. package/dist/esm/looma.js +3 -3
  113. package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
  114. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  115. package/dist/esm/ui-avatar-group.entry.js +1 -1
  116. package/dist/esm/ui-avatar.entry.js +1 -1
  117. package/dist/esm/ui-badge.entry.js +1 -1
  118. package/dist/esm/ui-button.entry.js +16 -5
  119. package/dist/esm/ui-checkbox.entry.js +1 -1
  120. package/dist/esm/ui-combobox.entry.js +539 -0
  121. package/dist/esm/ui-context-menu.entry.js +3 -3
  122. package/dist/esm/ui-dialog.entry.js +3 -3
  123. package/dist/esm/ui-disclosure.entry.js +2 -2
  124. package/dist/esm/ui-floating-action-button.entry.js +2 -2
  125. package/dist/esm/ui-form-field.entry.js +3 -3
  126. package/dist/esm/ui-icon-button.entry.js +2 -2
  127. package/dist/esm/ui-input.entry.js +11 -6
  128. package/dist/esm/ui-menu-item.entry.js +2 -2
  129. package/dist/esm/ui-menu.entry.js +3 -3
  130. package/dist/esm/ui-popover.entry.js +3 -3
  131. package/dist/esm/ui-radio-group.entry.js +2 -2
  132. package/dist/esm/ui-radio.entry.js +3 -3
  133. package/dist/esm/ui-search-result-row.entry.js +2 -2
  134. package/dist/esm/ui-search-shell.entry.js +2 -2
  135. package/dist/esm/ui-select.entry.js +15 -7
  136. package/dist/esm/ui-switch.entry.js +3 -3
  137. package/dist/esm/ui-tabs.entry.js +2 -2
  138. package/dist/esm/ui-textarea.entry.js +10 -6
  139. package/dist/esm/ui-toast-region.entry.js +2 -2
  140. package/dist/esm/ui-tooltip.entry.js +52 -16
  141. package/dist/esm/ui-top-bar.entry.js +2 -2
  142. package/dist/esm/ui-tree-item.entry.js +7 -3
  143. package/dist/esm/ui-tree.entry.js +81 -9
  144. package/dist/index.cjs +883 -123
  145. package/dist/index.d.cts +104 -1
  146. package/dist/index.d.ts +104 -1
  147. package/dist/index.js +62 -8
  148. package/dist/looma/looma.esm.js +1 -1
  149. package/dist/looma/{p-0198bb21.entry.js → p-13347631.entry.js} +1 -1
  150. package/dist/looma/p-14c081cf.entry.js +1 -0
  151. package/dist/looma/{p-0f45c5f0.entry.js → p-25366205.entry.js} +1 -1
  152. package/dist/looma/{p-a9f46811.entry.js → p-2e3aa869.entry.js} +1 -1
  153. package/dist/looma/p-40fe7fee.entry.js +1 -0
  154. package/dist/looma/p-446cda76.entry.js +1 -0
  155. package/dist/looma/p-4fc1b005.entry.js +13 -0
  156. package/dist/looma/p-582973b5.entry.js +1 -0
  157. package/dist/looma/{p-d273b857.entry.js → p-5a87b59d.entry.js} +1 -1
  158. package/dist/looma/{p-2ed7e241.entry.js → p-5da09f47.entry.js} +1 -1
  159. package/dist/looma/{p-7e94d90d.entry.js → p-69a5557b.entry.js} +1 -1
  160. package/dist/looma/p-6a8a4736.entry.js +1 -0
  161. package/dist/looma/{p-caa8fc7b.entry.js → p-6bf4038b.entry.js} +1 -1
  162. package/dist/looma/p-7e0bb7f6.entry.js +1 -0
  163. package/dist/looma/{p-ed5abf6d.entry.js → p-8204fee6.entry.js} +1 -1
  164. package/dist/looma/{p-5ba9d496.entry.js → p-8238e0dc.entry.js} +1 -1
  165. package/dist/looma/p-8BGiMGQ0.js +2 -0
  166. package/dist/looma/{p-051f578c.entry.js → p-8b8840b8.entry.js} +1 -1
  167. package/dist/looma/{p-1674cda4.entry.js → p-99d88efb.entry.js} +1 -1
  168. package/dist/looma/p-C-0syqXZ.js +1 -0
  169. package/dist/looma/p-a27669b1.entry.js +1 -0
  170. package/dist/looma/{p-11083743.entry.js → p-a6ee76b7.entry.js} +1 -1
  171. package/dist/looma/p-a90d2821.entry.js +1 -0
  172. package/dist/looma/{p-2e6f791e.entry.js → p-add36e74.entry.js} +1 -1
  173. package/dist/looma/{p-0584a051.entry.js → p-b6398a6b.entry.js} +1 -1
  174. package/dist/looma/{p-078f9fb8.entry.js → p-d50faaff.entry.js} +1 -1
  175. package/dist/looma/{p-b7aa4488.entry.js → p-d77278ce.entry.js} +1 -1
  176. package/dist/looma/p-d9ec13b7.entry.js +1 -0
  177. package/dist/looma/{p-1681b218.entry.js → p-ecf8005f.entry.js} +1 -1
  178. package/dist/looma/p-ed368426.entry.js +1 -0
  179. package/dist/looma/{p-063f5a89.entry.js → p-f0487ff3.entry.js} +1 -1
  180. package/dist/looma/p-f74e5546.entry.js +1 -0
  181. package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
  182. package/dist/types/components/ui-input/ui-input.d.ts +1 -1
  183. package/dist/types/components/ui-select/ui-select.d.ts +3 -2
  184. package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
  185. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +18 -1
  186. package/dist/types/components/ui-tree/ui-tree.d.ts +9 -1
  187. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +4 -0
  188. package/dist/types/components.d.ts +260 -28
  189. package/dist/types/field/combobox.d.ts +46 -0
  190. package/dist/types/field/valibot.d.ts +7 -0
  191. package/dist/types/field/validation.d.ts +56 -0
  192. package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-VO4C2MZX.js} +1 -1
  193. package/dist/{ui-avatar-group.entry-BWS7E2CM.js → ui-avatar-group.entry-TAXJRIIU.js} +1 -1
  194. package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-T6FU6ZYM.js} +1 -1
  195. package/dist/{ui-badge.entry-2WOBVOYP.js → ui-badge.entry-MZFYNBMJ.js} +1 -1
  196. package/dist/ui-button.entry-7UXMUGHN.js +80 -0
  197. package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-DMZJB3RE.js} +1 -1
  198. package/dist/ui-combobox.entry-ZCTPXEES.js +553 -0
  199. package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-2WMCBGCP.js} +6 -6
  200. package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-WO23XOSW.js} +6 -6
  201. package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-USX7OUEW.js} +2 -2
  202. package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-MXDIN7MV.js} +2 -2
  203. package/dist/{ui-form-field.entry-SJ6NNFXB.js → ui-form-field.entry-7ZCMEHPY.js} +3 -3
  204. package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-MJUNXHBU.js} +2 -2
  205. package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-AWG63YIG.js} +8 -6
  206. package/dist/{ui-menu-item.entry-V3HIMR75.js → ui-menu-item.entry-HFTWG62N.js} +2 -2
  207. package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-IT3GW5TL.js} +7 -7
  208. package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-ZQQB4N6E.js} +6 -6
  209. package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-V7PCTS7I.js} +2 -2
  210. package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-JYH6TQBI.js} +3 -3
  211. package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-JBNYXXUN.js} +2 -2
  212. package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-TEAWE76O.js} +2 -2
  213. package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-F3A6TE2U.js} +13 -7
  214. package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-MJIICMP2.js} +3 -3
  215. package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-6REFIUHV.js} +2 -2
  216. package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-OJTXCED7.js} +8 -6
  217. package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-NOFXLKPS.js} +5 -5
  218. package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-COWTWVHX.js} +57 -21
  219. package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-PIAWXJNV.js} +2 -2
  220. package/dist/{ui-tree-item.entry-45RR3CMP.js → ui-tree-item.entry-BSEWNL2O.js} +7 -3
  221. package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-XYI3ZFAZ.js} +77 -8
  222. package/dist/valibot.d.ts +52 -0
  223. package/dist/valibot.js +7 -0
  224. package/package.json +11 -3
  225. package/styles.css +36 -20
  226. package/theme-high-contrast.css +12 -0
  227. package/tokens.css +23 -0
  228. package/vue/{chunk-5KWCMTXB.js → chunk-JLW23USW.js} +88 -1
  229. package/vue/editor/index.js +1 -1
  230. package/vue/index.d.ts +123 -1
  231. package/vue/index.js +3 -1
  232. package/dist/components/p-CEYIKqYc.js +0 -1
  233. package/dist/components/p-CIA4RyEp.js +0 -1
  234. package/dist/components/p-PM9a74r7.js +0 -1
  235. package/dist/looma/p-34417499.entry.js +0 -1
  236. package/dist/looma/p-4b422d40.entry.js +0 -1
  237. package/dist/looma/p-54722713.entry.js +0 -13
  238. package/dist/looma/p-54c41576.entry.js +0 -1
  239. package/dist/looma/p-5d4713a6.entry.js +0 -1
  240. package/dist/looma/p-624ba086.entry.js +0 -1
  241. package/dist/looma/p-8d5adb17.entry.js +0 -1
  242. package/dist/looma/p-9194a99d.entry.js +0 -1
  243. package/dist/looma/p-CEeiinfk.js +0 -2
  244. package/dist/looma/p-PM9a74r7.js +0 -1
  245. package/dist/looma/p-a33522a2.entry.js +0 -1
  246. package/dist/looma/p-a5127c7d.entry.js +0 -1
  247. package/dist/looma/p-e3f99a24.entry.js +0 -1
  248. package/dist/ui-button.entry-VCGSEONK.js +0 -71
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
4
  var events = require('./events-TcQIzpNv.js');
5
5
 
6
6
  /**
@@ -616,6 +616,10 @@ const UITreeItem = class {
616
616
  label = '';
617
617
  /** One-based visual and semantic nesting level. */
618
618
  depth = 1;
619
+ /** Application hierarchy depth used for drop constraints. Defaults to visual depth. */
620
+ dropDepth;
621
+ /** Deepest descendant distance, used with the tree's max-depth drop constraint. */
622
+ subtreeDepth;
619
623
  /** Whether this item accepts children and exposes disclosure behavior. */
620
624
  container = false;
621
625
  /** Whether this item participates in pointer drag and drop. */
@@ -678,10 +682,10 @@ const UITreeItem = class {
678
682
  const level = Math.max(1, Math.floor(this.depth));
679
683
  const disclosureLabel = `${this.internalExpanded ? 'Collapse' : 'Expand'} ${this.label || 'item'}`;
680
684
  const dragLabel = `Drag ${this.label || 'item'} to reorder`;
681
- return (index.h(index.Host, { key: 'ea8ed538aa3883c87257a25614a066965364693f', role: "treeitem", "aria-level": String(level), "aria-expanded": this.container ? String(this.internalExpanded) : undefined, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "data-container": this.container ? '' : undefined, "data-selected": this.selected ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-drag-type": this.dragType || 'item', "data-drop-scope": this.dropScope || undefined, "data-accepts": this.accepts || undefined, tabIndex: this.disabled ? -1 : 0, style: {
685
+ return (index.h(index.Host, { key: '606f5fdac8a95489d0c62cd7d4918c6d5d0c759e', role: "treeitem", "aria-level": String(level), "aria-expanded": this.container ? String(this.internalExpanded) : undefined, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "data-container": this.container ? '' : undefined, "data-selected": this.selected ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-drag-type": this.dragType || 'item', "data-drop-scope": this.dropScope || undefined, "data-accepts": this.accepts || undefined, tabIndex: this.disabled ? -1 : 0, style: {
682
686
  '--ui-tree-item-depth': String(level - 1),
683
687
  'margin-inline-start': level > 1 ? 'var(--ui-tree-indent, 16px)' : '0px',
684
- } }, index.h("div", { key: '740b93aa47e65d8a1cb899d4b9c966d9ad1d456f', class: "row", part: "row", onClick: this.onRowClick }, this.sortable && !this.disabled ? (index.h("button", { class: "drag-handle", part: "drag-handle", type: "button", draggable: true, "aria-label": dragLabel, title: dragLabel }, index.h("span", { innerHTML: loomaIconMarkup('grip-vertical') }))) : null, this.container ? (index.h("button", { class: "disclosure", part: "disclosure", type: "button", "aria-label": disclosureLabel, "aria-expanded": String(this.internalExpanded), disabled: this.disabled, onClick: this.onDisclosureClick, onKeyDown: this.onDisclosureKeydown }, index.h("span", { class: { 'disclosure-icon': true, 'disclosure-icon--expanded': this.internalExpanded }, innerHTML: loomaIconMarkup('chevron-down') }))) : index.h("span", { class: "disclosure-spacer", "aria-hidden": "true" }), index.h("span", { key: '37e1b7f1cdddf623734becef465ffde83d8b86f2', class: "leading", part: "leading" }, index.h("slot", { key: '0ab3a60c98628f009918d0d720772154912d2709', name: "leading" })), index.h("span", { key: 'defdd343f25a0f4354110e981f3889e1d09c27ee', class: "label", part: "label" }, index.h("slot", { key: 'bde46ccacc1a620348062fc300503c4f1736316b' })), index.h("span", { key: 'caff9ada38c41be90aeb6e331f4c54a51f31d26c', class: "actions", part: "actions" }, index.h("slot", { key: 'e11704d6871445c91eaa29c99302d8b751be69d3', name: "actions" })), index.h("span", { key: '9efc0e95588f1dd4527dade2b7ff9f2774462c2e', class: "drop-indicator row-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })), this.container ? (index.h("div", { class: "children", part: "children", role: "group", hidden: !this.internalExpanded }, index.h("slot", { name: "children" }))) : null, index.h("span", { key: '8893ec2c4082bb8af942ef563055a2910d0d4201', class: "drop-indicator subtree-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })));
688
+ } }, index.h("div", { key: '2b4bb03d4b24ef668f22b08e803f7f43c2d63ae5', class: "row", part: "row", onClick: this.onRowClick }, this.sortable && !this.disabled ? (index.h("button", { class: "drag-handle", part: "drag-handle", type: "button", draggable: true, "aria-label": dragLabel, title: dragLabel }, index.h("span", { innerHTML: loomaIconMarkup('grip-vertical') }))) : null, this.container ? (index.h("button", { class: "disclosure", part: "disclosure", type: "button", "aria-label": disclosureLabel, "aria-expanded": String(this.internalExpanded), disabled: this.disabled, onClick: this.onDisclosureClick, onKeyDown: this.onDisclosureKeydown }, index.h("span", { class: { 'disclosure-icon': true, 'disclosure-icon--expanded': this.internalExpanded }, innerHTML: loomaIconMarkup('chevron-down') }))) : index.h("span", { class: "disclosure-spacer", "aria-hidden": "true" }), index.h("span", { key: 'e7b935158e35cdc6518bdd73d54c42dcfa211aee', class: "leading", part: "leading" }, index.h("slot", { key: '8448462349fd23b8be0fb673fc6e101bf94beaa7', name: "leading" })), index.h("span", { key: 'e0b6338e1ec9ec043446e42c5f03724adf7e1862', class: "label", part: "label" }, index.h("slot", { key: 'ed44e6f2ce3466c28d2b87fc7511399ecc339255' })), index.h("span", { key: '2aea78227904fe23cfc4b8e14852a4601e3cc34b', class: "actions", part: "actions" }, index.h("slot", { key: '7c6549008c2a54c3ea6fcdf9e0fdbe445d379922', name: "actions" })), index.h("span", { key: '05166ba04765bc518d6b95ca7ae5a67c4394d1bf', class: "drop-indicator row-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })), this.container ? (index.h("div", { class: "children", part: "children", role: "group", hidden: !this.internalExpanded }, index.h("slot", { name: "children" }))) : null, index.h("span", { key: '7381d6e9e2a8f94695f29e73194b1603d79cefb9', class: "drop-indicator subtree-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })));
685
689
  }
686
690
  static get watchers() { return {
687
691
  "expanded": [{
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
4
  var events = require('./events-TcQIzpNv.js');
5
5
 
6
6
  /**
@@ -64,9 +64,14 @@ const UITree = class {
64
64
  get host() { return index.getElement(this); }
65
65
  label = 'Tree';
66
66
  hoverExpandDelay = 700;
67
+ /** Maximum resulting item depth accepted by pointer reordering. Zero is unlimited. */
68
+ maxDepth = 0;
67
69
  source = null;
68
70
  target = null;
69
71
  position = null;
72
+ rejectedTarget = null;
73
+ rejectedPosition = null;
74
+ rejection = null;
70
75
  hoverIntent = null;
71
76
  componentDidLoad() {
72
77
  this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
@@ -134,19 +139,42 @@ const UITree = class {
134
139
  .filter(Boolean),
135
140
  };
136
141
  }
137
- permitsDrop(source, target, position) {
142
+ constraintDepth(item) {
143
+ if (item.dropDepth !== undefined)
144
+ return item.dropDepth;
145
+ const dropDepth = item.getAttribute('drop-depth');
146
+ if (dropDepth !== null)
147
+ return Number(dropDepth);
148
+ if (item.depth !== undefined)
149
+ return item.depth;
150
+ return Number(item.getAttribute('depth')) || 1;
151
+ }
152
+ dropRejection(source, target, position) {
138
153
  // A tree item can never move into (or beside) one of its own descendants.
139
154
  // Reject the target before showing any insertion affordance so the preview
140
155
  // stays truthful instead of promising a move the consumer must undo.
141
156
  if (source.contains(target))
142
- return false;
157
+ return { reason: 'descendant' };
143
158
  const sourceMeta = this.itemMetadata(source);
144
159
  const targetMeta = this.itemMetadata(target);
145
160
  if (position === 'inside') {
146
- return this.acceptsChildren(target)
147
- && (targetMeta.accepts.length === 0 || targetMeta.accepts.includes(sourceMeta.type));
161
+ if (!this.acceptsChildren(target)
162
+ || (targetMeta.accepts.length > 0 && !targetMeta.accepts.includes(sourceMeta.type))) {
163
+ return { reason: 'incompatible' };
164
+ }
148
165
  }
149
- return sourceMeta.type === targetMeta.type;
166
+ else if (sourceMeta.type !== targetMeta.type) {
167
+ return { reason: 'incompatible' };
168
+ }
169
+ const maxDepth = Math.max(0, Math.floor(this.maxDepth));
170
+ if (maxDepth > 0 && source.subtreeDepth !== undefined) {
171
+ const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
172
+ const subtreeDepth = Math.max(0, Math.floor(source.subtreeDepth));
173
+ const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
174
+ if (resultingDepth > maxDepth)
175
+ return { reason: 'max-depth', maxDepth, resultingDepth };
176
+ }
177
+ return null;
150
178
  }
151
179
  clearTarget() {
152
180
  this.target?.removeAttribute('data-drop-position');
@@ -154,10 +182,16 @@ const UITree = class {
154
182
  this.position = null;
155
183
  this.hoverIntent?.cancel();
156
184
  }
185
+ clearRejection() {
186
+ this.rejectedTarget = null;
187
+ this.rejectedPosition = null;
188
+ this.rejection = null;
189
+ }
157
190
  finishDrag() {
158
191
  this.source?.removeAttribute('data-dragging');
159
192
  this.source = null;
160
193
  this.clearTarget();
194
+ this.clearRejection();
161
195
  }
162
196
  expandTarget = (itemId) => {
163
197
  const item = Array.from(this.host.querySelectorAll('ui-tree-item'))
@@ -195,18 +229,29 @@ const UITree = class {
195
229
  return false;
196
230
  if (!target || target === this.source) {
197
231
  this.clearTarget();
232
+ this.clearRejection();
198
233
  return false;
199
234
  }
200
235
  const row = this.rowFor(target);
201
236
  if (!row)
202
237
  return false;
203
238
  const position = classifyDropPosition(row.getBoundingClientRect(), clientY, this.acceptsChildren(target));
204
- if (!this.permitsDrop(this.source, target, position)) {
239
+ const rejection = this.dropRejection(this.source, target, position);
240
+ if (rejection) {
205
241
  if (dataTransfer)
206
242
  dataTransfer.dropEffect = 'none';
207
243
  this.clearTarget();
244
+ if (rejection.reason === 'max-depth') {
245
+ this.rejectedTarget = target;
246
+ this.rejectedPosition = position;
247
+ this.rejection = rejection;
248
+ }
249
+ else {
250
+ this.clearRejection();
251
+ }
208
252
  return false;
209
253
  }
254
+ this.clearRejection();
210
255
  if (dataTransfer)
211
256
  dataTransfer.dropEffect = 'move';
212
257
  if (this.target !== target || this.position !== position) {
@@ -248,12 +293,15 @@ const UITree = class {
248
293
  if (this.itemAtPoint(event.clientX, event.clientY))
249
294
  return;
250
295
  this.clearTarget();
296
+ this.clearRejection();
251
297
  };
252
298
  dispatchReorder(source, target, position) {
253
299
  const sourceId = this.itemId(source);
254
300
  const targetId = this.itemId(target);
255
301
  if (!sourceId || !targetId)
256
302
  return;
303
+ if (position === 'inside')
304
+ this.expandTarget(targetId);
257
305
  const sourceMeta = this.itemMetadata(source);
258
306
  const targetMeta = this.itemMetadata(target);
259
307
  events.dispatchDetail(this.host, 'reorder', {
@@ -267,6 +315,21 @@ const UITree = class {
267
315
  trigger: 'pointer',
268
316
  });
269
317
  }
318
+ dispatchReorderRejected(source, target, position, rejection) {
319
+ const sourceId = this.itemId(source);
320
+ const targetId = this.itemId(target);
321
+ if (!sourceId || !targetId)
322
+ return;
323
+ events.dispatchDetail(this.host, 'reorder-rejected', {
324
+ sourceId,
325
+ targetId,
326
+ position,
327
+ reason: 'max-depth',
328
+ maxDepth: rejection.maxDepth,
329
+ resultingDepth: rejection.resultingDepth,
330
+ trigger: 'pointer',
331
+ });
332
+ }
270
333
  onDrop = (event) => {
271
334
  if (!this.source || !this.target || !this.position)
272
335
  return;
@@ -276,14 +339,23 @@ const UITree = class {
276
339
  };
277
340
  onDragEnd = (event) => {
278
341
  if (this.source) {
342
+ if (this.rejectedTarget && this.rejectedPosition && this.rejection) {
343
+ this.dispatchReorderRejected(this.source, this.rejectedTarget, this.rejectedPosition, this.rejection);
344
+ this.finishDrag();
345
+ return;
346
+ }
279
347
  const target = this.itemAtPoint(event.clientX, event.clientY);
280
348
  if (target && target !== this.source) {
281
349
  const row = this.rowFor(target);
282
350
  if (row) {
283
351
  const position = classifyDropPosition(row.getBoundingClientRect(), event.clientY, this.acceptsChildren(target));
284
- if (this.permitsDrop(this.source, target, position)) {
352
+ const rejection = this.dropRejection(this.source, target, position);
353
+ if (!rejection) {
285
354
  this.dispatchReorder(this.source, target, position);
286
355
  }
356
+ else if (rejection.reason === 'max-depth') {
357
+ this.dispatchReorderRejected(this.source, target, position, rejection);
358
+ }
287
359
  }
288
360
  }
289
361
  }
@@ -308,7 +380,7 @@ const UITree = class {
308
380
  next.focus();
309
381
  };
310
382
  render() {
311
- return (index.h(index.Host, { key: '7da064127eb199f5e2cfc59489a07204c9dac2f2', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: '31a98a6774ab35e565dab65f1dd8202494432b32' })));
383
+ return (index.h(index.Host, { key: '474c2154d2abe3c76eee9c36bf552390089df6e8', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: '93aedd02f984dd33b5efc811fef417d1199917bd' })));
312
384
  }
313
385
  };
314
386
  UITree.style = uiTreeCss();
@@ -6,6 +6,7 @@
6
6
  "components/ui-badge/ui-badge.js",
7
7
  "components/ui-button/ui-button.js",
8
8
  "components/ui-checkbox/ui-checkbox.js",
9
+ "components/ui-combobox/ui-combobox.js",
9
10
  "components/ui-context-menu/ui-context-menu.js",
10
11
  "components/ui-dialog/ui-dialog.js",
11
12
  "components/ui-disclosure/ui-disclosure.js",
@@ -1,15 +1,20 @@
1
1
  :host {
2
2
  display: inline-flex;
3
3
  vertical-align: middle;
4
- color: var(--ui-text-primary);
4
+ color: var(--ui-action-secondary-text, var(--ui-text-primary));
5
5
  }
6
6
 
7
- :host([variant='outline'])::slotted(button),
7
+ :host([data-variant='solid']) {
8
+ color: var(--ui-action-primary-text, var(--ui-text-on-accent));
9
+ }
10
+
11
+ :host([data-variant='outline']) ::slotted(button),
8
12
  ::slotted(button) {
9
13
  appearance: none;
10
- border: 1px solid var(--ui-border-default);
14
+ min-block-size: var(--ui-button-min-block-size, 2.5rem);
15
+ border: 1px solid var(--ui-control-border, var(--ui-border-default));
11
16
  border-radius: var(--ui-button-radius, var(--ui-radius-2));
12
- background: var(--ui-surface-default);
17
+ background: var(--ui-action-secondary-surface, var(--ui-surface-default));
13
18
  color: inherit;
14
19
  font: inherit;
15
20
  font-weight: var(--ui-font-medium, 500);
@@ -25,76 +30,77 @@
25
30
  margin: 0;
26
31
  }
27
32
 
28
- :host([data-size='sm'])::slotted(button) {
33
+ :host([data-size='sm']) ::slotted(button) {
29
34
  padding: var(--ui-space-1) var(--ui-space-2);
30
35
  font-size: 0.875rem;
31
36
  }
32
37
 
33
- :host([data-size='lg'])::slotted(button) {
38
+ :host([data-size='lg']) ::slotted(button) {
39
+ min-block-size: var(--ui-control-min-block-size, 2.75rem);
34
40
  padding: var(--ui-space-3) var(--ui-space-4);
35
41
  font-size: 1rem;
36
42
  }
37
43
 
38
44
  ::slotted(button:hover:enabled) {
39
- background: var(--ui-surface-muted);
40
- border-color: var(--ui-border-strong);
45
+ background: var(--ui-action-secondary-surface-hover, var(--ui-surface-muted));
46
+ border-color: var(--ui-control-border-hover, var(--ui-border-strong));
41
47
  }
42
48
 
43
49
  ::slotted(button:active:enabled) {
44
50
  background: var(--ui-surface-subtle);
45
51
  }
46
52
 
47
- :host([variant='solid'])::slotted(button) {
48
- border-color: var(--ui-accent-solid);
49
- background: var(--ui-accent-solid);
50
- color: var(--ui-text-on-accent);
53
+ :host([data-variant='solid']) ::slotted(button) {
54
+ border-color: var(--ui-action-primary-surface, var(--ui-accent-solid));
55
+ background: var(--ui-action-primary-surface, var(--ui-accent-solid));
56
+ color: var(--ui-action-primary-text, var(--ui-text-on-accent));
51
57
  box-shadow: var(--ui-button-solid-shadow, inset 0 1px rgb(255 255 255 / 0.16), var(--ui-shadow-xs));
52
58
  }
53
59
 
54
- :host([variant='solid'])::slotted(button:hover:enabled) {
55
- background: var(--ui-accent-hover);
56
- border-color: var(--ui-accent-hover);
60
+ :host([data-variant='solid']) ::slotted(button:hover:enabled) {
61
+ background: var(--ui-action-primary-surface-hover, var(--ui-accent-hover));
62
+ border-color: var(--ui-action-primary-surface-hover, var(--ui-accent-hover));
57
63
  box-shadow: var(--ui-shadow-sm);
58
64
  transform: translateY(-1px);
59
65
  }
60
66
 
61
- :host([variant='solid'])::slotted(button:active:enabled) {
62
- background: var(--ui-accent-active);
63
- border-color: var(--ui-accent-active);
67
+ :host([data-variant='solid']) ::slotted(button:active:enabled) {
68
+ background: var(--ui-action-primary-surface-active, var(--ui-accent-active));
69
+ border-color: var(--ui-action-primary-surface-active, var(--ui-accent-active));
64
70
  box-shadow: none;
65
71
  transform: translateY(0);
66
72
  }
67
73
 
68
- :host([variant='destructive'])::slotted(button) {
74
+ :host([data-variant='destructive']) ::slotted(button) {
69
75
  border-color: var(--ui-danger-solid);
70
76
  background: var(--ui-danger-solid);
71
77
  color: var(--ui-text-on-accent);
72
78
  box-shadow: var(--ui-button-destructive-shadow, inset 0 1px rgb(255 255 255 / 0.14), var(--ui-shadow-xs));
73
79
  }
74
80
 
75
- :host([variant='destructive'])::slotted(button:hover:enabled) {
81
+ :host([data-variant='destructive']) ::slotted(button:hover:enabled) {
76
82
  background: var(--ui-danger-hover);
77
83
  border-color: var(--ui-danger-hover);
78
84
  box-shadow: var(--ui-shadow-sm);
79
85
  transform: translateY(-1px);
80
86
  }
81
87
 
82
- :host([variant='destructive'])::slotted(button:active:enabled) {
88
+ :host([data-variant='destructive']) ::slotted(button:active:enabled) {
83
89
  box-shadow: none;
84
90
  transform: translateY(0);
85
91
  }
86
92
 
87
- :host([variant='ghost'])::slotted(button) {
93
+ :host([data-variant='ghost']) ::slotted(button) {
88
94
  border-color: transparent;
89
95
  background: transparent;
90
96
  }
91
97
 
92
- :host([variant='ghost'])::slotted(button:hover:enabled) {
98
+ :host([data-variant='ghost']) ::slotted(button:hover:enabled) {
93
99
  background: var(--ui-surface-muted);
94
100
  border-color: transparent;
95
101
  }
96
102
 
97
- :host([variant='ghost'])::slotted(button:active:enabled) {
103
+ :host([data-variant='ghost']) ::slotted(button:active:enabled) {
98
104
  background: var(--ui-surface-subtle);
99
105
  border-color: transparent;
100
106
  }
@@ -104,8 +110,12 @@
104
110
  outline-offset: 2px;
105
111
  }
106
112
 
107
- ::slotted(button:disabled),
108
- :host([data-disabled]) {
113
+ :host([data-disabled='true']),
114
+ :host([disabled]) {
109
115
  opacity: 0.6;
110
116
  cursor: not-allowed;
111
117
  }
118
+
119
+ ::slotted(button:disabled) {
120
+ cursor: not-allowed;
121
+ }
@@ -10,8 +10,19 @@ export class UIButton {
10
10
  const btn = this.getButton();
11
11
  if (!btn)
12
12
  return;
13
- this.host.dataset.size = this.size || '';
14
- this.host.dataset.disabled = this.disabled ? 'true' : '';
13
+ if (this.size) {
14
+ this.host.dataset.size = this.size;
15
+ }
16
+ else {
17
+ delete this.host.dataset.size;
18
+ }
19
+ if (this.disabled) {
20
+ this.host.dataset.disabled = 'true';
21
+ }
22
+ else {
23
+ delete this.host.dataset.disabled;
24
+ }
25
+ this.host.dataset.variant = this.variant;
15
26
  btn.disabled = this.disabled;
16
27
  }
17
28
  componentDidLoad() {
@@ -34,7 +45,7 @@ export class UIButton {
34
45
  this.host.click();
35
46
  };
36
47
  render() {
37
- return (h(Host, { key: 'b5f9152db70a276334df047f5cf53d1b8efe2174', "data-size": this.size || undefined, "data-disabled": this.disabled ? '' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: 'b39657e832abc63a6ea6090fa061779c3ae654b5', ref: (el) => (this.slotRef = el) })));
48
+ return (h(Host, { key: '9c8d479fe7f1873a447048944513648bac132d52', "data-size": this.size || undefined, "data-variant": this.variant, "data-disabled": this.disabled ? 'true' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '741f48e7efd42262834992c07c4685d3e929d91c', ref: (el) => (this.slotRef = el) })));
38
49
  }
39
50
  static get is() { return "ui-button"; }
40
51
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,24 @@
1
+ :host { display: grid; gap: var(--ui-space-1); min-inline-size: 0; color: var(--ui-text-primary); font: inherit; }
2
+ label { color: var(--ui-field-label-color, var(--ui-text-primary)); font-size: var(--ui-field-label-size, 0.875rem); font-weight: var(--ui-field-label-weight, 500); }
3
+ .field { display: flex; min-inline-size: 0; border: 1px solid var(--ui-control-border, var(--ui-border-default)); border-radius: var(--ui-radius-2); background: var(--ui-control-surface, var(--ui-surface-default)); }
4
+ .field:focus-within { border-color: var(--ui-control-focus, var(--ui-focus-ring)); outline: 2px solid var(--ui-control-focus, var(--ui-focus-ring)); outline-offset: 1px; }
5
+ input { appearance: none; width: 100%; min-inline-size: 0; min-block-size: var(--ui-control-min-block-size, 2.75rem); box-sizing: border-box; border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; line-height: var(--ui-line-height-md); padding: var(--ui-space-2) var(--ui-space-3); margin: 0; outline: none; }
6
+ :host([data-size='sm']) input { min-block-size: var(--ui-field-compact-size, 2rem); padding: var(--ui-space-1) var(--ui-space-2); }
7
+ button { appearance: none; border: 0; border-radius: var(--ui-radius-2); background: transparent; color: var(--ui-field-affordance-color, var(--ui-text-secondary)); font: inherit; font-weight: var(--ui-field-affordance-weight, 400); min-inline-size: 2rem; padding: var(--ui-space-1); cursor: pointer; }
8
+ button:hover:enabled { background: var(--ui-surface-muted); color: var(--ui-text-primary); }
9
+ button:focus-visible { outline: 2px solid var(--ui-focus-ring); outline-offset: -3px; }
10
+ input:disabled, button:disabled { color: var(--ui-text-muted); cursor: not-allowed; }
11
+ .field:has(input:disabled) { background: var(--ui-control-surface-disabled, var(--ui-surface-muted)); }
12
+ :host([data-validation='error']) .field { border-color: var(--ui-danger-solid, var(--ui-accent-active)); }
13
+ .popup { box-sizing: border-box; min-inline-size: 12rem; max-inline-size: calc(100vw - 1rem); max-block-size: var(--ui-combobox-max-block-size, 18rem); overflow: auto; margin: 0; padding: var(--ui-space-1); border: 1px solid var(--ui-border-default); border-radius: var(--ui-radius-2); background: var(--ui-surface-elevated); color: var(--ui-text-primary); box-shadow: var(--ui-shadow-md); }
14
+ [hidden] { display: none !important; }
15
+ .option { padding: var(--ui-space-2) var(--ui-space-3); border-radius: var(--ui-radius-1); cursor: pointer; overflow-wrap: anywhere; }
16
+ .option:hover, .option[data-active] { background: var(--ui-surface-muted); outline: 1px solid var(--ui-focus-ring); outline-offset: -1px; }
17
+ .option[aria-disabled='true'] { color: var(--ui-text-muted); cursor: not-allowed; }
18
+ .primary { display: block; color: var(--ui-option-primary-color, var(--ui-text-primary)); font-weight: var(--ui-option-primary-weight, 500); }
19
+ .secondary { display: block; color: var(--ui-option-secondary-color, var(--ui-text-secondary)); font-weight: var(--ui-option-secondary-weight, 400); font-size: var(--ui-font-size-sm); }
20
+ .message, .group { color: var(--ui-field-message-color, var(--ui-text-secondary)); font-weight: var(--ui-field-message-weight, 400); font-size: var(--ui-font-size-sm); line-height: var(--ui-line-height-md); overflow-wrap: anywhere; }
21
+ .group, .popup .message { padding: var(--ui-space-2) var(--ui-space-3); }
22
+ .sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
23
+ @media (pointer: coarse) { button { min-inline-size: 2.75rem; min-block-size: 2.75rem; } }
24
+ @media (forced-colors: active) { .field, .popup { border-color: CanvasText; } .option[data-active] { outline-color: Highlight; } }