@editora/ui-core 0.1.18 → 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 (307) 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 -669
  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-button.d.ts +1 -0
  57. package/dist/components/ui-button.d.ts.map +1 -1
  58. package/dist/components/ui-date-picker.d.ts.map +1 -1
  59. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  60. package/dist/components/ui-date-range-time-picker.d.ts +1 -0
  61. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  62. package/dist/components/ui-date-time-picker.d.ts +1 -0
  63. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  64. package/dist/components/ui-orbiter.d.ts.map +1 -1
  65. package/dist/components/ui-skeleton.d.ts.map +1 -1
  66. package/dist/components/ui-split-button.d.ts +1 -0
  67. package/dist/components/ui-split-button.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 +30 -9
  80. package/dist/date-picker.esm.js +90 -97
  81. package/dist/date-range-picker.cjs.js +22 -3
  82. package/dist/date-range-picker.esm.js +103 -108
  83. package/dist/date-range-time-picker.cjs.js +28 -12
  84. package/dist/date-range-time-picker.esm.js +137 -150
  85. package/dist/date-time-picker.cjs.js +25 -9
  86. package/dist/date-time-picker.esm.js +139 -155
  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 +4 -4
  162. package/dist/multi-select.esm.js +120 -140
  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 +2 -2
  196. package/dist/portal.esm.js +10 -19
  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 +11 -18
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/progress.cjs.js +1 -1
  204. package/dist/progress.esm.js +5 -9
  205. package/dist/quick-actions.cjs.js +6 -6
  206. package/dist/quick-actions.esm.js +52 -62
  207. package/dist/radio-group.cjs.js +13 -13
  208. package/dist/radio-group.esm.js +39 -51
  209. package/dist/radio.cjs.js +1 -1
  210. package/dist/radio.esm.js +5 -9
  211. package/dist/rating.cjs.js +1 -1
  212. package/dist/rating.esm.js +12 -23
  213. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  214. package/dist/roving-focus-group.cjs.js +1 -1
  215. package/dist/roving-focus-group.esm.js +3 -5
  216. package/dist/runtime-CTaOSmBj.js +1 -0
  217. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  218. package/dist/runtime.cjs.js +1 -1
  219. package/dist/runtime.esm.js +6 -6
  220. package/dist/scroll-area.cjs.js +3 -3
  221. package/dist/scroll-area.esm.js +38 -46
  222. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  223. package/dist/section.cjs.js +1 -1
  224. package/dist/section.esm.js +1 -1
  225. package/dist/select.cjs.js +7 -7
  226. package/dist/select.esm.js +67 -97
  227. package/dist/selection-popup.cjs.js +1 -1
  228. package/dist/selection-popup.esm.js +8 -15
  229. package/dist/separator.cjs.js +1 -1
  230. package/dist/separator.esm.js +1 -1
  231. package/dist/sidebar.cjs.js +18 -18
  232. package/dist/sidebar.esm.js +117 -139
  233. package/dist/skeleton.cjs.js +11 -11
  234. package/dist/skeleton.esm.js +27 -24
  235. package/dist/slider.cjs.js +1 -1
  236. package/dist/slider.esm.js +6 -11
  237. package/dist/slot.cjs.js +4 -4
  238. package/dist/slot.esm.js +16 -19
  239. package/dist/sortable.cjs.js +45 -45
  240. package/dist/sortable.esm.js +421 -524
  241. package/dist/spinning-text.cjs.js +12 -12
  242. package/dist/spinning-text.esm.js +80 -92
  243. package/dist/split-button.cjs.js +4 -4
  244. package/dist/split-button.esm.js +77 -62
  245. package/dist/splitter.cjs.js +1 -1
  246. package/dist/splitter.esm.js +1 -1
  247. package/dist/stepper.cjs.js +8 -8
  248. package/dist/stepper.esm.js +32 -52
  249. package/dist/switch.cjs.js +7 -7
  250. package/dist/switch.esm.js +23 -31
  251. package/dist/table.cjs.js +2 -2
  252. package/dist/table.esm.js +46 -56
  253. package/dist/tabs.cjs.js +3 -3
  254. package/dist/tabs.esm.js +35 -55
  255. package/dist/tags-input.cjs.js +4 -4
  256. package/dist/tags-input.esm.js +45 -62
  257. package/dist/textarea.cjs.js +6 -6
  258. package/dist/textarea.esm.js +32 -41
  259. package/dist/time-field.cjs.js +4 -4
  260. package/dist/time-field.esm.js +70 -84
  261. package/dist/time-picker.cjs.js +29 -21
  262. package/dist/time-picker.esm.js +96 -110
  263. package/dist/timeline.cjs.js +1 -1
  264. package/dist/timeline.esm.js +3 -5
  265. package/dist/toast.cjs.js +2 -2
  266. package/dist/toast.esm.js +33 -47
  267. package/dist/toggle-group.cjs.js +6 -6
  268. package/dist/toggle-group.esm.js +85 -105
  269. package/dist/toggle.cjs.js +1 -1
  270. package/dist/toggle.esm.js +3 -5
  271. package/dist/toolbar.cjs.js +1 -1
  272. package/dist/toolbar.esm.js +13 -24
  273. package/dist/tooltip.cjs.js +2 -2
  274. package/dist/tooltip.esm.js +31 -42
  275. package/dist/transfer-list.cjs.js +19 -19
  276. package/dist/transfer-list.esm.js +98 -111
  277. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  278. package/dist/tree-Dx_kv_ih.js +39 -0
  279. package/dist/tree-item.cjs.js +2 -2
  280. package/dist/tree-item.esm.js +2 -3
  281. package/dist/tree.cjs.js +1 -1
  282. package/dist/tree.esm.js +2 -5
  283. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  284. package/dist/ui-button-rXQOS9QJ.js +521 -0
  285. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  286. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  287. package/dist/visually-hidden.cjs.js +1 -1
  288. package/dist/visually-hidden.esm.js +1 -1
  289. package/dist/wizard.cjs.js +14 -14
  290. package/dist/wizard.esm.js +85 -105
  291. package/package.json +3 -3
  292. package/dist/date-time-utils-66480de4.js +0 -1
  293. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  294. package/dist/dismissable-layer-193e3bed.js +0 -1
  295. package/dist/focus-scope-2b12b4e7.js +0 -1
  296. package/dist/listbox-308789a0.mjs +0 -210
  297. package/dist/listbox-ef2f708e.js +0 -46
  298. package/dist/panel-group-40254cdd.js +0 -36
  299. package/dist/portal-c69756c0.js +0 -1
  300. package/dist/positioner-33529bb8.js +0 -1
  301. package/dist/runtime-3f13807b.js +0 -1
  302. package/dist/tree-0a7a8d05.js +0 -39
  303. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  304. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  305. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  306. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  307. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/toast.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as l } from "./ElementBase-909688f3.mjs";
1
+ import { E as l } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const u = 3200, c = 170, d = `
3
3
  :host {
4
4
  display: block;
@@ -213,19 +213,19 @@ const u = 3200, c = 170, d = `
213
213
  }
