@editora/ui-core 0.2.1 → 0.3.0

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 (365) hide show
  1. package/dist/{ElementBase-DxbvhLJs.js → ElementBase-CbUsP3D6.js} +1 -1
  2. package/dist/{ElementBase-BeZT54Hj.mjs → ElementBase-D5QsC5Vw.mjs} +10 -1
  3. package/dist/ElementBase.d.ts +7 -0
  4. package/dist/ElementBase.d.ts.map +1 -1
  5. package/dist/accordion.cjs.js +1 -1
  6. package/dist/accordion.esm.js +1 -1
  7. package/dist/add-icons-CVeHOsWl.js +1 -0
  8. package/dist/add-icons-DBUZJ0g7.mjs +14 -0
  9. package/dist/add-icons.cjs.js +1 -0
  10. package/dist/add-icons.d.ts +16 -0
  11. package/dist/add-icons.d.ts.map +1 -0
  12. package/dist/add-icons.esm.js +4 -0
  13. package/dist/alert-dialog.cjs.js +24 -24
  14. package/dist/alert-dialog.esm.js +112 -107
  15. package/dist/alert.cjs.js +8 -8
  16. package/dist/alert.esm.js +22 -22
  17. package/dist/animated-beam.cjs.js +1 -1
  18. package/dist/animated-beam.esm.js +1 -1
  19. package/dist/animated-list.cjs.js +1 -1
  20. package/dist/animated-list.esm.js +1 -1
  21. package/dist/animated-text.cjs.js +1 -1
  22. package/dist/animated-text.esm.js +1 -1
  23. package/dist/app-header.cjs.js +15 -3
  24. package/dist/app-header.esm.js +31 -4
  25. package/dist/aspect-ratio.cjs.js +1 -1
  26. package/dist/aspect-ratio.esm.js +1 -1
  27. package/dist/avatar.cjs.js +1 -1
  28. package/dist/avatar.esm.js +1 -1
  29. package/dist/badge.cjs.js +1 -1
  30. package/dist/badge.esm.js +1 -1
  31. package/dist/block-controls.cjs.js +1 -1
  32. package/dist/block-controls.esm.js +1 -1
  33. package/dist/box.cjs.js +1 -1
  34. package/dist/box.esm.js +1 -1
  35. package/dist/breadcrumb.cjs.js +4 -4
  36. package/dist/breadcrumb.esm.js +93 -84
  37. package/dist/button.cjs.js +520 -1
  38. package/dist/button.esm.js +682 -2
  39. package/dist/{calendar-CzpWDxLc.js → calendar-BsVqtpjM.js} +6 -6
  40. package/dist/{calendar-DkSDFg33.mjs → calendar-CFafqZVA.mjs} +6 -6
  41. package/dist/calendar.cjs.js +1 -1
  42. package/dist/calendar.esm.js +1 -1
  43. package/dist/card.cjs.js +6 -5
  44. package/dist/card.esm.js +52 -39
  45. package/dist/chart.cjs.js +2 -2
  46. package/dist/chart.esm.js +2 -2
  47. package/dist/checkbox.cjs.js +4 -4
  48. package/dist/checkbox.esm.js +36 -15
  49. package/dist/clone-source-BxK2pEVw.mjs +11 -0
  50. package/dist/clone-source-C7E_ri5f.js +1 -0
  51. package/dist/collapsible.cjs.js +1 -1
  52. package/dist/collapsible.esm.js +1 -1
  53. package/dist/color-picker.cjs.js +2 -2
  54. package/dist/color-picker.esm.js +3 -3
  55. package/dist/combobox.cjs.js +4 -4
  56. package/dist/combobox.esm.js +22 -19
  57. package/dist/command-palette.cjs.js +1 -1
  58. package/dist/command-palette.esm.js +1 -1
  59. package/dist/command.cjs.js +1 -1
  60. package/dist/command.esm.js +1 -1
  61. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  62. package/dist/components/ui-alert.d.ts.map +1 -1
  63. package/dist/components/ui-app-header.d.ts +1 -0
  64. package/dist/components/ui-app-header.d.ts.map +1 -1
  65. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  66. package/dist/components/ui-card.d.ts +7 -0
  67. package/dist/components/ui-card.d.ts.map +1 -1
  68. package/dist/components/ui-checkbox.d.ts +6 -0
  69. package/dist/components/ui-checkbox.d.ts.map +1 -1
  70. package/dist/components/ui-combobox.d.ts.map +1 -1
  71. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  72. package/dist/components/ui-dialog.d.ts +1 -0
  73. package/dist/components/ui-dialog.d.ts.map +1 -1
  74. package/dist/components/ui-drawer.d.ts.map +1 -1
  75. package/dist/components/ui-dropdown.d.ts.map +1 -1
  76. package/dist/components/ui-empty-state.d.ts.map +1 -1
  77. package/dist/components/ui-hover-card.d.ts.map +1 -1
  78. package/dist/components/ui-icon.d.ts +1 -0
  79. package/dist/components/ui-icon.d.ts.map +1 -1
  80. package/dist/components/ui-input.d.ts +16 -0
  81. package/dist/components/ui-input.d.ts.map +1 -1
  82. package/dist/components/ui-layout.d.ts +20 -0
  83. package/dist/components/ui-layout.d.ts.map +1 -1
  84. package/dist/components/ui-menu.d.ts +1 -0
  85. package/dist/components/ui-menu.d.ts.map +1 -1
  86. package/dist/components/ui-menubar.d.ts.map +1 -1
  87. package/dist/components/ui-multi-select.d.ts +6 -0
  88. package/dist/components/ui-multi-select.d.ts.map +1 -1
  89. package/dist/components/ui-number-field.d.ts +6 -0
  90. package/dist/components/ui-number-field.d.ts.map +1 -1
  91. package/dist/components/ui-pagination.d.ts.map +1 -1
  92. package/dist/components/ui-password-field.d.ts +11 -0
  93. package/dist/components/ui-password-field.d.ts.map +1 -1
  94. package/dist/components/ui-popover.d.ts.map +1 -1
  95. package/dist/components/ui-positioner.d.ts.map +1 -1
  96. package/dist/components/ui-radio-group.d.ts +6 -0
  97. package/dist/components/ui-radio-group.d.ts.map +1 -1
  98. package/dist/components/ui-rating.d.ts +1 -0
  99. package/dist/components/ui-rating.d.ts.map +1 -1
  100. package/dist/components/ui-select.d.ts +7 -0
  101. package/dist/components/ui-select.d.ts.map +1 -1
  102. package/dist/components/ui-sidebar.d.ts +1 -0
  103. package/dist/components/ui-sidebar.d.ts.map +1 -1
  104. package/dist/components/ui-slider.d.ts +6 -0
  105. package/dist/components/ui-slider.d.ts.map +1 -1
  106. package/dist/components/ui-sortable.d.ts +1 -0
  107. package/dist/components/ui-sortable.d.ts.map +1 -1
  108. package/dist/components/ui-switch.d.ts +6 -0
  109. package/dist/components/ui-switch.d.ts.map +1 -1
  110. package/dist/components/ui-tabs.d.ts +2 -0
  111. package/dist/components/ui-tabs.d.ts.map +1 -1
  112. package/dist/components/ui-textarea.d.ts +6 -0
  113. package/dist/components/ui-textarea.d.ts.map +1 -1
  114. package/dist/components/ui-toast.d.ts.map +1 -1
  115. package/dist/components/ui-tooltip.d.ts.map +1 -1
  116. package/dist/container.cjs.js +1 -1
  117. package/dist/container.esm.js +1 -1
  118. package/dist/context-menu.cjs.js +2 -2
  119. package/dist/context-menu.esm.js +2 -2
  120. package/dist/control-group.cjs.js +1 -1
  121. package/dist/control-group.esm.js +1 -1
  122. package/dist/data-table.cjs.js +5 -5
  123. package/dist/data-table.esm.js +7 -7
  124. package/dist/date-field.cjs.js +1 -1
  125. package/dist/date-field.esm.js +3 -3
  126. package/dist/date-picker.cjs.js +2 -2
  127. package/dist/date-picker.esm.js +17 -17
  128. package/dist/date-range-picker.cjs.js +2 -2
  129. package/dist/date-range-picker.esm.js +4 -4
  130. package/dist/date-range-time-picker.cjs.js +3 -3
  131. package/dist/date-range-time-picker.esm.js +16 -16
  132. package/dist/date-time-picker.cjs.js +26 -23
  133. package/dist/date-time-picker.esm.js +49 -46
  134. package/dist/{date-time-utils-zAx4ghvC.mjs → date-time-utils-CJUksWj3.mjs} +1 -1
  135. package/dist/{date-time-utils-C-4eHTyy.js → date-time-utils-D3hQQ5Om.js} +1 -1
  136. package/dist/description.cjs.js +1 -1
  137. package/dist/description.esm.js +1 -1
  138. package/dist/dialog.cjs.js +7 -7
  139. package/dist/dialog.esm.js +51 -47
  140. package/dist/direction-provider.cjs.js +1 -1
  141. package/dist/direction-provider.esm.js +1 -1
  142. package/dist/dismissable-layer.cjs.js +1 -1
  143. package/dist/dismissable-layer.esm.js +1 -1
  144. package/dist/dock.cjs.js +1 -1
  145. package/dist/dock.esm.js +1 -1
  146. package/dist/drawer.cjs.js +5 -5
  147. package/dist/drawer.esm.js +18 -17
  148. package/dist/dropdown.cjs.js +7 -7
  149. package/dist/dropdown.esm.js +39 -38
  150. package/dist/empty-state.cjs.js +12 -2
  151. package/dist/empty-state.esm.js +17 -7
  152. package/dist/field-error.cjs.js +1 -1
  153. package/dist/field-error.esm.js +1 -1
  154. package/dist/field.cjs.js +2 -2
  155. package/dist/field.esm.js +2 -2
  156. package/dist/fieldset.cjs.js +1 -1
  157. package/dist/fieldset.esm.js +1 -1
  158. package/dist/file-upload.cjs.js +1 -1
  159. package/dist/file-upload.esm.js +1 -1
  160. package/dist/flex.cjs.js +1 -1
  161. package/dist/flex.esm.js +1 -1
  162. package/dist/floating-toolbar.cjs.js +2 -2
  163. package/dist/floating-toolbar.esm.js +2 -2
  164. package/dist/focus-scope-Dl0qk5GP.mjs +177 -0
  165. package/dist/focus-scope-Doz0bnE1.js +1 -0
  166. package/dist/focus-scope.cjs.js +1 -1
  167. package/dist/focus-scope.esm.js +2 -2
  168. package/dist/form-control-B90_3kYN.js +1 -0
  169. package/dist/form-control-D9wWUMBl.mjs +86 -0
  170. package/dist/form.cjs.js +2 -2
  171. package/dist/form.esm.js +2 -2
  172. package/dist/gantt.cjs.js +2 -2
  173. package/dist/gantt.esm.js +2 -2
  174. package/dist/grid.cjs.js +1 -1
  175. package/dist/grid.esm.js +1 -1
  176. package/dist/hover-card.cjs.js +5 -5
  177. package/dist/hover-card.esm.js +19 -18
  178. package/dist/icon-cloud.cjs.js +1 -1
  179. package/dist/icon-cloud.esm.js +1 -1
  180. package/dist/icon.cjs.js +207 -1
  181. package/dist/icon.esm.js +294 -2
  182. package/dist/icons-CpCpPXV5.js +1 -0
  183. package/dist/icons-DWYbbhb0.mjs +115 -0
  184. package/dist/icons.d.ts +11 -1
  185. package/dist/icons.d.ts.map +1 -1
  186. package/dist/implicit-submit-B6M5Uc56.js +1 -0
  187. package/dist/implicit-submit-Lr0-q2LR.mjs +44 -0
  188. package/dist/index.cjs.js +1 -1
  189. package/dist/index.d.ts +1 -0
  190. package/dist/index.d.ts.map +1 -1
  191. package/dist/index.esm.js +309 -299
  192. package/dist/inline-edit.cjs.js +1 -1
  193. package/dist/inline-edit.esm.js +1 -1
  194. package/dist/input.cjs.js +62 -20
  195. package/dist/input.esm.js +164 -58
  196. package/dist/label.cjs.js +1 -1
  197. package/dist/label.esm.js +1 -1
  198. package/dist/layout.cjs.js +145 -4
  199. package/dist/layout.esm.js +278 -40
  200. package/dist/marquee.cjs.js +1 -1
  201. package/dist/marquee.esm.js +1 -1
  202. package/dist/masonry-grid.cjs.js +1 -1
  203. package/dist/masonry-grid.esm.js +1 -1
  204. package/dist/menu.cjs.js +8 -8
  205. package/dist/menu.esm.js +51 -47
  206. package/dist/menubar.cjs.js +9 -9
  207. package/dist/menubar.esm.js +41 -40
  208. package/dist/meter.cjs.js +1 -1
  209. package/dist/meter.esm.js +1 -1
  210. package/dist/multi-select.cjs.js +7 -7
  211. package/dist/multi-select.esm.js +55 -34
  212. package/dist/navigate-CXebafwF.mjs +18 -0
  213. package/dist/navigate-ChJVIIuS.js +1 -0
  214. package/dist/navigation-menu.cjs.js +1 -1
  215. package/dist/navigation-menu.esm.js +1 -1
  216. package/dist/number-attribute-BAF07JrU.mjs +8 -0
  217. package/dist/number-attribute-C4Rrl7d3.js +1 -0
  218. package/dist/number-field.cjs.js +8 -8
  219. package/dist/number-field.esm.js +90 -69
  220. package/dist/number-ticker.cjs.js +1 -1
  221. package/dist/number-ticker.esm.js +1 -1
  222. package/dist/odometer.cjs.js +1 -1
  223. package/dist/odometer.esm.js +1 -1
  224. package/dist/orbiter.cjs.js +1 -1
  225. package/dist/orbiter.esm.js +1 -1
  226. package/dist/pagination.cjs.js +24 -23
  227. package/dist/pagination.esm.js +61 -46
  228. package/dist/{panel-group-BVHJEdfx.js → panel-group-BIzzpQ5i.js} +1 -1
  229. package/dist/{panel-group-BxO_eNW6.mjs → panel-group-CFLjzRWI.mjs} +1 -1
  230. package/dist/panel-group.cjs.js +1 -1
  231. package/dist/panel-group.esm.js +1 -1
  232. package/dist/panel.cjs.js +1 -1
  233. package/dist/panel.esm.js +1 -1
  234. package/dist/password-field.cjs.js +36 -16
  235. package/dist/password-field.esm.js +113 -44
  236. package/dist/pin-input.cjs.js +1 -1
  237. package/dist/pin-input.esm.js +1 -1
  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 +2 -2
  243. package/dist/popover.esm.js +28 -26
  244. package/dist/portal.cjs.js +1 -1
  245. package/dist/portal.esm.js +1 -1
  246. package/dist/positioner.cjs.js +2 -2
  247. package/dist/positioner.esm.js +35 -38
  248. package/dist/preload.cjs.js +221 -0
  249. package/dist/preload.css +220 -0
  250. package/dist/preload.d.ts +17 -0
  251. package/dist/preload.d.ts.map +1 -0
  252. package/dist/preload.esm.js +224 -0
  253. package/dist/presence.cjs.js +1 -1
  254. package/dist/presence.esm.js +1 -1
  255. package/dist/primitives/clone-source.d.ts +3 -0
  256. package/dist/primitives/clone-source.d.ts.map +1 -0
  257. package/dist/primitives/focus-scope.d.ts +6 -0
  258. package/dist/primitives/focus-scope.d.ts.map +1 -1
  259. package/dist/primitives/form-control.d.ts +68 -0
  260. package/dist/primitives/form-control.d.ts.map +1 -0
  261. package/dist/primitives/implicit-submit.d.ts +17 -0
  262. package/dist/primitives/implicit-submit.d.ts.map +1 -0
  263. package/dist/primitives/navigate.d.ts +27 -0
  264. package/dist/primitives/navigate.d.ts.map +1 -0
  265. package/dist/primitives/number-attribute.d.ts +7 -0
  266. package/dist/primitives/number-attribute.d.ts.map +1 -0
  267. package/dist/primitives/slotted-input.d.ts +19 -0
  268. package/dist/primitives/slotted-input.d.ts.map +1 -0
  269. package/dist/progress.cjs.js +3 -3
  270. package/dist/progress.esm.js +3 -3
  271. package/dist/quick-actions.cjs.js +5 -5
  272. package/dist/quick-actions.esm.js +3 -3
  273. package/dist/radio-group.cjs.js +9 -9
  274. package/dist/radio-group.esm.js +47 -24
  275. package/dist/radio.cjs.js +1 -1
  276. package/dist/radio.esm.js +1 -1
  277. package/dist/rating.cjs.js +6 -6
  278. package/dist/rating.esm.js +21 -10
  279. package/dist/{runtime-BRT7E4A8.mjs → runtime-CORXjP7e.mjs} +379 -357
  280. package/dist/runtime-uCly3ECd.js +5 -0
  281. package/dist/runtime.cjs.js +1 -1
  282. package/dist/runtime.esm.js +1 -1
  283. package/dist/scroll-area.cjs.js +1 -1
  284. package/dist/scroll-area.esm.js +1 -1
  285. package/dist/section.cjs.js +1 -1
  286. package/dist/section.esm.js +1 -1
  287. package/dist/select.cjs.js +21 -21
  288. package/dist/select.esm.js +111 -71
  289. package/dist/selection-popup.cjs.js +2 -2
  290. package/dist/selection-popup.esm.js +2 -2
  291. package/dist/semantic-tokens.d.ts.map +1 -1
  292. package/dist/separator.cjs.js +1 -1
  293. package/dist/separator.esm.js +1 -1
  294. package/dist/sidebar.cjs.js +15 -15
  295. package/dist/sidebar.esm.js +48 -42
  296. package/dist/skeleton.cjs.js +1 -1
  297. package/dist/skeleton.esm.js +1 -1
  298. package/dist/slider.cjs.js +11 -11
  299. package/dist/slider.esm.js +40 -23
  300. package/dist/slot.cjs.js +1 -1
  301. package/dist/slot.esm.js +1 -1
  302. package/dist/slotted-input-BVq2QQg2.js +1 -0
  303. package/dist/slotted-input-atWznLfm.mjs +13 -0
  304. package/dist/sortable.cjs.js +25 -25
  305. package/dist/sortable.esm.js +29 -21
  306. package/dist/spinning-text.cjs.js +1 -1
  307. package/dist/spinning-text.esm.js +1 -1
  308. package/dist/split-button.cjs.js +1 -1
  309. package/dist/split-button.esm.js +1 -1
  310. package/dist/splitter.cjs.js +1 -1
  311. package/dist/splitter.esm.js +1 -1
  312. package/dist/standalone/add-icons.d.ts +2 -0
  313. package/dist/standalone/add-icons.d.ts.map +1 -0
  314. package/dist/standalone/preload.d.ts +2 -0
  315. package/dist/standalone/preload.d.ts.map +1 -0
  316. package/dist/stepper.cjs.js +3 -3
  317. package/dist/stepper.esm.js +3 -3
  318. package/dist/switch.cjs.js +9 -9
  319. package/dist/switch.esm.js +56 -35
  320. package/dist/table.cjs.js +1 -1
  321. package/dist/table.esm.js +1 -1
  322. package/dist/tabs.cjs.js +14 -14
  323. package/dist/tabs.esm.js +129 -115
  324. package/dist/tags-input.cjs.js +1 -1
  325. package/dist/tags-input.esm.js +1 -1
  326. package/dist/textarea.cjs.js +33 -11
  327. package/dist/textarea.esm.js +74 -35
  328. package/dist/theme.d.ts +6 -0
  329. package/dist/theme.d.ts.map +1 -1
  330. package/dist/time-field.cjs.js +1 -1
  331. package/dist/time-field.esm.js +2 -2
  332. package/dist/time-picker.cjs.js +1 -1
  333. package/dist/time-picker.esm.js +3 -3
  334. package/dist/timeline.cjs.js +2 -2
  335. package/dist/timeline.esm.js +2 -2
  336. package/dist/toast.cjs.js +4 -4
  337. package/dist/toast.esm.js +17 -16
  338. package/dist/toggle-group.cjs.js +1 -1
  339. package/dist/toggle-group.esm.js +1 -1
  340. package/dist/toggle.cjs.js +3 -3
  341. package/dist/toggle.esm.js +9 -9
  342. package/dist/toolbar.cjs.js +1 -1
  343. package/dist/toolbar.esm.js +1 -1
  344. package/dist/tooltip.cjs.js +2 -2
  345. package/dist/tooltip.esm.js +12 -14
  346. package/dist/transfer-list.cjs.js +1 -1
  347. package/dist/transfer-list.esm.js +1 -1
  348. package/dist/{tree-33fVNnaf.mjs → tree-CD2k2lIC.mjs} +1 -1
  349. package/dist/{tree-Dc02MChE.js → tree-ChQfhxya.js} +1 -1
  350. package/dist/tree-item.cjs.js +1 -1
  351. package/dist/tree-item.esm.js +1 -1
  352. package/dist/tree.cjs.js +1 -1
  353. package/dist/tree.esm.js +1 -1
  354. package/dist/visually-hidden.cjs.js +1 -1
  355. package/dist/visually-hidden.esm.js +1 -1
  356. package/dist/wizard.cjs.js +4 -4
  357. package/dist/wizard.esm.js +4 -4
  358. package/package.json +3 -2
  359. package/dist/focus-scope-Bwug2gDv.js +0 -1
  360. package/dist/focus-scope-CmEsG5UZ.mjs +0 -138
  361. package/dist/runtime-CXw4SGV9.js +0 -5
  362. package/dist/ui-button-C3OmI7Sn.mjs +0 -684
  363. package/dist/ui-button-CnLwXBnx.js +0 -520
  364. package/dist/ui-icon-D3avtxX_.js +0 -207
  365. package/dist/ui-icon-DLhB08Fo.mjs +0 -361
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-attribute.d.ts","sourceRoot":"","sources":["../../src/primitives/number-attribute.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI5E"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * "Bring your own input" for the text fields: `<input slot="input">` in the light DOM.
3
+ *
4
+ * Password managers and browser autofill look for real inputs in the document; one inside a shadow
5
+ * root is found unreliably, so sign-in forms could not be filled. With a slotted native input the
6
+ * component keeps its label, styling, clear and visibility buttons around it but uses that input as
7
+ * its control: it is an ordinary form field (name, autocomplete, FormData, Enter submits) that the
8
+ * component never renames or retypes.
9
+ */
10
+ export declare function findSlottedInput(host: HTMLElement): HTMLInputElement | null;
11
+ /**
12
+ * Names the slotted input after the component's label when it has no name of its own (a <label for>,
13
+ * aria-label or aria-labelledby). IDREFs into the shadow root cannot resolve from the light DOM, so
14
+ * the label text is copied; a description is copied into aria-description for the same reason.
15
+ */
16
+ export declare function nameSlottedInput(input: HTMLInputElement, label: string, description: string): void;
17
+ /** The component's inner-input rules, applied to a slotted input. */
18
+ export declare function slottedInputCss(inputRules: string): string;
19
+ //# sourceMappingURL=slotted-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slotted-input.d.ts","sourceRoot":"","sources":["../../src/primitives/slotted-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAK3E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAgBlG;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAM1D"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-DxbvhLJs.js"),m=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-CbUsP3D6.js"),m=`
2
2
  :host {
3
3
  display: block;
4
4
  width: 100%;
@@ -194,8 +194,8 @@
194
194
 
195
195
  :host([variant="contrast"]) {
196
196
  --ui-progress-bg: #1f2937;
197
- --ui-progress-fill: #93c5fd;
198
- --ui-progress-buffer: rgba(147, 197, 253, 0.36);
197
+ --ui-progress-fill: var(--ui-color-accent-on-dark, #93c5fd);
198
+ --ui-progress-buffer: color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 36%, transparent);
199
199
  --ui-progress-label: #e2e8f0;
200
200
  --ui-progress-track-border: 1px solid #334155;
201
201
  --ui-progress-fill-soft: var(--ui-progress-fill);
@@ -1,4 +1,4 @@
1
- import { E as g } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as g } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  const b = `
3
3
  :host {
4
4
  display: block;
@@ -195,8 +195,8 @@ const b = `
195
195
 
196
196
  :host([variant="contrast"]) {
197
197
  --ui-progress-bg: #1f2937;
198
- --ui-progress-fill: #93c5fd;
199
- --ui-progress-buffer: rgba(147, 197, 253, 0.36);
198
+ --ui-progress-fill: var(--ui-color-accent-on-dark, #93c5fd);
199
+ --ui-progress-buffer: color-mix(in srgb, var(--ui-color-accent-on-dark, #93c5fd) 36%, transparent);
200
200
  --ui-progress-label: #e2e8f0;
201
201
  --ui-progress-track-border: 1px solid #334155;
202
202
  --ui-progress-fill-soft: var(--ui-progress-fill);
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-DxbvhLJs.js"),h=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./ElementBase-CbUsP3D6.js"),h=`
2
2
  :host {
3
3
  --ui-quick-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
4
4
  --ui-quick-border: var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 76%, transparent));
@@ -110,8 +110,8 @@
110
110
  --ui-quick-border: #334155;
111
111
  --ui-quick-text: #e2e8f0;
112
112
  --ui-quick-muted: #93a4bd;
113
- --ui-quick-accent: #93c5fd;
114
- --ui-quick-focus: #93c5fd;
113
+ --ui-quick-accent: var(--ui-color-accent-on-dark, #93c5fd);
114
+ --ui-quick-focus: var(--ui-color-accent-on-dark, #93c5fd);
115
115
  }
116
116
 
117
117
  :host([variant="minimal"]) .root {
@@ -197,9 +197,9 @@
197
197
  border-color: Highlight;
198
198
  }
199
199
  }
200
- `;let p=0;function l(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class d extends b.ElementBase{constructor(){super(),this._instanceId=++p,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["open","mode","orientation","variant","floating","placement","collapsible","label","headless"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.getAttribute("mode")!=="fab"&&!this.hasAttribute("collapsible")&&!this.hasAttribute("open")&&this.setAttribute("open","")}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),super.disconnectedCallback()}attributeChangedCallback(e,o,t){if(o!==t){if(e==="open"){this._syncOpenUi();return}this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){const o=typeof e=="boolean"?e:!this.open;this.open=o;const t={open:o};this.dispatchEvent(new CustomEvent(o?"open":"close",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("toggle",{detail:t,bubbles:!0,composed:!0}))}_actions(){const e=this.root.querySelector('slot[name="action"]');return e?e.assignedElements({flatten:!0}).filter(o=>o instanceof HTMLElement):[]}_actionsId(){return`ui-quick-actions-${this._instanceId}-actions`}_syncActionAccessibility(e){this._actions().forEach((t,r)=>{if(t.id||(t.id=`ui-quick-actions-${this._instanceId}-action-${r+1}`),t.hasAttribute("role")||t.setAttribute("role","button"),!t.hasAttribute("aria-label")){const i=t.textContent?.trim();i&&t.setAttribute("aria-label",i)}if(e){const i=t.getAttribute("data-ui-quick-tabindex");i!=null?(i==="__none__"?t.removeAttribute("tabindex"):t.setAttribute("tabindex",i),t.removeAttribute("data-ui-quick-tabindex")):t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false");return}t.hasAttribute("data-ui-quick-tabindex")||t.setAttribute("data-ui-quick-tabindex",t.getAttribute("tabindex")??"__none__"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true")})}_onClick(e){const o=e.target;if(!o)return;if(o.closest(".toggle")){this.toggle();return}const r=e.composedPath(),i=this._actions(),s=i.find(n=>r.includes(n));if(!s)return;const a=i.indexOf(s),c={index:a,id:s.id||s.getAttribute("data-id")||String(a+1),label:s.getAttribute("aria-label")||s.textContent?.trim()||`Action ${a+1}`};this.dispatchEvent(new CustomEvent("select",{detail:c,bubbles:!0,composed:!0})),this.getAttribute("mode")==="fab"&&this.hide()}_moveFocus(e,o){const t=this._actions();if(!t.length)return;const r=t.indexOf(e);if(r<0)return;const i=(r+o+t.length)%t.length;t[i].focus()}_onKeyDown(e){if(e.key==="Escape"&&this.open&&this.getAttribute("mode")==="fab"){e.preventDefault(),this.hide();return}const o=e.target;if(!o)return;const r=this._actions().find(n=>n===o||n.contains(o));if(!r)return;const i=this.getAttribute("orientation")==="vertical"||this.getAttribute("mode")==="fab",s=!i&&getComputedStyle(this).direction==="rtl",a=i?"ArrowDown":s?"ArrowLeft":"ArrowRight",c=i?"ArrowUp":s?"ArrowRight":"ArrowLeft";if(e.key===a){e.preventDefault(),this._moveFocus(r,1);return}if(e.key===c){e.preventDefault(),this._moveFocus(r,-1);return}if(e.key==="Home"||e.key==="End"){e.preventDefault();const n=this._actions();if(!n.length)return;(e.key==="Home"?n[0]:n[n.length-1]).focus()}}_syncOpenUi(){if(!this.isConnected)return;if(!this.root.querySelector(".root")){this.requestRender();return}const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this.root.querySelector(".toggle");i&&(i.textContent=t?"−":"+",i.setAttribute("aria-label",r),i.setAttribute("aria-expanded",t?"true":"false"));const s=this.root.querySelector(".actions");s&&(t?s.removeAttribute("hidden"):s.setAttribute("hidden","")),this._syncActionAccessibility(t)}render(){const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this._actionsId(),s=this.getAttribute("orientation")==="vertical"||e==="fab"?"vertical":"horizontal";this.setContent(`
200
+ `;let p=0;function l(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}class d extends b.ElementBase{constructor(){super(),this._instanceId=++p,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["open","mode","orientation","variant","floating","placement","collapsible","label","headless"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.getAttribute("mode")!=="fab"&&!this.hasAttribute("collapsible")&&!this.hasAttribute("open")&&this.setAttribute("open","")}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),super.disconnectedCallback()}attributeChangedCallback(e,o,t){if(o!==t){if(e==="open"){this._syncOpenUi();return}this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(e){e?this.setAttribute("open",""):this.removeAttribute("open")}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){const o=typeof e=="boolean"?e:!this.open;this.open=o;const t={open:o};this.dispatchEvent(new CustomEvent(o?"open":"close",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("toggle",{detail:t,bubbles:!0,composed:!0}))}_actions(){const e=this.root.querySelector('slot[name="action"]');return e?e.assignedElements({flatten:!0}).filter(o=>o instanceof HTMLElement):[]}_actionsId(){return`ui-quick-actions-${this._instanceId}-actions`}_syncActionAccessibility(e){this._actions().forEach((t,r)=>{if(t.id||(t.id=`ui-quick-actions-${this._instanceId}-action-${r+1}`),t.hasAttribute("role")||t.setAttribute("role","button"),!t.hasAttribute("aria-label")){const i=t.textContent?.trim();i&&t.setAttribute("aria-label",i)}if(e){const i=t.getAttribute("data-ui-quick-tabindex");i!=null?(i==="__none__"?t.removeAttribute("tabindex"):t.setAttribute("tabindex",i),t.removeAttribute("data-ui-quick-tabindex")):t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false");return}t.hasAttribute("data-ui-quick-tabindex")||t.setAttribute("data-ui-quick-tabindex",t.getAttribute("tabindex")??"__none__"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true")})}_onClick(e){const o=e.target;if(!o)return;if(o.closest(".toggle")){this.toggle();return}const r=e.composedPath(),i=this._actions(),n=i.find(s=>r.includes(s));if(!n)return;const a=i.indexOf(n),c={index:a,id:n.id||n.getAttribute("data-id")||String(a+1),label:n.getAttribute("aria-label")||n.textContent?.trim()||`Action ${a+1}`};this.dispatchEvent(new CustomEvent("select",{detail:c,bubbles:!0,composed:!0})),this.getAttribute("mode")==="fab"&&this.hide()}_moveFocus(e,o){const t=this._actions();if(!t.length)return;const r=t.indexOf(e);if(r<0)return;const i=(r+o+t.length)%t.length;t[i].focus()}_onKeyDown(e){if(e.key==="Escape"&&this.open&&this.getAttribute("mode")==="fab"){e.preventDefault(),this.hide();return}const o=e.target;if(!o)return;const r=this._actions().find(s=>s===o||s.contains(o));if(!r)return;const i=this.getAttribute("orientation")==="vertical"||this.getAttribute("mode")==="fab",n=!i&&getComputedStyle(this).direction==="rtl",a=i?"ArrowDown":n?"ArrowLeft":"ArrowRight",c=i?"ArrowUp":n?"ArrowRight":"ArrowLeft";if(e.key===a){e.preventDefault(),this._moveFocus(r,1);return}if(e.key===c){e.preventDefault(),this._moveFocus(r,-1);return}if(e.key==="Home"||e.key==="End"){e.preventDefault();const s=this._actions();if(!s.length)return;(e.key==="Home"?s[0]:s[s.length-1]).focus()}}_syncOpenUi(){if(!this.isConnected)return;if(!this.root.querySelector(".root")){this.requestRender();return}const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this.root.querySelector(".toggle");i&&(i.textContent=t?"−":"+",i.setAttribute("aria-label",r),i.setAttribute("aria-expanded",t?"true":"false"));const n=this.root.querySelector(".actions");n&&(t?n.removeAttribute("hidden"):n.setAttribute("hidden","")),this._syncActionAccessibility(t)}render(){const e=this.getAttribute("mode")==="fab"?"fab":"bar",o=this.hasAttribute("collapsible")||e==="fab",t=this.open||!o&&e==="bar",r=this.getAttribute("label")||"Quick actions",i=this._actionsId(),n=this.getAttribute("orientation")==="vertical"||e==="fab"?"vertical":"horizontal";this.setContent(`
201
201
  <style>${h}</style>
202
- <div class="root" part="root" role="toolbar" aria-label="${l(r)}" aria-orientation="${s}">
202
+ <div class="root" part="root" role="toolbar" aria-label="${l(r)}" aria-orientation="${n}">
203
203
  ${o?`<button type="button" class="toggle" part="toggle" aria-label="${l(r)}" aria-controls="${i}" aria-haspopup="true" aria-expanded="${t?"true":"false"}">${t?"−":"+"}</button>`:""}
204
204
  <div id="${i}" class="actions" part="actions" role="group" aria-label="${l(r)} list" ${t?"":"hidden"}>
205
205
  <slot name="action"></slot>
@@ -1,4 +1,4 @@
1
- import { E as d } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as d } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  const b = `
3
3
  :host {
4
4
  --ui-quick-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
@@ -111,8 +111,8 @@ const b = `
111
111
  --ui-quick-border: #334155;
112
112
  --ui-quick-text: #e2e8f0;
113
113
  --ui-quick-muted: #93a4bd;
114
- --ui-quick-accent: #93c5fd;
115
- --ui-quick-focus: #93c5fd;
114
+ --ui-quick-accent: var(--ui-color-accent-on-dark, #93c5fd);
115
+ --ui-quick-focus: var(--ui-color-accent-on-dark, #93c5fd);
116
116
  }
117
117
 
118
118
  :host([variant="minimal"]) .root {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./ElementBase-DxbvhLJs.js"),c=require("./roving-focus-group-BdJ_4Njm.js"),g=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("./ElementBase-CbUsP3D6.js"),v=require("./form-control-B90_3kYN.js"),c=require("./roving-focus-group-BdJ_4Njm.js"),m=`
2
2
  :host {
3
3
  display: block;
4
4
  width: 100%;
@@ -253,29 +253,29 @@
253
253
  background: Highlight;
254
254
  }
255
255
  }
256
- `;function h(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function p(s){return s==="horizontal"?"horizontal":"vertical"}function x(s){return s==="sm"||s==="lg"?s:"md"}function _(s){return s==="card"||s==="segmented"?s:"default"}function m(s){return s==="neutral"||s==="success"||s==="warning"||s==="danger"||s==="info"?s:"brand"}class f extends v.ElementBase{constructor(){super(),this._value="",this._disabled=!1,this._required=!1,this._orientation="vertical",this._focusIndex=-1,this._options=[],this._observer=null,this._onClickBound=e=>this._onClick(e),this._onKeydownBound=e=>this._onKeydown(e)}static get observedAttributes(){return["value","disabled","required","name","orientation","variant","size","tone","options","headless"]}connectedCallback(){this._syncFromAttributes(),super.connectedCallback(),this.root.addEventListener("click",this._onClickBound),this.root.addEventListener("keydown",this._onKeydownBound),typeof MutationObserver<"u"&&(this._observer||(this._observer=new MutationObserver(()=>{this.hasAttribute("options")||(this._syncFromAttributes(),this.requestRender())})),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this.root.removeEventListener("click",this._onClickBound),this.root.removeEventListener("keydown",this._onKeydownBound),this._observer?.disconnect(),super.disconnectedCallback()}attributeChangedCallback(e,i,t){i!==t&&(this._syncFromAttributes(),e==="options"?this.requestRender():this._syncInteractiveState(),e==="value"&&this.dispatchEvent(new CustomEvent("valuechange",{detail:{value:this._value},bubbles:!0,composed:!0})))}get value(){return this._value}set value(e){const i=String(e||"");i!==this._value&&this.setAttribute("value",i)}get disabled(){return this._disabled}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}_syncFromAttributes(){if(this._value=this.getAttribute("value")||"",this._disabled=this.hasAttribute("disabled"),this._required=this.hasAttribute("required"),this._orientation=p(this.getAttribute("orientation")),this._options=this._collectOptions(),this._focusIndex<0||this._focusIndex>=this._options.length||this._options[this._focusIndex]?.disabled){const e=this._findSelectedIndex();this._focusIndex=e>=0?e:this._findFirstEnabledIndex()}}_collectOptions(){const e=this.getAttribute("options");if(e&&e.trim())try{const t=JSON.parse(e);if(Array.isArray(t)){const r=t.map((o,a)=>{if(typeof o=="string")return{value:o,label:o,disabled:!1};if(o&&typeof o=="object"){const n=String(o.value??`option-${a+1}`),d=String(o.label??n),l=o.description==null?void 0:String(o.description),u=!!o.disabled;return{value:n,label:d,description:l,disabled:u}}return null}).filter(Boolean);if(r.length)return r}}catch{}return Array.from(this.children).filter(t=>t instanceof HTMLElement&&t.hasAttribute("data-radio")).map((t,r)=>{const o=t.getAttribute("data-value")||t.getAttribute("value"),a=(t.getAttribute("data-label")||t.textContent||"").trim(),n=(o||a||`option-${r+1}`).trim(),d=(t.getAttribute("data-description")||"").trim()||void 0,l=t.hasAttribute("data-disabled")||t.getAttribute("aria-disabled")==="true";return{value:n,label:a||n,description:d,disabled:l}})}_findSelectedIndex(){const e=this._options.findIndex(i=>i.value===this._value&&!i.disabled);return e>=0?e:this._value?-1:this._findFirstEnabledIndex()}_findFirstEnabledIndex(){return this._options.findIndex(e=>!e.disabled)}_selectIndex(e,i){if(this._disabled)return;const t=this._options[e];if(!t||t.disabled)return;const r=this._value!==t.value;if(this._focusIndex=e,r){this._value=t.value,this.getAttribute("value")!==t.value?this.setAttribute("value",t.value):this.requestRender();const o={value:t.value,option:{...t},reason:i,name:this.getAttribute("name")||void 0};this.dispatchEvent(new CustomEvent("input",{detail:o,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}else this.requestRender();this._focusOption(e)}_moveSelection(e){const i=c.moveRovingFocusIndex(this._options,this._focusIndex,e>0?1:-1,{wrap:!0,fallbackIndex:c.resolveRovingFocusIndex(this._options,{activeIndex:this._focusIndex,selectedIndex:this._findSelectedIndex(),getDisabled:t=>!!t.disabled}),getDisabled:t=>!!t.disabled});i>=0&&this._selectIndex(i,"keyboard")}_focusOption(e){const i=this.root.querySelector(`.option[data-index="${e}"]`);c.focusRovingItem(i)}_syncInteractiveState(){if(!this.root.querySelector(".root"))return;this.setAttribute("role","radiogroup"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-required",this._required?"true":"false"),this.setAttribute("aria-orientation",this._orientation);const i=this._findSelectedIndex(),t=i>=0?i:this._findFirstEnabledIndex();this._focusIndex=c.resolveRovingFocusIndex(this._options,{activeIndex:this._focusIndex,selectedIndex:t,getDisabled:a=>!!a.disabled});const r=this.root.querySelectorAll(".option[data-index]");r.forEach(a=>{const n=Number(a.getAttribute("data-index"));if(Number.isNaN(n))return;const d=this._options[n];if(!d)return;const l=n===t,u=this._disabled||!!d.disabled,b=n===this._focusIndex?0:-1;a.setAttribute("data-value",d.value),a.setAttribute("data-checked",l?"true":"false"),a.setAttribute("data-disabled",u?"true":"false"),a.setAttribute("aria-checked",l?"true":"false"),a.setAttribute("aria-disabled",u?"true":"false"),a.setAttribute("tabindex",String(b))});const o=Array.from(r);c.syncRovingTabStops(o,o[this._focusIndex]||null,{activeAttribute:null})}_onClick(e){const i=e.target;if(!i)return;const t=i.closest(".option");if(!t)return;const r=Number(t.getAttribute("data-index"));Number.isNaN(r)||this._selectIndex(r,"click")}_onKeydown(e){if(this._disabled)return;const i=e.key,t=this._orientation==="horizontal";if(i==="ArrowRight"&&t||i==="ArrowDown"){e.preventDefault(),this._moveSelection(1);return}if(i==="ArrowLeft"&&t||i==="ArrowUp"){e.preventDefault(),this._moveSelection(-1);return}if(i==="Home"){e.preventDefault();const r=c.getRovingFocusBoundaryIndex(this._options,"first",o=>!!o.disabled);r>=0&&this._selectIndex(r,"keyboard");return}if(i==="End"){e.preventDefault();const r=c.getRovingFocusBoundaryIndex(this._options,"last",o=>!!o.disabled);r>=0&&this._selectIndex(r,"keyboard");return}if(i===" "||i==="Enter"){e.preventDefault();const r=this._focusIndex>=0?this._focusIndex:this._findSelectedIndex();r>=0&&this._selectIndex(r,"keyboard")}}render(){const e=x(this.getAttribute("size")),i=_(this.getAttribute("variant")),t=m(this.getAttribute("tone")),r=p(this.getAttribute("orientation"));this.setAttribute("role","radiogroup"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-required",this._required?"true":"false"),this.setAttribute("aria-orientation",r);const o=this._findSelectedIndex(),a=o>=0?o:this._findFirstEnabledIndex();(this._focusIndex<0||this._focusIndex>=this._options.length||this._options[this._focusIndex]?.disabled)&&(this._focusIndex=a),this.setContent(`
257
- <style>${g}</style>
256
+ `;function p(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function g(s){return s==="horizontal"?"horizontal":"vertical"}function _(s){return s==="sm"||s==="lg"?s:"md"}function A(s){return s==="card"||s==="segmented"?s:"default"}function y(s){return s==="neutral"||s==="success"||s==="warning"||s==="danger"||s==="info"?s:"brand"}const f=class f extends x.ElementBase{constructor(){super(),this._formControl=new v.FormControl(this,{getValue:()=>this.value||null,getValidity:()=>({valueMissing:v.isRequired(this)&&!this.value,message:"Please select one of these options."}),defaultAttribute:"value",onFormDisabled:()=>{this._disabled=this.hasAttribute("disabled")||this._formControl.disabledByForm,this.requestRender()}}),this._value="",this._disabled=!1,this._required=!1,this._orientation="vertical",this._focusIndex=-1,this._options=[],this._observer=null,this._onClickBound=e=>this._onClick(e),this._onKeydownBound=e=>this._onKeydown(e)}static get observedAttributes(){return["value","disabled","required","name","orientation","variant","size","tone","options","headless"]}formResetCallback(){this._formControl.formResetCallback()}formDisabledCallback(e){this._formControl.formDisabledCallback(e)}get form(){return this._formControl.form}connectedCallback(){this._syncFromAttributes(),super.connectedCallback(),this._formControl.connect(),this.root.addEventListener("click",this._onClickBound),this.root.addEventListener("keydown",this._onKeydownBound),typeof MutationObserver<"u"&&(this._observer||(this._observer=new MutationObserver(()=>{this.hasAttribute("options")||(this._syncFromAttributes(),this.requestRender())})),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._formControl.disconnect(),this.root.removeEventListener("click",this._onClickBound),this.root.removeEventListener("keydown",this._onKeydownBound),this._observer?.disconnect(),super.disconnectedCallback()}attributeChangedCallback(e,i,t){i!==t&&(this._syncFromAttributes(),e==="options"?this.requestRender():this._syncInteractiveState(),e==="value"&&this.dispatchEvent(new CustomEvent("valuechange",{detail:{value:this._value},bubbles:!0,composed:!0})))}get value(){return this._value}set value(e){const i=String(e||"");i!==this._value&&this.setAttribute("value",i)}get disabled(){return this._disabled}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}_syncFromAttributes(){if(this._value=this.getAttribute("value")||"",this._disabled=this.hasAttribute("disabled")||!!this._formControl?.disabledByForm,this._required=this.hasAttribute("required"),this._orientation=g(this.getAttribute("orientation")),this._options=this._collectOptions(),this._focusIndex<0||this._focusIndex>=this._options.length||this._options[this._focusIndex]?.disabled){const e=this._findSelectedIndex();this._focusIndex=e>=0?e:this._findFirstEnabledIndex()}}_collectOptions(){const e=this.getAttribute("options");if(e&&e.trim())try{const t=JSON.parse(e);if(Array.isArray(t)){const r=t.map((o,a)=>{if(typeof o=="string")return{value:o,label:o,disabled:!1};if(o&&typeof o=="object"){const n=String(o.value??`option-${a+1}`),d=String(o.label??n),l=o.description==null?void 0:String(o.description),u=!!o.disabled;return{value:n,label:d,description:l,disabled:u}}return null}).filter(Boolean);if(r.length)return r}}catch{}return Array.from(this.children).filter(t=>t instanceof HTMLElement&&t.hasAttribute("data-radio")).map((t,r)=>{const o=t.getAttribute("data-value")||t.getAttribute("value"),a=(t.getAttribute("data-label")||t.textContent||"").trim(),n=(o||a||`option-${r+1}`).trim(),d=(t.getAttribute("data-description")||"").trim()||void 0,l=t.hasAttribute("data-disabled")||t.getAttribute("aria-disabled")==="true";return{value:n,label:a||n,description:d,disabled:l}})}_findSelectedIndex(){const e=this._options.findIndex(i=>i.value===this._value&&!i.disabled);return e>=0?e:this._value?-1:this._findFirstEnabledIndex()}_findFirstEnabledIndex(){return this._options.findIndex(e=>!e.disabled)}_selectIndex(e,i){if(this._disabled)return;const t=this._options[e];if(!t||t.disabled)return;const r=this._value!==t.value;if(this._focusIndex=e,r){this._value=t.value,this.getAttribute("value")!==t.value?this.setAttribute("value",t.value):this.requestRender();const o={value:t.value,option:{...t},reason:i,name:this.getAttribute("name")||void 0};this.dispatchEvent(new CustomEvent("input",{detail:o,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}else this.requestRender();this._focusOption(e)}_moveSelection(e){const i=c.moveRovingFocusIndex(this._options,this._focusIndex,e>0?1:-1,{wrap:!0,fallbackIndex:c.resolveRovingFocusIndex(this._options,{activeIndex:this._focusIndex,selectedIndex:this._findSelectedIndex(),getDisabled:t=>!!t.disabled}),getDisabled:t=>!!t.disabled});i>=0&&this._selectIndex(i,"keyboard")}_focusOption(e){const i=this.root.querySelector(`.option[data-index="${e}"]`);c.focusRovingItem(i)}_syncInteractiveState(){if(!this.root.querySelector(".root"))return;this.setAttribute("role","radiogroup"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-required",this._required?"true":"false"),this.setAttribute("aria-orientation",this._orientation);const i=this._findSelectedIndex(),t=i>=0?i:this._findFirstEnabledIndex();this._focusIndex=c.resolveRovingFocusIndex(this._options,{activeIndex:this._focusIndex,selectedIndex:t,getDisabled:a=>!!a.disabled});const r=this.root.querySelectorAll(".option[data-index]");r.forEach(a=>{const n=Number(a.getAttribute("data-index"));if(Number.isNaN(n))return;const d=this._options[n];if(!d)return;const l=n===t,u=this._disabled||!!d.disabled,h=n===this._focusIndex?0:-1;a.setAttribute("data-value",d.value),a.setAttribute("data-checked",l?"true":"false"),a.setAttribute("data-disabled",u?"true":"false"),a.setAttribute("aria-checked",l?"true":"false"),a.setAttribute("aria-disabled",u?"true":"false"),a.setAttribute("tabindex",String(h))});const o=Array.from(r);c.syncRovingTabStops(o,o[this._focusIndex]||null,{activeAttribute:null})}_onClick(e){const i=e.target;if(!i)return;const t=i.closest(".option");if(!t)return;const r=Number(t.getAttribute("data-index"));Number.isNaN(r)||this._selectIndex(r,"click")}_onKeydown(e){if(this._disabled)return;const i=e.key,t=this._orientation==="horizontal";if(i==="ArrowRight"&&t||i==="ArrowDown"){e.preventDefault(),this._moveSelection(1);return}if(i==="ArrowLeft"&&t||i==="ArrowUp"){e.preventDefault(),this._moveSelection(-1);return}if(i==="Home"){e.preventDefault();const r=c.getRovingFocusBoundaryIndex(this._options,"first",o=>!!o.disabled);r>=0&&this._selectIndex(r,"keyboard");return}if(i==="End"){e.preventDefault();const r=c.getRovingFocusBoundaryIndex(this._options,"last",o=>!!o.disabled);r>=0&&this._selectIndex(r,"keyboard");return}if(i===" "||i==="Enter"){e.preventDefault();const r=this._focusIndex>=0?this._focusIndex:this._findSelectedIndex();r>=0&&this._selectIndex(r,"keyboard")}}render(){const e=_(this.getAttribute("size")),i=A(this.getAttribute("variant")),t=y(this.getAttribute("tone")),r=g(this.getAttribute("orientation"));this.setAttribute("role","radiogroup"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-required",this._required?"true":"false"),this.setAttribute("aria-orientation",r);const o=this._findSelectedIndex(),a=o>=0?o:this._findFirstEnabledIndex();(this._focusIndex<0||this._focusIndex>=this._options.length||this._options[this._focusIndex]?.disabled)&&(this._focusIndex=a),this.setContent(`
257
+ <style>${m}</style>
258
258
  <div class="root" part="root" data-size="${e}" data-variant="${i}" data-tone="${t}">
259
- ${this._options.map((n,d)=>{const l=d===a,u=this._disabled||!!n.disabled,b=d===this._focusIndex?0:-1;return`
259
+ ${this._options.map((n,d)=>{const l=d===a,u=this._disabled||!!n.disabled,h=d===this._focusIndex?0:-1;return`
260
260
  <button
261
261
  type="button"
262
262
  class="option"
263
263
  part="option"
264
264
  role="radio"
265
265
  data-index="${d}"
266
- data-value="${h(n.value)}"
266
+ data-value="${p(n.value)}"
267
267
  data-checked="${l?"true":"false"}"
268
268
  data-disabled="${u?"true":"false"}"
269
269
  aria-checked="${l?"true":"false"}"
270
270
  aria-disabled="${u?"true":"false"}"
271
- tabindex="${b}"
271
+ tabindex="${h}"
272
272
  >
273
273
  <span class="control" part="control"><span class="dot" part="dot"></span></span>
274
274
  <span class="text" part="text">
275
- <span class="label" part="label">${h(n.label)}</span>
276
- ${n.description?`<span class="description" part="description">${h(n.description)}</span>`:""}
275
+ <span class="label" part="label">${p(n.label)}</span>
276
+ ${n.description?`<span class="description" part="description">${p(n.description)}</span>`:""}
277
277
  </span>
278
278
  </button>
279
279
  `}).join("")}
280
280
  </div>
281
- `)}shouldRenderOnAttributeChange(e,i,t){return e==="options"}}typeof customElements<"u"&&!customElements.get("ui-radio-group")&&customElements.define("ui-radio-group",f);exports.UIRadioGroup=f;
281
+ `)}shouldRenderOnAttributeChange(e,i,t){return e==="options"}};f.formAssociated=!0;let b=f;typeof customElements<"u"&&!customElements.get("ui-radio-group")&&customElements.define("ui-radio-group",b);exports.UIRadioGroup=b;
@@ -1,6 +1,7 @@
1
- import { E as v } from "./ElementBase-BeZT54Hj.mjs";
2
- import { m as g, r as h, f as x, s as m, g as p } from "./roving-focus-group-Dbm1Jko_.mjs";
3
- const _ = `
1
+ import { E as m } from "./ElementBase-D5QsC5Vw.mjs";
2
+ import { F as x, i as _ } from "./form-control-D9wWUMBl.mjs";
3
+ import { m as A, r as f, f as y, s as k, g as v } from "./roving-focus-group-Dbm1Jko_.mjs";
4
+ const I = `
4
5
  :host {
5
6
  display: block;
6
7
  width: 100%;
@@ -259,21 +260,31 @@ const _ = `
259
260
  function b(s) {
260
261
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
261
262
  }
262
- function f(s) {
263
+ function g(s) {
263
264
  return s === "horizontal" ? "horizontal" : "vertical";
264
265
  }
265
- function I(s) {
266
+ function w(s) {
266
267
  return s === "sm" || s === "lg" ? s : "md";
267
268
  }
268
- function A(s) {
269
+ function C(s) {
269
270
  return s === "card" || s === "segmented" ? s : "default";
270
271
  }
271
- function y(s) {
272
+ function z(s) {
272
273
  return s === "neutral" || s === "success" || s === "warning" || s === "danger" || s === "info" ? s : "brand";
273
274
  }
274
- class k extends v {
275
+ const p = class p extends m {
275
276
  constructor() {
276
- super(), this._value = "", this._disabled = !1, this._required = !1, this._orientation = "vertical", this._focusIndex = -1, this._options = [], this._observer = null, this._onClickBound = (e) => this._onClick(e), this._onKeydownBound = (e) => this._onKeydown(e);
277
+ super(), this._formControl = new x(this, {
278
+ getValue: () => this.value || null,
279
+ getValidity: () => ({
280
+ valueMissing: _(this) && !this.value,
281
+ message: "Please select one of these options."
282
+ }),
283
+ defaultAttribute: "value",
284
+ onFormDisabled: () => {
285
+ this._disabled = this.hasAttribute("disabled") || this._formControl.disabledByForm, this.requestRender();
286
+ }
287
+ }), this._value = "", this._disabled = !1, this._required = !1, this._orientation = "vertical", this._focusIndex = -1, this._options = [], this._observer = null, this._onClickBound = (e) => this._onClick(e), this._onKeydownBound = (e) => this._onKeydown(e);
277
288
  }
278
289
  static get observedAttributes() {
279
290
  return [
@@ -289,13 +300,23 @@ class k extends v {
289
300
  "headless"
290
301
  ];
291
302
  }
303
+ formResetCallback() {
304
+ this._formControl.formResetCallback();
305
+ }
306
+ formDisabledCallback(e) {
307
+ this._formControl.formDisabledCallback(e);
308
+ }
309
+ /** The `<form>` this field belongs to, if any. */
310
+ get form() {
311
+ return this._formControl.form;
312
+ }
292
313
  connectedCallback() {
293
- this._syncFromAttributes(), super.connectedCallback(), this.root.addEventListener("click", this._onClickBound), this.root.addEventListener("keydown", this._onKeydownBound), typeof MutationObserver < "u" && (this._observer || (this._observer = new MutationObserver(() => {
314
+ this._syncFromAttributes(), super.connectedCallback(), this._formControl.connect(), this.root.addEventListener("click", this._onClickBound), this.root.addEventListener("keydown", this._onKeydownBound), typeof MutationObserver < "u" && (this._observer || (this._observer = new MutationObserver(() => {
294
315
  this.hasAttribute("options") || (this._syncFromAttributes(), this.requestRender());
295
316
  })), this._observer.observe(this, { childList: !0, subtree: !0, characterData: !0 }));
296
317
  }
297
318
  disconnectedCallback() {
298
- this.root.removeEventListener("click", this._onClickBound), this.root.removeEventListener("keydown", this._onKeydownBound), this._observer?.disconnect(), super.disconnectedCallback();
319
+ this._formControl.disconnect(), this.root.removeEventListener("click", this._onClickBound), this.root.removeEventListener("keydown", this._onKeydownBound), this._observer?.disconnect(), super.disconnectedCallback();
299
320
  }
300
321
  attributeChangedCallback(e, i, t) {
301
322
  i !== t && (this._syncFromAttributes(), e === "options" ? this.requestRender() : this._syncInteractiveState(), e === "value" && this.dispatchEvent(
@@ -320,7 +341,7 @@ class k extends v {
320
341
  e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
321
342
  }
322
343
  _syncFromAttributes() {
323
- if (this._value = this.getAttribute("value") || "", this._disabled = this.hasAttribute("disabled"), this._required = this.hasAttribute("required"), this._orientation = f(this.getAttribute("orientation")), this._options = this._collectOptions(), this._focusIndex < 0 || this._focusIndex >= this._options.length || this._options[this._focusIndex]?.disabled) {
344
+ if (this._value = this.getAttribute("value") || "", this._disabled = this.hasAttribute("disabled") || !!this._formControl?.disabledByForm, this._required = this.hasAttribute("required"), this._orientation = g(this.getAttribute("orientation")), this._options = this._collectOptions(), this._focusIndex < 0 || this._focusIndex >= this._options.length || this._options[this._focusIndex]?.disabled) {
324
345
  const e = this._findSelectedIndex();
325
346
  this._focusIndex = e >= 0 ? e : this._findFirstEnabledIndex();
326
347
  }
@@ -372,9 +393,9 @@ class k extends v {
372
393
  this._focusOption(e);
373
394
  }
374
395
  _moveSelection(e) {
375
- const i = g(this._options, this._focusIndex, e > 0 ? 1 : -1, {
396
+ const i = A(this._options, this._focusIndex, e > 0 ? 1 : -1, {
376
397
  wrap: !0,
377
- fallbackIndex: h(this._options, {
398
+ fallbackIndex: f(this._options, {
378
399
  activeIndex: this._focusIndex,
379
400
  selectedIndex: this._findSelectedIndex(),
380
401
  getDisabled: (t) => !!t.disabled
@@ -385,13 +406,13 @@ class k extends v {
385
406
  }
386
407
  _focusOption(e) {
387
408
  const i = this.root.querySelector(`.option[data-index="${e}"]`);
388
- x(i);
409
+ y(i);
389
410
  }
390
411
  _syncInteractiveState() {
391
412
  if (!this.root.querySelector(".root")) return;
392
413
  this.setAttribute("role", "radiogroup"), this.setAttribute("aria-disabled", this._disabled ? "true" : "false"), this.setAttribute("aria-required", this._required ? "true" : "false"), this.setAttribute("aria-orientation", this._orientation);
393
414
  const i = this._findSelectedIndex(), t = i >= 0 ? i : this._findFirstEnabledIndex();
394
- this._focusIndex = h(this._options, {
415
+ this._focusIndex = f(this._options, {
395
416
  activeIndex: this._focusIndex,
396
417
  selectedIndex: t,
397
418
  getDisabled: (a) => !!a.disabled
@@ -406,7 +427,7 @@ class k extends v {
406
427
  a.setAttribute("data-value", d.value), a.setAttribute("data-checked", l ? "true" : "false"), a.setAttribute("data-disabled", u ? "true" : "false"), a.setAttribute("aria-checked", l ? "true" : "false"), a.setAttribute("aria-disabled", u ? "true" : "false"), a.setAttribute("tabindex", String(c));
407
428
  });
408
429
  const o = Array.from(r);
409
- m(o, o[this._focusIndex] || null, { activeAttribute: null });
430
+ k(o, o[this._focusIndex] || null, { activeAttribute: null });
410
431
  }
411
432
  _onClick(e) {
412
433
  const i = e.target;
@@ -429,13 +450,13 @@ class k extends v {
429
450
  }
430
451
  if (i === "Home") {
431
452
  e.preventDefault();
432
- const r = p(this._options, "first", (o) => !!o.disabled);
453
+ const r = v(this._options, "first", (o) => !!o.disabled);
433
454
  r >= 0 && this._selectIndex(r, "keyboard");
434
455
  return;
435
456
  }
436
457
  if (i === "End") {
437
458
  e.preventDefault();
438
- const r = p(this._options, "last", (o) => !!o.disabled);
459
+ const r = v(this._options, "last", (o) => !!o.disabled);
439
460
  r >= 0 && this._selectIndex(r, "keyboard");
440
461
  return;
441
462
  }
@@ -446,11 +467,11 @@ class k extends v {
446
467
  }
447
468
  }
448
469
  render() {
449
- const e = I(this.getAttribute("size")), i = A(this.getAttribute("variant")), t = y(this.getAttribute("tone")), r = f(this.getAttribute("orientation"));
470
+ const e = w(this.getAttribute("size")), i = C(this.getAttribute("variant")), t = z(this.getAttribute("tone")), r = g(this.getAttribute("orientation"));
450
471
  this.setAttribute("role", "radiogroup"), this.setAttribute("aria-disabled", this._disabled ? "true" : "false"), this.setAttribute("aria-required", this._required ? "true" : "false"), this.setAttribute("aria-orientation", r);
451
472
  const o = this._findSelectedIndex(), a = o >= 0 ? o : this._findFirstEnabledIndex();
452
473
  (this._focusIndex < 0 || this._focusIndex >= this._options.length || this._options[this._focusIndex]?.disabled) && (this._focusIndex = a), this.setContent(`
453
- <style>${_}</style>
474
+ <style>${I}</style>
454
475
  <div class="root" part="root" data-size="${e}" data-variant="${i}" data-tone="${t}">
455
476
  ${this._options.map((n, d) => {
456
477
  const l = d === a, u = this._disabled || !!n.disabled, c = d === this._focusIndex ? 0 : -1;
@@ -482,8 +503,10 @@ class k extends v {
482
503
  shouldRenderOnAttributeChange(e, i, t) {
483
504
  return e === "options";
484
505
  }
485
- }
486
- typeof customElements < "u" && !customElements.get("ui-radio-group") && customElements.define("ui-radio-group", k);
506
+ };
507
+ p.formAssociated = !0;
508
+ let h = p;
509
+ typeof customElements < "u" && !customElements.get("ui-radio-group") && customElements.define("ui-radio-group", h);
487
510
  export {
488
- k as UIRadioGroup
511
+ h as UIRadioGroup
489
512
  };
package/dist/radio.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./ElementBase-DxbvhLJs.js"),u=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./ElementBase-CbUsP3D6.js"),u=`
2
2
  :host {
3
3
  --ui-radio-size: 16px;
4
4
  --ui-radio-hit-area: 24px;
package/dist/radio.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as l } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as l } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  const u = `
3
3
  :host {
4
4
  --ui-radio-size: 16px;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const V=require("./ElementBase-DxbvhLJs.js"),C=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const V=require("./ElementBase-CbUsP3D6.js"),C=`
2
2
  :host {
3
3
  --ui-rating-size: var(--ui-control-size, var(--ui-font-size-lg, 20px));
4
4
  --ui-rating-gap: var(--ui-control-gap, 6px);
@@ -317,7 +317,7 @@
317
317
  <svg viewBox="0 0 24 24" aria-hidden="true"${i?` class="${i}"`:""}>
318
318
  <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path>
319
319
  </svg>
320
- `}class k extends V.ElementBase{constructor(){super(),this._autoAriaLabel=!1,this._stars=[],this._value=0,this._max=5,this._precision=1,this._disabled=!1,this._readonly=!1,this._hoverValue=0,this._onHostKeyDown=t=>{t.composedPath()[0]===this&&this._onRootKeyDown(t,!0)},this._onRootClick=this._onRootClick.bind(this),this._onRootMouseMove=this._onRootMouseMove.bind(this),this._onRootMouseLeave=this._onRootMouseLeave.bind(this),this._onRootFocusIn=this._onRootFocusIn.bind(this),this._onRootFocusOut=this._onRootFocusOut.bind(this),this._onRootKeyDown=this._onRootKeyDown.bind(this)}static get observedAttributes(){return["value","max","precision","disabled","readonly","variant","size","headless","theme","tone","state","animation","shape","radius","aria-label","aria-labelledby","aria-describedby","label","show-value"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick,!0),this.root.addEventListener("mousemove",this._onRootMouseMove,!0),this.root.addEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.addEventListener("focusin",this._onRootFocusIn,!0),this.root.addEventListener("focusout",this._onRootFocusOut,!0),this.root.addEventListener("keydown",this._onRootKeyDown,!0),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick,!0),this.root.removeEventListener("mousemove",this._onRootMouseMove,!0),this.root.removeEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.removeEventListener("focusin",this._onRootFocusIn,!0),this.root.removeEventListener("focusout",this._onRootFocusOut,!0),this.root.removeEventListener("keydown",this._onRootKeyDown,!0),this.removeEventListener("keydown",this._onHostKeyDown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(t==="value"){const s=Number(r);Number.isFinite(s)&&(this._value=l(h(s,this._precision),0,this._max),this._syncStars(),this._syncAria())}if(t==="max"){const s=Number(r);Number.isFinite(s)&&s>0&&(this._max=Math.max(1,s),this._value>this._max&&(this._value=this._max),this._syncStars(),this._syncAria())}if(t==="precision"&&(this._precision=A(r),this._value=l(h(this._value,this._precision),0,this._max),this._hoverValue=this._hoverValue>0?l(h(this._hoverValue,this._precision),0,this._max):0,this._syncStars(),this._syncAria()),t==="disabled"&&(this._disabled=r!==null),t==="readonly"&&(this._readonly=r!==null),t==="animation"){const s=y(r);s?this.setAttribute("data-animation",s):this.removeAttribute("data-animation")}this.isConnected&&this.requestRender()}}get value(){return this._value}set value(t){const e=Number(t);if(!Number.isFinite(e))return;const r=l(h(e,this._precision),0,this._max);this._value!==r&&(this._value=r,this.setAttribute("value",String(this._value)),this._syncStars(),this._syncAria(),this._emit("change"),this._emit("input"))}get max(){return this._max}set max(t){const e=Number(t);Number.isFinite(e)&&(this._max=Math.max(1,e),this.setAttribute("max",String(this._max)),this._value>this._max&&(this._value=this._max,this.setAttribute("value",String(this._value))),this.requestRender())}get precision(){return this._precision}set precision(t){this._precision=t===.5?.5:1,this.setAttribute("precision",String(this._precision)),this._value=l(h(this._value,this._precision),0,this._max),this.requestRender()}get disabled(){return this._disabled}set disabled(t){this._disabled=!!t,this._disabled?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.requestRender()}get readonly(){return this._readonly}set readonly(t){this._readonly=!!t,this._readonly?this.setAttribute("readonly",""):this.removeAttribute("readonly"),this.requestRender()}_getStarFromEventTarget(t){return t instanceof Element?t.closest(".star"):null}_getStarIndex(t){if(!t)return-1;const e=Number(t.dataset.index);return Number.isFinite(e)?e:-1}_getValueFromPointer(t,e){const r=this._getStarIndex(e);if(r===-1)return this._value;if(this._precision!==.5)return r+1;const s=e.getBoundingClientRect(),n=t.clientX-s.left<=s.width/2?.5:1;return r+n}_formatValue(t){return Number.isInteger(t)?String(t):t.toFixed(1)}_getAriaValueText(t){return`${this._formatValue(t)} out of ${this._max}`}_onRootClick(t){if(this._disabled||this._readonly)return;const e=t,r=this._getStarFromEventTarget(e.target);r&&(this.value=this._getValueFromPointer(e,r))}_onRootMouseMove(t){if(this._disabled||this._readonly)return;const e=t,r=this._getStarFromEventTarget(e.target);r&&(this._hoverValue=this._getValueFromPointer(e,r),this.setAttribute("state","hover"),this._syncStars())}_onRootMouseLeave(){this._disabled||this._readonly||(this._hoverValue=0,this.removeAttribute("state"),this._syncStars())}_onRootFocusIn(t){if(this._disabled||this._readonly)return;const e=this._getStarFromEventTarget(t.target),r=this._getStarIndex(e);r!==-1&&(this._hoverValue=r+1,this.setAttribute("state","focus"),this._syncStars())}_onRootFocusOut(){this._disabled||this._readonly||(this._hoverValue=0,this.removeAttribute("state"),this._syncStars())}_onRootKeyDown(t,e=!1){if(this._disabled||this._readonly)return;const r=t,s=this._getStarFromEventTarget(r.target),o=e?Math.max(0,Math.ceil(this._value)-1):this._getStarIndex(s);if(o===-1)return;let n=this._value;const u=this._precision;switch(r.key){case"ArrowRight":case"ArrowUp":case"+":n=l(this._value+u,0,this._max);break;case"ArrowLeft":case"ArrowDown":case"-":n=l(this._value-u,0,this._max);break;case"Home":n=0;break;case"End":n=this._max;break;case" ":case"Enter":n=o+1;break;default:return}r.preventDefault(),this.value=n}_getFillPercent(t,e){const r=e-(t-1);return r>=1?100:r<=0?0:r*100}_syncStars(){const t=this._hoverValue>0?this._hoverValue:this._value;this._stars.forEach((e,r)=>{const s=r+1,o=this._getFillPercent(s,t);if(e.style.setProperty("--fill-percent",`${o}%`),this._disabled){e.setAttribute("data-state","disabled"),e.setAttribute("aria-disabled","true");return}if(e.removeAttribute("aria-disabled"),this._hoverValue>0){o>0?e.setAttribute("data-state","hover"):e.removeAttribute("data-state");return}o>0?e.setAttribute("data-state","active"):e.removeAttribute("data-state")}),this._syncAria()}_syncAria(){const t=this._getAriaValueText(this._value);this.setAttribute("role","slider"),this.setAttribute("tabindex",this._disabled||this._readonly?"-1":"0"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(this._max)),this.setAttribute("aria-valuenow",String(this._value)),this.setAttribute("aria-valuetext",t),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-readonly",this._readonly?"true":"false"),this._stars.forEach((e,r)=>{const s=r+1,o=this._getFillPercent(s,this._hoverValue>0?this._hoverValue:this._value);e.setAttribute("aria-hidden","true"),e.setAttribute("data-fill",String(o)),e.setAttribute("data-star-value",String(s))})}_emit(t){this.dispatchEvent(new CustomEvent(t,{detail:{value:this._value,max:this._max,precision:this._precision,disabled:this._disabled,readonly:this._readonly},bubbles:!0,composed:!0}))}render(){const t=g(this,"disabled"),e=g(this,"readonly"),r=$(a(this,"variant")),s=N(a(this,"size")),o=a(this,"theme"),n=I(a(this,"tone")),u=q(a(this,"state")),m=y(a(this,"animation")),d=T(a(this,"shape")),v=D(a(this,"radius")),R=A(a(this,"precision")),_=this._autoAriaLabel?null:a(this,"aria-label"),f=a(this,"aria-labelledby"),p=a(this,"aria-describedby"),c=a(this,"label"),b=g(this,"show-value"),S=a(this,"value"),E=a(this,"max");this._max=Math.max(1,Number(E)||5),this._precision=R,this._value=l(h(Number(S)||0,this._precision),0,this._max),this._disabled=t,this._readonly=e,m?this.setAttribute("data-animation",m):this.removeAttribute("data-animation"),o==="dark"||o==="brand"?this.setAttribute("theme",o):this.removeAttribute("theme"),n?this.setAttribute("tone",n):this.removeAttribute("tone"),u==="disabled"?this.setAttribute("state","disabled"):u!=="idle"?this.setAttribute("state",u):this.removeAttribute("state"),d==="square"||d==="pill"?this.setAttribute("shape",d):this.removeAttribute("shape"),r==="default"?this.removeAttribute("variant"):this.setAttribute("variant",r),s==="md"?this.removeAttribute("size"):this.setAttribute("size",s),v?this.style.setProperty("--ui-rating-radius",v):this.style.removeProperty("--ui-rating-radius"),this.setAttribute("precision",String(this._precision));const F=Array.from({length:this._max},(P,M)=>`
320
+ `}class k extends V.ElementBase{constructor(){super(),this._autoAriaLabel=!1,this._settingAutoLabel=!1,this._stars=[],this._value=0,this._max=5,this._precision=1,this._disabled=!1,this._readonly=!1,this._hoverValue=0,this._onHostKeyDown=t=>{t.composedPath()[0]===this&&this._onRootKeyDown(t,!0)},this._onRootClick=this._onRootClick.bind(this),this._onRootMouseMove=this._onRootMouseMove.bind(this),this._onRootMouseLeave=this._onRootMouseLeave.bind(this),this._onRootFocusIn=this._onRootFocusIn.bind(this),this._onRootFocusOut=this._onRootFocusOut.bind(this),this._onRootKeyDown=this._onRootKeyDown.bind(this)}static get observedAttributes(){return["value","max","precision","disabled","readonly","variant","size","headless","theme","tone","state","animation","shape","radius","aria-label","aria-labelledby","aria-describedby","label","show-value"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick,!0),this.root.addEventListener("mousemove",this._onRootMouseMove,!0),this.root.addEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.addEventListener("focusin",this._onRootFocusIn,!0),this.root.addEventListener("focusout",this._onRootFocusOut,!0),this.root.addEventListener("keydown",this._onRootKeyDown,!0),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick,!0),this.root.removeEventListener("mousemove",this._onRootMouseMove,!0),this.root.removeEventListener("mouseleave",this._onRootMouseLeave,!0),this.root.removeEventListener("focusin",this._onRootFocusIn,!0),this.root.removeEventListener("focusout",this._onRootFocusOut,!0),this.root.removeEventListener("keydown",this._onRootKeyDown,!0),this.removeEventListener("keydown",this._onHostKeyDown),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(t==="aria-label"&&!this._settingAutoLabel&&(this._autoAriaLabel=!1),t==="value"){const s=Number(r);Number.isFinite(s)&&(this._value=l(h(s,this._precision),0,this._max),this._syncStars(),this._syncAria())}if(t==="max"){const s=Number(r);Number.isFinite(s)&&s>0&&(this._max=Math.max(1,s),this._value>this._max&&(this._value=this._max),this._syncStars(),this._syncAria())}if(t==="precision"&&(this._precision=A(r),this._value=l(h(this._value,this._precision),0,this._max),this._hoverValue=this._hoverValue>0?l(h(this._hoverValue,this._precision),0,this._max):0,this._syncStars(),this._syncAria()),t==="disabled"&&(this._disabled=r!==null),t==="readonly"&&(this._readonly=r!==null),t==="animation"){const s=y(r);s?this.setAttribute("data-animation",s):this.removeAttribute("data-animation")}this.isConnected&&this.requestRender()}}get value(){return this._value}set value(t){const e=Number(t);if(!Number.isFinite(e))return;const r=l(h(e,this._precision),0,this._max);this._value!==r&&(this._value=r,this.setAttribute("value",String(this._value)),this._syncStars(),this._syncAria(),this._emit("change"),this._emit("input"))}get max(){return this._max}set max(t){const e=Number(t);Number.isFinite(e)&&(this._max=Math.max(1,e),this.setAttribute("max",String(this._max)),this._value>this._max&&(this._value=this._max,this.setAttribute("value",String(this._value))),this.requestRender())}get precision(){return this._precision}set precision(t){this._precision=t===.5?.5:1,this.setAttribute("precision",String(this._precision)),this._value=l(h(this._value,this._precision),0,this._max),this.requestRender()}get disabled(){return this._disabled}set disabled(t){this._disabled=!!t,this._disabled?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.requestRender()}get readonly(){return this._readonly}set readonly(t){this._readonly=!!t,this._readonly?this.setAttribute("readonly",""):this.removeAttribute("readonly"),this.requestRender()}_getStarFromEventTarget(t){return t instanceof Element?t.closest(".star"):null}_getStarIndex(t){if(!t)return-1;const e=Number(t.dataset.index);return Number.isFinite(e)?e:-1}_getValueFromPointer(t,e){const r=this._getStarIndex(e);if(r===-1)return this._value;if(this._precision!==.5)return r+1;const s=e.getBoundingClientRect(),n=t.clientX-s.left<=s.width/2?.5:1;return r+n}_formatValue(t){return Number.isInteger(t)?String(t):t.toFixed(1)}_getAriaValueText(t){return`${this._formatValue(t)} out of ${this._max}`}_onRootClick(t){if(this._disabled||this._readonly)return;const e=t,r=this._getStarFromEventTarget(e.target);r&&(this.value=this._getValueFromPointer(e,r))}_onRootMouseMove(t){if(this._disabled||this._readonly)return;const e=t,r=this._getStarFromEventTarget(e.target);r&&(this._hoverValue=this._getValueFromPointer(e,r),this.setAttribute("state","hover"),this._syncStars())}_onRootMouseLeave(){this._disabled||this._readonly||(this._hoverValue=0,this.removeAttribute("state"),this._syncStars())}_onRootFocusIn(t){if(this._disabled||this._readonly)return;const e=this._getStarFromEventTarget(t.target),r=this._getStarIndex(e);r!==-1&&(this._hoverValue=r+1,this.setAttribute("state","focus"),this._syncStars())}_onRootFocusOut(){this._disabled||this._readonly||(this._hoverValue=0,this.removeAttribute("state"),this._syncStars())}_onRootKeyDown(t,e=!1){if(this._disabled||this._readonly)return;const r=t,s=this._getStarFromEventTarget(r.target),o=e?Math.max(0,Math.ceil(this._value)-1):this._getStarIndex(s);if(o===-1)return;let n=this._value;const u=this._precision;switch(r.key){case"ArrowRight":case"ArrowUp":case"+":n=l(this._value+u,0,this._max);break;case"ArrowLeft":case"ArrowDown":case"-":n=l(this._value-u,0,this._max);break;case"Home":n=0;break;case"End":n=this._max;break;case" ":case"Enter":n=o+1;break;default:return}r.preventDefault(),this.value=n}_getFillPercent(t,e){const r=e-(t-1);return r>=1?100:r<=0?0:r*100}_syncStars(){const t=this._hoverValue>0?this._hoverValue:this._value;this._stars.forEach((e,r)=>{const s=r+1,o=this._getFillPercent(s,t);if(e.style.setProperty("--fill-percent",`${o}%`),this._disabled){e.setAttribute("data-state","disabled"),e.setAttribute("aria-disabled","true");return}if(e.removeAttribute("aria-disabled"),this._hoverValue>0){o>0?e.setAttribute("data-state","hover"):e.removeAttribute("data-state");return}o>0?e.setAttribute("data-state","active"):e.removeAttribute("data-state")}),this._syncAria()}_syncAria(){const t=this._getAriaValueText(this._value);this.setAttribute("role","slider"),this.setAttribute("tabindex",this._disabled||this._readonly?"-1":"0"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(this._max)),this.setAttribute("aria-valuenow",String(this._value)),this.setAttribute("aria-valuetext",t),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",this._disabled?"true":"false"),this.setAttribute("aria-readonly",this._readonly?"true":"false"),this._stars.forEach((e,r)=>{const s=r+1,o=this._getFillPercent(s,this._hoverValue>0?this._hoverValue:this._value);e.setAttribute("aria-hidden","true"),e.setAttribute("data-fill",String(o)),e.setAttribute("data-star-value",String(s))})}_emit(t){this.dispatchEvent(new CustomEvent(t,{detail:{value:this._value,max:this._max,precision:this._precision,disabled:this._disabled,readonly:this._readonly},bubbles:!0,composed:!0}))}render(){const t=g(this,"disabled"),e=g(this,"readonly"),r=$(a(this,"variant")),s=N(a(this,"size")),o=a(this,"theme"),n=I(a(this,"tone")),u=q(a(this,"state")),m=y(a(this,"animation")),d=T(a(this,"shape")),v=D(a(this,"radius")),R=A(a(this,"precision")),_=this._autoAriaLabel?null:a(this,"aria-label"),f=a(this,"aria-labelledby"),p=a(this,"aria-describedby"),c=a(this,"label"),b=g(this,"show-value"),S=a(this,"value"),L=a(this,"max");this._max=Math.max(1,Number(L)||5),this._precision=R,this._value=l(h(Number(S)||0,this._precision),0,this._max),this._disabled=t,this._readonly=e,m?this.setAttribute("data-animation",m):this.removeAttribute("data-animation"),o==="dark"||o==="brand"?this.setAttribute("theme",o):this.removeAttribute("theme"),n?this.setAttribute("tone",n):this.removeAttribute("tone"),u==="disabled"?this.setAttribute("state","disabled"):u!=="idle"?this.setAttribute("state",u):this.removeAttribute("state"),d==="square"||d==="pill"?this.setAttribute("shape",d):this.removeAttribute("shape"),r==="default"?this.removeAttribute("variant"):this.setAttribute("variant",r),s==="md"?this.removeAttribute("size"):this.setAttribute("size",s),v?this.style.setProperty("--ui-rating-radius",v):this.style.removeProperty("--ui-rating-radius"),this.setAttribute("precision",String(this._precision));const E=Array.from({length:this._max},(P,M)=>`
321
321
  <span
322
322
  class="star"
323
323
  aria-hidden="true"
@@ -334,19 +334,19 @@
334
334
  </span>
335
335
  </span>
336
336
  </span>
337
- `).join(""),L=b?`${this._formatValue(this._value)} / ${this._max}`:"";this.setContent(`
337
+ `).join(""),F=b?`${this._formatValue(this._value)} / ${this._max}`:"";if(this.setContent(`
338
338
  <style>${C}</style>
339
339
  <div
340
340
  class="stars"
341
341
  part="stars"
342
342
  aria-hidden="true"
343
343
  >
344
- ${F}
344
+ ${E}
345
345
  </div>
346
346
  ${c||b?`
347
347
  <div class="label" part="label">
348
348
  ${c?`<span class="label-text">${w(c)}</span>`:""}
349
- ${b?`<span class="value">${w(L)}</span>`:""}
349
+ ${b?`<span class="value">${w(F)}</span>`:""}
350
350
  </div>
351
351
  `:""}
352
- `),queueMicrotask(()=>{this._stars=Array.from(this.root.querySelectorAll(".star")),this._syncStars()}),this._autoAriaLabel=!1,_?this.setAttribute("aria-label",_):f?this.removeAttribute("aria-label"):(this.setAttribute("aria-label",(c||"").trim()||"Rating"),this._autoAriaLabel=!0),f?this.setAttribute("aria-labelledby",f):this.removeAttribute("aria-labelledby"),p?this.setAttribute("aria-describedby",p):this.removeAttribute("aria-describedby"),this._disabled?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._readonly?this.setAttribute("readonly",""):this.removeAttribute("readonly"),this._syncAria()}}typeof customElements<"u"&&!customElements.get("ui-rating")&&customElements.define("ui-rating",k);exports.UIRating=k;
352
+ `),queueMicrotask(()=>{this._stars=Array.from(this.root.querySelectorAll(".star")),this._syncStars()}),this._autoAriaLabel=!1,_)this.setAttribute("aria-label",_);else if(f)this.removeAttribute("aria-label");else{this._settingAutoLabel=!0;try{this.setAttribute("aria-label",(c||"").trim()||"Rating")}finally{this._settingAutoLabel=!1}this._autoAriaLabel=!0}f?this.setAttribute("aria-labelledby",f):this.removeAttribute("aria-labelledby"),p?this.setAttribute("aria-describedby",p):this.removeAttribute("aria-describedby"),this._disabled?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._readonly?this.setAttribute("readonly",""):this.removeAttribute("readonly"),this._syncAria()}}typeof customElements<"u"&&!customElements.get("ui-rating")&&customElements.define("ui-rating",k);exports.UIRating=k;
@@ -1,4 +1,4 @@
1
- import { E as M } from "./ElementBase-BeZT54Hj.mjs";
1
+ import { E as M } from "./ElementBase-D5QsC5Vw.mjs";
2
2
  const V = `
3
3
  :host {
4
4
  --ui-rating-size: var(--ui-control-size, var(--ui-font-size-lg, 20px));
@@ -376,7 +376,7 @@ function z(i) {
376
376
  }
377
377
  class q extends M {
378
378
  constructor() {
379
- super(), this._autoAriaLabel = !1, this._stars = [], this._value = 0, this._max = 5, this._precision = 1, this._disabled = !1, this._readonly = !1, this._hoverValue = 0, this._onHostKeyDown = (t) => {
379
+ super(), this._autoAriaLabel = !1, this._settingAutoLabel = !1, this._stars = [], this._value = 0, this._max = 5, this._precision = 1, this._disabled = !1, this._readonly = !1, this._hoverValue = 0, this._onHostKeyDown = (t) => {
380
380
  t.composedPath()[0] === this && this._onRootKeyDown(t, !0);
381
381
  }, this._onRootClick = this._onRootClick.bind(this), this._onRootMouseMove = this._onRootMouseMove.bind(this), this._onRootMouseLeave = this._onRootMouseLeave.bind(this), this._onRootFocusIn = this._onRootFocusIn.bind(this), this._onRootFocusOut = this._onRootFocusOut.bind(this), this._onRootKeyDown = this._onRootKeyDown.bind(this);
382
382
  }
@@ -411,7 +411,7 @@ class q extends M {
411
411
  }
412
412
  attributeChangedCallback(t, e, r) {
413
413
  if (e !== r) {
414
- if (t === "value") {
414
+ if (t === "aria-label" && !this._settingAutoLabel && (this._autoAriaLabel = !1), t === "value") {
415
415
  const s = Number(r);
416
416
  Number.isFinite(s) && (this._value = l(h(s, this._precision), 0, this._max), this._syncStars(), this._syncAria());
417
417
  }
@@ -579,11 +579,11 @@ class q extends M {
579
579
  render() {
580
580
  const t = g(this, "disabled"), e = g(this, "readonly"), r = C(a(this, "variant")), s = $(a(this, "size")), o = a(this, "theme"), n = T(a(this, "tone")), u = I(a(this, "state")), m = y(a(this, "animation")), d = N(a(this, "shape")), v = D(a(this, "radius")), k = A(a(this, "precision")), _ = this._autoAriaLabel ? null : a(this, "aria-label"), f = a(this, "aria-labelledby"), p = a(this, "aria-describedby"), c = a(this, "label"), b = g(this, "show-value"), R = a(this, "value"), S = a(this, "max");
581
581
  this._max = Math.max(1, Number(S) || 5), this._precision = k, this._value = l(h(Number(R) || 0, this._precision), 0, this._max), this._disabled = t, this._readonly = e, m ? this.setAttribute("data-animation", m) : this.removeAttribute("data-animation"), o === "dark" || o === "brand" ? this.setAttribute("theme", o) : this.removeAttribute("theme"), n ? this.setAttribute("tone", n) : this.removeAttribute("tone"), u === "disabled" ? this.setAttribute("state", "disabled") : u !== "idle" ? this.setAttribute("state", u) : this.removeAttribute("state"), d === "square" || d === "pill" ? this.setAttribute("shape", d) : this.removeAttribute("shape"), r === "default" ? this.removeAttribute("variant") : this.setAttribute("variant", r), s === "md" ? this.removeAttribute("size") : this.setAttribute("size", s), v ? this.style.setProperty("--ui-rating-radius", v) : this.style.removeProperty("--ui-rating-radius"), this.setAttribute("precision", String(this._precision));
582
- const E = Array.from({ length: this._max }, (H, L) => `
582
+ const L = Array.from({ length: this._max }, (H, F) => `
583
583
  <span
584
584
  class="star"
585
585
  aria-hidden="true"
586
- data-index="${L}"
586
+ data-index="${F}"
587
587
  part="star"
588
588
  style="--fill-percent: 0%;"
589
589
  >
@@ -596,25 +596,36 @@ class q extends M {
596
596
  </span>
597
597
  </span>
598
598
  </span>
599
- `).join(""), F = b ? `${this._formatValue(this._value)} / ${this._max}` : "";
600
- this.setContent(`
599
+ `).join(""), E = b ? `${this._formatValue(this._value)} / ${this._max}` : "";
600
+ if (this.setContent(`
601
601
  <style>${V}</style>
602
602
  <div
603
603
  class="stars"
604
604
  part="stars"
605
605
  aria-hidden="true"
606
606
  >
607
- ${E}
607
+ ${L}
608
608
  </div>
609
609
  ${c || b ? `
610
610
  <div class="label" part="label">
611
611
  ${c ? `<span class="label-text">${w(c)}</span>` : ""}
612
- ${b ? `<span class="value">${w(F)}</span>` : ""}
612
+ ${b ? `<span class="value">${w(E)}</span>` : ""}
613
613
  </div>
614
614
  ` : ""}
615
615
  `), queueMicrotask(() => {
616
616
  this._stars = Array.from(this.root.querySelectorAll(".star")), this._syncStars();
617
- }), this._autoAriaLabel = !1, _ ? this.setAttribute("aria-label", _) : f ? this.removeAttribute("aria-label") : (this.setAttribute("aria-label", (c || "").trim() || "Rating"), this._autoAriaLabel = !0), f ? this.setAttribute("aria-labelledby", f) : this.removeAttribute("aria-labelledby"), p ? this.setAttribute("aria-describedby", p) : this.removeAttribute("aria-describedby"), this._disabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this._readonly ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), this._syncAria();
617
+ }), this._autoAriaLabel = !1, _) this.setAttribute("aria-label", _);
618
+ else if (f) this.removeAttribute("aria-label");
619
+ else {
620
+ this._settingAutoLabel = !0;
621
+ try {
622
+ this.setAttribute("aria-label", (c || "").trim() || "Rating");
623
+ } finally {
624
+ this._settingAutoLabel = !1;
625
+ }
626
+ this._autoAriaLabel = !0;
627
+ }
628
+ f ? this.setAttribute("aria-labelledby", f) : this.removeAttribute("aria-labelledby"), p ? this.setAttribute("aria-describedby", p) : this.removeAttribute("aria-describedby"), this._disabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this._readonly ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), this._syncAria();
618
629
  }
619
630
  }
620
631
  typeof customElements < "u" && !customElements.get("ui-rating") && customElements.define("ui-rating", q);