@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
@@ -1,5 +1,5 @@
1
- import { E as _ } from "./ElementBase-909688f3.mjs";
2
- import { c as x } from "./menu-item-styles-27fdbac4.mjs";
1
+ import { E as _ } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { c as x } from "./menu-item-styles-CZiPwPwl.mjs";
3
3
  const l = [
4
4
  '[role="menuitem"]',
5
5
  '[role="menuitemcheckbox"]',
@@ -523,10 +523,9 @@ function h(i, e) {
523
523
  return i.getAttribute(e) || "";
524
524
  }
525
525
  function f(i, e) {
526
- if (i == null)
527
- return e;
528
- const r = i.trim().toLowerCase();
529
- return r !== "false" && r !== "0" && r !== "off";
526
+ if (i == null) return e;
527
+ const t = i.trim().toLowerCase();
528
+ return t !== "false" && t !== "0" && t !== "off";
530
529
  }
531
530
  function p() {
532
531
  return typeof window < "u" && typeof document < "u";
@@ -546,12 +545,12 @@ function g(i) {
546
545
  }
547
546
  }
548
547
  function E(i, e) {
549
- const r = i.offsetTop, t = r + i.offsetHeight, o = e.scrollTop, a = o + e.clientHeight;
550
- if (r < o) {
551
- e.scrollTop = r;
548
+ const t = i.offsetTop, r = t + i.offsetHeight, o = e.scrollTop, a = o + e.clientHeight;
549
+ if (t < o) {
550
+ e.scrollTop = t;
552
551
  return;
553
552
  }
554
- t > a && (e.scrollTop = Math.max(0, t - e.clientHeight));
553
+ r > a && (e.scrollTop = Math.max(0, r - e.clientHeight));
555
554
  }
556
555
  function I(i) {
557
556
  return w(i);
@@ -561,30 +560,26 @@ function w(i) {
561
560
  return document.createTextNode(i.textContent || "");
562
561
  if (!(i instanceof HTMLElement))
563
562
  return i.cloneNode(!1);
564
- const e = i.tagName === "UI-BOX", r = document.createElement(e ? "div" : i.tagName.toLowerCase());
565
- return Array.from(i.attributes).forEach((t) => {
566
- t.name !== "slot" && r.setAttribute(t.name, t.value);
567
- }), Array.from(i.childNodes).forEach((t) => {
568
- r.appendChild(w(t));
569
- }), r;
563
+ const e = i.tagName === "UI-BOX", t = document.createElement(e ? "div" : i.tagName.toLowerCase());
564
+ return Array.from(i.attributes).forEach((r) => {
565
+ r.name !== "slot" && t.setAttribute(r.name, r.value);
566
+ }), Array.from(i.childNodes).forEach((r) => {
567
+ t.appendChild(w(r));
568
+ }), t;
570
569
  }
571
- function T(i, e, r) {
572
- for (let t = e + r; t >= 0 && t < i.length; t += r)
573
- if (!b(i[t]))
574
- return t;
570
+ function T(i, e, t) {
571
+ for (let r = e + t; r >= 0 && r < i.length; r += t)
572
+ if (!b(i[r])) return r;
575
573
  return -1;
576
574
  }
577
- function M(i, e, r) {
578
- if (!e)
579
- return null;
580
- const t = i.filter((a) => !b(a));
581
- if (!t.length)
582
- return null;
583
- const o = r ? t.indexOf(r) : -1;
584
- for (let a = 1; a <= t.length; a += 1) {
585
- const n = t[(o + a + t.length) % t.length];
586
- if (C(n).toLowerCase().startsWith(e))
587
- return n;
575
+ function M(i, e, t) {
576
+ if (!e) return null;
577
+ const r = i.filter((a) => !b(a));
578
+ if (!r.length) return null;
579
+ const o = t ? r.indexOf(t) : -1;
580
+ for (let a = 1; a <= r.length; a += 1) {
581
+ const n = r[(o + a + r.length) % r.length];
582
+ if (C(n).toLowerCase().startsWith(e)) return n;
588
583
  }
589
584
  return null;
590
585
  }
@@ -640,8 +635,8 @@ class D extends _ {
640
635
  disconnectedCallback() {
641
636
  this.removeEventListener("click", this._onHostClick), this.removeEventListener("keydown", this._onHostKeyDown), this.root.removeEventListener("slotchange", this._onSlotChange), this._teardownOpenListeners(), this._openFrame && cancelAnimationFrame(this._openFrame), super.disconnectedCallback();
642
637
  }
643
- attributeChangedCallback(e, r, t) {
644
- if (r !== t) {
638
+ attributeChangedCallback(e, t, r) {
639
+ if (t !== r) {
645
640
  if (e === "open") {
646
641
  this._syncOpenState();
647
642
  return;
@@ -709,43 +704,39 @@ class D extends _ {
709
704
  return this._portalEl;
710
705
  }
711
706
  _isFocusable(e) {
712
- if (!e || !e.isConnected || e.disabled || e.getAttribute("aria-hidden") === "true")
713
- return !1;
714
- if (!p())
715
- return !0;
716
- const r = window.getComputedStyle(e);
717
- return r.display !== "none" && r.visibility !== "hidden";
707
+ if (!e || !e.isConnected || e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
708
+ if (!p()) return !0;
709
+ const t = window.getComputedStyle(e);
710
+ return t.display !== "none" && t.visibility !== "hidden";
718
711
  }
719
712
  _currentFocusedItem() {
720
713
  const e = this.root.activeElement || document.activeElement;
721
714
  return e instanceof HTMLElement ? e.closest(l) : null;
722
715
  }
723
716
  _queryItems(e = !0) {
724
- const r = this._getMenu();
725
- if (!r)
726
- return [];
727
- const t = Array.from(r.querySelectorAll(l));
728
- return e ? t : t.filter((o) => !b(o));
717
+ const t = this._getMenu();
718
+ if (!t) return [];
719
+ const r = Array.from(t.querySelectorAll(l));
720
+ return e ? r : r.filter((o) => !b(o));
729
721
  }
730
722
  _requestClose(e) {
731
- if (!this._isOpen)
732
- return;
733
- const r = new CustomEvent("request-close", {
723
+ if (!this._isOpen) return;
724
+ const t = new CustomEvent("request-close", {
734
725
  detail: { reason: e },
735
726
  bubbles: !0,
736
727
  composed: !0,
737
728
  cancelable: !0
738
729
  });
739
- this.dispatchEvent(r);
740
- const t = new CustomEvent("ui-request-close", {
730
+ this.dispatchEvent(t);
731
+ const r = new CustomEvent("ui-request-close", {
741
732
  detail: { reason: e },
742
733
  bubbles: !0,
743
734
  composed: !0,
744
735
  cancelable: !0
745
736
  });
746
- this.dispatchEvent(t), !(r.defaultPrevented || t.defaultPrevented) && this.close(e);
737
+ this.dispatchEvent(r), !(t.defaultPrevented || r.defaultPrevented) && this.close(e);
747
738
  }
748
- _close(e, r = {}) {
739
+ _close(e, t = {}) {
749
740
  if (this._openFrame && cancelAnimationFrame(this._openFrame), this._openFrame = 0, this._isOpen = !1, this._teardownOpenListeners(), this.hasAttribute("open") && this.removeAttribute("open"), this._syncControlState(), this._syncTriggerA11y(), this._clearActiveItem(), this._clearMenuContent(), this._resetTypeahead(), this.dispatchEvent(
750
741
  new CustomEvent("change", {
751
742
  bubbles: !0,
@@ -758,9 +749,9 @@ class D extends _ {
758
749
  composed: !0,
759
750
  detail: { reason: e }
760
751
  })
761
- ), r.restoreFocus !== !1) {
762
- const t = this._getTrigger();
763
- t && this._isFocusable(t) ? g(t) : this._restoreFocusEl && this._isFocusable(this._restoreFocusEl) && g(this._restoreFocusEl);
752
+ ), t.restoreFocus !== !1) {
753
+ const r = this._getTrigger();
754
+ r && this._isFocusable(r) ? g(r) : this._restoreFocusEl && this._isFocusable(this._restoreFocusEl) && g(this._restoreFocusEl);
764
755
  }
765
756
  this._restoreFocusEl = null;
766
757
  }
@@ -800,55 +791,50 @@ class D extends _ {
800
791
  }
801
792
  _renderMenuContent() {
802
793
  const e = this._getMenu();
803
- if (!e)
804
- return;
794
+ if (!e) return;
805
795
  e.replaceChildren();
806
- const r = this._getContentSource();
807
- if (r && e.appendChild(I(r)), !e.querySelector(l)) {
808
- const t = document.createElement("div");
809
- t.className = "empty-state", t.textContent = "No items", e.appendChild(t);
796
+ const t = this._getContentSource();
797
+ if (t && e.appendChild(I(t)), !e.querySelector(l)) {
798
+ const r = document.createElement("div");
799
+ r.className = "empty-state", r.textContent = "No items", e.appendChild(r);
810
800
  }
811
801
  this._syncMenuItemSemantics();
812
802
  }
813
803
  _syncMenuItemSemantics() {
814
- this._queryItems(!0).forEach((e, r) => {
815
- e.getAttribute("role") || e.setAttribute("role", "menuitem"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.dataset.sourceIndex = String(r), e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true" && e.setAttribute("aria-disabled", "true");
816
- const t = e.getAttribute("role");
817
- (t === "menuitemcheckbox" || t === "menuitemradio") && !e.hasAttribute("aria-checked") && e.setAttribute("aria-checked", "false"), this._applyStoredItemState(e, r);
804
+ this._queryItems(!0).forEach((e, t) => {
805
+ e.getAttribute("role") || e.setAttribute("role", "menuitem"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e.dataset.sourceIndex = String(t), e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true" && e.setAttribute("aria-disabled", "true");
806
+ const r = e.getAttribute("role");
807
+ (r === "menuitemcheckbox" || r === "menuitemradio") && !e.hasAttribute("aria-checked") && e.setAttribute("aria-checked", "false"), this._applyStoredItemState(e, t);
818
808
  });
819
809
  }
820
810
  _clearMenuContent() {
821
811
  const e = this._getMenu();
822
812
  e && e.replaceChildren();
823
813
  }
824
- _applyStoredItemState(e, r) {
825
- const t = e.getAttribute("role");
826
- if (t === "menuitemcheckbox") {
827
- if (!this._checkboxState.has(r))
828
- return;
829
- const n = this._checkboxState.get(r) === !0;
814
+ _applyStoredItemState(e, t) {
815
+ const r = e.getAttribute("role");
816
+ if (r === "menuitemcheckbox") {
817
+ if (!this._checkboxState.has(t)) return;
818
+ const n = this._checkboxState.get(t) === !0;
830
819
  e.setAttribute("aria-checked", n ? "true" : "false"), e.setAttribute("data-state", n ? "checked" : "unchecked");
831
820
  return;
832
821
  }
833
- if (t !== "menuitemradio")
834
- return;
822
+ if (r !== "menuitemradio") return;
835
823
  const o = e.getAttribute("data-group") || e.getAttribute("name") || "__default__";
836
- if (!this._radioState.has(o))
837
- return;
838
- const a = this._radioState.get(o) === r;
824
+ if (!this._radioState.has(o)) return;
825
+ const a = this._radioState.get(o) === t;
839
826
  e.setAttribute("aria-checked", a ? "true" : "false"), e.setAttribute("data-state", a ? "checked" : "unchecked");
840
827
  }
841
828
  _syncMenuPresentation() {
842
829
  const e = this._getMenu();
843
- if (!e)
844
- return;
845
- const r = p() ? window.getComputedStyle(this) : null;
846
- r && F.forEach((c) => {
847
- const m = r.getPropertyValue(c).trim();
830
+ if (!e) return;
831
+ const t = p() ? window.getComputedStyle(this) : null;
832
+ t && F.forEach((c) => {
833
+ const m = t.getPropertyValue(c).trim();
848
834
  m ? e.style.setProperty(c, m) : e.style.removeProperty(c);
849
835
  });
850
- const t = h(this, "variant"), o = A(this.getAttribute("size") || this.getAttribute("density")), a = h(this, "density"), n = h(this, "shape"), u = h(this, "elevation"), s = h(this, "tone"), d = S(this.getAttribute("radius") || n || null);
851
- if (t && t !== "default" ? e.setAttribute("data-variant", t) : e.removeAttribute("data-variant"), o !== "md" ? e.setAttribute("data-size", o) : e.removeAttribute("data-size"), a && a !== "default" ? e.setAttribute("data-density", a) : e.removeAttribute("data-density"), n && n !== "default" ? e.setAttribute("data-shape", n) : e.removeAttribute("data-shape"), u && u !== "default" ? e.setAttribute("data-elevation", u) : e.removeAttribute("data-elevation"), s && s !== "default" && s !== "brand" ? e.setAttribute("data-tone", s) : e.removeAttribute("data-tone"), d) {
836
+ const r = h(this, "variant"), o = A(this.getAttribute("size") || this.getAttribute("density")), a = h(this, "density"), n = h(this, "shape"), u = h(this, "elevation"), s = h(this, "tone"), d = S(this.getAttribute("radius") || n || null);
837
+ if (r && r !== "default" ? e.setAttribute("data-variant", r) : e.removeAttribute("data-variant"), o !== "md" ? e.setAttribute("data-size", o) : e.removeAttribute("data-size"), a && a !== "default" ? e.setAttribute("data-density", a) : e.removeAttribute("data-density"), n && n !== "default" ? e.setAttribute("data-shape", n) : e.removeAttribute("data-shape"), u && u !== "default" ? e.setAttribute("data-elevation", u) : e.removeAttribute("data-elevation"), s && s !== "default" && s !== "brand" ? e.setAttribute("data-tone", s) : e.removeAttribute("data-tone"), d) {
852
838
  e.style.setProperty("--ui-dropdown-radius", d), e.style.setProperty("--ui-dropdown-item-radius", d === "999px" ? "999px" : `max(0px, calc(${d} - 2px))`);
853
839
  return;
854
840
  }
@@ -856,14 +842,13 @@ class D extends _ {
856
842
  }
857
843
  _syncMenuA11y() {
858
844
  const e = this._getMenu();
859
- if (!e)
860
- return;
861
- const r = this._getTrigger(), t = this.getAttribute("aria-label") || "", o = this.getAttribute("aria-labelledby") || "", a = this.getAttribute("aria-describedby") || "", n = o || (!t && (r != null && r.id) ? r.id : "");
862
- t ? e.setAttribute("aria-label", t) : e.removeAttribute("aria-label"), n ? e.setAttribute("aria-labelledby", n) : e.removeAttribute("aria-labelledby"), a ? e.setAttribute("aria-describedby", a) : e.removeAttribute("aria-describedby");
845
+ if (!e) return;
846
+ const t = this._getTrigger(), r = this.getAttribute("aria-label") || "", o = this.getAttribute("aria-labelledby") || "", a = this.getAttribute("aria-describedby") || "", n = o || (!r && t?.id ? t.id : "");
847
+ r ? e.setAttribute("aria-label", r) : e.removeAttribute("aria-label"), n ? e.setAttribute("aria-labelledby", n) : e.removeAttribute("aria-labelledby"), a ? e.setAttribute("aria-describedby", a) : e.removeAttribute("aria-describedby");
863
848
  }
864
849
  _syncControlState() {
865
- const e = this._panelEl, r = this._getMenu();
866
- !e || !r || (e.hidden = !this._isOpen, e.setAttribute("data-placement", this._placement));
850
+ const e = this._panelEl, t = this._getMenu();
851
+ !e || !t || (e.hidden = !this._isOpen, e.setAttribute("data-placement", this._placement));
867
852
  }
868
853
  _schedulePanelSync(e) {
869
854
  this._openFrame && cancelAnimationFrame(this._openFrame), this._openFrame = requestAnimationFrame(() => {
@@ -875,33 +860,30 @@ class D extends _ {
875
860
  !e || !this._isOpen || (this._placement = this._resolvePlacement(), e.setAttribute("data-placement", this._placement), this.style.setProperty("--ui-dropdown-available-width", `${Math.max(0, Math.floor(this._availableWidth(this._placement)))}px`), this.style.setProperty("--ui-dropdown-available-height", `${Math.max(0, Math.floor(this._availableHeight(this._placement)))}px`));
876
861
  }
877
862
  _availableWidth(e) {
878
- const r = this._getTrigger();
879
- if (!r || !p())
880
- return 380;
881
- const t = r.getBoundingClientRect(), o = window.innerWidth || document.documentElement.clientWidth || 0;
882
- return e === "left" ? t.left - 12 : e === "right" ? o - t.right - 12 : o - t.left - 12;
863
+ const t = this._getTrigger();
864
+ if (!t || !p()) return 380;
865
+ const r = t.getBoundingClientRect(), o = window.innerWidth || document.documentElement.clientWidth || 0;
866
+ return e === "left" ? r.left - 12 : e === "right" ? o - r.right - 12 : o - r.left - 12;
883
867
  }
884
868
  _availableHeight(e) {
885
- const r = this._getTrigger();
886
- if (!r || !p())
887
- return 440;
888
- const t = r.getBoundingClientRect(), o = window.innerHeight || document.documentElement.clientHeight || 0;
889
- return e === "top" ? t.top - 12 : o - t.bottom - 12;
869
+ const t = this._getTrigger();
870
+ if (!t || !p()) return 440;
871
+ const r = t.getBoundingClientRect(), o = window.innerHeight || document.documentElement.clientHeight || 0;
872
+ return e === "top" ? r.top - 12 : o - r.bottom - 12;
890
873
  }
891
874
  _resolvePlacement() {
892
- const e = k(this.getAttribute("placement")), r = this._getTrigger(), t = this._getMenu();
893
- if (!r || !t || !p())
894
- return e;
895
- const o = r.getBoundingClientRect(), a = window.innerWidth || document.documentElement.clientWidth || 0, n = window.innerHeight || document.documentElement.clientHeight || 0, u = Math.max(0, n - o.bottom - 12), s = Math.max(0, o.top - 12), d = Math.max(0, a - o.right - 12), c = Math.max(0, o.left - 12), m = Math.min(Math.max(t.scrollHeight, t.offsetHeight) + 4, 320), v = Math.min(Math.max(t.scrollWidth, t.offsetWidth) + 4, 360);
875
+ const e = k(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
876
+ if (!t || !r || !p()) return e;
877
+ const o = t.getBoundingClientRect(), a = window.innerWidth || document.documentElement.clientWidth || 0, n = window.innerHeight || document.documentElement.clientHeight || 0, u = Math.max(0, n - o.bottom - 12), s = Math.max(0, o.top - 12), d = Math.max(0, a - o.right - 12), c = Math.max(0, o.left - 12), m = Math.min(Math.max(r.scrollHeight, r.offsetHeight) + 4, 320), v = Math.min(Math.max(r.scrollWidth, r.offsetWidth) + 4, 360);
896
878
  return e === "top" ? s >= m || s > u ? "top" : "bottom" : e === "left" ? c >= v || c > d ? "left" : "right" : e === "right" ? d >= v || d >= c ? "right" : "left" : u >= m || u >= s ? "bottom" : "top";
897
879
  }
898
880
  _clearActiveItem() {
899
881
  this._queryItems(!0).forEach((e) => e.removeAttribute("data-active"));
900
882
  }
901
- _setActiveItem(e, r = {}) {
902
- if (this._clearActiveItem(), !!e && (e.setAttribute("data-active", "true"), r.focus && g(e), r.scroll)) {
903
- const t = this._getMenu();
904
- t && E(e, t);
883
+ _setActiveItem(e, t = {}) {
884
+ if (this._clearActiveItem(), !!e && (e.setAttribute("data-active", "true"), t.focus && g(e), t.scroll)) {
885
+ const r = this._getMenu();
886
+ r && E(e, r);
905
887
  }
906
888
  }
907
889
  _focusFirstItem() {
@@ -913,12 +895,11 @@ class D extends _ {
913
895
  this._setActiveItem(e[e.length - 1] || null, { focus: !0, scroll: !0 });
914
896
  }
915
897
  _moveFocus(e) {
916
- const r = this._queryItems(!0);
917
- if (!r.length)
918
- return;
919
- const t = this._currentFocusedItem() || this._queryItems(!0).find((n) => n.getAttribute("data-active") === "true") || null, o = t ? r.indexOf(t) : e > 0 ? -1 : r.length, a = T(r, o, e);
898
+ const t = this._queryItems(!0);
899
+ if (!t.length) return;
900
+ const r = this._currentFocusedItem() || this._queryItems(!0).find((n) => n.getAttribute("data-active") === "true") || null, o = r ? t.indexOf(r) : e > 0 ? -1 : t.length, a = T(t, o, e);
920
901
  if (a >= 0) {
921
- this._setActiveItem(r[a], { focus: !0, scroll: !0 });
902
+ this._setActiveItem(t[a], { focus: !0, scroll: !0 });
922
903
  return;
923
904
  }
924
905
  e > 0 ? this._focusFirstItem() : this._focusLastItem();
@@ -930,52 +911,46 @@ class D extends _ {
930
911
  return e.ctrlKey || e.metaKey || e.altKey ? !1 : e.key.length === 1 && /\S/.test(e.key);
931
912
  }
932
913
  _handleTypeahead(e) {
933
- if (!this.typeahead || !this._isTypeaheadKey(e))
934
- return !1;
935
- const r = e.key.toLowerCase();
936
- this._typeaheadBuffer = `${this._typeaheadBuffer}${r}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 460);
937
- const t = M(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
938
- return t ? (this._setActiveItem(t, { focus: !0, scroll: !0 }), e.preventDefault(), !0) : !1;
914
+ if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
915
+ const t = e.key.toLowerCase();
916
+ this._typeaheadBuffer = `${this._typeaheadBuffer}${t}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 460);
917
+ const r = M(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
918
+ return r ? (this._setActiveItem(r, { focus: !0, scroll: !0 }), e.preventDefault(), !0) : !1;
939
919
  }
940
920
  _querySourceItems() {
941
921
  const e = this._getContentSource();
942
922
  return e ? Array.from(e.querySelectorAll(l)) : [];
943
923
  }
944
924
  _applySelectionBehavior(e) {
945
- const r = e.getAttribute("role"), t = Number(e.dataset.sourceIndex || "-1");
946
- if (r === "menuitemcheckbox") {
925
+ const t = e.getAttribute("role"), r = Number(e.dataset.sourceIndex || "-1");
926
+ if (t === "menuitemcheckbox") {
947
927
  const n = e.getAttribute("aria-checked") !== "true";
948
- e.setAttribute("aria-checked", n ? "true" : "false"), e.setAttribute("data-state", n ? "checked" : "unchecked"), t >= 0 && this._checkboxState.set(t, n);
928
+ e.setAttribute("aria-checked", n ? "true" : "false"), e.setAttribute("data-state", n ? "checked" : "unchecked"), r >= 0 && this._checkboxState.set(r, n);
949
929
  return;
950
930
  }
951
- if (r !== "menuitemradio")
952
- return;
931
+ if (t !== "menuitemradio") return;
953
932
  const a = e.getAttribute("data-group") || e.getAttribute("name") || "" || "__default__";
954
- t >= 0 && this._radioState.set(a, t), this._queryItems(!0).filter((n) => n.getAttribute("role") === "menuitemradio").forEach((n) => {
955
- const u = n.getAttribute("data-group") || n.getAttribute("name") || "";
956
- if (a && (u || "__default__") !== a)
957
- return;
933
+ r >= 0 && this._radioState.set(a, r), this._queryItems(!0).filter((n) => n.getAttribute("role") === "menuitemradio").forEach((n) => {
934
+ if ((n.getAttribute("data-group") || n.getAttribute("name") || "" || "__default__") !== a) return;
958
935
  const s = n === e;
959
936
  n.setAttribute("aria-checked", s ? "true" : "false"), n.setAttribute("data-state", s ? "checked" : "unchecked");
960
937
  });
961
938
  }
962
939
  _findMenuItemFromEvent(e) {
963
- const r = typeof e.composedPath == "function" ? e.composedPath() : [];
964
- for (const o of r)
965
- if (o instanceof HTMLElement && o.matches(l))
966
- return o;
967
- const t = e.target;
968
- return t instanceof HTMLElement ? t.closest(l) : null;
940
+ const t = typeof e.composedPath == "function" ? e.composedPath() : [];
941
+ for (const o of t)
942
+ if (o instanceof HTMLElement && o.matches(l)) return o;
943
+ const r = e.target;
944
+ return r instanceof HTMLElement ? r.closest(l) : null;
969
945
  }
970
946
  _isEventInsideTrigger(e) {
971
- const r = this._getTrigger();
972
- return r ? (typeof e.composedPath == "function" ? e.composedPath() : []).includes(r) : !1;
947
+ const t = this._getTrigger();
948
+ return t ? (typeof e.composedPath == "function" ? e.composedPath() : []).includes(t) : !1;
973
949
  }
974
950
  _emitSelect(e) {
975
- var t;
976
- const r = {
951
+ const t = {
977
952
  value: e.getAttribute("data-value") || e.getAttribute("value") || void 0,
978
- label: e.getAttribute("aria-label") || ((t = e.textContent) == null ? void 0 : t.trim()) || void 0,
953
+ label: e.getAttribute("aria-label") || e.textContent?.trim() || void 0,
979
954
  checked: e.getAttribute("aria-checked") === "true",
980
955
  item: e
981
956
  };
@@ -983,17 +958,15 @@ class D extends _ {
983
958
  new CustomEvent("select", {
984
959
  bubbles: !0,
985
960
  composed: !0,
986
- detail: r
961
+ detail: t
987
962
  })
988
963
  );
989
964
  }
990
965
  _onHostClick(e) {
991
- var t;
992
- if (this.hasAttribute("disabled"))
993
- return;
994
- const r = this._isOpen ? this._findMenuItemFromEvent(e) : null;
995
- if (r && ((t = this._getMenu()) != null && t.contains(r)) && !b(r)) {
996
- this._applySelectionBehavior(r), this._setActiveItem(r, { focus: !0, scroll: !0 }), this._emitSelect(r), this.closeOnSelect && this._requestClose("select");
966
+ if (this.hasAttribute("disabled")) return;
967
+ const t = this._isOpen ? this._findMenuItemFromEvent(e) : null;
968
+ if (t && this._getMenu()?.contains(t) && !b(t)) {
969
+ this._applySelectionBehavior(t), this._setActiveItem(t, { focus: !0, scroll: !0 }), this._emitSelect(t), this.closeOnSelect && this._requestClose("select");
997
970
  return;
998
971
  }
999
972
  if (this._isEventInsideTrigger(e)) {
@@ -1005,10 +978,8 @@ class D extends _ {
1005
978
  }
1006
979
  }
1007
980
  _onHostKeyDown(e) {
1008
- var r;
1009
981
  if (!this._isOpen) {
1010
- if (!this._isEventInsideTrigger(e) || !["ArrowDown", "ArrowUp", "Enter", " "].includes(e.key))
1011
- return;
982
+ if (!this._isEventInsideTrigger(e) || !["ArrowDown", "ArrowUp", "Enter", " "].includes(e.key)) return;
1012
983
  e.preventDefault(), this.open(), this._schedulePanelSync(e.key === "ArrowUp" ? "last" : "first");
1013
984
  return;
1014
985
  }
@@ -1039,8 +1010,7 @@ class D extends _ {
1039
1010
  }
1040
1011
  if (e.key === "Enter" || e.key === " ") {
1041
1012
  const t = this._currentFocusedItem();
1042
- if (!t || !((r = this._getMenu()) != null && r.contains(t)) || b(t))
1043
- return;
1013
+ if (!t || !this._getMenu()?.contains(t) || b(t)) return;
1044
1014
  e.preventDefault(), t.click();
1045
1015
  }
1046
1016
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./file-upload.cjs.js");require("./ElementBase-1b301e7f.js");class e extends t.UIFileUpload{connectedCallback(){this.hasAttribute("surface")||this.setAttribute("surface","dropzone"),super.connectedCallback()}}typeof customElements<"u"&&!customElements.get("ui-dropzone")&&customElements.define("ui-dropzone",e);exports.UIDropzone=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./file-upload.cjs.js");class e extends t.UIFileUpload{connectedCallback(){this.hasAttribute("surface")||this.setAttribute("surface","dropzone"),super.connectedCallback()}}typeof customElements<"u"&&!customElements.get("ui-dropzone")&&customElements.define("ui-dropzone",e);exports.UIDropzone=e;
@@ -1,5 +1,4 @@
1
1
  import { UIFileUpload as e } from "./file-upload.esm.js";
2
- import "./ElementBase-909688f3.mjs";
3
2
  class t extends e {
4
3
  connectedCallback() {
5
4
  this.hasAttribute("surface") || this.setAttribute("surface", "dropzone"), super.connectedCallback();
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./ElementBase-1b301e7f.js"),c=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./ElementBase-EV6mVBUV.js"),c=`
2
2
  :host {
3
3
  display: block;
4
4
  --ui-empty-bg: linear-gradient(180deg, var(--ui-color-surface, #ffffff), var(--ui-color-surface-alt, #f8fafc));
@@ -1,4 +1,4 @@
1
- import { E as n } from "./ElementBase-909688f3.mjs";
1
+ import { E as n } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const a = `
3
3
  :host {
4
4
  display: block;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-1b301e7f.js"),u=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),u=`
2
2
  :host {
3
3
  --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #dc2626));
4
4
  --ui-field-error-size: 12px;
@@ -1,4 +1,4 @@
1
- import { E as d } from "./ElementBase-909688f3.mjs";
1
+ import { E as d } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const l = `
3
3
  :host {
4
4
  --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #dc2626));
@@ -104,8 +104,7 @@ class f extends d {
104
104
  }
105
105
  _resolveTarget() {
106
106
  const r = this.getAttribute("for");
107
- if (!r)
108
- return null;
107
+ if (!r) return null;
109
108
  const i = this.getRootNode();
110
109
  return i instanceof Document || i instanceof ShadowRoot ? i.getElementById(r) : document.getElementById(r);
111
110
  }
@@ -113,8 +112,7 @@ class f extends d {
113
112
  this._target && this._errorId && (a(this._target, "aria-describedby", this._errorId, !1), this._target.getAttribute("aria-errormessage") === this._errorId && this._target.removeAttribute("aria-errormessage"), this._target.getAttribute("aria-invalid") === "true" && !this._target.hasAttribute("data-ui-invalid-persist") && this._target.removeAttribute("aria-invalid")), this._target = null;
114
113
  }
115
114
  _syncAssociation() {
116
- if (this._clearAssociation(), !this.hasAttribute("active") || this.hasAttribute("hidden"))
117
- return;
115
+ if (this._clearAssociation(), !this.hasAttribute("active") || this.hasAttribute("hidden")) return;
118
116
  const r = this._resolveTarget();
119
117
  r && (this._errorId = u(this, "msg"), this._target = r, a(r, "aria-describedby", this._errorId, !0), r.setAttribute("aria-errormessage", this._errorId), r.setAttribute("aria-invalid", "true"));
120
118
  }
package/dist/field.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("./ElementBase-1b301e7f.js"),q=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("./ElementBase-EV6mVBUV.js"),q=`
2
2
  :host {
3
3
  --ui-field-gap: 8px;
4
4
  --ui-field-label-width: 192px;
@@ -370,19 +370,19 @@
370
370
  box-shadow: none;
371
371
  }
372
372
  }
373
- `;function b(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function p(o){if(!o)return!1;const e=o.assignedNodes({flatten:!0});return e.length?e.some(t=>{var l;return t.nodeType===Node.TEXT_NODE?!!((l=t.textContent)!=null&&l.trim()):t.nodeType===Node.ELEMENT_NODE}):!1}function f(o){if(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"||o.getAttribute("tabindex")==="-1")return!1;const e=window.getComputedStyle(o);return!(e.display==="none"||e.visibility==="hidden")}function k(o){return!!o.closest('button, a, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"]')}function _(o){return Array.from(new Set(o.filter(Boolean)))}const S='ui-input, ui-textarea, ui-select, ui-combobox, input, textarea, select, button, [tabindex]:not([tabindex="-1"])';class A extends E.ElementBase{constructor(){super(),this._uid=Math.random().toString(36).slice(2,9),this._controlCache=null,this._stateSyncQueued=!1,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["label","description","error","for","required","invalid","orientation","headless","variant","tone","density","shape","shell","label-width"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this.root.addEventListener("slotchange",this._onSlotChange),this._scheduleDerivedStateSync()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this.root.removeEventListener("slotchange",this._onSlotChange),super.disconnectedCallback()}attributeChangedCallback(e,t,l){if(t!==l){if(e==="for"&&this._invalidateControlCache(),e==="label-width"){const i=this.getAttribute("label-width");i?this.style.setProperty("--ui-field-label-width",i):this.style.removeProperty("--ui-field-label-width")}if(e==="label"||e==="description"||e==="error"||e==="required"||e==="for"){this.isConnected&&this.requestRender();return}e==="invalid"&&this._scheduleDerivedStateSync()}}_onSlotChange(){this._invalidateControlCache(),this._scheduleDerivedStateSync()}_onRootClick(e){const t=e.target;t&&t.closest(".label")&&(k(t)||this._focusControl())}_invalidateControlCache(){this._controlCache=null}_scheduleDerivedStateSync(){this._stateSyncQueued||(this._stateSyncQueued=!0,queueMicrotask(()=>{this._stateSyncQueued=!1,this.isConnected&&this._syncDerivedState()}))}_focusControl(){const e=this._resolveControlElement();if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}}_resolveControlElement(){if(this._controlCache&&this._controlCache.isConnected&&f(this._controlCache))return this._controlCache;const e=this.getAttribute("for");if(e){const r=document.getElementById(e);if(r instanceof HTMLElement&&f(r))return this._controlCache=r,r}const t=this.root.querySelector("slot:not([name])"),l=(t==null?void 0:t.assignedElements({flatten:!0}))||[];for(const r of l){if(!(r instanceof HTMLElement))continue;if(f(r))return this._controlCache=r,r;const s=r.querySelector(S);if(s&&f(s))return this._controlCache=s,s}const i=this.querySelector(S);return i&&f(i)?(this._controlCache=i,i):null}_syncDerivedState(){const e=this.root.querySelector('slot[name="label"]'),t=this.root.querySelector('slot[name="actions"]'),l=this.root.querySelector('slot[name="description"]'),i=this.root.querySelector('slot[name="error"]'),r=(this.getAttribute("label")||"").trim(),s=(this.getAttribute("description")||"").trim(),h=(this.getAttribute("error")||"").trim(),n=!!r||p(e),c=p(t),d=!!s||p(l),u=!!h||p(i),C=n||c||d,a=n||c,g=this.root.querySelector(".meta"),v=this.root.querySelector(".label-row"),m=this.root.querySelector(".label"),x=this.root.querySelector(".actions"),y=this.root.querySelector(".description"),w=this.root.querySelector(".error");g&&(C?g.removeAttribute("hidden"):g.setAttribute("hidden","")),v&&(a?v.removeAttribute("hidden"):v.setAttribute("hidden","")),m&&(n?m.removeAttribute("hidden"):m.setAttribute("hidden","")),x&&(c?x.removeAttribute("hidden"):x.setAttribute("hidden","")),y&&(d?y.removeAttribute("hidden"):y.setAttribute("hidden","")),w&&(u?w.removeAttribute("hidden"):w.setAttribute("hidden","")),this._syncControlA11y(n,d,u)}_syncControlA11y(e,t,l){const i=this._resolveControlElement();if(!i)return;const r=`${this._uid}-label`,s=`${this._uid}-description`,h=`${this._uid}-error`,n=(i.getAttribute("aria-labelledby")||"").split(/\s+/).filter(a=>a&&a!==r);!i.hasAttribute("aria-label")&&e&&n.push(r);const c=_(n);c.length?i.setAttribute("aria-labelledby",c.join(" ")):i.removeAttribute("aria-labelledby");const d=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(a=>a&&a!==s&&a!==h);t&&d.push(s),l&&d.push(h);const u=_(d);u.length?i.setAttribute("aria-describedby",u.join(" ")):i.removeAttribute("aria-describedby"),this.hasAttribute("invalid")||l?i.setAttribute("aria-invalid","true"):i.removeAttribute("aria-invalid"),this.hasAttribute("required")?i.setAttribute("aria-required","true"):i.removeAttribute("aria-required")}render(){const e=this.getAttribute("label")||"",t=this.getAttribute("description")||"",l=this.getAttribute("error")||"",i=this.hasAttribute("required"),r=this.getAttribute("for")||"";this.setContent(`
373
+ `;function b(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function p(o){if(!o)return!1;const e=o.assignedNodes({flatten:!0});return e.length?e.some(r=>r.nodeType===Node.TEXT_NODE?!!r.textContent?.trim():r.nodeType===Node.ELEMENT_NODE):!1}function f(o){if(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"||o.getAttribute("tabindex")==="-1")return!1;const e=window.getComputedStyle(o);return!(e.display==="none"||e.visibility==="hidden")}function k(o){return!!o.closest('button, a, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"]')}function _(o){return Array.from(new Set(o.filter(Boolean)))}const S='ui-input, ui-textarea, ui-select, ui-combobox, input, textarea, select, button, [tabindex]:not([tabindex="-1"])';class A extends E.ElementBase{constructor(){super(),this._uid=Math.random().toString(36).slice(2,9),this._controlCache=null,this._stateSyncQueued=!1,this._onRootClick=this._onRootClick.bind(this),this._onSlotChange=this._onSlotChange.bind(this)}static get observedAttributes(){return["label","description","error","for","required","invalid","orientation","headless","variant","tone","density","shape","shell","label-width"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this.root.addEventListener("slotchange",this._onSlotChange),this._scheduleDerivedStateSync()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this.root.removeEventListener("slotchange",this._onSlotChange),super.disconnectedCallback()}attributeChangedCallback(e,r,l){if(r!==l){if(e==="for"&&this._invalidateControlCache(),e==="label-width"){const i=this.getAttribute("label-width");i?this.style.setProperty("--ui-field-label-width",i):this.style.removeProperty("--ui-field-label-width")}if(e==="label"||e==="description"||e==="error"||e==="required"||e==="for"){this.isConnected&&this.requestRender();return}e==="invalid"&&this._scheduleDerivedStateSync()}}_onSlotChange(){this._invalidateControlCache(),this._scheduleDerivedStateSync()}_onRootClick(e){const r=e.target;r&&r.closest(".label")&&(k(r)||this._focusControl())}_invalidateControlCache(){this._controlCache=null}_scheduleDerivedStateSync(){this._stateSyncQueued||(this._stateSyncQueued=!0,queueMicrotask(()=>{this._stateSyncQueued=!1,this.isConnected&&this._syncDerivedState()}))}_focusControl(){const e=this._resolveControlElement();if(e)try{e.focus({preventScroll:!0})}catch{e.focus()}}_resolveControlElement(){if(this._controlCache&&this._controlCache.isConnected&&f(this._controlCache))return this._controlCache;const e=this.getAttribute("for");if(e){const t=document.getElementById(e);if(t instanceof HTMLElement&&f(t))return this._controlCache=t,t}const l=this.root.querySelector("slot:not([name])")?.assignedElements({flatten:!0})||[];for(const t of l){if(!(t instanceof HTMLElement))continue;if(f(t))return this._controlCache=t,t;const s=t.querySelector(S);if(s&&f(s))return this._controlCache=s,s}const i=this.querySelector(S);return i&&f(i)?(this._controlCache=i,i):null}_syncDerivedState(){const e=this.root.querySelector('slot[name="label"]'),r=this.root.querySelector('slot[name="actions"]'),l=this.root.querySelector('slot[name="description"]'),i=this.root.querySelector('slot[name="error"]'),t=(this.getAttribute("label")||"").trim(),s=(this.getAttribute("description")||"").trim(),h=(this.getAttribute("error")||"").trim(),n=!!t||p(e),c=p(r),d=!!s||p(l),u=!!h||p(i),C=n||c||d,a=n||c,g=this.root.querySelector(".meta"),v=this.root.querySelector(".label-row"),m=this.root.querySelector(".label"),x=this.root.querySelector(".actions"),y=this.root.querySelector(".description"),w=this.root.querySelector(".error");g&&(C?g.removeAttribute("hidden"):g.setAttribute("hidden","")),v&&(a?v.removeAttribute("hidden"):v.setAttribute("hidden","")),m&&(n?m.removeAttribute("hidden"):m.setAttribute("hidden","")),x&&(c?x.removeAttribute("hidden"):x.setAttribute("hidden","")),y&&(d?y.removeAttribute("hidden"):y.setAttribute("hidden","")),w&&(u?w.removeAttribute("hidden"):w.setAttribute("hidden","")),this._syncControlA11y(n,d,u)}_syncControlA11y(e,r,l){const i=this._resolveControlElement();if(!i)return;const t=`${this._uid}-label`,s=`${this._uid}-description`,h=`${this._uid}-error`,n=(i.getAttribute("aria-labelledby")||"").split(/\s+/).filter(a=>a&&a!==t);!i.hasAttribute("aria-label")&&e&&n.push(t);const c=_(n);c.length?i.setAttribute("aria-labelledby",c.join(" ")):i.removeAttribute("aria-labelledby");const d=(i.getAttribute("aria-describedby")||"").split(/\s+/).filter(a=>a&&a!==s&&a!==h);r&&d.push(s),l&&d.push(h);const u=_(d);u.length?i.setAttribute("aria-describedby",u.join(" ")):i.removeAttribute("aria-describedby"),this.hasAttribute("invalid")||l?i.setAttribute("aria-invalid","true"):i.removeAttribute("aria-invalid"),this.hasAttribute("required")?i.setAttribute("aria-required","true"):i.removeAttribute("aria-required")}render(){const e=this.getAttribute("label")||"",r=this.getAttribute("description")||"",l=this.getAttribute("error")||"",i=this.hasAttribute("required"),t=this.getAttribute("for")||"";this.setContent(`
374
374
  <style>${q}</style>
375
375
  <div class="frame" part="field">
376
376
  <div class="meta" part="meta">
377
377
  <div class="label-row" part="top">
378
- <label class="label" id="${this._uid}-label" ${r?`for="${b(r)}"`:""}>
378
+ <label class="label" id="${this._uid}-label" ${t?`for="${b(t)}"`:""}>
379
379
  <slot name="label">${b(e)}</slot>
380
380
  ${i?'<span class="required" aria-hidden="true">*</span>':""}
381
381
  </label>
382
382
  <div class="actions" part="actions"><slot name="actions"></slot></div>
383
383
  </div>
384
384
  <p class="description" id="${this._uid}-description" part="description">
385
- <slot name="description">${b(t)}</slot>
385
+ <slot name="description">${b(r)}</slot>
386
386
  </p>
387
387
  </div>
388
388
 
@@ -395,4 +395,4 @@
395
395
  </p>
396
396
  </div>
397
397
  </div>
398
- `),this._invalidateControlCache(),this._scheduleDerivedStateSync()}shouldRenderOnAttributeChange(e,t,l){return e==="label"||e==="description"||e==="error"||e==="required"||e==="for"}}typeof customElements<"u"&&!customElements.get("ui-field")&&customElements.define("ui-field",A);exports.UIField=A;
398
+ `),this._invalidateControlCache(),this._scheduleDerivedStateSync()}shouldRenderOnAttributeChange(e,r,l){return e==="label"||e==="description"||e==="error"||e==="required"||e==="for"}}typeof customElements<"u"&&!customElements.get("ui-field")&&customElements.define("ui-field",A);exports.UIField=A;