@threadlabs/looma 0.1.22 → 0.1.24

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 (326) hide show
  1. package/dist/chunk-HNFCGIBP.js +8 -0
  2. package/dist/{chunk-NIPNHZ5W.js → chunk-IMHSPETJ.js} +65 -31
  3. package/dist/chunk-NB6DBRXQ.js +323 -0
  4. package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
  5. package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
  6. package/dist/cjs/icons-BAdjrnhS.js +680 -0
  7. package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/looma.cjs.js +2 -2
  10. package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
  11. package/dist/cjs/ui-affordance-scope.cjs.entry.js +2 -2
  12. package/dist/cjs/ui-avatar-group.cjs.entry.js +10 -18
  13. package/dist/cjs/ui-avatar.cjs.entry.js +3 -3
  14. package/dist/cjs/ui-badge.cjs.entry.js +3 -3
  15. package/dist/cjs/ui-button.cjs.entry.js +16 -5
  16. package/dist/cjs/ui-callout.cjs.entry.js +27 -0
  17. package/dist/cjs/ui-checkbox.cjs.entry.js +14 -8
  18. package/dist/cjs/ui-chip.cjs.entry.js +19 -0
  19. package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
  20. package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
  21. package/dist/cjs/ui-dialog.cjs.entry.js +46 -10
  22. package/dist/cjs/ui-disclosure.cjs.entry.js +10 -7
  23. package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
  24. package/dist/cjs/ui-form-field.cjs.entry.js +61 -6
  25. package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
  26. package/dist/cjs/ui-input.cjs.entry.js +11 -6
  27. package/dist/cjs/ui-menu-item.cjs.entry.js +3 -3
  28. package/dist/cjs/ui-menu.cjs.entry.js +16 -11
  29. package/dist/cjs/ui-popover.cjs.entry.js +12 -9
  30. package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
  31. package/dist/cjs/ui-radio.cjs.entry.js +18 -9
  32. package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
  33. package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
  34. package/dist/cjs/ui-select.cjs.entry.js +15 -7
  35. package/dist/cjs/ui-switch.cjs.entry.js +20 -11
  36. package/dist/cjs/ui-tabs.cjs.entry.js +11 -10
  37. package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
  38. package/dist/cjs/ui-toast-region.cjs.entry.js +31 -20
  39. package/dist/cjs/ui-tooltip.cjs.entry.js +63 -23
  40. package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
  41. package/dist/cjs/ui-tree-item.cjs.entry.js +57 -616
  42. package/dist/cjs/ui-tree.cjs.entry.js +198 -14
  43. package/dist/collection/collection-manifest.json +3 -0
  44. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
  45. package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
  46. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  47. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
  48. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
  49. package/dist/collection/components/ui-badge/ui-badge.css +64 -48
  50. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  51. package/dist/collection/components/ui-button/ui-button.css +36 -26
  52. package/dist/collection/components/ui-button/ui-button.js +14 -3
  53. package/dist/collection/components/ui-callout/ui-callout.css +74 -0
  54. package/dist/collection/components/ui-callout/ui-callout.js +59 -0
  55. package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
  56. package/dist/collection/components/ui-chip/ui-chip.css +43 -0
  57. package/dist/collection/components/ui-chip/ui-chip.js +45 -0
  58. package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
  59. package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
  60. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  61. package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
  62. package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
  63. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  64. package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
  65. package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
  66. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  67. package/dist/collection/components/ui-input/ui-input.css +8 -6
  68. package/dist/collection/components/ui-input/ui-input.js +11 -7
  69. package/dist/collection/components/ui-menu/ui-menu.css +12 -23
  70. package/dist/collection/components/ui-menu/ui-menu.js +16 -12
  71. package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
  72. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  73. package/dist/collection/components/ui-popover/ui-popover.css +14 -5
  74. package/dist/collection/components/ui-popover/ui-popover.js +12 -10
  75. package/dist/collection/components/ui-radio/ui-radio.js +25 -12
  76. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  77. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  78. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  79. package/dist/collection/components/ui-select/ui-select.css +8 -6
  80. package/dist/collection/components/ui-select/ui-select.js +17 -11
  81. package/dist/collection/components/ui-switch/ui-switch.js +22 -14
  82. package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
  83. package/dist/collection/components/ui-textarea/ui-textarea.css +7 -6
  84. package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
  85. package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
  86. package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
  87. package/dist/collection/components/ui-tooltip/ui-tooltip.js +115 -25
  88. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  89. package/dist/collection/components/ui-tree/ui-tree.css +2 -1
  90. package/dist/collection/components/ui-tree/ui-tree.js +216 -12
  91. package/dist/collection/components/ui-tree-item/ui-tree-item.js +84 -25
  92. package/dist/collection/field/combobox.js +4 -0
  93. package/dist/collection/field/valibot.js +5 -0
  94. package/dist/collection/field/validation.js +62 -0
  95. package/dist/collection/icons.js +6 -1
  96. package/dist/collection/overlay/manager.js +6 -7
  97. package/dist/collection/utils/controlled-state.js +4 -0
  98. package/dist/components/index.d.ts +6 -0
  99. package/dist/components/index.js +1 -1
  100. package/dist/components/p-Bh_1GxOD.js +1 -0
  101. package/dist/components/p-Bk55QiUK.js +1 -0
  102. package/dist/components/p-BnGhGgTH.js +1 -0
  103. package/dist/components/p-C-0syqXZ.js +1 -0
  104. package/dist/components/p-CoFximGM.js +13 -0
  105. package/dist/components/p-DIGcRYAW.js +1 -0
  106. package/dist/components/ui-affordance-scope.js +1 -1
  107. package/dist/components/ui-avatar-group.js +1 -1
  108. package/dist/components/ui-avatar.js +1 -1
  109. package/dist/components/ui-badge.js +1 -1
  110. package/dist/components/ui-button.js +1 -1
  111. package/dist/components/ui-callout.d.ts +11 -0
  112. package/dist/components/ui-callout.js +1 -0
  113. package/dist/components/ui-checkbox.js +1 -1
  114. package/dist/components/ui-chip.d.ts +11 -0
  115. package/dist/components/ui-chip.js +1 -0
  116. package/dist/components/ui-combobox.d.ts +11 -0
  117. package/dist/components/ui-combobox.js +1 -0
  118. package/dist/components/ui-context-menu.js +1 -1
  119. package/dist/components/ui-dialog.js +1 -1
  120. package/dist/components/ui-disclosure.js +1 -1
  121. package/dist/components/ui-floating-action-button.js +1 -1
  122. package/dist/components/ui-form-field.js +1 -1
  123. package/dist/components/ui-icon-button.js +1 -1
  124. package/dist/components/ui-input.js +1 -1
  125. package/dist/components/ui-menu-item.js +1 -1
  126. package/dist/components/ui-menu.js +1 -1
  127. package/dist/components/ui-popover.js +1 -1
  128. package/dist/components/ui-radio-group.js +1 -1
  129. package/dist/components/ui-radio.js +1 -1
  130. package/dist/components/ui-search-result-row.js +1 -1
  131. package/dist/components/ui-search-shell.js +1 -1
  132. package/dist/components/ui-select.js +1 -1
  133. package/dist/components/ui-switch.js +1 -1
  134. package/dist/components/ui-tabs.js +1 -1
  135. package/dist/components/ui-textarea.js +1 -1
  136. package/dist/components/ui-toast-region.js +1 -1
  137. package/dist/components/ui-tooltip.js +1 -1
  138. package/dist/components/ui-top-bar.js +1 -1
  139. package/dist/components/ui-tree-item.js +1 -13
  140. package/dist/components/ui-tree.js +1 -1
  141. package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
  142. package/dist/esm/icons-CoFximGM.js +678 -0
  143. package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
  144. package/dist/esm/loader.js +3 -3
  145. package/dist/esm/looma.js +3 -3
  146. package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
  147. package/dist/esm/ui-affordance-scope.entry.js +2 -2
  148. package/dist/esm/ui-avatar-group.entry.js +10 -18
  149. package/dist/esm/ui-avatar.entry.js +3 -3
  150. package/dist/esm/ui-badge.entry.js +3 -3
  151. package/dist/esm/ui-button.entry.js +16 -5
  152. package/dist/esm/ui-callout.entry.js +25 -0
  153. package/dist/esm/ui-checkbox.entry.js +14 -8
  154. package/dist/esm/ui-chip.entry.js +17 -0
  155. package/dist/esm/ui-combobox.entry.js +539 -0
  156. package/dist/esm/ui-context-menu.entry.js +3 -3
  157. package/dist/esm/ui-dialog.entry.js +46 -10
  158. package/dist/esm/ui-disclosure.entry.js +10 -7
  159. package/dist/esm/ui-floating-action-button.entry.js +2 -2
  160. package/dist/esm/ui-form-field.entry.js +61 -6
  161. package/dist/esm/ui-icon-button.entry.js +2 -2
  162. package/dist/esm/ui-input.entry.js +11 -6
  163. package/dist/esm/ui-menu-item.entry.js +3 -3
  164. package/dist/esm/ui-menu.entry.js +16 -11
  165. package/dist/esm/ui-popover.entry.js +12 -9
  166. package/dist/esm/ui-radio-group.entry.js +2 -2
  167. package/dist/esm/ui-radio.entry.js +18 -9
  168. package/dist/esm/ui-search-result-row.entry.js +2 -2
  169. package/dist/esm/ui-search-shell.entry.js +2 -2
  170. package/dist/esm/ui-select.entry.js +15 -7
  171. package/dist/esm/ui-switch.entry.js +20 -11
  172. package/dist/esm/ui-tabs.entry.js +11 -10
  173. package/dist/esm/ui-textarea.entry.js +10 -6
  174. package/dist/esm/ui-toast-region.entry.js +31 -20
  175. package/dist/esm/ui-tooltip.entry.js +63 -23
  176. package/dist/esm/ui-top-bar.entry.js +2 -2
  177. package/dist/esm/ui-tree-item.entry.js +57 -616
  178. package/dist/esm/ui-tree.entry.js +198 -14
  179. package/dist/index.cjs +2012 -870
  180. package/dist/index.d.cts +109 -1
  181. package/dist/index.d.ts +109 -1
  182. package/dist/index.js +72 -8
  183. package/dist/looma/looma.esm.js +1 -1
  184. package/dist/looma/p-03f44c45.entry.js +1 -0
  185. package/dist/looma/p-08f80207.entry.js +1 -0
  186. package/dist/looma/p-13f8195a.entry.js +1 -0
  187. package/dist/looma/{p-d273b857.entry.js → p-25e18ad6.entry.js} +1 -1
  188. package/dist/looma/p-2c03fa73.entry.js +1 -0
  189. package/dist/looma/p-314d5c7c.entry.js +1 -0
  190. package/dist/looma/{p-2ed7e241.entry.js → p-3ef2a21b.entry.js} +1 -1
  191. package/dist/looma/{p-063f5a89.entry.js → p-5a900d89.entry.js} +1 -1
  192. package/dist/looma/p-5fdcee1d.entry.js +1 -0
  193. package/dist/looma/{p-0198bb21.entry.js → p-672e3d16.entry.js} +1 -1
  194. package/dist/looma/p-68430534.entry.js +1 -0
  195. package/dist/looma/{p-2e6f791e.entry.js → p-72338f53.entry.js} +1 -1
  196. package/dist/looma/p-7ab661ec.entry.js +1 -0
  197. package/dist/looma/p-7c4a225f.entry.js +1 -0
  198. package/dist/looma/p-82f2fa3d.entry.js +1 -0
  199. package/dist/looma/p-839faf55.entry.js +1 -0
  200. package/dist/looma/p-8BGiMGQ0.js +2 -0
  201. package/dist/looma/p-8e254bc4.entry.js +1 -0
  202. package/dist/looma/p-8e6b1001.entry.js +1 -0
  203. package/dist/looma/p-920656cf.entry.js +1 -0
  204. package/dist/looma/p-97e8cb0e.entry.js +1 -0
  205. package/dist/looma/p-9d2662ca.entry.js +1 -0
  206. package/dist/looma/p-9e1c4020.entry.js +1 -0
  207. package/dist/looma/p-BnGhGgTH.js +1 -0
  208. package/dist/looma/p-C-0syqXZ.js +1 -0
  209. package/dist/looma/p-CoFximGM.js +13 -0
  210. package/dist/looma/{p-051f578c.entry.js → p-a63e2561.entry.js} +1 -1
  211. package/dist/looma/p-add67e4c.entry.js +1 -0
  212. package/dist/looma/p-b63f6d4f.entry.js +1 -0
  213. package/dist/looma/p-bd00d4e8.entry.js +1 -0
  214. package/dist/looma/p-cc915913.entry.js +1 -0
  215. package/dist/looma/p-cfba8f7c.entry.js +1 -0
  216. package/dist/looma/p-d56571a2.entry.js +1 -0
  217. package/dist/looma/{p-7e94d90d.entry.js → p-e0f241ab.entry.js} +1 -1
  218. package/dist/looma/p-f1750fd7.entry.js +1 -0
  219. package/dist/looma/p-fd1e4d22.entry.js +1 -0
  220. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
  221. package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
  222. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
  223. package/dist/types/components/ui-chip/ui-chip.d.ts +6 -0
  224. package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
  225. package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
  226. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
  227. package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
  228. package/dist/types/components/ui-input/ui-input.d.ts +1 -1
  229. package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
  230. package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
  231. package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
  232. package/dist/types/components/ui-select/ui-select.d.ts +3 -2
  233. package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
  234. package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
  235. package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
  236. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
  237. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +20 -2
  238. package/dist/types/components/ui-tree/ui-tree.d.ts +21 -1
  239. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +13 -5
  240. package/dist/types/components.d.ts +366 -71
  241. package/dist/types/field/combobox.d.ts +46 -0
  242. package/dist/types/field/valibot.d.ts +7 -0
  243. package/dist/types/field/validation.d.ts +56 -0
  244. package/dist/types/icons.d.ts +5 -0
  245. package/dist/types/utils/controlled-state.d.ts +4 -0
  246. package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-3TUZ6GLW.js} +2 -2
  247. package/dist/ui-avatar-group.entry-XGJKN25W.js +51 -0
  248. package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-SN3G44HW.js} +3 -3
  249. package/dist/ui-badge.entry-B6WDCWJX.js +22 -0
  250. package/dist/ui-button.entry-AZYUELLV.js +80 -0
  251. package/dist/ui-callout.entry-QRPWRMPC.js +32 -0
  252. package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-OB6GFC4M.js} +17 -8
  253. package/dist/ui-chip.entry-XSNPJXX3.js +22 -0
  254. package/dist/ui-combobox.entry-IIMMUJF7.js +553 -0
  255. package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-AIULIE5Y.js} +3 -3
  256. package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-QSYWYHLY.js} +48 -10
  257. package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-3BJEYU3U.js} +13 -7
  258. package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-JEVNV6FI.js} +2 -2
  259. package/dist/ui-form-field.entry-PKSY7UU4.js +120 -0
  260. package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-TPX7BE7R.js} +2 -2
  261. package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-6NCLNW4E.js} +8 -6
  262. package/dist/ui-menu-item.entry-KA2K3PKV.js +22 -0
  263. package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-7GDO5L2T.js} +19 -11
  264. package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-FR6YRNK6.js} +15 -9
  265. package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-7QHXQSNO.js} +2 -2
  266. package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-YNMXKLDW.js} +21 -9
  267. package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-AHVVAAIO.js} +2 -2
  268. package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-CNBEAMEZ.js} +2 -2
  269. package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-TUY6TCTC.js} +13 -7
  270. package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-26LFI7B5.js} +23 -11
  271. package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-LXB62RJJ.js} +14 -10
  272. package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-JYGMGPX2.js} +8 -6
  273. package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-TOW4KZLZ.js} +29 -20
  274. package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-SKFNYXPH.js} +68 -25
  275. package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-S3YP52EA.js} +2 -2
  276. package/dist/ui-tree-item.entry-LWYIPYLC.js +145 -0
  277. package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-LXKUQFRU.js} +184 -13
  278. package/dist/valibot.d.ts +52 -0
  279. package/dist/valibot.js +7 -0
  280. package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
  281. package/editor/extensions/index.d.ts +14 -6
  282. package/editor/extensions/index.js +1 -1
  283. package/editor/index.js +1 -1
  284. package/editor.css +37 -20
  285. package/package.json +11 -3
  286. package/styles.css +46 -20
  287. package/theme-high-contrast.css +12 -0
  288. package/tokens.css +26 -0
  289. package/vue/{chunk-5KWCMTXB.js → chunk-D4AJULDE.js} +116 -17
  290. package/vue/editor/index.d.ts +5 -15
  291. package/vue/editor/index.js +1 -1
  292. package/vue/index.d.ts +447 -115
  293. package/vue/index.js +7 -1
  294. package/dist/components/p-CEYIKqYc.js +0 -1
  295. package/dist/components/p-CIA4RyEp.js +0 -1
  296. package/dist/components/p-PM9a74r7.js +0 -1
  297. package/dist/looma/p-0584a051.entry.js +0 -1
  298. package/dist/looma/p-078f9fb8.entry.js +0 -1
  299. package/dist/looma/p-0f45c5f0.entry.js +0 -1
  300. package/dist/looma/p-11083743.entry.js +0 -1
  301. package/dist/looma/p-1674cda4.entry.js +0 -1
  302. package/dist/looma/p-1681b218.entry.js +0 -1
  303. package/dist/looma/p-34417499.entry.js +0 -1
  304. package/dist/looma/p-4b422d40.entry.js +0 -1
  305. package/dist/looma/p-54722713.entry.js +0 -13
  306. package/dist/looma/p-54c41576.entry.js +0 -1
  307. package/dist/looma/p-5ba9d496.entry.js +0 -1
  308. package/dist/looma/p-5d4713a6.entry.js +0 -1
  309. package/dist/looma/p-624ba086.entry.js +0 -1
  310. package/dist/looma/p-8d5adb17.entry.js +0 -1
  311. package/dist/looma/p-9194a99d.entry.js +0 -1
  312. package/dist/looma/p-CEeiinfk.js +0 -2
  313. package/dist/looma/p-PM9a74r7.js +0 -1
  314. package/dist/looma/p-a33522a2.entry.js +0 -1
  315. package/dist/looma/p-a5127c7d.entry.js +0 -1
  316. package/dist/looma/p-a9f46811.entry.js +0 -1
  317. package/dist/looma/p-b7aa4488.entry.js +0 -1
  318. package/dist/looma/p-caa8fc7b.entry.js +0 -1
  319. package/dist/looma/p-e3f99a24.entry.js +0 -1
  320. package/dist/looma/p-ed5abf6d.entry.js +0 -1
  321. package/dist/ui-avatar-group.entry-BWS7E2CM.js +0 -59
  322. package/dist/ui-badge.entry-2WOBVOYP.js +0 -22
  323. package/dist/ui-button.entry-VCGSEONK.js +0 -71
  324. package/dist/ui-form-field.entry-SJ6NNFXB.js +0 -67
  325. package/dist/ui-menu-item.entry-V3HIMR75.js +0 -22
  326. package/dist/ui-tree-item.entry-45RR3CMP.js +0 -385
