@threadlabs/looma 0.1.23 → 0.1.25

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 (309) hide show
  1. package/dist/chunk-HNFCGIBP.js +8 -0
  2. package/dist/chunk-NB6DBRXQ.js +323 -0
  3. package/dist/{chunk-GDMQKT5F.js → chunk-UY423IKN.js} +33 -30
  4. package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
  5. package/dist/cjs/icons-BAdjrnhS.js +680 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/looma.cjs.js +1 -1
  8. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
  10. package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
  11. package/dist/cjs/ui-badge.cjs.entry.js +2 -2
  12. package/dist/cjs/ui-button.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-callout.cjs.entry.js +27 -0
  14. package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
  15. package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
  16. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  17. package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
  18. package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
  19. package/dist/cjs/ui-editable.cjs.entry.js +100 -0
  20. package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
  21. package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
  22. package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
  23. package/dist/cjs/ui-input.cjs.entry.js +1 -1
  24. package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-menu.cjs.entry.js +14 -9
  26. package/dist/cjs/ui-multi-combobox.cjs.entry.js +158 -0
  27. package/dist/cjs/ui-popover.cjs.entry.js +10 -7
  28. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  29. package/dist/cjs/ui-radio.cjs.entry.js +16 -7
  30. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  31. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  32. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  33. package/dist/cjs/ui-switch.cjs.entry.js +19 -10
  34. package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
  35. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  36. package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
  37. package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
  38. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  39. package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
  40. package/dist/cjs/ui-tree.cjs.entry.js +123 -11
  41. package/dist/collection/collection-manifest.json +4 -0
  42. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
  43. package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
  44. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  45. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
  46. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
  47. package/dist/collection/components/ui-badge/ui-badge.css +64 -48
  48. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  49. package/dist/collection/components/ui-button/ui-button.js +1 -1
  50. package/dist/collection/components/ui-callout/ui-callout.css +74 -0
  51. package/dist/collection/components/ui-callout/ui-callout.js +59 -0
  52. package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
  53. package/dist/collection/components/ui-chip/ui-chip.css +47 -0
  54. package/dist/collection/components/ui-chip/ui-chip.js +67 -0
  55. package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
  56. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  57. package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
  58. package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
  59. package/dist/collection/components/ui-editable/ui-editable.css +2 -0
  60. package/dist/collection/components/ui-editable/ui-editable.js +196 -0
  61. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  62. package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
  63. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  64. package/dist/collection/components/ui-input/ui-input.js +1 -1
  65. package/dist/collection/components/ui-menu/ui-menu.css +12 -23
  66. package/dist/collection/components/ui-menu/ui-menu.js +16 -12
  67. package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
  68. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  69. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +29 -0
  70. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +503 -0
  71. package/dist/collection/components/ui-popover/ui-popover.css +14 -5
  72. package/dist/collection/components/ui-popover/ui-popover.js +12 -10
  73. package/dist/collection/components/ui-radio/ui-radio.js +24 -11
  74. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  75. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  76. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  77. package/dist/collection/components/ui-select/ui-select.js +1 -1
  78. package/dist/collection/components/ui-switch/ui-switch.js +22 -14
  79. package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
  80. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  81. package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
  82. package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
  83. package/dist/collection/components/ui-tooltip/ui-tooltip.js +14 -11
  84. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  85. package/dist/collection/components/ui-tree/ui-tree.css +2 -1
  86. package/dist/collection/components/ui-tree/ui-tree.js +122 -10
  87. package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
  88. package/dist/collection/field/editable.js +1 -0
  89. package/dist/collection/field/multi-combobox.js +1 -0
  90. package/dist/collection/icons.js +6 -1
  91. package/dist/collection/utils/controlled-state.js +4 -0
  92. package/dist/components/index.d.ts +8 -0
  93. package/dist/components/index.js +1 -1
  94. package/dist/components/p-B9CzOHvE.js +1 -0
  95. package/dist/components/p-BMgIcOh-.js +1 -0
  96. package/dist/components/p-BVteuP_d.js +1 -0
  97. package/dist/components/p-BnGhGgTH.js +1 -0
  98. package/dist/components/p-C6p-ygxq.js +1 -0
  99. package/dist/components/p-CoFximGM.js +13 -0
  100. package/dist/components/ui-affordance-scope.js +1 -1
  101. package/dist/components/ui-avatar-group.js +1 -1
  102. package/dist/components/ui-avatar.js +1 -1
  103. package/dist/components/ui-badge.js +1 -1
  104. package/dist/components/ui-button.js +1 -1
  105. package/dist/components/ui-callout.d.ts +11 -0
  106. package/dist/components/ui-callout.js +1 -0
  107. package/dist/components/ui-checkbox.js +1 -1
  108. package/dist/components/ui-chip.d.ts +11 -0
  109. package/dist/components/ui-chip.js +1 -0
  110. package/dist/components/ui-combobox.js +1 -1
  111. package/dist/components/ui-context-menu.js +1 -1
  112. package/dist/components/ui-dialog.js +1 -1
  113. package/dist/components/ui-disclosure.js +1 -1
  114. package/dist/components/ui-editable.d.ts +11 -0
  115. package/dist/components/ui-editable.js +1 -0
  116. package/dist/components/ui-floating-action-button.js +1 -1
  117. package/dist/components/ui-form-field.js +1 -1
  118. package/dist/components/ui-icon-button.js +1 -1
  119. package/dist/components/ui-input.js +1 -1
  120. package/dist/components/ui-menu-item.js +1 -1
  121. package/dist/components/ui-menu.js +1 -1
  122. package/dist/components/ui-multi-combobox.d.ts +11 -0
  123. package/dist/components/ui-multi-combobox.js +1 -0
  124. package/dist/components/ui-popover.js +1 -1
  125. package/dist/components/ui-radio-group.js +1 -1
  126. package/dist/components/ui-radio.js +1 -1
  127. package/dist/components/ui-search-result-row.js +1 -1
  128. package/dist/components/ui-search-shell.js +1 -1
  129. package/dist/components/ui-select.js +1 -1
  130. package/dist/components/ui-switch.js +1 -1
  131. package/dist/components/ui-tabs.js +1 -1
  132. package/dist/components/ui-textarea.js +1 -1
  133. package/dist/components/ui-toast-region.js +1 -1
  134. package/dist/components/ui-tooltip.js +1 -1
  135. package/dist/components/ui-top-bar.js +1 -1
  136. package/dist/components/ui-tree-item.js +1 -13
  137. package/dist/components/ui-tree.js +1 -1
  138. package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
  139. package/dist/esm/icons-CoFximGM.js +678 -0
  140. package/dist/esm/loader.js +1 -1
  141. package/dist/esm/looma.js +1 -1
  142. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  143. package/dist/esm/ui-avatar-group.entry.js +9 -17
  144. package/dist/esm/ui-avatar.entry.js +2 -2
  145. package/dist/esm/ui-badge.entry.js +2 -2
  146. package/dist/esm/ui-button.entry.js +1 -1
  147. package/dist/esm/ui-callout.entry.js +25 -0
  148. package/dist/esm/ui-checkbox.entry.js +13 -7
  149. package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
  150. package/dist/esm/ui-context-menu.entry.js +1 -1
  151. package/dist/esm/ui-dialog.entry.js +44 -8
  152. package/dist/esm/ui-disclosure.entry.js +9 -6
  153. package/dist/esm/ui-editable.entry.js +98 -0
  154. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  155. package/dist/esm/ui-form-field.entry.js +59 -4
  156. package/dist/esm/ui-icon-button.entry.js +1 -1
  157. package/dist/esm/ui-input.entry.js +1 -1
  158. package/dist/esm/ui-menu-item.entry.js +2 -2
  159. package/dist/esm/ui-menu.entry.js +14 -9
  160. package/dist/esm/ui-multi-combobox.entry.js +156 -0
  161. package/dist/esm/ui-popover.entry.js +10 -7
  162. package/dist/esm/ui-radio-group.entry.js +1 -1
  163. package/dist/esm/ui-radio.entry.js +16 -7
  164. package/dist/esm/ui-search-result-row.entry.js +1 -1
  165. package/dist/esm/ui-search-shell.entry.js +1 -1
  166. package/dist/esm/ui-select.entry.js +1 -1
  167. package/dist/esm/ui-switch.entry.js +19 -10
  168. package/dist/esm/ui-tabs.entry.js +10 -9
  169. package/dist/esm/ui-textarea.entry.js +1 -1
  170. package/dist/esm/ui-toast-region.entry.js +30 -19
  171. package/dist/esm/ui-tooltip.entry.js +12 -8
  172. package/dist/esm/ui-top-bar.entry.js +1 -1
  173. package/dist/esm/ui-tree-item.entry.js +54 -617
  174. package/dist/esm/ui-tree.entry.js +123 -11
  175. package/dist/index.cjs +1552 -894
  176. package/dist/index.d.cts +23 -1
  177. package/dist/index.d.ts +23 -1
  178. package/dist/index.js +12 -2
  179. package/dist/looma/looma.esm.js +1 -1
  180. package/dist/looma/p-08f80207.entry.js +1 -0
  181. package/dist/looma/{p-ed368426.entry.js → p-0e1741cb.entry.js} +1 -1
  182. package/dist/looma/p-0ef4bf13.entry.js +1 -0
  183. package/dist/looma/{p-7e0bb7f6.entry.js → p-166f8593.entry.js} +1 -1
  184. package/dist/looma/p-262a542c.entry.js +1 -0
  185. package/dist/looma/{p-13347631.entry.js → p-26d357ae.entry.js} +1 -1
  186. package/dist/looma/p-30f01909.entry.js +1 -0
  187. package/dist/looma/p-393e3e02.entry.js +1 -0
  188. package/dist/looma/p-3a44b9f9.entry.js +1 -0
  189. package/dist/looma/p-558d4f5b.entry.js +1 -0
  190. package/dist/looma/{p-5a87b59d.entry.js → p-5780cefa.entry.js} +1 -1
  191. package/dist/looma/p-5a7261e1.entry.js +1 -0
  192. package/dist/looma/p-5fdcee1d.entry.js +1 -0
  193. package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
  194. package/dist/looma/p-7319c147.entry.js +1 -0
  195. package/dist/looma/p-78b7e466.entry.js +1 -0
  196. package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
  197. package/dist/looma/p-7eb04f09.entry.js +1 -0
  198. package/dist/looma/{p-69a5557b.entry.js → p-81c533f5.entry.js} +1 -1
  199. package/dist/looma/p-87f501cf.entry.js +1 -0
  200. package/dist/looma/p-89e71bbb.entry.js +1 -0
  201. package/dist/looma/{p-8b8840b8.entry.js → p-92cd1841.entry.js} +1 -1
  202. package/dist/looma/{p-f0487ff3.entry.js → p-95eb3b58.entry.js} +1 -1
  203. package/dist/looma/p-96ec4d7a.entry.js +1 -0
  204. package/dist/looma/p-9d2662ca.entry.js +1 -0
  205. package/dist/looma/p-BnGhGgTH.js +1 -0
  206. package/dist/looma/p-CoFximGM.js +13 -0
  207. package/dist/looma/p-add67e4c.entry.js +1 -0
  208. package/dist/looma/p-b6c776fb.entry.js +1 -0
  209. package/dist/looma/p-bcb1b47b.entry.js +1 -0
  210. package/dist/looma/p-d56571a2.entry.js +1 -0
  211. package/dist/looma/{p-582973b5.entry.js → p-d62da01d.entry.js} +1 -1
  212. package/dist/looma/{p-f74e5546.entry.js → p-dbcb479c.entry.js} +1 -1
  213. package/dist/looma/p-e14024bf.entry.js +1 -0
  214. package/dist/looma/{p-5da09f47.entry.js → p-fc180770.entry.js} +1 -1
  215. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
  216. package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
  217. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
  218. package/dist/types/components/ui-chip/ui-chip.d.ts +8 -0
  219. package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -0
  220. package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
  221. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
  222. package/dist/types/components/ui-editable/ui-editable.d.ts +24 -0
  223. package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
  224. package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
  225. package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +47 -0
  226. package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
  227. package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
  228. package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
  229. package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
  230. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
  231. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +2 -1
  232. package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
  233. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
  234. package/dist/types/components.d.ts +343 -46
  235. package/dist/types/field/editable.d.ts +5 -0
  236. package/dist/types/field/multi-combobox.d.ts +11 -0
  237. package/dist/types/icons.d.ts +5 -0
  238. package/dist/types/utils/controlled-state.d.ts +4 -0
  239. package/dist/{ui-affordance-scope.entry-VO4C2MZX.js → ui-affordance-scope.entry-VSSP52ZP.js} +2 -2
  240. package/dist/ui-avatar-group.entry-JMCLL6FW.js +51 -0
  241. package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-X2YQ3QPG.js} +3 -3
  242. package/dist/ui-badge.entry-OJ6FJJKL.js +22 -0
  243. package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-ZN6JLND7.js} +2 -2
  244. package/dist/ui-callout.entry-7K6NXQ7U.js +32 -0
  245. package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-GUYRVU6O.js} +17 -8
  246. package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-chip_2.entry-M2DOTIGY.js} +32 -7
  247. package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-BM7FHOUJ.js} +5 -5
  248. package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-AZAD37CG.js} +50 -12
  249. package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-XDPGKMBK.js} +13 -7
  250. package/dist/ui-editable.entry-S3TE6KFT.js +110 -0
  251. package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-U7HGA3CS.js} +2 -2
  252. package/dist/ui-form-field.entry-C2ZSP3TM.js +120 -0
  253. package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-P6H2LY7D.js} +2 -2
  254. package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-GTNQJCQ2.js} +2 -2
  255. package/dist/ui-menu-item.entry-2HWOGUO5.js +22 -0
  256. package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-NZ7ER54K.js} +22 -14
  257. package/dist/ui-multi-combobox.entry-DZ5LLSVQ.js +167 -0
  258. package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-ZOEQMUWG.js} +17 -11
  259. package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-QCQ46EK5.js} +2 -2
  260. package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-QAATWUYT.js} +20 -8
  261. package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-2I3DH2OT.js} +2 -2
  262. package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-7RS55ORF.js} +2 -2
  263. package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-6O4KD4G7.js} +2 -2
  264. package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-DY5PSHCQ.js} +23 -11
  265. package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-6X56UOUE.js} +14 -10
  266. package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-RDYP6O77.js} +2 -2
  267. package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-EBY42KS5.js} +32 -23
  268. package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-PLXMPOKV.js} +19 -12
  269. package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-QKE2DLVD.js} +2 -2
  270. package/dist/ui-tree-item.entry-TC6YWIC6.js +145 -0
  271. package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-UL6UHCUT.js} +114 -12
  272. package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
  273. package/editor/extensions/index.d.ts +14 -6
  274. package/editor/extensions/index.js +1 -1
  275. package/editor/index.js +1 -1
  276. package/editor.css +37 -20
  277. package/package.json +1 -1
  278. package/styles.css +10 -0
  279. package/tokens.css +3 -0
  280. package/vue/{chunk-JLW23USW.js → chunk-GXQY27K2.js} +112 -17
  281. package/vue/editor/index.d.ts +5 -15
  282. package/vue/editor/index.js +1 -1
  283. package/vue/index.d.ts +442 -116
  284. package/vue/index.js +9 -1
  285. package/dist/components/p-CaietZcq.js +0 -1
  286. package/dist/components/p-DHd18bK7.js +0 -1
  287. package/dist/looma/p-14c081cf.entry.js +0 -1
  288. package/dist/looma/p-25366205.entry.js +0 -1
  289. package/dist/looma/p-2e3aa869.entry.js +0 -1
  290. package/dist/looma/p-40fe7fee.entry.js +0 -1
  291. package/dist/looma/p-446cda76.entry.js +0 -1
  292. package/dist/looma/p-4fc1b005.entry.js +0 -13
  293. package/dist/looma/p-6a8a4736.entry.js +0 -1
  294. package/dist/looma/p-6bf4038b.entry.js +0 -1
  295. package/dist/looma/p-8204fee6.entry.js +0 -1
  296. package/dist/looma/p-8238e0dc.entry.js +0 -1
  297. package/dist/looma/p-99d88efb.entry.js +0 -1
  298. package/dist/looma/p-a27669b1.entry.js +0 -1
  299. package/dist/looma/p-a6ee76b7.entry.js +0 -1
  300. package/dist/looma/p-b6398a6b.entry.js +0 -1
  301. package/dist/looma/p-d50faaff.entry.js +0 -1
  302. package/dist/looma/p-d77278ce.entry.js +0 -1
  303. package/dist/looma/p-d9ec13b7.entry.js +0 -1
  304. package/dist/looma/p-ecf8005f.entry.js +0 -1
  305. package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
  306. package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
  307. package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
  308. package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
  309. package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
