@editora/ui-core 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/accordion.cjs.js +3 -3
  2. package/dist/accordion.esm.js +3 -3
  3. package/dist/alert-dialog.cjs.js +32 -32
  4. package/dist/alert-dialog.esm.js +95 -75
  5. package/dist/alert.cjs.js +6 -6
  6. package/dist/alert.esm.js +6 -6
  7. package/dist/animated-list.cjs.js +4 -4
  8. package/dist/animated-list.esm.js +4 -4
  9. package/dist/animated-text.cjs.js +4 -4
  10. package/dist/animated-text.esm.js +4 -4
  11. package/dist/app-header.cjs.js +3 -3
  12. package/dist/app-header.esm.js +3 -3
  13. package/dist/aspect-ratio.cjs.js +3 -3
  14. package/dist/aspect-ratio.esm.js +3 -3
  15. package/dist/avatar.cjs.js +14 -14
  16. package/dist/avatar.esm.js +31 -29
  17. package/dist/badge.cjs.js +4 -4
  18. package/dist/badge.esm.js +4 -4
  19. package/dist/block-controls.cjs.js +4 -4
  20. package/dist/block-controls.esm.js +4 -4
  21. package/dist/box.cjs.js +2 -2
  22. package/dist/box.esm.js +2 -2
  23. package/dist/breadcrumb.cjs.js +5 -5
  24. package/dist/breadcrumb.esm.js +5 -5
  25. package/dist/button.cjs.js +1 -1
  26. package/dist/button.esm.js +1 -1
  27. package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
  28. package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
  29. package/dist/calendar.cjs.js +1 -1
  30. package/dist/calendar.esm.js +1 -1
  31. package/dist/card.cjs.js +8 -8
  32. package/dist/card.esm.js +63 -20
  33. package/dist/chart.cjs.js +4 -4
  34. package/dist/chart.esm.js +6 -6
  35. package/dist/checkbox.cjs.js +2 -2
  36. package/dist/checkbox.esm.js +2 -2
  37. package/dist/collapsible.cjs.js +7 -7
  38. package/dist/collapsible.esm.js +7 -7
  39. package/dist/collection.cjs.js +1 -1
  40. package/dist/collection.esm.js +27 -23
  41. package/dist/color-picker.cjs.js +34 -14
  42. package/dist/color-picker.esm.js +89 -67
  43. package/dist/combobox.cjs.js +29 -27
  44. package/dist/combobox.esm.js +51 -45
  45. package/dist/command.cjs.js +2 -2
  46. package/dist/command.esm.js +2 -2
  47. package/dist/components/ui-alert-dialog.d.ts +1 -0
  48. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  49. package/dist/components/ui-avatar.d.ts +1 -0
  50. package/dist/components/ui-avatar.d.ts.map +1 -1
  51. package/dist/components/ui-button.d.ts +1 -0
  52. package/dist/components/ui-button.d.ts.map +1 -1
  53. package/dist/components/ui-calendar.d.ts.map +1 -1
  54. package/dist/components/ui-card.d.ts +3 -0
  55. package/dist/components/ui-card.d.ts.map +1 -1
  56. package/dist/components/ui-checkbox.d.ts.map +1 -1
  57. package/dist/components/ui-collection.d.ts.map +1 -1
  58. package/dist/components/ui-color-picker.d.ts.map +1 -1
  59. package/dist/components/ui-combobox.d.ts.map +1 -1
  60. package/dist/components/ui-data-table.d.ts.map +1 -1
  61. package/dist/components/ui-date-field.d.ts.map +1 -1
  62. package/dist/components/ui-date-picker.d.ts.map +1 -1
  63. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  64. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  65. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  66. package/dist/components/ui-dock.d.ts +1 -0
  67. package/dist/components/ui-dock.d.ts.map +1 -1
  68. package/dist/components/ui-drawer.d.ts.map +1 -1
  69. package/dist/components/ui-dropdown.d.ts.map +1 -1
  70. package/dist/components/ui-field.d.ts.map +1 -1
  71. package/dist/components/ui-file-upload.d.ts.map +1 -1
  72. package/dist/components/ui-gantt.d.ts.map +1 -1
  73. package/dist/components/ui-input.d.ts.map +1 -1
  74. package/dist/components/ui-menu.d.ts.map +1 -1
  75. package/dist/components/ui-multi-select.d.ts.map +1 -1
  76. package/dist/components/ui-number-field.d.ts.map +1 -1
  77. package/dist/components/ui-password-field.d.ts.map +1 -1
  78. package/dist/components/ui-pin-input.d.ts +1 -0
  79. package/dist/components/ui-pin-input.d.ts.map +1 -1
  80. package/dist/components/ui-placement-grid.d.ts.map +1 -1
  81. package/dist/components/ui-portal.d.ts.map +1 -1
  82. package/dist/components/ui-positioner.d.ts.map +1 -1
  83. package/dist/components/ui-progress.d.ts.map +1 -1
  84. package/dist/components/ui-radio.d.ts.map +1 -1
  85. package/dist/components/ui-rating.d.ts +1 -0
  86. package/dist/components/ui-rating.d.ts.map +1 -1
  87. package/dist/components/ui-select.d.ts.map +1 -1
  88. package/dist/components/ui-sortable.d.ts +8 -0
  89. package/dist/components/ui-sortable.d.ts.map +1 -1
  90. package/dist/components/ui-switch.d.ts.map +1 -1
  91. package/dist/components/ui-table.d.ts.map +1 -1
  92. package/dist/components/ui-tabs.d.ts +1 -0
  93. package/dist/components/ui-tabs.d.ts.map +1 -1
  94. package/dist/components/ui-tags-input.d.ts +1 -0
  95. package/dist/components/ui-tags-input.d.ts.map +1 -1
  96. package/dist/components/ui-textarea.d.ts.map +1 -1
  97. package/dist/components/ui-time-field.d.ts.map +1 -1
  98. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  99. package/dist/components/ui-toggle.d.ts.map +1 -1
  100. package/dist/components/ui-tree.d.ts.map +1 -1
  101. package/dist/components/ui-wizard.d.ts.map +1 -1
  102. package/dist/context-menu.cjs.js +3 -3
  103. package/dist/context-menu.esm.js +4 -4
  104. package/dist/control-name-BmoI1m3a.js +1 -0
  105. package/dist/control-name-Bpj7F34X.mjs +48 -0
  106. package/dist/data-table.cjs.js +5 -2
  107. package/dist/data-table.esm.js +145 -142
  108. package/dist/date-field.cjs.js +5 -5
  109. package/dist/date-field.esm.js +34 -31
  110. package/dist/date-picker.cjs.js +16 -16
  111. package/dist/date-picker.esm.js +48 -44
  112. package/dist/date-range-picker.cjs.js +5 -5
  113. package/dist/date-range-picker.esm.js +120 -118
  114. package/dist/date-range-time-picker.cjs.js +22 -22
  115. package/dist/date-range-time-picker.esm.js +88 -84
  116. package/dist/date-time-picker.cjs.js +26 -26
  117. package/dist/date-time-picker.esm.js +105 -101
  118. package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
  119. package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
  120. package/dist/description.cjs.js +3 -3
  121. package/dist/description.esm.js +3 -3
  122. package/dist/dialog.cjs.js +2 -2
  123. package/dist/dialog.esm.js +2 -2
  124. package/dist/dock.cjs.js +12 -12
  125. package/dist/dock.esm.js +72 -74
  126. package/dist/drawer.cjs.js +19 -19
  127. package/dist/drawer.esm.js +58 -58
  128. package/dist/dropdown.cjs.js +13 -13
  129. package/dist/dropdown.esm.js +49 -48
  130. package/dist/empty-state.cjs.js +3 -3
  131. package/dist/empty-state.esm.js +3 -3
  132. package/dist/field-error.cjs.js +1 -1
  133. package/dist/field-error.esm.js +1 -1
  134. package/dist/field.cjs.js +12 -12
  135. package/dist/field.esm.js +84 -75
  136. package/dist/fieldset.cjs.js +4 -4
  137. package/dist/fieldset.esm.js +4 -4
  138. package/dist/file-upload.cjs.js +3 -3
  139. package/dist/file-upload.esm.js +5 -3
  140. package/dist/floating-toolbar.cjs.js +8 -8
  141. package/dist/floating-toolbar.esm.js +9 -9
  142. package/dist/form.cjs.js +11 -11
  143. package/dist/form.esm.js +11 -11
  144. package/dist/gantt.cjs.js +43 -32
  145. package/dist/gantt.esm.js +99 -88
  146. package/dist/icon-cloud.cjs.js +3 -3
  147. package/dist/icon-cloud.esm.js +3 -3
  148. package/dist/icon.cjs.js +1 -1
  149. package/dist/icon.esm.js +1 -1
  150. package/dist/index.cjs.js +1 -1
  151. package/dist/index.esm.js +121 -118
  152. package/dist/inline-edit.cjs.js +1 -1
  153. package/dist/inline-edit.esm.js +1 -1
  154. package/dist/input.cjs.js +14 -14
  155. package/dist/input.esm.js +39 -32
  156. package/dist/label.cjs.js +3 -3
  157. package/dist/label.esm.js +3 -3
  158. package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
  159. package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
  160. package/dist/listbox.cjs.js +1 -1
  161. package/dist/listbox.esm.js +1 -1
  162. package/dist/marquee.cjs.js +3 -3
  163. package/dist/marquee.esm.js +3 -3
  164. package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
  165. package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
  166. package/dist/menu.cjs.js +7 -7
  167. package/dist/menu.esm.js +29 -28
  168. package/dist/menubar.cjs.js +1 -1
  169. package/dist/menubar.esm.js +2 -2
  170. package/dist/meter.cjs.js +1 -1
  171. package/dist/meter.esm.js +1 -1
  172. package/dist/multi-select.cjs.js +18 -18
  173. package/dist/multi-select.esm.js +82 -66
  174. package/dist/navigation-menu.cjs.js +1 -1
  175. package/dist/navigation-menu.esm.js +1 -1
  176. package/dist/number-field.cjs.js +11 -13
  177. package/dist/number-field.esm.js +29 -27
  178. package/dist/number-ticker.cjs.js +4 -4
  179. package/dist/number-ticker.esm.js +4 -4
  180. package/dist/odometer.cjs.js +2 -2
  181. package/dist/odometer.esm.js +2 -2
  182. package/dist/orbiter.cjs.js +3 -3
  183. package/dist/orbiter.esm.js +3 -3
  184. package/dist/pagination.cjs.js +1 -1
  185. package/dist/pagination.esm.js +1 -1
  186. package/dist/password-field.cjs.js +23 -23
  187. package/dist/password-field.esm.js +48 -47
  188. package/dist/pin-input.cjs.js +8 -6
  189. package/dist/pin-input.esm.js +21 -15
  190. package/dist/placement-grid.cjs.js +4 -4
  191. package/dist/placement-grid.esm.js +58 -58
  192. package/dist/plugin-panel.cjs.js +1 -1
  193. package/dist/plugin-panel.esm.js +1 -1
  194. package/dist/popover.cjs.js +5 -5
  195. package/dist/popover.esm.js +4 -4
  196. package/dist/portal.cjs.js +3 -3
  197. package/dist/portal.esm.js +11 -10
  198. package/dist/positioner.cjs.js +2 -2
  199. package/dist/positioner.esm.js +15 -14
  200. package/dist/primitives/auto-scroll.d.ts +9 -0
  201. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  202. package/dist/primitives/control-name.d.ts +30 -0
  203. package/dist/primitives/control-name.d.ts.map +1 -0
  204. package/dist/primitives/selector.d.ts +4 -0
  205. package/dist/primitives/selector.d.ts.map +1 -0
  206. package/dist/primitives/trigger.d.ts +2 -0
  207. package/dist/primitives/trigger.d.ts.map +1 -0
  208. package/dist/progress.cjs.js +4 -4
  209. package/dist/progress.esm.js +20 -18
  210. package/dist/quick-actions.cjs.js +3 -3
  211. package/dist/quick-actions.esm.js +3 -3
  212. package/dist/radio-group.cjs.js +1 -1
  213. package/dist/radio-group.esm.js +1 -1
  214. package/dist/radio.cjs.js +2 -2
  215. package/dist/radio.esm.js +2 -2
  216. package/dist/rating.cjs.js +17 -16
  217. package/dist/rating.esm.js +91 -92
  218. package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
  219. package/dist/runtime-DwE-tizc.js +1 -0
  220. package/dist/runtime.cjs.js +1 -1
  221. package/dist/runtime.d.ts +1 -1
  222. package/dist/runtime.d.ts.map +1 -1
  223. package/dist/runtime.esm.js +29 -26
  224. package/dist/select.cjs.js +20 -19
  225. package/dist/select.esm.js +36 -32
  226. package/dist/selection-popup.cjs.js +2 -2
  227. package/dist/selection-popup.esm.js +2 -2
  228. package/dist/selector-BvAh35ve.js +1 -0
  229. package/dist/selector-WI8pD7YO.mjs +18 -0
  230. package/dist/separator.cjs.js +7 -7
  231. package/dist/separator.esm.js +7 -7
  232. package/dist/sidebar.cjs.js +7 -7
  233. package/dist/sidebar.esm.js +7 -7
  234. package/dist/skeleton.cjs.js +7 -7
  235. package/dist/skeleton.esm.js +7 -7
  236. package/dist/slider.cjs.js +3 -3
  237. package/dist/slider.esm.js +3 -3
  238. package/dist/slot.cjs.js +3 -3
  239. package/dist/slot.esm.js +3 -3
  240. package/dist/sortable.cjs.js +61 -48
  241. package/dist/sortable.esm.js +636 -554
  242. package/dist/spinning-text.cjs.js +3 -3
  243. package/dist/spinning-text.esm.js +3 -3
  244. package/dist/split-button.cjs.js +1 -1
  245. package/dist/split-button.esm.js +1 -1
  246. package/dist/stepper.cjs.js +1 -1
  247. package/dist/stepper.esm.js +1 -1
  248. package/dist/switch.cjs.js +10 -12
  249. package/dist/switch.esm.js +10 -12
  250. package/dist/table.cjs.js +9 -6
  251. package/dist/table.esm.js +46 -43
  252. package/dist/tabs.cjs.js +22 -23
  253. package/dist/tabs.esm.js +116 -112
  254. package/dist/tags-input.cjs.js +9 -9
  255. package/dist/tags-input.esm.js +32 -25
  256. package/dist/textarea.cjs.js +13 -13
  257. package/dist/textarea.esm.js +46 -31
  258. package/dist/theme.d.ts +18 -0
  259. package/dist/theme.d.ts.map +1 -1
  260. package/dist/time-field.cjs.js +5 -5
  261. package/dist/time-field.esm.js +21 -18
  262. package/dist/time-picker.cjs.js +4 -4
  263. package/dist/time-picker.esm.js +5 -5
  264. package/dist/timeline.cjs.js +2 -2
  265. package/dist/timeline.esm.js +4 -4
  266. package/dist/toast.cjs.js +6 -6
  267. package/dist/toast.esm.js +13 -13
  268. package/dist/toggle-group.cjs.js +5 -6
  269. package/dist/toggle-group.esm.js +63 -60
  270. package/dist/toggle.cjs.js +18 -18
  271. package/dist/toggle.esm.js +32 -31
  272. package/dist/tooltip.cjs.js +4 -4
  273. package/dist/tooltip.esm.js +4 -4
  274. package/dist/transfer-list.cjs.js +32 -32
  275. package/dist/transfer-list.esm.js +57 -57
  276. package/dist/tree-7qbVnpGp.js +39 -0
  277. package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
  278. package/dist/tree.cjs.js +1 -1
  279. package/dist/tree.esm.js +1 -1
  280. package/dist/trigger-BjnxLCeQ.mjs +9 -0
  281. package/dist/trigger-DkPsKxsP.js +1 -0
  282. package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
  283. package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
  284. package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
  285. package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
  286. package/dist/wizard.cjs.js +12 -13
  287. package/dist/wizard.esm.js +17 -15
  288. package/package.json +1 -1
  289. package/dist/runtime-CTaOSmBj.js +0 -1
  290. package/dist/tree-Dx_kv_ih.js +0 -39
