@editora/ui-core 0.1.19 → 0.1.21

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 (313) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +30 -29
  48. package/dist/color-picker.cjs.js +10 -10
  49. package/dist/color-picker.esm.js +190 -253
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-collection.d.ts.map +1 -1
  57. package/dist/components/ui-multi-select.d.ts.map +1 -1
  58. package/dist/components/ui-orbiter.d.ts.map +1 -1
  59. package/dist/components/ui-portal.d.ts.map +1 -1
  60. package/dist/components/ui-positioner.d.ts.map +1 -1
  61. package/dist/components/ui-skeleton.d.ts.map +1 -1
  62. package/dist/components/ui-sortable.d.ts +8 -0
  63. package/dist/components/ui-sortable.d.ts.map +1 -1
  64. package/dist/components/ui-split-button.d.ts +1 -0
  65. package/dist/components/ui-split-button.d.ts.map +1 -1
  66. package/dist/components/ui-tabs.d.ts.map +1 -1
  67. package/dist/components/ui-textarea.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +9 -9
  80. package/dist/date-picker.esm.js +69 -97
  81. package/dist/date-range-picker.cjs.js +3 -3
  82. package/dist/date-range-picker.esm.js +32 -56
  83. package/dist/date-range-time-picker.cjs.js +9 -9
  84. package/dist/date-range-time-picker.esm.js +111 -140
  85. package/dist/date-time-picker.cjs.js +7 -7
  86. package/dist/date-time-picker.esm.js +115 -147
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +5 -5
  162. package/dist/multi-select.esm.js +125 -137
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +3 -3
  196. package/dist/portal.esm.js +20 -28
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +22 -28
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/primitives/auto-scroll.d.ts +9 -0
  204. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  205. package/dist/primitives/selector.d.ts +4 -0
  206. package/dist/primitives/selector.d.ts.map +1 -0
  207. package/dist/progress.cjs.js +1 -1
  208. package/dist/progress.esm.js +5 -9
  209. package/dist/quick-actions.cjs.js +6 -6
  210. package/dist/quick-actions.esm.js +52 -62
  211. package/dist/radio-group.cjs.js +13 -13
  212. package/dist/radio-group.esm.js +39 -51
  213. package/dist/radio.cjs.js +1 -1
  214. package/dist/radio.esm.js +5 -9
  215. package/dist/rating.cjs.js +1 -1
  216. package/dist/rating.esm.js +12 -23
  217. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  218. package/dist/roving-focus-group.cjs.js +1 -1
  219. package/dist/roving-focus-group.esm.js +3 -5
  220. package/dist/runtime-CTaOSmBj.js +1 -0
  221. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  222. package/dist/runtime.cjs.js +1 -1
  223. package/dist/runtime.esm.js +6 -6
  224. package/dist/scroll-area.cjs.js +3 -3
  225. package/dist/scroll-area.esm.js +38 -46
  226. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  227. package/dist/section.cjs.js +1 -1
  228. package/dist/section.esm.js +1 -1
  229. package/dist/select.cjs.js +7 -7
  230. package/dist/select.esm.js +67 -97
  231. package/dist/selection-popup.cjs.js +1 -1
  232. package/dist/selection-popup.esm.js +8 -15
  233. package/dist/selector-BvAh35ve.js +1 -0
  234. package/dist/selector-WI8pD7YO.mjs +18 -0
  235. package/dist/separator.cjs.js +1 -1
  236. package/dist/separator.esm.js +1 -1
  237. package/dist/sidebar.cjs.js +18 -18
  238. package/dist/sidebar.esm.js +117 -139
  239. package/dist/skeleton.cjs.js +11 -11
  240. package/dist/skeleton.esm.js +27 -24
  241. package/dist/slider.cjs.js +1 -1
  242. package/dist/slider.esm.js +6 -11
  243. package/dist/slot.cjs.js +4 -4
  244. package/dist/slot.esm.js +16 -19
  245. package/dist/sortable.cjs.js +79 -65
  246. package/dist/sortable.esm.js +714 -734
  247. package/dist/spinning-text.cjs.js +12 -12
  248. package/dist/spinning-text.esm.js +80 -92
  249. package/dist/split-button.cjs.js +4 -4
  250. package/dist/split-button.esm.js +77 -62
  251. package/dist/splitter.cjs.js +1 -1
  252. package/dist/splitter.esm.js +1 -1
  253. package/dist/stepper.cjs.js +8 -8
  254. package/dist/stepper.esm.js +32 -52
  255. package/dist/switch.cjs.js +7 -7
  256. package/dist/switch.esm.js +23 -31
  257. package/dist/table.cjs.js +2 -2
  258. package/dist/table.esm.js +46 -56
  259. package/dist/tabs.cjs.js +8 -8
  260. package/dist/tabs.esm.js +89 -109
  261. package/dist/tags-input.cjs.js +4 -4
  262. package/dist/tags-input.esm.js +45 -62
  263. package/dist/textarea.cjs.js +10 -10
  264. package/dist/textarea.esm.js +49 -52
  265. package/dist/time-field.cjs.js +4 -4
  266. package/dist/time-field.esm.js +70 -84
  267. package/dist/time-picker.cjs.js +22 -22
  268. package/dist/time-picker.esm.js +88 -110
  269. package/dist/timeline.cjs.js +1 -1
  270. package/dist/timeline.esm.js +3 -5
  271. package/dist/toast.cjs.js +2 -2
  272. package/dist/toast.esm.js +33 -47
  273. package/dist/toggle-group.cjs.js +6 -6
  274. package/dist/toggle-group.esm.js +85 -105
  275. package/dist/toggle.cjs.js +1 -1
  276. package/dist/toggle.esm.js +3 -5
  277. package/dist/toolbar.cjs.js +1 -1
  278. package/dist/toolbar.esm.js +13 -24
  279. package/dist/tooltip.cjs.js +2 -2
  280. package/dist/tooltip.esm.js +31 -42
  281. package/dist/transfer-list.cjs.js +31 -31
  282. package/dist/transfer-list.esm.js +114 -127
  283. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  284. package/dist/tree-Dx_kv_ih.js +39 -0
  285. package/dist/tree-item.cjs.js +2 -2
  286. package/dist/tree-item.esm.js +2 -3
  287. package/dist/tree.cjs.js +1 -1
  288. package/dist/tree.esm.js +2 -5
  289. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  290. package/dist/ui-button-rXQOS9QJ.js +521 -0
  291. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  292. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  293. package/dist/visually-hidden.cjs.js +1 -1
  294. package/dist/visually-hidden.esm.js +1 -1
  295. package/dist/wizard.cjs.js +14 -14
  296. package/dist/wizard.esm.js +85 -105
  297. package/package.json +2 -2
  298. package/dist/date-time-utils-66480de4.js +0 -1
  299. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  300. package/dist/dismissable-layer-193e3bed.js +0 -1
  301. package/dist/focus-scope-2b12b4e7.js +0 -1
  302. package/dist/listbox-308789a0.mjs +0 -210
  303. package/dist/listbox-ef2f708e.js +0 -46
  304. package/dist/panel-group-40254cdd.js +0 -36
  305. package/dist/portal-c69756c0.js +0 -1
  306. package/dist/positioner-33529bb8.js +0 -1
  307. package/dist/runtime-3f13807b.js +0 -1
  308. package/dist/tree-0a7a8d05.js +0 -39
  309. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  310. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  311. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  312. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  313. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";const X=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"];function z(e){return e instanceof HTMLElement}function Y(e){return!!e&&typeof e.top=="number"&&typeof e.left=="number"}function $(e){return!!e&&typeof e.getBoundingClientRect=="function"}function C(e){const t=e.x??0,n=e.y??0;return typeof DOMRect.fromRect=="function"?DOMRect.fromRect({x:t,y:n,width:e.width,height:e.height}):new DOMRect(t,n,e.width,e.height)}function p(e){return e instanceof DOMRect?e:C({x:e.x??e.left,y:e.y??e.top,width:e.width,height:e.height})}function w(e){return z(e)?e.getBoundingClientRect():Y(e)?p(e):p(e.getBoundingClientRect())}function _(e,t){const n=t?.getClientRects?.(e);if(n)return Array.from(n).map(i=>p(i)).filter(i=>i.width>0||i.height>0);const r=(z(e)||$(e))&&typeof e.getClientRects=="function"?e.getClientRects():null;return r?Array.from(r).map(i=>p(i)).filter(i=>i.width>0||i.height>0):[]}function j(e,t,n,r){if(!n)return w(e);const i=_(e,r);if(i.length===0)return w(e);const{side:o}=x(t);return o==="bottom"||o==="right"?i[i.length-1]||w(e):i[0]||w(e)}function H(e){return z(e)?e:$(e)&&e.contextElement instanceof HTMLElement?e.contextElement:null}function G(e,t,n){if(n)return n;const r=H(e)||(t instanceof HTMLElement?t:null);return r&&window.getComputedStyle(r).direction==="rtl"?"rtl":"ltr"}function J(e,t,n){return{getBoundingClientRect:()=>C({x:e,y:t,width:0,height:0}),contextElement:n}}function K(e,t){const n=C({x:e.x??e.left,y:e.y??e.top,width:e.width,height:e.height});return{getBoundingClientRect:()=>n,contextElement:t}}function Q(e,t){return{getBoundingClientRect:()=>p(e.getBoundingClientRect()),getClientRects:()=>e.getClientRects(),contextElement:t}}function Z(){const e=window.innerWidth||document.documentElement.clientWidth||0,t=window.innerHeight||document.documentElement.clientHeight||0;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function L(e){return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function ee(e,t){const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return{top:r,left:n,right:i,bottom:o,width:Math.max(0,i-n),height:Math.max(0,o-r)}}function te(e){const t=window.getComputedStyle(e),n=`${t.overflow}${t.overflowX}${t.overflowY}`;return/(auto|scroll|overlay|hidden|clip)/.test(n)}function R(e){const t=[];let n=e?.parentElement??null;for(;n&&n!==document.body&&n!==document.documentElement;)te(n)&&t.push(n),n=n.parentElement;return t.push(window),t}function ne(e,t,n){let r=n instanceof HTMLElement?L(n.getBoundingClientRect()):Z();if(n instanceof HTMLElement)return r;const i=new Set,o=H(e);return o&&R(o).forEach(c=>{c instanceof Element&&i.add(c)}),t instanceof HTMLElement&&R(t).forEach(c=>{c instanceof Element&&i.add(c)}),i.forEach(c=>{r=ee(r,L(c.getBoundingClientRect()))}),r}function x(e){const[t,n]=e.split("-");return{side:t,align:n||"center"}}function re(e){return e==="top"?"bottom":e==="bottom"?"top":e==="left"?"right":"left"}function ie(e){const{side:t,align:n}=x(e);return`${re(t)}${n==="center"?"":`-${n}`}`}function O(e,t,n,r=0,i=0,o=!1){const{side:c,align:a}=x(n);let l=0,d=0;return c==="top"||c==="bottom"?(a==="start"?l=o?e.right-t.width:e.left:a==="end"?l=o?e.left:e.right-t.width:l=e.left+(e.width-t.width)/2,d=c==="top"?e.top-t.height-r:e.bottom+r,l+=i):(a==="start"?d=e.top:a==="end"?d=e.bottom-t.height:d=e.top+(e.height-t.height)/2,l=c==="left"?e.left-t.width-r:e.right+r,d+=i),{x:l,y:d}}function E(e,t,n){return Math.min(n,Math.max(t,e))}function P(e){return Math.max(0,e.top)+Math.max(0,e.right)+Math.max(0,e.bottom)+Math.max(0,e.left)}function D(e,t){const{side:n}=x(e);return Math.max(0,t[n])}function oe(e,t){const{side:n}=x(e);return n==="top"||n==="bottom"?Math.max(0,t.left)+Math.max(0,t.right):Math.max(0,t.top)+Math.max(0,t.bottom)}function b(e,t={}){const n=t.padding??e.padding,r=t.elementContext==="reference"?{x:e.rects.reference.left,y:e.rects.reference.top,width:e.rects.reference.width,height:e.rects.reference.height}:{x:e.x,y:e.y,width:e.rects.floating.width,height:e.rects.floating.height};return{top:e.boundary.top+n-r.y,right:r.x+r.width-(e.boundary.right-n),bottom:r.y+r.height-(e.boundary.bottom-n),left:e.boundary.left+n-r.x}}function F(e=0){return{name:"offset",options:e,fn(t){const n=typeof e=="number"?{mainAxis:e,crossAxis:0}:{mainAxis:e.mainAxis??0,crossAxis:e.crossAxis??0},r=O(t.rects.reference,t.rects.floating,t.placement,n.mainAxis,n.crossAxis,t.rtl);return{x:r.x,y:r.y,data:{x:r.x-t.x,y:r.y-t.y}}}}}function V(e={}){return{name:"flip",options:e,fn(t){const n=e.fallbackPlacements?.length?e.fallbackPlacements:[ie(t.initialPlacement)],i=[t.placement,...n].map(l=>{const d=t.getAnchorRect(l),f=t.getCoords(l,d),s=b({...t,x:f.x,y:f.y,rects:{...t.rects,reference:d}},{padding:e.padding??t.padding});return{placement:l,overflow:s,coords:f,reference:d}}),o=i[0];if(!o||D(t.placement,o.overflow)<=0)return{data:{overflows:i.map(({placement:l,overflow:d})=>({placement:l,overflow:d}))}};const a=i.find(({placement:l,overflow:d})=>D(l,d)<=0&&oe(l,d)<=0)||i.reduce((l,d)=>P(d.overflow)<P(l.overflow)?d:l,o);return a.placement===t.placement?{data:{overflows:i.map(({placement:l,overflow:d})=>({placement:l,overflow:d}))}}:{x:a.coords.x,y:a.coords.y,placement:a.placement,data:{overflows:i.map(({placement:l,overflow:d})=>({placement:l,overflow:d}))}}}}}function T(e={}){return{name:"autoPlacement",options:e,fn(t){const n=e.allowedPlacements?.length?e.allowedPlacements:X,r=n.map(o=>{const c=t.getAnchorRect(o),a=t.getCoords(o,c),l=b({...t,x:a.x,y:a.y,rects:{...t.rects,reference:c}},{padding:e.padding??t.padding});return{placement:o,overflow:l,coords:a,reference:c}}),i=r.reduce((o,c)=>{const a=P(c.overflow),l=P(o.overflow);if(a!==l)return a<l?c:o;const d=Math.max(0,t.boundary.right-c.coords.x)*Math.max(0,t.boundary.bottom-c.coords.y),f=Math.max(0,t.boundary.right-o.coords.x)*Math.max(0,t.boundary.bottom-o.coords.y);return d>f?c:o},r[0]);if(i)return{x:i.coords.x,y:i.coords.y,placement:i.placement,data:{index:n.indexOf(i.placement),overflows:r.map(({placement:o,overflow:c})=>({placement:o,overflow:c}))}}}}}function B(e={}){return{name:"shift",options:e,fn(t){const n=e.mainAxis??!0,r=e.crossAxis??!0,{side:i}=x(t.placement),o=b(t,{padding:e.padding??t.padding});let c=t.x,a=t.y;return i==="top"||i==="bottom"?(r&&(c+=Math.max(0,o.left)-Math.max(0,o.right)),n&&(a+=i==="top"?Math.max(0,o.top):-Math.max(0,o.bottom))):(r&&(a+=Math.max(0,o.top)-Math.max(0,o.bottom)),n&&(c+=i==="left"?Math.max(0,o.left):-Math.max(0,o.right))),{x:c,y:a,data:{x:c-t.x,y:a-t.y}}}}}function I(e={}){return{name:"size",options:e,fn(t){const n=e.padding??t.padding,r=Math.max(0,t.boundary.right-t.x-n),i=Math.max(0,t.boundary.bottom-t.y-n);return e.apply?.({availableWidth:r,availableHeight:i,rects:t.rects,elements:t.elements}),{data:{availableWidth:r,availableHeight:i}}}}}function k(e={}){return{name:"arrow",options:e,fn(t){const{side:n}=x(t.placement),r=e.padding??8,i=e.element?.getBoundingClientRect(),o=i?.width||e.element?.offsetWidth||0,c=i?.height||e.element?.offsetHeight||0,a=t.rects.reference.left+t.rects.reference.width/2,l=t.rects.reference.top+t.rects.reference.height/2;if(n==="top"||n==="bottom"){const u=o/2,y=r,v=Math.max(y,t.rects.floating.width-r-o),M=a-t.x-u,A=E(M,y,v);return{data:{x:A,centerOffset:M-A}}}const d=c/2,f=r,s=Math.max(f,t.rects.floating.height-r-c),g=l-t.y-d,m=E(g,f,s);return{data:{y:m,centerOffset:g-m}}}}}function q(e={}){return{name:"hide",options:e,fn(t){const n=e.padding??t.padding,r=b(t,{elementContext:"reference",padding:n}),i=b(t,{padding:n}),o=Object.values(r).some(a=>a>0),c=Object.values(i).some(a=>a>0);return{data:{referenceHidden:o,escaped:c,referenceHiddenOffsets:r,escapedOffsets:i}}}}}function ce(e){const t=typeof e.boundaryPadding=="number"?e.boundaryPadding:4,n=[];return e.autoPlacement?n.push(T({padding:t,allowedPlacements:e.allowedPlacements})):e.flip&&n.push(V({padding:t,fallbackPlacements:e.fallbackPlacements})),n.push(F({mainAxis:typeof e.offset=="number"?e.offset:8,crossAxis:typeof e.crossOffset=="number"?e.crossOffset:0})),(e.shift||e.fitViewport)&&n.push(B({padding:t})),(e.matchWidth||e.fitViewport)&&n.push(I({padding:t})),e.arrow&&n.push(k({element:e.arrow,padding:e.arrowPadding})),e.hideWhenDetached&&n.push(q({padding:t})),e.middleware?.length&&n.push(...e.middleware),n}function le(e,t,n){if(!n)return;typeof n.x=="number"&&(e.x=n.x),typeof n.y=="number"&&(e.y=n.y);const i=(typeof n.reset=="object"?n.reset.placement:void 0)||n.placement;if(i&&i!==e.placement){e.placement=i,e.rects=e.getRects(i);const o=e.getCoords(i,e.rects.reference);e.x=typeof n.x=="number"?n.x:o.x,e.y=typeof n.y=="number"?n.y:o.y}typeof n.x=="number"&&(e.x=n.x),typeof n.y=="number"&&(e.y=n.y),n.data!==void 0&&(e.middlewareData[t.name]=n.data)}function S(e,t,n={}){const r=z(t)?t.getBoundingClientRect():t,i=n.placement||"bottom",o=n.strategy||"fixed",c=typeof n.boundaryPadding=="number"?n.boundaryPadding:4,a=G(e,t,n.dir)==="rtl",l=h=>n.platform?.getElementRects?.({anchor:e,floating:t,placement:h,inline:!!n.inline})??{reference:j(e,h,!!n.inline,n.platform),floating:r},d=h=>l(h).reference,f=l(i),s=O(f.reference,f.floating,i,0,0,a),g={},m=n.platform?.getClippingRect?.({anchor:e,floating:t,boundary:n.boundary??null})??ne(e,t,n.boundary??null),u={x:s.x,y:s.y,initialPlacement:i,placement:i,strategy:o,rects:f,elements:{anchor:e,floating:t},boundary:m,padding:c,rtl:a,middlewareData:g,getRects:l,getAnchorRect:d,getCoords:(h,U=d(h))=>O(U,u.rects.floating,h,0,0,a)};ce(n).forEach(h=>{le(u,h,h.fn(u))});const y=g.size,v=g.hide,M=y?.availableWidth??Math.max(0,u.boundary.right-u.x-c),A=y?.availableHeight??Math.max(0,u.boundary.bottom-u.y-c);return{x:u.x,y:u.y,placement:u.placement,strategy:o,availableWidth:M,availableHeight:A,middlewareData:g,referenceHidden:v?.referenceHidden,escaped:v?.escaped,rects:u.rects}}function W(e,t){return t!=="absolute"?e:{...e,x:e.x+window.scrollX,y:e.y+window.scrollY}}function ae(e,t){if(typeof IntersectionObserver>"u")return()=>{};let n=()=>{};return(()=>{n();const i=e.getBoundingClientRect(),o=document.documentElement,c=`${-Math.floor(i.top)}px ${-Math.floor(o.clientWidth-i.right)}px ${-Math.floor(o.clientHeight-i.bottom)}px ${-Math.floor(i.left)}px`,a=new IntersectionObserver(()=>t(),{rootMargin:c,threshold:1});a.observe(e),n=()=>a.disconnect()})(),()=>n()}function de(e,t,n,r){let i=0,o=0,c=null,a=null,l=null;const d=[],f=H(e),s=()=>{i||(i=requestAnimationFrame(()=>{i=0,n()}))};if(r.observeWindowResize&&(window.addEventListener("resize",s),d.push(()=>window.removeEventListener("resize",s))),r.observeScroll&&(window.addEventListener("scroll",s,{passive:!0,capture:!0}),d.push(()=>window.removeEventListener("scroll",s,!0))),(r.observeAncestorScroll||r.observeAncestorResize?new Set([...f?R(f):[],...R(t)]):new Set).forEach(m=>{m!==window&&(r.observeAncestorScroll&&(m.addEventListener("scroll",s,{passive:!0}),d.push(()=>m.removeEventListener("scroll",s))),r.observeAncestorResize&&(m.addEventListener("resize",s),d.push(()=>m.removeEventListener("resize",s))))}),f&&r.observeLayoutShift&&d.push(ae(f,s)),typeof ResizeObserver<"u"&&(r.observeAnchorResize&&f&&(a=new ResizeObserver(s),a.observe(f)),r.observeFloatingResize&&(l=new ResizeObserver(s),l.observe(t))),r.animationFrame){c=w(e);const m=()=>{const u=w(e);c&&(c.top!==u.top||c.left!==u.left||c.width!==u.width||c.height!==u.height)&&s(),c=u,o=requestAnimationFrame(m)};o=requestAnimationFrame(m)}return()=>{d.forEach(m=>m()),a&&a.disconnect(),l&&l.disconnect(),i&&cancelAnimationFrame(i),o&&cancelAnimationFrame(o)}}function N(e,t,n,r={}){return de(e,t,n,{observeWindowResize:r.observeWindowResize??!0,observeScroll:r.observeScroll??!0,observeAncestorScroll:r.observeAncestorScroll??!0,observeAncestorResize:r.observeAncestorResize??!0,observeLayoutShift:r.observeLayoutShift??!0,observeAnchorResize:r.observeAnchorResize??!0,observeFloatingResize:r.observeFloatingResize??!0,animationFrame:r.animationFrame??!1})}function fe(e,t,n,r){const{side:i}=x(t.placement),o=n.left+n.width/2,c=n.top+n.height/2;if(i==="top"||i==="bottom"){const l=Math.max(8,r.width-8),d=E(o-t.x,8,l);e.style.left=`${Math.round(d)}px`}else{const l=Math.max(8,r.height-8),d=E(c-t.y,8,l);e.style.top=`${Math.round(d)}px`}}function se(e,t){const n=t.middlewareData?.arrow;n&&(typeof n.x=="number"&&(e.style.left=`${Math.round(n.x)}px`),typeof n.y=="number"&&(e.style.top=`${Math.round(n.y)}px`))}function ue(e,t,n,r){if(e.style.position=n,e.style.left=`${Math.round(t.x)}px`,e.style.top=`${Math.round(t.y)}px`,e.style.setProperty("--ui-positioner-x",`${Math.round(t.x)}px`),e.style.setProperty("--ui-positioner-y",`${Math.round(t.y)}px`),r.matchWidth){const i=w(r.anchor);e.style.width=`${Math.round(i.width)}px`}r.fitViewport&&(e.style.maxWidth=`${Math.round(t.availableWidth)}px`,e.style.maxHeight=`${Math.round(t.availableHeight)}px`),e.setAttribute("data-placement",t.placement),typeof t.referenceHidden=="boolean"||typeof t.escaped=="boolean"?(e.setAttribute("data-reference-hidden",t.referenceHidden?"true":"false"),e.setAttribute("data-escaped",t.escaped?"true":"false")):(e.removeAttribute("data-reference-hidden"),e.removeAttribute("data-escaped")),r.arrow instanceof HTMLElement&&(t.middlewareData?.arrow?se(r.arrow,t):fe(r.arrow,t,w(r.anchor),e.getBoundingClientRect()))}function me(e){if(!(e.floating instanceof HTMLElement))throw new Error("createPositioner requires a valid floating HTMLElement");const t=e.strategy||"fixed",n=e.floating;let r=W(S(e.anchor,n,e),t);const i=N(e.anchor,n,o,{observeWindowResize:e.observeWindowResize??!0,observeScroll:e.observeScroll??!0,observeAncestorScroll:e.observeAncestorScroll??!0,observeAncestorResize:e.observeAncestorResize??!0,observeLayoutShift:e.observeLayoutShift??!0,observeAnchorResize:e.observeAnchorResize??!0,observeFloatingResize:e.observeFloatingResize??!(e.fitViewport||e.matchWidth),animationFrame:e.animationFrame??!1});function o(){const c=W(S(e.anchor,n,e),t);return r=c,ue(n,c,t,e),e.onUpdate?.(c),r}return o(),{update:o,destroy(){i()}}}exports.arrowMiddleware=k;exports.autoPlacementMiddleware=T;exports.autoUpdatePositioner=N;exports.computePositionState=S;exports.createPositioner=me;exports.createVirtualPoint=J;exports.createVirtualRange=Q;exports.createVirtualRect=K;exports.detectPositionerOverflow=b;exports.flipMiddleware=V;exports.hideMiddleware=q;exports.offsetMiddleware=F;exports.shiftMiddleware=B;exports.sizeMiddleware=I;
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-1b301e7f.js"),c=require("./positioner-33529bb8.js"),h=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-EV6mVBUV.js"),h=require("./positioner-D_fqyx_j.js"),a=require("./selector-BvAh35ve.js"),d=`
2
2
  :host {
3
3
  display: contents;
4
4
  color-scheme: light dark;
5
5
  }
6
- `;function r(s,t=0){const e=Number(s);return Number.isFinite(e)?e:t}function o(s){if(s==null)return!1;const t=s.toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function d(s){return new Set(["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"]).has(s)?s:"bottom"}function f(s){return s==="absolute"?"absolute":"fixed"}class a extends u.ElementBase{constructor(){super(...arguments),this._positioner=null,this._observer=null}static get observedAttributes(){return["open","placement","strategy","offset","cross-offset","flip","shift","match-width","fit-viewport","auto-placement","hide-when-detached","inline","boundary-padding","dir","anchor","headless"]}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>this._syncPositioner()),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","id"]}),this._syncPositioner()}disconnectedCallback(){var t;(t=this._observer)==null||t.disconnect(),this._observer=null,this._destroyPositioner(),super.disconnectedCallback()}attributeChangedCallback(t,e,i){e!==i&&this._syncPositioner()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}updatePosition(){var t;(t=this._positioner)==null||t.update()}_destroyPositioner(){var t;(t=this._positioner)==null||t.destroy(),this._positioner=null}_resolveAnchor(){const t=this.getAttribute("anchor");if(t){const i=this.getRootNode(),n=i instanceof ShadowRoot||i instanceof Document?i.querySelector(t):null;if(n instanceof HTMLElement)return n;const l=document.querySelector(t);if(l instanceof HTMLElement)return l}const e=this.querySelector('[slot="anchor"]');return e instanceof HTMLElement?e:null}_resolveFloating(){const t=this.querySelector('[slot="content"]');return t instanceof HTMLElement?t:Array.from(this.children).find(e=>e.getAttribute("slot")!=="anchor")}_syncPositioner(){if(!this.isConnected)return;if(this.hasAttribute("headless")||!this.hasAttribute("open")){this._destroyPositioner();return}const t=this._resolveAnchor(),e=this._resolveFloating();if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement)){this._destroyPositioner();return}this._destroyPositioner(),this._positioner=c.createPositioner({anchor:t,floating:e,placement:d(this.getAttribute("placement")),strategy:f(this.getAttribute("strategy")),dir:this.getAttribute("dir")==="rtl"?"rtl":"ltr",offset:r(this.getAttribute("offset"),8),crossOffset:r(this.getAttribute("cross-offset"),0),flip:!this.hasAttribute("flip")||o(this.getAttribute("flip")),shift:!this.hasAttribute("shift")||o(this.getAttribute("shift")),matchWidth:o(this.getAttribute("match-width")),fitViewport:o(this.getAttribute("fit-viewport")),autoPlacement:o(this.getAttribute("auto-placement")),hideWhenDetached:o(this.getAttribute("hide-when-detached")),inline:o(this.getAttribute("inline")),boundaryPadding:r(this.getAttribute("boundary-padding"),4),arrow:this.querySelector('[slot="arrow"], .arrow'),onUpdate:i=>{this.dispatchEvent(new CustomEvent("position-change",{detail:i,bubbles:!0,composed:!0}))}})}render(){this.setContent(`<style>${h}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-positioner")&&customElements.define("ui-positioner",a);exports.UIPositioner=a;
6
+ `;function r(s,t=0){const e=Number(s);return Number.isFinite(e)?e:t}function o(s){if(s==null)return!1;const t=s.toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function f(s){return new Set(["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"]).has(s)?s:"bottom"}function b(s){return s==="absolute"?"absolute":"fixed"}class u extends c.ElementBase{constructor(){super(...arguments),this._positioner=null,this._observer=null}static get observedAttributes(){return["open","placement","strategy","offset","cross-offset","flip","shift","match-width","fit-viewport","auto-placement","hide-when-detached","inline","boundary-padding","dir","anchor","headless"]}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>this._syncPositioner()),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot","id"]}),this._syncPositioner()}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._destroyPositioner(),super.disconnectedCallback()}attributeChangedCallback(t,e,i){e!==i&&this._syncPositioner()}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}updatePosition(){this._positioner?.update()}_destroyPositioner(){this._positioner?.destroy(),this._positioner=null}_resolveAnchor(){const t=this.getAttribute("anchor");if(t){const i=this.getRootNode(),n=i instanceof ShadowRoot||i instanceof Document?a.safeQuerySelector(i,t):null;if(n instanceof HTMLElement)return n;const l=a.safeQuerySelector(document,t);if(l instanceof HTMLElement)return l}const e=this.querySelector('[slot="anchor"]');return e instanceof HTMLElement?e:null}_resolveFloating(){const t=this.querySelector('[slot="content"]');return t instanceof HTMLElement?t:Array.from(this.children).find(e=>e.getAttribute("slot")!=="anchor")}_syncPositioner(){if(!this.isConnected)return;if(this.hasAttribute("headless")||!this.hasAttribute("open")){this._destroyPositioner();return}const t=this._resolveAnchor(),e=this._resolveFloating();if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement)){this._destroyPositioner();return}this._destroyPositioner(),this._positioner=h.createPositioner({anchor:t,floating:e,placement:f(this.getAttribute("placement")),strategy:b(this.getAttribute("strategy")),dir:this.getAttribute("dir")==="rtl"?"rtl":"ltr",offset:r(this.getAttribute("offset"),8),crossOffset:r(this.getAttribute("cross-offset"),0),flip:!this.hasAttribute("flip")||o(this.getAttribute("flip")),shift:!this.hasAttribute("shift")||o(this.getAttribute("shift")),matchWidth:o(this.getAttribute("match-width")),fitViewport:o(this.getAttribute("fit-viewport")),autoPlacement:o(this.getAttribute("auto-placement")),hideWhenDetached:o(this.getAttribute("hide-when-detached")),inline:o(this.getAttribute("inline")),boundaryPadding:r(this.getAttribute("boundary-padding"),4),arrow:this.querySelector('[slot="arrow"], .arrow'),onUpdate:i=>{this.dispatchEvent(new CustomEvent("position-change",{detail:i,bubbles:!0,composed:!0}))}})}render(){this.setContent(`<style>${d}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-positioner")&&customElements.define("ui-positioner",u);exports.UIPositioner=u;
@@ -1,6 +1,7 @@
1
- import { E as a } from "./ElementBase-909688f3.mjs";
2
- import { l as h } from "./positioner-e9770c66.mjs";
3
- const c = `
1
+ import { E as h } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { e as c } from "./positioner-D0VGxtYU.mjs";
3
+ import { s as l } from "./selector-WI8pD7YO.mjs";
4
+ const u = `
4
5
  :host {
5
6
  display: contents;
6
7
  color-scheme: light dark;
@@ -11,12 +12,11 @@ function r(s, t = 0) {
11
12
  return Number.isFinite(e) ? e : t;
12
13
  }
13
14
  function o(s) {
14
- if (s == null)
15
- return !1;
15
+ if (s == null) return !1;
16
16
  const t = s.toLowerCase();
17
17
  return t !== "false" && t !== "0" && t !== "off";
18
18
  }
19
- function u(s) {
19
+ function d(s) {
20
20
  return (/* @__PURE__ */ new Set([
21
21
  "top",
22
22
  "top-start",
@@ -32,10 +32,10 @@ function u(s) {
32
32
  "left-end"
33
33
  ])).has(s) ? s : "bottom";
34
34
  }
35
- function d(s) {
35
+ function f(s) {
36
36
  return s === "absolute" ? "absolute" : "fixed";
37
37
  }
38
- class f extends a {
38
+ class b extends h {
39
39
  constructor() {
40
40
  super(...arguments), this._positioner = null, this._observer = null;
41
41
  }
@@ -63,8 +63,7 @@ class f extends a {
63
63
  super.connectedCallback(), this._observer = new MutationObserver(() => this._syncPositioner()), this._observer.observe(this, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["slot", "id"] }), this._syncPositioner();
64
64
  }
65
65
  disconnectedCallback() {
66
- var t;
67
- (t = this._observer) == null || t.disconnect(), this._observer = null, this._destroyPositioner(), super.disconnectedCallback();
66
+ this._observer?.disconnect(), this._observer = null, this._destroyPositioner(), super.disconnectedCallback();
68
67
  }
69
68
  attributeChangedCallback(t, e, i) {
70
69
  e !== i && this._syncPositioner();
@@ -76,22 +75,18 @@ class f extends a {
76
75
  this.removeAttribute("open");
77
76
  }
78
77
  updatePosition() {
79
- var t;
80
- (t = this._positioner) == null || t.update();
78
+ this._positioner?.update();
81
79
  }
82
80
  _destroyPositioner() {
83
- var t;
84
- (t = this._positioner) == null || t.destroy(), this._positioner = null;
81
+ this._positioner?.destroy(), this._positioner = null;
85
82
  }
86
83
  _resolveAnchor() {
87
84
  const t = this.getAttribute("anchor");
88
85
  if (t) {
89
- const i = this.getRootNode(), n = i instanceof ShadowRoot || i instanceof Document ? i.querySelector(t) : null;
90
- if (n instanceof HTMLElement)
91
- return n;
92
- const l = document.querySelector(t);
93
- if (l instanceof HTMLElement)
94
- return l;
86
+ const i = this.getRootNode(), n = i instanceof ShadowRoot || i instanceof Document ? l(i, t) : null;
87
+ if (n instanceof HTMLElement) return n;
88
+ const a = l(document, t);
89
+ if (a instanceof HTMLElement) return a;
95
90
  }
96
91
  const e = this.querySelector('[slot="anchor"]');
97
92
  return e instanceof HTMLElement ? e : null;
@@ -101,8 +96,7 @@ class f extends a {
101
96
  return t instanceof HTMLElement ? t : Array.from(this.children).find((e) => e.getAttribute("slot") !== "anchor");
102
97
  }
103
98
  _syncPositioner() {
104
- if (!this.isConnected)
105
- return;
99
+ if (!this.isConnected) return;
106
100
  if (this.hasAttribute("headless") || !this.hasAttribute("open")) {
107
101
  this._destroyPositioner();
108
102
  return;
@@ -112,11 +106,11 @@ class f extends a {
112
106
  this._destroyPositioner();
113
107
  return;
114
108
  }
115
- this._destroyPositioner(), this._positioner = h({
109
+ this._destroyPositioner(), this._positioner = c({
116
110
  anchor: t,
117
111
  floating: e,
118
- placement: u(this.getAttribute("placement")),
119
- strategy: d(this.getAttribute("strategy")),
112
+ placement: d(this.getAttribute("placement")),
113
+ strategy: f(this.getAttribute("strategy")),
120
114
  dir: this.getAttribute("dir") === "rtl" ? "rtl" : "ltr",
121
115
  offset: r(this.getAttribute("offset"), 8),
122
116
  crossOffset: r(this.getAttribute("cross-offset"), 0),
@@ -135,13 +129,13 @@ class f extends a {
135
129
  });
136
130
  }
137
131
  render() {
138
- this.setContent(`<style>${c}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`);
132
+ this.setContent(`<style>${u}</style><slot name="anchor"></slot><slot name="content"></slot><slot></slot>`);
139
133
  }
140
134
  shouldRenderOnAttributeChange() {
141
135
  return !1;
142
136
  }
143
137
  }
144
- typeof customElements < "u" && !customElements.get("ui-positioner") && customElements.define("ui-positioner", f);
138
+ typeof customElements < "u" && !customElements.get("ui-positioner") && customElements.define("ui-positioner", b);
145
139
  export {
146
- f as UIPositioner
140
+ b as UIPositioner
147
141
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-1b301e7f.js"),l=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),l=`
2
2
  :host {
3
3
  --ui-presence-duration-enter: 180ms;
4
4
  --ui-presence-duration-exit: 150ms;
@@ -1,4 +1,4 @@
1
- import { E as c } from "./ElementBase-909688f3.mjs";
1
+ import { E as c } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const d = `
3
3
  :host {
4
4
  --ui-presence-duration-enter: 180ms;
@@ -154,14 +154,12 @@ const d = `
154
154
  }
155
155
  `;
156
156
  function a(e, t) {
157
- if (e == null)
158
- return t;
157
+ if (e == null) return t;
159
158
  const s = String(e).toLowerCase();
160
159
  return s !== "false" && s !== "0";
161
160
  }
162
161
  function r(e, t) {
163
- if (e == null || e === "")
164
- return t;
162
+ if (e == null || e === "") return t;
165
163
  const s = Number(e);
166
164
  return Number.isFinite(s) ? s : t;
167
165
  }
@@ -247,29 +245,25 @@ class h extends c {
247
245
  this._clearDelay(), this._state !== "hidden" && (this._dispatch("before-exit"), this._setState("exiting"), this._dispatch("exit"));
248
246
  }
249
247
  _setState(t) {
250
- if (this._state === t)
251
- return;
248
+ if (this._state === t) return;
252
249
  this._state = t;
253
250
  const s = this._presenceEl || this.root.querySelector(".presence");
254
251
  this._presenceEl = s, s && s.setAttribute("data-state", t), this._syncNodePresentation(), this.setAttribute("data-state", t);
255
252
  }
256
253
  _syncNodePresentation() {
257
254
  const t = this._presenceEl || this.root.querySelector(".presence");
258
- if (!t)
259
- return;
255
+ if (!t) return;
260
256
  this._presenceEl = t;
261
257
  const s = a(this.getAttribute("keep-mounted"), !1), i = Math.max(0, r(this.getAttribute("enter-duration"), 180)), o = Math.max(0, r(this.getAttribute("exit-duration"), 150)), n = this._state !== "hidden" || s;
262
258
  t.style.setProperty("--ui-presence-duration-enter", `${i}ms`), t.style.setProperty("--ui-presence-duration-exit", `${o}ms`), t.style.display = n ? "block" : "none";
263
259
  }
264
260
  _onTransitionEnd(t) {
265
- if (t.target !== t.currentTarget)
266
- return;
261
+ if (t.target !== t.currentTarget) return;
267
262
  if (this._state === "entering" || this._state === "present") {
268
263
  this._setState("present"), this._dispatch("after-enter");
269
264
  return;
270
265
  }
271
- if (this._state !== "exiting")
272
- return;
266
+ if (this._state !== "exiting") return;
273
267
  a(this.getAttribute("keep-mounted"), !1) || this._setState("hidden"), this._dispatch("after-exit");
274
268
  }
275
269
  _dispatch(t) {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Per-frame scroll step for a pointer at `position` inside the span [start, end]: negative near
3
+ * the start, positive near the end, 0 elsewhere. The step grows linearly from 0 at the edge of the
4
+ * `zone` to `maxStep` at the very edge, and the zone never exceeds half the span.
5
+ */
6
+ export declare function edgeScrollDelta(position: number, start: number, end: number, zone?: number, maxStep?: number): number;
7
+ /** The nearest ancestor (crossing shadow roots) that scrolls vertically, or null for the page. */
8
+ export declare function findScrollParent(element: Element | null): HTMLElement | null;
9
+ //# sourceMappingURL=auto-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-scroll.d.ts","sourceRoot":"","sources":["../../src/primitives/auto-scroll.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,SAAK,EAAE,OAAO,SAAK,GAAG,MAAM,CAO7G;AAID,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAU5E"}
@@ -0,0 +1,4 @@
1
+ export declare function isValidSelector(selector: string): boolean;
2
+ /** `root.querySelector(selector)` that yields null instead of throwing on an invalid selector. */
3
+ export declare function safeQuerySelector<T extends Element = Element>(root: ParentNode, selector: string): T | null;
4
+ //# sourceMappingURL=selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/primitives/selector.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAazD;AAED,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAG3G"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./ElementBase-1b301e7f.js"),g=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./ElementBase-EV6mVBUV.js"),g=`
2
2
  :host {
3
3
  display: block;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import { E as p } from "./ElementBase-909688f3.mjs";
1
+ import { E as p } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const f = `
3
3
  :host {
4
4
  display: block;
@@ -317,14 +317,12 @@ function u(e, r, t) {
317
317
  return Number.isNaN(e) || e < r ? r : e > t ? t : e;
318
318
  }
319
319
  function g(e, r) {
320
- if (e == null)
321
- return r;
320
+ if (e == null) return r;
322
321
  const t = String(e).toLowerCase();
323
322
  return t !== "false" && t !== "0";
324
323
  }
325
324
  function d(e, r) {
326
- if (e == null || e === "")
327
- return r;
325
+ if (e == null || e === "") return r;
328
326
  const t = Number(e);
329
327
  return Number.isFinite(t) ? t : r;
330
328
  }
@@ -392,8 +390,7 @@ class E extends p {
392
390
  }
393
391
  _formatLabel(r) {
394
392
  const t = (this.getAttribute("format") || "percent").toLowerCase(), i = u(Math.round(d(this.getAttribute("precision"), 0)), 0, 3);
395
- if (t === "value")
396
- return `${this._value.toFixed(i)} / ${this._max.toFixed(i)}`;
393
+ if (t === "value") return `${this._value.toFixed(i)} / ${this._max.toFixed(i)}`;
397
394
  if (t === "fraction") {
398
395
  const s = Math.max(1, this._max - this._min);
399
396
  return `${Math.max(0, this._value - this._min).toFixed(i)}/${s.toFixed(i)}`;
@@ -401,8 +398,7 @@ class E extends p {
401
398
  return `${r.toFixed(i)}%`;
402
399
  }
403
400
  _emitState() {
404
- if (this._indeterminate)
405
- return;
401
+ if (this._indeterminate) return;
406
402
  const r = `${this._value}|${this._buffer}|${this._max}|${this._min}`;
407
403
  r !== this._lastEmitted && (this._lastEmitted = r, this.dispatchEvent(
408
404
  new CustomEvent("change", {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./ElementBase-1b301e7f.js"),p=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-EV6mVBUV.js"),h=`
2
2
  :host {
3
3
  --ui-quick-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 95%, transparent);
4
4
  --ui-quick-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
@@ -197,11 +197,11 @@
197
197
  border-color: Highlight;
198
198
  }
199
199
  }
200
- `;let g=0;function l(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class d extends h.ElementBase{constructor(){super(),this._instanceId=++g,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["open","mode","orientation","variant","floating","placement","collapsible","label","headless"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.getAttribute("mode")!=="fab"&&!this.hasAttribute("collapsible")&&!this.hasAttribute("open")&&this.setAttribute("open","")}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),super.disconnectedCallback()}attributeChangedCallback(e,i,t){if(i!==t){if(e==="open"){this._syncOpenUi();return}this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){const i=typeof e=="boolean"?e:!this.open;this.open=i;const t={open:i};this.dispatchEvent(new CustomEvent(i?"open":"close",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("toggle",{detail:t,bubbles:!0,composed:!0}))}_actions(){const e=this.root.querySelector('slot[name="action"]');return e?e.assignedElements({flatten:!0}).filter(i=>i instanceof HTMLElement):[]}_actionsId(){return`ui-quick-actions-${this._instanceId}-actions`}_syncActionAccessibility(e){this._actions().forEach((t,n)=>{var r;if(t.id||(t.id=`ui-quick-actions-${this._instanceId}-action-${n+1}`),t.hasAttribute("role")||t.setAttribute("role","button"),!t.hasAttribute("aria-label")){const o=(r=t.textContent)==null?void 0:r.trim();o&&t.setAttribute("aria-label",o)}if(e){const o=t.getAttribute("data-ui-quick-tabindex");o!=null?(o==="__none__"?t.removeAttribute("tabindex"):t.setAttribute("tabindex",o),t.removeAttribute("data-ui-quick-tabindex")):t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false");return}t.hasAttribute("data-ui-quick-tabindex")||t.setAttribute("data-ui-quick-tabindex",t.getAttribute("tabindex")??"__none__"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true")})}_onClick(e){var s;const i=e.target;if(!i)return;if(i.closest(".toggle")){this.toggle();return}const n=e.composedPath(),r=this._actions(),o=r.find(b=>n.includes(b));if(!o)return;const a=r.indexOf(o),c={index:a,id:o.id||o.getAttribute("data-id")||String(a+1),label:o.getAttribute("aria-label")||((s=o.textContent)==null?void 0:s.trim())||`Action ${a+1}`};this.dispatchEvent(new CustomEvent("select",{detail:c,bubbles:!0,composed:!0})),this.getAttribute("mode")==="fab"&&this.hide()}_moveFocus(e,i){const t=this._actions();if(!t.length)return;const n=t.indexOf(e);if(n<0)return;const r=(n+i+t.length)%t.length;t[r].focus()}_onKeyDown(e){if(e.key==="Escape"&&this.open&&this.getAttribute("mode")==="fab"){e.preventDefault(),this.hide();return}const i=e.target;if(!i)return;const n=this._actions().find(s=>s===i||s.contains(i));if(!n)return;const r=this.getAttribute("orientation")==="vertical"||this.getAttribute("mode")==="fab",o=!r&&getComputedStyle(this).direction==="rtl",a=r?"ArrowDown":o?"ArrowLeft":"ArrowRight",c=r?"ArrowUp":o?"ArrowRight":"ArrowLeft";if(e.key===a){e.preventDefault(),this._moveFocus(n,1);return}if(e.key===c){e.preventDefault(),this._moveFocus(n,-1);return}if(e.key==="Home"||e.key==="End"){e.preventDefault();const s=this._actions();if(!s.length)return;(e.key==="Home"?s[0]:s[s.length-1]).focus()}}_syncOpenUi(){if(!this.isConnected)return;if(!this.root.querySelector(".root")){this.requestRender();return}const e=this.getAttribute("mode")==="fab"?"fab":"bar",i=this.hasAttribute("collapsible")||e==="fab",t=this.open||!i&&e==="bar",n=this.getAttribute("label")||"Quick actions",r=this.root.querySelector(".toggle");r&&(r.textContent=t?"−":"+",r.setAttribute("aria-label",n),r.setAttribute("aria-expanded",t?"true":"false"));const o=this.root.querySelector(".actions");o&&(t?o.removeAttribute("hidden"):o.setAttribute("hidden","")),this._syncActionAccessibility(t)}render(){const e=this.getAttribute("mode")==="fab"?"fab":"bar",i=this.hasAttribute("collapsible")||e==="fab",t=this.open||!i&&e==="bar",n=this.getAttribute("label")||"Quick actions",r=this._actionsId(),o=this.getAttribute("orientation")==="vertical"||e==="fab"?"vertical":"horizontal";this.setContent(`
201
- <style>${p}</style>
202
- <section class="root" part="root" role="toolbar" aria-label="${l(n)}" aria-orientation="${o}">
203
- ${i?`<button type="button" class="toggle" part="toggle" aria-label="${l(n)}" aria-controls="${r}" aria-haspopup="true" aria-expanded="${t?"true":"false"}">${t?"−":"+"}</button>`:""}
204
- <div id="${r}" class="actions" part="actions" role="group" aria-label="${l(n)} list" ${t?"":"hidden"}>
200
+ `;let p=0;function l(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class d extends b.ElementBase{constructor(){super(),this._instanceId=++p,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["open","mode","orientation","variant","floating","placement","collapsible","label","headless"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.getAttribute("mode")!=="fab"&&!this.hasAttribute("collapsible")&&!this.hasAttribute("open")&&this.setAttribute("open","")}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),super.disconnectedCallback()}attributeChangedCallback(e,o,t){if(o!==t){if(e==="open"){this._syncOpenUi();return}this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){const o=typeof e=="boolean"?e:!this.open;this.open=o;const t={open:o};this.dispatchEvent(new CustomEvent(o?"open":"close",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("toggle",{detail:t,bubbles:!0,composed:!0}))}_actions(){const e=this.root.querySelector('slot[name="action"]');return e?e.assignedElements({flatten:!0}).filter(o=>o instanceof HTMLElement):[]}_actionsId(){return`ui-quick-actions-${this._instanceId}-actions`}_syncActionAccessibility(e){this._actions().forEach((t,r)=>{if(t.id||(t.id=`ui-quick-actions-${this._instanceId}-action-${r+1}`),t.hasAttribute("role")||t.setAttribute("role","button"),!t.hasAttribute("aria-label")){const i=t.textContent?.trim();i&&t.setAttribute("aria-label",i)}if(e){const i=t.getAttribute("data-ui-quick-tabindex");i!=null?(i==="__none__"?t.removeAttribute("tabindex"):t.setAttribute("tabindex",i),t.removeAttribute("data-ui-quick-tabindex")):t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false");return}t.hasAttribute("data-ui-quick-tabindex")||t.setAttribute("data-ui-quick-tabindex",t.getAttribute("tabindex")??"__none__"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true")})}_onClick(e){const o=e.target;if(!o)return;if(o.closest(".toggle")){this.toggle();return}const r=e.composedPath(),i=this._actions(),n=i.find(s=>r.includes(s));if(!n)return;const a=i.indexOf(n),c={index:a,id:n.id||n.getAttribute("data-id")||String(a+1),label:n.getAttribute("aria-label")||n.textContent?.trim()||`Action ${a+1}`};this.dispatchEvent(new CustomEvent("select",{detail:c,bubbles:!0,composed:!0})),this.getAttribute("mode")==="fab"&&this.hide()}_moveFocus(e,o){const t=this._actions();if(!t.length)return;const r=t.indexOf(e);if(r<0)return;const i=(r+o+t.length)%t.length;t[i].focus()}_onKeyDown(e){if(e.key==="Escape"&&this.open&&this.getAttribute("mode")==="fab"){e.preventDefault(),this.hide();return}const o=e.target;if(!o)return;const r=this._actions().find(s=>s===o||s.contains(o));if(!r)return;const i=this.getAttribute("orientation")==="vertical"||this.getAttribute("mode")==="fab",n=!i&&getComputedStyle(this).direction==="rtl",a=i?"ArrowDown":n?"ArrowLeft":"ArrowRight",c=i?"ArrowUp":n?"ArrowRight":"ArrowLeft";if(e.key===a){e.preventDefault(),this._moveFocus(r,1);return}if(e.key===c){e.preventDefault(),this._moveFocus(r,-1);return}if(e.key==="Home"||e.key==="End"){e.preventDefault();const s=this._actions();if(!s.length)return;(e.key==="Home"?s[0]:s[s.length-1]).focus()}}_syncOpenUi(){if(!this.isConnected)return;if(!this.root.querySelector(".root")){this.requestRender();return}const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this.root.querySelector(".toggle");i&&(i.textContent=t?"−":"+",i.setAttribute("aria-label",r),i.setAttribute("aria-expanded",t?"true":"false"));const n=this.root.querySelector(".actions");n&&(t?n.removeAttribute("hidden"):n.setAttribute("hidden","")),this._syncActionAccessibility(t)}render(){const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this._actionsId(),n=this.getAttribute("orientation")==="vertical"||e==="fab"?"vertical":"horizontal";this.setContent(`
201
+ <style>${h}</style>
202
+ <section class="root" part="root" role="toolbar" aria-label="${l(r)}" aria-orientation="${n}">
203
+ ${o?`<button type="button" class="toggle" part="toggle" aria-label="${l(r)}" aria-controls="${i}" aria-haspopup="true" aria-expanded="${t?"true":"false"}">${t?"−":"+"}</button>`:""}
204
+ <div id="${i}" class="actions" part="actions" role="group" aria-label="${l(r)} list" ${t?"":"hidden"}>
205
205
  <slot name="action"></slot>
206
206
  </div>
207
207
  </section>
@@ -1,5 +1,5 @@
1
- import { E as b } from "./ElementBase-909688f3.mjs";
2
- const h = `
1
+ import { E as d } from "./ElementBase-YlTLMsGk.mjs";
2
+ const b = `
3
3
  :host {
4
4
  --ui-quick-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 95%, transparent);
5
5
  --ui-quick-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent);
@@ -199,13 +199,13 @@ const h = `
199
199
  }
200
200
  }
201
201
  `;
202
- let p = 0;
202
+ let h = 0;
203
203
  function l(u) {
204
204
  return u.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
205
205
  }
206
- class g extends b {
206
+ class p extends d {
207
207
  constructor() {
208
- super(), this._instanceId = ++p, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
208
+ super(), this._instanceId = ++h, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
209
209
  }
210
210
  static get observedAttributes() {
211
211
  return [
@@ -226,8 +226,8 @@ class g extends b {
226
226
  disconnectedCallback() {
227
227
  this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), super.disconnectedCallback();
228
228
  }
229
- attributeChangedCallback(e, i, t) {
230
- if (i !== t) {
229
+ attributeChangedCallback(e, o, t) {
230
+ if (o !== t) {
231
231
  if (e === "open") {
232
232
  this._syncOpenUi();
233
233
  return;
@@ -248,116 +248,106 @@ class g extends b {
248
248
  this.toggle(!1);
249
249
  }
250
250
  toggle(e) {
251
- const i = typeof e == "boolean" ? e : !this.open;
252
- this.open = i;
253
- const t = { open: i };
254
- this.dispatchEvent(new CustomEvent(i ? "open" : "close", { detail: t, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("toggle", { detail: t, bubbles: !0, composed: !0 }));
251
+ const o = typeof e == "boolean" ? e : !this.open;
252
+ this.open = o;
253
+ const t = { open: o };
254
+ this.dispatchEvent(new CustomEvent(o ? "open" : "close", { detail: t, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("toggle", { detail: t, bubbles: !0, composed: !0 }));
255
255
  }
256
256
  _actions() {
257
257
  const e = this.root.querySelector('slot[name="action"]');
258
- return e ? e.assignedElements({ flatten: !0 }).filter((i) => i instanceof HTMLElement) : [];
258
+ return e ? e.assignedElements({ flatten: !0 }).filter((o) => o instanceof HTMLElement) : [];
259
259
  }
260
260
  _actionsId() {
261
261
  return `ui-quick-actions-${this._instanceId}-actions`;
262
262
  }
263
263
  _syncActionAccessibility(e) {
264
- this._actions().forEach((t, n) => {
265
- var r;
266
- if (t.id || (t.id = `ui-quick-actions-${this._instanceId}-action-${n + 1}`), t.hasAttribute("role") || t.setAttribute("role", "button"), !t.hasAttribute("aria-label")) {
267
- const o = (r = t.textContent) == null ? void 0 : r.trim();
268
- o && t.setAttribute("aria-label", o);
264
+ this._actions().forEach((t, r) => {
265
+ if (t.id || (t.id = `ui-quick-actions-${this._instanceId}-action-${r + 1}`), t.hasAttribute("role") || t.setAttribute("role", "button"), !t.hasAttribute("aria-label")) {
266
+ const i = t.textContent?.trim();
267
+ i && t.setAttribute("aria-label", i);
269
268
  }
270
269
  if (e) {
271
- const o = t.getAttribute("data-ui-quick-tabindex");
272
- o != null ? (o === "__none__" ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", o), t.removeAttribute("data-ui-quick-tabindex")) : t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"), t.setAttribute("aria-hidden", "false");
270
+ const i = t.getAttribute("data-ui-quick-tabindex");
271
+ i != null ? (i === "__none__" ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", i), t.removeAttribute("data-ui-quick-tabindex")) : t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"), t.setAttribute("aria-hidden", "false");
273
272
  return;
274
273
  }
275
274
  t.hasAttribute("data-ui-quick-tabindex") || t.setAttribute("data-ui-quick-tabindex", t.getAttribute("tabindex") ?? "__none__"), t.setAttribute("tabindex", "-1"), t.setAttribute("aria-hidden", "true");
276
275
  });
277
276
  }
278
277
  _onClick(e) {
279
- var s;
280
- const i = e.target;
281
- if (!i)
282
- return;
283
- if (i.closest(".toggle")) {
278
+ const o = e.target;
279
+ if (!o) return;
280
+ if (o.closest(".toggle")) {
284
281
  this.toggle();
285
282
  return;
286
283
  }
287
- const n = e.composedPath(), r = this._actions(), o = r.find((d) => n.includes(d));
288
- if (!o)
289
- return;
290
- const a = r.indexOf(o), c = {
284
+ const r = e.composedPath(), i = this._actions(), n = i.find((s) => r.includes(s));
285
+ if (!n) return;
286
+ const a = i.indexOf(n), c = {
291
287
  index: a,
292
- id: o.id || o.getAttribute("data-id") || String(a + 1),
293
- label: o.getAttribute("aria-label") || ((s = o.textContent) == null ? void 0 : s.trim()) || `Action ${a + 1}`
288
+ id: n.id || n.getAttribute("data-id") || String(a + 1),
289
+ label: n.getAttribute("aria-label") || n.textContent?.trim() || `Action ${a + 1}`
294
290
  };
295
291
  this.dispatchEvent(new CustomEvent("select", { detail: c, bubbles: !0, composed: !0 })), this.getAttribute("mode") === "fab" && this.hide();
296
292
  }
297
- _moveFocus(e, i) {
293
+ _moveFocus(e, o) {
298
294
  const t = this._actions();
299
- if (!t.length)
300
- return;
301
- const n = t.indexOf(e);
302
- if (n < 0)
303
- return;
304
- const r = (n + i + t.length) % t.length;
305
- t[r].focus();
295
+ if (!t.length) return;
296
+ const r = t.indexOf(e);
297
+ if (r < 0) return;
298
+ const i = (r + o + t.length) % t.length;
299
+ t[i].focus();
306
300
  }
307
301
  _onKeyDown(e) {
308
302
  if (e.key === "Escape" && this.open && this.getAttribute("mode") === "fab") {
309
303
  e.preventDefault(), this.hide();
310
304
  return;
311
305
  }
312
- const i = e.target;
313
- if (!i)
314
- return;
315
- const n = this._actions().find((s) => s === i || s.contains(i));
316
- if (!n)
317
- return;
318
- const r = this.getAttribute("orientation") === "vertical" || this.getAttribute("mode") === "fab", o = !r && getComputedStyle(this).direction === "rtl", a = r ? "ArrowDown" : o ? "ArrowLeft" : "ArrowRight", c = r ? "ArrowUp" : o ? "ArrowRight" : "ArrowLeft";
306
+ const o = e.target;
307
+ if (!o) return;
308
+ const r = this._actions().find((s) => s === o || s.contains(o));
309
+ if (!r) return;
310
+ const i = this.getAttribute("orientation") === "vertical" || this.getAttribute("mode") === "fab", n = !i && getComputedStyle(this).direction === "rtl", a = i ? "ArrowDown" : n ? "ArrowLeft" : "ArrowRight", c = i ? "ArrowUp" : n ? "ArrowRight" : "ArrowLeft";
319
311
  if (e.key === a) {
320
- e.preventDefault(), this._moveFocus(n, 1);
312
+ e.preventDefault(), this._moveFocus(r, 1);
321
313
  return;
322
314
  }
323
315
  if (e.key === c) {
324
- e.preventDefault(), this._moveFocus(n, -1);
316
+ e.preventDefault(), this._moveFocus(r, -1);
325
317
  return;
326
318
  }
327
319
  if (e.key === "Home" || e.key === "End") {
328
320
  e.preventDefault();
329
321
  const s = this._actions();
330
- if (!s.length)
331
- return;
322
+ if (!s.length) return;
332
323
  (e.key === "Home" ? s[0] : s[s.length - 1]).focus();
333
324
  }
334
325
  }
335
326
  _syncOpenUi() {
336
- if (!this.isConnected)
337
- return;
327
+ if (!this.isConnected) return;
338
328
  if (!this.root.querySelector(".root")) {
339
329
  this.requestRender();
340
330
  return;
341
331
  }
342
- const e = this.getAttribute("mode") === "fab" ? "fab" : "bar", i = this.hasAttribute("collapsible") || e === "fab", t = this.open || !i && e === "bar", n = this.getAttribute("label") || "Quick actions", r = this.root.querySelector(".toggle");
343
- r && (r.textContent = t ? "−" : "+", r.setAttribute("aria-label", n), r.setAttribute("aria-expanded", t ? "true" : "false"));
344
- const o = this.root.querySelector(".actions");
345
- o && (t ? o.removeAttribute("hidden") : o.setAttribute("hidden", "")), this._syncActionAccessibility(t);
332
+ const e = this.getAttribute("mode") === "fab" ? "fab" : "bar", o = this.hasAttribute("collapsible") || e === "fab", t = this.open || !o && e === "bar", r = this.getAttribute("label") || "Quick actions", i = this.root.querySelector(".toggle");
333
+ i && (i.textContent = t ? "−" : "+", i.setAttribute("aria-label", r), i.setAttribute("aria-expanded", t ? "true" : "false"));
334
+ const n = this.root.querySelector(".actions");
335
+ n && (t ? n.removeAttribute("hidden") : n.setAttribute("hidden", "")), this._syncActionAccessibility(t);
346
336
  }
347
337
  render() {
348
- const e = this.getAttribute("mode") === "fab" ? "fab" : "bar", i = this.hasAttribute("collapsible") || e === "fab", t = this.open || !i && e === "bar", n = this.getAttribute("label") || "Quick actions", r = this._actionsId(), o = this.getAttribute("orientation") === "vertical" || e === "fab" ? "vertical" : "horizontal";
338
+ const e = this.getAttribute("mode") === "fab" ? "fab" : "bar", o = this.hasAttribute("collapsible") || e === "fab", t = this.open || !o && e === "bar", r = this.getAttribute("label") || "Quick actions", i = this._actionsId(), n = this.getAttribute("orientation") === "vertical" || e === "fab" ? "vertical" : "horizontal";
349
339
  this.setContent(`
350
- <style>${h}</style>
351
- <section class="root" part="root" role="toolbar" aria-label="${l(n)}" aria-orientation="${o}">
352
- ${i ? `<button type="button" class="toggle" part="toggle" aria-label="${l(n)}" aria-controls="${r}" aria-haspopup="true" aria-expanded="${t ? "true" : "false"}">${t ? "−" : "+"}</button>` : ""}
353
- <div id="${r}" class="actions" part="actions" role="group" aria-label="${l(n)} list" ${t ? "" : "hidden"}>
340
+ <style>${b}</style>
341
+ <section class="root" part="root" role="toolbar" aria-label="${l(r)}" aria-orientation="${n}">
342
+ ${o ? `<button type="button" class="toggle" part="toggle" aria-label="${l(r)}" aria-controls="${i}" aria-haspopup="true" aria-expanded="${t ? "true" : "false"}">${t ? "−" : "+"}</button>` : ""}
343
+ <div id="${i}" class="actions" part="actions" role="group" aria-label="${l(r)} list" ${t ? "" : "hidden"}>
354
344
  <slot name="action"></slot>
355
345
  </div>
356
346
  </section>
357
347
  `), this._syncActionAccessibility(t);
358
348
  }
359
349
  }
360
- typeof customElements < "u" && !customElements.get("ui-quick-actions") && customElements.define("ui-quick-actions", g);
350
+ typeof customElements < "u" && !customElements.get("ui-quick-actions") && customElements.define("ui-quick-actions", p);
361
351
  export {
362
- g as UIQuickActions
352
+ p as UIQuickActions
363
353
  };