@@ -212,7 +212,7 @@ export class UIContextMenu {
212
212
  this.closeMenu('action', 'pointer');
213
213
  };
214
214
  render() {
215
- return (h(Host, { key: '4db0d5b55ead41925aa682b1e383b5735b49bf56', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, h("slot", { key: '462925d53db169c13e485789ae91e28b0abd3e40', name: "trigger" }), h("div", { key: 'cac8f3b11c4872d38e976f210ce9a43fd854b335', class: "menu", "data-open": this.internalOpen ? '' : undefined }, h("ui-menu", { key: 'ba50f74e11466da2240f7568479d5d10a614b394', open: this.internalOpen }, h("slot", { key: '1fcb45bf124e2377ac6c7fc236d2babf0d9e3bae' })))));
215
+ return (h(Host, { key: '5d927f41a72e680ad6d6d4a3fa0c913360cb8660', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, h("slot", { key: 'e5b1ec05d96093671fb839e3b81ddefb730575e1', name: "trigger" }), h("div", { key: 'a0c4a8ca50bcca2b7d3ee53b4c26db054af93151', class: "menu", "data-open": this.internalOpen ? '' : undefined }, h("ui-menu", { key: 'ac03b9dc3fa56d0cbb28115060726de4500a668b', open: this.internalOpen }, h("slot", { key: 'f2d8484cb9fb3956a3a5979795633a74d423577d' })))));
216
216
  }
217
217
  static get is() { return "ui-context-menu"; }
218
218
  static get encapsulation() { return "shadow"; }
@@ -1,19 +1,30 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { openOverlay, closeOverlay, requestTopOverlayClose } from "../../overlay/manager";
3
3
  import { dispatchDetail } from "../../utils/events";
4
+ import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
4
5
  export class UIDialog {
5
6
  host;
6
- open = false;
7
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
8
+ open;
7
9
  defaultOpen = false;
8
10
  modal = true;
9
11
  dismissible = true;
10
12
  /** Accessible name forwarded to the native dialog surface. */
11
13
  label;
12
14
  internalOpen = false;
15
+ accessibleLabel = 'Dialog';
13
16
  overlayId = `ui-dialog-${Math.random().toString(36).slice(2, 11)}`;
14
17
  dialogRef;
18
+ contentObserver = null;
15
19
  syncFromProp() {
16
- this.internalOpen = this.open;
20
+ if (isControlled(this.open))
21
+ this.internalOpen = this.open;
22
+ }
23
+ syncLabelFromProp() {
24
+ this.syncAccessibleLabel();
25
+ }
26
+ componentWillLoad() {
27
+ this.syncAccessibleLabel();
17
28
  }
18
29
  syncOpen() {
19
30
  if (this.dialogRef) {
@@ -34,20 +45,29 @@ export class UIDialog {
34
45
  }
35
46
  }
36
47
  componentDidLoad() {
37
- this.syncFromProp();
38
- this.internalOpen = this.internalOpen || this.defaultOpen;
48
+ this.contentObserver = new MutationObserver(this.syncAccessibleLabel);
49
+ this.contentObserver.observe(this.host, {
50
+ childList: true,
51
+ subtree: true,
52
+ characterData: true,
53
+ });
54
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
39
55
  this.dialogRef?.addEventListener('close', this.onDialogClose);
56
+ this.syncAccessibleLabel();
40
57
  this.syncOpen();
41
58
  }
42
59
  disconnectedCallback() {
43
60
  this.dialogRef?.removeEventListener('close', this.onDialogClose);
61
+ this.contentObserver?.disconnect();
62
+ this.contentObserver = null;
44
63
  closeOverlay(this.overlayId);
45
64
  }
46
65
  componentDidUpdate() {
47
66
  this.syncOpen();
48
67
  }
49
68
  handleRequestClose(reason, trigger) {
50
- this.internalOpen = false;
69
+ if (!isControlled(this.open))
70
+ this.internalOpen = false;
51
71
  dispatchDetail(this.host, 'close', {
52
72
  open: false,
53
73
  reason: reason,
@@ -56,8 +76,13 @@ export class UIDialog {
56
76
  }
57
77
  onDialogClose = () => {
58
78
  if (this.internalOpen) {
59
- this.internalOpen = false;
60
- closeOverlay(this.overlayId);
79
+ if (!isControlled(this.open)) {
80
+ this.internalOpen = false;
81
+ closeOverlay(this.overlayId);
82
+ }
83
+ else {
84
+ requestAnimationFrame(() => this.syncOpen());
85
+ }
61
86
  dispatchDetail(this.host, 'close', {
62
87
  open: false,
63
88
  reason: 'programmatic',
@@ -70,8 +95,16 @@ export class UIDialog {
70
95
  requestTopOverlayClose('escape', 'keyboard');
71
96
  }
72
97
  };
98
+ syncAccessibleLabel = () => {
99
+ const explicitLabel = this.label?.trim();
100
+ const heading = this.host.querySelector('[slot="heading"], [data-ui-dialog-title], h1, h2, h3, h4, h5, h6');
101
+ const headingLabel = heading?.textContent?.trim();
102
+ const nextLabel = explicitLabel || headingLabel || 'Dialog';
103
+ if (this.accessibleLabel !== nextLabel)
104
+ this.accessibleLabel = nextLabel;
105
+ };
73
106
  render() {
74
- return (h(Host, { key: 'c10f9063a1c2677caff3b8d1f26b37bf25978a77', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("dialog", { key: 'a7111bd363cab94f394cca526bf34ea8081e5228', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.label }, h("slot", { key: 'b0a9699fe0be09e331cfea81b6bbeaec11d48956' }))));
107
+ return (h(Host, { key: 'b7aa33e24a74527a58718b3fa2218f5a09e9e439', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("dialog", { key: 'f24455edc404581b5040c9c0090bf64141f9e296', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.accessibleLabel }, h("slot", { key: 'bad318e44b9c80dc0aae04ea5cdbb7b2ab472c35' }))));
75
108
  }
76
109
  static get is() { return "ui-dialog"; }
77
110
  static get encapsulation() { return "shadow"; }
@@ -96,16 +129,15 @@ export class UIDialog {
96
129
  "references": {}
97
130
  },
98
131
  "required": false,
99
- "optional": false,
132
+ "optional": true,
100
133
  "docs": {
101
134
  "tags": [],
102
- "text": ""
135
+ "text": "Controlled open state. Omit it to use defaultOpen and local interaction state."
103
136
  },
104
137
  "getter": false,
105
138
  "setter": false,
106
139
  "reflect": false,
107
- "attribute": "open",
108
- "defaultValue": "false"
140
+ "attribute": "open"
109
141
  },
110
142
  "defaultOpen": {
111
143
  "type": "boolean",
@@ -190,7 +222,8 @@ export class UIDialog {
190
222
  }
191
223
  static get states() {
192
224
  return {
193
- "internalOpen": {}
225
+ "internalOpen": {},
226
+ "accessibleLabel": {}
194
227
  };
195
228
  }
196
229
  static get elementRef() { return "host"; }
@@ -198,6 +231,9 @@ export class UIDialog {
198
231
  return [{
199
232
  "propName": "open",
200
233
  "methodName": "syncFromProp"
234
+ }, {
235
+ "propName": "label",
236
+ "methodName": "syncLabelFromProp"
201
237
  }, {
202
238
  "propName": "internalOpen",
203
239
  "methodName": "syncOpen"
@@ -1,9 +1,11 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { createId } from "../../utils/id";
3
3
  import { eventToTrigger, isActivationKey, dispatchDetail } from "../../utils/events";
4
+ import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
4
5
  export class UIDisclosure {
5
6
  host;
6
- open = false;
7
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
8
+ open;
7
9
  defaultOpen = false;
8
10
  disabled = false;
9
11
  internalOpen = false;
@@ -11,7 +13,8 @@ export class UIDisclosure {
11
13
  trigger = null;
12
14
  content = null;
13
15
  syncFromProp() {
14
- this.internalOpen = this.open;
16
+ if (isControlled(this.open))
17
+ this.internalOpen = this.open;
15
18
  }
16
19
  syncState() {
17
20
  if (this.trigger) {
@@ -23,8 +26,7 @@ export class UIDisclosure {
23
26
  }
24
27
  componentDidLoad() {
25
28
  this.resolveParts();
26
- this.syncFromProp();
27
- this.internalOpen = this.internalOpen || this.defaultOpen;
29
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
28
30
  this.syncState();
29
31
  this.trigger?.addEventListener('click', this.onTriggerClick);
30
32
  this.trigger?.addEventListener('keydown', this.onTriggerKeydown);
@@ -64,7 +66,8 @@ export class UIDisclosure {
64
66
  setOpen(next, action) {
65
67
  if (this.internalOpen === next)
66
68
  return;
67
- this.internalOpen = next;
69
+ if (!isControlled(this.open))
70
+ this.internalOpen = next;
68
71
  dispatchDetail(this.host, next ? 'open' : 'close', {
69
72
  open: next,
70
73
  reason: action.reason,
@@ -85,7 +88,7 @@ export class UIDisclosure {
85
88
  this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
86
89
  };
87
90
  render() {
88
- return (h(Host, { key: '7fbc83614f8e988a43d1baac0379a6dc8826b1d5' }, h("slot", { key: '6ef33ca7bce5c4d83ab65642f52a9d17febb794d' })));
91
+ return (h(Host, { key: '55a6fd71965104b96b55fd53870becce748a4116' }, h("slot", { key: '542727e10d335ff44fc7cf8250e80f045f89b8f2' })));
89
92
  }
90
93
  static get is() { return "ui-disclosure"; }
91
94
  static get encapsulation() { return "shadow"; }
@@ -110,16 +113,15 @@ export class UIDisclosure {
110
113
  "references": {}
111
114
  },
112
115
  "required": false,
113
- "optional": false,
116
+ "optional": true,
114
117
  "docs": {
115
118
  "tags": [],
116
- "text": ""
119
+ "text": "Controlled open state. Omit it to use defaultOpen and local interaction state."
117
120
  },
118
121
  "getter": false,
119
122
  "setter": false,
120
123
  "reflect": false,
121
- "attribute": "open",
122
- "defaultValue": "false"
124
+ "attribute": "open"
123
125
  },
124
126
  "defaultOpen": {
125
127
  "type": "boolean",
@@ -4,7 +4,7 @@ export class UIFloatingActionButton {
4
4
  mobileOnly = false;
5
5
  label = '';
6
6
  render() {
7
- return (h(Host, { key: '6f67f3967cf8883005f6c56747db515db5ebe1d0', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: 'deebb9261221c144b30bc3e41790158fc339cd14', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '3b045b69a4508c84dd5b7c8b3df0e6f3eded1c13' }))));
7
+ return (h(Host, { key: 'b41f0aaabbcd23cb79ac06245e69fd8ecb9c9912', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: '36a023bd66d38845f1116874380d7a28bb46b5a2', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '412c41e4732cc230f84e7758bfc7faab7e0802e2' }))));
8
8
  }
9
9
  static get is() { return "ui-floating-action-button"; }
10
10
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,8 @@
1
1
  :host {
2
2
  display: grid;
3
3
  gap: var(--ui-space-2);
4
+ min-inline-size: 0;
5
+ align-content: start;
4
6
  color: var(--ui-text-primary);
5
7
  }
6
8
 
@@ -10,8 +12,10 @@
10
12
  }
11
13
 
12
14
  ::slotted([data-slot='help']) {
15
+ min-block-size: var(--ui-form-field-help-min-block-size, 0);
13
16
  color: var(--ui-text-muted);
14
17
  font-size: 0.875rem;
18
+ line-height: var(--ui-line-height-md);
15
19
  }
16
20
 
17
21
  ::slotted([data-slot='error']),
@@ -5,17 +5,62 @@ export class UIFormField {
5
5
  invalid = false;
6
6
  disabled = false;
7
7
  required = false;
8
+ observer = null;
9
+ activeInput = null;
10
+ ownedDescriptionIds = new Set();
11
+ wireQueued = false;
8
12
  componentDidLoad() {
13
+ this.observer = new MutationObserver(this.scheduleWire);
14
+ this.observer.observe(this.host, {
15
+ childList: true,
16
+ subtree: true,
17
+ attributes: true,
18
+ attributeFilter: ['aria-describedby', 'data-slot', 'id', 'role'],
19
+ });
9
20
  this.wire();
10
21
  }
11
22
  componentDidUpdate() {
12
- this.wire();
23
+ this.scheduleWire();
24
+ }
25
+ disconnectedCallback() {
26
+ this.observer?.disconnect();
27
+ this.observer = null;
28
+ this.removeOwnedDescriptions(this.activeInput);
29
+ this.activeInput = null;
30
+ this.ownedDescriptionIds.clear();
13
31
  }
32
+ descriptionIds(input) {
33
+ return Array.from(new Set((input.getAttribute('aria-describedby') ?? '').split(/\s+/).filter(Boolean)));
34
+ }
35
+ removeOwnedDescriptions(input) {
36
+ if (!input || this.ownedDescriptionIds.size === 0)
37
+ return;
38
+ const remaining = this.descriptionIds(input)
39
+ .filter(id => !this.ownedDescriptionIds.has(id));
40
+ if (remaining.length > 0)
41
+ input.setAttribute('aria-describedby', remaining.join(' '));
42
+ else
43
+ input.removeAttribute('aria-describedby');
44
+ }
45
+ scheduleWire = () => {
46
+ if (this.wireQueued)
47
+ return;
48
+ this.wireQueued = true;
49
+ queueMicrotask(() => {
50
+ this.wireQueued = false;
51
+ this.wire();
52
+ });
53
+ };
14
54
  wire() {
15
55
  const label = this.host.querySelector('label');
16
56
  const input = this.host.querySelector('input, textarea, select');
17
57
  const help = this.host.querySelector('[data-slot="help"]');
18
58
  const error = this.host.querySelector('[data-slot="error"], [role="alert"]');
59
+ if (input !== this.activeInput) {
60
+ this.removeOwnedDescriptions(this.activeInput);
61
+ this.activeInput = input;
62
+ this.ownedDescriptionIds.clear();
63
+ }
19
64
  if (!input)
20
65
  return;
21
66
  if (!input.id) {
@@ -24,6 +69,9 @@ export class UIFormField {
24
69
  if (label && !label.getAttribute('for')) {
25
70
  label.setAttribute('for', input.id);
26
71
  }
72
+ const previousOwnedIds = this.ownedDescriptionIds;
73
+ const externalIds = this.descriptionIds(input)
74
+ .filter(id => !previousOwnedIds.has(id));
27
75
  const describedIds = [];
28
76
  if (help) {
29
77
  if (!help.id)
@@ -35,15 +83,22 @@ export class UIFormField {
35
83
  error.id = createId('form-field-error');
36
84
  describedIds.push(error.id);
37
85
  }
38
- if (describedIds.length) {
39
- input.setAttribute('aria-describedby', describedIds.join(' '));
86
+ const nextOwnedIds = describedIds.filter(id => !externalIds.includes(id));
87
+ const nextDescribedIds = Array.from(new Set([...externalIds, ...describedIds]));
88
+ const nextDescribedBy = nextDescribedIds.join(' ');
89
+ if (input.getAttribute('aria-describedby') !== nextDescribedBy) {
90
+ if (nextDescribedBy)
91
+ input.setAttribute('aria-describedby', nextDescribedBy);
92
+ else
93
+ input.removeAttribute('aria-describedby');
40
94
  }
95
+ this.ownedDescriptionIds = new Set(nextOwnedIds);
41
96
  input.disabled = this.disabled;
42
97
  input.required = this.required;
43
98
  input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
44
99
  }
45
100
  render() {
46
- return (h(Host, { key: 'c0a01ac28a7dd0e0b285e4b9f9763ef536a83a2e', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: 'b09be4482299d866a0651393e269299dedb0cbf4' })));
101
+ return (h(Host, { key: '0b8fd5608631b5f9159fdf99d6eba918cc6587e4', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: '4ed78782bcc8b6699a40d8402994b486d71d730a', onSlotchange: this.scheduleWire })));
47
102
  }
48
103
  static get is() { return "ui-form-field"; }
49
104
  static get encapsulation() { return "shadow"; }
@@ -7,7 +7,7 @@ export class UIIconButton {
7
7
  /** Reveals this control through a surrounding ui-affordance-scope. */
8
8
  anticipatory = false;
9
9
  render() {
10
- return (h(Host, { key: 'dd6149d96d534a641eedaf808df5348eef48f31f', "data-disabled": this.disabled ? '' : undefined, "data-ui-affordance": this.anticipatory ? 'button' : undefined }, h("button", { key: '3e1b83a3e01b724cb75ddb7243a1e85bd9eb3420', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: 'd280293841471ad37f556c73d86de3223e1f98e6' }))));
10
+ return (h(Host, { key: 'fb4534d977b4812f402855f78176b8316ebace61', "data-disabled": this.disabled ? '' : undefined, "data-ui-affordance": this.anticipatory ? 'button' : undefined }, h("button", { key: 'b90d290870ad76ba18de88a6b6947a15040ff12a', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '88ded6ad90a4cfeffcd687990e5ba8b0c7d3bd30' }))));
11
11
  }
12
12
  static get is() { return "ui-icon-button"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -1,14 +1,16 @@
1
1
  :host {
2
2
  display: inline-flex;
3
+ min-inline-size: 0;
3
4
  color: var(--ui-text-primary);
4
5
  }
5
6
 
6
7
  ::slotted(input) {
7
8
  width: 100%;
8
9
  appearance: none;
9
- border: 1px solid var(--ui-border-default);
10
+ min-block-size: var(--ui-control-min-block-size, 2.75rem);
11
+ border: 1px solid var(--ui-control-border, var(--ui-border-default));
10
12
  border-radius: var(--ui-radius-2);
11
- background: var(--ui-surface-default);
13
+ background: var(--ui-control-surface, var(--ui-surface-default));
12
14
  color: inherit;
13
15
  font: inherit;
14
16
  line-height: var(--ui-line-height-md);
@@ -21,12 +23,12 @@
21
23
  }
22
24
 
23
25
  ::slotted(input:hover:not(:focus):not(:disabled)) {
24
- border-color: var(--ui-border-strong);
26
+ border-color: var(--ui-control-border-hover, var(--ui-border-strong));
25
27
  }
26
28
 
27
29
  ::slotted(input:focus) {
28
- border-color: var(--ui-focus-ring);
29
- box-shadow: 0 0 0 3px var(--ui-accent-soft);
30
+ border-color: var(--ui-control-focus, var(--ui-focus-ring));
31
+ box-shadow: 0 0 0 3px var(--ui-control-focus-halo, var(--ui-accent-soft));
30
32
  }
31
33
 
32
34
  :host([data-invalid='true'])::slotted(input),
@@ -35,7 +37,7 @@
35
37
  }
36
38
 
37
39
  ::slotted(input:disabled) {
38
- background: var(--ui-surface-muted);
40
+ background: var(--ui-control-surface-disabled, var(--ui-surface-muted));
39
41
  color: var(--ui-text-muted);
40
42
  cursor: not-allowed;
41
43
  }
@@ -2,7 +2,7 @@ import { Host, h } from "@stencil/core";
2
2
  import { eventToTrigger, dispatchDetail } from "../../utils/events";
3
3
  export class UIInput {
4
4
  host;
5
- value = '';
5
+ value;
6
6
  defaultValue = '';
7
7
  disabled = false;
8
8
  invalid = false;
@@ -10,14 +10,19 @@ export class UIInput {
10
10
  internalValue = '';
11
11
  slotRef;
12
12
  syncFromProp() {
13
- this.internalValue = this.value;
13
+ if (this.value !== undefined)
14
+ this.internalValue = this.value;
14
15
  }
15
16
  syncToInput() {
16
17
  const input = this.getInput();
17
18
  if (!input)
18
19
  return;
19
20
  this.host.dataset.invalid = this.invalid ? 'true' : '';
20
- input.value = this.internalValue;
21
+ // When the host has no value prop, the slotted native control is
22
+ // intentionally uncontrolled. Frameworks such as Vue can then own its
23
+ // value without Looma resetting it during hydration or unrelated updates.
24
+ if (this.value !== undefined)
25
+ input.value = this.internalValue;
21
26
  input.defaultValue = this.defaultValue;
22
27
  input.disabled = this.disabled;
23
28
  input.readOnly = this.readOnly;
@@ -65,7 +70,7 @@ export class UIInput {
65
70
  });
66
71
  };
67
72
  render() {
68
- return (h(Host, { key: '2b3b4f6862cf5c5e413aaefb349c53d4e66eb6d0', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: '140dc656f13399b8ef05adb6cfa1d9a7e1373c2d', ref: (el) => (this.slotRef = el) })));
73
+ return (h(Host, { key: 'fe125b4e8ec35e9ac0b0ca0434aa8439f515c51b', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: 'ec0609f9143435cf0436abb98488b9f30b71530b', ref: (el) => (this.slotRef = el) })));
69
74
  }
70
75
  static get is() { return "ui-input"; }
71
76
  static get encapsulation() { return "shadow"; }
@@ -90,7 +95,7 @@ export class UIInput {
90
95
  "references": {}
91
96
  },
92
97
  "required": false,
93
- "optional": false,
98
+ "optional": true,
94
99
  "docs": {
95
100
  "tags": [],
96
101
  "text": ""
@@ -98,8 +103,7 @@ export class UIInput {
98
103
  "getter": false,
99
104
  "setter": false,
100
105
  "reflect": false,
101
- "attribute": "value",
102
- "defaultValue": "''"
106
+ "attribute": "value"
103
107
  },
104
108
  "defaultValue": {
105
109
  "type": "string",
@@ -2,14 +2,25 @@
2
2
  --ui-menu-viewport-gap: var(--ui-space-2, 0.5rem);
3
3
  display: flex;
4
4
  flex-direction: column;
5
+ box-sizing: border-box;
5
6
  inline-size: max-content;
6
7
  min-inline-size: min(12rem, calc(100vw - (var(--ui-menu-viewport-gap) * 2)));
7
8
  max-inline-size: calc(100vw - (var(--ui-menu-viewport-gap) * 2));
9
+ padding: 0;
10
+ border: 0;
11
+ border-radius: 0;
12
+ background: transparent;
13
+ box-shadow: var(--ui-shadow-lg);
14
+ }
15
+
16
+ .menu__surface {
17
+ display: flex;
18
+ flex-direction: column;
19
+ box-sizing: border-box;
8
20
  padding: var(--ui-space-1);
9
21
  background: var(--ui-surface-elevated);
10
22
  border: 1px solid var(--ui-border-default);
11
23
  border-radius: var(--ui-radius-3);
12
- box-shadow: var(--ui-shadow-lg);
13
24
  }
14
25
 
15
26
  :host(:not([data-open])) {
@@ -54,26 +65,4 @@
54
65
  ::slotted(ui-menu-item) {
55
66
  display: block;
56
67
  width: 100%;
57
- padding: var(--ui-space-2) var(--ui-space-3);
58
- text-align: left;
59
- background: none;
60
- border: none;
61
- border-radius: var(--ui-radius-2);
62
- color: var(--ui-text-primary);
63
- font-size: var(--ui-font-size-md);
64
- font-weight: var(--ui-font-medium, 500);
65
- cursor: pointer;
66
- transition:
67
- background-color var(--ui-motion-fast) var(--ui-motion-ease),
68
- color var(--ui-motion-fast) var(--ui-motion-ease);
69
- }
70
-
71
- ::slotted(ui-menu-item:hover:not([aria-disabled='true']):not([disabled])) {
72
- background: var(--ui-surface-subtle);
73
- }
74
-
75
- ::slotted(ui-menu-item[aria-disabled='true']),
76
- ::slotted(ui-menu-item[disabled]) {
77
- opacity: 0.6;
78
- cursor: not-allowed;
79
68
  }
@@ -2,10 +2,12 @@ import { Host, h } from "@stencil/core";
2
2
  import { eventToTrigger } from "../../utils/events";
3
3
  import { dispatchDetail } from "../../utils/events";
4
4
  import { closeOverlay, openOverlay, requestTopOverlayClose } from "../../overlay/manager";
5
+ import { controlledOrDefault, isControlled } from "../../utils/controlled-state";
5
6
  import { createAnchoredSurface, } from "../../overlay/positioning";
6
7
  export class UIMenu {
7
8
  host;
8
- open = false;
9
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
10
+ open;
9
11
  defaultOpen = false;
10
12
  /** Id of the control that anchors this menu in the top layer. */
11
13
  for;
@@ -16,7 +18,8 @@ export class UIMenu {
16
18
  anchor = null;
17
19
  surface = null;
18
20
  syncFromProp() {
19
- this.internalOpen = this.open;
21
+ if (isControlled(this.open))
22
+ this.internalOpen = this.open;
20
23
  }
21
24
  resetSurface() {
22
25
  this.setupSurface();
@@ -43,8 +46,7 @@ export class UIMenu {
43
46
  }
44
47
  }
45
48
  componentDidLoad() {
46
- this.syncFromProp();
47
- this.internalOpen = this.internalOpen || this.defaultOpen;
49
+ this.internalOpen = controlledOrDefault(this.open, this.defaultOpen);
48
50
  this.host.addEventListener('click', this.onItemClick);
49
51
  this.host.addEventListener('keydown', this.onKeydown);
50
52
  this.setupSurface();
@@ -77,7 +79,8 @@ export class UIMenu {
77
79
  closeMenu(reason, trigger) {
78
80
  if (!this.internalOpen)
79
81
  return;
80
- this.internalOpen = false;
82
+ if (!isControlled(this.open))
83
+ this.internalOpen = false;
81
84
  dispatchDetail(this.host, 'close', {
82
85
  open: false,
83
86
  reason: reason,
@@ -108,7 +111,8 @@ export class UIMenu {
108
111
  reason: 'action',
109
112
  trigger: eventToTrigger(e),
110
113
  });
111
- this.internalOpen = false;
114
+ if (!isControlled(this.open))
115
+ this.internalOpen = false;
112
116
  };
113
117
  onKeydown = (e) => {
114
118
  if (e.key === 'Escape') {
@@ -131,7 +135,8 @@ export class UIMenu {
131
135
  reason: 'action',
132
136
  trigger: 'keyboard',
133
137
  });
134
- this.internalOpen = false;
138
+ if (!isControlled(this.open))
139
+ this.internalOpen = false;
135
140
  }
136
141
  return;
137
142
  }
@@ -148,7 +153,7 @@ export class UIMenu {
148
153
  }
149
154
  };
150
155
  render() {
151
- return (h(Host, { key: '06ad0750df843cb874bd4f257d8567157c855493', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: '50118ac749a2747ca06f4d483499c4cd20125a89' })));
156
+ return (h(Host, { key: 'c5af7acaf41b75165e9f7cf47d65b7a1dcd4d1c0', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("div", { key: '058fff9a00a1dcba26f6db425096e7a96d889896', class: "menu__surface" }, h("slot", { key: 'dbbf9eb4ba2a348b6d85049e229ed0562ee17318' }))));
152
157
  }
153
158
  static get is() { return "ui-menu"; }
154
159
  static get encapsulation() { return "shadow"; }
@@ -173,16 +178,15 @@ export class UIMenu {
173
178
  "references": {}
174
179
  },
175
180
  "required": false,
176
- "optional": false,
181
+ "optional": true,
177
182
  "docs": {
178
183
  "tags": [],
179
- "text": ""
184
+ "text": "Controlled open state. Omit it to use defaultOpen and local interaction state."
180
185
  },
181
186
  "getter": false,
182
187
  "setter": false,
183
188
  "reflect": false,
184
- "attribute": "open",
185
- "defaultValue": "false"
189
+ "attribute": "open"
186
190
  },
187
191
  "defaultOpen": {
188
192
  "type": "boolean",
@@ -1,6 +1,12 @@
1
1
  :host {
2
2
  display: block;
3
3
  width: 100%;
4
+ }
5
+
6
+ .menu-item__surface {
7
+ display: block;
8
+ box-sizing: border-box;
9
+ width: 100%;
4
10
  padding: var(--ui-space-2) var(--ui-space-3);
5
11
  text-align: left;
6
12
  background: none;
@@ -15,12 +21,12 @@
15
21
  color var(--ui-motion-fast) var(--ui-motion-ease);
16
22
  }
17
23
 
18
- :host(:hover:not([aria-disabled='true']):not([disabled])) {
24
+ :host(:hover:not([aria-disabled='true']):not([disabled])) .menu-item__surface {
19
25
  background: var(--ui-surface-subtle);
20
26
  }
21
27
 
22
- :host([aria-disabled='true']),
23
- :host([disabled]) {
28
+ :host([aria-disabled='true']) .menu-item__surface,
29
+ :host([disabled]) .menu-item__surface {
24
30
  opacity: 0.6;
25
31
  cursor: not-allowed;
26
32
  }
@@ -3,7 +3,7 @@ export class UIMenuItem {
3
3
  disabled = false;
4
4
  value = '';
5
5
  render() {
6
- return (h(Host, { key: 'c0024d4bb84224019121b98a6fec36bfdad00864', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, h("slot", { key: '00eee7c496dfaf71e8ec158606ebc6641e2ef0d8' })));
6
+ return (h(Host, { key: 'f8a1721f8e516af04f901b53c3a66ce1de932608', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, h("span", { key: '6483d0b3ce1be06aed214f626b2d6a2963a44ade', class: "menu-item__surface" }, h("slot", { key: 'db470b1cbb54d56a14d05c0d7f72c43e37f4263e' }))));
7
7
  }
8
8
  static get is() { return "ui-menu-item"; }
9
9
  static get encapsulation() { return "shadow"; }