@editora/ui-core 0.1.25 → 0.2.1

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 (349) hide show
  1. package/README.md +132 -0
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +92 -53
  5. package/dist/alert-dialog.esm.js +211 -159
  6. package/dist/alert.cjs.js +42 -33
  7. package/dist/alert.esm.js +80 -71
  8. package/dist/animated-beam.cjs.js +42 -50
  9. package/dist/animated-beam.esm.js +47 -55
  10. package/dist/animated-list.cjs.js +11 -27
  11. package/dist/animated-list.esm.js +12 -28
  12. package/dist/animated-text.cjs.js +9 -9
  13. package/dist/animated-text.esm.js +9 -9
  14. package/dist/app-header.cjs.js +17 -12
  15. package/dist/app-header.esm.js +18 -13
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +16 -20
  19. package/dist/avatar.esm.js +16 -20
  20. package/dist/badge.cjs.js +27 -22
  21. package/dist/badge.esm.js +32 -27
  22. package/dist/block-controls.cjs.js +11 -12
  23. package/dist/block-controls.esm.js +8 -9
  24. package/dist/box.cjs.js +2 -3
  25. package/dist/box.esm.js +2 -3
  26. package/dist/breadcrumb.cjs.js +12 -18
  27. package/dist/breadcrumb.esm.js +11 -17
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.esm.js +1 -1
  30. package/dist/{calendar-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
  31. package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
  32. package/dist/calendar.cjs.js +1 -1
  33. package/dist/calendar.esm.js +1 -1
  34. package/dist/card.cjs.js +6 -7
  35. package/dist/card.esm.js +5 -6
  36. package/dist/chart.cjs.js +58 -52
  37. package/dist/chart.esm.js +101 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +9 -13
  41. package/dist/collapsible.esm.js +9 -13
  42. package/dist/color-picker.cjs.js +38 -19
  43. package/dist/color-picker.esm.js +134 -115
  44. package/dist/combobox.cjs.js +60 -57
  45. package/dist/combobox.esm.js +96 -92
  46. package/dist/command-palette.cjs.js +1 -0
  47. package/dist/command-palette.esm.js +1 -0
  48. package/dist/command.cjs.js +32 -14
  49. package/dist/command.esm.js +46 -28
  50. package/dist/components/date-time-utils.d.ts.map +1 -1
  51. package/dist/components/ui-accordion.d.ts.map +1 -1
  52. package/dist/components/ui-alert-dialog.d.ts +2 -0
  53. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  54. package/dist/components/ui-alert.d.ts.map +1 -1
  55. package/dist/components/ui-animated-beam.d.ts.map +1 -1
  56. package/dist/components/ui-animated-list.d.ts.map +1 -1
  57. package/dist/components/ui-app-header.d.ts.map +1 -1
  58. package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
  59. package/dist/components/ui-avatar.d.ts.map +1 -1
  60. package/dist/components/ui-badge.d.ts.map +1 -1
  61. package/dist/components/ui-block-controls.d.ts.map +1 -1
  62. package/dist/components/ui-box.d.ts.map +1 -1
  63. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  64. package/dist/components/ui-button.d.ts.map +1 -1
  65. package/dist/components/ui-calendar.d.ts.map +1 -1
  66. package/dist/components/ui-card.d.ts.map +1 -1
  67. package/dist/components/ui-chart.d.ts.map +1 -1
  68. package/dist/components/ui-checkbox.d.ts.map +1 -1
  69. package/dist/components/ui-collapsible.d.ts.map +1 -1
  70. package/dist/components/ui-color-picker.d.ts.map +1 -1
  71. package/dist/components/ui-combobox.d.ts.map +1 -1
  72. package/dist/components/ui-command-palette.d.ts.map +1 -1
  73. package/dist/components/ui-command.d.ts.map +1 -1
  74. package/dist/components/ui-container.d.ts.map +1 -1
  75. package/dist/components/ui-context-menu.d.ts.map +1 -1
  76. package/dist/components/ui-data-table.d.ts +7 -0
  77. package/dist/components/ui-data-table.d.ts.map +1 -1
  78. package/dist/components/ui-date-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  80. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  81. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  82. package/dist/components/ui-dialog.d.ts +2 -0
  83. package/dist/components/ui-dialog.d.ts.map +1 -1
  84. package/dist/components/ui-dock.d.ts.map +1 -1
  85. package/dist/components/ui-drawer.d.ts.map +1 -1
  86. package/dist/components/ui-dropdown.d.ts.map +1 -1
  87. package/dist/components/ui-empty-state.d.ts.map +1 -1
  88. package/dist/components/ui-field.d.ts.map +1 -1
  89. package/dist/components/ui-fieldset.d.ts.map +1 -1
  90. package/dist/components/ui-file-upload.d.ts.map +1 -1
  91. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  92. package/dist/components/ui-form.d.ts.map +1 -1
  93. package/dist/components/ui-gantt.d.ts.map +1 -1
  94. package/dist/components/ui-hover-card.d.ts.map +1 -1
  95. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  96. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  97. package/dist/components/ui-input.d.ts.map +1 -1
  98. package/dist/components/ui-marquee.d.ts.map +1 -1
  99. package/dist/components/ui-menu.d.ts.map +1 -1
  100. package/dist/components/ui-menubar.d.ts.map +1 -1
  101. package/dist/components/ui-meter.d.ts.map +1 -1
  102. package/dist/components/ui-multi-select.d.ts.map +1 -1
  103. package/dist/components/ui-number-field.d.ts.map +1 -1
  104. package/dist/components/ui-orbiter.d.ts.map +1 -1
  105. package/dist/components/ui-pagination.d.ts.map +1 -1
  106. package/dist/components/ui-password-field.d.ts.map +1 -1
  107. package/dist/components/ui-pin-input.d.ts.map +1 -1
  108. package/dist/components/ui-popover.d.ts.map +1 -1
  109. package/dist/components/ui-progress.d.ts.map +1 -1
  110. package/dist/components/ui-radio-group.d.ts.map +1 -1
  111. package/dist/components/ui-radio.d.ts.map +1 -1
  112. package/dist/components/ui-rating.d.ts +1 -0
  113. package/dist/components/ui-rating.d.ts.map +1 -1
  114. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  115. package/dist/components/ui-section.d.ts.map +1 -1
  116. package/dist/components/ui-select.d.ts.map +1 -1
  117. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  118. package/dist/components/ui-sidebar.d.ts.map +1 -1
  119. package/dist/components/ui-slider.d.ts.map +1 -1
  120. package/dist/components/ui-sortable.d.ts.map +1 -1
  121. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  122. package/dist/components/ui-split-button.d.ts.map +1 -1
  123. package/dist/components/ui-splitter.d.ts.map +1 -1
  124. package/dist/components/ui-stepper.d.ts.map +1 -1
  125. package/dist/components/ui-switch.d.ts.map +1 -1
  126. package/dist/components/ui-tabs.d.ts.map +1 -1
  127. package/dist/components/ui-tags-input.d.ts.map +1 -1
  128. package/dist/components/ui-textarea.d.ts.map +1 -1
  129. package/dist/components/ui-time-picker.d.ts.map +1 -1
  130. package/dist/components/ui-toggle-group.d.ts +2 -0
  131. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  132. package/dist/components/ui-toggle.d.ts.map +1 -1
  133. package/dist/components/ui-toolbar.d.ts +2 -0
  134. package/dist/components/ui-toolbar.d.ts.map +1 -1
  135. package/dist/components/ui-tooltip.d.ts.map +1 -1
  136. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  137. package/dist/components/ui-tree-item.d.ts.map +1 -1
  138. package/dist/components/ui-tree.d.ts.map +1 -1
  139. package/dist/components/ui-wizard.d.ts.map +1 -1
  140. package/dist/container.cjs.js +6 -12
  141. package/dist/container.esm.js +8 -14
  142. package/dist/context-menu.cjs.js +8 -8
  143. package/dist/context-menu.esm.js +42 -41
  144. package/dist/data-table.cjs.js +21 -18
  145. package/dist/data-table.esm.js +210 -190
  146. package/dist/date-field.cjs.js +9 -9
  147. package/dist/date-field.esm.js +19 -19
  148. package/dist/date-picker.cjs.js +29 -20
  149. package/dist/date-picker.esm.js +59 -50
  150. package/dist/date-range-picker.cjs.js +24 -19
  151. package/dist/date-range-picker.esm.js +86 -81
  152. package/dist/date-range-time-picker.cjs.js +27 -20
  153. package/dist/date-range-time-picker.esm.js +24 -17
  154. package/dist/date-time-picker.cjs.js +24 -17
  155. package/dist/date-time-picker.esm.js +89 -82
  156. package/dist/date-time-utils-C-4eHTyy.js +1 -0
  157. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
  158. package/dist/description.cjs.js +4 -4
  159. package/dist/description.esm.js +4 -4
  160. package/dist/dialog.cjs.js +59 -43
  161. package/dist/dialog.esm.js +86 -53
  162. package/dist/direction-provider.cjs.js +1 -1
  163. package/dist/direction-provider.esm.js +1 -1
  164. package/dist/dock.cjs.js +16 -30
  165. package/dist/dock.esm.js +26 -40
  166. package/dist/drawer.cjs.js +8 -12
  167. package/dist/drawer.esm.js +6 -10
  168. package/dist/dropdown.cjs.js +8 -6
  169. package/dist/dropdown.esm.js +33 -30
  170. package/dist/empty-state.cjs.js +17 -15
  171. package/dist/empty-state.esm.js +13 -11
  172. package/dist/field-error.cjs.js +1 -1
  173. package/dist/field-error.esm.js +7 -7
  174. package/dist/field.cjs.js +23 -14
  175. package/dist/field.esm.js +30 -21
  176. package/dist/fieldset.cjs.js +16 -9
  177. package/dist/fieldset.esm.js +19 -12
  178. package/dist/file-upload.cjs.js +79 -37
  179. package/dist/file-upload.esm.js +154 -112
  180. package/dist/flex.cjs.js +2 -2
  181. package/dist/flex.esm.js +8 -8
  182. package/dist/floating-toolbar.cjs.js +6 -7
  183. package/dist/floating-toolbar.esm.js +8 -9
  184. package/dist/form.cjs.js +24 -27
  185. package/dist/form.esm.js +24 -27
  186. package/dist/gantt.cjs.js +13 -11
  187. package/dist/gantt.esm.js +13 -11
  188. package/dist/grid.cjs.js +1 -1
  189. package/dist/grid.esm.js +1 -1
  190. package/dist/hover-card.cjs.js +8 -8
  191. package/dist/hover-card.esm.js +18 -15
  192. package/dist/icon-cloud.cjs.js +19 -36
  193. package/dist/icon-cloud.esm.js +41 -58
  194. package/dist/index.cjs.js +1 -1
  195. package/dist/index.d.ts +2 -0
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.esm.js +108 -104
  198. package/dist/inline-edit.cjs.js +50 -22
  199. package/dist/inline-edit.esm.js +77 -49
  200. package/dist/input.cjs.js +45 -38
  201. package/dist/input.esm.js +60 -53
  202. package/dist/label.cjs.js +6 -6
  203. package/dist/label.esm.js +6 -6
  204. package/dist/layout.cjs.js +3 -3
  205. package/dist/layout.esm.js +3 -3
  206. package/dist/marquee.cjs.js +7 -10
  207. package/dist/marquee.esm.js +7 -10
  208. package/dist/masonry-grid.cjs.js +2 -2
  209. package/dist/masonry-grid.esm.js +11 -11
  210. package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
  211. package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
  212. package/dist/menu.cjs.js +8 -24
  213. package/dist/menu.esm.js +52 -72
  214. package/dist/menubar.cjs.js +9 -31
  215. package/dist/menubar.esm.js +127 -153
  216. package/dist/meter.cjs.js +4 -9
  217. package/dist/meter.esm.js +6 -11
  218. package/dist/multi-select.cjs.js +53 -40
  219. package/dist/multi-select.esm.js +87 -73
  220. package/dist/navigation-menu.cjs.js +10 -10
  221. package/dist/navigation-menu.esm.js +33 -33
  222. package/dist/number-field.cjs.js +28 -17
  223. package/dist/number-field.esm.js +37 -26
  224. package/dist/number-ticker.cjs.js +4 -4
  225. package/dist/number-ticker.esm.js +10 -10
  226. package/dist/odometer.cjs.js +9 -9
  227. package/dist/odometer.esm.js +17 -17
  228. package/dist/orbiter.cjs.js +11 -28
  229. package/dist/orbiter.esm.js +28 -45
  230. package/dist/overlay-motion-B56x1GoY.js +49 -0
  231. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  232. package/dist/pagination.cjs.js +28 -25
  233. package/dist/pagination.esm.js +54 -51
  234. package/dist/password-field.cjs.js +39 -34
  235. package/dist/password-field.esm.js +63 -58
  236. package/dist/pin-input.cjs.js +18 -14
  237. package/dist/pin-input.esm.js +24 -20
  238. package/dist/placement-grid.cjs.js +1 -1
  239. package/dist/placement-grid.esm.js +1 -1
  240. package/dist/plugin-panel.cjs.js +1 -1
  241. package/dist/plugin-panel.esm.js +1 -1
  242. package/dist/popover.cjs.js +16 -28
  243. package/dist/popover.esm.js +29 -45
  244. package/dist/portal-DeaM1tYY.mjs +121 -0
  245. package/dist/portal-XbYR3m_q.js +1 -0
  246. package/dist/portal.cjs.js +1 -1
  247. package/dist/portal.d.ts +3 -1
  248. package/dist/portal.d.ts.map +1 -1
  249. package/dist/portal.esm.js +1 -1
  250. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  251. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  252. package/dist/positioner.cjs.js +1 -1
  253. package/dist/positioner.esm.js +1 -1
  254. package/dist/presence.cjs.js +1 -1
  255. package/dist/presence.esm.js +1 -1
  256. package/dist/primitives/overlay-motion.d.ts +47 -0
  257. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  258. package/dist/primitives/positioner.d.ts.map +1 -1
  259. package/dist/progress.cjs.js +11 -16
  260. package/dist/progress.esm.js +37 -42
  261. package/dist/quick-actions.cjs.js +14 -14
  262. package/dist/quick-actions.esm.js +12 -12
  263. package/dist/radio-group.cjs.js +50 -26
  264. package/dist/radio-group.esm.js +53 -29
  265. package/dist/radio.cjs.js +16 -13
  266. package/dist/radio.esm.js +16 -13
  267. package/dist/rating.cjs.js +11 -15
  268. package/dist/rating.esm.js +48 -50
  269. package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
  270. package/dist/runtime-CXw4SGV9.js +5 -0
  271. package/dist/runtime.cjs.js +1 -1
  272. package/dist/runtime.d.ts +3 -2
  273. package/dist/runtime.d.ts.map +1 -1
  274. package/dist/runtime.esm.js +36 -32
  275. package/dist/scroll-area.cjs.js +3 -4
  276. package/dist/scroll-area.esm.js +3 -4
  277. package/dist/section.cjs.js +2 -4
  278. package/dist/section.esm.js +2 -4
  279. package/dist/select.cjs.js +42 -75
  280. package/dist/select.esm.js +57 -89
  281. package/dist/selection-popup.cjs.js +3 -4
  282. package/dist/selection-popup.esm.js +3 -4
  283. package/dist/semantic-tokens.d.ts +17 -0
  284. package/dist/semantic-tokens.d.ts.map +1 -0
  285. package/dist/separator.cjs.js +6 -6
  286. package/dist/separator.esm.js +7 -7
  287. package/dist/sidebar.cjs.js +29 -28
  288. package/dist/sidebar.esm.js +32 -31
  289. package/dist/skeleton.cjs.js +2 -2
  290. package/dist/skeleton.esm.js +2 -2
  291. package/dist/slider.cjs.js +22 -26
  292. package/dist/slider.esm.js +25 -29
  293. package/dist/slot.cjs.js +1 -1
  294. package/dist/slot.esm.js +1 -1
  295. package/dist/sortable.cjs.js +10 -11
  296. package/dist/sortable.esm.js +10 -11
  297. package/dist/spinning-text.cjs.js +4 -13
  298. package/dist/spinning-text.esm.js +4 -13
  299. package/dist/split-button.cjs.js +7 -7
  300. package/dist/split-button.esm.js +17 -16
  301. package/dist/splitter.cjs.js +52 -10
  302. package/dist/splitter.esm.js +55 -13
  303. package/dist/stepper.cjs.js +31 -65
  304. package/dist/stepper.esm.js +32 -66
  305. package/dist/switch.cjs.js +20 -22
  306. package/dist/switch.esm.js +20 -22
  307. package/dist/table.cjs.js +5 -5
  308. package/dist/table.esm.js +20 -20
  309. package/dist/tabs.cjs.js +101 -26
  310. package/dist/tabs.esm.js +187 -112
  311. package/dist/tags-input.cjs.js +43 -17
  312. package/dist/tags-input.esm.js +75 -49
  313. package/dist/textarea.cjs.js +34 -35
  314. package/dist/textarea.esm.js +50 -51
  315. package/dist/theme.d.ts +25 -1
  316. package/dist/theme.d.ts.map +1 -1
  317. package/dist/time-field.cjs.js +8 -8
  318. package/dist/time-field.esm.js +29 -29
  319. package/dist/time-picker.cjs.js +17 -14
  320. package/dist/time-picker.esm.js +28 -25
  321. package/dist/timeline.cjs.js +10 -10
  322. package/dist/timeline.esm.js +7 -7
  323. package/dist/toast.cjs.js +2 -2
  324. package/dist/toast.esm.js +2 -2
  325. package/dist/toggle-group.cjs.js +13 -13
  326. package/dist/toggle-group.esm.js +66 -61
  327. package/dist/toggle.cjs.js +52 -34
  328. package/dist/toggle.esm.js +80 -62
  329. package/dist/toolbar.cjs.js +14 -14
  330. package/dist/toolbar.esm.js +41 -33
  331. package/dist/tooltip.cjs.js +3 -3
  332. package/dist/tooltip.esm.js +39 -33
  333. package/dist/transfer-list.cjs.js +37 -38
  334. package/dist/transfer-list.esm.js +32 -33
  335. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  336. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  337. package/dist/tree-item.cjs.js +9 -8
  338. package/dist/tree-item.esm.js +13 -12
  339. package/dist/tree.cjs.js +1 -1
  340. package/dist/tree.esm.js +1 -1
  341. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  342. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  343. package/dist/wizard.cjs.js +51 -39
  344. package/dist/wizard.esm.js +51 -39
  345. package/package.json +1 -1
  346. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  347. package/dist/portal-DgpQ3Jo1.js +0 -1
  348. package/dist/portal-bR42gHvG.mjs +0 -118
  349. package/dist/runtime-DwE-tizc.js +0 -1
@@ -1,13 +1,16 @@
1
1
  import { E as _ } from "./ElementBase-BeZT54Hj.mjs";
2
- import { r as x } from "./trigger-BjnxLCeQ.mjs";
3
- import { c as y } from "./menu-item-styles-IGSFLAHu.mjs";
2
+ import { O as x, s as y } from "./overlay-motion-BX3dPLay.mjs";
3
+ import { r as k } from "./trigger-BjnxLCeQ.mjs";
4
+ import { c as A } from "./menu-item-styles-CdqxPUuw.mjs";
4
5
  const l = [
5
6
  '[role="menuitem"]',
6
7
  '[role="menuitemcheckbox"]',
7
8
  '[role="menuitemradio"]',
8
9
  ".item",
9
10
  "[data-menu-item]"
10
- ].join(", "), k = `
11
+ ].join(", "), S = `
12
+ ${x}
13
+
11
14
  :host {
12
15
  --ui-dropdown-bg: var(
13
16
  --ui-dropdown-menu-bg,
@@ -21,7 +24,7 @@ const l = [
21
24
  );
22
25
  --ui-dropdown-border: var(--ui-dropdown-menu-border, var(--base-dropdown-border, 1px solid var(--ui-dropdown-border-color)));
23
26
  --ui-dropdown-shadow: var(--ui-dropdown-menu-shadow, var(--base-dropdown-shadow, 0 10px 24px rgba(15, 23, 42, 0.14)));
24
- --ui-dropdown-radius: var(--ui-dropdown-menu-radius, var(--base-dropdown-radius, var(--ui-radius, 4px)));
27
+ --ui-dropdown-radius: var(--ui-dropdown-menu-radius, var(--base-dropdown-radius, var(--ui-radius, 6px)));
25
28
  --ui-dropdown-padding: var(--ui-dropdown-menu-padding, var(--base-dropdown-content-padding, 0px));
26
29
  --ui-dropdown-min-width: var(--ui-dropdown-menu-min-width, var(--base-dropdown-min-width, 224px));
27
30
  --ui-dropdown-gap: 8px;
@@ -276,7 +279,7 @@ const l = [
276
279
  --ui-dropdown-item-checked-bg: color-mix(in srgb, var(--ui-color-warning, #b45309) 17%, transparent);
277
280
  }
278
281
 
279
- ${y({
282
+ ${A({
280
283
  scopes: [".menu"],
281
284
  prefix: "--ui-dropdown",
282
285
  shortcutSelectors: [".shortcut", ".meta"],
@@ -509,14 +512,14 @@ const l = [
509
512
  }
510
513
  }
511
514
  `;
512
- function A(i) {
515
+ function C(i) {
513
516
  return i === "top" || i === "left" || i === "right" ? i : "bottom";
514
517
  }
515
- function S(i) {
518
+ function E(i) {
516
519
  const e = (i || "").trim().toLowerCase();
517
520
  return e === "sm" || e === "1" || e === "compact" ? "sm" : e === "lg" || e === "3" || e === "comfortable" ? "lg" : "md";
518
521
  }
519
- function C(i) {
522
+ function I(i) {
520
523
  const e = (i || "").trim().toLowerCase();
521
524
  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;
522
525
  }
@@ -534,7 +537,7 @@ function h() {
534
537
  function b(i) {
535
538
  return i.hasAttribute("disabled") || i.getAttribute("aria-disabled") === "true" || i.disabled === !0;
536
539
  }
537
- function E(i) {
540
+ function T(i) {
538
541
  return (i.getAttribute("aria-label") || i.textContent || "").trim();
539
542
  }
540
543
  function g(i) {
@@ -545,7 +548,7 @@ function g(i) {
545
548
  i.focus();
546
549
  }
547
550
  }
548
- function I(i, e) {
551
+ function M(i, e) {
549
552
  const t = i.offsetTop, r = t + i.offsetHeight, o = e.scrollTop, a = o + e.clientHeight;
550
553
  if (t < o) {
551
554
  e.scrollTop = t;
@@ -553,7 +556,7 @@ function I(i, e) {
553
556
  }
554
557
  r > a && (e.scrollTop = Math.max(0, r - e.clientHeight));
555
558
  }
556
- function T(i) {
559
+ function O(i) {
557
560
  return w(i);
558
561
  }
559
562
  function w(i) {
@@ -568,23 +571,23 @@ function w(i) {
568
571
  t.appendChild(w(r));
569
572
  }), t;
570
573
  }
571
- function M(i, e, t) {
574
+ function P(i, e, t) {
572
575
  for (let r = e + t; r >= 0 && r < i.length; r += t)
573
576
  if (!b(i[r])) return r;
574
577
  return -1;
575
578
  }
576
- function O(i, e, t) {
579
+ function F(i, e, t) {
577
580
  if (!e) return null;
578
581
  const r = i.filter((a) => !b(a));
579
582
  if (!r.length) return null;
580
583
  const o = t ? r.indexOf(t) : -1;
581
584
  for (let a = 1; a <= r.length; a += 1) {
582
585
  const n = r[(o + a + r.length) % r.length];
583
- if (E(n).toLowerCase().startsWith(e)) return n;
586
+ if (T(n).toLowerCase().startsWith(e)) return n;
584
587
  }
585
588
  return null;
586
589
  }
587
- const P = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "tone", "size", "radius"]), F = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-describedby"]), D = [
590
+ const D = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "tone", "size", "radius"]), L = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-describedby"]), z = [
588
591
  "--ui-dropdown-bg",
589
592
  "--ui-dropdown-color",
590
593
  "--ui-dropdown-muted",
@@ -606,7 +609,7 @@ const P = /* @__PURE__ */ new Set(["variant", "density", "shape", "elevation", "
606
609
  "--ui-dropdown-duration",
607
610
  "--ui-dropdown-easing"
608
611
  ];
609
- class L extends _ {
612
+ class H extends _ {
610
613
  constructor() {
611
614
  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);
612
615
  }
@@ -647,11 +650,11 @@ class L extends _ {
647
650
  this.hasAttribute("disabled") && this._isOpen && this.close("disabled"), this._syncTriggerA11y();
648
651
  return;
649
652
  }
650
- if (this._isOpen && (e === "placement" || P.has(e))) {
653
+ if (this._isOpen && (e === "placement" || D.has(e))) {
651
654
  this._syncMenuPresentation(), this._schedulePanelSync();
652
655
  return;
653
656
  }
654
- this._isOpen && F.has(e) && this._syncMenuA11y();
657
+ this._isOpen && L.has(e) && this._syncMenuA11y();
655
658
  }
656
659
  }
657
660
  }
@@ -783,7 +786,7 @@ class L extends _ {
783
786
  _syncTriggerA11y() {
784
787
  const e = this._getTrigger();
785
788
  if (!e) return;
786
- const t = x(e);
789
+ const t = k(e);
787
790
  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
791
  t.setAttribute("aria-disabled", "true"), t.setAttribute("tabindex", "-1");
789
792
  return;
@@ -795,7 +798,7 @@ class L extends _ {
795
798
  if (!e) return;
796
799
  e.replaceChildren();
797
800
  const t = this._getContentSource();
798
- if (t && e.appendChild(T(t)), !e.querySelector(l)) {
801
+ if (t && e.appendChild(O(t)), !e.querySelector(l)) {
799
802
  const r = document.createElement("div");
800
803
  r.className = "empty-state", r.textContent = "No items", e.appendChild(r);
801
804
  }
@@ -830,11 +833,11 @@ class L extends _ {
830
833
  const e = this._getMenu();
831
834
  if (!e) return;
832
835
  const t = h() ? window.getComputedStyle(this) : null;
833
- t && D.forEach((c) => {
836
+ t && z.forEach((c) => {
834
837
  const m = t.getPropertyValue(c).trim();
835
838
  m ? e.style.setProperty(c, m) : e.style.removeProperty(c);
836
839
  });
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);
840
+ const r = p(this, "variant"), o = E(this.getAttribute("size") || this.getAttribute("density")), a = p(this, "density"), n = p(this, "shape"), u = p(this, "elevation"), s = p(this, "tone"), d = I(this.getAttribute("radius") || n || null);
838
841
  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) {
839
842
  e.style.setProperty("--ui-dropdown-radius", d), e.style.setProperty("--ui-dropdown-item-radius", d === "999px" ? "999px" : `max(0px, calc(${d} - 2px))`);
840
843
  return;
@@ -849,7 +852,7 @@ class L extends _ {
849
852
  }
850
853
  _syncControlState() {
851
854
  const e = this._panelEl, t = this._getMenu();
852
- !e || !t || (e.hidden = !this._isOpen, e.setAttribute("data-placement", this._placement));
855
+ !e || !t || (e.setAttribute("data-placement", this._placement), y(e, this._isOpen, String(this._placement).split("-")[0]));
853
856
  }
854
857
  _schedulePanelSync(e) {
855
858
  this._openFrame && cancelAnimationFrame(this._openFrame), this._openFrame = requestAnimationFrame(() => {
@@ -873,7 +876,7 @@ class L extends _ {
873
876
  return e === "top" ? r.top - 12 : o - r.bottom - 12;
874
877
  }
875
878
  _resolvePlacement() {
876
- const e = A(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
879
+ const e = C(this.getAttribute("placement")), t = this._getTrigger(), r = this._getMenu();
877
880
  if (!t || !r || !h()) return e;
878
881
  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);
879
882
  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";
@@ -884,7 +887,7 @@ class L extends _ {
884
887
  _setActiveItem(e, t = {}) {
885
888
  if (this._clearActiveItem(), !!e && (e.setAttribute("data-active", "true"), t.focus && g(e), t.scroll)) {
886
889
  const r = this._getMenu();
887
- r && I(e, r);
890
+ r && M(e, r);
888
891
  }
889
892
  }
890
893
  _focusFirstItem() {
@@ -898,7 +901,7 @@ class L extends _ {
898
901
  _moveFocus(e) {
899
902
  const t = this._queryItems(!0);
900
903
  if (!t.length) return;
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);
904
+ 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 = P(t, o, e);
902
905
  if (a >= 0) {
903
906
  this._setActiveItem(t[a], { focus: !0, scroll: !0 });
904
907
  return;
@@ -915,7 +918,7 @@ class L extends _ {
915
918
  if (!this.typeahead || !this._isTypeaheadKey(e)) return !1;
916
919
  const t = e.key.toLowerCase();
917
920
  this._typeaheadBuffer = `${this._typeaheadBuffer}${t}`.slice(0, 24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), 460);
918
- const r = O(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
921
+ const r = F(this._queryItems(!0), this._typeaheadBuffer, this._currentFocusedItem());
919
922
  return r ? (this._setActiveItem(r, { focus: !0, scroll: !0 }), e.preventDefault(), !0) : !1;
920
923
  }
921
924
  _querySourceItems() {
@@ -1024,7 +1027,7 @@ class L extends _ {
1024
1027
  }
1025
1028
  render() {
1026
1029
  this.setContent(`
1027
- <style>${k}</style>
1030
+ <style>${S}</style>
1028
1031
  <div class="root" part="root">
1029
1032
  <div class="trigger" part="trigger">
1030
1033
  <slot name="trigger"></slot>
@@ -1049,7 +1052,7 @@ class L extends _ {
1049
1052
  return !1;
1050
1053
  }
1051
1054
  }
1052
- typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown", L);
1055
+ typeof customElements < "u" && !customElements.get("ui-dropdown") && customElements.define("ui-dropdown", H);
1053
1056
  export {
1054
- L as UIDropdown
1057
+ H as UIDropdown
1055
1058
  };
@@ -2,18 +2,19 @@
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));
5
- --ui-empty-border: 1px dashed color-mix(in srgb, var(--ui-color-border, rgba(51, 65, 85, 0.28)) 88%, transparent);
6
- --ui-empty-radius: 16px;
5
+ --ui-empty-border: 1px dashed var(--ui-color-line, color-mix(in srgb, var(--ui-color-border, rgba(51, 65, 85, 0.28)) 88%, transparent));
6
+ --ui-empty-radius: calc(var(--ui-radius, 6px) + 4px);
7
7
  --ui-empty-padding: 28px;
8
8
  --ui-empty-title: var(--ui-color-text, #0f172a);
9
- --ui-empty-description: var(--ui-color-muted, #526175);
9
+ --ui-empty-description: var(--ui-color-text-secondary, var(--ui-color-muted, #526175));
10
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
- --ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
14
- --ui-empty-action-border: color-mix(in srgb, var(--ui-color-primary, #2563eb) 36%, transparent);
15
- --ui-empty-action-color: var(--ui-color-primary, #1d4ed8);
16
- --ui-empty-action-bg-hover: color-mix(in srgb, var(--ui-color-primary, #2563eb) 22%, transparent);
13
+ /* The default action is a primary button: a solid fill with the theme's text colour on it. */
14
+ --ui-empty-action-bg: var(--ui-color-primary, #2563eb);
15
+ --ui-empty-action-border: transparent;
16
+ --ui-empty-action-color: var(--ui-color-foreground-on-primary, #ffffff);
17
+ --ui-empty-action-bg-hover: color-mix(in srgb, var(--ui-color-primary, #2563eb) 88%, var(--ui-color-text-strong, #0f172a));
17
18
  color-scheme: light dark;
18
19
  }
19
20
 
@@ -71,10 +72,11 @@
71
72
  border: 1px solid var(--ui-empty-action-border);
72
73
  background: var(--ui-empty-action-bg);
73
74
  color: var(--ui-empty-action-color);
74
- border-radius: 10px;
75
- padding: 8px 12px;
76
- font-size: 13px;
77
- font-weight: 600;
75
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
76
+ min-height: var(--ui-control-height-2, 32px);
77
+ padding: 0 12px;
78
+ font-size: var(--ui-control-font-size-2, 14px);
79
+ font-weight: 500;
78
80
  cursor: pointer;
79
81
  }
80
82
 
@@ -149,21 +151,21 @@
149
151
  border-color: Highlight;
150
152
  }
151
153
  }
152
- `;function e(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class n extends a.ElementBase{constructor(){super(),this._actionBtn=null,this._onActionClick=this._onActionClick.bind(this)}static get observedAttributes(){return["title","description","action-label","tone","compact","headless"]}disconnectedCallback(){this._actionBtn&&(this._actionBtn.removeEventListener("click",this._onActionClick),this._actionBtn=null),super.disconnectedCallback()}_onActionClick(){this.dispatchEvent(new CustomEvent("action",{bubbles:!0}))}render(){this._actionBtn&&(this._actionBtn.removeEventListener("click",this._onActionClick),this._actionBtn=null);const o=this.getAttribute("title")||"No results found",r=this.getAttribute("description")||"Try adjusting your filters or creating a new record.",t=this.getAttribute("action-label")||"";this.setContent(`
154
+ `;function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class n extends a.ElementBase{constructor(){super(),this._actionBtn=null,this._onActionClick=this._onActionClick.bind(this)}static get observedAttributes(){return["title","description","action-label","tone","compact","headless"]}disconnectedCallback(){this._actionBtn&&(this._actionBtn.removeEventListener("click",this._onActionClick),this._actionBtn=null),super.disconnectedCallback()}_onActionClick(){this.dispatchEvent(new CustomEvent("action",{bubbles:!0}))}render(){this._actionBtn&&(this._actionBtn.removeEventListener("click",this._onActionClick),this._actionBtn=null);const o=this.getAttribute("title")||"No results found",r=this.getAttribute("description")||"Try adjusting your filters or creating a new record.",t=this.getAttribute("action-label")||"";this.setContent(`
153
155
  <style>${c}</style>
154
156
  <section class="card" role="status" aria-live="polite">
155
157
  <div class="icon" part="icon" aria-hidden="true">
156
158
  <slot name="icon">i</slot>
157
159
  </div>
158
160
  <h3 class="title" part="title">
159
- <slot name="title">${e(o)}</slot>
161
+ <slot name="title">${i(o)}</slot>
160
162
  </h3>
161
163
  <p class="description" part="description">
162
- <slot name="description">${e(r)}</slot>
164
+ <slot name="description">${i(r)}</slot>
163
165
  </p>
164
166
  <div class="actions" part="actions">
165
167
  <slot name="actions"></slot>
166
- ${t?`<button type="button" class="default-action">${e(t)}</button>`:""}
168
+ ${t?`<button type="button" class="default-action">${i(t)}</button>`:""}
167
169
  </div>
168
170
  </section>
169
171
  `),this._actionBtn=this.root.querySelector(".default-action"),this._actionBtn&&this._actionBtn.addEventListener("click",this._onActionClick)}shouldRenderOnAttributeChange(o,r,t){return!0}}typeof customElements<"u"&&!customElements.get("ui-empty-state")&&customElements.define("ui-empty-state",n);exports.UIEmptyState=n;
@@ -3,18 +3,19 @@ const a = `
3
3
  :host {
4
4
  display: block;
5
5
  --ui-empty-bg: linear-gradient(180deg, var(--ui-color-surface, #ffffff), var(--ui-color-surface-alt, #f8fafc));
6
- --ui-empty-border: 1px dashed color-mix(in srgb, var(--ui-color-border, rgba(51, 65, 85, 0.28)) 88%, transparent);
7
- --ui-empty-radius: 16px;
6
+ --ui-empty-border: 1px dashed var(--ui-color-line, color-mix(in srgb, var(--ui-color-border, rgba(51, 65, 85, 0.28)) 88%, transparent));
7
+ --ui-empty-radius: calc(var(--ui-radius, 6px) + 4px);
8
8
  --ui-empty-padding: 28px;
9
9
  --ui-empty-title: var(--ui-color-text, #0f172a);
10
- --ui-empty-description: var(--ui-color-muted, #526175);
10
+ --ui-empty-description: var(--ui-color-text-secondary, var(--ui-color-muted, #526175));
11
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
- --ui-empty-action-bg: color-mix(in srgb, var(--ui-color-primary, #2563eb) 14%, transparent);
15
- --ui-empty-action-border: color-mix(in srgb, var(--ui-color-primary, #2563eb) 36%, transparent);
16
- --ui-empty-action-color: var(--ui-color-primary, #1d4ed8);
17
- --ui-empty-action-bg-hover: color-mix(in srgb, var(--ui-color-primary, #2563eb) 22%, transparent);
14
+ /* The default action is a primary button: a solid fill with the theme's text colour on it. */
15
+ --ui-empty-action-bg: var(--ui-color-primary, #2563eb);
16
+ --ui-empty-action-border: transparent;
17
+ --ui-empty-action-color: var(--ui-color-foreground-on-primary, #ffffff);
18
+ --ui-empty-action-bg-hover: color-mix(in srgb, var(--ui-color-primary, #2563eb) 88%, var(--ui-color-text-strong, #0f172a));
18
19
  color-scheme: light dark;
19
20
  }
20
21
 
@@ -72,10 +73,11 @@ const a = `
72
73
  border: 1px solid var(--ui-empty-action-border);
73
74
  background: var(--ui-empty-action-bg);
74
75
  color: var(--ui-empty-action-color);
75
- border-radius: 10px;
76
- padding: 8px 12px;
77
- font-size: 13px;
78
- font-weight: 600;
76
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
77
+ min-height: var(--ui-control-height-2, 32px);
78
+ padding: 0 12px;
79
+ font-size: var(--ui-control-font-size-2, 14px);
80
+ font-weight: 500;
79
81
  cursor: pointer;
80
82
  }
81
83
 
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-DxbvhLJs.js"),u=`
2
2
  :host {
3
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
3
+ --ui-field-error-color: var(--ui-color-danger-text, 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-BeZT54Hj.mjs";
2
2
  const l = `
3
3
  :host {
4
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
4
+ --ui-field-error-color: var(--ui-color-danger-text, 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;
@@ -76,8 +76,8 @@ function u(e, r) {
76
76
  function c(e) {
77
77
  return Array.from(new Set(e.filter(Boolean)));
78
78
  }
79
- function a(e, r, i, t) {
80
- const o = (e.getAttribute(r) || "").split(/\s+/).filter(Boolean), s = t ? c([...o, i]) : o.filter((n) => n !== i);
79
+ function a(e, r, t, i) {
80
+ const o = (e.getAttribute(r) || "").split(/\s+/).filter(Boolean), s = i ? c([...o, t]) : o.filter((n) => n !== t);
81
81
  s.length ? e.setAttribute(r, s.join(" ")) : e.removeAttribute(r);
82
82
  }
83
83
  class f extends d {
@@ -93,8 +93,8 @@ class f extends d {
93
93
  disconnectedCallback() {
94
94
  this._clearAssociation(), super.disconnectedCallback();
95
95
  }
96
- attributeChangedCallback(r, i, t) {
97
- i !== t && (r === "for" || r === "active" || r === "hidden") && this._syncAssociation();
96
+ attributeChangedCallback(r, t, i) {
97
+ t !== i && (r === "for" || r === "active" || r === "hidden") && this._syncAssociation();
98
98
  }
99
99
  render() {
100
100
  this.setContent(`
@@ -105,8 +105,8 @@ class f extends d {
105
105
  _resolveTarget() {
106
106
  const r = this.getAttribute("for");
107
107
  if (!r) return null;
108
- const i = this.getRootNode();
109
- return i instanceof Document || i instanceof ShadowRoot ? i.getElementById(r) : document.getElementById(r);
108
+ const t = this.getRootNode();
109
+ return t instanceof Document || t instanceof ShadowRoot ? t.getElementById(r) : document.getElementById(r);
110
110
  }
111
111
  _clearAssociation() {
112
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;
package/dist/field.cjs.js CHANGED
@@ -2,14 +2,16 @@
2
2
  :host {
3
3
  --ui-field-gap: 8px;
4
4
  --ui-field-label-width: 192px;
5
- --ui-field-radius: 12px;
6
- --ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
5
+ --ui-field-radius: calc(var(--ui-radius, 6px) + 4px);
6
+ --ui-field-bg: transparent;
7
+ --ui-field-frame-padding: 0px;
8
+ --ui-field-density: 1;
7
9
  --ui-field-color: var(--ui-color-text, var(--ui-text, #0f172a));
8
10
  --ui-field-label-color: var(--ui-color-text, var(--ui-text, #0f172a));
9
11
  --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));
12
+ --ui-field-error-color: var(--ui-color-danger-text, var(--ui-color-danger, var(--ui-error, #c81e1e)));
11
13
  --ui-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
12
- --ui-field-border: 1px solid var(--ui-field-border-color);
14
+ --ui-field-border: 0;
13
15
  --ui-field-shadow:
14
16
  none;
15
17
  --ui-field-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
@@ -38,7 +40,7 @@
38
40
  border: var(--ui-field-border);
39
41
  border-radius: var(--ui-field-radius);
40
42
  box-shadow: var(--ui-field-shadow);
41
- padding: 12px;
43
+ padding: calc(var(--ui-field-frame-padding) * var(--ui-field-density));
42
44
  box-sizing: border-box;
43
45
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
44
46
  }
@@ -156,6 +158,16 @@
156
158
  --ui-field-shell-border-color: color-mix(in srgb, var(--ui-field-error-color) 56%, transparent);
157
159
  }
158
160
 
161
+ /* A plain field is flat: label, control and message with no box around them. These variants draw the box. */
162
+ :host([variant="surface"]),
163
+ :host([variant="outline"]),
164
+ :host([variant="soft"]),
165
+ :host([variant="contrast"]),
166
+ :host([variant="elevated"]) {
167
+ --ui-field-border: 1px solid var(--ui-field-border-color);
168
+ --ui-field-frame-padding: 12px;
169
+ }
170
+
159
171
  :host([variant="surface"]) {
160
172
  --ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
161
173
  --ui-field-shadow:
@@ -193,10 +205,7 @@
193
205
  --ui-field-bg: transparent;
194
206
  --ui-field-border: 0;
195
207
  --ui-field-shadow: none;
196
- }
197
-
198
- :host([variant="minimal"]) .frame {
199
- padding: 0;
208
+ --ui-field-frame-padding: 0px;
200
209
  }
201
210
 
202
211
  :host([variant="elevated"]) {
@@ -223,8 +232,8 @@
223
232
  --ui-field-gap: 6px;
224
233
  }
225
234
 
226
- :host([density="compact"]) .frame {
227
- padding: 9px;
235
+ :host([density="compact"]) {
236
+ --ui-field-density: 0.75;
228
237
  }
229
238
 
230
239
  :host([density="compact"]) .label {
@@ -240,8 +249,8 @@
240
249
  --ui-field-gap: 10px;
241
250
  }
242
251
 
243
- :host([density="comfortable"]) .frame {
244
- padding: 15px;
252
+ :host([density="comfortable"]) {
253
+ --ui-field-density: 1.25;
245
254
  }
246
255
 
247
256
  :host([density="comfortable"]) .label {
@@ -370,7 +379,7 @@
370
379
  box-shadow: none;
371
380
  }
372
381
  }
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(`
382
+ `;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"),v=this.root.querySelector(".actions"),u=this.root.querySelector(".description"),m=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","")),v&&(d?v.removeAttribute("hidden"):v.setAttribute("hidden","")),u&&(h?u.removeAttribute("hidden"):u.setAttribute("hidden","")),m&&(b?m.removeAttribute("hidden"):m.setAttribute("hidden",""));const T=t?t.assignedNodes({flatten:!0}).map(f=>f.textContent||"").join(" "):"",s=f=>f.replace(/\s+/g," ").trim(),q=f=>f?f.assignedNodes({flatten:!0}).map($=>$.textContent||"").join(" "):"",B=h?s(a||q(l)):"",R=b?s(y||q(o)):"";this._syncControlA11y(n,s(e||T),[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,v=b||E||p||g||!!(c&&c.length>0);t&&i&&!v?(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 m=e.hasAttribute("aria-description")&&!e.hasAttribute(S);l&&!m?(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
383
  <style>${N}</style>
375
384
  <div class="frame" part="field">
376
385
  <div class="meta" part="meta">
package/dist/field.esm.js CHANGED
@@ -3,14 +3,16 @@ const N = `
3
3
  :host {
4
4
  --ui-field-gap: 8px;
5
5
  --ui-field-label-width: 192px;
6
- --ui-field-radius: 12px;
7
- --ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
6
+ --ui-field-radius: calc(var(--ui-radius, 6px) + 4px);
7
+ --ui-field-bg: transparent;
8
+ --ui-field-frame-padding: 0px;
9
+ --ui-field-density: 1;
8
10
  --ui-field-color: var(--ui-color-text, var(--ui-text, #0f172a));
9
11
  --ui-field-label-color: var(--ui-color-text, var(--ui-text, #0f172a));
10
12
  --ui-field-description-color: var(--ui-color-muted, var(--ui-muted, #526175));
11
- --ui-field-error-color: var(--ui-color-danger, var(--ui-error, #c81e1e));
13
+ --ui-field-error-color: var(--ui-color-danger-text, var(--ui-color-danger, var(--ui-error, #c81e1e)));
12
14
  --ui-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
13
- --ui-field-border: 1px solid var(--ui-field-border-color);
15
+ --ui-field-border: 0;
14
16
  --ui-field-shadow:
15
17
  none;
16
18
  --ui-field-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
@@ -39,7 +41,7 @@ const N = `
39
41
  border: var(--ui-field-border);
40
42
  border-radius: var(--ui-field-radius);
41
43
  box-shadow: var(--ui-field-shadow);
42
- padding: 12px;
44
+ padding: calc(var(--ui-field-frame-padding) * var(--ui-field-density));
43
45
  box-sizing: border-box;
44
46
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
45
47
  }
@@ -157,6 +159,16 @@ const N = `
157
159
  --ui-field-shell-border-color: color-mix(in srgb, var(--ui-field-error-color) 56%, transparent);
158
160
  }
159
161
 
162
+ /* A plain field is flat: label, control and message with no box around them. These variants draw the box. */
163
+ :host([variant="surface"]),
164
+ :host([variant="outline"]),
165
+ :host([variant="soft"]),
166
+ :host([variant="contrast"]),
167
+ :host([variant="elevated"]) {
168
+ --ui-field-border: 1px solid var(--ui-field-border-color);
169
+ --ui-field-frame-padding: 12px;
170
+ }
171
+
160
172
  :host([variant="surface"]) {
161
173
  --ui-field-bg: var(--ui-color-surface, var(--ui-surface, #ffffff));
162
174
  --ui-field-shadow:
@@ -194,10 +206,7 @@ const N = `
194
206
  --ui-field-bg: transparent;
195
207
  --ui-field-border: 0;
196
208
  --ui-field-shadow: none;
197
- }
198
-
199
- :host([variant="minimal"]) .frame {
200
- padding: 0;
209
+ --ui-field-frame-padding: 0px;
201
210
  }
202
211
 
203
212
  :host([variant="elevated"]) {
@@ -224,8 +233,8 @@ const N = `
224
233
  --ui-field-gap: 6px;
225
234
  }
226
235
 
227
- :host([density="compact"]) .frame {
228
- padding: 9px;
236
+ :host([density="compact"]) {
237
+ --ui-field-density: 0.75;
229
238
  }
230
239
 
231
240
  :host([density="compact"]) .label {
@@ -241,8 +250,8 @@ const N = `
241
250
  --ui-field-gap: 10px;
242
251
  }
243
252
 
244
- :host([density="comfortable"]) .frame {
245
- padding: 15px;
253
+ :host([density="comfortable"]) {
254
+ --ui-field-density: 1.25;
246
255
  }
247
256
 
248
257
  :host([density="comfortable"]) .label {
@@ -481,12 +490,12 @@ class M extends $ {
481
490
  return o && x(o) ? (this._controlCache = o, o) : null;
482
491
  }
483
492
  _syncDerivedState() {
484
- 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");
485
- 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", ""));
486
- 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((B) => B.textContent || "").join(" ") : "", I = h ? s(a || T(l)) : "", R = b ? s(y || T(o)) : "";
493
+ 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"), v = this.root.querySelector(".actions"), u = this.root.querySelector(".description"), m = this.root.querySelector(".error");
494
+ c && (w ? c.removeAttribute("hidden") : c.setAttribute("hidden", "")), p && (E ? p.removeAttribute("hidden") : p.setAttribute("hidden", "")), g && (n ? g.removeAttribute("hidden") : g.setAttribute("hidden", "")), v && (d ? v.removeAttribute("hidden") : v.setAttribute("hidden", "")), u && (h ? u.removeAttribute("hidden") : u.setAttribute("hidden", "")), m && (b ? m.removeAttribute("hidden") : m.setAttribute("hidden", ""));
495
+ const T = t ? t.assignedNodes({ flatten: !0 }).map((f) => f.textContent || "").join(" ") : "", s = (f) => f.replace(/\s+/g, " ").trim(), q = (f) => f ? f.assignedNodes({ flatten: !0 }).map((B) => B.textContent || "").join(" ") : "", I = h ? s(a || q(l)) : "", R = b ? s(y || q(o)) : "";
487
496
  this._syncControlA11y(
488
497
  n,
489
- s(e || q),
498
+ s(e || T),
490
499
  [I, R].filter(Boolean).join(" "),
491
500
  b
492
501
  );
@@ -496,14 +505,14 @@ class M extends $ {
496
505
  if (!e) return;
497
506
  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);
498
507
  w.length ? e.setAttribute("aria-labelledby", w.join(" ")) : e.removeAttribute("aria-labelledby");
499
- 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);
500
- t && i && !m ? (e.setAttribute("aria-label", i), e.setAttribute(_, "")) : e.hasAttribute(_) && (e.removeAttribute("aria-label"), e.removeAttribute(_));
508
+ const E = e.hasAttribute("aria-label") && !e.hasAttribute(_), c = e.labels, p = (e.getAttribute("label") || "").trim().length > 0, g = (e.textContent || "").trim().length > 0, v = b || E || p || g || !!(c && c.length > 0);
509
+ t && i && !v ? (e.setAttribute("aria-label", i), e.setAttribute(_, "")) : e.hasAttribute(_) && (e.removeAttribute("aria-label"), e.removeAttribute(_));
501
510
  const u = k(
502
511
  (e.getAttribute("aria-describedby") || "").split(/\s+/).filter((s) => s && s !== y && s !== n)
503
512
  );
504
513
  u.length ? e.setAttribute("aria-describedby", u.join(" ")) : e.removeAttribute("aria-describedby");
505
- const v = e.hasAttribute("aria-description") && !e.hasAttribute(S);
506
- 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");
514
+ const m = e.hasAttribute("aria-description") && !e.hasAttribute(S);
515
+ l && !m ? (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");
507
516
  }
508
517
  render() {
509
518
  const t = this.getAttribute("label") || "", i = this.getAttribute("description") || "", l = this.getAttribute("error") || "", o = this.hasAttribute("required"), e = this.getAttribute("for") || "";