@editora/ui-core 0.1.19 → 0.1.20

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 (299) 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 +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  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-orbiter.d.ts.map +1 -1
  57. package/dist/components/ui-skeleton.d.ts.map +1 -1
  58. package/dist/components/ui-split-button.d.ts +1 -0
  59. package/dist/components/ui-split-button.d.ts.map +1 -1
  60. package/dist/components/ui-time-picker.d.ts.map +1 -1
  61. package/dist/container.cjs.js +2 -2
  62. package/dist/container.esm.js +2 -3
  63. package/dist/context-menu.cjs.js +8 -8
  64. package/dist/context-menu.esm.js +157 -219
  65. package/dist/control-group.cjs.js +1 -1
  66. package/dist/control-group.esm.js +2 -3
  67. package/dist/data-table.cjs.js +4 -4
  68. package/dist/data-table.esm.js +299 -381
  69. package/dist/date-field.cjs.js +3 -3
  70. package/dist/date-field.esm.js +68 -80
  71. package/dist/date-picker.cjs.js +9 -9
  72. package/dist/date-picker.esm.js +69 -97
  73. package/dist/date-range-picker.cjs.js +3 -3
  74. package/dist/date-range-picker.esm.js +32 -56
  75. package/dist/date-range-time-picker.cjs.js +9 -9
  76. package/dist/date-range-time-picker.esm.js +111 -140
  77. package/dist/date-time-picker.cjs.js +4 -4
  78. package/dist/date-time-picker.esm.js +112 -144
  79. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  80. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  81. package/dist/description.cjs.js +1 -1
  82. package/dist/description.esm.js +3 -5
  83. package/dist/dialog.cjs.js +12 -12
  84. package/dist/dialog.esm.js +44 -63
  85. package/dist/direction-provider.cjs.js +1 -1
  86. package/dist/direction-provider.esm.js +2 -3
  87. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  88. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  89. package/dist/dismissable-layer.cjs.js +2 -2
  90. package/dist/dismissable-layer.esm.js +4 -6
  91. package/dist/dock.cjs.js +5 -5
  92. package/dist/dock.esm.js +134 -155
  93. package/dist/drawer.cjs.js +2 -2
  94. package/dist/drawer.esm.js +18 -35
  95. package/dist/dropdown.cjs.js +2 -2
  96. package/dist/dropdown.esm.js +119 -149
  97. package/dist/dropzone.cjs.js +1 -1
  98. package/dist/dropzone.esm.js +0 -1
  99. package/dist/empty-state.cjs.js +1 -1
  100. package/dist/empty-state.esm.js +1 -1
  101. package/dist/field-error.cjs.js +1 -1
  102. package/dist/field-error.esm.js +3 -5
  103. package/dist/field.cjs.js +5 -5
  104. package/dist/field.esm.js +27 -34
  105. package/dist/fieldset.cjs.js +4 -4
  106. package/dist/fieldset.esm.js +19 -24
  107. package/dist/file-upload.cjs.js +4 -4
  108. package/dist/file-upload.esm.js +69 -93
  109. package/dist/flex.cjs.js +1 -1
  110. package/dist/flex.esm.js +5 -9
  111. package/dist/floating-toolbar.cjs.js +4 -4
  112. package/dist/floating-toolbar.esm.js +60 -85
  113. package/dist/focus-scope-Bwug2gDv.js +1 -0
  114. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  115. package/dist/focus-scope.cjs.js +2 -2
  116. package/dist/focus-scope.esm.js +15 -20
  117. package/dist/form.cjs.js +2 -2
  118. package/dist/form.esm.js +26 -53
  119. package/dist/gantt.cjs.js +43 -43
  120. package/dist/gantt.esm.js +295 -322
  121. package/dist/grid.cjs.js +1 -1
  122. package/dist/grid.esm.js +5 -9
  123. package/dist/hover-card.cjs.js +4 -4
  124. package/dist/hover-card.esm.js +22 -28
  125. package/dist/icon-cloud.cjs.js +7 -7
  126. package/dist/icon-cloud.esm.js +48 -62
  127. package/dist/icon.cjs.js +1 -1
  128. package/dist/icon.esm.js +2 -4
  129. package/dist/index.cjs.js +1 -1
  130. package/dist/index.esm.js +378 -390
  131. package/dist/inline-edit.cjs.js +11 -11
  132. package/dist/inline-edit.esm.js +32 -36
  133. package/dist/input.cjs.js +17 -17
  134. package/dist/input.esm.js +50 -63
  135. package/dist/label.cjs.js +2 -2
  136. package/dist/label.esm.js +8 -17
  137. package/dist/layout.cjs.js +2 -2
  138. package/dist/layout.esm.js +20 -26
  139. package/dist/listbox-B6QgECax.js +46 -0
  140. package/dist/listbox-DJamVeFj.mjs +200 -0
  141. package/dist/listbox.cjs.js +1 -1
  142. package/dist/listbox.esm.js +2 -4
  143. package/dist/marquee.cjs.js +5 -5
  144. package/dist/marquee.esm.js +33 -50
  145. package/dist/masonry-grid.cjs.js +1 -1
  146. package/dist/masonry-grid.esm.js +5 -9
  147. package/dist/menu.cjs.js +3 -3
  148. package/dist/menu.esm.js +106 -126
  149. package/dist/menubar.cjs.js +5 -5
  150. package/dist/menubar.esm.js +118 -164
  151. package/dist/meter.cjs.js +2 -2
  152. package/dist/meter.esm.js +4 -4
  153. package/dist/multi-select.cjs.js +4 -4
  154. package/dist/multi-select.esm.js +120 -140
  155. package/dist/navigation-menu.cjs.js +4 -4
  156. package/dist/navigation-menu.esm.js +44 -55
  157. package/dist/number-field.cjs.js +2 -2
  158. package/dist/number-field.esm.js +73 -98
  159. package/dist/number-ticker.cjs.js +3 -3
  160. package/dist/number-ticker.esm.js +22 -43
  161. package/dist/odometer.cjs.js +1 -1
  162. package/dist/odometer.esm.js +5 -9
  163. package/dist/orbiter.cjs.js +13 -13
  164. package/dist/orbiter.esm.js +79 -90
  165. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  166. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  167. package/dist/pagination.cjs.js +2 -2
  168. package/dist/pagination.esm.js +14 -18
  169. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  170. package/dist/panel-group-CaD0_KQf.js +36 -0
  171. package/dist/panel-group.cjs.js +1 -1
  172. package/dist/panel-group.esm.js +2 -5
  173. package/dist/panel.cjs.js +4 -4
  174. package/dist/panel.esm.js +8 -10
  175. package/dist/password-field.cjs.js +9 -9
  176. package/dist/password-field.esm.js +62 -82
  177. package/dist/pin-input.cjs.js +3 -3
  178. package/dist/pin-input.esm.js +33 -39
  179. package/dist/placement-grid.cjs.js +4 -4
  180. package/dist/placement-grid.esm.js +108 -131
  181. package/dist/plugin-panel.cjs.js +7 -7
  182. package/dist/plugin-panel.esm.js +13 -15
  183. package/dist/popover.cjs.js +2 -2
  184. package/dist/popover.esm.js +21 -31
  185. package/dist/portal-DgpQ3Jo1.js +1 -0
  186. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  187. package/dist/portal.cjs.js +2 -2
  188. package/dist/portal.esm.js +10 -19
  189. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  190. package/dist/positioner-D_fqyx_j.js +1 -0
  191. package/dist/positioner.cjs.js +2 -2
  192. package/dist/positioner.esm.js +11 -18
  193. package/dist/presence.cjs.js +1 -1
  194. package/dist/presence.esm.js +7 -13
  195. package/dist/progress.cjs.js +1 -1
  196. package/dist/progress.esm.js +5 -9
  197. package/dist/quick-actions.cjs.js +6 -6
  198. package/dist/quick-actions.esm.js +52 -62
  199. package/dist/radio-group.cjs.js +13 -13
  200. package/dist/radio-group.esm.js +39 -51
  201. package/dist/radio.cjs.js +1 -1
  202. package/dist/radio.esm.js +5 -9
  203. package/dist/rating.cjs.js +1 -1
  204. package/dist/rating.esm.js +12 -23
  205. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  206. package/dist/roving-focus-group.cjs.js +1 -1
  207. package/dist/roving-focus-group.esm.js +3 -5
  208. package/dist/runtime-CTaOSmBj.js +1 -0
  209. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  210. package/dist/runtime.cjs.js +1 -1
  211. package/dist/runtime.esm.js +6 -6
  212. package/dist/scroll-area.cjs.js +3 -3
  213. package/dist/scroll-area.esm.js +38 -46
  214. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  215. package/dist/section.cjs.js +1 -1
  216. package/dist/section.esm.js +1 -1
  217. package/dist/select.cjs.js +7 -7
  218. package/dist/select.esm.js +67 -97
  219. package/dist/selection-popup.cjs.js +1 -1
  220. package/dist/selection-popup.esm.js +8 -15
  221. package/dist/separator.cjs.js +1 -1
  222. package/dist/separator.esm.js +1 -1
  223. package/dist/sidebar.cjs.js +18 -18
  224. package/dist/sidebar.esm.js +117 -139
  225. package/dist/skeleton.cjs.js +11 -11
  226. package/dist/skeleton.esm.js +27 -24
  227. package/dist/slider.cjs.js +1 -1
  228. package/dist/slider.esm.js +6 -11
  229. package/dist/slot.cjs.js +4 -4
  230. package/dist/slot.esm.js +16 -19
  231. package/dist/sortable.cjs.js +45 -45
  232. package/dist/sortable.esm.js +421 -524
  233. package/dist/spinning-text.cjs.js +12 -12
  234. package/dist/spinning-text.esm.js +80 -92
  235. package/dist/split-button.cjs.js +4 -4
  236. package/dist/split-button.esm.js +77 -62
  237. package/dist/splitter.cjs.js +1 -1
  238. package/dist/splitter.esm.js +1 -1
  239. package/dist/stepper.cjs.js +8 -8
  240. package/dist/stepper.esm.js +32 -52
  241. package/dist/switch.cjs.js +7 -7
  242. package/dist/switch.esm.js +23 -31
  243. package/dist/table.cjs.js +2 -2
  244. package/dist/table.esm.js +46 -56
  245. package/dist/tabs.cjs.js +3 -3
  246. package/dist/tabs.esm.js +35 -55
  247. package/dist/tags-input.cjs.js +4 -4
  248. package/dist/tags-input.esm.js +45 -62
  249. package/dist/textarea.cjs.js +6 -6
  250. package/dist/textarea.esm.js +32 -41
  251. package/dist/time-field.cjs.js +4 -4
  252. package/dist/time-field.esm.js +70 -84
  253. package/dist/time-picker.cjs.js +22 -22
  254. package/dist/time-picker.esm.js +88 -110
  255. package/dist/timeline.cjs.js +1 -1
  256. package/dist/timeline.esm.js +3 -5
  257. package/dist/toast.cjs.js +2 -2
  258. package/dist/toast.esm.js +33 -47
  259. package/dist/toggle-group.cjs.js +6 -6
  260. package/dist/toggle-group.esm.js +85 -105
  261. package/dist/toggle.cjs.js +1 -1
  262. package/dist/toggle.esm.js +3 -5
  263. package/dist/toolbar.cjs.js +1 -1
  264. package/dist/toolbar.esm.js +13 -24
  265. package/dist/tooltip.cjs.js +2 -2
  266. package/dist/tooltip.esm.js +31 -42
  267. package/dist/transfer-list.cjs.js +19 -19
  268. package/dist/transfer-list.esm.js +98 -111
  269. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  270. package/dist/tree-Dx_kv_ih.js +39 -0
  271. package/dist/tree-item.cjs.js +2 -2
  272. package/dist/tree-item.esm.js +2 -3
  273. package/dist/tree.cjs.js +1 -1
  274. package/dist/tree.esm.js +2 -5
  275. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  276. package/dist/ui-button-rXQOS9QJ.js +521 -0
  277. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  278. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  279. package/dist/visually-hidden.cjs.js +1 -1
  280. package/dist/visually-hidden.esm.js +1 -1
  281. package/dist/wizard.cjs.js +14 -14
  282. package/dist/wizard.esm.js +85 -105
  283. package/package.json +2 -2
  284. package/dist/date-time-utils-66480de4.js +0 -1
  285. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  286. package/dist/dismissable-layer-193e3bed.js +0 -1
  287. package/dist/focus-scope-2b12b4e7.js +0 -1
  288. package/dist/listbox-308789a0.mjs +0 -210
  289. package/dist/listbox-ef2f708e.js +0 -46
  290. package/dist/panel-group-40254cdd.js +0 -36
  291. package/dist/portal-c69756c0.js +0 -1
  292. package/dist/positioner-33529bb8.js +0 -1
  293. package/dist/runtime-3f13807b.js +0 -1
  294. package/dist/tree-0a7a8d05.js +0 -39
  295. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  296. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  297. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  298. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  299. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { E as c } from "./ElementBase-909688f3.mjs";
