@editora/ui-core 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +30 -29
  48. package/dist/color-picker.cjs.js +10 -10
  49. package/dist/color-picker.esm.js +190 -253
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-collection.d.ts.map +1 -1
  57. package/dist/components/ui-multi-select.d.ts.map +1 -1
  58. package/dist/components/ui-orbiter.d.ts.map +1 -1
  59. package/dist/components/ui-portal.d.ts.map +1 -1
  60. package/dist/components/ui-positioner.d.ts.map +1 -1
  61. package/dist/components/ui-skeleton.d.ts.map +1 -1
  62. package/dist/components/ui-sortable.d.ts +8 -0
  63. package/dist/components/ui-sortable.d.ts.map +1 -1
  64. package/dist/components/ui-split-button.d.ts +1 -0
  65. package/dist/components/ui-split-button.d.ts.map +1 -1
  66. package/dist/components/ui-tabs.d.ts.map +1 -1
  67. package/dist/components/ui-textarea.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +9 -9
  80. package/dist/date-picker.esm.js +69 -97
  81. package/dist/date-range-picker.cjs.js +3 -3
  82. package/dist/date-range-picker.esm.js +32 -56
  83. package/dist/date-range-time-picker.cjs.js +9 -9
  84. package/dist/date-range-time-picker.esm.js +111 -140
  85. package/dist/date-time-picker.cjs.js +7 -7
  86. package/dist/date-time-picker.esm.js +115 -147
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +5 -5
  162. package/dist/multi-select.esm.js +125 -137
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +3 -3
  196. package/dist/portal.esm.js +20 -28
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +22 -28
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/primitives/auto-scroll.d.ts +9 -0
  204. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  205. package/dist/primitives/selector.d.ts +4 -0
  206. package/dist/primitives/selector.d.ts.map +1 -0
  207. package/dist/progress.cjs.js +1 -1
  208. package/dist/progress.esm.js +5 -9
  209. package/dist/quick-actions.cjs.js +6 -6
  210. package/dist/quick-actions.esm.js +52 -62
  211. package/dist/radio-group.cjs.js +13 -13
  212. package/dist/radio-group.esm.js +39 -51
  213. package/dist/radio.cjs.js +1 -1
  214. package/dist/radio.esm.js +5 -9
  215. package/dist/rating.cjs.js +1 -1
  216. package/dist/rating.esm.js +12 -23
  217. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  218. package/dist/roving-focus-group.cjs.js +1 -1
  219. package/dist/roving-focus-group.esm.js +3 -5
  220. package/dist/runtime-CTaOSmBj.js +1 -0
  221. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  222. package/dist/runtime.cjs.js +1 -1
  223. package/dist/runtime.esm.js +6 -6
  224. package/dist/scroll-area.cjs.js +3 -3
  225. package/dist/scroll-area.esm.js +38 -46
  226. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  227. package/dist/section.cjs.js +1 -1
  228. package/dist/section.esm.js +1 -1
  229. package/dist/select.cjs.js +7 -7
  230. package/dist/select.esm.js +67 -97
  231. package/dist/selection-popup.cjs.js +1 -1
  232. package/dist/selection-popup.esm.js +8 -15
  233. package/dist/selector-BvAh35ve.js +1 -0
  234. package/dist/selector-WI8pD7YO.mjs +18 -0
  235. package/dist/separator.cjs.js +1 -1
  236. package/dist/separator.esm.js +1 -1
  237. package/dist/sidebar.cjs.js +18 -18
  238. package/dist/sidebar.esm.js +117 -139
  239. package/dist/skeleton.cjs.js +11 -11
  240. package/dist/skeleton.esm.js +27 -24
  241. package/dist/slider.cjs.js +1 -1
  242. package/dist/slider.esm.js +6 -11
  243. package/dist/slot.cjs.js +4 -4
  244. package/dist/slot.esm.js +16 -19
  245. package/dist/sortable.cjs.js +79 -65
  246. package/dist/sortable.esm.js +714 -734
  247. package/dist/spinning-text.cjs.js +12 -12
  248. package/dist/spinning-text.esm.js +80 -92
  249. package/dist/split-button.cjs.js +4 -4
  250. package/dist/split-button.esm.js +77 -62
  251. package/dist/splitter.cjs.js +1 -1
  252. package/dist/splitter.esm.js +1 -1
  253. package/dist/stepper.cjs.js +8 -8
  254. package/dist/stepper.esm.js +32 -52
  255. package/dist/switch.cjs.js +7 -7
  256. package/dist/switch.esm.js +23 -31
  257. package/dist/table.cjs.js +2 -2
  258. package/dist/table.esm.js +46 -56
  259. package/dist/tabs.cjs.js +8 -8
  260. package/dist/tabs.esm.js +89 -109
  261. package/dist/tags-input.cjs.js +4 -4
  262. package/dist/tags-input.esm.js +45 -62
  263. package/dist/textarea.cjs.js +10 -10
  264. package/dist/textarea.esm.js +49 -52
  265. package/dist/time-field.cjs.js +4 -4
  266. package/dist/time-field.esm.js +70 -84
  267. package/dist/time-picker.cjs.js +22 -22
  268. package/dist/time-picker.esm.js +88 -110
  269. package/dist/timeline.cjs.js +1 -1
  270. package/dist/timeline.esm.js +3 -5
  271. package/dist/toast.cjs.js +2 -2
  272. package/dist/toast.esm.js +33 -47
  273. package/dist/toggle-group.cjs.js +6 -6
  274. package/dist/toggle-group.esm.js +85 -105
  275. package/dist/toggle.cjs.js +1 -1
  276. package/dist/toggle.esm.js +3 -5
  277. package/dist/toolbar.cjs.js +1 -1
  278. package/dist/toolbar.esm.js +13 -24
  279. package/dist/tooltip.cjs.js +2 -2
  280. package/dist/tooltip.esm.js +31 -42
  281. package/dist/transfer-list.cjs.js +31 -31
  282. package/dist/transfer-list.esm.js +114 -127
  283. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  284. package/dist/tree-Dx_kv_ih.js +39 -0
  285. package/dist/tree-item.cjs.js +2 -2
  286. package/dist/tree-item.esm.js +2 -3
  287. package/dist/tree.cjs.js +1 -1
  288. package/dist/tree.esm.js +2 -5
  289. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  290. package/dist/ui-button-rXQOS9QJ.js +521 -0
  291. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  292. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  293. package/dist/visually-hidden.cjs.js +1 -1
  294. package/dist/visually-hidden.esm.js +1 -1
  295. package/dist/wizard.cjs.js +14 -14
  296. package/dist/wizard.esm.js +85 -105
  297. package/package.json +2 -2
  298. package/dist/date-time-utils-66480de4.js +0 -1
  299. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  300. package/dist/dismissable-layer-193e3bed.js +0 -1
  301. package/dist/focus-scope-2b12b4e7.js +0 -1
  302. package/dist/listbox-308789a0.mjs +0 -210
  303. package/dist/listbox-ef2f708e.js +0 -46
  304. package/dist/panel-group-40254cdd.js +0 -36
  305. package/dist/portal-c69756c0.js +0 -1
  306. package/dist/positioner-33529bb8.js +0 -1
  307. package/dist/runtime-3f13807b.js +0 -1
  308. package/dist/tree-0a7a8d05.js +0 -39
  309. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  310. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  311. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  312. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  313. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,9 +1,9 @@
