@threadlabs/looma 0.1.23 → 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 (287) hide show
  1. package/dist/chunk-HNFCGIBP.js +8 -0
  2. package/dist/{chunk-GDMQKT5F.js → chunk-IMHSPETJ.js} +32 -30
  3. package/dist/chunk-NB6DBRXQ.js +323 -0
  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-chip.cjs.entry.js +19 -0
  16. package/dist/cjs/ui-combobox.cjs.entry.js +3 -3
  17. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  18. package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
  19. package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
  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-popover.cjs.entry.js +10 -7
  27. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  28. package/dist/cjs/ui-radio.cjs.entry.js +16 -7
  29. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  30. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  31. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  32. package/dist/cjs/ui-switch.cjs.entry.js +19 -10
  33. package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
  34. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  35. package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
  36. package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
  37. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  38. package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
  39. package/dist/cjs/ui-tree.cjs.entry.js +123 -11
  40. package/dist/collection/collection-manifest.json +2 -0
  41. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
  42. package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
  43. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  44. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
  45. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
  46. package/dist/collection/components/ui-badge/ui-badge.css +64 -48
  47. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  48. package/dist/collection/components/ui-button/ui-button.js +1 -1
  49. package/dist/collection/components/ui-callout/ui-callout.css +74 -0
  50. package/dist/collection/components/ui-callout/ui-callout.js +59 -0
  51. package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
  52. package/dist/collection/components/ui-chip/ui-chip.css +43 -0
  53. package/dist/collection/components/ui-chip/ui-chip.js +45 -0
  54. package/dist/collection/components/ui-combobox/ui-combobox.js +3 -3
  55. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  56. package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
  57. package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
  58. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  59. package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
  60. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  61. package/dist/collection/components/ui-input/ui-input.js +1 -1
  62. package/dist/collection/components/ui-menu/ui-menu.css +12 -23
  63. package/dist/collection/components/ui-menu/ui-menu.js +16 -12
  64. package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
  65. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  66. package/dist/collection/components/ui-popover/ui-popover.css +14 -5
  67. package/dist/collection/components/ui-popover/ui-popover.js +12 -10
  68. package/dist/collection/components/ui-radio/ui-radio.js +24 -11
  69. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  70. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  71. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  72. package/dist/collection/components/ui-select/ui-select.js +1 -1
  73. package/dist/collection/components/ui-switch/ui-switch.js +22 -14
  74. package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
  75. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  76. package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
  77. package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
  78. package/dist/collection/components/ui-tooltip/ui-tooltip.js +14 -11
  79. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  80. package/dist/collection/components/ui-tree/ui-tree.css +2 -1
  81. package/dist/collection/components/ui-tree/ui-tree.js +122 -10
  82. package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
  83. package/dist/collection/icons.js +6 -1
  84. package/dist/collection/utils/controlled-state.js +4 -0
  85. package/dist/components/index.d.ts +4 -0
  86. package/dist/components/index.js +1 -1
  87. package/dist/components/p-Bk55QiUK.js +1 -0
  88. package/dist/components/p-BnGhGgTH.js +1 -0
  89. package/dist/components/p-CoFximGM.js +13 -0
  90. package/dist/components/p-DIGcRYAW.js +1 -0
  91. package/dist/components/ui-affordance-scope.js +1 -1
  92. package/dist/components/ui-avatar-group.js +1 -1
  93. package/dist/components/ui-avatar.js +1 -1
  94. package/dist/components/ui-badge.js +1 -1
  95. package/dist/components/ui-button.js +1 -1
  96. package/dist/components/ui-callout.d.ts +11 -0
  97. package/dist/components/ui-callout.js +1 -0
  98. package/dist/components/ui-checkbox.js +1 -1
  99. package/dist/components/ui-chip.d.ts +11 -0
  100. package/dist/components/ui-chip.js +1 -0
  101. package/dist/components/ui-combobox.js +1 -1
  102. package/dist/components/ui-context-menu.js +1 -1
  103. package/dist/components/ui-dialog.js +1 -1
  104. package/dist/components/ui-disclosure.js +1 -1
  105. package/dist/components/ui-floating-action-button.js +1 -1
  106. package/dist/components/ui-form-field.js +1 -1
  107. package/dist/components/ui-icon-button.js +1 -1
  108. package/dist/components/ui-input.js +1 -1
  109. package/dist/components/ui-menu-item.js +1 -1
  110. package/dist/components/ui-menu.js +1 -1
  111. package/dist/components/ui-popover.js +1 -1
  112. package/dist/components/ui-radio-group.js +1 -1
  113. package/dist/components/ui-radio.js +1 -1
  114. package/dist/components/ui-search-result-row.js +1 -1
  115. package/dist/components/ui-search-shell.js +1 -1
  116. package/dist/components/ui-select.js +1 -1
  117. package/dist/components/ui-switch.js +1 -1
  118. package/dist/components/ui-tabs.js +1 -1
  119. package/dist/components/ui-textarea.js +1 -1
  120. package/dist/components/ui-toast-region.js +1 -1
  121. package/dist/components/ui-tooltip.js +1 -1
  122. package/dist/components/ui-top-bar.js +1 -1
  123. package/dist/components/ui-tree-item.js +1 -13
  124. package/dist/components/ui-tree.js +1 -1
  125. package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
  126. package/dist/esm/icons-CoFximGM.js +678 -0
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/looma.js +1 -1
  129. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  130. package/dist/esm/ui-avatar-group.entry.js +9 -17
  131. package/dist/esm/ui-avatar.entry.js +2 -2
  132. package/dist/esm/ui-badge.entry.js +2 -2
  133. package/dist/esm/ui-button.entry.js +1 -1
  134. package/dist/esm/ui-callout.entry.js +25 -0
  135. package/dist/esm/ui-checkbox.entry.js +13 -7
  136. package/dist/esm/ui-chip.entry.js +17 -0
  137. package/dist/esm/ui-combobox.entry.js +3 -3
  138. package/dist/esm/ui-context-menu.entry.js +1 -1
  139. package/dist/esm/ui-dialog.entry.js +44 -8
  140. package/dist/esm/ui-disclosure.entry.js +9 -6
  141. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  142. package/dist/esm/ui-form-field.entry.js +59 -4
  143. package/dist/esm/ui-icon-button.entry.js +1 -1
  144. package/dist/esm/ui-input.entry.js +1 -1
  145. package/dist/esm/ui-menu-item.entry.js +2 -2
  146. package/dist/esm/ui-menu.entry.js +14 -9
  147. package/dist/esm/ui-popover.entry.js +10 -7
  148. package/dist/esm/ui-radio-group.entry.js +1 -1
  149. package/dist/esm/ui-radio.entry.js +16 -7
  150. package/dist/esm/ui-search-result-row.entry.js +1 -1
  151. package/dist/esm/ui-search-shell.entry.js +1 -1
  152. package/dist/esm/ui-select.entry.js +1 -1
  153. package/dist/esm/ui-switch.entry.js +19 -10
  154. package/dist/esm/ui-tabs.entry.js +10 -9
  155. package/dist/esm/ui-textarea.entry.js +1 -1
  156. package/dist/esm/ui-toast-region.entry.js +30 -19
  157. package/dist/esm/ui-tooltip.entry.js +12 -8
  158. package/dist/esm/ui-top-bar.entry.js +1 -1
  159. package/dist/esm/ui-tree-item.entry.js +54 -617
  160. package/dist/esm/ui-tree.entry.js +123 -11
  161. package/dist/index.cjs +1224 -842
  162. package/dist/index.d.cts +5 -0
  163. package/dist/index.d.ts +5 -0
  164. package/dist/index.js +12 -2
  165. package/dist/looma/looma.esm.js +1 -1
  166. package/dist/looma/p-03f44c45.entry.js +1 -0
  167. package/dist/looma/p-08f80207.entry.js +1 -0
  168. package/dist/looma/{p-f74e5546.entry.js → p-13f8195a.entry.js} +1 -1
  169. package/dist/looma/{p-5a87b59d.entry.js → p-25e18ad6.entry.js} +1 -1
  170. package/dist/looma/p-2c03fa73.entry.js +1 -0
  171. package/dist/looma/{p-ed368426.entry.js → p-314d5c7c.entry.js} +1 -1
  172. package/dist/looma/{p-5da09f47.entry.js → p-3ef2a21b.entry.js} +1 -1
  173. package/dist/looma/{p-f0487ff3.entry.js → p-5a900d89.entry.js} +1 -1
  174. package/dist/looma/p-5fdcee1d.entry.js +1 -0
  175. package/dist/looma/{p-13347631.entry.js → p-672e3d16.entry.js} +1 -1
  176. package/dist/looma/{p-582973b5.entry.js → p-68430534.entry.js} +1 -1
  177. package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
  178. package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
  179. package/dist/looma/p-7c4a225f.entry.js +1 -0
  180. package/dist/looma/p-82f2fa3d.entry.js +1 -0
  181. package/dist/looma/p-839faf55.entry.js +1 -0
  182. package/dist/looma/{p-7e0bb7f6.entry.js → p-8e254bc4.entry.js} +1 -1
  183. package/dist/looma/p-8e6b1001.entry.js +1 -0
  184. package/dist/looma/p-920656cf.entry.js +1 -0
  185. package/dist/looma/{p-40fe7fee.entry.js → p-97e8cb0e.entry.js} +1 -1
  186. package/dist/looma/p-9d2662ca.entry.js +1 -0
  187. package/dist/looma/p-9e1c4020.entry.js +1 -0
  188. package/dist/looma/p-BnGhGgTH.js +1 -0
  189. package/dist/looma/p-CoFximGM.js +13 -0
  190. package/dist/looma/{p-8b8840b8.entry.js → p-a63e2561.entry.js} +1 -1
  191. package/dist/looma/p-add67e4c.entry.js +1 -0
  192. package/dist/looma/p-b63f6d4f.entry.js +1 -0
  193. package/dist/looma/p-bd00d4e8.entry.js +1 -0
  194. package/dist/looma/p-cc915913.entry.js +1 -0
  195. package/dist/looma/p-cfba8f7c.entry.js +1 -0
  196. package/dist/looma/p-d56571a2.entry.js +1 -0
  197. package/dist/looma/{p-69a5557b.entry.js → p-e0f241ab.entry.js} +1 -1
  198. package/dist/looma/p-f1750fd7.entry.js +1 -0
  199. package/dist/looma/p-fd1e4d22.entry.js +1 -0
  200. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
  201. package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
  202. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
  203. package/dist/types/components/ui-chip/ui-chip.d.ts +6 -0
  204. package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
  205. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
  206. package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
  207. package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
  208. package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
  209. package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
  210. package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
  211. package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
  212. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
  213. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +2 -1
  214. package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
  215. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
  216. package/dist/types/components.d.ts +110 -47
  217. package/dist/types/icons.d.ts +5 -0
  218. package/dist/types/utils/controlled-state.d.ts +4 -0
  219. package/dist/{ui-affordance-scope.entry-VO4C2MZX.js → ui-affordance-scope.entry-3TUZ6GLW.js} +2 -2
  220. package/dist/ui-avatar-group.entry-XGJKN25W.js +51 -0
  221. package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-SN3G44HW.js} +3 -3
  222. package/dist/ui-badge.entry-B6WDCWJX.js +22 -0
  223. package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-AZYUELLV.js} +2 -2
  224. package/dist/ui-callout.entry-QRPWRMPC.js +32 -0
  225. package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-OB6GFC4M.js} +17 -8
  226. package/dist/ui-chip.entry-XSNPJXX3.js +22 -0
  227. package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-combobox.entry-IIMMUJF7.js} +5 -5
  228. package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-AIULIE5Y.js} +5 -5
  229. package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-QSYWYHLY.js} +50 -12
  230. package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-3BJEYU3U.js} +13 -7
  231. package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-JEVNV6FI.js} +2 -2
  232. package/dist/ui-form-field.entry-PKSY7UU4.js +120 -0
  233. package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-TPX7BE7R.js} +2 -2
  234. package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-6NCLNW4E.js} +2 -2
  235. package/dist/ui-menu-item.entry-KA2K3PKV.js +22 -0
  236. package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-7GDO5L2T.js} +22 -14
  237. package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-FR6YRNK6.js} +17 -11
  238. package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-7QHXQSNO.js} +2 -2
  239. package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-YNMXKLDW.js} +20 -8
  240. package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-AHVVAAIO.js} +2 -2
  241. package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-CNBEAMEZ.js} +2 -2
  242. package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-TUY6TCTC.js} +2 -2
  243. package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-26LFI7B5.js} +23 -11
  244. package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-LXB62RJJ.js} +14 -10
  245. package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-JYGMGPX2.js} +2 -2
  246. package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-TOW4KZLZ.js} +32 -23
  247. package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-SKFNYXPH.js} +19 -12
  248. package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-S3YP52EA.js} +2 -2
  249. package/dist/ui-tree-item.entry-LWYIPYLC.js +145 -0
  250. package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-LXKUQFRU.js} +114 -12
  251. package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
  252. package/editor/extensions/index.d.ts +14 -6
  253. package/editor/extensions/index.js +1 -1
  254. package/editor/index.js +1 -1
  255. package/editor.css +37 -20
  256. package/package.json +1 -1
  257. package/styles.css +10 -0
  258. package/tokens.css +3 -0
  259. package/vue/{chunk-JLW23USW.js → chunk-D4AJULDE.js} +28 -16
  260. package/vue/editor/index.d.ts +5 -15
  261. package/vue/editor/index.js +1 -1
  262. package/vue/index.d.ts +325 -115
  263. package/vue/index.js +5 -1
  264. package/dist/components/p-CaietZcq.js +0 -1
  265. package/dist/components/p-DHd18bK7.js +0 -1
  266. package/dist/looma/p-14c081cf.entry.js +0 -1
  267. package/dist/looma/p-25366205.entry.js +0 -1
  268. package/dist/looma/p-2e3aa869.entry.js +0 -1
  269. package/dist/looma/p-446cda76.entry.js +0 -1
  270. package/dist/looma/p-4fc1b005.entry.js +0 -13
  271. package/dist/looma/p-6a8a4736.entry.js +0 -1
  272. package/dist/looma/p-6bf4038b.entry.js +0 -1
  273. package/dist/looma/p-8204fee6.entry.js +0 -1
  274. package/dist/looma/p-8238e0dc.entry.js +0 -1
  275. package/dist/looma/p-99d88efb.entry.js +0 -1
  276. package/dist/looma/p-a27669b1.entry.js +0 -1
  277. package/dist/looma/p-a6ee76b7.entry.js +0 -1
  278. package/dist/looma/p-b6398a6b.entry.js +0 -1
  279. package/dist/looma/p-d50faaff.entry.js +0 -1
  280. package/dist/looma/p-d77278ce.entry.js +0 -1
  281. package/dist/looma/p-d9ec13b7.entry.js +0 -1
  282. package/dist/looma/p-ecf8005f.entry.js +0 -1
  283. package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
  284. package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
  285. package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
  286. package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
  287. package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