2
- import { l as b } from "./positioner-e9770c66.mjs";
3
- const f = `
1
+ import { E as u } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { e as h } from "./positioner-D0VGxtYU.mjs";
3
+ const d = `
4
4
  :host {
5
5
  position: fixed;
6
6
  inset: 0;
@@ -203,41 +203,38 @@ const f = `
203
203
  }
204
204
  }
205
205
  `;
206
- function p(i, t) {
207
- if (i == null || i === "")
208
- return t;
209
- const e = Number(i);
206
+ function c(o, t) {
207
+ if (o == null || o === "") return t;
208
+ const e = Number(o);
210
209
  return Number.isFinite(e) ? e : t;
211
210
  }
212
- function h(i, t) {
213
- if (i == null)
214
- return t;
215
- const e = i.trim().toLowerCase();
211
+ function a(o, t) {
212
+ if (o == null) return t;
213
+ const e = o.trim().toLowerCase();
216
214
  return e !== "false" && e !== "0" && e !== "off";
217
215
  }
218
- function g(i) {
219
- if (!document.body.contains(i))
220
- return !1;
221
- const t = window.getComputedStyle(i);
216
+ function b(o) {
217
+ if (!document.body.contains(o)) return !1;
218
+ const t = window.getComputedStyle(o);
222
219
  return !(t.display === "none" || t.visibility === "hidden" || Number.parseFloat(t.opacity || "1") <= 0);
223
220
  }
224
- function _(i) {
225
- return i === "top" || i === "bottom" ? i : "auto";
221
+ function f(o) {
222
+ return o === "top" || o === "bottom" ? o : "auto";
226
223
  }
227
- function m(i) {
228
- return i === "start" || i === "end" ? i : "center";
224
+ function p(o) {
225
+ return o === "start" || o === "end" ? o : "center";
229
226
  }
230
- function v(i, t) {
231
- const e = i === "top" ? "top" : "bottom";
227
+ function g(o, t) {
228
+ const e = o === "top" ? "top" : "bottom";
232
229
  return t === "start" ? `${e}-start` : t === "end" ? `${e}-end` : e;
233
230
  }
234
- function y(i) {
231
+ function _(o) {
235
232
  const t = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', e = [];
236
- return i.forEach((o) => {
237
- o instanceof HTMLElement && (o.matches(t) && e.push(o), e.push(...Array.from(o.querySelectorAll(t))));
233
+ return o.forEach((i) => {
234
+ i instanceof HTMLElement && (i.matches(t) && e.push(i), e.push(...Array.from(i.querySelectorAll(t))));
238
235
  }), Array.from(new Set(e));
239
236
  }
240
- class w extends c {
237
+ class m extends u {
241
238
  constructor() {
242
239
  super(...arguments), this._anchor = null, this._panel = null, this._toolbarSlot = null, this._defaultSlot = null, this._raf = null, this._resizeObserver = null, this._mutationObserver = null, this._positioner = null, this._positionerPlacement = null, this._positionerOffset = 0, this._globalListenersBound = !1, this._isOpen = !1, this._closeReason = "programmatic", this._onWindowChangeBound = this._onWindowChange.bind(this), this._onDocumentPointerDownBound = this._onDocumentPointerDown.bind(this), this._onDocumentKeyDownBound = this._onDocumentKeyDown.bind(this), this._onPanelKeyDownBound = this._onPanelKeyDown.bind(this), this._onSlotChangeBound = this._onSlotChange.bind(this);
243
240
  }
@@ -265,11 +262,10 @@ class w extends c {
265
262
  super.connectedCallback(), this._syncAnchorFromAttribute(), this._syncOpenState(), this._schedulePosition();
266
263
  }
267
264
  disconnectedCallback() {
268
- var t;
269
- this._unbindGlobalListeners(), this._teardownObservers(), (t = this._positioner) == null || t.destroy(), this._positioner = null, this._raf != null && (cancelAnimationFrame(this._raf), this._raf = null), super.disconnectedCallback();
265
+ this._unbindGlobalListeners(), this._teardownObservers(), this._positioner?.destroy(), this._positioner = null, this._raf != null && (cancelAnimationFrame(this._raf), this._raf = null), super.disconnectedCallback();
270
266
  }
271
- attributeChangedCallback(t, e, o) {
272
- if (e !== o) {
267
+ attributeChangedCallback(t, e, i) {
268
+ if (e !== i) {
273
269
  if (t === "anchor-id") {
274
270
  this._syncAnchorFromAttribute(), this.hasAttribute("open") && !this._anchor && this._requestClose("anchor-missing"), this._schedulePosition();
275
271
  return;
@@ -294,8 +290,7 @@ class w extends c {
294
290
  }
295
291
  }
296
292
  showForAnchorId(t) {
297
- if (this.hasAttribute("disabled") || !t)
298
- return;
293
+ if (this.hasAttribute("disabled") || !t) return;
299
294
  const e = document.getElementById(t);
300
295
  if (!e) {
301
296
  this._requestClose("anchor-missing");
@@ -313,7 +308,6 @@ class w extends c {
313
308
  this.hasAttribute("open") && (this._closeReason = t, this.removeAttribute("open"));
314
309
  }
315
310
  _syncOpenState() {
316
- var e;
317
311
  const t = this.hasAttribute("open") && !this.hasAttribute("headless") && !this.hasAttribute("disabled");
318
312
  if (t === this._isOpen) {
319
313
  t && this._schedulePosition();
@@ -323,7 +317,7 @@ class w extends c {
323
317
  this._bindGlobalListeners(), this._ensureObservers(), this._dispatchOpenEvents(), this._schedulePosition();
324
318
  return;
325
319
  }
326
- this._unbindGlobalListeners(), this._teardownObservers(), (e = this._positioner) == null || e.destroy(), this._positioner = null, this._positionerPlacement = null, this._positionerOffset = 0, this._raf != null && (cancelAnimationFrame(this._raf), this._raf = null), this._dispatchCloseEvents(this._closeReason), this._closeReason = "programmatic";
320
+ this._unbindGlobalListeners(), this._teardownObservers(), this._positioner?.destroy(), this._positioner = null, this._positionerPlacement = null, this._positionerOffset = 0, this._raf != null && (cancelAnimationFrame(this._raf), this._raf = null), this._dispatchCloseEvents(this._closeReason), this._closeReason = "programmatic";
327
321
  }
328
322
  _dispatchOpenEvents() {
329
323
  this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })), this.dispatchEvent(
@@ -350,8 +344,7 @@ class w extends c {
350
344
  );
351
345
  }
352
346
  _requestClose(t) {
353
- if (!this.hasAttribute("open"))
354
- return;
347
+ if (!this.hasAttribute("open")) return;
355
348
  const e = new CustomEvent("request-close", {
356
349
  detail: { reason: t },
357
350
  bubbles: !0,
@@ -359,13 +352,13 @@ class w extends c {
359
352
  cancelable: !0
360
353
  });
361
354
  this.dispatchEvent(e);
362
- const o = new CustomEvent("ui-request-close", {
355
+ const i = new CustomEvent("ui-request-close", {
363
356
  detail: { reason: t },
364
357
  bubbles: !0,
365
358
  composed: !0,
366
359
  cancelable: !0
367
360
  });
368
- this.dispatchEvent(o), !(e.defaultPrevented || o.defaultPrevented) && this.closeToolbar(t);
361
+ this.dispatchEvent(i), !(e.defaultPrevented || i.defaultPrevented) && this.closeToolbar(t);
369
362
  }
370
363
  _syncAnchorFromAttribute() {
371
364
  const t = this.getAttribute("anchor-id");
@@ -416,25 +409,22 @@ class w extends c {
416
409
  this._globalListenersBound && (window.removeEventListener("scroll", this._onWindowChangeBound, !0), window.removeEventListener("resize", this._onWindowChangeBound), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound, !0), this._globalListenersBound = !1);
417
410
  }
418
411
  _position() {
419
- var s, a;
420
- if (!this.hasAttribute("open") || this.hasAttribute("headless") || this.hasAttribute("disabled"))
421
- return;
412
+ if (!this.hasAttribute("open") || this.hasAttribute("headless") || this.hasAttribute("disabled")) return;
422
413
  if (!this._anchor) {
423
414
  this._requestClose("anchor-missing");
424
415
  return;
425
416
  }
426
- if (!g(this._anchor)) {
417
+ if (!b(this._anchor)) {
427
418
  this._requestClose("anchor-hidden");
428
419
  return;
429
420
  }
430
- if (!this._panel)
431
- return;
432
- const t = Math.max(0, p(this.getAttribute("offset"), 8)), e = _(this.getAttribute("placement")), o = m(this.getAttribute("align")), n = v(e, o);
433
- if (!this._positioner || this._positionerPlacement !== n || this._positionerOffset !== t) {
434
- (s = this._positioner) == null || s.destroy(), this._positioner = b({
421
+ if (!this._panel) return;
422
+ const t = Math.max(0, c(this.getAttribute("offset"), 8)), e = f(this.getAttribute("placement")), i = p(this.getAttribute("align")), r = g(e, i);
423
+ if (!this._positioner || this._positionerPlacement !== r || this._positionerOffset !== t) {
424
+ this._positioner?.destroy(), this._positioner = h({
435
425
  anchor: this._anchor,
436
426
  floating: this._panel,
437
- placement: n,
427
+ placement: r,
438
428
  strategy: "fixed",
439
429
  offset: t,
440
430
  flip: !0,
@@ -447,72 +437,57 @@ class w extends c {
447
437
  observeLayoutShift: !1,
448
438
  observeAnchorResize: !1,
449
439
  observeFloatingResize: !1,
450
- onUpdate: (l) => {
451
- var u;
452
- const d = l.placement.startsWith("top") ? "top" : "bottom";
453
- this.style.setProperty("--ui-floating-toolbar-origin-x", o === "start" ? "0%" : o === "end" ? "100%" : "50%"), (u = this._panel) == null || u.setAttribute("data-side", d);
440
+ onUpdate: (s) => {
441
+ const l = s.placement.startsWith("top") ? "top" : "bottom";
442
+ this.style.setProperty("--ui-floating-toolbar-origin-x", i === "start" ? "0%" : i === "end" ? "100%" : "50%"), this._panel?.setAttribute("data-side", l);
454
443
  }
455
- }), this._positionerPlacement = n, this._positionerOffset = t;
444
+ }), this._positionerPlacement = r, this._positionerOffset = t;
456
445
  return;
457
446
  }
458
- (a = this._positioner) == null || a.update();
447
+ this._positioner?.update();
459
448
  }
460
449
  _onWindowChange() {
461
450
  this.hasAttribute("open") && this._schedulePosition();
462
451
  }
463
452
  _onDocumentPointerDown(t) {
464
- if (!this.hasAttribute("open") || !h(this.getAttribute("close-on-outside"), !0))
465
- return;
453
+ if (!this.hasAttribute("open") || !a(this.getAttribute("close-on-outside"), !0)) return;
466
454
  const e = t.composedPath();
467
455
  e.includes(this) || this._anchor && e.includes(this._anchor) || this._requestClose("outside");
468
456
  }
469
457
  _onDocumentKeyDown(t) {
470
- this.hasAttribute("open") && t.key === "Escape" && h(this.getAttribute("close-on-escape"), !0) && (t.preventDefault(), this._requestClose("escape"));
458
+ this.hasAttribute("open") && t.key === "Escape" && a(this.getAttribute("close-on-escape"), !0) && (t.preventDefault(), this._requestClose("escape"));
471
459
  }
472
460
  _onPanelKeyDown(t) {
473
- if (!this._panel || !["ArrowRight", "ArrowLeft", "Home", "End"].includes(t.key))
474
- return;
461
+ if (!this._panel || !["ArrowRight", "ArrowLeft", "Home", "End"].includes(t.key)) return;
475
462
  const e = this._getFocusableItems();
476
- if (e.length === 0)
477
- return;
478
- const o = document.activeElement, n = o ? e.indexOf(o) : -1;
479
- let r = n;
480
- t.key === "Home" ? r = 0 : t.key === "End" ? r = e.length - 1 : t.key === "ArrowRight" ? r = n < 0 ? 0 : (n + 1) % e.length : t.key === "ArrowLeft" && (r = n < 0 ? e.length - 1 : (n - 1 + e.length) % e.length);
481
- const s = e[r];
463
+ if (e.length === 0) return;
464
+ const i = document.activeElement, r = i ? e.indexOf(i) : -1;
465
+ let n = r;
466
+ t.key === "Home" ? n = 0 : t.key === "End" ? n = e.length - 1 : t.key === "ArrowRight" ? n = r < 0 ? 0 : (r + 1) % e.length : t.key === "ArrowLeft" && (n = r < 0 ? e.length - 1 : (r - 1 + e.length) % e.length);
467
+ const s = e[n];
482
468
  s && (t.preventDefault(), s.focus());
483
469
  }
484
470
  _getFocusableItems() {
485
- var o, n;
486
- const t = ((o = this._toolbarSlot) == null ? void 0 : o.assignedElements({ flatten: !0 })) || [], e = ((n = this._defaultSlot) == null ? void 0 : n.assignedElements({ flatten: !0 })) || [];
487
- return y([...t, ...e]);
471
+ const t = this._toolbarSlot?.assignedElements({ flatten: !0 }) || [], e = this._defaultSlot?.assignedElements({ flatten: !0 }) || [];
472
+ return _([...t, ...e]);
488
473
  }
489
474
  _onSlotChange() {
490
475
  this._syncRowVisibility(), this._schedulePosition();
491
476
  }
492
477
  _syncRowVisibility() {
493
- var r, s;
494
478
  const t = this.root.querySelector(".row-toolbar"), e = this.root.querySelector(".row-default");
495
- if (!t || !e)
496
- return;
497
- const o = (((r = this._toolbarSlot) == null ? void 0 : r.assignedNodes({ flatten: !0 })) || []).some((a) => {
498
- var l;
499
- return a.nodeType === Node.TEXT_NODE ? !!((l = a.textContent) != null && l.trim()) : a.nodeType === Node.ELEMENT_NODE;
500
- }), n = (((s = this._defaultSlot) == null ? void 0 : s.assignedNodes({ flatten: !0 })) || []).some((a) => {
501
- var l;
502
- return a.nodeType === Node.TEXT_NODE ? !!((l = a.textContent) != null && l.trim()) : a.nodeType === Node.ELEMENT_NODE;
503
- });
504
- o ? t.removeAttribute("hidden") : t.setAttribute("hidden", ""), n ? e.removeAttribute("hidden") : e.setAttribute("hidden", "");
479
+ if (!t || !e) return;
480
+ const i = (this._toolbarSlot?.assignedNodes({ flatten: !0 }) || []).some((n) => n.nodeType === Node.TEXT_NODE ? !!n.textContent?.trim() : n.nodeType === Node.ELEMENT_NODE), r = (this._defaultSlot?.assignedNodes({ flatten: !0 }) || []).some((n) => n.nodeType === Node.TEXT_NODE ? !!n.textContent?.trim() : n.nodeType === Node.ELEMENT_NODE);
481
+ i ? t.removeAttribute("hidden") : t.setAttribute("hidden", ""), r ? e.removeAttribute("hidden") : e.setAttribute("hidden", "");
505
482
  }
506
483
  _syncPanelA11y() {
507
- if (!this._panel)
508
- return;
484
+ if (!this._panel) return;
509
485
  const t = this.getAttribute("aria-labelledby"), e = this.getAttribute("aria-label") || (t ? null : "Floating toolbar");
510
486
  t ? this._panel.setAttribute("aria-labelledby", t) : this._panel.removeAttribute("aria-labelledby"), e ? this._panel.setAttribute("aria-label", e) : this._panel.removeAttribute("aria-label");
511
487
  }
512
488
  render() {
513
- var t, e, o, n, r, s;
514
489
  this.setContent(`
515
- <style>${f}</style>
490
+ <style>${d}</style>
516
491
  <section class="panel" part="panel" role="toolbar" aria-orientation="horizontal" tabindex="-1">
517
492
  <div class="row row-toolbar" part="row-toolbar">
518
493
  <slot name="toolbar"></slot>
@@ -521,10 +496,10 @@ class w extends c {
521
496
  <slot></slot>
522
497
  </div>
523
498
  </section>
524
- `), this._panel = this.root.querySelector(".panel"), this._toolbarSlot = this.root.querySelector('slot[name="toolbar"]'), this._defaultSlot = this.root.querySelector("slot:not([name])"), (t = this._panel) == null || t.removeEventListener("keydown", this._onPanelKeyDownBound), (e = this._panel) == null || e.addEventListener("keydown", this._onPanelKeyDownBound), (o = this._toolbarSlot) == null || o.removeEventListener("slotchange", this._onSlotChangeBound), (n = this._defaultSlot) == null || n.removeEventListener("slotchange", this._onSlotChangeBound), (r = this._toolbarSlot) == null || r.addEventListener("slotchange", this._onSlotChangeBound), (s = this._defaultSlot) == null || s.addEventListener("slotchange", this._onSlotChangeBound), this._syncPanelA11y(), this._syncRowVisibility(), this._refreshObservers(), this._schedulePosition();
499
+ `), this._panel = this.root.querySelector(".panel"), this._toolbarSlot = this.root.querySelector('slot[name="toolbar"]'), this._defaultSlot = this.root.querySelector("slot:not([name])"), this._panel?.removeEventListener("keydown", this._onPanelKeyDownBound), this._panel?.addEventListener("keydown", this._onPanelKeyDownBound), this._toolbarSlot?.removeEventListener("slotchange", this._onSlotChangeBound), this._defaultSlot?.removeEventListener("slotchange", this._onSlotChangeBound), this._toolbarSlot?.addEventListener("slotchange", this._onSlotChangeBound), this._defaultSlot?.addEventListener("slotchange", this._onSlotChangeBound), this._syncPanelA11y(), this._syncRowVisibility(), this._refreshObservers(), this._schedulePosition();
525
500
  }
526
501
  }
527
- typeof customElements < "u" && !customElements.get("ui-floating-toolbar") && customElements.define("ui-floating-toolbar", w);
502
+ typeof customElements < "u" && !customElements.get("ui-floating-toolbar") && customElements.define("ui-floating-toolbar", m);
528
503
  export {
529
- w as UIFloatingToolbar
504
+ m as UIFloatingToolbar
530
505
  };
@@ -0,0 +1 @@
1
+ "use strict";const f=[],b=["a[href]","area[href]",'input:not([type="hidden"])',"select","textarea","button","iframe","[tabindex]",'[contenteditable="true"]'].join(", ");function h(){const t=f.filter(e=>!e.paused);return t.length?t[t.length-1]:null}function y(t){return!(t.hasAttribute("disabled")||t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden")||t.getAttribute("tabindex")==="-1")}function a(t){return Array.from(t.querySelectorAll(b)).filter(y)}function d(t){t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1")}function m(t){return typeof t=="function"?t():t??null}function s(t){if(!t||!t.isConnected)return!1;try{return t.focus(),!0}catch{return!1}}function F(t){return t.querySelector('[aria-selected="true"], [data-selected="true"], [selected], [checked], [aria-current="true"]')||null}function E(t){if(!t.options.inertOthers||typeof document>"u"||!document.body)return;const e=Array.from(document.body.children);t.inerted=e.filter(r=>r!==t.options.node&&!r.contains(t.options.node)).map(r=>{const c=r.hasAttribute("inert");return c||r.setAttribute("inert",""),{element:r,hadInert:c}})}function v(t){t.inerted.forEach(({element:e,hadInert:r})=>{r||e.removeAttribute("inert")}),t.inerted=[]}function A(t){if(!(t.node instanceof HTMLElement))throw new Error("createFocusScope requires a valid HTMLElement node");const e={id:Symbol("focus-scope"),options:{trapped:!0,loop:!0,restoreFocus:!0,autoFocus:"first",inertOthers:!1,...t},paused:!1,previouslyFocused:document.activeElement instanceof HTMLElement?document.activeElement:null,inerted:[],onKeyDown:()=>{},onFocusIn:()=>{}},r=()=>{const n=a(e.options.node)[0]||null;s(n)||(d(e.options.node),s(e.options.node))},c=()=>{const n=a(e.options.node),o=n.length?n[n.length-1]:null;s(o)||(d(e.options.node),s(e.options.node))},u=()=>{const n=m(e.options.initialFocus);if(s(n))return;const o=e.options.autoFocus;if(o!=="none"){if(o==="container"){d(e.options.node),s(e.options.node);return}if(o==="selected"){const i=F(e.options.node);if(s(i))return}r()}};return e.onKeyDown=n=>{if(e.paused||h()?.id!==e.id||!e.options.trapped||n.key!=="Tab")return;const o=a(e.options.node);if(!o.length){n.preventDefault(),u();return}const i=document.activeElement instanceof HTMLElement?document.activeElement:null;if(!i||!e.options.node.contains(i)){n.preventDefault(),u();return}const l=o[0],p=o[o.length-1];if(n.shiftKey){(i===l||i===e.options.node)&&(n.preventDefault(),e.options.loop&&s(p));return}i===p&&(n.preventDefault(),e.options.loop&&s(l))},e.onFocusIn=n=>{if(e.paused||h()?.id!==e.id||!e.options.trapped)return;const o=n.target;(typeof n.composedPath=="function"?n.composedPath():[]).includes(e.options.node)||o instanceof Node&&(e.options.node.contains(o)||u())},f.push(e),E(e),document.addEventListener("keydown",e.onKeyDown,!0),document.addEventListener("focusin",e.onFocusIn,!0),u(),{destroy(){const n=f.findIndex(i=>i.id===e.id);if(n>=0&&f.splice(n,1),document.removeEventListener("keydown",e.onKeyDown,!0),document.removeEventListener("focusin",e.onFocusIn,!0),v(e),!e.options.restoreFocus)return;const o=m(e.options.finalFocus)||e.previouslyFocused;s(o)},focusFirst:r,focusLast:c,focusInitial:u,pause(){e.paused=!0},resume(){e.paused=!1}}}exports.createFocusScope=A;
@@ -1,4 +1,4 @@
1
- const a = [], y = [
1
+ const f = [], b = [
2
2
  "a[href]",
3
3
  "area[href]",
4
4
  'input:not([type="hidden"])',
@@ -9,55 +9,53 @@ const a = [], y = [
9
9
  "[tabindex]",
10
10
  '[contenteditable="true"]'
11
11
  ].join(", ");
12
- function m() {
13
- const t = a.filter((e) => !e.paused);
12
+ function h() {
13
+ const t = f.filter((e) => !e.paused);
14
14
  return t.length ? t[t.length - 1] : null;
15
15
  }
16
- function F(t) {
16
+ function y(t) {
17
17
  return !(t.hasAttribute("disabled") || t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden") || t.getAttribute("tabindex") === "-1");
18
18
  }
19
- function d(t) {
20
- return Array.from(t.querySelectorAll(y)).filter(F);
19
+ function a(t) {
20
+ return Array.from(t.querySelectorAll(b)).filter(y);
21
21
  }
22
- function l(t) {
22
+ function d(t) {
23
23
  t.hasAttribute("tabindex") || t.setAttribute("tabindex", "-1");
24
24
  }
25
- function b(t) {
25
+ function m(t) {
26
26
  return typeof t == "function" ? t() : t ?? null;
27
27
  }
28
28
  function s(t) {
29
- if (!t || !t.isConnected)
30
- return !1;
29
+ if (!t || !t.isConnected) return !1;
31
30
  try {
32
31
  return t.focus(), !0;
33
32
  } catch {
34
33
  return !1;
35
34
  }
36
35
  }
37
- function E(t) {
36
+ function F(t) {
38
37
  return t.querySelector(
39
38
  '[aria-selected="true"], [data-selected="true"], [selected], [checked], [aria-current="true"]'
40
39
  ) || null;
41
40
  }
42
- function v(t) {
43
- if (!t.options.inertOthers || typeof document > "u" || !document.body)
44
- return;
41
+ function E(t) {
42
+ if (!t.options.inertOthers || typeof document > "u" || !document.body) return;
45
43
  const e = Array.from(document.body.children);
46
44
  t.inerted = e.filter((r) => r !== t.options.node && !r.contains(t.options.node)).map((r) => {
47
- const f = r.hasAttribute("inert");
48
- return f || r.setAttribute("inert", ""), { element: r, hadInert: f };
45
+ const c = r.hasAttribute("inert");
46
+ return c || r.setAttribute("inert", ""), { element: r, hadInert: c };
49
47
  });
50
48
  }
51
- function A(t) {
49
+ function v(t) {
52
50
  t.inerted.forEach(({ element: e, hadInert: r }) => {
53
51
  r || e.removeAttribute("inert");
54
52
  }), t.inerted = [];
55
53
  }
56
- function L(t) {
54
+ function A(t) {
57
55
  if (!(t.node instanceof HTMLElement))
58
56
  throw new Error("createFocusScope requires a valid HTMLElement node");
59
57
  const e = {
60
- id: Symbol("focus-scope"),
58
+ id: /* @__PURE__ */ Symbol("focus-scope"),
61
59
  options: {
62
60
  trapped: !0,
63
61
  loop: !0,
@@ -74,34 +72,30 @@ function L(t) {
74
72
  onFocusIn: () => {
75
73
  }
76
74
  }, r = () => {
77
- const n = d(e.options.node)[0] || null;
78
- s(n) || (l(e.options.node), s(e.options.node));
79
- }, f = () => {
80
- const n = d(e.options.node), o = n.length ? n[n.length - 1] : null;
81
- s(o) || (l(e.options.node), s(e.options.node));
75
+ const n = a(e.options.node)[0] || null;
76
+ s(n) || (d(e.options.node), s(e.options.node));
77
+ }, c = () => {
78
+ const n = a(e.options.node), o = n.length ? n[n.length - 1] : null;
79
+ s(o) || (d(e.options.node), s(e.options.node));
82
80
  }, u = () => {
83
- const n = b(e.options.initialFocus);
84
- if (s(n))
85
- return;
81
+ const n = m(e.options.initialFocus);
82
+ if (s(n)) return;
86
83
  const o = e.options.autoFocus;
87
84
  if (o !== "none") {
88
85
  if (o === "container") {
89
- l(e.options.node), s(e.options.node);
86
+ d(e.options.node), s(e.options.node);
90
87
  return;
91
88
  }
92
89
  if (o === "selected") {
93
- const i = E(e.options.node);
94
- if (s(i))
95
- return;
90
+ const i = F(e.options.node);
91
+ if (s(i)) return;
96
92
  }
97
93
  r();
98
94
  }
99
95
  };
100
96
  return e.onKeyDown = (n) => {
101
- var h;
102
- if (e.paused || ((h = m()) == null ? void 0 : h.id) !== e.id || !e.options.trapped || n.key !== "Tab")
103
- return;
104
- const o = d(e.options.node);
97
+ if (e.paused || h()?.id !== e.id || !e.options.trapped || n.key !== "Tab") return;
98
+ const o = a(e.options.node);
105
99
  if (!o.length) {
106
100
  n.preventDefault(), u();
107
101
  return;
@@ -111,28 +105,25 @@ function L(t) {
111
105
  n.preventDefault(), u();
112
106
  return;
113
107
  }
114
- const c = o[0], p = o[o.length - 1];
108
+ const l = o[0], p = o[o.length - 1];
115
109
  if (n.shiftKey) {
116
- (i === c || i === e.options.node) && (n.preventDefault(), e.options.loop && s(p));
110
+ (i === l || i === e.options.node) && (n.preventDefault(), e.options.loop && s(p));
117
111
  return;
118
112
  }
119
- i === p && (n.preventDefault(), e.options.loop && s(c));
113
+ i === p && (n.preventDefault(), e.options.loop && s(l));
120
114
  }, e.onFocusIn = (n) => {
121
- var c;
122
- if (e.paused || ((c = m()) == null ? void 0 : c.id) !== e.id || !e.options.trapped)
123
- return;
115
+ if (e.paused || h()?.id !== e.id || !e.options.trapped) return;
124
116
  const o = n.target;
125
117
  (typeof n.composedPath == "function" ? n.composedPath() : []).includes(e.options.node) || o instanceof Node && (e.options.node.contains(o) || u());
126
- }, a.push(e), v(e), document.addEventListener("keydown", e.onKeyDown, !0), document.addEventListener("focusin", e.onFocusIn, !0), u(), {
118
+ }, f.push(e), E(e), document.addEventListener("keydown", e.onKeyDown, !0), document.addEventListener("focusin", e.onFocusIn, !0), u(), {
127
119
  destroy() {
128
- const n = a.findIndex((i) => i.id === e.id);
129
- if (n >= 0 && a.splice(n, 1), document.removeEventListener("keydown", e.onKeyDown, !0), document.removeEventListener("focusin", e.onFocusIn, !0), A(e), !e.options.restoreFocus)
130
- return;
131
- const o = b(e.options.finalFocus) || e.previouslyFocused;
120
+ const n = f.findIndex((i) => i.id === e.id);
121
+ if (n >= 0 && f.splice(n, 1), document.removeEventListener("keydown", e.onKeyDown, !0), document.removeEventListener("focusin", e.onFocusIn, !0), v(e), !e.options.restoreFocus) return;
122
+ const o = m(e.options.finalFocus) || e.previouslyFocused;
132
123
  s(o);
133
124
  },
134
125
  focusFirst: r,
135
- focusLast: f,
126
+ focusLast: c,
136
127
  focusInitial: u,
137
128
  pause() {
138
129
  e.paused = !0;
@@ -143,5 +134,5 @@ function L(t) {
143
134
  };
144
135
  }
145
136
  export {
146
- L as c
137
+ A as c
147
138
  };
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-1b301e7f.js"),n=require("./focus-scope-2b12b4e7.js"),u=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-EV6mVBUV.js"),n=require("./focus-scope-Bwug2gDv.js"),u=`
2
2
  :host {
3
3
  display: contents;
4
4
  color-scheme: light dark;
5
5
  }
6
- `;function a(e){return e==="selected"||e==="container"||e==="none"?e:"first"}function o(e){if(e==null)return!1;const t=e.toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}class i extends c.ElementBase{constructor(){super(...arguments),this._scope=null,this._onKeyDown=t=>{if(t.key!=="Escape"||!this.hasAttribute("active"))return;const s=document.activeElement;s&&!this.contains(s)||this.dispatchEvent(new CustomEvent("escape",{detail:{originalEvent:t},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["active","trapped","loop","restore-focus","auto-focus","inert-others","headless"]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._onKeyDown,!0),this._syncScope()}disconnectedCallback(){document.removeEventListener("keydown",this._onKeyDown,!0),this._destroyScope(),super.disconnectedCallback()}attributeChangedCallback(t,s,r){s!==r&&this._syncScope()}get initialFocus(){return this.querySelector("[data-ui-initial-focus], [autofocus]")}get finalFocus(){return this.querySelector("[data-ui-final-focus]")}activate(){this.setAttribute("active","")}deactivate(){this.removeAttribute("active")}focusFirst(){var t;(t=this._scope)==null||t.focusFirst()}focusInitial(){var t;(t=this._scope)==null||t.focusInitial()}_destroyScope(){var t;(t=this._scope)==null||t.destroy(),this._scope=null}_syncScope(){if(this.isConnected){if(this.hasAttribute("headless")||!this.hasAttribute("active")){this._destroyScope();return}this._destroyScope(),this._scope=n.createFocusScope({node:this,trapped:!this.hasAttribute("trapped")||o(this.getAttribute("trapped")),loop:!this.hasAttribute("loop")||o(this.getAttribute("loop")),restoreFocus:!this.hasAttribute("restore-focus")||o(this.getAttribute("restore-focus")),autoFocus:a(this.getAttribute("auto-focus")),initialFocus:this.initialFocus,finalFocus:this.finalFocus,inertOthers:o(this.getAttribute("inert-others"))}),this.dispatchEvent(new CustomEvent("focus-scope-mount",{bubbles:!0,composed:!0}))}}render(){this.setContent(`<style>${u}</style><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-focus-scope")&&customElements.define("ui-focus-scope",i);exports.UIFocusScope=i;
6
+ `;function a(t){return t==="selected"||t==="container"||t==="none"?t:"first"}function o(t){if(t==null)return!1;const e=t.toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}class i extends c.ElementBase{constructor(){super(...arguments),this._scope=null,this._onKeyDown=e=>{if(e.key!=="Escape"||!this.hasAttribute("active"))return;const s=document.activeElement;s&&!this.contains(s)||this.dispatchEvent(new CustomEvent("escape",{detail:{originalEvent:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["active","trapped","loop","restore-focus","auto-focus","inert-others","headless"]}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._onKeyDown,!0),this._syncScope()}disconnectedCallback(){document.removeEventListener("keydown",this._onKeyDown,!0),this._destroyScope(),super.disconnectedCallback()}attributeChangedCallback(e,s,r){s!==r&&this._syncScope()}get initialFocus(){return this.querySelector("[data-ui-initial-focus], [autofocus]")}get finalFocus(){return this.querySelector("[data-ui-final-focus]")}activate(){this.setAttribute("active","")}deactivate(){this.removeAttribute("active")}focusFirst(){this._scope?.focusFirst()}focusInitial(){this._scope?.focusInitial()}_destroyScope(){this._scope?.destroy(),this._scope=null}_syncScope(){if(this.isConnected){if(this.hasAttribute("headless")||!this.hasAttribute("active")){this._destroyScope();return}this._destroyScope(),this._scope=n.createFocusScope({node:this,trapped:!this.hasAttribute("trapped")||o(this.getAttribute("trapped")),loop:!this.hasAttribute("loop")||o(this.getAttribute("loop")),restoreFocus:!this.hasAttribute("restore-focus")||o(this.getAttribute("restore-focus")),autoFocus:a(this.getAttribute("auto-focus")),initialFocus:this.initialFocus,finalFocus:this.finalFocus,inertOthers:o(this.getAttribute("inert-others"))}),this.dispatchEvent(new CustomEvent("focus-scope-mount",{bubbles:!0,composed:!0}))}}render(){this.setContent(`<style>${u}</style><slot></slot>`)}shouldRenderOnAttributeChange(){return!1}}typeof customElements<"u"&&!customElements.get("ui-focus-scope")&&customElements.define("ui-focus-scope",i);exports.UIFocusScope=i;
@@ -1,29 +1,27 @@
1
- import { E as r } from "./ElementBase-909688f3.mjs";
2
- import { c as n } from "./focus-scope-103833ee.mjs";
1
+ import { E as r } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { c as n } from "./focus-scope-CmEsG5UZ.mjs";
3
3
  const c = `
4
4
  :host {
5
5
  display: contents;
6
6
  color-scheme: light dark;
7
7
  }
8
8
  `;
9
- function u(e) {
10
- return e === "selected" || e === "container" || e === "none" ? e : "first";
9
+ function u(t) {
10
+ return t === "selected" || t === "container" || t === "none" ? t : "first";
11
11
  }
12
- function o(e) {
13
- if (e == null)
14
- return !1;
15
- const t = e.toLowerCase();
16
- return t !== "false" && t !== "0" && t !== "off";
12
+ function o(t) {
13
+ if (t == null) return !1;
14
+ const e = t.toLowerCase();
15
+ return e !== "false" && e !== "0" && e !== "off";
17
16
  }
18
17
  class a extends r {
19
18
  constructor() {
20
- super(...arguments), this._scope = null, this._onKeyDown = (t) => {
21
- if (t.key !== "Escape" || !this.hasAttribute("active"))
22
- return;
19
+ super(...arguments), this._scope = null, this._onKeyDown = (e) => {
20
+ if (e.key !== "Escape" || !this.hasAttribute("active")) return;
23
21
  const s = document.activeElement;
24
22
  s && !this.contains(s) || this.dispatchEvent(
25
23
  new CustomEvent("escape", {
26
- detail: { originalEvent: t },
24
+ detail: { originalEvent: e },
27
25
  bubbles: !0,
28
26
  composed: !0
29
27
  })
@@ -39,7 +37,7 @@ class a extends r {
39
37
  disconnectedCallback() {
40
38
  document.removeEventListener("keydown", this._onKeyDown, !0), this._destroyScope(), super.disconnectedCallback();
41
39
  }
42
- attributeChangedCallback(t, s, i) {
40
+ attributeChangedCallback(e, s, i) {
43
41
  s !== i && this._syncScope();
44
42
  }
45
43
  get initialFocus() {
@@ -55,16 +53,13 @@ class a extends r {
55
53
  this.removeAttribute("active");
56
54
  }
57
55
  focusFirst() {
58
- var t;
59
- (t = this._scope) == null || t.focusFirst();
56
+ this._scope?.focusFirst();
60
57
  }
61
58
  focusInitial() {
62
- var t;
63
- (t = this._scope) == null || t.focusInitial();
59
+ this._scope?.focusInitial();
64
60
  }
65
61
  _destroyScope() {
66
- var t;
67
- (t = this._scope) == null || t.destroy(), this._scope = null;
62
+ this._scope?.destroy(), this._scope = null;
68
63
  }
69
64
  _syncScope() {
70
65
  if (this.isConnected) {