@editora/ui-core 0.1.20 → 0.1.22

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 (290) hide show
  1. package/dist/accordion.cjs.js +3 -3
  2. package/dist/accordion.esm.js +3 -3
  3. package/dist/alert-dialog.cjs.js +32 -32
  4. package/dist/alert-dialog.esm.js +95 -75
  5. package/dist/alert.cjs.js +6 -6
  6. package/dist/alert.esm.js +6 -6
  7. package/dist/animated-list.cjs.js +4 -4
  8. package/dist/animated-list.esm.js +4 -4
  9. package/dist/animated-text.cjs.js +4 -4
  10. package/dist/animated-text.esm.js +4 -4
  11. package/dist/app-header.cjs.js +3 -3
  12. package/dist/app-header.esm.js +3 -3
  13. package/dist/aspect-ratio.cjs.js +3 -3
  14. package/dist/aspect-ratio.esm.js +3 -3
  15. package/dist/avatar.cjs.js +14 -14
  16. package/dist/avatar.esm.js +31 -29
  17. package/dist/badge.cjs.js +4 -4
  18. package/dist/badge.esm.js +4 -4
  19. package/dist/block-controls.cjs.js +4 -4
  20. package/dist/block-controls.esm.js +4 -4
  21. package/dist/box.cjs.js +2 -2
  22. package/dist/box.esm.js +2 -2
  23. package/dist/breadcrumb.cjs.js +5 -5
  24. package/dist/breadcrumb.esm.js +5 -5
  25. package/dist/button.cjs.js +1 -1
  26. package/dist/button.esm.js +1 -1
  27. package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
  28. package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
  29. package/dist/calendar.cjs.js +1 -1
  30. package/dist/calendar.esm.js +1 -1
  31. package/dist/card.cjs.js +8 -8
  32. package/dist/card.esm.js +63 -20
  33. package/dist/chart.cjs.js +4 -4
  34. package/dist/chart.esm.js +6 -6
  35. package/dist/checkbox.cjs.js +2 -2
  36. package/dist/checkbox.esm.js +2 -2
  37. package/dist/collapsible.cjs.js +7 -7
  38. package/dist/collapsible.esm.js +7 -7
  39. package/dist/collection.cjs.js +1 -1
  40. package/dist/collection.esm.js +27 -23
  41. package/dist/color-picker.cjs.js +34 -14
  42. package/dist/color-picker.esm.js +89 -67
  43. package/dist/combobox.cjs.js +29 -27
  44. package/dist/combobox.esm.js +51 -45
  45. package/dist/command.cjs.js +2 -2
  46. package/dist/command.esm.js +2 -2
  47. package/dist/components/ui-alert-dialog.d.ts +1 -0
  48. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  49. package/dist/components/ui-avatar.d.ts +1 -0
  50. package/dist/components/ui-avatar.d.ts.map +1 -1
  51. package/dist/components/ui-button.d.ts +1 -0
  52. package/dist/components/ui-button.d.ts.map +1 -1
  53. package/dist/components/ui-calendar.d.ts.map +1 -1
  54. package/dist/components/ui-card.d.ts +3 -0
  55. package/dist/components/ui-card.d.ts.map +1 -1
  56. package/dist/components/ui-checkbox.d.ts.map +1 -1
  57. package/dist/components/ui-collection.d.ts.map +1 -1
  58. package/dist/components/ui-color-picker.d.ts.map +1 -1
  59. package/dist/components/ui-combobox.d.ts.map +1 -1
  60. package/dist/components/ui-data-table.d.ts.map +1 -1
  61. package/dist/components/ui-date-field.d.ts.map +1 -1
  62. package/dist/components/ui-date-picker.d.ts.map +1 -1
  63. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  64. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  65. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  66. package/dist/components/ui-dock.d.ts +1 -0
  67. package/dist/components/ui-dock.d.ts.map +1 -1
  68. package/dist/components/ui-drawer.d.ts.map +1 -1
  69. package/dist/components/ui-dropdown.d.ts.map +1 -1
  70. package/dist/components/ui-field.d.ts.map +1 -1
  71. package/dist/components/ui-file-upload.d.ts.map +1 -1
  72. package/dist/components/ui-gantt.d.ts.map +1 -1
  73. package/dist/components/ui-input.d.ts.map +1 -1
  74. package/dist/components/ui-menu.d.ts.map +1 -1
  75. package/dist/components/ui-multi-select.d.ts.map +1 -1
  76. package/dist/components/ui-number-field.d.ts.map +1 -1
  77. package/dist/components/ui-password-field.d.ts.map +1 -1
  78. package/dist/components/ui-pin-input.d.ts +1 -0
  79. package/dist/components/ui-pin-input.d.ts.map +1 -1
  80. package/dist/components/ui-placement-grid.d.ts.map +1 -1
  81. package/dist/components/ui-portal.d.ts.map +1 -1
  82. package/dist/components/ui-positioner.d.ts.map +1 -1
  83. package/dist/components/ui-progress.d.ts.map +1 -1
  84. package/dist/components/ui-radio.d.ts.map +1 -1
  85. package/dist/components/ui-rating.d.ts +1 -0
  86. package/dist/components/ui-rating.d.ts.map +1 -1
  87. package/dist/components/ui-select.d.ts.map +1 -1
  88. package/dist/components/ui-sortable.d.ts +8 -0
  89. package/dist/components/ui-sortable.d.ts.map +1 -1
  90. package/dist/components/ui-switch.d.ts.map +1 -1
  91. package/dist/components/ui-table.d.ts.map +1 -1
  92. package/dist/components/ui-tabs.d.ts +1 -0
  93. package/dist/components/ui-tabs.d.ts.map +1 -1
  94. package/dist/components/ui-tags-input.d.ts +1 -0
  95. package/dist/components/ui-tags-input.d.ts.map +1 -1
  96. package/dist/components/ui-textarea.d.ts.map +1 -1
  97. package/dist/components/ui-time-field.d.ts.map +1 -1
  98. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  99. package/dist/components/ui-toggle.d.ts.map +1 -1
  100. package/dist/components/ui-tree.d.ts.map +1 -1
  101. package/dist/components/ui-wizard.d.ts.map +1 -1
  102. package/dist/context-menu.cjs.js +3 -3
  103. package/dist/context-menu.esm.js +4 -4
  104. package/dist/control-name-BmoI1m3a.js +1 -0
  105. package/dist/control-name-Bpj7F34X.mjs +48 -0
  106. package/dist/data-table.cjs.js +5 -2
  107. package/dist/data-table.esm.js +145 -142
  108. package/dist/date-field.cjs.js +5 -5
  109. package/dist/date-field.esm.js +34 -31
  110. package/dist/date-picker.cjs.js +16 -16
  111. package/dist/date-picker.esm.js +48 -44
  112. package/dist/date-range-picker.cjs.js +5 -5
  113. package/dist/date-range-picker.esm.js +120 -118
  114. package/dist/date-range-time-picker.cjs.js +22 -22
  115. package/dist/date-range-time-picker.esm.js +88 -84
  116. package/dist/date-time-picker.cjs.js +26 -26
  117. package/dist/date-time-picker.esm.js +105 -101
  118. package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
  119. package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
  120. package/dist/description.cjs.js +3 -3
  121. package/dist/description.esm.js +3 -3
  122. package/dist/dialog.cjs.js +2 -2
  123. package/dist/dialog.esm.js +2 -2
  124. package/dist/dock.cjs.js +12 -12
  125. package/dist/dock.esm.js +72 -74
  126. package/dist/drawer.cjs.js +19 -19
  127. package/dist/drawer.esm.js +58 -58
  128. package/dist/dropdown.cjs.js +13 -13
  129. package/dist/dropdown.esm.js +49 -48
  130. package/dist/empty-state.cjs.js +3 -3
  131. package/dist/empty-state.esm.js +3 -3
  132. package/dist/field-error.cjs.js +1 -1
  133. package/dist/field-error.esm.js +1 -1
  134. package/dist/field.cjs.js +12 -12
  135. package/dist/field.esm.js +84 -75
  136. package/dist/fieldset.cjs.js +4 -4
  137. package/dist/fieldset.esm.js +4 -4
  138. package/dist/file-upload.cjs.js +3 -3
  139. package/dist/file-upload.esm.js +5 -3
  140. package/dist/floating-toolbar.cjs.js +8 -8
  141. package/dist/floating-toolbar.esm.js +9 -9
  142. package/dist/form.cjs.js +11 -11
  143. package/dist/form.esm.js +11 -11
  144. package/dist/gantt.cjs.js +43 -32
  145. package/dist/gantt.esm.js +99 -88
  146. package/dist/icon-cloud.cjs.js +3 -3
  147. package/dist/icon-cloud.esm.js +3 -3
  148. package/dist/icon.cjs.js +1 -1
  149. package/dist/icon.esm.js +1 -1
  150. package/dist/index.cjs.js +1 -1
  151. package/dist/index.esm.js +121 -118
  152. package/dist/inline-edit.cjs.js +1 -1
  153. package/dist/inline-edit.esm.js +1 -1
  154. package/dist/input.cjs.js +14 -14
  155. package/dist/input.esm.js +39 -32
  156. package/dist/label.cjs.js +3 -3
  157. package/dist/label.esm.js +3 -3
  158. package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
  159. package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
  160. package/dist/listbox.cjs.js +1 -1
  161. package/dist/listbox.esm.js +1 -1
  162. package/dist/marquee.cjs.js +3 -3
  163. package/dist/marquee.esm.js +3 -3
  164. package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
  165. package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
  166. package/dist/menu.cjs.js +7 -7
  167. package/dist/menu.esm.js +29 -28
  168. package/dist/menubar.cjs.js +1 -1
  169. package/dist/menubar.esm.js +2 -2
  170. package/dist/meter.cjs.js +1 -1
  171. package/dist/meter.esm.js +1 -1
  172. package/dist/multi-select.cjs.js +18 -18
  173. package/dist/multi-select.esm.js +82 -66
  174. package/dist/navigation-menu.cjs.js +1 -1
  175. package/dist/navigation-menu.esm.js +1 -1
  176. package/dist/number-field.cjs.js +11 -13
  177. package/dist/number-field.esm.js +29 -27
  178. package/dist/number-ticker.cjs.js +4 -4
  179. package/dist/number-ticker.esm.js +4 -4
  180. package/dist/odometer.cjs.js +2 -2
  181. package/dist/odometer.esm.js +2 -2
  182. package/dist/orbiter.cjs.js +3 -3
  183. package/dist/orbiter.esm.js +3 -3
  184. package/dist/pagination.cjs.js +1 -1
  185. package/dist/pagination.esm.js +1 -1
  186. package/dist/password-field.cjs.js +23 -23
  187. package/dist/password-field.esm.js +48 -47
  188. package/dist/pin-input.cjs.js +8 -6
  189. package/dist/pin-input.esm.js +21 -15
  190. package/dist/placement-grid.cjs.js +4 -4
  191. package/dist/placement-grid.esm.js +58 -58
  192. package/dist/plugin-panel.cjs.js +1 -1
  193. package/dist/plugin-panel.esm.js +1 -1
  194. package/dist/popover.cjs.js +5 -5
  195. package/dist/popover.esm.js +4 -4
  196. package/dist/portal.cjs.js +3 -3
  197. package/dist/portal.esm.js +11 -10
  198. package/dist/positioner.cjs.js +2 -2
  199. package/dist/positioner.esm.js +15 -14
  200. package/dist/primitives/auto-scroll.d.ts +9 -0
  201. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  202. package/dist/primitives/control-name.d.ts +30 -0
  203. package/dist/primitives/control-name.d.ts.map +1 -0
  204. package/dist/primitives/selector.d.ts +4 -0
  205. package/dist/primitives/selector.d.ts.map +1 -0
  206. package/dist/primitives/trigger.d.ts +2 -0
  207. package/dist/primitives/trigger.d.ts.map +1 -0
  208. package/dist/progress.cjs.js +4 -4
  209. package/dist/progress.esm.js +20 -18
  210. package/dist/quick-actions.cjs.js +3 -3
  211. package/dist/quick-actions.esm.js +3 -3
  212. package/dist/radio-group.cjs.js +1 -1
  213. package/dist/radio-group.esm.js +1 -1
  214. package/dist/radio.cjs.js +2 -2
  215. package/dist/radio.esm.js +2 -2
  216. package/dist/rating.cjs.js +17 -16
  217. package/dist/rating.esm.js +91 -92
  218. package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
  219. package/dist/runtime-DwE-tizc.js +1 -0
  220. package/dist/runtime.cjs.js +1 -1
  221. package/dist/runtime.d.ts +1 -1
  222. package/dist/runtime.d.ts.map +1 -1
  223. package/dist/runtime.esm.js +29 -26
  224. package/dist/select.cjs.js +20 -19
  225. package/dist/select.esm.js +36 -32
  226. package/dist/selection-popup.cjs.js +2 -2
  227. package/dist/selection-popup.esm.js +2 -2
  228. package/dist/selector-BvAh35ve.js +1 -0
  229. package/dist/selector-WI8pD7YO.mjs +18 -0
  230. package/dist/separator.cjs.js +7 -7
  231. package/dist/separator.esm.js +7 -7
  232. package/dist/sidebar.cjs.js +7 -7
  233. package/dist/sidebar.esm.js +7 -7
  234. package/dist/skeleton.cjs.js +7 -7
  235. package/dist/skeleton.esm.js +7 -7
  236. package/dist/slider.cjs.js +3 -3
  237. package/dist/slider.esm.js +3 -3
  238. package/dist/slot.cjs.js +3 -3
  239. package/dist/slot.esm.js +3 -3
  240. package/dist/sortable.cjs.js +61 -48
  241. package/dist/sortable.esm.js +636 -554
  242. package/dist/spinning-text.cjs.js +3 -3
  243. package/dist/spinning-text.esm.js +3 -3
  244. package/dist/split-button.cjs.js +1 -1
  245. package/dist/split-button.esm.js +1 -1
  246. package/dist/stepper.cjs.js +1 -1
  247. package/dist/stepper.esm.js +1 -1
  248. package/dist/switch.cjs.js +10 -12
  249. package/dist/switch.esm.js +10 -12
  250. package/dist/table.cjs.js +9 -6
  251. package/dist/table.esm.js +46 -43
  252. package/dist/tabs.cjs.js +22 -23
  253. package/dist/tabs.esm.js +116 -112
  254. package/dist/tags-input.cjs.js +9 -9
  255. package/dist/tags-input.esm.js +32 -25
  256. package/dist/textarea.cjs.js +13 -13
  257. package/dist/textarea.esm.js +46 -31
  258. package/dist/theme.d.ts +18 -0
  259. package/dist/theme.d.ts.map +1 -1
  260. package/dist/time-field.cjs.js +5 -5
  261. package/dist/time-field.esm.js +21 -18
  262. package/dist/time-picker.cjs.js +4 -4
  263. package/dist/time-picker.esm.js +5 -5
  264. package/dist/timeline.cjs.js +2 -2
  265. package/dist/timeline.esm.js +4 -4
  266. package/dist/toast.cjs.js +6 -6
  267. package/dist/toast.esm.js +13 -13
  268. package/dist/toggle-group.cjs.js +5 -6
  269. package/dist/toggle-group.esm.js +63 -60
  270. package/dist/toggle.cjs.js +18 -18
  271. package/dist/toggle.esm.js +32 -31
  272. package/dist/tooltip.cjs.js +4 -4
  273. package/dist/tooltip.esm.js +4 -4
  274. package/dist/transfer-list.cjs.js +32 -32
  275. package/dist/transfer-list.esm.js +57 -57
  276. package/dist/tree-7qbVnpGp.js +39 -0
  277. package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
  278. package/dist/tree.cjs.js +1 -1
  279. package/dist/tree.esm.js +1 -1
  280. package/dist/trigger-BjnxLCeQ.mjs +9 -0
  281. package/dist/trigger-DkPsKxsP.js +1 -0
  282. package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
  283. package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
  284. package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
  285. package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
  286. package/dist/wizard.cjs.js +12 -13
  287. package/dist/wizard.esm.js +17 -15
  288. package/package.json +1 -1
  289. package/dist/runtime-CTaOSmBj.js +0 -1
  290. package/dist/tree-Dx_kv_ih.js +0 -39