@@ -1,5 +1,5 @@
1
- import { E as V } from "./ElementBase-YlTLMsGk.mjs";
2
- const M = `
1
+ import { E as M } from "./ElementBase-YlTLMsGk.mjs";
2
+ const V = `
3
3
  :host {
4
4
  --ui-rating-size: var(--ui-control-size, var(--ui-font-size-lg, 20px));
5
5
  --ui-rating-gap: var(--ui-control-gap, 6px);
@@ -13,6 +13,8 @@ const M = `
13
13
  --ui-rating-easing: var(--ui-motion-easing, cubic-bezier(0.2, 0.8, 0.2, 1));
14
14
  --ui-rating-radius: var(--ui-control-radius, var(--ui-radius, 4px));
15
15
  display: inline-flex;
16
+ flex-wrap: wrap;
17
+ max-inline-size: 100%;
16
18
  align-items: center;
17
19
  gap: var(--ui-rating-gap);
18
20
  color-scheme: light dark;
@@ -28,7 +30,7 @@ const M = `
28
30
  }
29
31
 
30
32
  :host([tone="neutral"]) {
31
- --ui-rating-color: color-mix(in srgb, var(--ui-color-muted, #64748b) 74%, var(--ui-color-text, #0f172a) 26%);
33
+ --ui-rating-color: color-mix(in srgb, var(--ui-color-muted, #526175) 74%, var(--ui-color-text, #0f172a) 26%);
32
34
  }
33
35
 
34
36
  :host([tone="info"]) {
@@ -36,7 +38,7 @@ const M = `
36
38
  }
37
39
 
38
40
  :host([tone="success"]) {
39
- --ui-rating-color: var(--ui-color-success, #16a34a);
41
+ --ui-rating-color: var(--ui-color-success, #15803d);
40
42
  }
41
43
 
42
44
  :host([tone="warning"]) {
@@ -253,7 +255,7 @@ const M = `
253
255
 
254
256
  .label {
255
257
  font-size: var(--ui-font-size-sm, 12px);
256
- color: var(--ui-color-muted, #64748b);
258
+ color: var(--ui-color-muted, #526175);
257
259
  white-space: nowrap;
258
260
  }
259
261
 
@@ -317,68 +319,68 @@ const M = `
317
319
  }
318
320
  }
319
321
  `;
320
- function x(e) {
321
- return e !== null && e.toLowerCase() !== "false" && e !== "0";
322
+ function x(i) {
323
+ return i !== null && i.toLowerCase() !== "false" && i !== "0";
322
324
  }
323
- function C(e) {
324
- return e === "soft" || e === "glass" || e === "contrast" || e === "minimal" ? e : "default";
325
+ function C(i) {
326
+ return i === "soft" || i === "glass" || i === "contrast" || i === "minimal" ? i : "default";
325
327
  }
326
- function $(e) {
327
- return e === "sm" || e === "lg" ? e : "md";
328
+ function $(i) {
329
+ return i === "sm" || i === "lg" ? i : "md";
328
330
  }
329
- function N(e) {
330
- return e === "square" || e === "pill" ? e : "rounded";
331
+ function N(i) {
332
+ return i === "square" || i === "pill" ? i : "rounded";
331
333
  }
332
- function T(e) {
333
- return e === "neutral" || e === "info" || e === "success" || e === "warning" || e === "danger" ? e : null;
334
+ function T(i) {
335
+ return i === "neutral" || i === "info" || i === "success" || i === "warning" || i === "danger" ? i : null;
334
336
  }
335
- function I(e) {
336
- return e === "hover" || e === "focus" || e === "disabled" ? e : "idle";
337
+ function I(i) {
338
+ return i === "hover" || i === "focus" || i === "disabled" ? i : "idle";
337
339
  }
338
- function y(e) {
339
- return e === "scale" || e === "pulse" || e === "none" ? e : null;
340
+ function y(i) {
341
+ return i === "scale" || i === "pulse" || i === "none" ? i : null;
340
342
  }
341
- function q(e) {
342
- if (!e) return null;
343
- const t = e.trim();
343
+ function q(i) {
344
+ if (!i) return null;
345
+ const t = i.trim();
344
346
  return t ? t === "full" ? "999px" : /^-?\\d+(\\.\\d+)?$/.test(t) ? `${t}px` : t : null;
345
347
  }
346
- function A(e) {
347
- const t = Number(e);
348
+ function A(i) {
349
+ const t = Number(i);
348
350
  return !Number.isFinite(t) || t <= 0 ? 1 : t === 0.5 ? 0.5 : 1;
349
351
  }
350
- function l(e, t, i) {
351
- return Math.min(i, Math.max(t, e));
352
+ function n(i, t, e) {
353
+ return Math.min(e, Math.max(t, i));
352
354
  }
353
- function u(e, t) {
354
- const i = Math.round(e / t) * t;
355
- return Number(i.toFixed(2));
355
+ function u(i, t) {
356
+ const e = Math.round(i / t) * t;
357
+ return Number(e.toFixed(2));
356
358
  }
357
- function o(e, t) {
358
- const i = e.getAttribute(t);
359
- if (i != null) return i;
360
- const r = e[t];
359
+ function o(i, t) {
360
+ const e = i.getAttribute(t);
361
+ if (e != null) return e;
362
+ const r = i[t];
361
363
  return typeof r == "string" && r.length > 0 ? r : null;
362
364
  }
363
- function f(e, t) {
364
- const i = e.getAttribute(t);
365
- if (i != null) return x(i);
366
- const r = e[t];
365
+ function g(i, t) {
366
+ const e = i.getAttribute(t);
367
+ if (e != null) return x(e);
368
+ const r = i[t];
367
369
  return typeof r == "boolean" ? r : typeof r == "string" ? x(r) : !1;
368
370
  }
369
- function w(e) {
370
- return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
371
+ function w(i) {
372
+ return i.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
371
373
  }
372
- function z(e) {
374
+ function z(i) {
373
375
  return `
374
- <svg viewBox="0 0 24 24" aria-hidden="true"${e ? ` class="${e}"` : ""}>
376
+ <svg viewBox="0 0 24 24" aria-hidden="true"${i ? ` class="${i}"` : ""}>
375
377
  <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>
376
378
  </svg>
377
379
  `;
378
380
  }
379
- class B extends V {
381
+ class B extends M {
380
382
  constructor() {
381
- super(), this._stars = [], this._value = 0, this._max = 5, this._precision = 1, this._disabled = !1, this._readonly = !1, this._hoverValue = 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);
383
+ 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._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
384
  }
383
385
  static get observedAttributes() {
384
386
  return [
@@ -409,17 +411,17 @@ class B extends V {
409
411
  disconnectedCallback() {
410
412
  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), super.disconnectedCallback();
411
413
  }
412
- attributeChangedCallback(t, i, r) {
413
- if (i !== r) {
414
+ attributeChangedCallback(t, e, r) {
415
+ if (e !== r) {
414
416
  if (t === "value") {
415
417
  const s = Number(r);
416
- Number.isFinite(s) && (this._value = l(u(s, this._precision), 0, this._max), this._syncStars(), this._syncAria());
418
+ Number.isFinite(s) && (this._value = n(u(s, this._precision), 0, this._max), this._syncStars(), this._syncAria());
417
419
  }
418
420
  if (t === "max") {
419
421
  const s = Number(r);
420
422
  Number.isFinite(s) && s > 0 && (this._max = Math.max(1, s), this._value > this._max && (this._value = this._max), this._syncStars(), this._syncAria());
421
423
  }
422
- if (t === "precision" && (this._precision = A(r), this._value = l(u(this._value, this._precision), 0, this._max), this._hoverValue = this._hoverValue > 0 ? l(u(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") {
424
+ if (t === "precision" && (this._precision = A(r), this._value = n(u(this._value, this._precision), 0, this._max), this._hoverValue = this._hoverValue > 0 ? n(u(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") {
423
425
  const s = y(r);
424
426
  s ? this.setAttribute("data-animation", s) : this.removeAttribute("data-animation");
425
427
  }
@@ -430,23 +432,23 @@ class B extends V {
430
432
  return this._value;
431
433
  }
432
434
  set value(t) {
433
- const i = Number(t);
434
- if (!Number.isFinite(i)) return;
435
- const r = l(u(i, this._precision), 0, this._max);
435
+ const e = Number(t);
436
+ if (!Number.isFinite(e)) return;
437
+ const r = n(u(e, this._precision), 0, this._max);
436
438
  this._value !== r && (this._value = r, this.setAttribute("value", String(this._value)), this._syncStars(), this._syncAria(), this._emit("change"), this._emit("input"));
437
439
  }
438
440
  get max() {
439
441
  return this._max;
440
442
  }
441
443
  set max(t) {
442
- const i = Number(t);
443
- Number.isFinite(i) && (this._max = Math.max(1, i), this.setAttribute("max", String(this._max)), this._value > this._max && (this._value = this._max, this.setAttribute("value", String(this._value))), this.requestRender());
444
+ const e = Number(t);
445
+ 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());
444
446
  }
445
447
  get precision() {
446
448
  return this._precision;
447
449
  }
448
450
  set precision(t) {
449
- this._precision = t === 0.5 ? 0.5 : 1, this.setAttribute("precision", String(this._precision)), this._value = l(u(this._value, this._precision), 0, this._max), this.requestRender();
451
+ this._precision = t === 0.5 ? 0.5 : 1, this.setAttribute("precision", String(this._precision)), this._value = n(u(this._value, this._precision), 0, this._max), this.requestRender();
450
452
  }
451
453
  get disabled() {
452
454
  return this._disabled;
@@ -465,16 +467,16 @@ class B extends V {
465
467
  }
466
468
  _getStarIndex(t) {
467
469
  if (!t) return -1;
468
- const i = Number(t.dataset.index);
469
- return Number.isFinite(i) ? i : -1;
470
+ const e = Number(t.dataset.index);
471
+ return Number.isFinite(e) ? e : -1;
470
472
  }
471
- _getValueFromPointer(t, i) {
472
- const r = this._getStarIndex(i);
473
+ _getValueFromPointer(t, e) {
474
+ const r = this._getStarIndex(e);
473
475
  if (r === -1) return this._value;
474
476
  if (this._precision !== 0.5)
475
477
  return r + 1;
476
- const s = i.getBoundingClientRect(), n = t.clientX - s.left <= s.width / 2 ? 0.5 : 1;
477
- return r + n;
478
+ const s = e.getBoundingClientRect(), l = t.clientX - s.left <= s.width / 2 ? 0.5 : 1;
479
+ return r + l;
478
480
  }
479
481
  _formatValue(t) {
480
482
  return Number.isInteger(t) ? String(t) : t.toFixed(1);
@@ -484,20 +486,20 @@ class B extends V {
484
486
  }
485
487
  _onRootClick(t) {
486
488
  if (this._disabled || this._readonly) return;
487
- const i = t, r = this._getStarFromEventTarget(i.target);
488
- r && (this.value = this._getValueFromPointer(i, r));
489
+ const e = t, r = this._getStarFromEventTarget(e.target);
490
+ r && (this.value = this._getValueFromPointer(e, r));
489
491
  }
490
492
  _onRootMouseMove(t) {
491
493
  if (this._disabled || this._readonly) return;
492
- const i = t, r = this._getStarFromEventTarget(i.target);
493
- r && (this._hoverValue = this._getValueFromPointer(i, r), this.setAttribute("state", "hover"), this._syncStars());
494
+ const e = t, r = this._getStarFromEventTarget(e.target);
495
+ r && (this._hoverValue = this._getValueFromPointer(e, r), this.setAttribute("state", "hover"), this._syncStars());
494
496
  }
495
497
  _onRootMouseLeave() {
496
498
  this._disabled || this._readonly || (this._hoverValue = 0, this.removeAttribute("state"), this._syncStars());
497
499
  }
498
500
  _onRootFocusIn(t) {
499
501
  if (this._disabled || this._readonly) return;
500
- const i = this._getStarFromEventTarget(t.target), r = this._getStarIndex(i);
502
+ const e = this._getStarFromEventTarget(t.target), r = this._getStarIndex(e);
501
503
  r !== -1 && (this._hoverValue = r + 1, this.setAttribute("state", "focus"), this._syncStars());
502
504
  }
503
505
  _onRootFocusOut() {
@@ -505,20 +507,20 @@ class B extends V {
505
507
  }
506
508
  _onRootKeyDown(t) {
507
509
  if (this._disabled || this._readonly) return;
508
- const i = t, r = this._getStarFromEventTarget(i.target), s = this._getStarIndex(r);
510
+ const e = t, r = this._getStarFromEventTarget(e.target), s = this._getStarIndex(r);
509
511
  if (s === -1) return;
510
512
  let a = this._value;
511
- const n = this._precision;
512
- switch (i.key) {
513
+ const l = this._precision;
514
+ switch (e.key) {
513
515
  case "ArrowRight":
514
516
  case "ArrowUp":
515
517
  case "+":
516
- a = l(this._value + n, 0, this._max);
518
+ a = n(this._value + l, 0, this._max);
517
519
  break;
518
520
  case "ArrowLeft":
519
521
  case "ArrowDown":
520
522
  case "-":
521
- a = l(this._value - n, 0, this._max);
523
+ a = n(this._value - l, 0, this._max);
522
524
  break;
523
525
  case "Home":
524
526
  a = 0;
@@ -533,34 +535,32 @@ class B extends V {
533
535
  default:
534
536
  return;
535
537
  }
536
- i.preventDefault(), this.value = a;
538
+ e.preventDefault(), this.value = a;
537
539
  }
538
- _getFillPercent(t, i) {
539
- const r = i - (t - 1);
540
+ _getFillPercent(t, e) {
541
+ const r = e - (t - 1);
540
542
  return r >= 1 ? 100 : r <= 0 ? 0 : r * 100;
541
543
  }
542
544
  _syncStars() {
543
545
  const t = this._hoverValue > 0 ? this._hoverValue : this._value;
544
- this._stars.forEach((i, r) => {
546
+ this._stars.forEach((e, r) => {
545
547
  const s = r + 1, a = this._getFillPercent(s, t);
546
- if (i.style.setProperty("--fill-percent", `${a}%`), this._disabled) {
547
- i.setAttribute("data-state", "disabled"), i.setAttribute("aria-disabled", "true");
548
+ if (e.style.setProperty("--fill-percent", `${a}%`), this._disabled) {
549
+ e.setAttribute("data-state", "disabled"), e.setAttribute("aria-disabled", "true");
548
550
  return;
549
551
  }
550
- if (i.removeAttribute("aria-disabled"), this._hoverValue > 0) {
551
- a > 0 ? i.setAttribute("data-state", "hover") : i.removeAttribute("data-state");
552
+ if (e.removeAttribute("aria-disabled"), this._hoverValue > 0) {
553
+ a > 0 ? e.setAttribute("data-state", "hover") : e.removeAttribute("data-state");
552
554
  return;
553
555
  }
554
- a > 0 ? i.setAttribute("data-state", "active") : i.removeAttribute("data-state");
556
+ a > 0 ? e.setAttribute("data-state", "active") : e.removeAttribute("data-state");
555
557
  }), this._syncAria();
556
558
  }
557
559
  _syncAria() {
558
560
  const t = this._getAriaValueText(this._value);
559
- 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((i, r) => {
561
+ 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) => {
560
562
  const s = r + 1, a = this._getFillPercent(s, this._hoverValue > 0 ? this._hoverValue : this._value);
561
- i.setAttribute("role", "presentation"), i.setAttribute("tabindex", "-1"), i.setAttribute("aria-hidden", "true"), i.setAttribute("aria-checked", "false");
562
- const n = this._precision === 0.5 ? `${r + 0.5} to ${r + 1}` : `${r + 1}`;
563
- i.setAttribute("data-fill", String(a)), i.setAttribute("data-star-value", String(s)), i.setAttribute("aria-label", `${n}`);
563
+ e.setAttribute("aria-hidden", "true"), e.setAttribute("data-fill", String(a)), e.setAttribute("data-star-value", String(s));
564
564
  });
565
565
  }
566
566
  _emit(t) {
@@ -579,13 +579,12 @@ class B extends V {
579
579
  );
580
580
  }
581
581
  render() {
582
- const t = f(this, "disabled"), i = f(this, "readonly"), r = C(o(this, "variant")), s = $(o(this, "size")), a = o(this, "theme"), n = T(o(this, "tone")), h = I(o(this, "state")), g = y(o(this, "animation")), c = N(o(this, "shape")), m = q(o(this, "radius")), k = A(o(this, "precision")), v = o(this, "aria-label"), p = o(this, "aria-labelledby"), _ = o(this, "aria-describedby"), d = o(this, "label"), b = f(this, "show-value"), R = o(this, "value"), S = o(this, "max");
583
- this._max = Math.max(1, Number(S) || 5), this._precision = k, this._value = l(u(Number(R) || 0, this._precision), 0, this._max), this._disabled = t, this._readonly = i, g ? this.setAttribute("data-animation", g) : this.removeAttribute("data-animation"), a === "dark" || a === "brand" ? this.setAttribute("theme", a) : this.removeAttribute("theme"), n ? this.setAttribute("tone", n) : this.removeAttribute("tone"), h === "disabled" ? this.setAttribute("state", "disabled") : h !== "idle" ? this.setAttribute("state", h) : this.removeAttribute("state"), c === "square" || c === "pill" ? this.setAttribute("shape", c) : this.removeAttribute("shape"), r === "default" ? this.removeAttribute("variant") : this.setAttribute("variant", r), s === "md" ? this.removeAttribute("size") : this.setAttribute("size", s), m ? this.style.setProperty("--ui-rating-radius", m) : this.style.removeProperty("--ui-rating-radius"), this.setAttribute("precision", String(this._precision));
582
+ const t = g(this, "disabled"), e = g(this, "readonly"), r = C(o(this, "variant")), s = $(o(this, "size")), a = o(this, "theme"), l = T(o(this, "tone")), c = I(o(this, "state")), m = y(o(this, "animation")), d = N(o(this, "shape")), v = q(o(this, "radius")), k = A(o(this, "precision")), p = this._autoAriaLabel ? null : o(this, "aria-label"), f = o(this, "aria-labelledby"), _ = o(this, "aria-describedby"), h = o(this, "label"), b = g(this, "show-value"), R = o(this, "value"), S = o(this, "max");
583
+ this._max = Math.max(1, Number(S) || 5), this._precision = k, this._value = n(u(Number(R) || 0, this._precision), 0, this._max), this._disabled = t, this._readonly = e, m ? this.setAttribute("data-animation", m) : this.removeAttribute("data-animation"), a === "dark" || a === "brand" ? this.setAttribute("theme", a) : this.removeAttribute("theme"), l ? this.setAttribute("tone", l) : this.removeAttribute("tone"), c === "disabled" ? this.setAttribute("state", "disabled") : c !== "idle" ? this.setAttribute("state", c) : 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));
584
584
  const E = Array.from({ length: this._max }, (P, L) => `
585
- <button
586
- type="button"
585
+ <span
587
586
  class="star"
588
- tabindex="-1"
587
+ aria-hidden="true"
589
588
  data-index="${L}"
590
589
  part="star"
591
590
  style="--fill-percent: 0%;"
@@ -598,10 +597,10 @@ class B extends V {
598
597
  </span>
599
598
  </span>
600
599
  </span>
601
- </button>
600
+ </span>
602
601
  `).join(""), F = b ? `${this._formatValue(this._value)} / ${this._max}` : "";
603
602
  this.setContent(`
604
- <style>${M}</style>
603
+ <style>${V}</style>
605
604
  <div
606
605
  class="stars"
607
606
  part="stars"
@@ -609,15 +608,15 @@ class B extends V {
609
608
  >
610
609
  ${E}
611
610
  </div>
612
- ${d || b ? `
611
+ ${h || b ? `
613
612
  <div class="label" part="label">
614
- ${d ? `<span class="label-text">${w(d)}</span>` : ""}
613
+ ${h ? `<span class="label-text">${w(h)}</span>` : ""}
615
614
  ${b ? `<span class="value">${w(F)}</span>` : ""}
616
615
  </div>
617
616
  ` : ""}
618
617
  `), queueMicrotask(() => {
619
618
  this._stars = Array.from(this.root.querySelectorAll(".star")), this._syncStars();
620
- }), v ? this.setAttribute("aria-label", v) : this.removeAttribute("aria-label"), p ? this.setAttribute("aria-labelledby", p) : this.removeAttribute("aria-labelledby"), _ ? this.setAttribute("aria-describedby", _) : this.removeAttribute("aria-describedby"), this._disabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this._readonly ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), this._syncAria();
619
+ }), this._autoAriaLabel = !1, p ? this.setAttribute("aria-label", p) : f ? this.removeAttribute("aria-label") : (this.setAttribute("aria-label", (h || "").trim() || "Rating"), this._autoAriaLabel = !0), f ? this.setAttribute("aria-labelledby", f) : this.removeAttribute("aria-labelledby"), _ ? this.setAttribute("aria-describedby", _) : this.removeAttribute("aria-describedby"), this._disabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this._readonly ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), this._syncAria();
621
620
  }
622
621
  }
623
622
  typeof customElements < "u" && !customElements.get("ui-rating") && customElements.define("ui-rating", B);