214
214
  `;
215
215
  let h = 0;
216
- function p(a) {
217
- return String(a).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
216
+ function p(i) {
217
+ return String(i).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
218
218
  }
219
- function m(a) {
220
- const t = String(a || "").toLowerCase();
219
+ function m(i) {
220
+ const t = String(i || "").toLowerCase();
221
221
  return t === "success" || t === "warning" || t === "error" || t === "loading" || t === "neutral" ? t : "info";
222
222
  }
223
- function g(a) {
224
- const t = Number(a);
223
+ function g(i) {
224
+ const t = Number(i);
225
225
  return Number.isFinite(t) ? Math.max(0, Math.trunc(t)) : u;
226
226
  }
227
- function f(a) {
228
- const t = String(a || "polite").toLowerCase();
227
+ function f(i) {
228
+ const t = String(i || "polite").toLowerCase();
229
229
  return t === "off" || t === "assertive" ? t : "polite";
230
230
  }
231
231
  class b extends l {
@@ -248,28 +248,27 @@ class b extends l {
248
248
  t ? this.setAttribute("headless", "") : this.removeAttribute("headless");
249
249
  }
250
250
  show(t, e = {}) {
251
- const o = ++h, s = m(e.type), i = g(e.duration), r = f(e.ariaLive), n = {
251
+ const o = ++h, s = m(e.type), a = g(e.duration), r = f(e.ariaLive), n = {
252
252
  id: o,
253
253
  message: String(t ?? ""),
254
- duration: i,
254
+ duration: a,
255
255
  tone: s,
256
256
  ariaLive: r,
257
257
  createdAt: Date.now(),
258
258
  closing: !1
259
259
  };
260
- return this._toasts.push(n), this._trimVisibleToasts(), this.requestRender(), this.dispatchEvent(new CustomEvent("show", { detail: { id: o, message: n.message, type: s }, bubbles: !0 })), this._scheduleAutoHide(o, i), o;
260
+ return this._toasts.push(n), this._trimVisibleToasts(), this.requestRender(), this.dispatchEvent(new CustomEvent("show", { detail: { id: o, message: n.message, type: s }, bubbles: !0 })), this._scheduleAutoHide(o, a), o;
261
261
  }
262
262
  hide(t) {
263
- const e = this._toasts.find((i) => i.id === t);
264
- if (!e || e.closing)
265
- return;
263
+ const e = this._toasts.find((a) => a.id === t);
264
+ if (!e || e.closing) return;
266
265
  e.closing = !0, this._clearToastTimer(t), this.requestRender();
267
266
  const o = this._exitMap.get(t);
268
267
  o && clearTimeout(o);
269
268
  const s = setTimeout(() => {
270
269
  this._exitMap.delete(t);
271
- const i = this._toasts.length;
272
- this._toasts = this._toasts.filter((r) => r.id !== t), this._toasts.length !== i && (this.requestRender(), this.dispatchEvent(new CustomEvent("hide", { detail: { id: t }, bubbles: !0 })));
270
+ const a = this._toasts.length;
271
+ this._toasts = this._toasts.filter((r) => r.id !== t), this._toasts.length !== a && (this.requestRender(), this.dispatchEvent(new CustomEvent("hide", { detail: { id: t }, bubbles: !0 })));
273
272
  }, c);
274
273
  this._exitMap.set(t, s);
275
274
  }
@@ -279,13 +278,11 @@ class b extends l {
279
278
  }
280
279
  _trimVisibleToasts() {
281
280
  const t = this._toasts.filter((s) => !s.closing), e = this._maxVisible();
282
- if (t.length <= e)
283
- return;
284
- [...t].sort((s, i) => s.createdAt - i.createdAt).slice(0, t.length - e).forEach((s) => this.hide(s.id));
281
+ if (t.length <= e) return;
282
+ [...t].sort((s, a) => s.createdAt - a.createdAt).slice(0, t.length - e).forEach((s) => this.hide(s.id));
285
283
  }
286
284
  _scheduleAutoHide(t, e) {
287
- if (this._clearToastTimer(t), e <= 0)
288
- return;
285
+ if (this._clearToastTimer(t), e <= 0) return;
289
286
  const o = Date.now(), s = setTimeout(() => {
290
287
  this._timerMap.delete(t), this.hide(t);
291
288
  }, e);
@@ -293,16 +290,14 @@ class b extends l {
293
290
  }
294
291
  _pauseToast(t) {
295
292
  const e = this._timerMap.get(t);
296
- if (!e || e.paused)
297
- return;
293
+ if (!e || e.paused) return;
298
294
  clearTimeout(e.timeout);
299
295
  const o = Date.now() - e.startedAt;
300
296
  e.remaining = Math.max(0, e.remaining - o), e.paused = !0, this._timerMap.set(t, e);
301
297
  }
302
298
  _resumeToast(t) {
303
299
  const e = this._timerMap.get(t);
304
- if (!e || !e.paused)
305
- return;
300
+ if (!e || !e.paused) return;
306
301
  const o = Math.max(0, e.remaining);
307
302
  this._scheduleAutoHide(t, o);
308
303
  }
@@ -313,27 +308,22 @@ class b extends l {
313
308
  o && (clearTimeout(o), this._exitMap.delete(t));
314
309
  }
315
310
  _clearAllTimers() {
316
- for (const t of this._timerMap.values())
317
- clearTimeout(t.timeout);
311
+ for (const t of this._timerMap.values()) clearTimeout(t.timeout);
318
312
  this._timerMap.clear();
319
- for (const t of this._exitMap.values())
320
- clearTimeout(t);
313
+ for (const t of this._exitMap.values()) clearTimeout(t);
321
314
  this._exitMap.clear();
322
315
  }
323
316
  _closestToastId(t) {
324
- const e = t instanceof HTMLElement ? t : null, o = e == null ? void 0 : e.closest(".toast[data-toast-id]");
325
- if (!o)
326
- return null;
317
+ const o = (t instanceof HTMLElement ? t : null)?.closest(".toast[data-toast-id]");
318
+ if (!o) return null;
327
319
  const s = Number(o.getAttribute("data-toast-id"));
328
320
  return Number.isFinite(s) ? s : null;
329
321
  }
330
322
  _handleRootClick(t) {
331
323
  const e = t.target;
332
- if (!e)
333
- return;
324
+ if (!e) return;
334
325
  const o = e.closest("button.close[data-toast-id]");
335
- if (!o)
336
- return;
326
+ if (!o) return;
337
327
  t.preventDefault();
338
328
  const s = Number(o.getAttribute("data-toast-id"));
339
329
  Number.isNaN(s) || this.hide(s);
@@ -343,24 +333,20 @@ class b extends l {
343
333
  e != null && this._pauseToast(e);
344
334
  }
345
335
  _handleRootMouseLeave(t) {
346
- var i;
347
336
  const e = this._closestToastId(t.target);
348
- if (e == null)
349
- return;
350
- const o = (i = t.target) == null ? void 0 : i.closest(".toast[data-toast-id]"), s = t.relatedTarget;
351
- s && (o != null && o.contains(s)) || this._resumeToast(e);
337
+ if (e == null) return;
338
+ const o = t.target?.closest(".toast[data-toast-id]"), s = t.relatedTarget;
339
+ s && o?.contains(s) || this._resumeToast(e);
352
340
  }
353
341
  _handleRootFocusIn(t) {
354
342
  const e = this._closestToastId(t.target);
355
343
  e != null && this._pauseToast(e);
356
344
  }
357
345
  _handleRootFocusOut(t) {
358
- var i;
359
346
  const e = this._closestToastId(t.target);
360
- if (e == null)
361
- return;
362
- const o = t.relatedTarget, s = (i = t.target) == null ? void 0 : i.closest(".toast[data-toast-id]");
363
- o && (s != null && s.contains(o)) || this._resumeToast(e);
347
+ if (e == null) return;
348
+ const o = t.relatedTarget, s = t.target?.closest(".toast[data-toast-id]");
349
+ o && s?.contains(o) || this._resumeToast(e);
364
350
  }
365
351
  render() {
366
352
  this.setContent(`
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("./ElementBase-1b301e7f.js"),d=require("./roving-focus-group-5c059bf9.js"),_=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("./ElementBase-EV6mVBUV.js"),g=require("./roving-focus-group-BdJ_4Njm.js"),y=`
2
2
  :host {
3
3
  --ui-toggle-group-gap: 8px;
4
4
  --ui-toggle-group-padding: 6px;
@@ -115,17 +115,17 @@
115
115
  --ui-toggle-group-shadow: none;
116
116
  }
117
117
  }
118
- `,x=new Set(["multiple","orientation","aria-label","required","disabled"]);function S(n){return String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function w(n){try{return JSON.parse(n)}catch{return}}function I(n,t){if(!t)return n||"";if(!n)return[];const e=w(n);return Array.isArray(e)?Array.from(new Set(e.map(r=>String(r)).filter(Boolean))):n.includes(",")?Array.from(new Set(n.split(",").map(r=>r.trim()).filter(Boolean))):[n]}function m(n,t){return t?JSON.stringify(Array.isArray(n)?n:[String(n)]):String(n||"")}class A extends y.ElementBase{constructor(){super(),this._observer=null,this._isSyncing=!1,this._focusIndex=-1,this._onToggleEvent=this._onToggleEvent.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["value","multiple","disabled","headless","orientation","variant","size","density","shape","elevation","allow-empty","required","activation","aria-label"]}connectedCallback(){super.connectedCallback(),this.addEventListener("change",this._onToggleEvent),this.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(t=>{this._isSyncing||(t.forEach(e=>{e.type!=="childList"||e.removedNodes.length===0||e.removedNodes.forEach(r=>this._clearGroupFlagsFromNode(r))}),this._syncChildren())}),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeFilter:["value","data-value","disabled","pressed","data-disabled"]}),this._syncChildren()}attributeChangedCallback(t,e,r){if(e!==r){if(x.has(t)){if(!this.root.querySelector(".group")){this.requestRender();return}this._syncGroupA11y()}this._syncChildren()}}disconnectedCallback(){this.removeEventListener("change",this._onToggleEvent),this.removeEventListener("keydown",this._onKeyDown),this._toggles().forEach(t=>this._clearGroupFlags(t)),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}get multiple(){return this.hasAttribute("multiple")}set multiple(t){t?this.setAttribute("multiple",""):this.removeAttribute("multiple")}get value(){return I(this.getAttribute("value"),this.multiple)}set value(t){const e=m(t,this.multiple);if(!this.multiple&&!e){this.hasAttribute("value")&&this.removeAttribute("value"),this._syncChildren();return}this.getAttribute("value")!==e&&this.setAttribute("value",e),this._syncChildren()}_toggles(){return Array.from(this.querySelectorAll("ui-toggle"))}_toggleValue(t,e){var r;return t.getAttribute("value")||t.getAttribute("data-value")||((r=t.textContent)==null?void 0:r.trim())||String(e)}_clearGroupFlags(t){var e;t.hasAttribute("data-group-item")&&t.removeAttribute("data-group-item"),t.hasAttribute("data-group-disabled")&&t.removeAttribute("data-group-disabled"),t.hasAttribute("role")&&t.removeAttribute("role"),t.hasAttribute("aria-checked")&&t.removeAttribute("aria-checked"),(e=t._syncAria)==null||e.call(t)}_clearGroupFlagsFromNode(t){if(!(t instanceof HTMLElement))return;t.matches("ui-toggle")&&this._clearGroupFlags(t),Array.from(t.querySelectorAll("ui-toggle")).forEach(r=>this._clearGroupFlags(r))}_selectedSet(){const t=this.value;return Array.isArray(t)?new Set(t.map(e=>String(e))):t?new Set([String(t)]):new Set}_setGroupValue(t,e=!0){const r=m(t,this.multiple),a=this.getAttribute("value")||"";if(!this.multiple&&!r&&!a||a===r){this._syncChildren();return}if(!this.multiple&&!r?this.removeAttribute("value"):this.setAttribute("value",r),this._syncChildren(),!e)return;const i={value:this.multiple?Array.isArray(t)?t:[String(t)]:String(t||""),values:this.multiple?Array.isArray(t)?t:[String(t)]:t?[String(t)]:[],multiple:this.multiple};this.dispatchEvent(new CustomEvent("input",{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:i,bubbles:!0,composed:!0}))}_syncChildren(){const t=this._toggles(),e=this.hasAttribute("disabled"),r=this._selectedSet(),a=this.multiple,i=(u,s,l)=>{const f=u.hasAttribute(s);l&&!f&&u.setAttribute(s,""),!l&&f&&u.removeAttribute(s)},c=(u,s,l)=>{u.getAttribute(s)!==l&&u.setAttribute(s,l)};let h=-1,p=-1;this._isSyncing=!0;try{t.forEach((s,l)=>{const f=this._toggleValue(s,l),g=s.hasAttribute("data-disabled")||s.getAttribute("aria-disabled")==="true",o=e||g;i(s,"data-group-item",!0),o?(i(s,"disabled",!0),i(s,"data-group-disabled",e&&!g)):s.hasAttribute("data-group-disabled")&&(i(s,"disabled",!1),i(s,"data-group-disabled",!1));const b=r.has(f);i(s,"pressed",b),c(s,"role",a?"checkbox":"radio"),c(s,"aria-checked",b?"true":"false"),b&&p<0&&(p=l),!s.hasAttribute("disabled")&&h<0&&(h=l)});const u=d.resolveRovingFocusIndex(t,{activeIndex:this._focusIndex,selectedIndex:p>=0?p:h,getDisabled:s=>s.hasAttribute("disabled")});this._focusIndex=u,d.syncRovingTabStops(t,t[u]||null,{activeAttribute:null})}finally{this._isSyncing=!1}}_onToggleEvent(t){var p;const e=t.target;if(!e||e.tagName.toLowerCase()!=="ui-toggle"||this.hasAttribute("disabled"))return;const a=this._toggles().indexOf(e);if(a<0)return;const i=this._toggleValue(e,a),c=((p=t.detail)==null?void 0:p.pressed)??e.hasAttribute("pressed");if(this._focusIndex=a,this.multiple){const u=this._selectedSet();c?u.add(i):u.delete(i),this._setGroupValue(Array.from(u),!0);return}const h=this.hasAttribute("allow-empty")&&!this.hasAttribute("required");if(c){this._setGroupValue(i,!0);return}if(h)this._setGroupValue("",!0);else{const u=String(this.value||"");this._setGroupValue(u||i,!1)}}_onKeyDown(t){var l,f;const e=t.target;if(!e||e.tagName.toLowerCase()!=="ui-toggle")return;const r=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",a=this.getAttribute("activation")==="manual"?"manual":"auto",i=this._toggles().filter(g=>!g.hasAttribute("disabled"));if(i.length<2)return;const c=i.indexOf(e);if(c<0)return;const h=this._isHorizontalRtl(),p=g=>{var v;const o=d.moveRovingFocusIndex(i,c,g,{wrap:!0,fallbackIndex:d.resolveRovingFocusIndex(i,{activeIndex:c,getDisabled:()=>!1}),getDisabled:()=>!1});if(o<0)return;const b=i[o];this._focusIndex=this._toggles().indexOf(b),d.syncRovingTabStops(i,b,{activeAttribute:null}),d.focusRovingItem(b),a==="auto"&&((v=b.toggle)==null||v.call(b,!0))},u=r==="horizontal"&&(t.key==="ArrowRight"&&!h||t.key==="ArrowLeft"&&h)||r==="vertical"&&t.key==="ArrowDown",s=r==="horizontal"&&(t.key==="ArrowLeft"&&!h||t.key==="ArrowRight"&&h)||r==="vertical"&&t.key==="ArrowUp";if(u){t.preventDefault(),p(1);return}if(s){t.preventDefault(),p(-1);return}if(t.key==="Home"){t.preventDefault();const g=d.getRovingFocusBoundaryIndex(i,"first",()=>!1);if(g<0)return;const o=i[g];this._focusIndex=this._toggles().indexOf(o),d.syncRovingTabStops(i,o,{activeAttribute:null}),d.focusRovingItem(o),a==="auto"&&((l=o.toggle)==null||l.call(o,!0));return}if(t.key==="End"){t.preventDefault();const g=d.getRovingFocusBoundaryIndex(i,"last",()=>!1);if(g<0)return;const o=i[g];this._focusIndex=this._toggles().indexOf(o),d.syncRovingTabStops(i,o,{activeAttribute:null}),d.focusRovingItem(o),a==="auto"&&((f=o.toggle)==null||f.call(o,!0))}}render(){const t=this.multiple?"group":"radiogroup",e=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",r=this.getAttribute("aria-label")||"Toggle group",a=this.hasAttribute("required"),i=this.hasAttribute("disabled");this.setContent(`
119
- <style>${_}</style>
118
+ `,_=new Set(["multiple","orientation","aria-label","required","disabled"]);function x(n){return String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function S(n){try{return JSON.parse(n)}catch{return}}function w(n,t){if(!t)return n||"";if(!n)return[];const e=S(n);return Array.isArray(e)?Array.from(new Set(e.map(i=>String(i)).filter(Boolean))):n.includes(",")?Array.from(new Set(n.split(",").map(i=>i.trim()).filter(Boolean))):[n]}function f(n,t){return t?JSON.stringify(Array.isArray(n)?n:[String(n)]):String(n||"")}class v extends A.ElementBase{constructor(){super(),this._observer=null,this._isSyncing=!1,this._focusIndex=-1,this._onToggleEvent=this._onToggleEvent.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["value","multiple","disabled","headless","orientation","variant","size","density","shape","elevation","allow-empty","required","activation","aria-label"]}connectedCallback(){super.connectedCallback(),this.addEventListener("change",this._onToggleEvent),this.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(t=>{this._isSyncing||(t.forEach(e=>{e.type!=="childList"||e.removedNodes.length===0||e.removedNodes.forEach(i=>this._clearGroupFlagsFromNode(i))}),this._syncChildren())}),this._observer.observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeFilter:["value","data-value","disabled","pressed","data-disabled"]}),this._syncChildren()}attributeChangedCallback(t,e,i){if(e!==i){if(_.has(t)){if(!this.root.querySelector(".group")){this.requestRender();return}this._syncGroupA11y()}this._syncChildren()}}disconnectedCallback(){this.removeEventListener("change",this._onToggleEvent),this.removeEventListener("keydown",this._onKeyDown),this._toggles().forEach(t=>this._clearGroupFlags(t)),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}get multiple(){return this.hasAttribute("multiple")}set multiple(t){t?this.setAttribute("multiple",""):this.removeAttribute("multiple")}get value(){return w(this.getAttribute("value"),this.multiple)}set value(t){const e=f(t,this.multiple);if(!this.multiple&&!e){this.hasAttribute("value")&&this.removeAttribute("value"),this._syncChildren();return}this.getAttribute("value")!==e&&this.setAttribute("value",e),this._syncChildren()}_toggles(){return Array.from(this.querySelectorAll("ui-toggle"))}_toggleValue(t,e){return t.getAttribute("value")||t.getAttribute("data-value")||t.textContent?.trim()||String(e)}_clearGroupFlags(t){t.hasAttribute("data-group-item")&&t.removeAttribute("data-group-item"),t.hasAttribute("data-group-disabled")&&t.removeAttribute("data-group-disabled"),t.hasAttribute("role")&&t.removeAttribute("role"),t.hasAttribute("aria-checked")&&t.removeAttribute("aria-checked"),t._syncAria?.()}_clearGroupFlagsFromNode(t){if(!(t instanceof HTMLElement))return;t.matches("ui-toggle")&&this._clearGroupFlags(t),Array.from(t.querySelectorAll("ui-toggle")).forEach(i=>this._clearGroupFlags(i))}_selectedSet(){const t=this.value;return Array.isArray(t)?new Set(t.map(e=>String(e))):t?new Set([String(t)]):new Set}_setGroupValue(t,e=!0){const i=f(t,this.multiple),a=this.getAttribute("value")||"";if(!this.multiple&&!i&&!a||a===i){this._syncChildren();return}if(!this.multiple&&!i?this.removeAttribute("value"):this.setAttribute("value",i),this._syncChildren(),!e)return;const r={value:this.multiple?Array.isArray(t)?t:[String(t)]:String(t||""),values:this.multiple?Array.isArray(t)?t:[String(t)]:t?[String(t)]:[],multiple:this.multiple};this.dispatchEvent(new CustomEvent("input",{detail:r,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:r,bubbles:!0,composed:!0}))}_syncChildren(){const t=this._toggles(),e=this.hasAttribute("disabled"),i=this._selectedSet(),a=this.multiple,r=(c,s,o)=>{const u=c.hasAttribute(s);o&&!u&&c.setAttribute(s,""),!o&&u&&c.removeAttribute(s)},d=(c,s,o)=>{c.getAttribute(s)!==o&&c.setAttribute(s,o)};let h=-1,l=-1;this._isSyncing=!0;try{t.forEach((s,o)=>{const u=this._toggleValue(s,o),p=s.hasAttribute("data-disabled")||s.getAttribute("aria-disabled")==="true",m=e||p;r(s,"data-group-item",!0),m?(r(s,"disabled",!0),r(s,"data-group-disabled",e&&!p)):s.hasAttribute("data-group-disabled")&&(r(s,"disabled",!1),r(s,"data-group-disabled",!1));const b=i.has(u);r(s,"pressed",b),d(s,"role",a?"checkbox":"radio"),d(s,"aria-checked",b?"true":"false"),b&&l<0&&(l=o),!s.hasAttribute("disabled")&&h<0&&(h=o)});const c=g.resolveRovingFocusIndex(t,{activeIndex:this._focusIndex,selectedIndex:l>=0?l:h,getDisabled:s=>s.hasAttribute("disabled")});this._focusIndex=c,g.syncRovingTabStops(t,t[c]||null,{activeAttribute:null})}finally{this._isSyncing=!1}}_onToggleEvent(t){const e=t.target;if(!e||e.tagName.toLowerCase()!=="ui-toggle"||this.hasAttribute("disabled"))return;const a=this._toggles().indexOf(e);if(a<0)return;const r=this._toggleValue(e,a),d=t.detail?.pressed??e.hasAttribute("pressed");if(this._focusIndex=a,this.multiple){const l=this._selectedSet();d?l.add(r):l.delete(r),this._setGroupValue(Array.from(l),!0);return}const h=this.hasAttribute("allow-empty")&&!this.hasAttribute("required");if(d){this._setGroupValue(r,!0);return}if(h)this._setGroupValue("",!0);else{const l=String(this.value||"");this._setGroupValue(l||r,!1)}}_onKeyDown(t){const e=t.target;if(!e||e.tagName.toLowerCase()!=="ui-toggle")return;const i=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",a=this.getAttribute("activation")==="manual"?"manual":"auto",r=this._toggles().filter(o=>!o.hasAttribute("disabled"));if(r.length<2)return;const d=r.indexOf(e);if(d<0)return;const h=this._isHorizontalRtl(),l=o=>{const u=g.moveRovingFocusIndex(r,d,o,{wrap:!0,fallbackIndex:g.resolveRovingFocusIndex(r,{activeIndex:d,getDisabled:()=>!1}),getDisabled:()=>!1});if(u<0)return;const p=r[u];this._focusIndex=this._toggles().indexOf(p),g.syncRovingTabStops(r,p,{activeAttribute:null}),g.focusRovingItem(p),a==="auto"&&p.toggle?.(!0)},c=i==="horizontal"&&(t.key==="ArrowRight"&&!h||t.key==="ArrowLeft"&&h)||i==="vertical"&&t.key==="ArrowDown",s=i==="horizontal"&&(t.key==="ArrowLeft"&&!h||t.key==="ArrowRight"&&h)||i==="vertical"&&t.key==="ArrowUp";if(c){t.preventDefault(),l(1);return}if(s){t.preventDefault(),l(-1);return}if(t.key==="Home"){t.preventDefault();const o=g.getRovingFocusBoundaryIndex(r,"first",()=>!1);if(o<0)return;const u=r[o];this._focusIndex=this._toggles().indexOf(u),g.syncRovingTabStops(r,u,{activeAttribute:null}),g.focusRovingItem(u),a==="auto"&&u.toggle?.(!0);return}if(t.key==="End"){t.preventDefault();const o=g.getRovingFocusBoundaryIndex(r,"last",()=>!1);if(o<0)return;const u=r[o];this._focusIndex=this._toggles().indexOf(u),g.syncRovingTabStops(r,u,{activeAttribute:null}),g.focusRovingItem(u),a==="auto"&&u.toggle?.(!0)}}render(){const t=this.multiple?"group":"radiogroup",e=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",i=this.getAttribute("aria-label")||"Toggle group",a=this.hasAttribute("required"),r=this.hasAttribute("disabled");this.setContent(`
119
+ <style>${y}</style>
120
120
  <div
121
121
  class="group"
122
122
  part="group"
123
123
  role="${t}"
124
- aria-label="${S(r)}"
124
+ aria-label="${x(i)}"
125
125
  aria-orientation="${e}"
126
- aria-disabled="${i?"true":"false"}"
126
+ aria-disabled="${r?"true":"false"}"
127
127
  aria-required="${a?"true":"false"}"
128
128
  >
129
129
  <slot></slot>
130
130
  </div>
131
- `),this._syncChildren()}_syncGroupA11y(){const t=this.root.querySelector(".group");if(!t)return;const e=this.multiple?"group":"radiogroup",r=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",a=this.getAttribute("aria-label")||"Toggle group",i=this.hasAttribute("required"),c=this.hasAttribute("disabled");t.getAttribute("role")!==e&&t.setAttribute("role",e),t.getAttribute("aria-label")!==a&&t.setAttribute("aria-label",a),t.getAttribute("aria-orientation")!==r&&t.setAttribute("aria-orientation",r),t.setAttribute("aria-disabled",c?"true":"false"),t.setAttribute("aria-required",i?"true":"false")}_isHorizontalRtl(){if(this.getAttribute("orientation")==="vertical")return!1;const t=this.getAttribute("dir");return t?t.toLowerCase()==="rtl":typeof window>"u"?!1:window.getComputedStyle(this).direction==="rtl"}shouldRenderOnAttributeChange(t,e,r){return!1}}typeof customElements<"u"&&!customElements.get("ui-toggle-group")&&customElements.define("ui-toggle-group",A);exports.UIToggleGroup=A;
131
+ `),this._syncChildren()}_syncGroupA11y(){const t=this.root.querySelector(".group");if(!t)return;const e=this.multiple?"group":"radiogroup",i=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",a=this.getAttribute("aria-label")||"Toggle group",r=this.hasAttribute("required"),d=this.hasAttribute("disabled");t.getAttribute("role")!==e&&t.setAttribute("role",e),t.getAttribute("aria-label")!==a&&t.setAttribute("aria-label",a),t.getAttribute("aria-orientation")!==i&&t.setAttribute("aria-orientation",i),t.setAttribute("aria-disabled",d?"true":"false"),t.setAttribute("aria-required",r?"true":"false")}_isHorizontalRtl(){if(this.getAttribute("orientation")==="vertical")return!1;const t=this.getAttribute("dir");return t?t.toLowerCase()==="rtl":typeof window>"u"?!1:window.getComputedStyle(this).direction==="rtl"}shouldRenderOnAttributeChange(t,e,i){return!1}}typeof customElements<"u"&&!customElements.get("ui-toggle-group")&&customElements.define("ui-toggle-group",v);exports.UIToggleGroup=v;
@@ -1,6 +1,6 @@
1
- import { E as x } from "./ElementBase-909688f3.mjs";
2
- import { r as A, s as f, g as y, f as m, m as w } from "./roving-focus-group-4350c9a7.mjs";
3
- const S = `
1
+ import { E as _ } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { r as m, s as p, g as v, f, m as x } from "./roving-focus-group-Dbm1Jko_.mjs";
3
+ const w = `
4
4
  :host {
5
5
  --ui-toggle-group-gap: 8px;
6
6
  --ui-toggle-group-padding: 6px;
@@ -117,29 +117,27 @@ const S = `
117
117
  --ui-toggle-group-shadow: none;
118
118
  }
119
119
  }
120
- `, E = /* @__PURE__ */ new Set(["multiple", "orientation", "aria-label", "required", "disabled"]);
121
- function C(n) {
120
+ `, S = /* @__PURE__ */ new Set(["multiple", "orientation", "aria-label", "required", "disabled"]);
121
+ function E(n) {
122
122
  return String(n).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
123
123
  }
124
- function I(n) {
124
+ function C(n) {
125
125
  try {
126
126
  return JSON.parse(n);
127
127
  } catch {
128
128
  return;
129
129
  }
130
130
  }
131
- function k(n, t) {
132
- if (!t)
133
- return n || "";
134
- if (!n)
135
- return [];
136
- const e = I(n);
137
- return Array.isArray(e) ? Array.from(new Set(e.map((r) => String(r)).filter(Boolean))) : n.includes(",") ? Array.from(new Set(n.split(",").map((r) => r.trim()).filter(Boolean))) : [n];
131
+ function I(n, t) {
132
+ if (!t) return n || "";
133
+ if (!n) return [];
134
+ const e = C(n);
135
+ return Array.isArray(e) ? Array.from(new Set(e.map((i) => String(i)).filter(Boolean))) : n.includes(",") ? Array.from(new Set(n.split(",").map((i) => i.trim()).filter(Boolean))) : [n];
138
136
  }
139
- function _(n, t) {
137
+ function A(n, t) {
140
138
  return t ? JSON.stringify(Array.isArray(n) ? n : [String(n)]) : String(n || "");
141
139
  }
142
- class z extends x {
140
+ class k extends _ {
143
141
  constructor() {
144
142
  super(), this._observer = null, this._isSyncing = !1, this._focusIndex = -1, this._onToggleEvent = this._onToggleEvent.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
145
143
  }
@@ -164,7 +162,7 @@ class z extends x {
164
162
  connectedCallback() {
165
163
  super.connectedCallback(), this.addEventListener("change", this._onToggleEvent), this.addEventListener("keydown", this._onKeyDown), this._observer = new MutationObserver((t) => {
166
164
  this._isSyncing || (t.forEach((e) => {
167
- e.type !== "childList" || e.removedNodes.length === 0 || e.removedNodes.forEach((r) => this._clearGroupFlagsFromNode(r));
165
+ e.type !== "childList" || e.removedNodes.length === 0 || e.removedNodes.forEach((i) => this._clearGroupFlagsFromNode(i));
168
166
  }), this._syncChildren());
169
167
  }), this._observer.observe(this, {
170
168
  childList: !0,
@@ -174,9 +172,9 @@ class z extends x {
174
172
  attributeFilter: ["value", "data-value", "disabled", "pressed", "data-disabled"]
175
173
  }), this._syncChildren();
176
174
  }
177
- attributeChangedCallback(t, e, r) {
178
- if (e !== r) {
179
- if (E.has(t)) {
175
+ attributeChangedCallback(t, e, i) {
176
+ if (e !== i) {
177
+ if (S.has(t)) {
180
178
  if (!this.root.querySelector(".group")) {
181
179
  this.requestRender();
182
180
  return;
@@ -196,10 +194,10 @@ class z extends x {
196
194
  t ? this.setAttribute("multiple", "") : this.removeAttribute("multiple");
197
195
  }
198
196
  get value() {
199
- return k(this.getAttribute("value"), this.multiple);
197
+ return I(this.getAttribute("value"), this.multiple);
200
198
  }
201
199
  set value(t) {
202
- const e = _(t, this.multiple);
200
+ const e = A(t, this.multiple);
203
201
  if (!this.multiple && !e) {
204
202
  this.hasAttribute("value") && this.removeAttribute("value"), this._syncChildren();
205
203
  return;
@@ -210,149 +208,133 @@ class z extends x {
210
208
  return Array.from(this.querySelectorAll("ui-toggle"));
211
209
  }
212
210
  _toggleValue(t, e) {
213
- var r;
214
- return t.getAttribute("value") || t.getAttribute("data-value") || ((r = t.textContent) == null ? void 0 : r.trim()) || String(e);
211
+ return t.getAttribute("value") || t.getAttribute("data-value") || t.textContent?.trim() || String(e);
215
212
  }
216
213
  _clearGroupFlags(t) {
217
- var e;
218
- t.hasAttribute("data-group-item") && t.removeAttribute("data-group-item"), t.hasAttribute("data-group-disabled") && t.removeAttribute("data-group-disabled"), t.hasAttribute("role") && t.removeAttribute("role"), t.hasAttribute("aria-checked") && t.removeAttribute("aria-checked"), (e = t._syncAria) == null || e.call(t);
214
+ t.hasAttribute("data-group-item") && t.removeAttribute("data-group-item"), t.hasAttribute("data-group-disabled") && t.removeAttribute("data-group-disabled"), t.hasAttribute("role") && t.removeAttribute("role"), t.hasAttribute("aria-checked") && t.removeAttribute("aria-checked"), t._syncAria?.();
219
215
  }
220
216
  _clearGroupFlagsFromNode(t) {
221
- if (!(t instanceof HTMLElement))
222
- return;
223
- t.matches("ui-toggle") && this._clearGroupFlags(t), Array.from(t.querySelectorAll("ui-toggle")).forEach((r) => this._clearGroupFlags(r));
217
+ if (!(t instanceof HTMLElement)) return;
218
+ t.matches("ui-toggle") && this._clearGroupFlags(t), Array.from(t.querySelectorAll("ui-toggle")).forEach((i) => this._clearGroupFlags(i));
224
219
  }
225
220
  _selectedSet() {
226
221
  const t = this.value;
227
222
  return Array.isArray(t) ? new Set(t.map((e) => String(e))) : t ? /* @__PURE__ */ new Set([String(t)]) : /* @__PURE__ */ new Set();
228
223
  }
229
224
  _setGroupValue(t, e = !0) {
230
- const r = _(t, this.multiple), a = this.getAttribute("value") || "";
231
- if (!this.multiple && !r && !a || a === r) {
225
+ const i = A(t, this.multiple), a = this.getAttribute("value") || "";
226
+ if (!this.multiple && !i && !a || a === i) {
232
227
  this._syncChildren();
233
228
  return;
234
229
  }
235
- if (!this.multiple && !r ? this.removeAttribute("value") : this.setAttribute("value", r), this._syncChildren(), !e)
236
- return;
237
- const i = {
230
+ if (!this.multiple && !i ? this.removeAttribute("value") : this.setAttribute("value", i), this._syncChildren(), !e) return;
231
+ const r = {
238
232
  value: this.multiple ? Array.isArray(t) ? t : [String(t)] : String(t || ""),
239
233
  values: this.multiple ? Array.isArray(t) ? t : [String(t)] : t ? [String(t)] : [],
240
234
  multiple: this.multiple
241
235
  };
242
- this.dispatchEvent(new CustomEvent("input", { detail: i, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: i, bubbles: !0, composed: !0 }));
236
+ this.dispatchEvent(new CustomEvent("input", { detail: r, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: r, bubbles: !0, composed: !0 }));
243
237
  }
244
238
  _syncChildren() {
245
- const t = this._toggles(), e = this.hasAttribute("disabled"), r = this._selectedSet(), a = this.multiple, i = (u, s, l) => {
246
- const b = u.hasAttribute(s);
247
- l && !b && u.setAttribute(s, ""), !l && b && u.removeAttribute(s);
248
- }, g = (u, s, l) => {
249
- u.getAttribute(s) !== l && u.setAttribute(s, l);
239
+ const t = this._toggles(), e = this.hasAttribute("disabled"), i = this._selectedSet(), a = this.multiple, r = (d, s, o) => {
240
+ const u = d.hasAttribute(s);
241
+ o && !u && d.setAttribute(s, ""), !o && u && d.removeAttribute(s);
242
+ }, g = (d, s, o) => {
243
+ d.getAttribute(s) !== o && d.setAttribute(s, o);
250
244
  };
251
- let c = -1, h = -1;
245
+ let c = -1, l = -1;
252
246
  this._isSyncing = !0;
253
247
  try {
254
- t.forEach((s, l) => {
255
- const b = this._toggleValue(s, l), d = s.hasAttribute("data-disabled") || s.getAttribute("aria-disabled") === "true", o = e || d;
256
- i(s, "data-group-item", !0), o ? (i(s, "disabled", !0), i(s, "data-group-disabled", e && !d)) : s.hasAttribute("data-group-disabled") && (i(s, "disabled", !1), i(s, "data-group-disabled", !1));
257
- const p = r.has(b);
258
- i(s, "pressed", p), g(s, "role", a ? "checkbox" : "radio"), g(s, "aria-checked", p ? "true" : "false"), p && h < 0 && (h = l), !s.hasAttribute("disabled") && c < 0 && (c = l);
248
+ t.forEach((s, o) => {
249
+ const u = this._toggleValue(s, o), h = s.hasAttribute("data-disabled") || s.getAttribute("aria-disabled") === "true", y = e || h;
250
+ r(s, "data-group-item", !0), y ? (r(s, "disabled", !0), r(s, "data-group-disabled", e && !h)) : s.hasAttribute("data-group-disabled") && (r(s, "disabled", !1), r(s, "data-group-disabled", !1));
251
+ const b = i.has(u);
252
+ r(s, "pressed", b), g(s, "role", a ? "checkbox" : "radio"), g(s, "aria-checked", b ? "true" : "false"), b && l < 0 && (l = o), !s.hasAttribute("disabled") && c < 0 && (c = o);
259
253
  });
260
- const u = A(t, {
254
+ const d = m(t, {
261
255
  activeIndex: this._focusIndex,
262
- selectedIndex: h >= 0 ? h : c,
256
+ selectedIndex: l >= 0 ? l : c,
263
257
  getDisabled: (s) => s.hasAttribute("disabled")
264
258
  });
265
- this._focusIndex = u, f(t, t[u] || null, { activeAttribute: null });
259
+ this._focusIndex = d, p(t, t[d] || null, { activeAttribute: null });
266
260
  } finally {
267
261
  this._isSyncing = !1;
268
262
  }
269
263
  }
270
264
  _onToggleEvent(t) {
271
- var h;
272
265
  const e = t.target;
273
- if (!e || e.tagName.toLowerCase() !== "ui-toggle" || this.hasAttribute("disabled"))
274
- return;
266
+ if (!e || e.tagName.toLowerCase() !== "ui-toggle" || this.hasAttribute("disabled")) return;
275
267
  const a = this._toggles().indexOf(e);
276
- if (a < 0)
277
- return;
278
- const i = this._toggleValue(e, a), g = ((h = t.detail) == null ? void 0 : h.pressed) ?? e.hasAttribute("pressed");
268
+ if (a < 0) return;
269
+ const r = this._toggleValue(e, a), g = t.detail?.pressed ?? e.hasAttribute("pressed");
279
270
  if (this._focusIndex = a, this.multiple) {
280
- const u = this._selectedSet();
281
- g ? u.add(i) : u.delete(i), this._setGroupValue(Array.from(u), !0);
271
+ const l = this._selectedSet();
272
+ g ? l.add(r) : l.delete(r), this._setGroupValue(Array.from(l), !0);
282
273
  return;
283
274
  }
284
275
  const c = this.hasAttribute("allow-empty") && !this.hasAttribute("required");
285
276
  if (g) {
286
- this._setGroupValue(i, !0);
277
+ this._setGroupValue(r, !0);
287
278
  return;
288
279
  }
289
- if (c)
290
- this._setGroupValue("", !0);
280
+ if (c) this._setGroupValue("", !0);
291
281
  else {
292
- const u = String(this.value || "");
293
- this._setGroupValue(u || i, !1);
282
+ const l = String(this.value || "");
283
+ this._setGroupValue(l || r, !1);
294
284
  }
295
285
  }
296
286
  _onKeyDown(t) {
297
- var l, b;
298
287
  const e = t.target;
299
- if (!e || e.tagName.toLowerCase() !== "ui-toggle")
300
- return;
301
- const r = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", a = this.getAttribute("activation") === "manual" ? "manual" : "auto", i = this._toggles().filter((d) => !d.hasAttribute("disabled"));
302
- if (i.length < 2)
303
- return;
304
- const g = i.indexOf(e);
305
- if (g < 0)
306
- return;
307
- const c = this._isHorizontalRtl(), h = (d) => {
308
- var v;
309
- const o = w(i, g, d, {
288
+ if (!e || e.tagName.toLowerCase() !== "ui-toggle") return;
289
+ const i = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", a = this.getAttribute("activation") === "manual" ? "manual" : "auto", r = this._toggles().filter((o) => !o.hasAttribute("disabled"));
290
+ if (r.length < 2) return;
291
+ const g = r.indexOf(e);
292
+ if (g < 0) return;
293
+ const c = this._isHorizontalRtl(), l = (o) => {
294
+ const u = x(r, g, o, {
310
295
  wrap: !0,
311
- fallbackIndex: A(i, { activeIndex: g, getDisabled: () => !1 }),
296
+ fallbackIndex: m(r, { activeIndex: g, getDisabled: () => !1 }),
312
297
  getDisabled: () => !1
313
298
  });
314
- if (o < 0)
315
- return;
316
- const p = i[o];
317
- this._focusIndex = this._toggles().indexOf(p), f(i, p, { activeAttribute: null }), m(p), a === "auto" && ((v = p.toggle) == null || v.call(p, !0));
318
- }, u = r === "horizontal" && (t.key === "ArrowRight" && !c || t.key === "ArrowLeft" && c) || r === "vertical" && t.key === "ArrowDown", s = r === "horizontal" && (t.key === "ArrowLeft" && !c || t.key === "ArrowRight" && c) || r === "vertical" && t.key === "ArrowUp";
319
- if (u) {
320
- t.preventDefault(), h(1);
299
+ if (u < 0) return;
300
+ const h = r[u];
301
+ this._focusIndex = this._toggles().indexOf(h), p(r, h, { activeAttribute: null }), f(h), a === "auto" && h.toggle?.(!0);
302
+ }, d = i === "horizontal" && (t.key === "ArrowRight" && !c || t.key === "ArrowLeft" && c) || i === "vertical" && t.key === "ArrowDown", s = i === "horizontal" && (t.key === "ArrowLeft" && !c || t.key === "ArrowRight" && c) || i === "vertical" && t.key === "ArrowUp";
303
+ if (d) {
304
+ t.preventDefault(), l(1);
321
305
  return;
322
306
  }
323
307
  if (s) {
324
- t.preventDefault(), h(-1);
308
+ t.preventDefault(), l(-1);
325
309
  return;
326
310
  }
327
311
  if (t.key === "Home") {
328
312
  t.preventDefault();
329
- const d = y(i, "first", () => !1);
330
- if (d < 0)
331
- return;
332
- const o = i[d];
333
- this._focusIndex = this._toggles().indexOf(o), f(i, o, { activeAttribute: null }), m(o), a === "auto" && ((l = o.toggle) == null || l.call(o, !0));
313
+ const o = v(r, "first", () => !1);
314
+ if (o < 0) return;
315
+ const u = r[o];
316
+ this._focusIndex = this._toggles().indexOf(u), p(r, u, { activeAttribute: null }), f(u), a === "auto" && u.toggle?.(!0);
334
317
  return;
335
318
  }
336
319
  if (t.key === "End") {
337
320
  t.preventDefault();
338
- const d = y(i, "last", () => !1);
339
- if (d < 0)
340
- return;
341
- const o = i[d];
342
- this._focusIndex = this._toggles().indexOf(o), f(i, o, { activeAttribute: null }), m(o), a === "auto" && ((b = o.toggle) == null || b.call(o, !0));
321
+ const o = v(r, "last", () => !1);
322
+ if (o < 0) return;
323
+ const u = r[o];
324
+ this._focusIndex = this._toggles().indexOf(u), p(r, u, { activeAttribute: null }), f(u), a === "auto" && u.toggle?.(!0);
343
325
  }
344
326
  }
345
327
  render() {
346
- const t = this.multiple ? "group" : "radiogroup", e = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", r = this.getAttribute("aria-label") || "Toggle group", a = this.hasAttribute("required"), i = this.hasAttribute("disabled");
328
+ const t = this.multiple ? "group" : "radiogroup", e = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", i = this.getAttribute("aria-label") || "Toggle group", a = this.hasAttribute("required"), r = this.hasAttribute("disabled");
347
329
  this.setContent(`
348
- <style>${S}</style>
330
+ <style>${w}</style>
349
331
  <div
350
332
  class="group"
351
333
  part="group"
352
334
  role="${t}"
353
- aria-label="${C(r)}"
335
+ aria-label="${E(i)}"
354
336
  aria-orientation="${e}"
355
- aria-disabled="${i ? "true" : "false"}"
337
+ aria-disabled="${r ? "true" : "false"}"
356
338
  aria-required="${a ? "true" : "false"}"
357
339
  >
358
340
  <slot></slot>
@@ -361,22 +343,20 @@ class z extends x {
361
343
  }
362
344
  _syncGroupA11y() {
363
345
  const t = this.root.querySelector(".group");
364
- if (!t)
365
- return;
366
- const e = this.multiple ? "group" : "radiogroup", r = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", a = this.getAttribute("aria-label") || "Toggle group", i = this.hasAttribute("required"), g = this.hasAttribute("disabled");
367
- t.getAttribute("role") !== e && t.setAttribute("role", e), t.getAttribute("aria-label") !== a && t.setAttribute("aria-label", a), t.getAttribute("aria-orientation") !== r && t.setAttribute("aria-orientation", r), t.setAttribute("aria-disabled", g ? "true" : "false"), t.setAttribute("aria-required", i ? "true" : "false");
346
+ if (!t) return;
347
+ const e = this.multiple ? "group" : "radiogroup", i = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", a = this.getAttribute("aria-label") || "Toggle group", r = this.hasAttribute("required"), g = this.hasAttribute("disabled");
348
+ t.getAttribute("role") !== e && t.setAttribute("role", e), t.getAttribute("aria-label") !== a && t.setAttribute("aria-label", a), t.getAttribute("aria-orientation") !== i && t.setAttribute("aria-orientation", i), t.setAttribute("aria-disabled", g ? "true" : "false"), t.setAttribute("aria-required", r ? "true" : "false");
368
349
  }
369
350
  _isHorizontalRtl() {
370
- if (this.getAttribute("orientation") === "vertical")
371
- return !1;
351
+ if (this.getAttribute("orientation") === "vertical") return !1;
372
352
  const t = this.getAttribute("dir");
373
353
  return t ? t.toLowerCase() === "rtl" : typeof window > "u" ? !1 : window.getComputedStyle(this).direction === "rtl";
374
354
  }
375
- shouldRenderOnAttributeChange(t, e, r) {
355
+ shouldRenderOnAttributeChange(t, e, i) {
376
356
  return !1;
377
357
  }
378
358
  }
379
- typeof customElements < "u" && !customElements.get("ui-toggle-group") && customElements.define("ui-toggle-group", z);
359
+ typeof customElements < "u" && !customElements.get("ui-toggle-group") && customElements.define("ui-toggle-group", k);
380
360
  export {
381
- z as UIToggleGroup
361
+ k as UIToggleGroup
382
362
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-1b301e7f.js"),c=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-EV6mVBUV.js"),c=`
2
2
  :host {
3
3
  --ui-toggle-radius: 10px;
4
4
  --ui-toggle-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent);
@@ -1,4 +1,4 @@
1
- import { E as g } from "./ElementBase-909688f3.mjs";
1
+ import { E as g } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const u = `
3
3
  :host {
4
4
  --ui-toggle-radius: 10px;
@@ -221,8 +221,7 @@ const u = `
221
221
  }
222
222
  `, l = /* @__PURE__ */ new Set(["icon-on", "icon-off", "aria-label"]);
223
223
  function c(o) {
224
- if (o == null)
225
- return !1;
224
+ if (o == null) return !1;
226
225
  const e = String(o).toLowerCase();
227
226
  return e !== "false" && e !== "0" && e !== "off";
228
227
  }
@@ -281,8 +280,7 @@ class d extends g {
281
280
  e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
282
281
  }
283
282
  toggle(e) {
284
- if (this.disabled)
285
- return;
283
+ if (this.disabled) return;
286
284
  const t = typeof e == "boolean" ? e : !this.pressed;
287
285
  if (t === this.pressed) {
288
286
  this._syncAria();
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-1b301e7f.js"),i=require("./roving-focus-group-5c059bf9.js"),b=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./ElementBase-EV6mVBUV.js"),i=require("./roving-focus-group-BdJ_4Njm.js"),b=`
2
2
  :host {
3
3
  --ui-toolbar-gap: 8px;
4
4
  --ui-toolbar-padding: 8px;