@editora/ui-core 0.1.24 → 0.2.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 (318) hide show
  1. package/README.md +339 -5
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +76 -45
  5. package/dist/alert-dialog.esm.js +179 -135
  6. package/dist/alert.cjs.js +41 -32
  7. package/dist/alert.esm.js +79 -70
  8. package/dist/animated-beam.cjs.js +42 -50
  9. package/dist/animated-beam.esm.js +47 -55
  10. package/dist/animated-list.cjs.js +11 -27
  11. package/dist/animated-list.esm.js +12 -28
  12. package/dist/animated-text.cjs.js +4 -4
  13. package/dist/animated-text.esm.js +4 -4
  14. package/dist/app-header.cjs.js +5 -5
  15. package/dist/app-header.esm.js +6 -6
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +13 -17
  19. package/dist/avatar.esm.js +13 -17
  20. package/dist/badge.cjs.js +27 -22
  21. package/dist/badge.esm.js +32 -27
  22. package/dist/block-controls.cjs.js +11 -12
  23. package/dist/block-controls.esm.js +8 -9
  24. package/dist/box.cjs.js +2 -3
  25. package/dist/box.esm.js +2 -3
  26. package/dist/breadcrumb.cjs.js +12 -18
  27. package/dist/breadcrumb.esm.js +11 -17
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.esm.js +1 -1
  30. package/dist/{calendar-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
  31. package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
  32. package/dist/calendar.cjs.js +1 -1
  33. package/dist/calendar.esm.js +1 -1
  34. package/dist/card.cjs.js +6 -7
  35. package/dist/card.esm.js +5 -6
  36. package/dist/chart.cjs.js +52 -52
  37. package/dist/chart.esm.js +95 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +7 -11
  41. package/dist/collapsible.esm.js +7 -11
  42. package/dist/color-picker.cjs.js +36 -17
  43. package/dist/color-picker.esm.js +132 -113
  44. package/dist/combobox.cjs.js +57 -54
  45. package/dist/combobox.esm.js +62 -58
  46. package/dist/command-palette.cjs.js +1 -0
  47. package/dist/command-palette.esm.js +1 -0
  48. package/dist/command.cjs.js +32 -14
  49. package/dist/command.esm.js +46 -28
  50. package/dist/components/date-time-utils.d.ts.map +1 -1
  51. package/dist/components/gantt-schedule.d.ts +79 -0
  52. package/dist/components/gantt-schedule.d.ts.map +1 -0
  53. package/dist/components/ui-accordion.d.ts.map +1 -1
  54. package/dist/components/ui-alert-dialog.d.ts +2 -0
  55. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  56. package/dist/components/ui-alert.d.ts.map +1 -1
  57. package/dist/components/ui-animated-beam.d.ts.map +1 -1
  58. package/dist/components/ui-animated-list.d.ts.map +1 -1
  59. package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
  60. package/dist/components/ui-avatar.d.ts.map +1 -1
  61. package/dist/components/ui-badge.d.ts.map +1 -1
  62. package/dist/components/ui-block-controls.d.ts.map +1 -1
  63. package/dist/components/ui-box.d.ts.map +1 -1
  64. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  65. package/dist/components/ui-button.d.ts.map +1 -1
  66. package/dist/components/ui-calendar.d.ts.map +1 -1
  67. package/dist/components/ui-card.d.ts.map +1 -1
  68. package/dist/components/ui-checkbox.d.ts.map +1 -1
  69. package/dist/components/ui-collapsible.d.ts.map +1 -1
  70. package/dist/components/ui-color-picker.d.ts.map +1 -1
  71. package/dist/components/ui-combobox.d.ts.map +1 -1
  72. package/dist/components/ui-command-palette.d.ts.map +1 -1
  73. package/dist/components/ui-command.d.ts.map +1 -1
  74. package/dist/components/ui-container.d.ts.map +1 -1
  75. package/dist/components/ui-context-menu.d.ts.map +1 -1
  76. package/dist/components/ui-data-table.d.ts +7 -0
  77. package/dist/components/ui-data-table.d.ts.map +1 -1
  78. package/dist/components/ui-date-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  80. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  81. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  82. package/dist/components/ui-dialog.d.ts +2 -0
  83. package/dist/components/ui-dialog.d.ts.map +1 -1
  84. package/dist/components/ui-dock.d.ts.map +1 -1
  85. package/dist/components/ui-drawer.d.ts.map +1 -1
  86. package/dist/components/ui-dropdown.d.ts.map +1 -1
  87. package/dist/components/ui-empty-state.d.ts.map +1 -1
  88. package/dist/components/ui-field.d.ts.map +1 -1
  89. package/dist/components/ui-fieldset.d.ts.map +1 -1
  90. package/dist/components/ui-file-upload.d.ts.map +1 -1
  91. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  92. package/dist/components/ui-form.d.ts.map +1 -1
  93. package/dist/components/ui-gantt.d.ts +186 -2
  94. package/dist/components/ui-gantt.d.ts.map +1 -1
  95. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  96. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  97. package/dist/components/ui-input.d.ts.map +1 -1
  98. package/dist/components/ui-marquee.d.ts.map +1 -1
  99. package/dist/components/ui-menu.d.ts.map +1 -1
  100. package/dist/components/ui-menubar.d.ts.map +1 -1
  101. package/dist/components/ui-meter.d.ts.map +1 -1
  102. package/dist/components/ui-multi-select.d.ts.map +1 -1
  103. package/dist/components/ui-number-field.d.ts.map +1 -1
  104. package/dist/components/ui-orbiter.d.ts.map +1 -1
  105. package/dist/components/ui-pagination.d.ts.map +1 -1
  106. package/dist/components/ui-password-field.d.ts.map +1 -1
  107. package/dist/components/ui-pin-input.d.ts.map +1 -1
  108. package/dist/components/ui-popover.d.ts.map +1 -1
  109. package/dist/components/ui-progress.d.ts.map +1 -1
  110. package/dist/components/ui-radio-group.d.ts.map +1 -1
  111. package/dist/components/ui-radio.d.ts.map +1 -1
  112. package/dist/components/ui-rating.d.ts +1 -0
  113. package/dist/components/ui-rating.d.ts.map +1 -1
  114. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  115. package/dist/components/ui-section.d.ts.map +1 -1
  116. package/dist/components/ui-select.d.ts.map +1 -1
  117. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  118. package/dist/components/ui-slider.d.ts.map +1 -1
  119. package/dist/components/ui-sortable.d.ts.map +1 -1
  120. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  121. package/dist/components/ui-split-button.d.ts.map +1 -1
  122. package/dist/components/ui-splitter.d.ts.map +1 -1
  123. package/dist/components/ui-stepper.d.ts.map +1 -1
  124. package/dist/components/ui-switch.d.ts.map +1 -1
  125. package/dist/components/ui-tabs.d.ts.map +1 -1
  126. package/dist/components/ui-tags-input.d.ts.map +1 -1
  127. package/dist/components/ui-textarea.d.ts.map +1 -1
  128. package/dist/components/ui-time-picker.d.ts.map +1 -1
  129. package/dist/components/ui-toggle-group.d.ts +2 -0
  130. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  131. package/dist/components/ui-toggle.d.ts.map +1 -1
  132. package/dist/components/ui-toolbar.d.ts +2 -0
  133. package/dist/components/ui-toolbar.d.ts.map +1 -1
  134. package/dist/components/ui-tooltip.d.ts.map +1 -1
  135. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  136. package/dist/components/ui-tree-item.d.ts.map +1 -1
  137. package/dist/components/ui-tree.d.ts.map +1 -1
  138. package/dist/components/ui-wizard.d.ts.map +1 -1
  139. package/dist/container.cjs.js +6 -12
  140. package/dist/container.esm.js +8 -14
  141. package/dist/context-menu.cjs.js +8 -8
  142. package/dist/context-menu.esm.js +42 -41
  143. package/dist/data-table.cjs.js +18 -15
  144. package/dist/data-table.esm.js +207 -187
  145. package/dist/date-field.cjs.js +8 -8
  146. package/dist/date-field.esm.js +7 -7
  147. package/dist/date-picker.cjs.js +27 -18
  148. package/dist/date-picker.esm.js +57 -48
  149. package/dist/date-range-picker.cjs.js +22 -17
  150. package/dist/date-range-picker.esm.js +31 -26
  151. package/dist/date-range-time-picker.cjs.js +26 -19
  152. package/dist/date-range-time-picker.esm.js +23 -16
  153. package/dist/date-time-picker.cjs.js +23 -16
  154. package/dist/date-time-picker.esm.js +88 -81
  155. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
  156. package/dist/date-time-utils-DdigV4hs.js +1 -0
  157. package/dist/dialog.cjs.js +57 -41
  158. package/dist/dialog.esm.js +84 -51
  159. package/dist/dock.cjs.js +16 -30
  160. package/dist/dock.esm.js +26 -40
  161. package/dist/drawer.cjs.js +8 -12
  162. package/dist/drawer.esm.js +6 -10
  163. package/dist/dropdown.cjs.js +8 -6
  164. package/dist/dropdown.esm.js +33 -30
  165. package/dist/empty-state.cjs.js +17 -15
  166. package/dist/empty-state.esm.js +13 -11
  167. package/dist/field.cjs.js +22 -13
  168. package/dist/field.esm.js +54 -45
  169. package/dist/fieldset.cjs.js +18 -11
  170. package/dist/fieldset.esm.js +20 -13
  171. package/dist/file-upload.cjs.js +77 -35
  172. package/dist/file-upload.esm.js +152 -110
  173. package/dist/floating-toolbar.cjs.js +6 -7
  174. package/dist/floating-toolbar.esm.js +8 -9
  175. package/dist/form.cjs.js +20 -23
  176. package/dist/form.esm.js +20 -23
  177. package/dist/gantt.cjs.js +525 -110
  178. package/dist/gantt.esm.js +1882 -377
  179. package/dist/hover-card.cjs.js +7 -7
  180. package/dist/hover-card.esm.js +7 -7
  181. package/dist/icon-cloud.cjs.js +19 -36
  182. package/dist/icon-cloud.esm.js +41 -58
  183. package/dist/index.cjs.js +1 -1
  184. package/dist/index.d.ts +2 -0
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.esm.js +108 -104
  187. package/dist/inline-edit.cjs.js +47 -19
  188. package/dist/inline-edit.esm.js +66 -38
  189. package/dist/input.cjs.js +44 -37
  190. package/dist/input.esm.js +59 -52
  191. package/dist/layout.cjs.js +3 -3
  192. package/dist/layout.esm.js +3 -3
  193. package/dist/marquee.cjs.js +7 -10
  194. package/dist/marquee.esm.js +7 -10
  195. package/dist/menu.cjs.js +8 -24
  196. package/dist/menu.esm.js +52 -72
  197. package/dist/menubar.cjs.js +9 -31
  198. package/dist/menubar.esm.js +127 -153
  199. package/dist/meter.cjs.js +4 -9
  200. package/dist/meter.esm.js +6 -11
  201. package/dist/multi-select.cjs.js +48 -35
  202. package/dist/multi-select.esm.js +67 -53
  203. package/dist/navigation-menu.cjs.js +10 -10
  204. package/dist/navigation-menu.esm.js +33 -33
  205. package/dist/number-field.cjs.js +27 -16
  206. package/dist/number-field.esm.js +36 -25
  207. package/dist/odometer.cjs.js +5 -5
  208. package/dist/odometer.esm.js +3 -3
  209. package/dist/orbiter.cjs.js +11 -28
  210. package/dist/orbiter.esm.js +28 -45
  211. package/dist/overlay-motion-B56x1GoY.js +49 -0
  212. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  213. package/dist/pagination.cjs.js +28 -25
  214. package/dist/pagination.esm.js +54 -51
  215. package/dist/password-field.cjs.js +38 -33
  216. package/dist/password-field.esm.js +62 -57
  217. package/dist/pin-input.cjs.js +17 -13
  218. package/dist/pin-input.esm.js +23 -19
  219. package/dist/plugin-panel.cjs.js +1 -1
  220. package/dist/plugin-panel.esm.js +1 -1
  221. package/dist/popover.cjs.js +16 -28
  222. package/dist/popover.esm.js +29 -45
  223. package/dist/portal-DeaM1tYY.mjs +121 -0
  224. package/dist/portal-XbYR3m_q.js +1 -0
  225. package/dist/portal.d.ts +3 -1
  226. package/dist/portal.d.ts.map +1 -1
  227. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  228. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  229. package/dist/positioner.cjs.js +1 -1
  230. package/dist/positioner.esm.js +1 -1
  231. package/dist/primitives/overlay-motion.d.ts +47 -0
  232. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  233. package/dist/primitives/positioner.d.ts.map +1 -1
  234. package/dist/progress.cjs.js +11 -16
  235. package/dist/progress.esm.js +37 -42
  236. package/dist/quick-actions.cjs.js +13 -13
  237. package/dist/quick-actions.esm.js +11 -11
  238. package/dist/radio-group.cjs.js +50 -26
  239. package/dist/radio-group.esm.js +53 -29
  240. package/dist/radio.cjs.js +15 -12
  241. package/dist/radio.esm.js +15 -12
  242. package/dist/rating.cjs.js +11 -15
  243. package/dist/rating.esm.js +48 -50
  244. package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
  245. package/dist/runtime-DxCl0A5q.js +5 -0
  246. package/dist/runtime.cjs.js +1 -1
  247. package/dist/runtime.d.ts +3 -2
  248. package/dist/runtime.d.ts.map +1 -1
  249. package/dist/runtime.esm.js +36 -32
  250. package/dist/scroll-area.cjs.js +3 -4
  251. package/dist/scroll-area.esm.js +3 -4
  252. package/dist/section.cjs.js +2 -4
  253. package/dist/section.esm.js +2 -4
  254. package/dist/select.cjs.js +40 -73
  255. package/dist/select.esm.js +55 -87
  256. package/dist/selection-popup.cjs.js +3 -4
  257. package/dist/selection-popup.esm.js +3 -4
  258. package/dist/semantic-tokens.d.ts +17 -0
  259. package/dist/semantic-tokens.d.ts.map +1 -0
  260. package/dist/sidebar.cjs.js +22 -22
  261. package/dist/sidebar.esm.js +25 -25
  262. package/dist/skeleton.cjs.js +2 -2
  263. package/dist/skeleton.esm.js +2 -2
  264. package/dist/slider.cjs.js +22 -26
  265. package/dist/slider.esm.js +25 -29
  266. package/dist/sortable.cjs.js +4 -5
  267. package/dist/sortable.esm.js +4 -5
  268. package/dist/spinning-text.cjs.js +4 -13
  269. package/dist/spinning-text.esm.js +4 -13
  270. package/dist/split-button.cjs.js +5 -5
  271. package/dist/split-button.esm.js +15 -14
  272. package/dist/splitter.cjs.js +52 -10
  273. package/dist/splitter.esm.js +55 -13
  274. package/dist/stepper.cjs.js +31 -65
  275. package/dist/stepper.esm.js +32 -66
  276. package/dist/switch.cjs.js +20 -22
  277. package/dist/switch.esm.js +20 -22
  278. package/dist/table.cjs.js +5 -5
  279. package/dist/table.esm.js +20 -20
  280. package/dist/tabs.cjs.js +91 -21
  281. package/dist/tabs.esm.js +182 -112
  282. package/dist/tags-input.cjs.js +41 -15
  283. package/dist/tags-input.esm.js +73 -47
  284. package/dist/textarea.cjs.js +32 -33
  285. package/dist/textarea.esm.js +38 -39
  286. package/dist/theme.d.ts +25 -1
  287. package/dist/theme.d.ts.map +1 -1
  288. package/dist/time-field.cjs.js +7 -7
  289. package/dist/time-field.esm.js +6 -6
  290. package/dist/time-picker.cjs.js +16 -13
  291. package/dist/time-picker.esm.js +27 -24
  292. package/dist/timeline.cjs.js +10 -10
  293. package/dist/timeline.esm.js +7 -7
  294. package/dist/toggle-group.cjs.js +13 -13
  295. package/dist/toggle-group.esm.js +66 -61
  296. package/dist/toggle.cjs.js +52 -34
  297. package/dist/toggle.esm.js +80 -62
  298. package/dist/toolbar.cjs.js +14 -14
  299. package/dist/toolbar.esm.js +41 -33
  300. package/dist/tooltip.cjs.js +3 -3
  301. package/dist/tooltip.esm.js +39 -33
  302. package/dist/transfer-list.cjs.js +28 -29
  303. package/dist/transfer-list.esm.js +28 -29
  304. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  305. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  306. package/dist/tree-item.cjs.js +9 -8
  307. package/dist/tree-item.esm.js +13 -12
  308. package/dist/tree.cjs.js +1 -1
  309. package/dist/tree.esm.js +1 -1
  310. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  311. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  312. package/dist/wizard.cjs.js +39 -36
  313. package/dist/wizard.esm.js +39 -36
  314. package/package.json +1 -1
  315. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  316. package/dist/portal-DgpQ3Jo1.js +0 -1
  317. package/dist/portal-bR42gHvG.mjs +0 -118
  318. package/dist/runtime-DwE-tizc.js +0 -1
@@ -1,17 +1,17 @@
1
1
  import { E as q } from "./ElementBase-BeZT54Hj.mjs";
2
- import { r as O, e as F, l as U, i as A, s as N, c as V } from "./date-time-utils-BTlxnz5j.mjs";
3
- function g(s, t, e) {
4
- return Math.max(t, Math.min(e, s));
2
+ import { r as O, e as F, l as U, i as A, s as N, c as V } from "./date-time-utils-B4hAkt36.mjs";
3
+ function g(o, t, e) {
4
+ return Math.max(t, Math.min(e, o));
5
5
  }
6
- function m(s, t = 3) {
6
+ function m(o, t = 3) {
7
7
  const e = 10 ** t;
8
- return Math.round(s * e) / e;
8
+ return Math.round(o * e) / e;
9
9
  }
10
- function S(s) {
11
- return g(Math.round(s), 0, 255);
10
+ function S(o) {
11
+ return g(Math.round(o), 0, 255);
12
12
  }
13
- function D(s) {
14
- const t = s.trim();
13
+ function D(o) {
14
+ const t = o.trim();
15
15
  if (!t) return null;
16
16
  if (t.endsWith("%")) {
17
17
  const r = Number(t.slice(0, -1));
@@ -20,8 +20,8 @@ function D(s) {
20
20
  const e = Number(t);
21
21
  return Number.isFinite(e) ? g(e, 0, 1) : null;
22
22
  }
23
- function C(s) {
24
- const t = s.trim();
23
+ function C(o) {
24
+ const t = o.trim();
25
25
  if (!t) return null;
26
26
  if (t.endsWith("%")) {
27
27
  const r = Number(t.slice(0, -1));
@@ -30,14 +30,14 @@ function C(s) {
30
30
  const e = Number(t);
31
31
  return Number.isFinite(e) ? S(e) : null;
32
32
  }
33
- function B(s) {
34
- const t = s.trim();
33
+ function B(o) {
34
+ const t = o.trim();
35
35
  if (!t.endsWith("%")) return null;
36
36
  const e = Number(t.slice(0, -1));
37
37
  return Number.isFinite(e) ? g(e, 0, 100) : null;
38
38
  }
39
- function W(s) {
40
- const t = s.trim().toLowerCase();
39
+ function W(o) {
40
+ const t = o.trim().toLowerCase();
41
41
  if (!t) return null;
42
42
  if (t.endsWith("deg")) {
43
43
  const r = Number(t.slice(0, -3));
@@ -54,12 +54,12 @@ function W(s) {
54
54
  const e = Number(t);
55
55
  return Number.isFinite(e) ? y(e) : null;
56
56
  }
57
- function y(s) {
58
- const t = s % 360;
57
+ function y(o) {
58
+ const t = o % 360;
59
59
  return t < 0 ? t + 360 : t;
60
60
  }
61
- function T(s) {
62
- const t = s.trim();
61
+ function T(o) {
62
+ const t = o.trim();
63
63
  if (!t) return null;
64
64
  if (t.includes("/")) {
65
65
  const [r, i] = t.split("/");
@@ -83,18 +83,18 @@ function T(s) {
83
83
  alpha: e[3] ?? null
84
84
  };
85
85
  }
86
- function K(s) {
87
- const t = s.trim().replace(/^#/, "");
86
+ function K(o) {
87
+ const t = o.trim().replace(/^#/, "");
88
88
  if (![3, 4, 6, 8].includes(t.length) || !/^[0-9a-f]+$/i.test(t)) return null;
89
89
  if (t.length === 3 || t.length === 4) {
90
- const n = parseInt(t[0] + t[0], 16), o = parseInt(t[1] + t[1], 16), l = parseInt(t[2] + t[2], 16), c = t.length === 4 ? parseInt(t[3] + t[3], 16) / 255 : 1;
91
- return b({ r: n, g: o, b: l, a: c });
90
+ const n = parseInt(t[0] + t[0], 16), s = parseInt(t[1] + t[1], 16), l = parseInt(t[2] + t[2], 16), c = t.length === 4 ? parseInt(t[3] + t[3], 16) / 255 : 1;
91
+ return b({ r: n, g: s, b: l, a: c });
92
92
  }
93
93
  const e = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
94
94
  return b({ r: e, g: r, b: i, a });
95
95
  }
96
- function G(s) {
97
- const t = /^rgba?\((.+)\)$/i.exec(s.trim());
96
+ function G(o) {
97
+ const t = /^rgba?\((.+)\)$/i.exec(o.trim());
98
98
  if (!t) return null;
99
99
  const e = T(t[1]);
100
100
  if (!e || e.channels.length < 3) return null;
@@ -103,8 +103,8 @@ function G(s) {
103
103
  const n = e.alpha != null ? D(e.alpha) : 1;
104
104
  return n == null ? null : b({ r, g: i, b: a, a: n });
105
105
  }
106
- function X(s) {
107
- const t = /^hsla?\((.+)\)$/i.exec(s.trim());
106
+ function X(o) {
107
+ const t = /^hsla?\((.+)\)$/i.exec(o.trim());
108
108
  if (!t) return null;
109
109
  const e = T(t[1]);
110
110
  if (!e || e.channels.length < 3) return null;
@@ -113,35 +113,35 @@ function X(s) {
113
113
  const n = e.alpha != null ? D(e.alpha) : 1;
114
114
  return n == null ? null : $({ h: r, s: i, l: a, a: n });
115
115
  }
116
- function b(s) {
116
+ function b(o) {
117
117
  return {
118
- r: S(s.r),
119
- g: S(s.g),
120
- b: S(s.b),
121
- a: m(g(s.a, 0, 1), 4)
118
+ r: S(o.r),
119
+ g: S(o.g),
120
+ b: S(o.b),
121
+ a: m(g(o.a, 0, 1), 4)
122
122
  };
123
123
  }
124
- function f(s) {
125
- const t = (s || "").trim();
124
+ function v(o) {
125
+ const t = (o || "").trim();
126
126
  return t ? t.startsWith("#") ? K(t) : /^rgba?\(/i.test(t) ? G(t) : /^hsla?\(/i.test(t) ? X(t) : null : null;
127
127
  }
128
- function Y(s, t = !1) {
129
- const e = b(s), r = (a) => a.toString(16).padStart(2, "0"), i = `#${r(e.r)}${r(e.g)}${r(e.b)}`;
128
+ function Y(o, t = !1) {
129
+ const e = b(o), r = (a) => a.toString(16).padStart(2, "0"), i = `#${r(e.r)}${r(e.g)}${r(e.b)}`;
130
130
  return t ? `${i}${r(Math.round(e.a * 255))}` : i;
131
131
  }
132
- function j(s, t = !0) {
133
- const e = b(s);
132
+ function j(o, t = !0) {
133
+ const e = b(o);
134
134
  return !t || e.a >= 1 ? `rgb(${e.r} ${e.g} ${e.b})` : `rgb(${e.r} ${e.g} ${e.b} / ${m(e.a, 3)})`;
135
135
  }
136
- function J(s, t = !0) {
137
- const e = Math.round(y(s.h)), r = Math.round(g(s.s, 0, 100)), i = Math.round(g(s.l, 0, 100)), a = m(g(s.a, 0, 1), 3);
136
+ function J(o, t = !0) {
137
+ const e = Math.round(y(o.h)), r = Math.round(g(o.s, 0, 100)), i = Math.round(g(o.l, 0, 100)), a = m(g(o.a, 0, 1), 3);
138
138
  return !t || a >= 1 ? `hsl(${e} ${r}% ${i}%)` : `hsl(${e} ${r}% ${i}% / ${a})`;
139
139
  }
140
- function z(s) {
141
- const t = b(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n;
140
+ function z(o) {
141
+ const t = b(o), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), s = a - n;
142
142
  let l = 0;
143
- o !== 0 && (a === e ? l = (r - i) / o % 6 : a === r ? l = (i - e) / o + 2 : l = (e - r) / o + 4, l *= 60, l < 0 && (l += 360));
144
- const c = a === 0 ? 0 : o / a * 100, p = a * 100;
143
+ s !== 0 && (a === e ? l = (r - i) / s % 6 : a === r ? l = (i - e) / s + 2 : l = (e - r) / s + 4, l *= 60, l < 0 && (l += 360));
144
+ const c = a === 0 ? 0 : s / a * 100, p = a * 100;
145
145
  return {
146
146
  h: m(l, 3),
147
147
  s: m(c, 3),
@@ -149,44 +149,44 @@ function z(s) {
149
149
  a: t.a
150
150
  };
151
151
  }
152
- function Q(s) {
153
- const t = y(s.h), e = g(s.s, 0, 100) / 100, r = g(s.v, 0, 100) / 100, i = r * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i;
154
- let o = 0, l = 0, c = 0;
155
- return t < 60 ? (o = i, l = a) : t < 120 ? (o = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (o = a, c = i) : (o = i, c = a), b({
156
- r: (o + n) * 255,
152
+ function Q(o) {
153
+ const t = y(o.h), e = g(o.s, 0, 100) / 100, r = g(o.v, 0, 100) / 100, i = r * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i;
154
+ let s = 0, l = 0, c = 0;
155
+ return t < 60 ? (s = i, l = a) : t < 120 ? (s = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (s = a, c = i) : (s = i, c = a), b({
156
+ r: (s + n) * 255,
157
157
  g: (l + n) * 255,
158
158
  b: (c + n) * 255,
159
- a: s.a
159
+ a: o.a
160
160
  });
161
161
  }
162
- function M(s) {
163
- const t = b(s), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), o = a - n, l = (a + n) / 2;
162
+ function M(o) {
163
+ const t = b(o), e = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(e, r, i), n = Math.min(e, r, i), s = a - n, l = (a + n) / 2;
164
164
  let c = 0, p = 0;
165
- return o !== 0 && (p = o / (1 - Math.abs(2 * l - 1)), a === e ? c = (r - i) / o % 6 : a === r ? c = (i - e) / o + 2 : c = (e - r) / o + 4, c *= 60, c < 0 && (c += 360)), {
165
+ return s !== 0 && (p = s / (1 - Math.abs(2 * l - 1)), a === e ? c = (r - i) / s % 6 : a === r ? c = (i - e) / s + 2 : c = (e - r) / s + 4, c *= 60, c < 0 && (c += 360)), {
166
166
  h: m(c, 3),
167
167
  s: m(p * 100, 3),
168
168
  l: m(l * 100, 3),
169
169
  a: t.a
170
170
  };
171
171
  }
172
- function $(s) {
173
- const t = y(s.h), e = g(s.s, 0, 100) / 100, r = g(s.l, 0, 100) / 100, i = (1 - Math.abs(2 * r - 1)) * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i / 2;
174
- let o = 0, l = 0, c = 0;
175
- return t < 60 ? (o = i, l = a) : t < 120 ? (o = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (o = a, c = i) : (o = i, c = a), b({
176
- r: (o + n) * 255,
172
+ function $(o) {
173
+ const t = y(o.h), e = g(o.s, 0, 100) / 100, r = g(o.l, 0, 100) / 100, i = (1 - Math.abs(2 * r - 1)) * e, a = i * (1 - Math.abs(t / 60 % 2 - 1)), n = r - i / 2;
174
+ let s = 0, l = 0, c = 0;
175
+ return t < 60 ? (s = i, l = a) : t < 120 ? (s = a, l = i) : t < 180 ? (l = i, c = a) : t < 240 ? (l = a, c = i) : t < 300 ? (s = a, c = i) : (s = i, c = a), b({
176
+ r: (s + n) * 255,
177
177
  g: (l + n) * 255,
178
178
  b: (c + n) * 255,
179
- a: s.a
179
+ a: o.a
180
180
  });
181
181
  }
182
- function _(s, t) {
183
- return Y(s, t).toUpperCase();
182
+ function _(o, t) {
183
+ return Y(o, t).toUpperCase();
184
184
  }
185
- function w(s, t) {
186
- return j(s, t);
185
+ function w(o, t) {
186
+ return j(o, t);
187
187
  }
188
- function Z(s, t) {
189
- return J(M(s), t);
188
+ function Z(o, t) {
189
+ return J(M(o), t);
190
190
  }
191
191
  const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
192
192
  <svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
@@ -194,15 +194,15 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
194
194
  </svg>
195
195
  `, H = `
196
196
  :host {
197
- --ui-cp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
198
- --ui-cp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent);
197
+ --ui-cp-bg: var(--color-panel-solid, var(--ui-color-surface, #ffffff));
198
+ --ui-cp-border: var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent));
199
199
  --ui-cp-text: var(--ui-color-text, #0f172a);
200
200
  --ui-cp-muted: var(--ui-color-muted, #526175);
201
201
  --ui-cp-accent: var(--ui-color-primary, #2563eb);
202
202
  --ui-cp-success: var(--ui-color-success, #15803d);
203
203
  --ui-cp-warning: var(--ui-color-warning, #b45309);
204
204
  --ui-cp-danger: var(--ui-color-danger, #dc2626);
205
- --ui-cp-radius: 14px;
205
+ --ui-cp-radius: calc(var(--ui-radius, 6px) + 2px);
206
206
  --ui-cp-shadow: none;
207
207
  --ui-cp-padding: 10px;
208
208
  --ui-cp-duration: 160ms;
@@ -457,7 +457,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
457
457
  color: var(--ui-cp-text);
458
458
  min-inline-size: 32px;
459
459
  block-size: 30px;
460
- border-radius: 9px;
460
+ border-radius: var(--ui-control-radius-1, var(--ui-radius, 6px));
461
461
  padding: 0 8px;
462
462
  display: inline-grid;
463
463
  place-items: center;
@@ -497,7 +497,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
497
497
  position: relative;
498
498
  inline-size: 100%;
499
499
  block-size: clamp(128px, 16vw, 156px);
500
- border-radius: 10px;
500
+ border-radius: var(--ui-control-radius-3, var(--ui-radius, 6px));
501
501
  border: 1px solid color-mix(in srgb, var(--ui-cp-border) 82%, transparent);
502
502
  overflow: visible;
503
503
  cursor: crosshair;
@@ -602,7 +602,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
602
602
  display: inline-grid;
603
603
  grid-template-columns: repeat(3, minmax(0, 1fr));
604
604
  border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
605
- border-radius: 10px;
605
+ border-radius: var(--ui-control-radius-3, var(--ui-radius, 6px));
606
606
  overflow: hidden;
607
607
  }
608
608
 
@@ -618,6 +618,11 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
618
618
  color var(--ui-cp-duration) var(--ui-cp-ease);
619
619
  }
620
620
 
621
+ .tab:hover:not([data-active="true"]) {
622
+ background: color-mix(in srgb, var(--ui-cp-accent) 8%, transparent);
623
+ color: var(--ui-cp-text);
624
+ }
625
+
621
626
  .tab[data-active="true"] {
622
627
  background: color-mix(in srgb, var(--ui-cp-accent) 15%, transparent);
623
628
  color: var(--ui-cp-text);
@@ -665,7 +670,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
665
670
  min-inline-size: 0;
666
671
  inline-size: 100%;
667
672
  min-block-size: 28px;
668
- border-radius: 8px;
673
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
669
674
  border: 1px solid color-mix(in srgb, var(--ui-cp-border) 86%, transparent);
670
675
  background: color-mix(in srgb, var(--ui-cp-bg) 95%, transparent);
671
676
  color: var(--ui-cp-text);
@@ -714,9 +719,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
714
719
  }
715
720
 
716
721
  .swatch:hover {
717
- transform: translateY(-1px);
718
- border-color: color-mix(in srgb, var(--ui-cp-accent) 40%, var(--ui-cp-border));
719
- box-shadow: 0 2px 8px rgba(2, 6, 23, 0.18);
722
+ border-color: color-mix(in srgb, var(--ui-cp-accent) 55%, var(--ui-cp-border));
720
723
  }
721
724
 
722
725
  .swatch[data-selected="true"] {
@@ -747,7 +750,7 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
747
750
 
748
751
  .actions .btn {
749
752
  min-block-size: 28px;
750
- border-radius: 9px;
753
+ border-radius: var(--ui-control-radius-2, var(--ui-radius, 6px));
751
754
  border: 1px solid color-mix(in srgb, var(--ui-cp-border) 84%, transparent);
752
755
  background: color-mix(in srgb, var(--ui-cp-bg) 95%, transparent);
753
756
  color: var(--ui-cp-text);
@@ -760,9 +763,25 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
760
763
  color var(--ui-cp-duration) var(--ui-cp-ease);
761
764
  }
762
765
 
766
+ .actions .btn:hover {
767
+ background: color-mix(in srgb, var(--ui-cp-accent) 10%, var(--ui-cp-bg));
768
+ border-color: color-mix(in srgb, var(--ui-cp-accent) 34%, var(--ui-cp-border));
769
+ }
770
+
771
+ .actions .btn[data-tone="primary"]:hover {
772
+ border-color: transparent;
773
+ background: color-mix(in srgb, var(--ui-color-primary, var(--ui-cp-accent)) 88%, #000);
774
+ }
775
+
776
+ .actions .btn:focus-visible {
777
+ outline: 2px solid color-mix(in srgb, var(--ui-cp-accent) 64%, transparent);
778
+ outline-offset: 2px;
779
+ }
780
+
763
781
  .actions .btn[data-tone="primary"] {
764
- border-color: color-mix(in srgb, var(--ui-cp-accent) 62%, transparent);
765
- background: color-mix(in srgb, var(--ui-cp-accent) 18%, transparent);
782
+ border-color: transparent;
783
+ background: var(--ui-color-primary, var(--ui-cp-accent));
784
+ color: var(--ui-color-foreground-on-primary, #ffffff);
766
785
  }
767
786
 
768
787
  .actions .btn[hidden] {
@@ -897,18 +916,18 @@ const I = "#2563eb", L = "editora:ui-color-picker:recent", tt = `
897
916
  overflow: auto;
898
917
  }
899
918
  `;
900
- function u(s, t, e) {
901
- return Math.max(t, Math.min(e, s));
919
+ function u(o, t, e) {
920
+ return Math.max(t, Math.min(e, o));
902
921
  }
903
- function E(s, t) {
904
- return Math.abs(s - t) <= 5e-4;
922
+ function E(o, t) {
923
+ return Math.abs(o - t) <= 5e-4;
905
924
  }
906
- function k(s) {
907
- return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
925
+ function k(o) {
926
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
908
927
  }
909
928
  class rt extends q {
910
929
  constructor() {
911
- super(), this._syncing = !1, this._initialized = !1, this._rgba = b(f(I) || { r: 37, g: 99, b: 235, a: 1 }), this._hsva = z(this._rgba), this._format = "hex", this._open = !1, this._error = "", this._presets = [], this._recentColors = [], this._panelCache = /* @__PURE__ */ new WeakMap(), this._overlay = null, this._overlayRoot = null, this._releaseScrollLock = null, this._restoreFocusEl = null, this._isSheetOpen = !1, this._dragTarget = null, this._dragPointerId = -1, this._dragRect = null, this._dragX = 0, this._dragY = 0, this._dragRaf = 0, this._dragChanged = !1, this._dragSource = "drag", this._renderingSwatches = !1, this._scheduleOverlayPosition = O(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onPanelClick(t, "root"), this._onRootInputBound = (t) => this._onPanelInput(t, "root"), this._onRootChangeBound = (t) => this._onPanelChange(t, "root"), this._onRootKeyDownBound = (t) => this._onPanelKeyDown(t, "root"), this._onRootPointerDownBound = (t) => this._onPanelPointerDown(t, "root"), this._onRootPointerMoveBound = (t) => this._onPanelPointerMove(t), this._onRootPointerUpBound = (t) => this._onPanelPointerUp(t), this._onRootPointerCancelBound = (t) => this._onPanelPointerCancel(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._scheduleOverlayPosition.run(), this._onWindowScrollBound = (t) => {
930
+ super(), this._syncing = !1, this._initialized = !1, this._rgba = b(v(I) || { r: 37, g: 99, b: 235, a: 1 }), this._hsva = z(this._rgba), this._format = "hex", this._open = !1, this._error = "", this._presets = [], this._recentColors = [], this._panelCache = /* @__PURE__ */ new WeakMap(), this._overlay = null, this._overlayRoot = null, this._releaseScrollLock = null, this._restoreFocusEl = null, this._isSheetOpen = !1, this._dragTarget = null, this._dragPointerId = -1, this._dragRect = null, this._dragX = 0, this._dragY = 0, this._dragRaf = 0, this._dragChanged = !1, this._dragSource = "drag", this._renderingSwatches = !1, this._scheduleOverlayPosition = O(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onPanelClick(t, "root"), this._onRootInputBound = (t) => this._onPanelInput(t, "root"), this._onRootChangeBound = (t) => this._onPanelChange(t, "root"), this._onRootKeyDownBound = (t) => this._onPanelKeyDown(t, "root"), this._onRootPointerDownBound = (t) => this._onPanelPointerDown(t, "root"), this._onRootPointerMoveBound = (t) => this._onPanelPointerMove(t), this._onRootPointerUpBound = (t) => this._onPanelPointerUp(t), this._onRootPointerCancelBound = (t) => this._onPanelPointerCancel(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._scheduleOverlayPosition.run(), this._onWindowScrollBound = (t) => {
912
931
  F(t, [this._overlay]) || this._scheduleOverlayPosition.run();
913
932
  }, this._applyValueAttribute(!1), this._applyFormatAttribute(), this._open = this.hasAttribute("open"), this._parsePresetsAttribute();
914
933
  }
@@ -994,7 +1013,7 @@ class rt extends q {
994
1013
  this._setOpen(t, "api");
995
1014
  }
996
1015
  setColor(t) {
997
- const e = f(t || "");
1016
+ const e = v(t || "");
998
1017
  if (!e) {
999
1018
  this._setInvalid(t, "Invalid color format");
1000
1019
  return;
@@ -1218,10 +1237,10 @@ class rt extends q {
1218
1237
  _applyValueAttribute(t) {
1219
1238
  const e = this.getAttribute("value");
1220
1239
  if (!e) {
1221
- this._applyRgba(f(I) || this._rgba, !1);
1240
+ this._applyRgba(v(I) || this._rgba, !1);
1222
1241
  return;
1223
1242
  }
1224
- const r = f(e);
1243
+ const r = v(e);
1225
1244
  if (!r) {
1226
1245
  t && this._setInvalid(e, "Unable to parse color value");
1227
1246
  return;
@@ -1243,7 +1262,7 @@ class rt extends q {
1243
1262
  const r = [];
1244
1263
  for (const i of e) {
1245
1264
  if (typeof i != "string") continue;
1246
- const a = f(i);
1265
+ const a = v(i);
1247
1266
  if (!a) continue;
1248
1267
  const n = _(this._normalizeByAlpha(a), this._alphaEnabled());
1249
1268
  r.includes(n) || r.push(n);
@@ -1264,7 +1283,7 @@ class rt extends q {
1264
1283
  if (!t) return;
1265
1284
  const e = JSON.parse(t);
1266
1285
  if (!Array.isArray(e)) return;
1267
- this._recentColors = e.filter((r) => typeof r == "string").map((r) => f(r)).filter((r) => !!r).map((r) => _(this._normalizeByAlpha(r), this._alphaEnabled())).slice(0, this._maxRecent());
1286
+ this._recentColors = e.filter((r) => typeof r == "string").map((r) => v(r)).filter((r) => !!r).map((r) => _(this._normalizeByAlpha(r), this._alphaEnabled())).slice(0, this._maxRecent());
1268
1287
  } catch {
1269
1288
  this._recentColors = [];
1270
1289
  }
@@ -1479,12 +1498,12 @@ class rt extends q {
1479
1498
  return this._isPopoverMode() && this._open && this._overlayRoot ? this._overlayRoot.querySelector('[data-cp-panel="overlay"]') : this.root.querySelector('[data-cp-panel="inline"]');
1480
1499
  }
1481
1500
  _updateUI(t, e = !1) {
1482
- const r = this.root.querySelector('[data-role="trigger-wrap"]'), i = this.root.querySelector(".trigger"), a = this.root.querySelector('[data-role="trigger-value"]'), n = this.root.querySelector('[data-role="trigger-preview"]'), o = this.root.querySelector('[data-role="inline-panel"]'), l = this._isPopoverMode(), c = this._state(), p = this._tone(), v = c === "loading", h = this._isDisabled(), x = this._isReadonly(), R = this._serializeValue() || this._placeholder();
1483
- r && (r.hidden = !l), i && (i.disabled = h || v, i.dataset.state = c, i.dataset.tone = p, i.setAttribute("aria-expanded", l && this._open ? "true" : "false"), this._applyAria(i, R)), a && (a.textContent = R), n && (n.style.background = w(this._rgba, !0)), o && (o.hidden = l), this._forEachPanel((d) => this._updatePanel(d, { skipSwatches: t, disabled: h, readonly: x, loading: v, state: c, tone: p, modePopover: l, liveOnly: e }));
1501
+ const r = this.root.querySelector('[data-role="trigger-wrap"]'), i = this.root.querySelector(".trigger"), a = this.root.querySelector('[data-role="trigger-value"]'), n = this.root.querySelector('[data-role="trigger-preview"]'), s = this.root.querySelector('[data-role="inline-panel"]'), l = this._isPopoverMode(), c = this._state(), p = this._tone(), f = c === "loading", h = this._isDisabled(), x = this._isReadonly(), R = this._serializeValue() || this._placeholder();
1502
+ r && (r.hidden = !l), i && (i.disabled = h || f, i.dataset.state = c, i.dataset.tone = p, i.setAttribute("aria-expanded", l && this._open ? "true" : "false"), this._applyAria(i, R)), a && (a.textContent = R), n && (n.style.background = w(this._rgba, !0)), s && (s.hidden = l), this._forEachPanel((d) => this._updatePanel(d, { skipSwatches: t, disabled: h, readonly: x, loading: f, state: c, tone: p, modePopover: l, liveOnly: e }));
1484
1503
  }
1485
1504
  _updatePanel(t, e) {
1486
- const r = this._rgba, i = M(r), a = this._hsva, n = `hsl(${Math.round(a.h)} 100% 50%)`, o = t.panel.getAttribute("data-cp-panel") === "overlay", l = !!this._error || e.state === "error", c = e.disabled || e.readonly || e.loading;
1487
- if (this._applyAria(t.panel), t.panel.dataset.state = l ? "error" : e.state, t.panel.dataset.tone = e.tone, t.panel.setAttribute("aria-busy", e.loading ? "true" : "false"), o && e.modePopover ? (t.panel.setAttribute("role", "dialog"), t.panel.setAttribute("aria-modal", "true"), t.panel.tabIndex = -1) : (t.panel.removeAttribute("role"), t.panel.removeAttribute("aria-modal"), t.panel.removeAttribute("tabindex")), t.label && (t.label.textContent = this._labelText()), t.valueText && (t.valueText.textContent = this._serializeValue()), t.preview && (t.preview.style.background = w(r, !0)), t.status) {
1505
+ const r = this._rgba, i = M(r), a = this._hsva, n = `hsl(${Math.round(a.h)} 100% 50%)`, s = t.panel.getAttribute("data-cp-panel") === "overlay", l = !!this._error || e.state === "error", c = e.disabled || e.readonly || e.loading;
1506
+ if (this._applyAria(t.panel), t.panel.dataset.state = l ? "error" : e.state, t.panel.dataset.tone = e.tone, t.panel.setAttribute("aria-busy", e.loading ? "true" : "false"), s && e.modePopover ? (t.panel.setAttribute("role", "dialog"), t.panel.setAttribute("aria-modal", "true"), t.panel.tabIndex = -1) : (t.panel.removeAttribute("role"), t.panel.removeAttribute("aria-modal"), t.panel.removeAttribute("tabindex")), t.label && (t.label.textContent = this._labelText()), t.valueText && (t.valueText.textContent = this._serializeValue()), t.preview && (t.preview.style.background = w(r, !0)), t.status) {
1488
1507
  let d = "";
1489
1508
  l ? d = "Error" : e.state === "loading" ? d = "Syncing" : e.state === "success" && (d = "Saved"), t.status.hidden = !d, t.status.textContent = d, t.status.dataset.tone = e.tone;
1490
1509
  }
@@ -1499,7 +1518,7 @@ class rt extends q {
1499
1518
  linear-gradient(-45deg, transparent 75%, var(--ui-cp-checker-a) 75%),
1500
1519
  linear-gradient(to right, rgba(${r.r}, ${r.g}, ${r.b}, 0), rgba(${r.r}, ${r.g}, ${r.b}, 1))
1501
1520
  `), t.alphaThumb && (t.alphaThumb.style.left = `${u(a.a * 100, 1, 99)}%`);
1502
- const p = t.panel.getRootNode(), v = p instanceof ShadowRoot ? p.activeElement : t.panel.ownerDocument.activeElement, h = v && t.panel.contains(v) ? v.getAttribute("data-input") : null;
1521
+ const p = t.panel.getRootNode(), f = p instanceof ShadowRoot ? p.activeElement : t.panel.ownerDocument.activeElement, h = f && t.panel.contains(f) ? f.getAttribute("data-input") : null;
1503
1522
  if (t.inputHex && h !== "hex" && (t.inputHex.value = _(r, this._alphaEnabled())), t.inputR && h !== "r" && (t.inputR.value = String(r.r)), t.inputG && h !== "g" && (t.inputG.value = String(r.g)), t.inputB && h !== "b" && (t.inputB.value = String(r.b)), t.inputA1 && h !== "a1" && (t.inputA1.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), t.inputH && h !== "h" && (t.inputH.value = String(Math.round(i.h))), t.inputS && h !== "s" && (t.inputS.value = String(Math.round(i.s))), t.inputL && h !== "l" && (t.inputL.value = String(Math.round(i.l))), t.inputA2 && h !== "a2" && (t.inputA2.value = this._alphaEnabled() ? String(Number(r.a.toFixed(3))) : "1"), e.liveOnly) return;
1504
1523
  if (t.tabHex && (t.tabHex.dataset.active = String(this._format === "hex")), t.tabRgb && (t.tabRgb.dataset.active = String(this._format === "rgb")), t.tabHsl && (t.tabHsl.dataset.active = String(this._format === "hsl")), t.groupHex && (t.groupHex.hidden = this._format !== "hex"), t.groupRgb && (t.groupRgb.hidden = this._format !== "rgb"), t.groupHsl && (t.groupHsl.hidden = this._format !== "hsl"), t.inputA1 && (t.inputA1.disabled = !this._alphaEnabled() || c), t.inputA2 && (t.inputA2.disabled = !this._alphaEnabled() || c), t.error) {
1505
1524
  const d = this._error || (e.state === "error" ? "Unable to validate current color value." : "");
@@ -1525,12 +1544,12 @@ class rt extends q {
1525
1544
  _renderSwatches(t) {
1526
1545
  const e = this._currentHex().toLowerCase();
1527
1546
  t.presets && (t.presets.innerHTML = this._presets.map((r) => {
1528
- const i = f(r);
1547
+ const i = v(r);
1529
1548
  if (!i) return "";
1530
1549
  const a = _(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
1531
1550
  return `<button type="button" class="swatch" part="swatch" data-action="preset" data-color="${k(a)}"${n} title="${k(a)}" style="background:${k(w(i, !0))}"></button>`;
1532
1551
  }).join("")), t.recentTitle && (t.recentTitle.hidden = !this._recentEnabled() || this._recentColors.length === 0), t.recent && (t.recent.hidden = !this._recentEnabled() || this._recentColors.length === 0, t.recent.innerHTML = this._recentColors.map((r) => {
1533
- const i = f(r);
1552
+ const i = v(r);
1534
1553
  if (!i) return "";
1535
1554
  const a = _(this._normalizeByAlpha(i), this._alphaEnabled()), n = a.toLowerCase() === e ? ' data-selected="true"' : "";
1536
1555
  return `<button type="button" class="swatch" part="swatch recent" data-action="recent" data-color="${k(a)}"${n} title="${k(a)}" style="background:${k(w(i, !0))}"></button>`;
@@ -1572,7 +1591,7 @@ class rt extends q {
1572
1591
  }
1573
1592
  if (a === "clear") {
1574
1593
  if (this._isReadonly()) return;
1575
- const n = f(I);
1594
+ const n = v(I);
1576
1595
  n && (this._applyRgba(n, !1), this._error = "", this._syncValueAttribute(), this._emitInput("text"), this._emitChange("text"), this._pushRecent(this._currentHex()), this._updateUI(!1));
1577
1596
  return;
1578
1597
  }
@@ -1582,10 +1601,10 @@ class rt extends q {
1582
1601
  }
1583
1602
  if (a === "preset" || a === "recent") {
1584
1603
  if (this._isReadonly()) return;
1585
- const n = i.getAttribute("data-color") || "", o = f(n);
1586
- if (!o) return;
1604
+ const n = i.getAttribute("data-color") || "", s = v(n);
1605
+ if (!s) return;
1587
1606
  const l = a === "preset" ? "preset" : "recent";
1588
- this._applyRgba(o, !0), this._error = "", this._syncValueAttribute(), this._emitInput(l), this._emitChange(l), this._pushRecent(this._currentHex()), this._updateUI(!1);
1607
+ this._applyRgba(s, !0), this._error = "", this._syncValueAttribute(), this._emitInput(l), this._emitChange(l), this._pushRecent(this._currentHex()), this._updateUI(!1);
1589
1608
  return;
1590
1609
  }
1591
1610
  }
@@ -1628,18 +1647,18 @@ class rt extends q {
1628
1647
  if (!i || this._isReadonly() || this._isLoading()) return;
1629
1648
  const a = t.shiftKey ? 5 : 1;
1630
1649
  let n = !1;
1631
- const o = { ...this._hsva };
1650
+ const s = { ...this._hsva };
1632
1651
  if (i === "sv") {
1633
- t.key === "ArrowLeft" ? (o.s = u(o.s - a, 0, 100), n = !0) : t.key === "ArrowRight" ? (o.s = u(o.s + a, 0, 100), n = !0) : t.key === "ArrowUp" ? (o.v = u(o.v + a, 0, 100), n = !0) : t.key === "ArrowDown" ? (o.v = u(o.v - a, 0, 100), n = !0) : t.key === "Home" ? (o.s = 0, o.v = 100, n = !0) : t.key === "End" && (o.s = 100, o.v = 0, n = !0), n && (t.preventDefault(), this._commitHsva(o, "drag"));
1652
+ t.key === "ArrowLeft" ? (s.s = u(s.s - a, 0, 100), n = !0) : t.key === "ArrowRight" ? (s.s = u(s.s + a, 0, 100), n = !0) : t.key === "ArrowUp" ? (s.v = u(s.v + a, 0, 100), n = !0) : t.key === "ArrowDown" ? (s.v = u(s.v - a, 0, 100), n = !0) : t.key === "Home" ? (s.s = 0, s.v = 100, n = !0) : t.key === "End" && (s.s = 100, s.v = 0, n = !0), n && (t.preventDefault(), this._commitHsva(s, "drag"));
1634
1653
  return;
1635
1654
  }
1636
1655
  if (i === "hue") {
1637
- t.key === "ArrowLeft" || t.key === "ArrowDown" ? (o.h = u(o.h - a, 0, 360), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (o.h = u(o.h + a, 0, 360), n = !0) : t.key === "Home" ? (o.h = 0, n = !0) : t.key === "End" && (o.h = 360, n = !0), n && (t.preventDefault(), this._commitHsva(o, "slider"));
1656
+ t.key === "ArrowLeft" || t.key === "ArrowDown" ? (s.h = u(s.h - a, 0, 360), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (s.h = u(s.h + a, 0, 360), n = !0) : t.key === "Home" ? (s.h = 0, n = !0) : t.key === "End" && (s.h = 360, n = !0), n && (t.preventDefault(), this._commitHsva(s, "slider"));
1638
1657
  return;
1639
1658
  }
1640
1659
  if (i === "alpha" && this._alphaEnabled()) {
1641
1660
  const l = t.shiftKey ? 0.1 : 0.01;
1642
- t.key === "ArrowLeft" || t.key === "ArrowDown" ? (o.a = u(o.a - l, 0, 1), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (o.a = u(o.a + l, 0, 1), n = !0) : t.key === "Home" ? (o.a = 0, n = !0) : t.key === "End" && (o.a = 1, n = !0), n && (t.preventDefault(), this._commitHsva(o, "slider"));
1661
+ t.key === "ArrowLeft" || t.key === "ArrowDown" ? (s.a = u(s.a - l, 0, 1), n = !0) : t.key === "ArrowRight" || t.key === "ArrowUp" ? (s.a = u(s.a + l, 0, 1), n = !0) : t.key === "Home" ? (s.a = 0, n = !0) : t.key === "End" && (s.a = 1, n = !0), n && (t.preventDefault(), this._commitHsva(s, "slider"));
1643
1662
  }
1644
1663
  }
1645
1664
  _commitHsva(t, e) {
@@ -1649,22 +1668,22 @@ class rt extends q {
1649
1668
  if (!t) return null;
1650
1669
  const e = this._panelRefs(t);
1651
1670
  if (this._format === "hex") {
1652
- const l = e.inputHex?.value || "", c = l.trim().startsWith("#") ? l.trim() : `#${l.trim()}`, p = f(c);
1671
+ const l = e.inputHex?.value || "", c = l.trim().startsWith("#") ? l.trim() : `#${l.trim()}`, p = v(c);
1653
1672
  return p ? this._normalizeByAlpha(p) : null;
1654
1673
  }
1655
1674
  if (this._format === "rgb") {
1656
- const l = Number(e.inputR?.value ?? ""), c = Number(e.inputG?.value ?? ""), p = Number(e.inputB?.value ?? ""), v = this._alphaEnabled() ? Number(e.inputA1?.value ?? "") : 1;
1657
- return [l, c, p, v].every((h) => Number.isFinite(h)) ? this._normalizeByAlpha({ r: l, g: c, b: p, a: v }) : null;
1675
+ const l = Number(e.inputR?.value ?? ""), c = Number(e.inputG?.value ?? ""), p = Number(e.inputB?.value ?? ""), f = this._alphaEnabled() ? Number(e.inputA1?.value ?? "") : 1;
1676
+ return [l, c, p, f].every((h) => Number.isFinite(h)) ? this._normalizeByAlpha({ r: l, g: c, b: p, a: f }) : null;
1658
1677
  }
1659
1678
  const r = Number(e.inputH?.value ?? ""), i = Number(e.inputS?.value ?? ""), a = Number(e.inputL?.value ?? ""), n = this._alphaEnabled() ? Number(e.inputA2?.value ?? "") : 1;
1660
1679
  if (![r, i, a, n].every((l) => Number.isFinite(l))) return null;
1661
- const o = {
1680
+ const s = {
1662
1681
  h: u(r, 0, 360),
1663
1682
  s: u(i, 0, 100),
1664
1683
  l: u(a, 0, 100),
1665
1684
  a: u(n, 0, 1)
1666
1685
  };
1667
- return this._normalizeByAlpha($(o));
1686
+ return this._normalizeByAlpha($(s));
1668
1687
  }
1669
1688
  _onPanelPointerDown(t, e) {
1670
1689
  if (this._isDisabled() || this._isReadonly() || this._isLoading()) return;
@@ -1728,7 +1747,7 @@ class rt extends q {
1728
1747
  const t = window.EyeDropper;
1729
1748
  if (typeof t == "function")
1730
1749
  try {
1731
- const r = await new t().open(), i = f(r?.sRGBHex || "");
1750
+ const r = await new t().open(), i = v(r?.sRGBHex || "");
1732
1751
  if (!i) return;
1733
1752
  this._applyRgba(i, !0), this._error = "", this._syncValueAttribute(), this._emitInput("eyedropper"), this._emitChange("eyedropper"), this._pushRecent(this._currentHex()), this._updateUI(!1);
1734
1753
  } catch {
@@ -1765,9 +1784,9 @@ class rt extends q {
1765
1784
  this.dispatchEvent(new CustomEvent("toast", { detail: { message: r }, bubbles: !0, composed: !0 }));
1766
1785
  }
1767
1786
  _applyAria(t, e = "") {
1768
- const r = this.getAttribute("aria-labelledby"), i = this.getAttribute("aria-describedby"), a = this.getAttribute("aria-label"), n = this.getRootNode(), o = r ? r.split(/\s+/).map((p) => n.getElementById?.(p)?.textContent?.trim() || "").filter(Boolean).join(" ") : "";
1787
+ const r = this.getAttribute("aria-labelledby"), i = this.getAttribute("aria-describedby"), a = this.getAttribute("aria-label"), n = this.getRootNode(), s = r ? r.split(/\s+/).map((p) => n.getElementById?.(p)?.textContent?.trim() || "").filter(Boolean).join(" ") : "";
1769
1788
  t.removeAttribute("aria-labelledby"), i ? t.setAttribute("aria-describedby", i) : t.removeAttribute("aria-describedby");
1770
- const l = o || a || "Color picker", c = e && !l.includes(e) ? `${l}, ${e}` : l;
1789
+ const l = s || a || "Color picker", c = e && !l.includes(e) ? `${l}, ${e}` : l;
1771
1790
  t.setAttribute("aria-label", c);
1772
1791
  }
1773
1792
  }