@vonage/vivid 5.4.0 → 5.6.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 (351) hide show
  1. package/LICENSE.md +201 -0
  2. package/accordion/definition.cjs +5 -0
  3. package/accordion/definition.js +5 -0
  4. package/accordion/index.cjs +1 -1
  5. package/accordion/index.js +14 -3
  6. package/alert/definition.cjs +4 -12
  7. package/alert/definition.js +5 -13
  8. package/alert/index.cjs +11 -11
  9. package/alert/index.js +33 -37
  10. package/audio-player/definition.cjs +4 -0
  11. package/audio-player/definition.js +4 -0
  12. package/audio-player/index.cjs +1 -1
  13. package/audio-player/index.js +8 -2
  14. package/banner/definition.cjs +2 -4
  15. package/banner/definition.js +2 -4
  16. package/banner/index.cjs +2 -2
  17. package/banner/index.js +1 -1
  18. package/breadcrumb/definition.cjs +1 -0
  19. package/breadcrumb/definition.js +1 -0
  20. package/breadcrumb/index.cjs +1 -1
  21. package/breadcrumb/index.js +1 -0
  22. package/bundled/affix.js +1 -1
  23. package/bundled/anchored.cjs +1 -1
  24. package/bundled/anchored.js +6 -6
  25. package/bundled/attribute-binding-behaviour.cjs +1 -1
  26. package/bundled/attribute-binding-behaviour.js +3 -1
  27. package/bundled/base-color-picker.cjs +18 -13
  28. package/bundled/base-color-picker.js +107 -84
  29. package/bundled/base-progress.cjs +1 -1
  30. package/bundled/base-progress.js +3 -0
  31. package/bundled/button.cjs +1 -1
  32. package/bundled/button.js +14 -10
  33. package/bundled/calendar-picker.template.cjs +1 -1
  34. package/bundled/calendar-picker.template.js +4 -2
  35. package/bundled/char-count.cjs +1 -1
  36. package/bundled/char-count.js +1 -1
  37. package/bundled/definition10.cjs +7 -7
  38. package/bundled/definition10.js +29 -19
  39. package/bundled/definition11.cjs +12 -19
  40. package/bundled/definition11.js +73 -204
  41. package/bundled/definition12.cjs +19 -10
  42. package/bundled/definition12.js +218 -36
  43. package/bundled/definition13.cjs +10 -1
  44. package/bundled/definition13.js +38 -14
  45. package/bundled/definition14.cjs +1 -5
  46. package/bundled/definition14.js +15 -24
  47. package/bundled/definition15.cjs +5 -30
  48. package/bundled/definition15.js +22 -73
  49. package/bundled/definition16.cjs +30 -19
  50. package/bundled/definition16.js +74 -97
  51. package/bundled/definition17.cjs +19 -13
  52. package/bundled/definition17.js +86 -117
  53. package/bundled/definition18.cjs +13 -12
  54. package/bundled/definition18.js +125 -71
  55. package/bundled/definition19.cjs +16 -16
  56. package/bundled/definition19.js +132 -94
  57. package/bundled/definition2.cjs +8 -9
  58. package/bundled/definition2.js +89 -142
  59. package/bundled/definition22.cjs +1 -1
  60. package/bundled/definition22.js +1 -0
  61. package/bundled/definition3.cjs +1 -1
  62. package/bundled/definition3.js +2 -1
  63. package/bundled/definition5.cjs +1 -1
  64. package/bundled/definition5.js +9 -3
  65. package/bundled/definition6.cjs +1 -1
  66. package/bundled/definition6.js +1 -0
  67. package/bundled/definition7.cjs +1 -1
  68. package/bundled/definition7.js +7 -4
  69. package/bundled/definition8.cjs +1 -1
  70. package/bundled/definition8.js +1 -0
  71. package/bundled/definition9.cjs +6 -6
  72. package/bundled/definition9.js +545 -488
  73. package/bundled/delegates-aria.cjs +1 -1
  74. package/bundled/delegates-aria.js +3 -1
  75. package/bundled/form-associated.cjs +1 -1
  76. package/bundled/form-associated.js +11 -3
  77. package/bundled/host-semantics.js +4 -4
  78. package/bundled/listbox.cjs +1 -1
  79. package/bundled/listbox.js +22 -4
  80. package/bundled/localized.cjs +1 -1
  81. package/bundled/localized.js +149 -66
  82. package/bundled/mixins.cjs +4 -4
  83. package/bundled/mixins.js +11 -8
  84. package/bundled/picker-field.template.cjs +14 -14
  85. package/bundled/picker-field.template.js +36 -56
  86. package/bundled/scrollIntoView.cjs +1 -1
  87. package/bundled/scrollIntoView.js +4 -1
  88. package/bundled/text-field.cjs +1 -1
  89. package/bundled/text-field.js +1 -1
  90. package/bundled/time-selection-picker.template.cjs +12 -12
  91. package/bundled/time-selection-picker.template.js +16 -12
  92. package/bundled/trapped-focus.cjs +1 -0
  93. package/bundled/trapped-focus.js +26 -0
  94. package/bundled/vivid-element.cjs +4 -4
  95. package/bundled/vivid-element.js +529 -492
  96. package/calendar/definition.cjs +2 -0
  97. package/calendar/definition.js +2 -0
  98. package/calendar/index.cjs +13 -13
  99. package/calendar/index.js +174 -144
  100. package/checkbox/definition.cjs +1 -0
  101. package/checkbox/definition.js +1 -0
  102. package/color-picker/definition.cjs +213 -112
  103. package/color-picker/definition.js +213 -112
  104. package/color-picker/index.cjs +104 -75
  105. package/color-picker/index.js +417 -326
  106. package/combobox/definition.cjs +17 -6
  107. package/combobox/definition.js +17 -6
  108. package/combobox/index.cjs +14 -9
  109. package/combobox/index.js +54 -42
  110. package/contextual-help/index.cjs +1 -1
  111. package/contextual-help/index.js +1 -1
  112. package/custom-elements.json +6976 -484
  113. package/data-grid/definition.cjs +105 -7
  114. package/data-grid/definition.js +105 -7
  115. package/data-grid/index.cjs +52 -38
  116. package/data-grid/index.js +313 -242
  117. package/date-picker/index.cjs +1 -1
  118. package/date-picker/index.js +2 -2
  119. package/date-range-picker/definition.cjs +2 -0
  120. package/date-range-picker/definition.js +2 -0
  121. package/date-range-picker/index.cjs +1 -1
  122. package/date-range-picker/index.js +7 -3
  123. package/date-time-picker/index.cjs +1 -1
  124. package/date-time-picker/index.js +2 -2
  125. package/dial-pad/definition.cjs +148 -0
  126. package/dial-pad/definition.js +148 -0
  127. package/dial-pad/index.cjs +27 -20
  128. package/dial-pad/index.js +202 -101
  129. package/dialog/definition.cjs +1 -0
  130. package/dialog/definition.js +1 -0
  131. package/dialog/index.cjs +1 -1
  132. package/dialog/index.js +1 -0
  133. package/divider/index.cjs +1 -1
  134. package/divider/index.js +1 -1
  135. package/fab/definition.cjs +1 -0
  136. package/fab/definition.js +1 -0
  137. package/fab/index.cjs +1 -1
  138. package/fab/index.js +1 -0
  139. package/file-picker/definition.cjs +7 -2
  140. package/file-picker/definition.js +7 -2
  141. package/file-picker/index.cjs +6 -6
  142. package/file-picker/index.js +82 -73
  143. package/icon/definition.cjs +66 -41
  144. package/icon/definition.js +67 -42
  145. package/index.cjs +21 -0
  146. package/index.js +1 -1
  147. package/lib/color-picker/color-picker.d.ts +390 -12
  148. package/lib/color-picker/locale.d.ts +4 -0
  149. package/lib/data-grid/locale.d.ts +5 -0
  150. package/lib/date-picker/date-picker.d.ts +38 -38
  151. package/lib/date-range-picker/date-range-picker.d.ts +20 -20
  152. package/lib/date-time-picker/date-time-picker.d.ts +40 -40
  153. package/lib/dial-pad/dial-pad.d.ts +1 -0
  154. package/lib/icon/icon.d.ts +1 -1
  155. package/lib/menu/menu.d.ts +4 -4
  156. package/lib/rich-text-editor/definition.d.ts +3 -2
  157. package/lib/rich-text-editor/locale.d.ts +29 -3
  158. package/lib/rich-text-editor/popover.d.ts +19 -0
  159. package/lib/rich-text-editor/rich-text-editor.d.ts +16 -45
  160. package/lib/rich-text-editor/rich-text-editor.template.d.ts +2 -2
  161. package/lib/rich-text-editor/rte/config.d.ts +18 -0
  162. package/lib/rich-text-editor/rte/document.d.ts +28 -0
  163. package/lib/rich-text-editor/rte/exports.d.ts +23 -0
  164. package/lib/rich-text-editor/rte/feature.d.ts +46 -0
  165. package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +33 -0
  166. package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +11 -0
  167. package/lib/rich-text-editor/rte/features/internal/history.d.ts +10 -0
  168. package/lib/rich-text-editor/rte/features/internal/text-style.d.ts +18 -0
  169. package/lib/rich-text-editor/rte/html-parser.d.ts +24 -0
  170. package/lib/rich-text-editor/rte/html-serializer.d.ts +30 -0
  171. package/lib/rich-text-editor/rte/instance.d.ts +57 -0
  172. package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -0
  173. package/lib/rich-text-editor/rte/utils/impl.d.ts +1 -0
  174. package/lib/rich-text-editor/rte/utils/textblock-attrs.d.ts +29 -0
  175. package/lib/rich-text-editor/rte/utils/textblock-marks.d.ts +10 -0
  176. package/lib/rich-text-editor/rte/utils/ui.d.ts +109 -0
  177. package/lib/simple-color-picker/simple-color-picker.d.ts +6 -5
  178. package/lib/text-area/text-area.d.ts +1 -1
  179. package/lib/text-field/text-field.d.ts +1 -1
  180. package/lib/time-picker/time-picker.d.ts +20 -20
  181. package/lib/toggletip/toggletip.d.ts +4 -4
  182. package/lib/tooltip/tooltip.d.ts +4 -4
  183. package/locales/de-DE.cjs +58 -7
  184. package/locales/de-DE.js +58 -7
  185. package/locales/en-GB.cjs +60 -9
  186. package/locales/en-GB.js +60 -9
  187. package/locales/en-US.cjs +60 -9
  188. package/locales/en-US.js +60 -9
  189. package/locales/ja-JP.cjs +59 -8
  190. package/locales/ja-JP.js +59 -8
  191. package/locales/zh-CN.cjs +58 -7
  192. package/locales/zh-CN.js +58 -7
  193. package/menu/definition.cjs +1 -0
  194. package/menu/definition.js +1 -0
  195. package/number-field/definition.cjs +5 -3
  196. package/number-field/definition.js +5 -3
  197. package/number-field/index.cjs +5 -3
  198. package/number-field/index.js +34 -32
  199. package/option/index.cjs +1 -1
  200. package/option/index.js +1 -1
  201. package/package.json +76 -62
  202. package/pagination/definition.cjs +2 -0
  203. package/pagination/definition.js +2 -0
  204. package/pagination/index.cjs +1 -1
  205. package/pagination/index.js +2 -0
  206. package/progress-ring/index.cjs +1 -1
  207. package/progress-ring/index.js +1 -1
  208. package/radio/definition.cjs +4 -0
  209. package/radio/definition.js +4 -0
  210. package/radio/index.cjs +1 -1
  211. package/radio/index.js +1 -1
  212. package/radio-group/index.cjs +1 -1
  213. package/radio-group/index.js +1 -1
  214. package/range-slider/definition.cjs +2 -1
  215. package/range-slider/definition.js +2 -1
  216. package/range-slider/index.cjs +1 -1
  217. package/range-slider/index.js +3 -1
  218. package/rich-text-editor/definition.cjs +17942 -1074
  219. package/rich-text-editor/definition.js +17926 -1079
  220. package/rich-text-editor/index.cjs +29 -130
  221. package/rich-text-editor/index.js +5565 -2474
  222. package/searchable-select/definition.cjs +6 -2
  223. package/searchable-select/definition.js +6 -2
  224. package/searchable-select/index.cjs +1 -1
  225. package/searchable-select/index.js +14 -10
  226. package/select/definition.cjs +22 -4
  227. package/select/definition.js +22 -4
  228. package/selectable-box/index.cjs +1 -1
  229. package/selectable-box/index.js +1 -1
  230. package/shared/color-picker/base-color-picker.d.ts +2 -1
  231. package/shared/patterns/anchored.d.ts +8 -8
  232. package/shared/patterns/char-count/char-count.d.ts +1 -1
  233. package/shared/patterns/localized.d.ts +386 -0
  234. package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
  235. package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
  236. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
  237. package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
  238. package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
  239. package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
  240. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
  241. package/shared/utils/promise.d.ts +7 -0
  242. package/simple-color-picker/definition.cjs +11 -6
  243. package/simple-color-picker/definition.js +11 -6
  244. package/simple-color-picker/index.cjs +6 -6
  245. package/simple-color-picker/index.js +44 -39
  246. package/slider/definition.cjs +7 -1
  247. package/slider/definition.js +7 -1
  248. package/styles/core/all.css +5 -1
  249. package/styles/core/theme.css +5 -1
  250. package/styles/core/typography.css +1 -1
  251. package/styles/tokens/theme-dark.css +4 -4
  252. package/styles/tokens/theme-light.css +4 -4
  253. package/styles/tokens/vivid-2-compat.css +1 -1
  254. package/switch/definition.cjs +1 -0
  255. package/switch/definition.js +1 -0
  256. package/switch/index.cjs +1 -1
  257. package/switch/index.js +1 -0
  258. package/tabs/definition.cjs +2 -0
  259. package/tabs/definition.js +2 -0
  260. package/tabs/index.cjs +1 -1
  261. package/tabs/index.js +2 -0
  262. package/tag/definition.cjs +34 -14
  263. package/tag/definition.js +34 -14
  264. package/tag/index.cjs +25 -12
  265. package/tag/index.js +64 -47
  266. package/tag-group/definition.cjs +1 -2
  267. package/tag-group/definition.js +1 -2
  268. package/tag-group/index.cjs +1 -1
  269. package/tag-group/index.js +11 -12
  270. package/text-area/definition.cjs +13 -7
  271. package/text-area/definition.js +13 -7
  272. package/text-area/index.cjs +6 -6
  273. package/text-area/index.js +20 -14
  274. package/text-field/definition.cjs +16 -6
  275. package/text-field/definition.js +16 -6
  276. package/time-picker/index.cjs +1 -1
  277. package/time-picker/index.js +1 -1
  278. package/toggletip/definition.cjs +5 -1
  279. package/toggletip/definition.js +5 -1
  280. package/toggletip/index.cjs +1 -1
  281. package/toggletip/index.js +1 -1
  282. package/tooltip/definition.cjs +6 -3
  283. package/tooltip/definition.js +6 -3
  284. package/tooltip/index.cjs +1 -1
  285. package/tooltip/index.js +1 -1
  286. package/tree-view/definition.cjs +28 -6
  287. package/tree-view/definition.js +28 -6
  288. package/tree-view/index.cjs +1 -1
  289. package/tree-view/index.js +28 -6
  290. package/unbundled/_commonjsHelpers.cjs +0 -26
  291. package/unbundled/_commonjsHelpers.js +1 -26
  292. package/unbundled/attribute-binding-behaviour.cjs +1 -0
  293. package/unbundled/attribute-binding-behaviour.js +1 -0
  294. package/unbundled/base-color-picker.cjs +45 -21
  295. package/unbundled/base-color-picker.js +45 -21
  296. package/unbundled/base-progress.cjs +3 -0
  297. package/unbundled/base-progress.js +3 -0
  298. package/unbundled/button.cjs +14 -10
  299. package/unbundled/button.js +14 -10
  300. package/unbundled/calendar-picker.template.cjs +3 -1
  301. package/unbundled/calendar-picker.template.js +3 -1
  302. package/unbundled/definition.cjs +1 -0
  303. package/unbundled/definition.js +1 -0
  304. package/unbundled/definition2.cjs +4 -1
  305. package/unbundled/definition2.js +4 -1
  306. package/unbundled/definition3.cjs +1 -0
  307. package/unbundled/definition3.js +1 -0
  308. package/unbundled/definition4.cjs +1 -0
  309. package/unbundled/definition4.js +1 -0
  310. package/unbundled/definition5.cjs +3 -2
  311. package/unbundled/definition5.js +4 -3
  312. package/unbundled/delegates-aria.cjs +1 -0
  313. package/unbundled/delegates-aria.js +1 -0
  314. package/unbundled/form-associated.cjs +4 -0
  315. package/unbundled/form-associated.js +4 -0
  316. package/unbundled/listbox.cjs +16 -1
  317. package/unbundled/listbox.js +16 -1
  318. package/unbundled/localized.cjs +36 -0
  319. package/unbundled/localized.js +37 -2
  320. package/unbundled/mixins.cjs +2 -0
  321. package/unbundled/mixins.js +2 -0
  322. package/unbundled/picker-field.template.cjs +3 -35
  323. package/unbundled/picker-field.template.js +3 -34
  324. package/unbundled/scrollIntoView.cjs +1 -0
  325. package/unbundled/scrollIntoView.js +1 -0
  326. package/unbundled/text-field.cjs +1 -1
  327. package/unbundled/text-field.js +1 -1
  328. package/unbundled/time-selection-picker.template.cjs +5 -1
  329. package/unbundled/time-selection-picker.template.js +5 -1
  330. package/unbundled/trapped-focus.cjs +37 -0
  331. package/unbundled/trapped-focus.js +34 -0
  332. package/unbundled/vivid-element.cjs +1 -1
  333. package/unbundled/vivid-element.js +1 -1
  334. package/video-player/definition.cjs +54 -44
  335. package/video-player/definition.js +50 -40
  336. package/video-player/index.cjs +28 -28
  337. package/video-player/index.js +1448 -1442
  338. package/visually-hidden/index.cjs +1 -1
  339. package/visually-hidden/index.js +1 -1
  340. package/vivid.api.json +6463 -6099
  341. package/bundled/_has.cjs +0 -1
  342. package/bundled/_has.js +0 -34
  343. package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +0 -4
  344. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +0 -18
  345. package/lib/rich-text-editor/image-placeholder/definition.d.ts +0 -2
  346. package/lib/rich-text-editor/image-placeholder/image-placeholder.d.ts +0 -7
  347. package/lib/rich-text-editor/image-placeholder/image-placeholder.template.d.ts +0 -4
  348. package/lib/rich-text-editor/menubar/consts.d.ts +0 -18
  349. package/lib/rich-text-editor/menubar/definition.d.ts +0 -2
  350. package/lib/rich-text-editor/menubar/menubar.d.ts +0 -386
  351. package/lib/rich-text-editor/menubar/menubar.template.d.ts +0 -4