@@ -1,12 +1,13 @@
1
1
  import { E as _ } from "./ElementBase-YlTLMsGk.mjs";
2
- import { c as x } from "./menu-item-styles-CZiPwPwl.mjs";
2
+ import { r as x } from "./trigger-BjnxLCeQ.mjs";
3
+ import { c as y } from "./menu-item-styles-IGSFLAHu.mjs";
3
4
  const l = [
4
5
  '[role="menuitem"]',
5
6
  '[role="menuitemcheckbox"]',
6
7
  '[role="menuitemradio"]',
7
8
  ".item",
8
9
  "[data-menu-item]"
9
- ].join(", "), y = `
10
+ ].join(", "), k = `
10
11
  :host {
11
12
  --ui-dropdown-bg: var(
12
13
  --ui-dropdown-menu-bg,
@@ -251,7 +252,7 @@ const l = [
251
252
  }
252
253
 
253
254
  .menu[data-tone='neutral'] {
254
- --ui-dropdown-ring: color-mix(in srgb, var(--ui-color-muted, #64748b) 60%, var(--ui-dropdown-color));
255
+ --ui-dropdown-ring: color-mix(in srgb, var(--ui-color-muted, #526175) 60%, var(--ui-dropdown-color));
255
256
  }
256
257
 
257
258
  .menu[data-tone='danger'] {
@@ -262,20 +263,20 @@ const l = [
262
263
  }
263
264
 
264
265
  .menu[data-tone='success'] {
265
- --ui-dropdown-ring: var(--ui-color-success, #16a34a);
266
- --ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-success, #16a34a) 12%, transparent);
267
- --ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-success, #16a34a) 18%, transparent);
268
- --ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-success, #16a34a) 16%, transparent);
266
+ --ui-dropdown-ring: var(--ui-color-success, #15803d);
267
+ --ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 12%, transparent);
268
+ --ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 18%, transparent);
269
+ --ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 16%, transparent);
269
270
  }
270
271
 
271
272
  .menu[data-tone='warning'] {
272
- --ui-dropdown-ring: var(--ui-color-warning, #d97706);
273
- --ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-warning, #d97706) 15%, transparent);
274
- --ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-warning, #d97706) 20%, transparent);
275
- --ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-warning, #d97706) 17%, transparent);
273
+ --ui-dropdown-ring: var(--ui-color-warning, #b45309);
274
+ --ui-dropdown-item-hover-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 15%, transparent);
275
+ --ui-dropdown-item-active-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 20%, transparent);
276
+ --ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 17%, transparent);
276
277
  }
277
278
 
278
- ${x({
279
+ ${y({
279
280
  scopes: [".menu"],
280
281
  prefix: "--ui-dropdown",
281
282
  shortcutSelectors: [".shortcut", ".meta"],
@@ -508,18 +509,18 @@ const l = [
508
509
  }
509
510
  }
510
511
  `;
511
- function k(i) {
512
+ function A(i) {
512
513
  return i === "top" || i === "left" || i === "right" ? i : "bottom";
513
514
  }
514
- function A(i) {
515
+ function S(i) {
515
516
  const e = (i || "").trim().toLowerCase();
516
517
  return e === "sm" || e === "1" || e === "compact" ? "sm" : e === "lg" || e === "3" || e === "comfortable" ? "lg" : "md";
517
518
  }
518
- function S(i) {
519
+ function C(i) {
519
520
  const e = (i || "").trim().toLowerCase();
520
521
  return !e || e === "default" ? null : e === "none" ? "0px" : e === "sm" ? "8px" : e === "md" ? "12px" : e === "lg" || e === "large" ? "16px" : e === "full" || e === "pill" ? "999px" : e === "square" ? "6px" : e === "soft" || e === "rounded" ? "14px" : /^\d+(\.\d+)?$/.test(e) ? `${e}px` : /^\d+(\.\d+)?(px|rem|em|%)$/.test(e) ? e : i;
521
522
  }
522
- function h(i, e) {
523
+ function p(i, e) {
523
524
  return i.getAttribute(e) || "";
524
525
  }
525
526
  function f(i, e) {
@@ -527,13 +528,13 @@ function f(i, e) {
527
528
  const t = i.trim().toLowerCase();
528
529
  return t !== "false" && t !== "0" && t !== "off";
529
530
  }
530
- function p() {
531
+ function h() {
531
532
  return typeof window < "u" && typeof document < "u";
532
533
  }
533
534
  function b(i) {
534
535
  return i.hasAttribute("disabled") || i.getAttribute("aria-disabled") === "true" || i.disabled === !0;
535
536
  }
536
- function C(i) {
537
+ function E(i) {
537
538
  return (i.getAttribute("aria-label") || i.textContent || "").trim();
538
539
  }
539
540
  function g(i) {
@@ -544,7 +545,7 @@ function g(i) {
544
545
  i.focus();
545
546
  }
546
547
  }
547
- function E(i, e) {
548
+ function I(i, e) {
548
549
  const t = i.offsetTop, r = t + i.offsetHeight, o = e.scrollTop, a = o + e.clientHeight;
549
550
  if (t < o) {
550
551
  e.scrollTop = t;
@@ -552,7 +553,7 @@ function E(i, e) {
552
553
  }
553
554
  r > a && (e.scrollTop = Math.max(0, r - e.clientHeight));
554
555
  }
555
- function I(i) {
556
+ function T(i) {
556
557
  return w(i);
557
558
  }
558
559
  function w(i) {
@@ -567,23 +568,23 @@ function w(i) {
567
568
  t.appendChild(w(r));
568
569
  }), t;
569
570
  }
570
- function T(i, e, t) {
571
+ function M(i, e, t) {
571
572
  for (let r = e + t; r >= 0 && r < i.length; r += t)
572
573
  if (!b(i[r])) return r;
573
574
  return -1;
574
575
  }
575
- function M(i, e, t) {
576
+ function O(i, e, t) {
576
577
  if (!e) return null;
577
578
  const r = i.filter((a) => !b(a));
578
579
  if (!r.length) return null;
579
580
  const o = t ? r.indexOf(t) : -1;
580
581
  for (let a = 1; a <= r.length; a += 1) {
581
582
  const n = r[(o + a + r.length) % r.length];
582
- if (C(n).toLowerCase().startsWith(e)) return n;
583
+ if (E(n).toLowerCase().startsWith(e)) return n;
583
584
  }
584
585
  return null;
585
586
  }
586
- const O = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "tone", "size", "radius"]), P = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-describedby"]), F = [
587
+ const P = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "tone", "size", "radius"]), F = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-describedby"]), D = [
587
588
  "--ui-dropdown-bg",
588
589
  "--ui-dropdown-color",
589
590
  "--ui-dropdown-muted",
@@ -605,7 +606,7 @@ const O = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "
605
606
  "--ui-dropdown-duration",
606
607
  "--ui-dropdown-easing"
607
608
  ];
608
- class D extends _ {
609
+ class L extends _ {
609
610
  constructor() {
610
611
  super(), this._isOpen = !1, this._panelEl = null, this._portalEl = null, this._restoreFocusEl = null, this._typeaheadBuffer = "", this._typeaheadTimer = null, this._placement = "bottom", this._openListenersBound = !1, this._openFrame = 0, this._checkboxState = /* @__PURE__ */ new Map(), this._radioState = /* @__PURE__ */ new Map(), this._menuId = `ui-dropdown-menu-${Math.random().toString(36).slice(2, 10)}`, this._triggerId = `ui-dropdown-trigger-${Math.random().toString(36).slice(2, 10)}`, this._onHostClick = this._onHostClick.bind(this), this._onHostKeyDown = this._onHostKeyDown.bind(this), this._onDocumentPointerDown = this._onDocumentPointerDown.bind(this), this._onSlotChange = this._onSlotChange.bind(this);
611
612
  }
@@ -646,11 +647,11 @@ class D extends _ {
646
647
  this.hasAttribute("disabled") && this._isOpen && this.close("disabled"), this._syncTriggerA11y();
647
648
  return;
648
649
  }
649
- if (this._isOpen && (e === "placement" || O.has(e))) {
650
+ if (this._isOpen && (e === "placement" || P.has(e))) {
650
651
  this._syncMenuPresentation(), this._schedulePanelSync();
651
652
  return;
652
653
  }
653
- this._isOpen && P.has(e) && this._syncMenuA11y();
654
+ this._isOpen && F.has(e) && this._syncMenuA11y();
654
655
  }
655
656
  }
656
657
  }
@@ -705,7 +706,7 @@ class D extends _ {
705
706
  }
706
707
  _isFocusable(e) {
707
708
  if (!e || !e.isConnected || e.disabled || e.getAttribute("aria-hidden") === "true") return !1;
708
- if (!p()) return !0;
709
+ if (!h()) return !0;
709
710
  const t = window.getComputedStyle(e);
710
711
  return t.display !== "none" && t.visibility !== "hidden";
711
712
  }
@@ -781,20 +782,20 @@ class D extends _ {
781
782
  }
782
783
  _syncTriggerA11y() {
783
784
  const e = this._getTrigger();
784
- if (e) {
785
- if (e.id || (e.id = this._triggerId), e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", this._isOpen ? "true" : "false"), this._isOpen ? e.setAttribute("aria-controls", this._menuId) : e.removeAttribute("aria-controls"), this.hasAttribute("disabled")) {
786
- e.setAttribute("aria-disabled", "true"), e.setAttribute("tabindex", "-1");
787
- return;
788
- }
789
- e.getAttribute("aria-disabled") === "true" && e.removeAttribute("aria-disabled"), e.getAttribute("tabindex") === "-1" && e.removeAttribute("tabindex");
785
+ if (!e) return;
786
+ const t = x(e);
787
+ if (t.id || (t.id = this._triggerId), t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", this._isOpen ? "true" : "false"), this._isOpen ? t.setAttribute("aria-controls", this._menuId) : t.removeAttribute("aria-controls"), this.hasAttribute("disabled")) {
788
+ t.setAttribute("aria-disabled", "true"), t.setAttribute("tabindex", "-1");
789
+ return;
790
790
  }
791
+ t.getAttribute("aria-disabled") === "true" && t.removeAttribute("aria-disabled"), t.getAttribute("tabindex") === "-1" && t.removeAttribute("tabindex");
791
792
  }
792
793
  _renderMenuContent() {
793
794
  const e = this._getMenu();
794
795
  if (!e) return;
795
796
  e.replaceChildren();
796
797
  const t = this._getContentSource();
797
- if (t && e.appendChild(I(t)), !e.querySelector(l)) {
798
+ if (t && e.appendChild(T(t)), !e.querySelector(l)) {
798
799
  const r = document.createElement("div");
799
800
  r.className = "empty-state", r.textContent = "No items", e.appendChild(r);
800
801
  }
@@ -828,12 +829,12 @@ class D extends _ {
828
829
  _syncMenuPresentation() {
829
830
  const e = this._getMenu();
830
831
  if (!e) return;
831
- const t = p() ? window.getComputedStyle(this) : null;
832
- t && F.forEach((c) => {
832
+ const t = h() ? window.getComputedStyle(this) : null;
833
+ t && D.forEach((c) => {
833
834
  const m = t.getPropertyValue(c).trim();
834
835
  m ? e.style.setProperty(c, m) : e.style.removeProperty(c);
835
836
  });
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
+ const r = p(this, "variant"), o = S(this.getAttribute("size") || this.getAttribute("density")), a = p(this, "density"), n = p(this, "shape"), u = p(this, "elevation"), s = p(this, "tone"), d = C(this.getAttribute("radius") || n || null);
837
838
  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) {
838
839
  e.style.setProperty("--ui-dropdown-radius", d), e.style.setProperty("--ui-dropdown-item-radius", d === "999px" ? "999px" : `max(0px, calc(${d} - 2px))`);
839
840
  return;
@@ -861,19 +862,19 @@ class D extends _ {
861
862
  }
862
863
  _availableWidth(e) {
863
864
  const t = this._getTrigger();
864
- if (!t || !p()) return 380;
865
+ if (!t || !h()) return 380;
865
866
  const r = t.getBoundingClientRect(), o = window.innerWidth || document.documentElement.clientWidth || 0;
866
867
  return e === "left" ? r.left - 12 : e === "right" ? o - r.right - 12 : o - r.left - 12;
867
868
  }
868
869
  _availableHeight(e) {
869
870
  const t = this._getTrigger();
870
- if (!t || !p()) return 440;
871
+ if (!t || !h()) return 440;
871
872
  const r = t.getBoundingClientRect(), o = window.innerHeight || document.documentElement.clientHeight || 0;
872
873
  return e === "top" ? r.top - 12 : o - r.bottom - 12;
873
874
  }
874
875
  _resolvePlacement() {
875
- const e = k(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
876
- if (!t || !r || !p()) return e;
876
+ const e = A(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
877
+ if (!t || !r || !h()) return e;
877
878
  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);
878
879
  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";
879
880
  }
@@ -883,7 +884,7 @@ class D extends _ {
883
884
  _setActiveItem(e, t = {}) {
884
885
  if (this._clearActiveItem(), !!e && (e.setAttribute("data-active", "true"), t.focus && g(e), t.scroll)) {
885
886
  const r = this._getMenu();
886
- r && E(e, r);
887
+ r && I(e, r);
887
888
  }
888
889
  }
889
890
  _focusFirstItem() {
@@ -897,7 +898,7 @@ class D extends _ {
897
898
  _moveFocus(e) {
898
899
  const t = this._queryItems(!0);
899
900
  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);
901
+ 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 = M(t, o, e);
901
902
  if (a >= 0) {
902
903
  this._setActiveItem(t[a], { focus: !0, scroll: !0 });
903
904
  return;
@@ -914,7 +915,7 @@ class D extends _ {
914
915
  if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
915
916
  const t = e.key.toLowerCase();
916
917
  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
+ const r = O(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
918
919
  return r ? (this._setActiveItem(r, { focus: !0, scroll: !0 }), e.preventDefault(), !0) : !1;
919
920
  }
920
921
  _querySourceItems() {
@@ -1023,7 +1024,7 @@ class D extends _ {
1023
1024
  }
1024
1025
  render() {
1025
1026
  this.setContent(`
1026
- <style>${y}</style>
1027
+ <style>${k}</style>
1027
1028
  <div class="root" part="root">
1028
1029
  <div class="trigger" part="trigger">
1029
1030
  <slot name="trigger"></slot>
@@ -1048,7 +1049,7 @@ class D extends _ {
1048
1049
  return !1;
1049
1050
  }
1050
1051
  }
1051
- typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown", D);
1052
+ typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown", L);
1052
1053
  export {
1053
- D as UIDropdown
1054
+ L as UIDropdown
1054
1055
  };
@@ -6,8 +6,8 @@
6
6
  --ui-empty-radius: 16px;
7
7
  --ui-empty-padding: 28px;
8
8
  --ui-empty-title: var(--ui-color-text, #0f172a);
9
- --ui-empty-description: var(--ui-color-muted, #64748b);
10
- --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #64748b) 18%, transparent);
9
+ --ui-empty-description: var(--ui-color-muted, #526175);
10
+ --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #526175) 18%, transparent);
11
11
  --ui-empty-icon-color: color-mix(in srgb, var(--ui-color-text, #334155) 82%, transparent);
12
12
  --ui-empty-shadow: none;
13
13
  --ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
@@ -100,7 +100,7 @@
100
100
 
101
101
  :host([tone="success"]) {
102
102
  --ui-empty-icon-color: var(--ui-color-success, #166534);
103
- --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #16a34a) 20%, transparent);
103
+ --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
104
104
  }
105
105
 
106
106
  :host([tone="warning"]) {
@@ -7,8 +7,8 @@ const a = `
7
7
  --ui-empty-radius: 16px;
8
8
  --ui-empty-padding: 28px;
9
9
  --ui-empty-title: var(--ui-color-text, #0f172a);
10
- --ui-empty-description: var(--ui-color-muted, #64748b);
11
- --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #64748b) 18%, transparent);
10
+ --ui-empty-description: var(--ui-color-muted, #526175);
11
+ --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-muted, #526175) 18%, transparent);
12
12
  --ui-empty-icon-color: color-mix(in srgb, var(--ui-color-text, #334155) 82%, transparent);
13
13
  --ui-empty-shadow: none;
14
14
  --ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
@@ -101,7 +101,7 @@ const a = `
101
101
 
102
102
  :host([tone="success"]) {
103
103
  --ui-empty-icon-color: var(--ui-color-success, #166534);
104
- --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #16a34a) 20%, transparent);
104
+ --ui-empty-icon-bg: color-mix(in srgb, var(--ui-color-success, #15803d) 20%, transparent);
105
105
  }
106
106
 
107
107
  :host([tone="warning"]) {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),u=`
2
2
  :host {
3
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #dc2626));
3
+ --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
4
4
  --ui-field-error-size: 12px;
5
5
  --ui-field-error-weight: 600;
6
6
  --ui-field-error-line-height: 1.45;
@@ -1,7 +1,7 @@
1
1
  import { E as d } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const l = `
3
3
  :host {
4
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #dc2626));
4
+ --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
5
5
  --ui-field-error-size: 12px;
6
6
  --ui-field-error-weight: 600;
7
7
  --ui-field-error-line-height: 1.45;
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-EV6mVBUV.js"),q=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("./ElementBase-EV6mVBUV.js"),N=`
2
2
  :host {
3
3
  --ui-field-gap: 8px;
4
4
  --ui-field-label-width: 192px;
@@ -6,8 +6,8 @@
6
6
  --ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
7
7
  --ui-field-color: var(--ui-color-text, var(--ui-text, #0f172a));
8
8
  --ui-field-label-color: var(--ui-color-text, var(--ui-text, #0f172a));
9
- --ui-field-description-color: var(--ui-color-muted, var(--ui-muted, #64748b));
10
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #dc2626));
9
+ --ui-field-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
10
+ --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
11
11
  --ui-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
12
12
  --ui-field-border: 1px solid var(--ui-field-border-color);
13
13
  --ui-field-shadow:
@@ -216,7 +216,7 @@
216
216
 
217
217
  :host([tone="danger"]) {
218
218
  --ui-field-accent: #dc2626;
219
- --ui-field-error-color: #dc2626;
219
+ --ui-field-error-color: #c81e1e;
220
220
  }
221
221
 
222
222
  :host([density="compact"]) {
@@ -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(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
- <style>${q}</style>
373
+ `;function C(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function A(r){if(!r)return!1;const t=r.assignedNodes({flatten:!0});return t.length?t.some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE):!1}function x(r){if(r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"||r.getAttribute("tabindex")==="-1")return!1;const t=window.getComputedStyle(r);return!(t.display==="none"||t.visibility==="hidden")}function D(r){return!!r.closest('button, a, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"]')}function k(r){return Array.from(new Set(r.filter(Boolean)))}const _="data-ui-field-label",S="data-ui-field-description",I='ui-input, ui-textarea, ui-select, ui-combobox, input, textarea, select, button, [tabindex]:not([tabindex="-1"])';class L extends M.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(t,i,l){if(i!==l){if(t==="for"&&this._invalidateControlCache(),t==="label-width"){const o=this.getAttribute("label-width");o?this.style.setProperty("--ui-field-label-width",o):this.style.removeProperty("--ui-field-label-width")}if(t==="label"||t==="description"||t==="error"||t==="required"||t==="for"){this.isConnected&&this.requestRender();return}t==="invalid"&&this._scheduleDerivedStateSync()}}_onSlotChange(){this._invalidateControlCache(),this._scheduleDerivedStateSync()}_onRootClick(t){const i=t.target;i&&i.closest(".label")&&(D(i)||this._focusControl())}_invalidateControlCache(){this._controlCache=null}_scheduleDerivedStateSync(){this._stateSyncQueued||(this._stateSyncQueued=!0,queueMicrotask(()=>{this._stateSyncQueued=!1,this.isConnected&&this._syncDerivedState()}))}_focusControl(){const t=this._resolveControlElement();if(t)try{t.focus({preventScroll:!0})}catch{t.focus()}}_resolveControlElement(){if(this._controlCache&&this._controlCache.isConnected&&x(this._controlCache))return this._controlCache;const t=this.getAttribute("for");if(t){const e=document.getElementById(t);if(e instanceof HTMLElement&&x(e))return this._controlCache=e,e}const l=this.root.querySelector("slot:not([name])")?.assignedElements({flatten:!0})||[];for(const e of l){if(!(e instanceof HTMLElement))continue;if(x(e))return this._controlCache=e,e;const a=e.querySelector(I);if(a&&x(a))return this._controlCache=a,a}const o=this.querySelector(I);return o&&x(o)?(this._controlCache=o,o):null}_syncDerivedState(){const t=this.root.querySelector('slot[name="label"]'),i=this.root.querySelector('slot[name="actions"]'),l=this.root.querySelector('slot[name="description"]'),o=this.root.querySelector('slot[name="error"]'),e=(this.getAttribute("label")||"").trim(),a=(this.getAttribute("description")||"").trim(),y=(this.getAttribute("error")||"").trim(),n=!!e||A(t),d=A(i),h=!!a||A(l),b=!!y||A(o),w=n||d||h,E=n||d,c=this.root.querySelector(".meta"),p=this.root.querySelector(".label-row"),g=this.root.querySelector(".label"),m=this.root.querySelector(".actions"),u=this.root.querySelector(".description"),v=this.root.querySelector(".error");c&&(w?c.removeAttribute("hidden"):c.setAttribute("hidden","")),p&&(E?p.removeAttribute("hidden"):p.setAttribute("hidden","")),g&&(n?g.removeAttribute("hidden"):g.setAttribute("hidden","")),m&&(d?m.removeAttribute("hidden"):m.setAttribute("hidden","")),u&&(h?u.removeAttribute("hidden"):u.setAttribute("hidden","")),v&&(b?v.removeAttribute("hidden"):v.setAttribute("hidden",""));const q=t?t.assignedNodes({flatten:!0}).map(f=>f.textContent||"").join(" "):"",s=f=>f.replace(/\s+/g," ").trim(),T=f=>f?f.assignedNodes({flatten:!0}).map($=>$.textContent||"").join(" "):"",B=h?s(a||T(l)):"",R=b?s(y||T(o)):"";this._syncControlA11y(n,s(e||q),[B,R].filter(Boolean).join(" "),b)}_syncControlA11y(t,i,l,o){const e=this._resolveControlElement();if(!e)return;const a=`${this._uid}-label`,y=`${this._uid}-description`,n=`${this._uid}-error`,d=(e.getAttribute("aria-labelledby")||"").split(/\s+/).filter(s=>s&&s!==a),h=e.getRootNode(),b=d.some(s=>!!h.getElementById?.(s)),w=k(d);w.length?e.setAttribute("aria-labelledby",w.join(" ")):e.removeAttribute("aria-labelledby");const E=e.hasAttribute("aria-label")&&!e.hasAttribute(_),c=e.labels,p=(e.getAttribute("label")||"").trim().length>0,g=(e.textContent||"").trim().length>0,m=b||E||p||g||!!(c&&c.length>0);t&&i&&!m?(e.setAttribute("aria-label",i),e.setAttribute(_,"")):e.hasAttribute(_)&&(e.removeAttribute("aria-label"),e.removeAttribute(_));const u=k((e.getAttribute("aria-describedby")||"").split(/\s+/).filter(s=>s&&s!==y&&s!==n));u.length?e.setAttribute("aria-describedby",u.join(" ")):e.removeAttribute("aria-describedby");const v=e.hasAttribute("aria-description")&&!e.hasAttribute(S);l&&!v?(e.setAttribute("aria-description",l),e.setAttribute(S,"")):e.hasAttribute(S)&&(e.removeAttribute("aria-description"),e.removeAttribute(S)),this.hasAttribute("invalid")||o?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),this.hasAttribute("required")?e.setAttribute("aria-required","true"):e.removeAttribute("aria-required")}render(){const t=this.getAttribute("label")||"",i=this.getAttribute("description")||"",l=this.getAttribute("error")||"",o=this.hasAttribute("required"),e=this.getAttribute("for")||"";this.setContent(`
374
+ <style>${N}</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" ${t?`for="${b(t)}"`:""}>
379
- <slot name="label">${b(e)}</slot>
380
- ${i?'<span class="required" aria-hidden="true">*</span>':""}
378
+ <label class="label" id="${this._uid}-label" ${e?`for="${C(e)}"`:""}>
379
+ <slot name="label">${C(t)}</slot>
380
+ ${o?'<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(r)}</slot>
385
+ <slot name="description">${C(i)}</slot>
386
386
  </p>
387
387
  </div>
388
388
 
@@ -391,8 +391,8 @@
391
391
  <div class="control" part="control"><slot></slot></div>
392
392
  </div>
393
393
  <p class="error" id="${this._uid}-error" part="error" aria-live="polite">
394
- <slot name="error">${b(l)}</slot>
394
+ <slot name="error">${C(l)}</slot>
395
395
  </p>
396
396
  </div>
397
397
  </div>
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;
398
+ `),this._invalidateControlCache(),this._scheduleDerivedStateSync()}shouldRenderOnAttributeChange(t,i,l){return t==="label"||t==="description"||t==="error"||t==="required"||t==="for"}}typeof customElements<"u"&&!customElements.get("ui-field")&&customElements.define("ui-field",L);exports.UIField=L;