@@ -1,6 +1,7 @@
1
1
  import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
2
  import { c as createId } from './id-hgBUJRDa.js';
3
3
  import { d as dispatchDetail, e as eventToTrigger, i as isActivationKey } from './events-JwSoedEO.js';
4
+ import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
4
5
 
5
6
  const uiDisclosureCss = () => `:host{display:block}::slotted([hidden]){display:none !important}`;
6
7
 
@@ -9,7 +10,8 @@ const UIDisclosure = class {
9
10
  registerInstance(this, hostRef);
10
11
  }
11
12
  get host() { return getElement(this); }
12
- open = false;
13
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
14
+ open;
13
15
  defaultOpen = false;
14
16
  disabled = false;
15
17
  internalOpen = false;
@@ -17,7 +19,8 @@ const UIDisclosure = class {
17
19
  trigger = null;
18
20
  content = null;
19
21
  syncFromProp() {
20
- this.internalOpen = this.open;
22
+ if (isControlled(this.open))
23
+ this.internalOpen = this.open;
21
24
  }
22
25
  syncState() {
23
26
  if (this.trigger) {
@@ -29,8 +32,7 @@ const UIDisclosure = class {
29
32
  }
30
33
  componentDidLoad() {
31
34
  this.resolveParts();
32
- this.syncFromProp();
33
- this.internalOpen = this.internalOpen || this.defaultOpen;
35
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
34
36
  this.syncState();
35
37
  this.trigger?.addEventListener('click', this.onTriggerClick);
36
38
  this.trigger?.addEventListener('keydown', this.onTriggerKeydown);
@@ -70,7 +72,8 @@ const UIDisclosure = class {
70
72
  setOpen(next, action) {
71
73
  if (this.internalOpen === next)
72
74
  return;
73
- this.internalOpen = next;
75
+ if (!isControlled(this.open))
76
+ this.internalOpen = next;
74
77
  dispatchDetail(this.host, next ? 'open' : 'close', {
75
78
  open: next,
76
79
  reason: action.reason,
@@ -91,7 +94,7 @@ const UIDisclosure = class {
91
94
  this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
92
95
  };
93
96
  render() {
94
- return (h(Host, { key: '3905d2d78a2d3d4ef36b582ba0f426be8e5e0f5e' }, h("slot", { key: '18547ff56457b73319264bba981f994fb947dffb' })));
97
+ return (h(Host, { key: '55f998f8e47ebe01fd5832d6c3dac310dda34b8d' }, h("slot", { key: '0d88728151901e1e412d7f5a3ae78b06aa7548fb' })));
95
98
  }
96
99
  static get watchers() { return {
97
100
  "open": [{
@@ -0,0 +1,98 @@
1
+ import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
+ import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
3
+
4
+ const uiEditableCss = () => `:host{display:block;min-inline-size:0}[hidden]{display:none !important}`;
5
+
6
+ const UIEditable = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.editChange = createEvent(this, "edit-change");
10
+ }
11
+ get host() { return getElement(this); }
12
+ /** Controlled edit state. Omit it to use defaultEdit and local interaction state. */
13
+ edit;
14
+ defaultEdit = false;
15
+ disabled = false;
16
+ editChange;
17
+ internalEdit = false;
18
+ trigger = null;
19
+ syncFromProp() {
20
+ if (isControlled(this.edit))
21
+ this.internalEdit = this.edit;
22
+ }
23
+ componentWillLoad() {
24
+ this.internalEdit = controlledOrDefault(this.edit, this.defaultEdit);
25
+ }
26
+ componentDidLoad() {
27
+ this.host.ownerDocument.addEventListener('pointerdown', this.onDocumentPointerDown, true);
28
+ }
29
+ disconnectedCallback() {
30
+ this.host.ownerDocument.removeEventListener('pointerdown', this.onDocumentPointerDown, true);
31
+ }
32
+ requestEdit(next, reason, trigger) {
33
+ if (this.disabled || this.internalEdit === next)
34
+ return;
35
+ if (!isControlled(this.edit))
36
+ this.internalEdit = next;
37
+ this.editChange.emit({ edit: next, reason, trigger });
38
+ if (next)
39
+ requestAnimationFrame(() => this.focusEditor());
40
+ else
41
+ requestAnimationFrame(() => this.trigger?.focus());
42
+ }
43
+ focusEditor() {
44
+ const editRoot = this.host.querySelector('[slot="edit"]');
45
+ const candidate = editRoot?.matches('input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox')
46
+ ? editRoot
47
+ : editRoot?.querySelector('input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox');
48
+ const focusInput = candidate?.focusInput;
49
+ if (typeof focusInput === 'function')
50
+ void focusInput.call(candidate);
51
+ else
52
+ candidate?.focus();
53
+ }
54
+ eventTrigger(event) {
55
+ return event.composedPath().find(node => node instanceof HTMLElement && node.hasAttribute('data-ui-editable-trigger'));
56
+ }
57
+ onClick = (event) => {
58
+ if (this.internalEdit || this.disabled)
59
+ return;
60
+ const trigger = this.eventTrigger(event);
61
+ if (!trigger)
62
+ return;
63
+ this.trigger = trigger;
64
+ this.requestEdit(true, 'activate', 'pointer');
65
+ };
66
+ onKeyDown = (event) => {
67
+ if (this.internalEdit && event.key === 'Escape') {
68
+ event.preventDefault();
69
+ event.stopPropagation();
70
+ this.requestEdit(false, 'escape', 'keyboard');
71
+ return;
72
+ }
73
+ if (this.internalEdit || !['Enter', ' '].includes(event.key))
74
+ return;
75
+ const trigger = this.eventTrigger(event);
76
+ if (!trigger)
77
+ return;
78
+ event.preventDefault();
79
+ this.trigger = trigger;
80
+ this.requestEdit(true, 'activate', 'keyboard');
81
+ };
82
+ onDocumentPointerDown = (event) => {
83
+ if (!this.internalEdit || event.composedPath().includes(this.host))
84
+ return;
85
+ this.requestEdit(false, 'light-dismiss', 'pointer');
86
+ };
87
+ render() {
88
+ return h(Host, { key: 'f350400d4ebf897fb657b83b7cba9d309c5067bd', "data-edit": this.internalEdit ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, onClick: this.onClick, onKeyDown: this.onKeyDown }, h("div", { key: 'f365ac61f59e9aaa1516121e3d6e2a42187e1d7b', part: "preview", hidden: this.internalEdit }, h("slot", { key: 'ea234b437cc4eb530f2994d695429be91d874ef7', name: "preview" })), h("div", { key: 'dacf0e74e72c47868986c80aaa60f55942fd9505', part: "edit", hidden: !this.internalEdit }, h("slot", { key: '54a943bc290335181a23b4cfa6055e4acfd8a62b', name: "edit" })));
89
+ }
90
+ static get watchers() { return {
91
+ "edit": [{
92
+ "syncFromProp": 0
93
+ }]
94
+ }; }
95
+ };
96
+ UIEditable.style = uiEditableCss();
97
+
98
+ export { UIEditable as ui_editable };
@@ -10,7 +10,7 @@ const UIFloatingActionButton = class {
10
10
  mobileOnly = false;
11
11
  label = '';
12
12
  render() {
13
- return (h(Host, { key: 'c9a7d8c9b6d6608566b21621a73d939f372c830d', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: '8eddccaf6be2f028bc02df967038843120045b84', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '0ea12efb9cb8ecec06238066827a734fb3b01e1e' }))));
13
+ return (h(Host, { key: '9e917e07efcef5c0a96b8b09af8934f336a521bd', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: '940daac4c2ff1144d7e82b36727205f286325a8e', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '382c70aa4836f6e799f98e1f0e4bc6e3104430fc' }))));
14
14
  }
15
15
  };
16
16
  UIFloatingActionButton.style = uiFloatingActionButtonCss();
@@ -11,17 +11,62 @@ const UIFormField = class {
11
11
  invalid = false;
12
12
  disabled = false;
13
13
  required = false;
14
+ observer = null;
15
+ activeInput = null;
16
+ ownedDescriptionIds = new Set();
17
+ wireQueued = false;
14
18
  componentDidLoad() {
19
+ this.observer = new MutationObserver(this.scheduleWire);
20
+ this.observer.observe(this.host, {
21
+ childList: true,
22
+ subtree: true,
23
+ attributes: true,
24
+ attributeFilter: ['aria-describedby', 'data-slot', 'id', 'role'],
25
+ });
15
26
  this.wire();
16
27
  }
17
28
  componentDidUpdate() {
18
- this.wire();
29
+ this.scheduleWire();
30
+ }
31
+ disconnectedCallback() {
32
+ this.observer?.disconnect();
33
+ this.observer = null;
34
+ this.removeOwnedDescriptions(this.activeInput);
35
+ this.activeInput = null;
36
+ this.ownedDescriptionIds.clear();
19
37
  }
38
+ descriptionIds(input) {
39
+ return Array.from(new Set((input.getAttribute('aria-describedby') ?? '').split(/\s+/).filter(Boolean)));
40
+ }
41
+ removeOwnedDescriptions(input) {
42
+ if (!input || this.ownedDescriptionIds.size === 0)
43
+ return;
44
+ const remaining = this.descriptionIds(input)
45
+ .filter(id => !this.ownedDescriptionIds.has(id));
46
+ if (remaining.length > 0)
47
+ input.setAttribute('aria-describedby', remaining.join(' '));
48
+ else
49
+ input.removeAttribute('aria-describedby');
50
+ }
51
+ scheduleWire = () => {
52
+ if (this.wireQueued)
53
+ return;
54
+ this.wireQueued = true;
55
+ queueMicrotask(() => {
56
+ this.wireQueued = false;
57
+ this.wire();
58
+ });
59
+ };
20
60
  wire() {
21
61
  const label = this.host.querySelector('label');
22
62
  const input = this.host.querySelector('input, textarea, select');
23
63
  const help = this.host.querySelector('[data-slot="help"]');
24
64
  const error = this.host.querySelector('[data-slot="error"], [role="alert"]');
65
+ if (input !== this.activeInput) {
66
+ this.removeOwnedDescriptions(this.activeInput);
67
+ this.activeInput = input;
68
+ this.ownedDescriptionIds.clear();
69
+ }
25
70
  if (!input)
26
71
  return;
27
72
  if (!input.id) {
@@ -30,6 +75,9 @@ const UIFormField = class {
30
75
  if (label && !label.getAttribute('for')) {
31
76
  label.setAttribute('for', input.id);
32
77
  }
78
+ const previousOwnedIds = this.ownedDescriptionIds;
79
+ const externalIds = this.descriptionIds(input)
80
+ .filter(id => !previousOwnedIds.has(id));
33
81
  const describedIds = [];
34
82
  if (help) {
35
83
  if (!help.id)
@@ -41,15 +89,22 @@ const UIFormField = class {
41
89
  error.id = createId('form-field-error');
42
90
  describedIds.push(error.id);
43
91
  }
44
- if (describedIds.length) {
45
- input.setAttribute('aria-describedby', describedIds.join(' '));
92
+ const nextOwnedIds = describedIds.filter(id => !externalIds.includes(id));
93
+ const nextDescribedIds = Array.from(new Set([...externalIds, ...describedIds]));
94
+ const nextDescribedBy = nextDescribedIds.join(' ');
95
+ if (input.getAttribute('aria-describedby') !== nextDescribedBy) {
96
+ if (nextDescribedBy)
97
+ input.setAttribute('aria-describedby', nextDescribedBy);
98
+ else
99
+ input.removeAttribute('aria-describedby');
46
100
  }
101
+ this.ownedDescriptionIds = new Set(nextOwnedIds);
47
102
  input.disabled = this.disabled;
48
103
  input.required = this.required;
49
104
  input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
50
105
  }
51
106
  render() {
52
- return (h(Host, { key: 'cdd06c6b16ac56f3547e64e7888d8766243392db', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: '7d545673a3485f8beee01b13ab56185b98ba8856' })));
107
+ return (h(Host, { key: 'ac01e2be489b9c907169417dc5064061bd74ff7c', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: 'c739f9b2c948bc1d3db4316871c2293bf75cf520', onSlotchange: this.scheduleWire })));
53
108
  }
54
109
  };
55
110
  UIFormField.style = uiFormFieldCss();
@@ -13,7 +13,7 @@ const UIIconButton = class {
13
13
  /** Reveals this control through a surrounding ui-affordance-scope. */
14
14
  anticipatory = false;
15
15
  render() {
16
- return (h(Host, { key: '8616d7e52a03a7a42738b11f4cabed3eb38c8640', "data-disabled": this.disabled ? '' : undefined, "data-ui-affordance": this.anticipatory ? 'button' : undefined }, h("button", { key: 'fae1362a50a0d80e2fcb3ab41f63ff21cf5d939a', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: 'e548fc504e3b26e85263fe3fc8faac0887fee16b' }))));
16
+ return (h(Host, { key: '225e147d184109d39a2e6f9236ba3ba3c5864c31', "data-disabled": this.disabled ? '' : undefined, "data-ui-affordance": this.anticipatory ? 'button' : undefined }, h("button", { key: '7e54fab4520ae6641c974abf19e975e8eec7a3df', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '54f9ba27c5a2ca896267f07ad1055907e74a64bc' }))));
17
17
  }
18
18
  };
19
19
  UIIconButton.style = uiIconButtonCss();
@@ -76,7 +76,7 @@ const UIInput = class {
76
76
  });
77
77
  };
78
78
  render() {
79
- return (h(Host, { key: 'a2f2c108144a7acae0dfb1bef6ea1f38a4dcca9c', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: '04284765a12089a8a1045056d72551a3494f00fc', ref: (el) => (this.slotRef = el) })));
79
+ return (h(Host, { key: '0d8676e8458476681653ef4600dcb0f3b56d1ed1', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: 'd3585c07b6985d9090002f7a9c0eea1227517e0f', ref: (el) => (this.slotRef = el) })));
80
80
  }
81
81
  static get watchers() { return {
82
82
  "value": [{
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-8BGiMGQ0.js';
2
2
 
3
- const uiMenuItemCss = () => `:host{display:block;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}:host(:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}:host([aria-disabled='true']),:host([disabled]){opacity:0.6;cursor:not-allowed}`;
3
+ const uiMenuItemCss = () => `:host{display:block;width:100%}.menu-item__surface{display:block;box-sizing:border-box;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}:host(:hover:not([aria-disabled='true']):not([disabled])) .menu-item__surface{background:var(--ui-surface-subtle)}:host([aria-disabled='true']) .menu-item__surface,:host([disabled]) .menu-item__surface{opacity:0.6;cursor:not-allowed}`;
4
4
 
5
5
  const UIMenuItem = class {
6
6
  constructor(hostRef) {
@@ -9,7 +9,7 @@ const UIMenuItem = class {
9
9
  disabled = false;
10
10
  value = '';
11
11
  render() {
12
- return (h(Host, { key: 'ebd7c5aa5c8fdce2d2349aef7f1a4505b9190852', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, h("slot", { key: '7b55a8545034b055f8cbd047a0f16ea729af097e' })));
12
+ return (h(Host, { key: '711e7f70268d23969e40073cd47b065afadc22c9', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, h("span", { key: 'd0c0aff983bdbc48666fcd652b39340bfd92c790', class: "menu-item__surface" }, h("slot", { key: '3fc6111848142b388529a9cdb5f6134bffe8fa42' }))));
13
13
  }
14
14
  };
15
15
  UIMenuItem.style = uiMenuItemCss();
@@ -1,16 +1,18 @@
1
1
  import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
2
  import { d as dispatchDetail, e as eventToTrigger } from './events-JwSoedEO.js';
3
3
  import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
4
+ import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
4
5
  import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
5
6
 
6
- const uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:auto;max-block-size:calc(100dvh - (var(--ui-menu-viewport-gap) * 2));opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}::slotted(ui-menu-item){display:block;width:100%;padding:var(--ui-space-2) var(--ui-space-3);text-align:left;background:none;border:none;border-radius:var(--ui-radius-2);color:var(--ui-text-primary);font-size:var(--ui-font-size-md);font-weight:var(--ui-font-medium, 500);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(ui-menu-item:hover:not([aria-disabled='true']):not([disabled])){background:var(--ui-surface-subtle)}::slotted(ui-menu-item[aria-disabled='true']),::slotted(ui-menu-item[disabled]){opacity:0.6;cursor:not-allowed}`;
7
+ const uiMenuCss = () => `:host{--ui-menu-viewport-gap:var(--ui-space-2, 0.5rem);display:flex;flex-direction:column;box-sizing:border-box;inline-size:max-content;min-inline-size:min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));max-inline-size:calc(100vw - (var(--ui-menu-viewport-gap) * 2));padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.menu__surface{display:flex;flex-direction:column;box-sizing:border-box;padding:var(--ui-space-1);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;overflow:auto;max-block-size:calc(100dvh - (var(--ui-menu-viewport-gap) * 2));opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}::slotted(ui-menu-item){display:block;width:100%}`;
7
8
 
8
9
  const UIMenu = class {
9
10
  constructor(hostRef) {
10
11
  registerInstance(this, hostRef);
11
12
  }
12
13
  get host() { return getElement(this); }
13
- open = false;
14
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
15
+ open;
14
16
  defaultOpen = false;
15
17
  /** Id of the control that anchors this menu in the top layer. */
16
18
  for;
@@ -21,7 +23,8 @@ const UIMenu = class {
21
23
  anchor = null;
22
24
  surface = null;
23
25
  syncFromProp() {
24
- this.internalOpen = this.open;
26
+ if (isControlled(this.open))
27
+ this.internalOpen = this.open;
25
28
  }
26
29
  resetSurface() {
27
30
  this.setupSurface();
@@ -48,8 +51,7 @@ const UIMenu = class {
48
51
  }
49
52
  }
50
53
  componentDidLoad() {
51
- this.syncFromProp();
52
- this.internalOpen = this.internalOpen || this.defaultOpen;
54
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
53
55
  this.host.addEventListener('click', this.onItemClick);
54
56
  this.host.addEventListener('keydown', this.onKeydown);
55
57
  this.setupSurface();
@@ -82,7 +84,8 @@ const UIMenu = class {
82
84
  closeMenu(reason, trigger) {
83
85
  if (!this.internalOpen)
84
86
  return;
85
- this.internalOpen = false;
87
+ if (!isControlled(this.open))
88
+ this.internalOpen = false;
86
89
  dispatchDetail(this.host, 'close', {
87
90
  open: false,
88
91
  reason: reason,
@@ -113,7 +116,8 @@ const UIMenu = class {
113
116
  reason: 'action',
114
117
  trigger: eventToTrigger(e),
115
118
  });
116
- this.internalOpen = false;
119
+ if (!isControlled(this.open))
120
+ this.internalOpen = false;
117
121
  };
118
122
  onKeydown = (e) => {
119
123
  if (e.key === 'Escape') {
@@ -136,7 +140,8 @@ const UIMenu = class {
136
140
  reason: 'action',
137
141
  trigger: 'keyboard',
138
142
  });
139
- this.internalOpen = false;
143
+ if (!isControlled(this.open))
144
+ this.internalOpen = false;
140
145
  }
141
146
  return;
142
147
  }
@@ -153,7 +158,7 @@ const UIMenu = class {
153
158
  }
154
159
  };
155
160
  render() {
156
- return (h(Host, { key: '25ae79e914820dfc470fa03d8c843646c3c060d9', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: 'b3a8b130e55610d948bc3e4603dede59dd560d05' })));
161
+ return (h(Host, { key: 'afba5a7f63238afdb6f71a3636c1f294d3e8ac6f', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("div", { key: '50d770efd27dddca436b804f10f1cc40bc604cb5', class: "menu__surface" }, h("slot", { key: '5014fc43a0ee2d66168bbcc1d52b20bd5120acb9' }))));
157
162
  }
158
163
  static get watchers() { return {
159
164
  "open": [{
@@ -0,0 +1,156 @@
1
+ import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
+
3
+ const uiMultiComboboxCss = () => `:host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(field){flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}ui-combobox::part(input){flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;max-inline-size:100%;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
4
+
5
+ const UIMultiCombobox = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.queryChange = createEvent(this, "query-change");
9
+ this.addItem = createEvent(this, "add-item");
10
+ this.removeItem = createEvent(this, "remove-item");
11
+ this.createItem = createEvent(this, "create-item");
12
+ this.optionsChange = createEvent(this, "options-change");
13
+ }
14
+ get host() { return getElement(this); }
15
+ label = '';
16
+ placeholder = '';
17
+ items = [];
18
+ config = {};
19
+ query;
20
+ defaultQuery = '';
21
+ disabled = false;
22
+ readOnly = false;
23
+ required = false;
24
+ name = '';
25
+ queryChange;
26
+ addItem;
27
+ removeItem;
28
+ createItem;
29
+ optionsChange;
30
+ raw = '';
31
+ rows = [];
32
+ combobox;
33
+ filteredConfig;
34
+ filteredConfigSource;
35
+ filteredSelection = '';
36
+ componentWillLoad() { this.raw = this.query ?? this.defaultQuery; }
37
+ syncQuery() {
38
+ if (this.query !== undefined)
39
+ this.raw = this.query;
40
+ }
41
+ get selectedValues() { return new Set(this.items.map(item => item.value)); }
42
+ get comboboxConfig() {
43
+ const selectionKey = this.items.map(item => item.value).join('\u0000');
44
+ if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
45
+ return this.filteredConfig;
46
+ }
47
+ const ownerFilter = this.config.filter;
48
+ const selected = this.selectedValues;
49
+ this.filteredConfigSource = this.config;
50
+ this.filteredSelection = selectionKey;
51
+ this.filteredConfig = {
52
+ ...this.config,
53
+ filter: (option, query, context) => !selected.has(option.value)
54
+ && (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())),
55
+ };
56
+ return this.filteredConfig;
57
+ }
58
+ setQuery(query, trigger) {
59
+ if (this.query === undefined)
60
+ this.raw = query;
61
+ this.queryChange.emit({ query, display: query, trigger });
62
+ }
63
+ onQueryChange = (event) => {
64
+ event.stopPropagation();
65
+ this.setQuery(event.detail.query, event.detail.trigger);
66
+ };
67
+ onOptionsChange = (event) => {
68
+ event.stopPropagation();
69
+ this.rows = event.detail;
70
+ this.optionsChange.emit(event.detail);
71
+ };
72
+ onValueChange = (event) => {
73
+ event.stopPropagation();
74
+ if (event.detail.kind !== 'selection' || !event.detail.option)
75
+ return;
76
+ const item = event.detail.option;
77
+ this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
78
+ // ui-combobox emits its selection value before the matching label query.
79
+ // Clear after both owner notifications so the stale label cannot win.
80
+ queueMicrotask(() => this.setQuery('', event.detail.trigger));
81
+ };
82
+ onCreateEntry = (event) => {
83
+ event.stopPropagation();
84
+ const query = event.detail.query.trim();
85
+ if (!query)
86
+ return;
87
+ this.setQuery('', event.detail.trigger);
88
+ this.createItem.emit({ query, trigger: event.detail.trigger });
89
+ };
90
+ remove(index, trigger) {
91
+ const item = this.items[index];
92
+ if (!item || item.disabled || this.disabled || this.readOnly)
93
+ return;
94
+ this.removeItem.emit({ item, index, trigger });
95
+ requestAnimationFrame(() => {
96
+ const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
97
+ const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
98
+ if (next && next.dataset.value !== item.value)
99
+ next.focus();
100
+ else
101
+ void this.focusInput();
102
+ });
103
+ }
104
+ focusItem(index) {
105
+ this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
106
+ }
107
+ onItemKeyDown = (event, index) => {
108
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
109
+ return;
110
+ if (event.key === 'ArrowLeft') {
111
+ event.preventDefault();
112
+ event.stopPropagation();
113
+ this.focusItem(Math.max(0, index - 1));
114
+ }
115
+ else if (event.key === 'ArrowRight') {
116
+ event.preventDefault();
117
+ event.stopPropagation();
118
+ if (index === this.items.length - 1)
119
+ void this.focusInput();
120
+ else
121
+ this.focusItem(index + 1);
122
+ }
123
+ else if (event.key === 'Backspace' || event.key === 'Delete') {
124
+ event.preventDefault();
125
+ event.stopPropagation();
126
+ this.remove(index, 'keyboard');
127
+ }
128
+ };
129
+ onKeyDown = (event) => {
130
+ if (event.defaultPrevented || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
131
+ return;
132
+ const input = event.composedPath().find(node => node instanceof HTMLInputElement);
133
+ if (!input || this.raw || (input.selectionStart ?? 0) > 0)
134
+ return;
135
+ if (event.key === 'ArrowLeft' && this.items.length) {
136
+ event.preventDefault();
137
+ this.focusItem(this.items.length - 1);
138
+ }
139
+ else if (event.key === 'Backspace' && this.items.length) {
140
+ event.preventDefault();
141
+ this.remove(this.items.length - 1, 'keyboard');
142
+ }
143
+ };
144
+ async focusInput() { await this.combobox?.focusInput(); }
145
+ render() {
146
+ return h(Host, { key: 'bdb03a28ea25b22340dc56381fa45031f0c47c27', onKeyDown: this.onKeyDown }, h("ui-combobox", { key: '51ba1ab747af9f216223bd71f524db79ef57b8a9', ref: element => this.combobox = element, label: this.label, "label-visibility": "sr-only", placeholder: this.placeholder, name: this.name, value: null, query: this.raw, config: this.comboboxConfig, size: "sm", disabled: this.disabled, readOnly: this.readOnly, required: this.required, "onQuery-change": this.onQueryChange, "onValue-change": this.onValueChange, "onCreate-entry": this.onCreateEntry, "onOptions-change": this.onOptionsChange }, h("div", { key: 'ebd8fd8e62db3c2e47b1bfc7558c01e7e1abb8ba', slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index) => h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: event => this.onItemKeyDown(event, index) }, h("slot", { name: `item-${item.id}` }, h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map(option => h("span", { slot: `option-${option.id}` }, h("slot", { name: `option-${option.id}` }, option.label))), h("span", { key: '99cd9848130de37e52a4f735c95e3754dbc64691', slot: "create" }, h("slot", { key: '84cc7c14716819bd968bdfcb9213fe3887a5c2b9', name: "create" }, "Create \u201C", this.raw, "\u201D")), h("span", { key: '1660eb03425dea4d36797e416d91b051531a470d', slot: "loading" }, h("slot", { key: '10c979403e89331e8bdf69ff2db3f5bc272b2685', name: "loading" }, "Loading suggestions\u2026")), h("span", { key: '1c862b6c5906aa3ec5fc874de5a5119e13ef9422', slot: "empty" }, h("slot", { key: '1c70a1beb7321d3b2be888b3826a1dba2f6fcc70', name: "empty" }, "No suggestions.")), h("span", { key: '4b4da5cb8b22543b90ff9230191bbb2e81d16408', slot: "error" }, h("slot", { key: 'a371a5ce50895562ebc6e55227e4a4834af37f3d', name: "error" }, "Unable to load suggestions.")), h("div", { key: 'f82e38165d90bdbfa8413c0a561abf7ab5da0183', slot: "footer" }, h("slot", { key: '6c0bd2b89428832f4cb485f5d2e30a792859ba9e', name: "footer" }))));
147
+ }
148
+ static get watchers() { return {
149
+ "query": [{
150
+ "syncQuery": 0
151
+ }]
152
+ }; }
153
+ };
154
+ UIMultiCombobox.style = uiMultiComboboxCss();
155
+
156
+ export { UIMultiCombobox as ui_multi_combobox };
@@ -1,16 +1,18 @@
1
1
  import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
2
  import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
3
3
  import { d as dispatchDetail } from './events-JwSoedEO.js';
4
+ import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
4
5
  import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
5
6
 
6
- const uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);box-shadow:var(--ui-shadow-lg);max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:auto}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}`;
7
+ const uiPopoverCss = () => `:host{--ui-popover-viewport-gap:var(--ui-space-2, 0.5rem);box-sizing:border-box;max-inline-size:min( 20rem, calc(100vw - (var(--ui-popover-viewport-gap) * 2)) );max-block-size:calc(100dvh - (var(--ui-popover-viewport-gap) * 2));overflow:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:var(--ui-shadow-lg)}.popover__surface{box-sizing:border-box;padding:var(--ui-space-3);background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3)}:host(:not([data-open])){display:none}:host([popover]){position:fixed;inset:auto;margin:0;opacity:0;transform:translateY(-4px) scale(0.99);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}:host([popover]:popover-open){opacity:1;transform:translateY(0) scale(1)}@starting-style{:host([popover]:popover-open){opacity:0;transform:translateY(-4px) scale(0.99)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host([popover]){transition:none}}`;
7
8
 
8
9
  const UIPopover = class {
9
10
  constructor(hostRef) {
10
11
  registerInstance(this, hostRef);
11
12
  }
12
13
  get host() { return getElement(this); }
13
- open = false;
14
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
15
+ open;
14
16
  defaultOpen = false;
15
17
  /** Optional id of the element this popover follows in the top layer. */
16
18
  for;
@@ -20,7 +22,8 @@ const UIPopover = class {
20
22
  anchor = null;
21
23
  surface = null;
22
24
  syncFromProp() {
23
- this.internalOpen = this.open;
25
+ if (isControlled(this.open))
26
+ this.internalOpen = this.open;
24
27
  }
25
28
  onOpenChange() {
26
29
  this.syncOverlay();
@@ -79,8 +82,7 @@ const UIPopover = class {
79
82
  }
80
83
  }
81
84
  componentDidLoad() {
82
- this.syncFromProp();
83
- this.internalOpen = this.internalOpen || this.defaultOpen;
85
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
84
86
  this.host.addEventListener('keydown', this.onKeydown);
85
87
  this.setupSurface();
86
88
  this.syncOverlay();
@@ -95,7 +97,8 @@ const UIPopover = class {
95
97
  this.syncOverlay();
96
98
  }
97
99
  handleRequestClose(reason, trigger) {
98
- this.internalOpen = false;
100
+ if (!isControlled(this.open))
101
+ this.internalOpen = false;
99
102
  dispatchDetail(this.host, 'close', {
100
103
  open: false,
101
104
  reason: reason,
@@ -108,7 +111,7 @@ const UIPopover = class {
108
111
  }
109
112
  };
110
113
  render() {
111
- return (h(Host, { key: 'cd957cb9fd5d1c05da7729a16d4cb229bc1deffa', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: 'd14960a1471948120f7173e18adae8d86e4fabb7' })));
114
+ return (h(Host, { key: 'a4986ace0f3c586774a549cb844287b28ccd0531', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("div", { key: '8f2c589916d06138ef72bfe0d039893b3c59a7cc', class: "popover__surface" }, h("slot", { key: 'ee70e7dcc53a99b5c80e56862a6eb00edcfcf912' }))));
112
115
  }
113
116
  static get watchers() { return {
114
117
  "open": [{
@@ -107,7 +107,7 @@ const UIRadioGroup = class {
107
107
  }
108
108
  };
109
109
  render() {
110
- return (h(Host, { key: 'e80e01600d499d1b8e3410060433dac2bb8cf38a', role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'e60dcfa1b174b1a4c9092567e6ec4d9f5bcd9ffe' })));
110
+ return (h(Host, { key: '1882ad7c092c6a138eab2a52c19beb9a950a8d5a', role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'd5abade3d23963410cfbac17e80aa16dd21ccc6e' })));
111
111
  }
112
112
  static get watchers() { return {
113
113
  "value": [{