@@ -12,10 +12,12 @@ const UIToastRegion = class {
12
12
  }
13
13
  get host() { return index.getElement(this); }
14
14
  open = true;
15
- internalOpen = true;
15
+ internalOpen = false;
16
16
  surface = null;
17
+ contentObserver = null;
18
+ pendingDismiss = null;
17
19
  syncFromProp() {
18
- this.internalOpen = this.open;
20
+ this.syncContents();
19
21
  }
20
22
  syncSurface() {
21
23
  if (this.internalOpen)
@@ -25,22 +27,39 @@ const UIToastRegion = class {
25
27
  }
26
28
  componentDidLoad() {
27
29
  this.surface = positioning.createViewportSurface(this.host);
28
- this.syncFromProp();
30
+ this.contentObserver = new MutationObserver(this.syncContents);
31
+ this.contentObserver.observe(this.host, { childList: true, subtree: true });
32
+ this.syncContents();
29
33
  this.syncSurface();
30
34
  this.host.addEventListener('click', this.onClick);
31
35
  }
32
36
  disconnectedCallback() {
33
37
  this.host.removeEventListener('click', this.onClick);
38
+ this.contentObserver?.disconnect();
39
+ this.contentObserver = null;
34
40
  this.surface?.destroy();
35
41
  this.surface = null;
36
42
  }
37
43
  getToasts() {
38
44
  return Array.from(this.host.querySelectorAll('[data-ui-toast]'));
39
45
  }
40
- updateOpenState() {
41
- const toasts = this.getToasts();
42
- this.internalOpen = toasts.length > 0;
43
- }
46
+ syncContents = () => {
47
+ const nextOpen = this.open && this.getToasts().length > 0;
48
+ const wasOpen = this.internalOpen;
49
+ const completedDismiss = this.pendingDismiss && !this.host.contains(this.pendingDismiss.toast)
50
+ ? this.pendingDismiss
51
+ : null;
52
+ this.internalOpen = nextOpen;
53
+ if (wasOpen && !nextOpen && completedDismiss) {
54
+ events.dispatchDetail(this.host, 'close', {
55
+ open: false,
56
+ reason: 'action',
57
+ trigger: completedDismiss.trigger,
58
+ });
59
+ }
60
+ if (completedDismiss || !this.open)
61
+ this.pendingDismiss = null;
62
+ };
44
63
  onClick = (e) => {
45
64
  const dismissBtn = e.target.closest?.('[data-ui-toast-dismiss]');
46
65
  if (!dismissBtn)
@@ -49,24 +68,16 @@ const UIToastRegion = class {
49
68
  if (!toast)
50
69
  return;
51
70
  const id = toast.id ?? '';
52
- toast.setAttribute('aria-hidden', 'true');
53
- toast.remove();
71
+ const trigger = events.eventToTrigger(e);
72
+ this.pendingDismiss = { toast: toast, trigger };
54
73
  events.dispatchDetail(this.host, 'dismiss', {
55
74
  id,
56
75
  reason: 'action',
57
- trigger: events.eventToTrigger(e),
76
+ trigger,
58
77
  });
59
- this.updateOpenState();
60
- if (this.getToasts().length === 0) {
61
- events.dispatchDetail(this.host, 'close', {
62
- open: false,
63
- reason: 'action',
64
- trigger: events.eventToTrigger(e),
65
- });
66
- }
67
78
  };
68
79
  render() {
69
- return (index.h(index.Host, { key: '9ec1cc51ecc4e7a256be5d89a09a10788e46db53', role: "region", "aria-label": "Notifications", "data-open": this.internalOpen ? '' : undefined }, index.h("slot", { key: '7b08656f3745a02f8e9f0935e47d6f2cffd88f9b' })));
80
+ return (index.h(index.Host, { key: 'b4430aceacb7a66202c6a43ad7b0bbe31c51eb94', role: "region", "aria-label": "Notifications", "aria-live": "polite", "data-open": this.internalOpen ? '' : undefined }, index.h("slot", { key: '8bfb02d38366fab29a1668a53b7834ccd1a9aa65' })));
70
81
  }
71
82
  static get watchers() { return {
72
83
  "open": [{
@@ -3,9 +3,10 @@
3
3
  var index = require('./index-BHG9Rpil.js');
4
4
  var manager = require('./manager-Ce25WRtl.js');
5
5
  var events = require('./events-TcQIzpNv.js');
6
+ var controlledState = require('./controlled-state-BFya8rAX.js');
6
7
  var positioning = require('./positioning-i0WrCAdF.js');
7
8
 
8
- const uiTooltipCss = () => `:host{position:fixed;inset:auto;margin:0;display:inline-block;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md);opacity:0;transform:translateY(4px);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-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}`;
9
+ const uiTooltipCss = () => `:host{position:fixed;inset:auto;margin:0;display:inline-block;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent;opacity:0;transform:translateY(4px);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}.tooltip__surface{box-sizing:border-box;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md)}:host(:popover-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}`;
9
10
 
10
11
  const UITooltip = class {
11
12
  constructor(hostRef) {
@@ -15,7 +16,8 @@ const UITooltip = class {
15
16
  }
16
17
  get host() { return index.getElement(this); }
17
18
  for = '';
18
- open = false;
19
+ /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
20
+ open;
19
21
  defaultOpen = false;
20
22
  placement = 'top-start';
21
23
  /** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
@@ -36,7 +38,8 @@ const UITooltip = class {
36
38
  hideTimer = null;
37
39
  syncFromProp() {
38
40
  this.clearTimers();
39
- this.internalOpen = this.open;
41
+ if (controlledState.isControlled(this.open))
42
+ this.internalOpen = this.open;
40
43
  }
41
44
  resetSurface() {
42
45
  this.syncTrigger();
@@ -63,8 +66,7 @@ const UITooltip = class {
63
66
  componentDidLoad() {
64
67
  if (!this.host.id)
65
68
  this.host.id = this.overlayId;
66
- this.syncFromProp();
67
- this.internalOpen = this.internalOpen || this.defaultOpen;
69
+ this.internalOpen = controlledState.controlledOrDefault(this.open, this.defaultOpen);
68
70
  this.syncTrigger();
69
71
  this.setupSurface();
70
72
  this.host.addEventListener('pointerenter', this.onSurfaceEnter);
@@ -149,7 +151,8 @@ const UITooltip = class {
149
151
  setInteractionOpen(nextOpen, trigger) {
150
152
  if (this.internalOpen === nextOpen)
151
153
  return;
152
- this.internalOpen = nextOpen;
154
+ if (!controlledState.isControlled(this.open))
155
+ this.internalOpen = nextOpen;
153
156
  events.dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
154
157
  open: nextOpen,
155
158
  reason: 'action',
@@ -206,7 +209,8 @@ const UITooltip = class {
206
209
  if (reason === 'escape' || (reason === 'light-dismiss' && this.toggleOnClick)) {
207
210
  this.pinned = false;
208
211
  this.clearTimers();
209
- this.internalOpen = false;
212
+ if (!controlledState.isControlled(this.open))
213
+ this.internalOpen = false;
210
214
  events.dispatchDetail(this.host, 'close', {
211
215
  open: false,
212
216
  reason,
@@ -215,7 +219,7 @@ const UITooltip = class {
215
219
  }
216
220
  }
217
221
  render() {
218
- return (index.h(index.Host, { key: 'b0199c23316a707ae3e1e7c361f2838872f62221', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, index.h("slot", { key: 'd0c7822f2f47848a509bf8e310806edbdb320f02' })));
222
+ return (index.h(index.Host, { key: 'ce34c51bc3a9c9f7f31b7f0d329175df0cee1ab3', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, index.h("div", { key: 'e5bb2bcb146fe8ec3b4e9a6abb550961181e3c06', class: "tooltip__surface" }, index.h("slot", { key: 'bdb71bfcb0f72c212cbb5c64fb69510fdded4afb' }))));
219
223
  }
220
224
  static get watchers() { return {
221
225
  "open": [{
@@ -35,7 +35,7 @@ const UITopBar = class {
35
35
  this.hasActions = slotHasContent(this.actionsSlot);
36
36
  };
37
37
  render() {
38
- return (index.h(index.Host, { key: '730e45232ab2b86c2ac99dba773f4ca15d7c3c51' }, index.h("header", { key: 'f94f9b4f3f5930fda950895d2eec01d3ec175479', class: "top-bar", part: "base" }, index.h("div", { key: '038f6a404b0f159b4b826ada73d3c920266354c8', class: "top-bar__leading", hidden: !this.hasLeading }, index.h("slot", { key: '2d415368310c319eca3f3eb9b2c885ef79bb4107', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: 'dfd78b02066a91e9c610e4655a70da704ad65327', class: "top-bar__title" }, index.h("slot", { key: '499e24a864a31f6e400fd02aab4a3f960c87e572' })), index.h("div", { key: '5aa94952996487651dffecd2e351548631fa29b6', class: "top-bar__search", hidden: !this.hasSearch }, index.h("slot", { key: 'eddad95f8acf787ee0cead2a46e7961a06375d5c', name: "search", ref: (el) => (this.searchSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: 'dc69d492aa221a8beb888350bf101f8beeceede9', class: "top-bar__actions", hidden: !this.hasActions }, index.h("slot", { key: '7cde7e062f487da8209738a32415636c7a6b72f0', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.syncSlots })))));
38
+ return (index.h(index.Host, { key: 'b92aa4e03475b3e623212a1e98f45d5532860b51' }, index.h("header", { key: 'a3552708b0e424e762e100ee55fc6bfac4cd830a', class: "top-bar", part: "base" }, index.h("div", { key: '4c8a9e3a04ff23a615bf09e368f4212dd5b38157', class: "top-bar__leading", hidden: !this.hasLeading }, index.h("slot", { key: '64ecc99672b8fd37305810e0776a24bf87ea6f08', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: '37fc003aba2b87f7c8c0e654cd6810d7f231f365', class: "top-bar__title" }, index.h("slot", { key: 'e6c901c15852e83340ca8ad1e264fd5e35445e84' })), index.h("div", { key: '37b1ac319367eeded4182ada401a31e0b9c2555a', class: "top-bar__search", hidden: !this.hasSearch }, index.h("slot", { key: '0a8b5ef500dd843909bb35a1133be548411f3b71', name: "search", ref: (el) => (this.searchSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: '7e5054a3ed6ecfe8d9d8b1b36992843aa0fb62eb', class: "top-bar__actions", hidden: !this.hasActions }, index.h("slot", { key: '19fe59c5ba4da7f0ceda764948f1288bfaa2a41d', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.syncSlots })))));
39
39
  }
40
40
  };
41
41
  UITopBar.style = uiTopBarCss();