@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 +0,0 @@
1
- import{r as t,g as i,h as e,H as s}from"./p-CEeiinfk.js";import{d as r}from"./p-JwSoedEO.js";function n(t,i,e){const s=t.height>0?Math.min(1,Math.max(0,(i-t.top)/t.height)):.5;return e?s<.25?"before":s>.75?"after":"inside":s<.5?"before":"after"}const o=class{constructor(i){t(this,i)}get host(){return i(this)}label="Tree";hoverExpandDelay=700;source=null;target=null;position=null;hoverIntent=null;componentDidLoad(){this.hoverIntent=function(t,i){let e,s;function r(){e&&clearTimeout(e),e=void 0,s=void 0}return{schedule(n){s===n&&e||(r(),s=n,e=setTimeout((()=>{e=void 0;const t=s;s=void 0,t&&i(t)}),Math.max(0,t)))},cancel:r,destroy:r}}(this.hoverExpandDelay,this.expandTarget),this.host.addEventListener("dragstart",this.onDragStart),this.host.addEventListener("drag",this.onDrag),this.host.addEventListener("dragenter",this.onDragOver),this.host.addEventListener("dragover",this.onDragOver),this.host.addEventListener("dragleave",this.onDragLeave),this.host.addEventListener("drop",this.onDrop),this.host.addEventListener("dragend",this.onDragEnd),this.host.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){this.hoverIntent?.destroy(),this.host.removeEventListener("dragstart",this.onDragStart),this.host.removeEventListener("drag",this.onDrag),this.host.removeEventListener("dragenter",this.onDragOver),this.host.removeEventListener("dragover",this.onDragOver),this.host.removeEventListener("dragleave",this.onDragLeave),this.host.removeEventListener("drop",this.onDrop),this.host.removeEventListener("dragend",this.onDragEnd),this.host.removeEventListener("keydown",this.onKeyDown)}itemFromEvent(t){return t.composedPath().find((t=>t instanceof HTMLElement&&"ui-tree-item"===t.localName))??null}itemId(t){return t.itemId||t.getAttribute("item-id")||""}rowFor(t){return t.shadowRoot?.querySelector('[part="row"]')??null}itemAtPoint(t,i){let e=this.host.ownerDocument.elementFromPoint(t,i);for(;e;){if("ui-tree-item"===e.localName&&this.host.contains(e))return e;const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}return null}isWithinTree(t){let i=t instanceof HTMLElement?t:null;for(;i;){if(i===this.host||this.host.contains(i))return!0;const t=i.getRootNode();i=t instanceof ShadowRoot?t.host:i.parentElement}return!1}acceptsChildren(t){return Boolean(t.container??t.hasAttribute("container"))&&!Boolean(t.disabled??t.hasAttribute("disabled"))}itemMetadata(t){return{type:t.getAttribute("data-drag-type")||t.getAttribute("drag-type")||"item",scope:t.getAttribute("data-drop-scope")||t.getAttribute("drop-scope")||"",accepts:(t.getAttribute("data-accepts")||t.getAttribute("accepts")||"").split(",").map((t=>t.trim())).filter(Boolean)}}permitsDrop(t,i,e){if(t.contains(i))return!1;const s=this.itemMetadata(t),r=this.itemMetadata(i);return"inside"===e?this.acceptsChildren(i)&&(0===r.accepts.length||r.accepts.includes(s.type)):s.type===r.type}clearTarget(){this.target?.removeAttribute("data-drop-position"),this.target=null,this.position=null,this.hoverIntent?.cancel()}finishDrag(){this.source?.removeAttribute("data-dragging"),this.source=null,this.clearTarget()}expandTarget=t=>{const i=Array.from(this.host.querySelectorAll("ui-tree-item")).find((i=>this.itemId(i)===t));i&&"false"===i.getAttribute("aria-expanded")&&i.dispatchEvent(new CustomEvent("ui-tree-auto-expand"))};onDragStart=t=>{const i=this.itemFromEvent(t);if(!i||!Boolean(i.sortable??i.hasAttribute("sortable"))||Boolean(i.disabled??i.hasAttribute("disabled")))return;if(!t.composedPath().some((t=>t instanceof HTMLElement&&"drag-handle"===t.getAttribute("part"))))return void t.preventDefault();const e=this.itemId(i),s=this.rowFor(i);e&&s?(this.source=i,i.setAttribute("data-dragging","true"),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)),function(t,i){if(!t||"function"!=typeof t.setDragImage)return;const{height:e}=i.getBoundingClientRect();t.setDragImage(i,16,Math.max(0,e/2))}(t.dataTransfer,s)):t.preventDefault()};updateTarget(t,i,e){if(!this.source)return!1;if(!t||t===this.source)return this.clearTarget(),!1;const s=this.rowFor(t);if(!s)return!1;const r=n(s.getBoundingClientRect(),i,this.acceptsChildren(t));return this.permitsDrop(this.source,t,r)?(e&&(e.dropEffect="move"),this.target===t&&this.position===r||(this.clearTarget(),this.target=t,this.position=r,t.setAttribute("data-drop-position",r)),"inside"===r&&"false"===t.getAttribute("aria-expanded")?this.hoverIntent?.schedule(this.itemId(t)):this.hoverIntent?.cancel(),!0):(e&&(e.dropEffect="none"),this.clearTarget(),!1)}onDrag=t=>{if(!this.source||0===t.clientX&&0===t.clientY)return;const i=this.itemAtPoint(t.clientX,t.clientY);i&&this.updateTarget(i,t.clientY,t.dataTransfer)};onDragOver=t=>{if(!this.source)return;const i=this.itemFromEvent(t);this.updateTarget(i,t.clientY,t.dataTransfer)&&t.preventDefault()};onDragLeave=t=>{this.isWithinTree(t.relatedTarget)||this.itemAtPoint(t.clientX,t.clientY)||this.clearTarget()};dispatchReorder(t,i,e){const s=this.itemId(t),n=this.itemId(i);if(!s||!n)return;const o=this.itemMetadata(t),h=this.itemMetadata(i);r(this.host,"reorder",{sourceId:s,targetId:n,position:e,sourceType:o.type,targetType:h.type,sourceScope:o.scope,targetScope:h.scope,trigger:"pointer"})}onDrop=t=>{this.source&&this.target&&this.position&&(t.preventDefault(),this.dispatchReorder(this.source,this.target,this.position),this.finishDrag())};onDragEnd=t=>{if(this.source){const i=this.itemAtPoint(t.clientX,t.clientY);if(i&&i!==this.source){const e=this.rowFor(i);if(e){const s=n(e.getBoundingClientRect(),t.clientY,this.acceptsChildren(i));this.permitsDrop(this.source,i,s)&&this.dispatchReorder(this.source,i,s)}}}this.finishDrag()};visibleItems(){return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((t=>t.getClientRects().length>0&&!t.hasAttribute("disabled")))}onKeyDown=t=>{const i=this.itemFromEvent(t);if(!i)return;const e=this.visibleItems(),s=e.indexOf(i);if(s<0)return;const r="ArrowDown"===t.key?e[s+1]:"ArrowUp"===t.key?e[s-1]:null;r&&(t.preventDefault(),r.focus())};render(){return e(s,{key:"7da064127eb199f5e2cfc59489a07204c9dac2f2",role:"tree","aria-label":this.label||"Tree"},e("slot",{key:"31a98a6774ab35e565dab65f1dd8202494432b32"}))}};o.style=":host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter, 22px)}::slotted(ui-tree-item){--ui-tree-indent:inherit}";export{o as ui_tree}
@@ -1,71 +0,0 @@
1
- import {
2
- isActivationKey
3
- } from "./chunk-UL7UIUJZ.js";
4
- import {
5
- Host,
6
- getElement,
7
- h,
8
- registerInstance
9
- } from "./chunk-NIPNHZ5W.js";
10
-
11
- // dist/esm/ui-button.entry.js
12
- var uiButtonCss = () => `:host{display:inline-flex;vertical-align:middle;color:var(--ui-text-primary)}:host([variant='outline'])::slotted(button),::slotted(button){appearance:none;border:1px solid var(--ui-border-default);border-radius:var(--ui-button-radius, var(--ui-radius-2));background:var(--ui-surface-default);color:inherit;font:inherit;font-weight:var(--ui-font-medium, 500);line-height:var(--ui-line-height-tight);padding:var(--ui-space-2) var(--ui-space-3);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host([data-size='sm'])::slotted(button){padding:var(--ui-space-1) var(--ui-space-2);font-size:0.875rem}:host([data-size='lg'])::slotted(button){padding:var(--ui-space-3) var(--ui-space-4);font-size:1rem}::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:var(--ui-border-strong)}::slotted(button:active:enabled){background:var(--ui-surface-subtle)}:host([variant='solid'])::slotted(button){border-color:var(--ui-accent-solid);background:var(--ui-accent-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-button-solid-shadow, inset 0 1px rgb(255 255 255 / 0.16), var(--ui-shadow-xs))}:host([variant='solid'])::slotted(button:hover:enabled){background:var(--ui-accent-hover);border-color:var(--ui-accent-hover);box-shadow:var(--ui-shadow-sm);transform:translateY(-1px)}:host([variant='solid'])::slotted(button:active:enabled){background:var(--ui-accent-active);border-color:var(--ui-accent-active);box-shadow:none;transform:translateY(0)}:host([variant='destructive'])::slotted(button){border-color:var(--ui-danger-solid);background:var(--ui-danger-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-button-destructive-shadow, inset 0 1px rgb(255 255 255 / 0.14), var(--ui-shadow-xs))}:host([variant='destructive'])::slotted(button:hover:enabled){background:var(--ui-danger-hover);border-color:var(--ui-danger-hover);box-shadow:var(--ui-shadow-sm);transform:translateY(-1px)}:host([variant='destructive'])::slotted(button:active:enabled){box-shadow:none;transform:translateY(0)}:host([variant='ghost'])::slotted(button){border-color:transparent;background:transparent}:host([variant='ghost'])::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:transparent}:host([variant='ghost'])::slotted(button:active:enabled){background:var(--ui-surface-subtle);border-color:transparent}::slotted(button:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}::slotted(button:disabled),:host([data-disabled]){opacity:0.6;cursor:not-allowed}`;
13
- var UIButton = class {
14
- constructor(hostRef) {
15
- registerInstance(this, hostRef);
16
- }
17
- get host() {
18
- return getElement(this);
19
- }
20
- variant = "outline";
21
- size;
22
- disabled = false;
23
- slotRef;
24
- syncToButton() {
25
- const btn = this.getButton();
26
- if (!btn)
27
- return;
28
- this.host.dataset.size = this.size || "";
29
- this.host.dataset.disabled = this.disabled ? "true" : "";
30
- btn.disabled = this.disabled;
31
- }
32
- componentDidLoad() {
33
- this.slotRef?.addEventListener("slotchange", () => this.syncToButton());
34
- this.syncToButton();
35
- }
36
- componentDidUpdate() {
37
- this.syncToButton();
38
- }
39
- getButton() {
40
- const slot = this.host.shadowRoot?.querySelector("slot");
41
- const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
42
- return nodes.find((el) => el.tagName === "BUTTON") ?? null;
43
- }
44
- onKeydown = (e) => {
45
- const btn = this.getButton();
46
- if (btn || this.disabled || !isActivationKey(e))
47
- return;
48
- e.preventDefault();
49
- this.host.click();
50
- };
51
- render() {
52
- return h(Host, { key: "b5f9152db70a276334df047f5cf53d1b8efe2174", "data-size": this.size || void 0, "data-disabled": this.disabled ? "" : void 0, onKeyDown: this.onKeydown }, h("slot", { key: "b39657e832abc63a6ea6090fa061779c3ae654b5", ref: (el) => this.slotRef = el }));
53
- }
54
- static get watchers() {
55
- return {
56
- "variant": [{
57
- "syncToButton": 0
58
- }],
59
- "size": [{
60
- "syncToButton": 0
61
- }],
62
- "disabled": [{
63
- "syncToButton": 0
64
- }]
65
- };
66
- }
67
- };
68
- UIButton.style = uiButtonCss();
69
- export {
70
- UIButton as ui_button
71
- };