1
- import { E as T } from "./ElementBase-909688f3.mjs";
2
- const _ = {
1
+ import { E as T } from "./ElementBase-YlTLMsGk.mjs";
2
+ const y = {
3
3
  sm: { expanded: 220, collapsed: 64, min: 168, max: 300 },
4
4
  md: { expanded: 236, collapsed: 72, min: 180, max: 320 },
5
5
  lg: { expanded: 268, collapsed: 80, min: 192, max: 360 }
6
- }, z = /* @__PURE__ */ new Set([
6
+ }, w = /* @__PURE__ */ new Set([
7
7
  "variant",
8
8
  "size",
9
9
  "density",
@@ -21,7 +21,7 @@ const _ = {
21
21
  "position",
22
22
  "rail",
23
23
  "headless"
24
- ]), A = /* @__PURE__ */ new Set([
24
+ ]), _ = /* @__PURE__ */ new Set([
25
25
  "width",
26
26
  "min-width",
27
27
  "max-width",
@@ -746,41 +746,36 @@ const _ = {
746
746
  function d(o) {
747
747
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
748
748
  }
749
- function y(o) {
750
- if (!o)
751
- return null;
749
+ function f(o) {
750
+ if (!o) return null;
752
751
  const e = o.trim();
753
752
  return e ? ["none", "sm", "md", "lg", "full"].includes(e) ? e : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e : null;
754
753
  }
755
- function g(o) {
756
- if (!o)
757
- return null;
754
+ function m(o) {
755
+ if (!o) return null;
758
756
  const e = o.trim();
759
757
  return e ? /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e : null;
760
758
  }
761
- function C(o) {
759
+ function z(o) {
762
760
  return o === "sm" || o === "1" ? "sm" : o === "lg" || o === "3" ? "lg" : "md";
763
761
  }
764
762
  function l(o, e) {
765
- if (!o)
766
- return e;
763
+ if (!o) return e;
767
764
  const i = Number.parseFloat(String(o));
768
765
  return Number.isFinite(i) ? i : e;
769
766
  }
770
- function x(o) {
767
+ function v(o) {
771
768
  return o.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") || "item";
772
769
  }
773
770
  class V extends T {
774
771
  constructor() {
775
772
  super(...arguments), this._observer = null, this._resizeCleanup = null, this._responsiveCleanup = null, this._responsiveAutoCollapsed = !1, this._userCollapsePreference = !1, this._expanded = /* @__PURE__ */ new Set(), this._dragging = !1, this._lastExpandedWidth = 0, this._handleSearchInput = (e) => {
776
773
  const i = e.target;
777
- if (!i)
778
- return;
779
- const t = i.closest('[slot="search"]');
780
- if (!t || !this.contains(t))
781
- return;
782
- const r = typeof i.value == "string" ? i.value : "";
783
- r ? this.setAttribute("search-query", r) : this.removeAttribute("search-query"), this.dispatchEvent(new CustomEvent("search-change", { detail: { query: r }, bubbles: !0 }));
774
+ if (!i) return;
775
+ const r = i.closest('[slot="search"]');
776
+ if (!r || !this.contains(r)) return;
777
+ const t = typeof i.value == "string" ? i.value : "";
778
+ t ? this.setAttribute("search-query", t) : this.removeAttribute("search-query"), this.dispatchEvent(new CustomEvent("search-change", { detail: { query: t }, bubbles: !0 }));
784
779
  };
785
780
  }
786
781
  static get observedAttributes() {
@@ -822,23 +817,22 @@ class V extends T {
822
817
  super.connectedCallback(), this._observeLightDom(), this._bindResponsiveCollapse(), this.addEventListener("input", this._handleSearchInput, !0), this.addEventListener("change", this._handleSearchInput, !0);
823
818
  }
824
819
  disconnectedCallback() {
825
- var e, i, t;
826
- (e = this._observer) == null || e.disconnect(), this._observer = null, (i = this._resizeCleanup) == null || i.call(this), this._resizeCleanup = null, (t = this._responsiveCleanup) == null || t.call(this), this._responsiveCleanup = null, this.removeEventListener("input", this._handleSearchInput, !0), this.removeEventListener("change", this._handleSearchInput, !0), super.disconnectedCallback();
820
+ this._observer?.disconnect(), this._observer = null, this._resizeCleanup?.(), this._resizeCleanup = null, this._responsiveCleanup?.(), this._responsiveCleanup = null, this.removeEventListener("input", this._handleSearchInput, !0), this.removeEventListener("change", this._handleSearchInput, !0), super.disconnectedCallback();
827
821
  }
828
822
  shouldRenderOnAttributeChange(e) {
829
- return !(A.has(e) || z.has(e) || e === "collapsed" || e === "value" || e === "radius");
823
+ return !(_.has(e) || w.has(e) || e === "collapsed" || e === "value" || e === "radius");
830
824
  }
831
- attributeChangedCallback(e, i, t) {
832
- if (i !== t) {
825
+ attributeChangedCallback(e, i, r) {
826
+ if (i !== r) {
833
827
  if (e === "radius" && this.isConnected) {
834
- const r = y(t);
835
- if (r && r !== t) {
836
- this.setAttribute("radius", r);
828
+ const t = f(r);
829
+ if (t && t !== r) {
830
+ this.setAttribute("radius", t);
837
831
  return;
838
832
  }
839
833
  }
840
834
  if (this.isConnected) {
841
- if (A.has(e)) {
835
+ if (_.has(e)) {
842
836
  this._applySizing();
843
837
  return;
844
838
  }
@@ -850,7 +844,7 @@ class V extends T {
850
844
  this._applyItemMetrics();
851
845
  return;
852
846
  }
853
- if (!z.has(e)) {
847
+ if (!w.has(e)) {
854
848
  if (e === "collapsed") {
855
849
  this.hasAttribute("collapsed") && this._expanded.clear(), this._applySizing(), this._syncExpandedDom();
856
850
  return;
@@ -859,7 +853,7 @@ class V extends T {
859
853
  this._syncActiveDom();
860
854
  return;
861
855
  }
862
- super.attributeChangedCallback(e, i, t);
856
+ super.attributeChangedCallback(e, i, r);
863
857
  }
864
858
  }
865
859
  }
@@ -880,19 +874,19 @@ class V extends T {
880
874
  (typeof e == "boolean" ? e : !this.hasAttribute("collapsed")) ? this.collapse() : this.expand();
881
875
  }
882
876
  render() {
883
- const e = this._buildSections(), i = !this.querySelector('[slot="header"]'), t = !this.querySelector('[slot="search"]'), r = !this.querySelector('[slot="footer"]'), s = !this.querySelector('[slot="promo"]'), a = `
877
+ const e = this._buildSections(), i = !this.querySelector('[slot="header"]'), r = !this.querySelector('[slot="search"]'), t = !this.querySelector('[slot="footer"]'), s = !this.querySelector('[slot="promo"]'), n = `
884
878
  <aside class="shell" part="shell">
885
879
  <div class="header-wrap" part="header" ${i ? "hidden" : ""}><slot name="header"></slot></div>
886
- <div class="search-wrap" part="search" ${t ? "hidden" : ""}><slot name="search"></slot></div>
880
+ <div class="search-wrap" part="search" ${r ? "hidden" : ""}><slot name="search"></slot></div>
887
881
  <nav class="nav" part="nav" aria-label="${d(this.getAttribute("aria-label") || "Sidebar")}">
888
882
  ${e}
889
883
  </nav>
890
884
  <div class="promo-wrap" part="promo" ${s ? "hidden" : ""}><slot name="promo"></slot></div>
891
- <div class="footer-wrap" part="footer" ${r ? "hidden" : ""}><slot name="footer"></slot></div>
885
+ <div class="footer-wrap" part="footer" ${t ? "hidden" : ""}><slot name="footer"></slot></div>
892
886
  <button class="resize-handle" part="resize-handle" type="button" aria-label="Resize sidebar"></button>
893
887
  </aside>
894
888
  `;
895
- this.setContent(D(a)), this._applyItemMetrics(), this._applyRadius(), this._applySizing(), this._bindInteractions(), this._syncActiveDom(), this._syncExpandedDom();
889
+ this.setContent(D(n)), this._applyItemMetrics(), this._applyRadius(), this._applySizing(), this._bindInteractions(), this._syncActiveDom(), this._syncExpandedDom();
896
890
  }
897
891
  _observeLightDom() {
898
892
  this._observer || (this._observer = new MutationObserver((e) => {
@@ -906,10 +900,10 @@ class V extends T {
906
900
  }
907
901
  _buildSections() {
908
902
  const e = this._groupItems(this._filterItems(this._collectItems(), this.getAttribute("search-query") || ""));
909
- return e.length ? e.map(({ label: i, items: t }) => `
903
+ return e.length ? e.map(({ label: i, items: r }) => `
910
904
  <section class="section" part="section">
911
905
  ${i ? `<div class="section-label" part="section-label">${d(i)}</div>` : ""}
912
- <div class="section-items">${t.map((s, a) => this._renderItem(s, `${x(i || "general")}-${a}`)).join("")}</div>
906
+ <div class="section-items">${r.map((s, n) => this._renderItem(s, `${v(i || "general")}-${n}`)).join("")}</div>
913
907
  </section>
914
908
  `).join("") : `
915
909
  <section class="section" part="section">
@@ -927,18 +921,18 @@ class V extends T {
927
921
  `;
928
922
  }
929
923
  _renderItem(e, i) {
930
- const t = e.id || i, r = this.value ? this.value === e.value : !!e.active, s = this._expanded.has(t), a = this.getAttribute("show-icons") !== "false", n = this.getAttribute("show-badges") !== "false", c = e.description ? `<div class="item-description">${d(e.description)}</div>` : "", u = e.contentHtml ? `<span class="copy custom-copy">${e.contentHtml}</span>` : `<span class="copy">
924
+ const r = e.id || i, t = this.value ? this.value === e.value : !!e.active, s = this._expanded.has(r), n = this.getAttribute("show-icons") !== "false", a = this.getAttribute("show-badges") !== "false", c = e.description ? `<div class="item-description">${d(e.description)}</div>` : "", u = e.contentHtml ? `<span class="copy custom-copy">${e.contentHtml}</span>` : `<span class="copy">
931
925
  <span class="item-label">${d(e.label)}</span>
932
926
  ${c}
933
- </span>`, h = a ? this._renderIcon(e) : "", b = n && e.badge ? `<span class="badge" part="badge">${d(e.badge)}</span>` : "", p = e.children.length ? '<span class="arrow-wrap" part="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6 3.75L10.25 8L6 12.25" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg></span>' : "", v = h ? `<span class="icon-wrap" part="icon"><span class="icon">${h}</span></span>` : "", f = b || p ? `<span class="end-wrap">${b ? `<span class="meta">${b}</span>` : ""}${p}</span>` : "", m = !!e.href && !e.children.length, E = r ? ' aria-current="page" data-active="true"' : "", $ = e.disabled ? ' aria-disabled="true"' : ' aria-disabled="false"', k = e.tone && e.tone !== "default" ? ` data-tone="${d(e.tone)}"` : "", I = m ? ` href="${d(e.href || "")}"` : "", S = m && e.target ? ` target="${d(e.target)}"` : "", P = m && e.rel ? ` rel="${d(e.rel)}"` : "", L = e.children.length ? `<div class="submenu" part="submenu"><div class="submenu-inner">${e.children.map((R, W) => this._renderItem(R, `${t}-${W}`)).join("")}</div></div>` : "", w = m ? "a" : "button", H = m ? "" : ' type="button"';
927
+ </span>`, p = n ? this._renderIcon(e) : "", g = a && e.badge ? `<span class="badge" part="badge">${d(e.badge)}</span>` : "", b = e.children.length ? '<span class="arrow-wrap" part="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6 3.75L10.25 8L6 12.25" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg></span>' : "", A = p ? `<span class="icon-wrap" part="icon"><span class="icon">${p}</span></span>` : "", C = g || b ? `<span class="end-wrap">${g ? `<span class="meta">${g}</span>` : ""}${b}</span>` : "", h = !!e.href && !e.children.length, E = t ? ' aria-current="page" data-active="true"' : "", $ = e.disabled ? ' aria-disabled="true"' : ' aria-disabled="false"', k = e.tone && e.tone !== "default" ? ` data-tone="${d(e.tone)}"` : "", I = h ? ` href="${d(e.href || "")}"` : "", S = h && e.target ? ` target="${d(e.target)}"` : "", P = h && e.rel ? ` rel="${d(e.rel)}"` : "", L = e.children.length ? `<div class="submenu" part="submenu"><div class="submenu-inner">${e.children.map((R, W) => this._renderItem(R, `${r}-${W}`)).join("")}</div></div>` : "", x = h ? "a" : "button", H = h ? "" : ' type="button"';
934
928
  return `
935
- <div class="item" data-item-id="${d(t)}" data-value="${d(e.value)}" ${s ? 'data-expanded="true"' : ""}>
936
- <${w}
929
+ <div class="item" data-item-id="${d(r)}" data-value="${d(e.value)}" ${s ? 'data-expanded="true"' : ""}>
930
+ <${x}
937
931
  class="item-button"
938
932
  part="item"
939
933
  ${H}
940
- data-action="${e.children.length ? "toggle" : m ? "navigate" : "select"}"
941
- data-item-id="${d(t)}"
934
+ data-action="${e.children.length ? "toggle" : h ? "navigate" : "select"}"
935
+ data-item-id="${d(r)}"
942
936
  data-value="${d(e.value)}"
943
937
  ${I}
944
938
  ${S}
@@ -947,10 +941,10 @@ class V extends T {
947
941
  ${$}
948
942
  ${k}
949
943
  >
950
- ${v}
944
+ ${A}
951
945
  ${u}
952
- ${f}
953
- </${w}>
946
+ ${C}
947
+ </${x}>
954
948
  ${L}
955
949
  </div>
956
950
  `;
@@ -971,19 +965,18 @@ class V extends T {
971
965
  return Array.from(this.querySelectorAll('[slot="item"]')).map((e) => this._parseSlottedItem(e));
972
966
  }
973
967
  _parseSlottedItem(e) {
974
- var r, s;
975
968
  let i = [];
976
- const t = e.dataset.children;
977
- if (t)
969
+ const r = e.dataset.children;
970
+ if (r)
978
971
  try {
979
- const a = JSON.parse(t);
980
- Array.isArray(a) && (i = a);
972
+ const t = JSON.parse(r);
973
+ Array.isArray(t) && (i = t);
981
974
  } catch {
982
975
  i = [];
983
976
  }
984
977
  return {
985
- value: e.dataset.value || ((r = e.textContent) == null ? void 0 : r.trim()) || "item",
986
- label: e.dataset.label || ((s = e.textContent) == null ? void 0 : s.trim()) || e.dataset.value || "Item",
978
+ value: e.dataset.value || e.textContent?.trim() || "item",
979
+ label: e.dataset.label || e.textContent?.trim() || e.dataset.value || "Item",
987
980
  href: e.dataset.href,
988
981
  target: e.dataset.target,
989
982
  rel: e.dataset.rel,
@@ -1001,67 +994,65 @@ class V extends T {
1001
994
  }
1002
995
  _renderIcon(e) {
1003
996
  const i = String(e.iconHtml || "").trim();
1004
- if (i)
1005
- return i;
1006
- const t = String(e.icon || "").trim();
1007
- return t ? d(t) : "";
997
+ if (i) return i;
998
+ const r = String(e.icon || "").trim();
999
+ return r ? d(r) : "";
1008
1000
  }
1009
- _normalizeItems(e, i = 0, t = "") {
1010
- return e.map((r, s) => {
1011
- var b, p, v, f;
1012
- const a = ((b = r.label) == null ? void 0 : b.trim()) || ((p = r.value) == null ? void 0 : p.trim()) || `Item ${s + 1}`, n = ((v = r.value) == null ? void 0 : v.trim()) || x(a), c = ((f = r.section) == null ? void 0 : f.trim()) || t || "", u = `${x(c || "nav")}-${x(n)}-${i}-${s}`, h = this._normalizeItems(r.children || [], i + 1, c);
1001
+ _normalizeItems(e, i = 0, r = "") {
1002
+ return e.map((t, s) => {
1003
+ const n = t.label?.trim() || t.value?.trim() || `Item ${s + 1}`, a = t.value?.trim() || v(n), c = t.section?.trim() || r || "", u = `${v(c || "nav")}-${v(a)}-${i}-${s}`, p = this._normalizeItems(t.children || [], i + 1, c);
1013
1004
  return {
1014
- ...r,
1005
+ ...t,
1015
1006
  id: u,
1016
- label: a,
1017
- value: n,
1007
+ label: n,
1008
+ value: a,
1018
1009
  section: c,
1019
- children: h,
1010
+ children: p,
1020
1011
  depth: i
1021
1012
  };
1022
1013
  });
1023
1014
  }
1024
1015
  _groupItems(e) {
1025
- const i = [], t = /* @__PURE__ */ new Map();
1026
- for (const r of e) {
1027
- const s = r.section || "", a = t.get(s);
1028
- if (a) {
1029
- a.items.push(r);
1016
+ const i = [], r = /* @__PURE__ */ new Map();
1017
+ for (const t of e) {
1018
+ const s = t.section || "", n = r.get(s);
1019
+ if (n) {
1020
+ n.items.push(t);
1030
1021
  continue;
1031
1022
  }
1032
- const n = { label: s, items: [r] };
1033
- t.set(s, n), i.push(n);
1023
+ const a = { label: s, items: [t] };
1024
+ r.set(s, a), i.push(a);
1034
1025
  }
1035
1026
  return i;
1036
1027
  }
1037
1028
  _filterItems(e, i) {
1038
- const t = i.trim().toLowerCase();
1039
- return t ? e.map((r) => {
1040
- const s = [r.label, r.description, r.value, r.section].filter(Boolean).some((n) => String(n).toLowerCase().includes(t)), a = s ? r.children : this._filterItems(r.children, t);
1041
- return !s && !a.length ? null : {
1042
- ...r,
1043
- children: a
1029
+ const r = i.trim().toLowerCase();
1030
+ return r ? e.map((t) => {
1031
+ const s = [t.label, t.description, t.value, t.section].filter(Boolean).some((a) => String(a).toLowerCase().includes(r)), n = s ? t.children : this._filterItems(t.children, r);
1032
+ return !s && !n.length ? null : {
1033
+ ...t,
1034
+ children: n
1044
1035
  };
1045
- }).filter((r) => !!r) : e;
1036
+ }).filter((t) => !!t) : e;
1046
1037
  }
1047
1038
  _bindInteractions() {
1048
1039
  this.root.querySelectorAll(".item-button").forEach((i) => {
1049
- i.onclick = (t) => {
1050
- const r = t.currentTarget, s = r.dataset.action, a = r.dataset.itemId || "", n = r.dataset.value || "";
1051
- if (r.getAttribute("aria-disabled") !== "true") {
1040
+ i.onclick = (r) => {
1041
+ const t = r.currentTarget, s = t.dataset.action, n = t.dataset.itemId || "", a = t.dataset.value || "";
1042
+ if (t.getAttribute("aria-disabled") !== "true") {
1052
1043
  if (s === "toggle") {
1053
- t.preventDefault(), this._toggleExpanded(a);
1044
+ r.preventDefault(), this._toggleExpanded(n);
1054
1045
  return;
1055
1046
  }
1056
1047
  if (s === "navigate") {
1057
- this._selectValue(n);
1048
+ this._selectValue(a);
1058
1049
  return;
1059
1050
  }
1060
- t.preventDefault(), this._selectValue(n);
1051
+ r.preventDefault(), this._selectValue(a);
1061
1052
  }
1062
- }, i.onkeydown = (t) => {
1063
- const r = t.currentTarget, s = r.dataset.itemId || "", a = r.dataset.value || "";
1064
- t.key === "ArrowRight" && r.dataset.action === "toggle" ? (t.preventDefault(), this._expanded.add(s), this._syncExpandedDom()) : t.key === "ArrowLeft" ? (t.preventDefault(), this._expanded.delete(s), this._syncExpandedDom()) : (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r.dataset.action === "toggle" ? this._toggleExpanded(s) : this._selectValue(a));
1053
+ }, i.onkeydown = (r) => {
1054
+ const t = r.currentTarget, s = t.dataset.itemId || "", n = t.dataset.value || "";
1055
+ r.key === "ArrowRight" && t.dataset.action === "toggle" ? (r.preventDefault(), this._expanded.add(s), this._syncExpandedDom()) : r.key === "ArrowLeft" ? (r.preventDefault(), this._expanded.delete(s), this._syncExpandedDom()) : (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t.dataset.action === "toggle" ? this._toggleExpanded(s) : this._selectValue(n));
1065
1056
  };
1066
1057
  });
1067
1058
  const e = this.root.querySelector(".resize-handle");
@@ -1078,11 +1069,11 @@ class V extends T {
1078
1069
  }
1079
1070
  _selectValue(e) {
1080
1071
  this.value = e;
1081
- const i = this._flattenItems(this._collectItems()), t = i.findIndex((a) => a.value === e), r = i[t], s = {
1082
- index: t,
1072
+ const i = this._flattenItems(this._collectItems()), r = i.findIndex((n) => n.value === e), t = i[r], s = {
1073
+ index: r,
1083
1074
  value: e,
1084
- label: (r == null ? void 0 : r.label) || e,
1085
- item: r
1075
+ label: t?.label || e,
1076
+ item: t
1086
1077
  };
1087
1078
  this.dispatchEvent(new CustomEvent("select", { detail: s, bubbles: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: s, bubbles: !0 }));
1088
1079
  }
@@ -1096,8 +1087,8 @@ class V extends T {
1096
1087
  return e.flatMap((i) => [i, ...this._flattenItems(i.children)]);
1097
1088
  }
1098
1089
  _applySizing() {
1099
- const e = C(this.getAttribute("size")), i = _[e], t = l(this.getAttribute("width"), i.expanded), r = l(this.getAttribute("min-width"), i.min), s = l(this.getAttribute("max-width"), i.max), a = l(this.getAttribute("collapsed-width"), i.collapsed), n = this._restoreWidth(t), c = Math.min(Math.max(n, r), s), u = this.hasAttribute("collapsed") ? a : c;
1100
- this.style.setProperty("--ui-sidebar-width", `${c}px`), this.style.setProperty("--ui-sidebar-min-width", `${r}px`), this.style.setProperty("--ui-sidebar-max-width", `${s}px`), this.style.setProperty("--ui-sidebar-collapsed-width", `${a}px`), this.style.setProperty("--ui-sidebar-current-width", `${u}px`), this.style.setProperty("inline-size", `${u}px`);
1090
+ const e = z(this.getAttribute("size")), i = y[e], r = l(this.getAttribute("width"), i.expanded), t = l(this.getAttribute("min-width"), i.min), s = l(this.getAttribute("max-width"), i.max), n = l(this.getAttribute("collapsed-width"), i.collapsed), a = this._restoreWidth(r), c = Math.min(Math.max(a, t), s), u = this.hasAttribute("collapsed") ? n : c;
1091
+ this.style.setProperty("--ui-sidebar-width", `${c}px`), this.style.setProperty("--ui-sidebar-min-width", `${t}px`), this.style.setProperty("--ui-sidebar-max-width", `${s}px`), this.style.setProperty("--ui-sidebar-collapsed-width", `${n}px`), this.style.setProperty("--ui-sidebar-current-width", `${u}px`), this.style.setProperty("inline-size", `${u}px`);
1101
1092
  }
1102
1093
  _applyRadius() {
1103
1094
  const e = this.getAttribute("radius"), i = this.getAttribute("item-radius");
@@ -1105,12 +1096,12 @@ class V extends T {
1105
1096
  this.style.removeProperty("--ui-sidebar-radius"), i || this.style.removeProperty("--ui-sidebar-item-radius"), this.style.removeProperty("--ui-sidebar-promo-radius");
1106
1097
  return;
1107
1098
  }
1108
- const t = y(e) || e;
1109
- this.style.setProperty("--ui-sidebar-radius", t), i || this.style.setProperty("--ui-sidebar-item-radius", t), this.style.setProperty("--ui-sidebar-promo-radius", t);
1099
+ const r = f(e) || e;
1100
+ this.style.setProperty("--ui-sidebar-radius", r), i || this.style.setProperty("--ui-sidebar-item-radius", r), this.style.setProperty("--ui-sidebar-promo-radius", r);
1110
1101
  }
1111
1102
  _applyItemMetrics() {
1112
- const e = y(this.getAttribute("item-radius")), i = g(this.getAttribute("item-gap")), t = g(this.getAttribute("item-padding-x")), r = g(this.getAttribute("item-padding-y")), s = g(this.getAttribute("item-height")), a = g(this.getAttribute("item-font-size")), n = g(this.getAttribute("item-line-height"));
1113
- this._setOptionalCssVar("--ui-sidebar-item-radius", e), this._setOptionalCssVar("--ui-sidebar-item-gap", i), this._setOptionalCssVar("--ui-sidebar-item-padding-x", t), this._setOptionalCssVar("--ui-sidebar-item-padding-y", r), this._setOptionalCssVar("--ui-sidebar-item-height", s), this._setOptionalCssVar("--ui-sidebar-item-font-size", a), this._setOptionalCssVar("--ui-sidebar-item-line-height", n);
1103
+ const e = f(this.getAttribute("item-radius")), i = m(this.getAttribute("item-gap")), r = m(this.getAttribute("item-padding-x")), t = m(this.getAttribute("item-padding-y")), s = m(this.getAttribute("item-height")), n = m(this.getAttribute("item-font-size")), a = m(this.getAttribute("item-line-height"));
1104
+ this._setOptionalCssVar("--ui-sidebar-item-radius", e), this._setOptionalCssVar("--ui-sidebar-item-gap", i), this._setOptionalCssVar("--ui-sidebar-item-padding-x", r), this._setOptionalCssVar("--ui-sidebar-item-padding-y", t), this._setOptionalCssVar("--ui-sidebar-item-height", s), this._setOptionalCssVar("--ui-sidebar-item-font-size", n), this._setOptionalCssVar("--ui-sidebar-item-line-height", a);
1114
1105
  }
1115
1106
  _setOptionalCssVar(e, i) {
1116
1107
  if (!i) {
@@ -1120,24 +1111,20 @@ class V extends T {
1120
1111
  this.style.setProperty(e, i);
1121
1112
  }
1122
1113
  _restoreWidth(e) {
1123
- if (!this.hasAttribute("auto-save"))
1124
- return e;
1114
+ if (!this.hasAttribute("auto-save")) return e;
1125
1115
  const i = this.getAttribute("storage-key");
1126
- if (!i)
1127
- return e;
1116
+ if (!i) return e;
1128
1117
  try {
1129
- const t = window.localStorage.getItem(`ui-sidebar:${i}`);
1130
- if (!t)
1131
- return e;
1132
- const r = Number.parseFloat(t);
1133
- return Number.isFinite(r) ? r : e;
1118
+ const r = window.localStorage.getItem(`ui-sidebar:${i}`);
1119
+ if (!r) return e;
1120
+ const t = Number.parseFloat(r);
1121
+ return Number.isFinite(t) ? t : e;
1134
1122
  } catch {
1135
1123
  return e;
1136
1124
  }
1137
1125
  }
1138
1126
  _persistWidth(e) {
1139
- if (!this.hasAttribute("auto-save"))
1140
- return;
1127
+ if (!this.hasAttribute("auto-save")) return;
1141
1128
  const i = this.getAttribute("storage-key");
1142
1129
  if (i)
1143
1130
  try {
@@ -1147,12 +1134,10 @@ class V extends T {
1147
1134
  }
1148
1135
  _currentExpandedWidth() {
1149
1136
  const e = Number.parseFloat(this.style.getPropertyValue("--ui-sidebar-width"));
1150
- return Number.isFinite(e) && e > 0 ? e : l(this.getAttribute("width"), _[C(this.getAttribute("size"))].expanded);
1137
+ return Number.isFinite(e) && e > 0 ? e : l(this.getAttribute("width"), y[z(this.getAttribute("size"))].expanded);
1151
1138
  }
1152
1139
  _bindResponsiveCollapse() {
1153
- var t;
1154
- if ((t = this._responsiveCleanup) == null || t.call(this), this._responsiveCleanup = null, typeof window > "u" || typeof window.matchMedia != "function")
1155
- return;
1140
+ if (this._responsiveCleanup?.(), this._responsiveCleanup = null, typeof window > "u" || typeof window.matchMedia != "function") return;
1156
1141
  const e = window.matchMedia("(max-width: 767px)"), i = () => this._syncResponsiveCollapse(e.matches);
1157
1142
  typeof e.addEventListener == "function" ? e.addEventListener("change", i) : typeof e.addListener == "function" && e.addListener(i), this._responsiveCleanup = () => {
1158
1143
  typeof e.removeEventListener == "function" ? e.removeEventListener("change", i) : typeof e.removeListener == "function" && e.removeListener(i);
@@ -1178,38 +1163,31 @@ class V extends T {
1178
1163
  this.dispatchEvent(new CustomEvent("width-change", { detail: i, bubbles: !0 }));
1179
1164
  }
1180
1165
  _handleResizeKey(e) {
1181
- const t = this.getAttribute("position") === "right" ? -1 : 1, r = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), r), a = l(this.style.getPropertyValue("--ui-sidebar-max-width"), r);
1182
- let n = r;
1183
- if (e.key === "ArrowRight")
1184
- n = r + 16 * t;
1185
- else if (e.key === "ArrowLeft")
1186
- n = r - 16 * t;
1187
- else if (e.key === "Home")
1188
- n = s;
1189
- else if (e.key === "End")
1190
- n = a;
1191
- else
1192
- return;
1193
- e.preventDefault(), n = Math.min(Math.max(n, s), a), this.style.setProperty("--ui-sidebar-width", `${n}px`), this.hasAttribute("collapsed") || (this.style.setProperty("--ui-sidebar-current-width", `${n}px`), this.style.setProperty("inline-size", `${n}px`)), this._persistWidth(n), this._emitWidthChange("keyboard");
1166
+ const r = this.getAttribute("position") === "right" ? -1 : 1, t = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = l(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1167
+ let a = t;
1168
+ if (e.key === "ArrowRight") a = t + 16 * r;
1169
+ else if (e.key === "ArrowLeft") a = t - 16 * r;
1170
+ else if (e.key === "Home") a = s;
1171
+ else if (e.key === "End") a = n;
1172
+ else return;
1173
+ e.preventDefault(), a = Math.min(Math.max(a, s), n), this.style.setProperty("--ui-sidebar-width", `${a}px`), this.hasAttribute("collapsed") || (this.style.setProperty("--ui-sidebar-current-width", `${a}px`), this.style.setProperty("inline-size", `${a}px`)), this._persistWidth(a), this._emitWidthChange("keyboard");
1194
1174
  }
1195
1175
  _startResize(e) {
1196
- if (!this.hasAttribute("resizable"))
1197
- return;
1176
+ if (!this.hasAttribute("resizable")) return;
1198
1177
  e.preventDefault();
1199
- const i = this.getAttribute("position") === "right", t = e.clientX, r = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), r), a = l(this.style.getPropertyValue("--ui-sidebar-max-width"), r);
1200
- this._dragging = !0, this.dispatchEvent(new CustomEvent("resize-start", { detail: { width: r }, bubbles: !0 }));
1201
- const n = (u) => {
1202
- const h = u.clientX - t, b = i ? r - h : r + h, p = Math.min(Math.max(b, s), a);
1203
- this.style.setProperty("--ui-sidebar-width", `${p}px`), this.hasAttribute("collapsed") || (this.style.setProperty("--ui-sidebar-current-width", `${p}px`), this.style.setProperty("inline-size", `${p}px`)), this.dispatchEvent(new CustomEvent("resize", { detail: { width: p }, bubbles: !0 }));
1178
+ const i = this.getAttribute("position") === "right", r = e.clientX, t = this._currentExpandedWidth(), s = l(this.style.getPropertyValue("--ui-sidebar-min-width"), t), n = l(this.style.getPropertyValue("--ui-sidebar-max-width"), t);
1179
+ this._dragging = !0, this.dispatchEvent(new CustomEvent("resize-start", { detail: { width: t }, bubbles: !0 }));
1180
+ const a = (u) => {
1181
+ const p = u.clientX - r, g = i ? t - p : t + p, b = Math.min(Math.max(g, s), n);
1182
+ this.style.setProperty("--ui-sidebar-width", `${b}px`), this.hasAttribute("collapsed") || (this.style.setProperty("--ui-sidebar-current-width", `${b}px`), this.style.setProperty("inline-size", `${b}px`)), this.dispatchEvent(new CustomEvent("resize", { detail: { width: b }, bubbles: !0 }));
1204
1183
  }, c = () => {
1205
- if (!this._dragging)
1206
- return;
1207
- this._dragging = !1, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", c);
1184
+ if (!this._dragging) return;
1185
+ this._dragging = !1, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", c);
1208
1186
  const u = this._currentExpandedWidth();
1209
1187
  this._persistWidth(u), this._emitWidthChange("pointer"), this.dispatchEvent(new CustomEvent("resize-end", { detail: { width: u }, bubbles: !0 }));
1210
1188
  };
1211
- window.addEventListener("pointermove", n), window.addEventListener("pointerup", c), this._resizeCleanup = () => {
1212
- window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", c);
1189
+ window.addEventListener("pointermove", a), window.addEventListener("pointerup", c), this._resizeCleanup = () => {
1190
+ window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", c);
1213
1191
  };
1214
1192
  }
1215
1193
  }
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-1b301e7f.js"),h=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./ElementBase-EV6mVBUV.js");function r(a){const e=a.trim();return!e||/[;{}<>"']/.test(e)?"":e}const x=`
2
2
  :host {
3
3
  display: block;
4
4
  --ui-skeleton-radius: 10px;
@@ -183,23 +183,23 @@
183
183
  display: none !important;
184
184
  }
185
185
  }
186
- `,o=["96%","86%","78%","92%","68%","88%"];class s extends g.ElementBase{static get observedAttributes(){return["count","height","width","radius","gap","variant","animated","animation","density","tone","duration","headless"]}_numAttr(e,t){const i=this.getAttribute(e);if(!i)return t;const n=Number(i);return Number.isFinite(n)&&n>0?n:t}_animationMode(){const e=(this.getAttribute("animation")||"").trim().toLowerCase();return e==="shimmer"||e==="pulse"||e==="wave"||e==="none"?e:this.hasAttribute("animated")?"shimmer":"none"}_lineWidth(e,t,i){return i&&i.trim()?i:t==="text"?o[e%o.length]||"92%":t==="badge"?"92px":t==="button"?"128px":t==="avatar"?"44px":"100%"}render(){const e=Math.max(1,Math.min(40,this._numAttr("count",1))),t=this.getAttribute("height"),i=this.getAttribute("width"),n=this.getAttribute("radius"),r=this.getAttribute("gap"),a=this.getAttribute("duration"),l=(this.getAttribute("variant")||"rect").trim(),u=this._animationMode(),d=Array.from({length:e},(m,c)=>`<div class="line" style="--ui-line-width:${this._lineWidth(c,l,i)};"></div>`).join("");this.setContent(`
187
- <style>${h}</style>
186
+ `,g=["96%","86%","78%","92%","68%","88%"];class p extends f.ElementBase{static get observedAttributes(){return["count","height","width","radius","gap","variant","animated","animation","density","tone","duration","headless"]}_numAttr(e,t){const i=this.getAttribute(e);if(!i)return t;const n=Number(i);return Number.isFinite(n)&&n>0?n:t}_animationMode(){const e=(this.getAttribute("animation")||"").trim().toLowerCase();return e==="shimmer"||e==="pulse"||e==="wave"||e==="none"?e:this.hasAttribute("animated")?"shimmer":"none"}_lineWidth(e,t,i){return i&&i.trim()?i:t==="text"?g[e%g.length]||"92%":t==="badge"?"92px":t==="button"?"128px":t==="avatar"?"44px":"100%"}render(){const e=Math.max(1,Math.min(40,this._numAttr("count",1))),t=this.getAttribute("height"),i=this.getAttribute("width"),n=this.getAttribute("radius"),o=this.getAttribute("gap"),s=this.getAttribute("duration"),m=(this.getAttribute("variant")||"rect").trim(),k=this._animationMode(),b=Array.from({length:e},(w,v)=>`<div class="line" style="--ui-line-width:${r(this._lineWidth(v,m,i))};"></div>`).join(""),u=t?r(t):"",l=i?r(i):"",c=n?r(n):"",d=o?r(o):"",h=s?r(s):"";this.setContent(`
187
+ <style>${x}</style>
188
188
  <div
189
189
  class="stack"
190
- data-animation="${u}"
190
+ data-animation="${k}"
191
191
  style="
192
- ${t?`--ui-skeleton-height:${t};`:""}
193
- ${i?`--ui-skeleton-width:${i};`:""}
194
- ${n?`--ui-skeleton-radius:${n};`:""}
195
- ${r?`--ui-skeleton-gap:${r};`:""}
196
- ${a?`--ui-skeleton-duration:${a};`:""}
192
+ ${u?`--ui-skeleton-height:${u};`:""}
193
+ ${l?`--ui-skeleton-width:${l};`:""}
194
+ ${c?`--ui-skeleton-radius:${c};`:""}
195
+ ${d?`--ui-skeleton-gap:${d};`:""}
196
+ ${h?`--ui-skeleton-duration:${h};`:""}
197
197
  "
198
198
  role="status"
199
199
  aria-live="polite"
200
200
  aria-busy="true"
201
201
  aria-label="Loading"
202
202
  >
203
- ${d}
203
+ ${b}
204
204
  </div>
205
- `)}shouldRenderOnAttributeChange(e,t,i){return!0}}typeof customElements<"u"&&!customElements.get("ui-skeleton")&&customElements.define("ui-skeleton",s);exports.UISkeleton=s;
205
+ `)}shouldRenderOnAttributeChange(e,t,i){return!0}}typeof customElements<"u"&&!customElements.get("ui-skeleton")&&customElements.define("ui-skeleton",p);exports.UISkeleton=p;
@@ -1,5 +1,9 @@
1
- import { E as c } from "./ElementBase-909688f3.mjs";
2
- const h = `
1
+ import { E as v } from "./ElementBase-YlTLMsGk.mjs";
2
+ function r(a) {
3
+ const e = a.trim();
4
+ return !e || /[;{}<>"']/.test(e) ? "" : e;
5
+ }
6
+ const f = `
3
7
  :host {
4
8
  display: block;
5
9
  --ui-skeleton-radius: 10px;
@@ -184,8 +188,8 @@ const h = `
184
188
  display: none !important;
185
189
  }
186
190
  }
187
- `, o = ["96%", "86%", "78%", "92%", "68%", "88%"];
188
- class g extends c {
191
+ `, g = ["96%", "86%", "78%", "92%", "68%", "88%"];
192
+ class x extends v {
189
193
  static get observedAttributes() {
190
194
  return [
191
195
  "count",
@@ -202,48 +206,47 @@ class g extends c {
202
206
  "headless"
203
207
  ];
204
208
  }
205
- _numAttr(e, i) {
206
- const t = this.getAttribute(e);
207
- if (!t)
208
- return i;
209
- const n = Number(t);
210
- return Number.isFinite(n) && n > 0 ? n : i;
209
+ _numAttr(e, t) {
210
+ const i = this.getAttribute(e);
211
+ if (!i) return t;
212
+ const n = Number(i);
213
+ return Number.isFinite(n) && n > 0 ? n : t;
211
214
  }
212
215
  _animationMode() {
213
216
  const e = (this.getAttribute("animation") || "").trim().toLowerCase();
214
217
  return e === "shimmer" || e === "pulse" || e === "wave" || e === "none" ? e : this.hasAttribute("animated") ? "shimmer" : "none";
215
218
  }
216
- _lineWidth(e, i, t) {
217
- return t && t.trim() ? t : i === "text" ? o[e % o.length] || "92%" : i === "badge" ? "92px" : i === "button" ? "128px" : i === "avatar" ? "44px" : "100%";
219
+ _lineWidth(e, t, i) {
220
+ return i && i.trim() ? i : t === "text" ? g[e % g.length] || "92%" : t === "badge" ? "92px" : t === "button" ? "128px" : t === "avatar" ? "44px" : "100%";
218
221
  }
219
222
  render() {
220
- const e = Math.max(1, Math.min(40, this._numAttr("count", 1))), i = this.getAttribute("height"), t = this.getAttribute("width"), n = this.getAttribute("radius"), r = this.getAttribute("gap"), a = this.getAttribute("duration"), s = (this.getAttribute("variant") || "rect").trim(), l = this._animationMode(), u = Array.from({ length: e }, (m, d) => `<div class="line" style="--ui-line-width:${this._lineWidth(d, s, t)};"></div>`).join("");
223
+ const e = Math.max(1, Math.min(40, this._numAttr("count", 1))), t = this.getAttribute("height"), i = this.getAttribute("width"), n = this.getAttribute("radius"), o = this.getAttribute("gap"), s = this.getAttribute("duration"), p = (this.getAttribute("variant") || "rect").trim(), m = this._animationMode(), k = Array.from({ length: e }, (w, b) => `<div class="line" style="--ui-line-width:${r(this._lineWidth(b, p, i))};"></div>`).join(""), u = t ? r(t) : "", l = i ? r(i) : "", c = n ? r(n) : "", d = o ? r(o) : "", h = s ? r(s) : "";
221
224
  this.setContent(`
222
- <style>${h}</style>
225
+ <style>${f}</style>
223
226
  <div
224
227
  class="stack"
225
- data-animation="${l}"
228
+ data-animation="${m}"
226
229
  style="
227
- ${i ? `--ui-skeleton-height:${i};` : ""}
228
- ${t ? `--ui-skeleton-width:${t};` : ""}
229
- ${n ? `--ui-skeleton-radius:${n};` : ""}
230
- ${r ? `--ui-skeleton-gap:${r};` : ""}
231
- ${a ? `--ui-skeleton-duration:${a};` : ""}
230
+ ${u ? `--ui-skeleton-height:${u};` : ""}
231
+ ${l ? `--ui-skeleton-width:${l};` : ""}
232
+ ${c ? `--ui-skeleton-radius:${c};` : ""}
233
+ ${d ? `--ui-skeleton-gap:${d};` : ""}
234
+ ${h ? `--ui-skeleton-duration:${h};` : ""}
232
235
  "
233
236
  role="status"
234
237
  aria-live="polite"
235
238
  aria-busy="true"
236
239
  aria-label="Loading"
237
240
  >
238
- ${u}
241
+ ${k}
239
242
  </div>
240
243
  `);
241
244
  }
242
- shouldRenderOnAttributeChange(e, i, t) {
245
+ shouldRenderOnAttributeChange(e, t, i) {
243
246
  return !0;
244
247
  }
245
248
  }
246
- typeof customElements < "u" && !customElements.get("ui-skeleton") && customElements.define("ui-skeleton", g);
249
+ typeof customElements < "u" && !customElements.get("ui-skeleton") && customElements.define("ui-skeleton", x);
247
250
  export {
248
- g as UISkeleton
251
+ x as UISkeleton
249
252
  };