@@ -1,133 +1,136 @@
1
- import { V as ee, a as x, o as G, n as te, h as n, c as oe, d as se } from "../bundled/vivid-element.js";
2
- import { P as re, p as ae } from "../bundled/definition9.js";
1
+ import { V as ee, a as y, o as L, n as te, h as n, c as oe, d as re } from "../bundled/vivid-element.js";
2
+ import { P as se, p as ae } from "../bundled/definition9.js";
3
3
  import { I as ie, i as le } from "../bundled/definition2.js";
4
4
  import { W as ne, f as ce } from "../bundled/mixins.js";
5
5
  import { D as de, d as pe } from "../bundled/delegates-aria.js";
6
- import { B as he, i as f } from "../bundled/base-color-picker.js";
7
- import { W as ue } from "../bundled/with-contextual-help.js";
8
- import { W as ve } from "../bundled/with-error-text.js";
9
- import { W as fe } from "../bundled/with-success-text.js";
10
- import { T as be, t as me } from "../bundled/definition10.js";
11
- import { B as ge, b as xe } from "../bundled/definition3.js";
12
- import { r as u } from "../bundled/ref.js";
13
- import { w as J } from "../bundled/when.js";
14
- import { s as L } from "../bundled/slotted.js";
15
- import { r as Ce } from "../bundled/repeat.js";
16
- import { c as M } from "../bundled/class-names.js";
17
- const ye = ".palette{display:grid;grid-template-columns:repeat(var(--swatches-per-row, 7),var(--_color-swatch-size, 24px))}.swatch{position:relative;padding:0;border:none;border-radius:4px;background-color:var(--swatch-color);block-size:var(--_color-swatch-size, 24px);color:var(--vvd-color-canvas);cursor:pointer;inline-size:var(--_color-swatch-size, 24px)}.swatch.contrast{color:var(--vvd-color-canvas-text)}.swatch:focus-visible{outline:none;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--focus-inset: -3px}:host{display:inline-block}.base{display:inline-block;min-inline-size:var(--_color-picker-min-inline-size, 280px)}.control{inline-size:100%}.button{display:inline-flex;box-sizing:border-box;align-items:center;border:0 none;border-radius:4px;margin:0;background-color:var(--button-color, var(--vvd-color-canvas-text));block-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));color:var(--vvd-color-canvas);inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-inline:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/4);text-decoration:none;vertical-align:middle}.button.contrast{color:var(--vvd-color-canvas-text)}.button:not(.disabled){cursor:pointer}.button.disabled{background-color:var(--vvd-color-neutral-300);color:var(--vvd-color-neutral-500);cursor:not-allowed}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.button [data-vvd-component=icon]{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.dialog{display:flex;flex-direction:column;min-inline-size:var(--_color-picker-popup-min-inline-size, 264px)}.dialog .header{display:inline-flex;align-items:center;justify-content:space-between;padding-block:8px;padding-inline:16px}.dialog .header-title{font:var(--vvd-typography-base-extended-bold)}.dialog .body{display:flex;flex-direction:column;gap:16px;margin-block-end:16px;padding-inline:16px}.dialog .hex-input-wrapper{display:flex;align-items:stretch;gap:8px}.dialog .hex-input-wrapper [data-vvd-component=button]{flex:0 0 auto}.dialog .footer{padding:16px;border-top:1px solid var(--vvd-color-neutral-200)}.dialog .footer-title{display:block;margin-block-end:8px}.dialog .palette{gap:var(--_color-swatches-gap, 8px)}vvd-hex-input{min-width:0;flex:1 1 auto}vvd-hex-input::part(input){width:100%;height:100%;box-sizing:border-box;border:0 none;border-radius:8px;background-color:var(--vvd-color-canvas);box-shadow:inset 0 0 0 1px var(--vvd-color-neutral-500);font:var(--vvd-typography-base);outline:transparent;padding-inline:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.4)}vvd-hex-input::part(input):focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}vvd-hex-picker{width:auto;height:auto;gap:16px;inline-size:100%}vvd-hex-picker::part(saturation){border-radius:8px;block-size:120px}vvd-hex-picker::part(hue){flex:0 0 8px;border-radius:8px}vvd-hex-picker::part(hue-pointer){width:10px;height:10px}vvd-hex-picker::part(saturation-pointer){width:18px;height:18px}::part(popup-base){inline-size:max-content;min-block-size:var(--_color-picker-popup-min-inline-size, 264px);min-inline-size:var(--_color-picker-popup-min-inline-size, 264px)}", v = (o, e = 0, t = 1) => o > t ? t : o < e ? e : o, l = (o, e = 0, t = Math.pow(10, e)) => Math.round(t * o) / t, $e = (o) => Ee(E(o)), E = (o) => (o[0] === "#" && (o = o.substring(1)), o.length < 6 ? {
18
- r: parseInt(o[0] + o[0], 16),
19
- g: parseInt(o[1] + o[1], 16),
20
- b: parseInt(o[2] + o[2], 16),
21
- a: o.length === 4 ? l(parseInt(o[3] + o[3], 16) / 255, 2) : 1
6
+ import { h as he } from "../bundled/index.js";
7
+ import { B as ue, i as b } from "../bundled/base-color-picker.js";
8
+ import { W as ve } from "../bundled/with-contextual-help.js";
9
+ import { W as fe } from "../bundled/with-error-text.js";
10
+ import { W as be } from "../bundled/with-success-text.js";
11
+ import { T as me } from "../bundled/trapped-focus.js";
12
+ import { T as ge, t as xe } from "../bundled/definition10.js";
13
+ import { B as ye, b as Ce } from "../bundled/definition3.js";
14
+ import { T as $e, t as ke } from "../bundled/definition11.js";
15
+ import { r as v } from "../bundled/ref.js";
16
+ import { w as E } from "../bundled/when.js";
17
+ import { s as F } from "../bundled/slotted.js";
18
+ import { r as we } from "../bundled/repeat.js";
19
+ import { c as N } from "../bundled/class-names.js";
20
+ const _e = ".palette{display:grid;grid-template-columns:repeat(var(--swatches-per-row, 7),var(--_color-swatch-size, 24px))}.swatch{position:relative;padding:0;border-radius:4px;background-color:var(--swatch-color);block-size:var(--_color-swatch-size, 24px);color:var(--vvd-color-canvas);cursor:pointer;inline-size:var(--_color-swatch-size, 24px)}.swatch:not(.contrast){border:none}.swatch.contrast{border:1px solid var(--vvd-color-neutral-400);color:var(--vvd-color-canvas-text)}.swatch:focus-visible{outline:none;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--focus-inset: -3px}:host{display:inline-block;--_low-ink-color: var(--vvd-color-neutral-600)}.base{display:inline-block;min-inline-size:var(--_color-picker-min-inline-size, 280px)}.control{inline-size:100%}.button{display:inline-flex;box-sizing:border-box;align-items:center;border:0 none;border-radius:4px;margin:0;background-color:var(--button-color, var(--vvd-color-canvas-text));block-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));color:var(--vvd-color-canvas);inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-inline:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/4);text-decoration:none;vertical-align:middle}.button.contrast{color:var(--vvd-color-canvas-text)}.button:not(.disabled){cursor:pointer}.button.disabled{background-color:var(--vvd-color-neutral-300);color:var(--vvd-color-neutral-500);cursor:not-allowed}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.button [data-vvd-component=icon]{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.dialog{display:flex;flex-direction:column;min-inline-size:var(--_color-picker-popup-min-inline-size, 264px)}.dialog .header{display:inline-flex;align-items:center;justify-content:space-between;padding-block:8px;padding-inline:16px}.dialog .header-title{font:var(--vvd-typography-base-extended-bold);margin-block:0}.dialog .body{display:flex;flex-direction:column;gap:16px;margin-block-end:16px;padding-inline:16px}.dialog .hex-input-wrapper{display:flex;align-items:stretch;gap:8px}.dialog .hex-input-wrapper [data-vvd-component=button]{flex:0 0 auto}.dialog .footer{padding:16px;border-top:1px solid var(--vvd-color-neutral-200)}.dialog .footer-header{margin-block-end:8px}.dialog .swatches-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.dialog .palette{gap:var(--_color-swatches-gap, 8px)}vvd-hex-input{min-width:0;flex:1 1 auto}vvd-hex-input::part(input),vvd-hex-input>input{width:100%;height:100%;box-sizing:border-box;border:0 none;border-radius:8px;background-color:var(--vvd-color-canvas);box-shadow:inset 0 0 0 1px var(--vvd-color-neutral-500);font:var(--vvd-typography-base);outline:transparent;padding-inline:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.4)}vvd-hex-input::part(input):focus-visible,vvd-hex-input>input:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}vvd-hex-picker{width:auto;height:auto;gap:16px;inline-size:100%}vvd-hex-picker::part(saturation){border-radius:8px;block-size:120px}vvd-hex-picker::part(hue){flex:0 0 8px;border-radius:8px}vvd-hex-picker::part(hue-pointer){width:10px;height:10px}vvd-hex-picker::part(saturation-pointer){width:18px;height:18px}::part(popup-base){inline-size:max-content;min-block-size:var(--_color-picker-popup-min-inline-size, 264px);min-inline-size:var(--_color-picker-popup-min-inline-size, 264px)}.visually-hidden{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip:rect(0 0 0 0)}", f = (r, e = 0, o = 1) => r > o ? o : r < e ? e : r, l = (r, e = 0, o = Math.pow(10, e)) => Math.round(o * r) / o, Se = (r) => Ie(P(r)), P = (r) => (r[0] === "#" && (r = r.substring(1)), r.length < 6 ? {
21
+ r: parseInt(r[0] + r[0], 16),
22
+ g: parseInt(r[1] + r[1], 16),
23
+ b: parseInt(r[2] + r[2], 16),
24
+ a: r.length === 4 ? l(parseInt(r[3] + r[3], 16) / 255, 2) : 1
22
25
  } : {
23
- r: parseInt(o.substring(0, 2), 16),
24
- g: parseInt(o.substring(2, 4), 16),
25
- b: parseInt(o.substring(4, 6), 16),
26
- a: o.length === 8 ? l(parseInt(o.substring(6, 8), 16) / 255, 2) : 1
27
- }), ke = (o) => Se(_e(o)), we = ({ h: o, s: e, v: t, a: s }) => {
28
- const r = (200 - e) * t / 100;
26
+ r: parseInt(r.substring(0, 2), 16),
27
+ g: parseInt(r.substring(2, 4), 16),
28
+ b: parseInt(r.substring(4, 6), 16),
29
+ a: r.length === 8 ? l(parseInt(r.substring(6, 8), 16) / 255, 2) : 1
30
+ }), Ee = (r) => He(Te(r)), Pe = ({ h: r, s: e, v: o, a: t }) => {
31
+ const s = (200 - e) * o / 100;
29
32
  return {
30
- h: l(o),
31
- s: l(r > 0 && r < 200 ? e * t / 100 / (r <= 100 ? r : 200 - r) * 100 : 0),
32
- l: l(r / 2),
33
- a: l(s, 2)
33
+ h: l(r),
34
+ s: l(s > 0 && s < 200 ? e * o / 100 / (s <= 100 ? s : 200 - s) * 100 : 0),
35
+ l: l(s / 2),
36
+ a: l(t, 2)
34
37
  };
35
- }, H = (o) => {
36
- const { h: e, s: t, l: s } = we(o);
37
- return `hsl(${e}, ${t}%, ${s}%)`;
38
- }, _e = ({ h: o, s: e, v: t, a: s }) => {
39
- o = o / 360 * 6, e = e / 100, t = t / 100;
40
- const r = Math.floor(o), a = t * (1 - e), i = t * (1 - (o - r) * e), C = t * (1 - (1 - o + r) * e), y = r % 6;
38
+ }, T = (r) => {
39
+ const { h: e, s: o, l: t } = Pe(r);
40
+ return `hsl(${e}, ${o}%, ${t}%)`;
41
+ }, Te = ({ h: r, s: e, v: o, a: t }) => {
42
+ r = r / 360 * 6, e = e / 100, o = o / 100;
43
+ const s = Math.floor(r), i = o * (1 - e), a = o * (1 - (r - s) * e), d = o * (1 - (1 - r + s) * e), C = s % 6;
41
44
  return {
42
- r: l([t, i, a, a, C, t][y] * 255),
43
- g: l([C, t, t, i, a, a][y] * 255),
44
- b: l([a, a, C, t, t, i][y] * 255),
45
- a: l(s, 2)
45
+ r: l([o, a, i, i, d, o][C] * 255),
46
+ g: l([d, o, o, a, i, i][C] * 255),
47
+ b: l([i, i, d, o, o, a][C] * 255),
48
+ a: l(t, 2)
46
49
  };
47
- }, b = (o) => {
48
- const e = o.toString(16);
50
+ }, m = (r) => {
51
+ const e = r.toString(16);
49
52
  return e.length < 2 ? "0" + e : e;
50
- }, Se = ({ r: o, g: e, b: t, a: s }) => {
51
- const r = s < 1 ? b(l(s * 255)) : "";
52
- return "#" + b(o) + b(e) + b(t) + r;
53
- }, Ee = ({ r: o, g: e, b: t, a: s }) => {
54
- const r = Math.max(o, e, t), a = r - Math.min(o, e, t), i = a ? r === o ? (e - t) / a : r === e ? 2 + (t - o) / a : 4 + (o - e) / a : 0;
53
+ }, He = ({ r, g: e, b: o, a: t }) => {
54
+ const s = t < 1 ? m(l(t * 255)) : "";
55
+ return "#" + m(r) + m(e) + m(o) + s;
56
+ }, Ie = ({ r, g: e, b: o, a: t }) => {
57
+ const s = Math.max(r, e, o), i = s - Math.min(r, e, o), a = i ? s === r ? (e - o) / i : s === e ? 2 + (o - r) / i : 4 + (r - e) / i : 0;
55
58
  return {
56
- h: l(60 * (i < 0 ? i + 6 : i)),
57
- s: l(r ? a / r * 100 : 0),
58
- v: l(r / 255 * 100),
59
- a: s
59
+ h: l(60 * (a < 0 ? a + 6 : a)),
60
+ s: l(s ? i / s * 100 : 0),
61
+ v: l(s / 255 * 100),
62
+ a: t
60
63
  };
61
- }, U = (o, e) => {
62
- if (o === e)
64
+ }, U = (r, e) => {
65
+ if (r === e)
63
66
  return !0;
64
- for (const t in o)
65
- if (o[t] !== e[t])
67
+ for (const o in r)
68
+ if (r[o] !== e[o])
66
69
  return !1;
67
70
  return !0;
68
- }, He = (o, e) => o.toLowerCase() === e.toLowerCase() ? !0 : U(E(o), E(e)), N = {}, I = (o) => {
69
- let e = N[o];
70
- return e || (e = document.createElement("template"), e.innerHTML = o, N[o] = e), e;
71
- }, A = (o, e, t) => {
72
- o.dispatchEvent(new CustomEvent(e, {
71
+ }, ze = (r, e) => r.toLowerCase() === e.toLowerCase() ? !0 : U(P(r), P(e)), D = {}, A = (r) => {
72
+ let e = D[r];
73
+ return e || (e = document.createElement("template"), e.innerHTML = r, D[r] = e), e;
74
+ }, M = (r, e, o) => {
75
+ r.dispatchEvent(new CustomEvent(e, {
73
76
  bubbles: !0,
74
- detail: t
77
+ detail: o
75
78
  }));
76
79
  };
77
- let d = !1;
78
- const P = (o) => "touches" in o, Pe = (o) => d && !P(o) ? !1 : (d || (d = P(o)), !0), F = (o, e) => {
79
- const t = P(e) ? e.touches[0] : e, s = o.el.getBoundingClientRect();
80
- A(o.el, "move", o.getMove({
81
- x: v((t.pageX - (s.left + window.pageXOffset)) / s.width),
82
- y: v((t.pageY - (s.top + window.pageYOffset)) / s.height)
80
+ let h = !1;
81
+ const H = (r) => "touches" in r, Le = (r) => h && !H(r) ? !1 : (h || (h = H(r)), !0), B = (r, e) => {
82
+ const o = H(e) ? e.touches[0] : e, t = r.el.getBoundingClientRect();
83
+ M(r.el, "move", r.getMove({
84
+ x: f((o.pageX - (t.left + window.pageXOffset)) / t.width),
85
+ y: f((o.pageY - (t.top + window.pageYOffset)) / t.height)
83
86
  }));
84
- }, Te = (o, e) => {
85
- const t = e.keyCode;
86
- t > 40 || o.xy && t < 37 || t < 33 || (e.preventDefault(), A(o.el, "move", o.getMove({
87
- x: t === 39 ? 0.01 : t === 37 ? -0.01 : t === 34 ? 0.05 : t === 33 ? -0.05 : t === 35 ? 1 : t === 36 ? -1 : 0,
88
- y: t === 40 ? 0.01 : t === 38 ? -0.01 : 0
87
+ }, Ae = (r, e) => {
88
+ const o = e.keyCode;
89
+ o > 40 || r.xy && o < 37 || o < 33 || (e.preventDefault(), M(r.el, "move", r.getMove({
90
+ x: o === 39 ? 0.01 : o === 37 ? -0.01 : o === 34 ? 0.05 : o === 33 ? -0.05 : o === 35 ? 1 : o === 36 ? -1 : 0,
91
+ y: o === 40 ? 0.01 : o === 38 ? -0.01 : 0
89
92
  }, !0)));
90
93
  };
91
94
  class Y {
92
- constructor(e, t, s, r) {
93
- const a = I(`<div role="slider" tabindex="0" part="${t}" ${s}><div part="${t}-pointer"></div></div>`);
94
- e.appendChild(a.content.cloneNode(!0));
95
- const i = e.querySelector(`[part=${t}]`);
96
- i.addEventListener("mousedown", this), i.addEventListener("touchstart", this), i.addEventListener("keydown", this), this.el = i, this.xy = r, this.nodes = [i.firstChild, i];
95
+ constructor(e, o, t, s) {
96
+ const i = A(`<div role="slider" tabindex="0" part="${o}" ${t}><div part="${o}-pointer"></div></div>`);
97
+ e.appendChild(i.content.cloneNode(!0));
98
+ const a = e.querySelector(`[part=${o}]`);
99
+ a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = s, this.nodes = [a.firstChild, a];
97
100
  }
98
101
  set dragging(e) {
99
- const t = e ? document.addEventListener : document.removeEventListener;
100
- t(d ? "touchmove" : "mousemove", this), t(d ? "touchend" : "mouseup", this);
102
+ const o = e ? document.addEventListener : document.removeEventListener;
103
+ o(h ? "touchmove" : "mousemove", this), o(h ? "touchend" : "mouseup", this);
101
104
  }
102
105
  handleEvent(e) {
103
106
  switch (e.type) {
104
107
  case "mousedown":
105
108
  case "touchstart":
106
- if (e.preventDefault(), !Pe(e) || !d && e.button != 0)
109
+ if (e.preventDefault(), !Le(e) || !h && e.button != 0)
107
110
  return;
108
- this.el.focus(), F(this, e), this.dragging = !0;
111
+ this.el.focus(), B(this, e), this.dragging = !0;
109
112
  break;
110
113
  case "mousemove":
111
114
  case "touchmove":
112
- e.preventDefault(), F(this, e);
115
+ e.preventDefault(), B(this, e);
113
116
  break;
114
117
  case "mouseup":
115
118
  case "touchend":
116
119
  this.dragging = !1;
117
120
  break;
118
121
  case "keydown":
119
- Te(this, e);
122
+ Ae(this, e);
120
123
  break;
121
124
  }
122
125
  }
123
126
  style(e) {
124
- e.forEach((t, s) => {
125
- for (const r in t)
126
- this.nodes[s].style.setProperty(r, t[r]);
127
+ e.forEach((o, t) => {
128
+ for (const s in o)
129
+ this.nodes[t].style.setProperty(s, o[s]);
127
130
  });
128
131
  }
129
132
  }
130
- class ze extends Y {
133
+ class Me extends Y {
131
134
  constructor(e) {
132
135
  super(e, "hue", 'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"', !1);
133
136
  }
@@ -135,15 +138,15 @@ class ze extends Y {
135
138
  this.h = e, this.style([
136
139
  {
137
140
  left: `${e / 360 * 100}%`,
138
- color: H({ h: e, s: 100, v: 100, a: 1 })
141
+ color: T({ h: e, s: 100, v: 100, a: 1 })
139
142
  }
140
143
  ]), this.el.setAttribute("aria-valuenow", `${l(e)}`);
141
144
  }
142
- getMove(e, t) {
143
- return { h: t ? v(this.h + e.x * 360, 0, 360) : 360 * e.x };
145
+ getMove(e, o) {
146
+ return { h: o ? f(this.h + e.x * 360, 0, 360) : 360 * e.x };
144
147
  }
145
148
  }
146
- class Ie extends Y {
149
+ class Fe extends Y {
147
150
  constructor(e) {
148
151
  super(e, "saturation", 'aria-label="Color"', !0);
149
152
  }
@@ -152,44 +155,44 @@ class Ie extends Y {
152
155
  {
153
156
  top: `${100 - e.v}%`,
154
157
  left: `${e.s}%`,
155
- color: H(e)
158
+ color: T(e)
156
159
  },
157
160
  {
158
- "background-color": H({ h: e.h, s: 100, v: 100, a: 1 })
161
+ "background-color": T({ h: e.h, s: 100, v: 100, a: 1 })
159
162
  }
160
163
  ]), this.el.setAttribute("aria-valuetext", `Saturation ${l(e.s)}%, Brightness ${l(e.v)}%`);
161
164
  }
162
- getMove(e, t) {
165
+ getMove(e, o) {
163
166
  return {
164
- s: t ? v(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
165
- v: t ? v(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
167
+ s: o ? f(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
168
+ v: o ? f(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
166
169
  };
167
170
  }
168
171
  }
169
- const Ae = ':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}', Le = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", Me = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", m = Symbol("same"), $ = Symbol("color"), O = Symbol("hsva"), k = Symbol("update"), B = Symbol("parts"), R = Symbol("css"), V = Symbol("sliders");
170
- let Ne = class extends HTMLElement {
172
+ const Ne = ':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}', De = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", Be = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", g = Symbol("same"), $ = Symbol("color"), O = Symbol("hsva"), k = Symbol("update"), R = Symbol("parts"), K = Symbol("css"), V = Symbol("sliders");
173
+ let Oe = class extends HTMLElement {
171
174
  static get observedAttributes() {
172
175
  return ["color"];
173
176
  }
174
- get [R]() {
175
- return [Ae, Le, Me];
177
+ get [K]() {
178
+ return [Ne, De, Be];
176
179
  }
177
180
  get [V]() {
178
- return [Ie, ze];
181
+ return [Fe, Me];
179
182
  }
180
183
  get color() {
181
184
  return this[$];
182
185
  }
183
186
  set color(e) {
184
- if (!this[m](e)) {
185
- const t = this.colorModel.toHsva(e);
186
- this[k](t), this[$] = e;
187
+ if (!this[g](e)) {
188
+ const o = this.colorModel.toHsva(e);
189
+ this[k](o), this[$] = e;
187
190
  }
188
191
  }
189
192
  constructor() {
190
193
  super();
191
- const e = I(`<style>${this[R].join("")}</style>`), t = this.attachShadow({ mode: "open" });
192
- t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[B] = this[V].map((s) => new s(t));
194
+ const e = A(`<style>${this[K].join("")}</style>`), o = this.attachShadow({ mode: "open" });
195
+ o.appendChild(e.content.cloneNode(!0)), o.addEventListener("move", this), this[R] = this[V].map((t) => new t(o));
193
196
  }
194
197
  connectedCallback() {
195
198
  if (this.hasOwnProperty("color")) {
@@ -197,73 +200,73 @@ let Ne = class extends HTMLElement {
197
200
  delete this.color, this.color = e;
198
201
  } else this.color || (this.color = this.colorModel.defaultColor);
199
202
  }
200
- attributeChangedCallback(e, t, s) {
201
- const r = this.colorModel.fromAttr(s);
202
- this[m](r) || (this.color = r);
203
+ attributeChangedCallback(e, o, t) {
204
+ const s = this.colorModel.fromAttr(t);
205
+ this[g](s) || (this.color = s);
203
206
  }
204
207
  handleEvent(e) {
205
- const t = this[O], s = { ...t, ...e.detail };
206
- this[k](s);
207
- let r;
208
- !U(s, t) && !this[m](r = this.colorModel.fromHsva(s)) && (this[$] = r, A(this, "color-changed", { value: r }));
208
+ const o = this[O], t = { ...o, ...e.detail };
209
+ this[k](t);
210
+ let s;
211
+ !U(t, o) && !this[g](s = this.colorModel.fromHsva(t)) && (this[$] = s, M(this, "color-changed", { value: s }));
209
212
  }
210
- [m](e) {
213
+ [g](e) {
211
214
  return this.color && this.colorModel.equal(e, this.color);
212
215
  }
213
216
  [k](e) {
214
- this[O] = e, this[B].forEach((t) => t.update(e));
217
+ this[O] = e, this[R].forEach((o) => o.update(e));
215
218
  }
216
219
  };
217
- const Fe = {
220
+ const Re = {
218
221
  defaultColor: "#000",
219
- toHsva: $e,
220
- fromHsva: ({ h: o, s: e, v: t }) => ke({ h: o, s: e, v: t, a: 1 }),
221
- equal: He,
222
- fromAttr: (o) => o
222
+ toHsva: Se,
223
+ fromHsva: ({ h: r, s: e, v: o }) => Ee({ h: r, s: e, v: o, a: 1 }),
224
+ equal: ze,
225
+ fromAttr: (r) => r
223
226
  };
224
- class Oe extends Ne {
227
+ class Ke extends Oe {
225
228
  get colorModel() {
226
- return Fe;
229
+ return Re;
227
230
  }
228
231
  }
229
- class Q extends Oe {
232
+ class Q extends Ke {
230
233
  }
231
234
  customElements.define("hex-color-picker", Q);
232
- const Be = /^#?([0-9A-F]{3,8})$/i, w = (o, e) => {
233
- const t = Be.exec(o), s = t ? t[1].length : 0;
234
- return s === 3 || // '#rgb' format
235
- s === 6 || // '#rrggbb' format
236
- !!e && s === 4 || // '#rgba' format
237
- !!e && s === 8;
238
- }, Re = I('<slot><input part="input" spellcheck="false"></slot>'), q = (o, e) => o.replace(/([^0-9A-F]+)/gi, "").substring(0, e ? 8 : 6), D = Symbol("alpha"), g = Symbol("color"), K = Symbol("saved"), _ = Symbol("input"), S = Symbol("init"), W = Symbol("prefix"), h = Symbol("update");
239
- class Ve extends HTMLElement {
235
+ const Ve = /^#?([0-9A-F]{3,8})$/i, w = (r, e) => {
236
+ const o = Ve.exec(r), t = o ? o[1].length : 0;
237
+ return t === 3 || // '#rgb' format
238
+ t === 6 || // '#rrggbb' format
239
+ !!e && t === 4 || // '#rgba' format
240
+ !!e && t === 8;
241
+ }, qe = A('<slot><input part="input" spellcheck="false"></slot>'), q = (r, e) => r.replace(/([^0-9A-F]+)/gi, "").substring(0, e ? 8 : 6), W = Symbol("alpha"), x = Symbol("color"), X = Symbol("saved"), _ = Symbol("input"), S = Symbol("init"), j = Symbol("prefix"), u = Symbol("update");
242
+ class We extends HTMLElement {
240
243
  static get observedAttributes() {
241
244
  return ["alpha", "color", "prefixed"];
242
245
  }
243
246
  get color() {
244
- return this[g];
247
+ return this[x];
245
248
  }
246
249
  set color(e) {
247
- this[g] = e, this[h](e);
250
+ this[x] = e, this[u](e);
248
251
  }
249
252
  get alpha() {
250
- return this[D];
253
+ return this[W];
251
254
  }
252
255
  set alpha(e) {
253
- this[D] = e, this.toggleAttribute("alpha", e);
254
- const t = this.color;
255
- t && !w(t, e) && (this.color = t.startsWith("#") ? t.substring(0, t.length === 5 ? 4 : 7) : t.substring(0, t.length === 4 ? 3 : 6));
256
+ this[W] = e, this.toggleAttribute("alpha", e);
257
+ const o = this.color;
258
+ o && !w(o, e) && (this.color = o.startsWith("#") ? o.substring(0, o.length === 5 ? 4 : 7) : o.substring(0, o.length === 4 ? 3 : 6));
256
259
  }
257
260
  get prefixed() {
258
- return this[W];
261
+ return this[j];
259
262
  }
260
263
  set prefixed(e) {
261
- this[W] = e, this.toggleAttribute("prefixed", e), this[h](this.color);
264
+ this[j] = e, this.toggleAttribute("prefixed", e), this[u](this.color);
262
265
  }
263
266
  constructor() {
264
267
  super();
265
268
  const e = this.attachShadow({ mode: "open" });
266
- e.appendChild(Re.content.cloneNode(!0)), e.firstElementChild.addEventListener("slotchange", () => this[S](e));
269
+ e.appendChild(qe.content.cloneNode(!0)), e.firstElementChild.addEventListener("slotchange", () => this[S](e));
267
270
  }
268
271
  connectedCallback() {
269
272
  if (this[S](this.shadowRoot), this.hasOwnProperty("alpha")) {
@@ -279,80 +282,84 @@ class Ve extends HTMLElement {
279
282
  if (this.hasOwnProperty("color")) {
280
283
  const e = this.color;
281
284
  delete this.color, this.color = e;
282
- } else this.color == null ? this.color = this.getAttribute("color") || "" : this[g] && this[h](this[g]);
285
+ } else this.color == null ? this.color = this.getAttribute("color") || "" : this[x] && this[u](this[x]);
283
286
  }
284
287
  handleEvent(e) {
285
- const t = e.target, { value: s } = t;
288
+ const o = e.target, { value: t } = o;
286
289
  switch (e.type) {
287
290
  case "input":
288
- const r = q(s, this.alpha);
289
- this[K] = this.color, (w(r, this.alpha) || s === "") && (this.color = r, this.dispatchEvent(new CustomEvent("color-changed", {
291
+ const s = q(t, this.alpha);
292
+ this[X] = this.color, (w(s, this.alpha) || t === "") && (this.color = s, this.dispatchEvent(new CustomEvent("color-changed", {
290
293
  bubbles: !0,
291
- detail: { value: r ? "#" + r : "" }
294
+ detail: { value: s ? "#" + s : "" }
292
295
  })));
293
296
  break;
294
297
  case "blur":
295
- s && !w(s, this.alpha) && (this.color = this[K]);
298
+ t && !w(t, this.alpha) && (this.color = this[X]);
296
299
  }
297
300
  }
298
- attributeChangedCallback(e, t, s) {
299
- e === "color" && this.color !== s && (this.color = s);
300
- const r = s != null;
301
- e === "alpha" && this.alpha !== r && (this.alpha = r), e === "prefixed" && this.prefixed !== r && (this.prefixed = r);
301
+ attributeChangedCallback(e, o, t) {
302
+ e === "color" && this.color !== t && (this.color = t);
303
+ const s = t != null;
304
+ e === "alpha" && this.alpha !== s && (this.alpha = s), e === "prefixed" && this.prefixed !== s && (this.prefixed = s);
302
305
  }
303
306
  [S](e) {
304
- let t = this.querySelector("input");
305
- if (!t) {
306
- let s;
307
- for (; s = this.firstChild; )
308
- s.remove();
309
- t = e.querySelector("input");
307
+ let o = this.querySelector("input");
308
+ if (!o) {
309
+ let t;
310
+ for (; t = this.firstChild; )
311
+ t.remove();
312
+ o = e.querySelector("input");
310
313
  }
311
- t.addEventListener("input", this), t.addEventListener("blur", this), this[_] = t, this[h](this.color);
314
+ o.addEventListener("input", this), o.addEventListener("blur", this), this[_] = o, this[u](this.color);
312
315
  }
313
- [h](e) {
316
+ [u](e) {
314
317
  this[_] && (this[_].value = e == null || e == "" ? "" : (this.prefixed ? "#" : "") + q(e, this.alpha));
315
318
  }
316
319
  }
317
- class Z extends Ve {
320
+ class Z extends We {
318
321
  }
319
322
  customElements.define("hex-input", Z);
320
- var qe = Object.defineProperty, p = (o, e, t, s) => {
321
- for (var r = void 0, a = o.length - 1, i; a >= 0; a--)
322
- (i = o[a]) && (r = i(e, t, r) || r);
323
- return r && qe(e, t, r), r;
323
+ var Xe = Object.defineProperty, p = (r, e, o, t) => {
324
+ for (var s = void 0, i = r.length - 1, a; i >= 0; i--)
325
+ (a = r[i]) && (s = a(e, o, s) || s);
326
+ return s && Xe(e, o, s), s;
324
327
  };
325
- const T = "vvd-hex-picker", z = "vvd-hex-input";
326
- class De extends Q {
328
+ const I = "vvd-hex-picker", z = "vvd-hex-input";
329
+ class je extends Q {
327
330
  static {
328
331
  this.displayName = "VvdHexPicker";
329
332
  }
330
333
  }
331
- class Ke extends Z {
334
+ class Ge extends Z {
332
335
  static {
333
336
  this.displayName = "VvdHexInput";
334
337
  }
335
338
  }
336
- customElements.get(T) || customElements.define(T, De);
337
- customElements.get(z) || customElements.define(z, Ke);
338
- const X = T, j = z;
339
- class c extends ue(
339
+ /* v8 ignore if -- @preserve */
340
+ customElements.get(I) || customElements.define(I, je);
341
+ /* v8 ignore if -- @preserve */
342
+ customElements.get(z) || customElements.define(z, Ge);
343
+ const G = I, J = z;
344
+ class c extends ve(
340
345
  ne(
341
- ve(fe(de(he(ee))))
346
+ fe(
347
+ be(
348
+ de(me(ue(ee)))
349
+ )
350
+ )
342
351
  )
343
352
  ) {
344
353
  constructor() {
345
- super(...arguments), this.disableSavedColors = !1, this.savedColors = [], this.maxSwatches = 6, this.copyIconName = "copy-2-line", this.#e = null, this._copyValueToClipboard = async (e) => {
354
+ super(...arguments), this.disableSavedColors = !1, this.savedColors = [], this.maxSwatches = 6, this.#t = (e) => {
355
+ this._isInPath(e, this._buttonEl) || this._isInPath(e, this._popupEl) || (this.open = !1);
356
+ }, this.copyIconName = "copy-2-line", this.#e = null, this._copyValueToClipboard = async (e) => {
346
357
  try {
347
- await navigator.clipboard.writeText(e), this._setTemporaryCopyIcon("check-circle-line");
358
+ await navigator.clipboard.writeText(e), this._setTemporaryCopyIcon("check-circle-line"), this._ariaLiveDescription = this.locale.colorPicker.copySuccessMessage(e);
348
359
  } catch {
349
- alert(this.locale?.colorPicker?.copyErrorText), this._setTemporaryCopyIcon("error-line");
360
+ alert(this.locale.colorPicker.copyErrorText), this._setTemporaryCopyIcon("error-line"), this._ariaLiveDescription = this.locale.colorPicker.copyErrorText;
350
361
  }
351
- }, this.#t = (e) => {
352
- this._isInPath(e, this._buttonEl) || this._isInPath(e, this._popupEl) || (this.open = !1);
353
- }, this.#o = (e) => {
354
- e.key === "Escape" && (this.open = !1);
355
- };
362
+ }, this._ariaLiveDescription = "";
356
363
  }
357
364
  static {
358
365
  this.HEX_COLOR_PATTERN = /^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$/;
@@ -361,6 +368,7 @@ class c extends ue(
361
368
  * @internal
362
369
  */
363
370
  placeholderChanged() {
371
+ /* v8 ignore if -- @preserve */
364
372
  this.proxy instanceof HTMLInputElement && (this.proxy.placeholder = this.placeholder);
365
373
  }
366
374
  /**
@@ -371,6 +379,14 @@ class c extends ue(
371
379
  handleChange() {
372
380
  this.$emit("change");
373
381
  }
382
+ /**
383
+ * @internal
384
+ */
385
+ openChanged(e, o) {
386
+ o && this.isConnected && requestAnimationFrame(() => {
387
+ this._refreshCanvasColor();
388
+ });
389
+ }
374
390
  /**
375
391
  * @internal
376
392
  */
@@ -389,6 +405,55 @@ class c extends ue(
389
405
  _handleColorSaving() {
390
406
  this._saveCurrentColor();
391
407
  }
408
+ /**
409
+ * @internal
410
+ */
411
+ _saveCurrentColor() {
412
+ const e = this.value;
413
+ if (typeof e != "string" || !b(e)) return;
414
+ const o = Array.isArray(this.savedColors) ? [...this.savedColors] : [], t = o.findIndex((s) => s?.value === e);
415
+ t !== -1 && o.splice(t, 1), o.unshift({ value: e }), this.savedColors = o.slice(0, this._maxSwatchesNormalized), this._setSavedColors(this.savedColors);
416
+ }
417
+ /**
418
+ * @internal
419
+ */
420
+ _loadSavedColors() {
421
+ try {
422
+ const e = localStorage.getItem(this._savedColorsStorageKey);
423
+ if (!e) return [];
424
+ const o = JSON.parse(e);
425
+ return Array.isArray(o) ? o.filter(
426
+ (t) => t && typeof t.value == "string" && b(t.value)
427
+ ).map((t) => ({
428
+ value: t.value,
429
+ label: typeof t.label == "string" ? t.label : void 0
430
+ })) : [];
431
+ } catch {
432
+ return [];
433
+ }
434
+ }
435
+ /**
436
+ * @internal
437
+ */
438
+ _setSavedColors(e) {
439
+ try {
440
+ localStorage.setItem(
441
+ this._savedColorsStorageKey,
442
+ JSON.stringify(e)
443
+ );
444
+ } catch {
445
+ }
446
+ }
447
+ /**
448
+ * Get all color swatches combined, both from swatches property and saved colors
449
+ * @internal
450
+ */
451
+ get allSwatches() {
452
+ const e = Array.isArray(this.swatches) ? this.swatches : [], o = Array.isArray(this.savedColors) ? this.savedColors : [], t = /* @__PURE__ */ new Set(), s = [], i = (a) => {
453
+ !a || typeof a.value != "string" || !b(a.value) || t.has(a.value) || (t.add(a.value), s.push(a));
454
+ };
455
+ return this.disableSavedColors || o.forEach(i), e.forEach(i), s.slice(0, this._maxSwatchesNormalized);
456
+ }
392
457
  /**
393
458
  * @internal
394
459
  */
@@ -411,21 +476,22 @@ class c extends ue(
411
476
  /**
412
477
  * @internal
413
478
  */
414
- valueChanged(e, t) {
415
- this._vcHexPickerEl && typeof t == "string" && (this._vcHexPickerEl.color = t), this._vcHexInputEl && typeof t == "string" && (this._vcHexInputEl.color = t);
479
+ valueChanged(e, o) {
480
+ this._vcHexPickerEl && typeof o == "string" && (this._vcHexPickerEl.color = o), this._vcHexInputEl && typeof o == "string" && (this._vcHexInputEl.color = o);
416
481
  }
417
482
  /**
418
483
  * @internal
419
484
  */
420
485
  _onTextFieldInput(e) {
421
- const t = e.currentTarget;
422
- this.value = t.value;
486
+ const o = e.currentTarget;
487
+ this.value = o.value;
423
488
  }
424
489
  /**
425
490
  * @internal
426
491
  */
427
492
  get _buttonColor() {
428
- return this._canvasColor || this._refreshCanvasColor(), this.value && f(this.value) ? this.value : "var(--vvd-color-canvas-text)";
493
+ /* v8 ignore else -- @preserve */
494
+ return this._canvasColor || this._refreshCanvasColor(), this.value && b(this.value) ? this.value : "var(--vvd-color-canvas-text)";
429
495
  }
430
496
  /**
431
497
  * @internal
@@ -442,207 +508,211 @@ class c extends ue(
442
508
  /**
443
509
  * @internal
444
510
  */
445
- _isInPath(e, t) {
446
- if (!t) return !1;
447
- const s = e.composedPath?.();
448
- return !!(s && s.includes(t));
449
- }
450
- #e;
451
- /**
452
- * @internal
453
- */
454
- _setTemporaryCopyIcon(e, t = 2e3) {
455
- this.copyIconName = e, this.#e && clearTimeout(this.#e), this.#e = setTimeout(() => {
456
- this.copyIconName = "copy-2-line", this.#e = null;
457
- }, t);
511
+ _isInPath(e, o) {
512
+ if (!o) return !1;
513
+ const t = e.composedPath?.();
514
+ return !!(t && t.includes(o));
458
515
  }
516
+ #t;
459
517
  connectedCallback() {
460
- super.connectedCallback(), this._refreshCanvasColor(), this.savedColors = this._loadSavedColors(), document.addEventListener("mousedown", this.#t, !0), document.addEventListener("keydown", this.#o);
518
+ super.connectedCallback(), this.savedColors = this._loadSavedColors(), document.addEventListener("mousedown", this.#t, !0);
461
519
  }
462
520
  disconnectedCallback() {
463
521
  super.disconnectedCallback(), document.removeEventListener(
464
522
  "mousedown",
465
523
  this.#t,
466
524
  !0
467
- ), document.removeEventListener("keydown", this.#o);
525
+ );
468
526
  }
469
- #t;
470
- #o;
527
+ #e;
471
528
  /**
472
529
  * @internal
473
530
  */
474
- _saveCurrentColor() {
475
- const e = this.value;
476
- if (typeof e != "string" || !f(e)) return;
477
- const t = Array.isArray(this.savedColors) ? [...this.savedColors] : [], s = t.findIndex((r) => r?.value === e);
478
- s !== -1 && t.splice(s, 1), t.unshift({ value: e }), this.savedColors = t.slice(0, this._maxSwatchesNormalized), this._setSavedColors(this.savedColors);
531
+ _setTemporaryCopyIcon(e, o = 2e3) {
532
+ this.copyIconName = e, this.#e && clearTimeout(this.#e), this.#e = setTimeout(() => {
533
+ this.copyIconName = "copy-2-line", this.#e = null;
534
+ }, o);
479
535
  }
536
+ // --- Trapped focus ---
480
537
  /**
481
538
  * @internal
482
539
  */
483
- _loadSavedColors() {
484
- try {
485
- const e = localStorage.getItem(this._savedColorsStorageKey);
486
- if (!e) return [];
487
- const t = JSON.parse(e);
488
- return Array.isArray(t) ? t.filter(
489
- (s) => s && typeof s.value == "string" && f(s.value)
490
- ).map((s) => ({
491
- value: s.value,
492
- label: typeof s.label == "string" ? s.label : void 0
493
- })) : [];
494
- } catch {
495
- return [];
496
- }
540
+ _onBaseKeydown(e) {
541
+ return this.open && he(e) ? (this.open = !1, !1) : !this._trappedFocus(e, () => this._focusableElsWithinDialog());
497
542
  }
498
543
  /**
499
544
  * @internal
500
545
  */
501
- _setSavedColors(e) {
502
- try {
503
- localStorage.setItem(
504
- this._savedColorsStorageKey,
505
- JSON.stringify(e)
506
- );
507
- } catch {
546
+ _focusableElsWithinDialog() {
547
+ return this._popupEl.querySelectorAll(
548
+ 'button:not([role="gridcell"]), [data-vvd-component="button"], vwc-button:not([role="gridcell"])'
549
+ );
550
+ }
551
+ /**
552
+ * @internal
553
+ */
554
+ _handleCellKeydown(e, o, t, s) {
555
+ if (e.key === "Tab") {
556
+ e.preventDefault();
557
+ const i = this._focusableElsWithinDialog(), a = Array.prototype.indexOf.call(
558
+ i,
559
+ e.currentTarget
560
+ ), d = e.shiftKey ? (a - 1 + i.length) % i.length : (a + 1) % i.length;
561
+ return i[d]?.focus(), !1;
508
562
  }
563
+ return super._handleCellKeydown(e, o, t, s);
509
564
  }
510
565
  /**
511
- * Get all color swatches combined, both from swatches property and saved colors
512
566
  * @internal
513
567
  */
514
- get allSwatches() {
515
- const e = Array.isArray(this.swatches) ? this.swatches : [], t = Array.isArray(this.savedColors) ? this.savedColors : [], s = /* @__PURE__ */ new Set(), r = [], a = (i) => {
516
- !i || typeof i.value != "string" || !f(i.value) || s.has(i.value) || (s.add(i.value), r.push(i));
517
- };
518
- return this.disableSavedColors || t.forEach(a), e.forEach(a), r.slice(0, this._maxSwatchesNormalized);
568
+ _handleSwatchSelection(e) {
569
+ /* v8 ignore else -- @preserve */
570
+ this.value !== e && (this._ariaLiveDescription = this.locale.colorPicker.selectionSuccessMessage(e)), super._handleSwatchSelection(e);
519
571
  }
520
572
  }
521
573
  p([
522
- x
574
+ y
523
575
  ], c.prototype, "placeholder");
524
576
  p([
525
- x({ attribute: "saved-colors-key" })
577
+ y({ attribute: "saved-colors-key" })
526
578
  ], c.prototype, "savedColorsKey");
527
579
  p([
528
- x({
580
+ y({
529
581
  mode: "boolean",
530
582
  attribute: "disable-saved-colors"
531
583
  })
532
584
  ], c.prototype, "disableSavedColors");
533
585
  p([
534
- G
586
+ L
535
587
  ], c.prototype, "savedColors");
536
588
  p([
537
- x({
589
+ y({
538
590
  attribute: "max-swatches",
539
591
  mode: "fromView",
540
592
  converter: te
541
593
  })
542
594
  ], c.prototype, "maxSwatches");
543
595
  p([
544
- G
596
+ L
545
597
  ], c.prototype, "copyIconName");
546
- function We(o, e) {
598
+ p([
599
+ L
600
+ ], c.prototype, "_ariaLiveDescription");
601
+ function Je(r, e) {
547
602
  return n`
548
- <${o}
603
+ <${r}
549
604
  id="text-field"
550
- class="${(s) => M("control")}"
605
+ class="${(t) => N("control")}"
551
606
  pattern="${c.HEX_COLOR_PATTERN.source}"
552
607
  maxlength="7"
553
- label="${(s) => s.label}"
554
- :value="${(s) => s.value}"
555
- placeholder="${(s) => s.placeholder}"
556
- helper-text="${(s) => s.helperText}"
557
- error-text="${(s) => s.errorValidationMessage}"
558
- success-text="${(s) => s.successText}"
559
- ?disabled="${(s) => s.disabled}"
560
- ?required="${(s) => s.required}"
561
- @input='${(s, r) => s._onTextFieldInput(r.event)}'
562
- @change="${(s) => s.handleChange()}"
563
- @blur="${(s) => {
564
- s.$emit("blur", void 0, { bubbles: !1 });
608
+ label="${(t) => t.label}"
609
+ :value="${(t) => t.value}"
610
+ placeholder="${(t) => t.placeholder}"
611
+ helper-text="${(t) => t.helperText}"
612
+ error-text="${(t) => t.errorValidationMessage}"
613
+ success-text="${(t) => t.successText}"
614
+ ?disabled="${(t) => t.disabled}"
615
+ ?required="${(t) => t.required}"
616
+ @input='${(t, s) => t._onTextFieldInput(s.event)}'
617
+ @change="${(t) => t.handleChange()}"
618
+ @blur="${(t) => {
619
+ t.$emit("blur", void 0, { bubbles: !1 });
565
620
  }}"
566
- @focus="${(s) => {
567
- s.$emit("focus", void 0, { bubbles: !1 });
621
+ @focus="${(t) => {
622
+ t.$emit("focus", void 0, { bubbles: !1 });
568
623
  }}"
569
624
  ${pe()}
570
- ${u("_textFieldEl")}
625
+ ${v("_textFieldEl")}
571
626
  >
572
627
  <button
573
- aria-label="${(s) => s.locale.colorPicker.pickerButtonLabel}"
574
- class="button ${(s) => M(
575
- s._applyContrastClass(s._buttonColor) ? "contrast" : "",
576
- s.disabled ? "disabled" : ""
628
+ aria-label="${(t) => t.locale.colorPicker.pickerButtonLabel}"
629
+ aria-expanded="${(t) => t.open}"
630
+ aria-haspopup="dialog"
631
+ class="button ${(t) => N(
632
+ t._applyContrastClass(t._buttonColor) ? "contrast" : "",
633
+ t.disabled ? "disabled" : ""
577
634
  )}"
578
- style="--button-color: ${(s) => s._buttonColor};"
579
- ?disabled="${(s) => s.disabled}"
580
- @click="${(s) => s._onButtonClick()}"
635
+ style="--button-color: ${(t) => t._buttonColor};"
636
+ ?disabled="${(t) => t.disabled}"
637
+ @click="${(t) => t._onButtonClick()}"
581
638
  slot="action-items"
582
- ${u("_buttonEl")}>
639
+ ${v("_buttonEl")}>
583
640
  <${e} name="edit-line"></${e}>
584
641
  </button>
585
642
  <slot
586
- slot="${(s) => s._helperTextSlottedContent?.length ? "helper-text" : void 0}"
643
+ slot="${(t) => t._helperTextSlottedContent?.length ? "helper-text" : void 0}"
587
644
  name="helper-text"
588
- ${L("_helperTextSlottedContent")}
645
+ ${F("_helperTextSlottedContent")}
589
646
  ></slot>
590
647
  <slot
591
- slot='${(s) => s._contextualHelpSlottedContent?.length ? "contextual-help" : void 0}'
648
+ slot='${(t) => t._contextualHelpSlottedContent?.length ? "contextual-help" : void 0}'
592
649
  name='contextual-help'
593
- ${L("_contextualHelpSlottedContent")}
650
+ ${F("_contextualHelpSlottedContent")}
594
651
  ></slot>
595
- </${o}>
652
+ </${r}>
596
653
  `;
597
654
  }
598
- function Xe(o, e) {
655
+ function Ue(r, e) {
599
656
  return n`
600
657
  <div class="header">
601
- <span class="header-title" id="color-picker-title">
602
- <slot name="popup-text">${(t) => t.locale.colorPicker.popupLabel}</slot>
603
- </span>
604
- <${o} size="condensed"
605
- aria-label="${(t) => t.locale.colorPicker.closeButtonLabel}"
606
- @click="${(t) => t._handleCloseRequest()}">
658
+ <h2 class="header-title" id="color-picker-title">
659
+ <slot name="popup-text">${(o) => o.locale.colorPicker.popupLabel}</slot>
660
+ </h2>
661
+ <${r} size="condensed"
662
+ aria-label="${(o) => o.locale.colorPicker.closeButtonLabel}"
663
+ @click="${(o) => o._handleCloseRequest()}">
607
664
  <${e} slot="icon" name="close-line"></${e}>
608
- </${o}>
665
+ </${r}>
609
666
  </div>
610
667
  `;
611
668
  }
612
- function je(o, e) {
669
+ function Ye(r, e, o) {
613
670
  return n`
614
671
  <div class="body">
615
- <${n.partial(X)}
672
+ <${n.partial(G)}
616
673
  part="hex-picker"
617
674
  color="${(t) => t.value}"
618
675
  @color-changed="${(t, s) => t._onPickerColorChanged(s.event)}"
619
- ${u("_vcHexPickerEl")}
620
- ></${n.partial(X)}>
676
+ ${v("_vcHexPickerEl")}
677
+ ></${n.partial(G)}>
621
678
  <div class="hex-input-wrapper">
622
- <${n.partial(j)}
679
+ <${n.partial(J)}
623
680
  part="hex-input"
624
681
  prefixed
625
682
  color="${(t) => t.value}"
626
683
  @color-changed="${(t, s) => t._onPickerColorChanged(s.event)}"
627
- ${u("_vcHexInputEl")}
628
- ></${n.partial(j)}>
629
- <${o} size="normal"
630
- aria-label="${(t) => t.locale.colorPicker.copyButtonLabel}"
631
- @click="${(t) => t._copyValueToClipboard(t.value)}">
632
- <${e} slot="icon" name="${(t) => t.copyIconName}"></${e}>
684
+ ${v("_vcHexInputEl")}
685
+ >
686
+ <input name="hex-code-input" aria-label="${(t) => t.locale.colorPicker.hexInputLabel}"
687
+ placeholder="${(t) => t.placeholder}"
688
+ @blur="${(t, s) => s.event.stopImmediatePropagation()}"
689
+ part="input">
690
+ </${n.partial(J)}>
691
+ <${o} placement="top"
692
+ text="${(t) => t.locale.colorPicker.copyButtonLabel}"
693
+ exportparts="vvd-theme-alternate">
694
+ <${r}
695
+ slot="anchor" size="normal"
696
+ aria-label="${(t) => t.locale.colorPicker.copyButtonLabel}"
697
+ @click="${(t) => t._copyValueToClipboard(t.value)}">
698
+ <${e} slot="icon" name="${(t) => t.copyIconName}"></${e}>
699
+ </${r}>
633
700
  </${o}>
634
701
  </div>
635
702
  </div>
636
703
  `;
637
704
  }
638
- function Ge(o, e) {
705
+ function Qe(r, e, o) {
639
706
  return n`
640
707
  <div class="footer">
641
- <span class="footer-title" id="color-picker-footer-title"
642
- ><slot name="swatches-text"
643
- >${(t) => t.locale.colorPicker.swatchesLabel}</slot
644
- ></span
645
- >
708
+ <div class="footer-header">
709
+ <span class="footer-title" id="color-picker-footer-title"
710
+ ><slot name="swatches-text"
711
+ >${(t) => t.locale.colorPicker.swatchesLabel}</slot
712
+ ></span
713
+ >
714
+ ${E((t) => !t.disableSavedColors, Ze())}
715
+ </div>
646
716
  <div
647
717
  class="palette"
648
718
  role="grid"
@@ -651,76 +721,97 @@ function Ge(o, e) {
651
721
  style="--swatches-per-row: ${(t) => t._getRowLength()};"
652
722
  aria-labelledby="color-picker-footer-title"
653
723
  >
654
- ${Ce(
724
+ ${we(
655
725
  (t) => t.allSwatches,
656
- (t) => t._renderColorSwatch(e),
726
+ (t) => t._renderColorSwatch(e, o),
657
727
  { positioning: !0 }
658
728
  )}
659
- ${J(
729
+ ${E(
660
730
  (t) => !t.disableSavedColors,
661
731
  n`
662
- <${o}
663
- appearance="outlined"
664
- size="super-condensed"
665
- role="gridcell"
666
- tabindex="${(t) => t.allSwatches.length ? "-1" : "0"}"
667
- aria-label="${(t) => t.locale.colorPicker.saveButtonLabel}"
668
- @click="${(t) => t._saveCurrentColor()}"
669
- @keydown="${(t, s) => t._handleCellKeydown(
732
+ <${o} placement="top"
733
+ text="${(t) => t.locale.colorPicker.saveButtonLabel}"
734
+ exportparts="vvd-theme-alternate">
735
+ <${r}
736
+ slot="anchor"
737
+ appearance="outlined"
738
+ size="super-condensed"
739
+ role="gridcell"
740
+ tabindex="${(t) => t.allSwatches.length ? "-1" : "0"}"
741
+ aria-label="${(t) => t.locale.colorPicker.saveButtonLabel}"
742
+ @click="${(t) => t._saveCurrentColor()}"
743
+ @keydown="${(t, s) => t._handleCellKeydown(
670
744
  s.event,
671
745
  t.value,
672
746
  t.allSwatches.length,
673
747
  !0
674
748
  )}">
675
- >
676
- <${e} slot="icon" name="plus-line"></${e}>
677
- </${o}>
678
- `
749
+ <${e} slot="icon" name="plus-line"></${e}>
750
+ </${r}>
751
+ </${o}>
752
+ `
679
753
  )}
680
754
  </div>
681
755
  </div>
682
756
  `;
683
757
  }
684
- const Je = (o) => {
685
- const e = o.tagFor(be), t = o.tagFor(ie), s = o.tagFor(re), r = o.tagFor(ge);
758
+ function Ze() {
686
759
  return n`
687
- <div class="base">
688
- ${We(e, t)}
689
- <${s}
760
+ <span
761
+ id="swatches-count"
762
+ class="swatches-count"
763
+ aria-label="${(r) => r.locale.colorPicker.maxSwatchesMessage(
764
+ r.allSwatches.length,
765
+ r.maxSwatches
766
+ )}"
767
+ >${(r) => `${r.allSwatches.length}/${r.maxSwatches}`}</span
768
+ >
769
+ `;
770
+ }
771
+ const et = (r) => {
772
+ const e = r.tagFor(ge), o = r.tagFor(ie), t = r.tagFor(se), s = r.tagFor(ye), i = r.tagFor($e);
773
+ return n`
774
+ <div class="base" @keydown="${(a, { event: d }) => a._onBaseKeydown(d)}">
775
+ <span aria-live="assertive" aria-relevant="text" class="visually-hidden">
776
+ ${(a) => a._ariaLiveDescription}
777
+ </span>
778
+ ${Je(e, o)}
779
+ <${t}
690
780
  :open="${(a) => a.open}"
691
781
  :anchor="${(a) => a._buttonEl}"
692
782
  placement="top"
693
783
  offset="10"
694
- ${u("_popupEl")}>
784
+ ${v("_popupEl")}>
695
785
  <div class="dialog"
696
786
  role="dialog"
697
787
  aria-modal="true"
698
788
  aria-labelledby="color-picker-title">
699
- ${Xe(r, t)}
700
- ${je(r, t)}
701
- ${J(
789
+ ${Ue(s, o)}
790
+ ${Ye(s, o, i)}
791
+ ${E(
702
792
  (a) => !a.disableSavedColors || a.allSwatches.length > 0,
703
- Ge(r, t)
793
+ Qe(s, o, i)
704
794
  )}
705
795
  </div>
706
- </${s}>
796
+ </${t}>
707
797
  </div>
708
798
  `;
709
- }, Ue = se(
799
+ }, tt = re(
710
800
  "color-picker",
711
801
  c,
712
- Je,
802
+ et,
713
803
  [
714
804
  ae,
715
805
  le,
716
- me,
717
806
  xe,
807
+ Ce,
808
+ ke,
718
809
  ce
719
810
  ],
720
811
  {
721
- styles: ye
812
+ styles: _e
722
813
  }
723
- ), Ye = oe(
724
- Ue
814
+ ), ot = oe(
815
+ tt
725
816
  );
726
- Ye();
817
+ ot();