@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
@@ -8,15 +8,18 @@ const icon_definition = require('../icon/definition.cjs');
8
8
  const mixins = require('../unbundled/mixins.cjs');
9
9
  const fastElement = require('@microsoft/fast-element');
10
10
  const delegatesAria = require('../unbundled/delegates-aria.cjs');
11
+ const index = require('../unbundled/index.cjs');
11
12
  const withContextualHelp = require('../unbundled/with-contextual-help.cjs');
13
+ const trappedFocus = require('../unbundled/trapped-focus.cjs');
12
14
  const baseColorPicker = require('../unbundled/base-color-picker.cjs');
13
15
  const withErrorText = require('../unbundled/with-error-text.cjs');
14
16
  const withSuccessText = require('../unbundled/with-success-text.cjs');
15
17
  const fastWebUtilities = require('@microsoft/fast-web-utilities');
16
18
  const textField_definition = require('../text-field/definition.cjs');
17
19
  const button_definition = require('../unbundled/definition.cjs');
20
+ const tooltip_definition = require('../tooltip/definition.cjs');
18
21
 
19
- const styles = ".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)}";
22
+ const styles = ".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)}";
20
23
 
21
24
  // Clamps a value between an upper and lower bound.
22
25
  // We use ternary operators because it makes the minified code
@@ -596,9 +599,11 @@ class VvdHexInput extends HexInput {
596
599
  this.displayName = "VvdHexInput";
597
600
  }
598
601
  }
602
+ /* v8 ignore if -- @preserve */
599
603
  if (!customElements.get(VC_HEX_PICKER_TAG)) {
600
604
  customElements.define(VC_HEX_PICKER_TAG, VvdHexPicker);
601
605
  }
606
+ /* v8 ignore if -- @preserve */
602
607
  if (!customElements.get(VC_HEX_INPUT_TAG)) {
603
608
  customElements.define(VC_HEX_INPUT_TAG, VvdHexInput);
604
609
  }
@@ -606,7 +611,11 @@ const vcPickerTag = VC_HEX_PICKER_TAG;
606
611
  const vcInputTag = VC_HEX_INPUT_TAG;
607
612
  class ColorPicker extends withContextualHelp.WithContextualHelp(
608
613
  mixins.WithFeedback(
609
- withErrorText.WithErrorText(withSuccessText.WithSuccessText(delegatesAria.DelegatesAria(baseColorPicker.BaseColorPicker(vividElement.VividElement))))
614
+ withErrorText.WithErrorText(
615
+ withSuccessText.WithSuccessText(
616
+ delegatesAria.DelegatesAria(trappedFocus.TrappedFocus(baseColorPicker.BaseColorPicker(vividElement.VividElement)))
617
+ )
618
+ )
610
619
  )
611
620
  ) {
612
621
  constructor() {
@@ -614,20 +623,6 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
614
623
  this.disableSavedColors = false;
615
624
  this.savedColors = [];
616
625
  this.maxSwatches = 6;
617
- this.copyIconName = "copy-2-line";
618
- this.#iconResetTimer = null;
619
- /**
620
- * @internal
621
- */
622
- this._copyValueToClipboard = async (value) => {
623
- try {
624
- await navigator.clipboard.writeText(value);
625
- this._setTemporaryCopyIcon("check-circle-line");
626
- } catch {
627
- alert(this.locale?.colorPicker?.copyErrorText);
628
- this._setTemporaryCopyIcon("error-line");
629
- }
630
- };
631
626
  /**
632
627
  * @internal
633
628
  */
@@ -637,14 +632,23 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
637
632
  }
638
633
  this.open = false;
639
634
  };
635
+ this.copyIconName = "copy-2-line";
636
+ this.#iconResetTimer = null;
640
637
  /**
641
638
  * @internal
642
639
  */
643
- this.#closeOnEscape = (e) => {
644
- if (e.key === "Escape") {
645
- this.open = false;
640
+ this._copyValueToClipboard = async (value) => {
641
+ try {
642
+ await navigator.clipboard.writeText(value);
643
+ this._setTemporaryCopyIcon("check-circle-line");
644
+ this._ariaLiveDescription = this.locale.colorPicker.copySuccessMessage(value);
645
+ } catch {
646
+ alert(this.locale.colorPicker.copyErrorText);
647
+ this._setTemporaryCopyIcon("error-line");
648
+ this._ariaLiveDescription = this.locale.colorPicker.copyErrorText;
646
649
  }
647
650
  };
651
+ this._ariaLiveDescription = "";
648
652
  }
649
653
  static {
650
654
  /**
@@ -658,6 +662,7 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
658
662
  * @internal
659
663
  */
660
664
  placeholderChanged() {
665
+ /* v8 ignore if -- @preserve */
661
666
  if (this.proxy instanceof HTMLInputElement) {
662
667
  this.proxy.placeholder = this.placeholder;
663
668
  }
@@ -670,6 +675,16 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
670
675
  handleChange() {
671
676
  this.$emit("change");
672
677
  }
678
+ /**
679
+ * @internal
680
+ */
681
+ openChanged(_oldValue, newValue) {
682
+ if (newValue && this.isConnected) {
683
+ requestAnimationFrame(() => {
684
+ this._refreshCanvasColor();
685
+ });
686
+ }
687
+ }
673
688
  /**
674
689
  * @internal
675
690
  */
@@ -690,6 +705,71 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
690
705
  _handleColorSaving() {
691
706
  this._saveCurrentColor();
692
707
  }
708
+ /**
709
+ * @internal
710
+ */
711
+ _saveCurrentColor() {
712
+ const value = this.value;
713
+ if (typeof value !== "string" || !baseColorPicker.isValidHexColor(value)) return;
714
+ const swatches = Array.isArray(this.savedColors) ? [...this.savedColors] : [];
715
+ const idx = swatches.findIndex((s) => s?.value === value);
716
+ if (idx !== -1) swatches.splice(idx, 1);
717
+ swatches.unshift({ value });
718
+ this.savedColors = swatches.slice(0, this._maxSwatchesNormalized);
719
+ this._setSavedColors(this.savedColors);
720
+ }
721
+ /**
722
+ * @internal
723
+ */
724
+ _loadSavedColors() {
725
+ try {
726
+ const savedColors = localStorage.getItem(this._savedColorsStorageKey);
727
+ if (!savedColors) return [];
728
+ const parsed = JSON.parse(savedColors);
729
+ if (!Array.isArray(parsed)) return [];
730
+ return parsed.filter(
731
+ (x) => x && typeof x.value === "string" && baseColorPicker.isValidHexColor(x.value)
732
+ ).map((x) => ({
733
+ value: x.value,
734
+ label: typeof x.label === "string" ? x.label : void 0
735
+ }));
736
+ } catch {
737
+ return [];
738
+ }
739
+ }
740
+ /**
741
+ * @internal
742
+ */
743
+ _setSavedColors(swatches) {
744
+ try {
745
+ localStorage.setItem(
746
+ this._savedColorsStorageKey,
747
+ JSON.stringify(swatches)
748
+ );
749
+ } catch {
750
+ }
751
+ }
752
+ /**
753
+ * Get all color swatches combined, both from swatches property and saved colors
754
+ * @internal
755
+ */
756
+ get allSwatches() {
757
+ const predefinedColors = Array.isArray(this.swatches) ? this.swatches : [];
758
+ const savedColors = Array.isArray(this.savedColors) ? this.savedColors : [];
759
+ const seen = /* @__PURE__ */ new Set();
760
+ const merged = [];
761
+ const appendIfUniqueAndValid = (swatch) => {
762
+ if (!swatch || typeof swatch.value !== "string") return;
763
+ if (!baseColorPicker.isValidHexColor(swatch.value) || seen.has(swatch.value)) return;
764
+ seen.add(swatch.value);
765
+ merged.push(swatch);
766
+ };
767
+ if (!this.disableSavedColors) {
768
+ savedColors.forEach(appendIfUniqueAndValid);
769
+ }
770
+ predefinedColors.forEach(appendIfUniqueAndValid);
771
+ return merged.slice(0, this._maxSwatchesNormalized);
772
+ }
693
773
  /**
694
774
  * @internal
695
775
  */
@@ -736,6 +816,7 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
736
816
  * @internal
737
817
  */
738
818
  get _buttonColor() {
819
+ /* v8 ignore else -- @preserve */
739
820
  if (!this._canvasColor) {
740
821
  this._refreshCanvasColor();
741
822
  }
@@ -764,24 +845,11 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
764
845
  const path = e.composedPath?.();
765
846
  return !!(path && path.includes(el));
766
847
  }
767
- #iconResetTimer;
768
- /**
769
- * @internal
770
- */
771
- _setTemporaryCopyIcon(name, ms = 2e3) {
772
- this.copyIconName = name;
773
- if (this.#iconResetTimer) clearTimeout(this.#iconResetTimer);
774
- this.#iconResetTimer = setTimeout(() => {
775
- this.copyIconName = "copy-2-line";
776
- this.#iconResetTimer = null;
777
- }, ms);
778
- }
848
+ #closeOnPointerOutside;
779
849
  connectedCallback() {
780
850
  super.connectedCallback();
781
- this._refreshCanvasColor();
782
851
  this.savedColors = this._loadSavedColors();
783
852
  document.addEventListener("mousedown", this.#closeOnPointerOutside, true);
784
- document.addEventListener("keydown", this.#closeOnEscape);
785
853
  }
786
854
  disconnectedCallback() {
787
855
  super.disconnectedCallback();
@@ -790,74 +858,67 @@ class ColorPicker extends withContextualHelp.WithContextualHelp(
790
858
  this.#closeOnPointerOutside,
791
859
  true
792
860
  );
793
- document.removeEventListener("keydown", this.#closeOnEscape);
794
861
  }
795
- #closeOnPointerOutside;
796
- #closeOnEscape;
862
+ #iconResetTimer;
797
863
  /**
798
864
  * @internal
799
865
  */
800
- _saveCurrentColor() {
801
- const value = this.value;
802
- if (typeof value !== "string" || !baseColorPicker.isValidHexColor(value)) return;
803
- const swatches = Array.isArray(this.savedColors) ? [...this.savedColors] : [];
804
- const idx = swatches.findIndex((s) => s?.value === value);
805
- if (idx !== -1) swatches.splice(idx, 1);
806
- swatches.unshift({ value });
807
- this.savedColors = swatches.slice(0, this._maxSwatchesNormalized);
808
- this._setSavedColors(this.savedColors);
866
+ _setTemporaryCopyIcon(name, ms = 2e3) {
867
+ this.copyIconName = name;
868
+ if (this.#iconResetTimer) clearTimeout(this.#iconResetTimer);
869
+ this.#iconResetTimer = setTimeout(() => {
870
+ this.copyIconName = "copy-2-line";
871
+ this.#iconResetTimer = null;
872
+ }, ms);
809
873
  }
874
+ // --- Trapped focus ---
810
875
  /**
811
876
  * @internal
812
877
  */
813
- _loadSavedColors() {
814
- try {
815
- const savedColors = localStorage.getItem(this._savedColorsStorageKey);
816
- if (!savedColors) return [];
817
- const parsed = JSON.parse(savedColors);
818
- if (!Array.isArray(parsed)) return [];
819
- return parsed.filter(
820
- (x) => x && typeof x.value === "string" && baseColorPicker.isValidHexColor(x.value)
821
- ).map((x) => ({
822
- value: x.value,
823
- label: typeof x.label === "string" ? x.label : void 0
824
- }));
825
- } catch {
826
- return [];
878
+ _onBaseKeydown(event) {
879
+ if (this.open && index.handleEscapeKeyAndStopPropogation(event)) {
880
+ this.open = false;
881
+ return false;
827
882
  }
883
+ if (this._trappedFocus(event, () => this._focusableElsWithinDialog())) {
884
+ return false;
885
+ }
886
+ return true;
828
887
  }
829
888
  /**
830
889
  * @internal
831
890
  */
832
- _setSavedColors(swatches) {
833
- try {
834
- localStorage.setItem(
835
- this._savedColorsStorageKey,
836
- JSON.stringify(swatches)
891
+ _focusableElsWithinDialog() {
892
+ return this._popupEl.querySelectorAll(
893
+ 'button:not([role="gridcell"]), [data-vvd-component="button"], vwc-button:not([role="gridcell"])'
894
+ );
895
+ }
896
+ /**
897
+ * @internal
898
+ */
899
+ _handleCellKeydown(event, value, index, isSaveCell) {
900
+ if (event.key === "Tab") {
901
+ event.preventDefault();
902
+ const focusableEls = this._focusableElsWithinDialog();
903
+ const idx = Array.prototype.indexOf.call(
904
+ focusableEls,
905
+ event.currentTarget
837
906
  );
838
- } catch {
907
+ const nextIdx = event.shiftKey ? (idx - 1 + focusableEls.length) % focusableEls.length : (idx + 1) % focusableEls.length;
908
+ focusableEls[nextIdx]?.focus();
909
+ return false;
839
910
  }
911
+ return super._handleCellKeydown(event, value, index, isSaveCell);
840
912
  }
841
913
  /**
842
- * Get all color swatches combined, both from swatches property and saved colors
843
914
  * @internal
844
915
  */
845
- get allSwatches() {
846
- const predefinedColors = Array.isArray(this.swatches) ? this.swatches : [];
847
- const savedColors = Array.isArray(this.savedColors) ? this.savedColors : [];
848
- const seen = /* @__PURE__ */ new Set();
849
- const merged = [];
850
- const appendIfUniqueAndValid = (swatch) => {
851
- if (!swatch || typeof swatch.value !== "string") return;
852
- if (!baseColorPicker.isValidHexColor(swatch.value) || seen.has(swatch.value)) return;
853
- seen.add(swatch.value);
854
- merged.push(swatch);
855
- };
856
- if (!this.disableSavedColors) {
857
- savedColors.forEach(appendIfUniqueAndValid);
916
+ _handleSwatchSelection(value) {
917
+ /* v8 ignore else -- @preserve */
918
+ if (this.value !== value) {
919
+ this._ariaLiveDescription = this.locale.colorPicker.selectionSuccessMessage(value);
858
920
  }
859
- predefinedColors.forEach(appendIfUniqueAndValid);
860
- return merged.slice(0, this._maxSwatchesNormalized);
921
+ super._handleSwatchSelection(value);
861
922
  }
862
923
  }
863
924
  __decorateClass([
@@ -885,6 +946,9 @@ __decorateClass([
885
946
  __decorateClass([
886
947
  fastElement.observable
887
948
  ], ColorPicker.prototype, "copyIconName");
949
+ __decorateClass([
950
+ fastElement.observable
951
+ ], ColorPicker.prototype, "_ariaLiveDescription");
888
952
 
889
953
  function renderTextField(textFieldTag, iconTag) {
890
954
  const getClasses = (_) => fastWebUtilities.classNames("control");
@@ -915,6 +979,8 @@ function renderTextField(textFieldTag, iconTag) {
915
979
  >
916
980
  <button
917
981
  aria-label="${(x) => x.locale.colorPicker.pickerButtonLabel}"
982
+ aria-expanded="${(x) => x.open}"
983
+ aria-haspopup="dialog"
918
984
  class="button ${(x) => fastWebUtilities.classNames(
919
985
  x._applyContrastClass(x._buttonColor) ? "contrast" : "",
920
986
  x.disabled ? "disabled" : ""
@@ -942,9 +1008,9 @@ function renderTextField(textFieldTag, iconTag) {
942
1008
  function renderPopupHeader(buttonTag, iconTag) {
943
1009
  return fastElement.html`
944
1010
  <div class="header">
945
- <span class="header-title" id="color-picker-title">
1011
+ <h2 class="header-title" id="color-picker-title">
946
1012
  <slot name="popup-text">${(x) => x.locale.colorPicker.popupLabel}</slot>
947
- </span>
1013
+ </h2>
948
1014
  <${buttonTag} size="condensed"
949
1015
  aria-label="${(x) => x.locale.colorPicker.closeButtonLabel}"
950
1016
  @click="${(x) => x._handleCloseRequest()}">
@@ -953,7 +1019,7 @@ function renderPopupHeader(buttonTag, iconTag) {
953
1019
  </div>
954
1020
  `;
955
1021
  }
956
- function renderPopupBody(buttonTag, iconTag) {
1022
+ function renderPopupBody(buttonTag, iconTag, tooltipTag) {
957
1023
  return fastElement.html`
958
1024
  <div class="body">
959
1025
  <${fastElement.html.partial(vcPickerTag)}
@@ -969,24 +1035,37 @@ function renderPopupBody(buttonTag, iconTag) {
969
1035
  color="${(x) => x.value}"
970
1036
  @color-changed="${(x, c) => x._onPickerColorChanged(c.event)}"
971
1037
  ${fastElement.ref("_vcHexInputEl")}
972
- ></${fastElement.html.partial(vcInputTag)}>
973
- <${buttonTag} size="normal"
974
- aria-label="${(x) => x.locale.colorPicker.copyButtonLabel}"
975
- @click="${(x) => x._copyValueToClipboard(x.value)}">
976
- <${iconTag} slot="icon" name="${(x) => x.copyIconName}"></${iconTag}>
977
- </${buttonTag}>
1038
+ >
1039
+ <input name="hex-code-input" aria-label="${(x) => x.locale.colorPicker.hexInputLabel}"
1040
+ placeholder="${(x) => x.placeholder}"
1041
+ @blur="${(x, c) => c.event.stopImmediatePropagation()}"
1042
+ part="input">
1043
+ </${fastElement.html.partial(vcInputTag)}>
1044
+ <${tooltipTag} placement="top"
1045
+ text="${(x) => x.locale.colorPicker.copyButtonLabel}"
1046
+ exportparts="vvd-theme-alternate">
1047
+ <${buttonTag}
1048
+ slot="anchor" size="normal"
1049
+ aria-label="${(x) => x.locale.colorPicker.copyButtonLabel}"
1050
+ @click="${(x) => x._copyValueToClipboard(x.value)}">
1051
+ <${iconTag} slot="icon" name="${(x) => x.copyIconName}"></${iconTag}>
1052
+ </${buttonTag}>
1053
+ </${tooltipTag}>
978
1054
  </div>
979
1055
  </div>
980
1056
  `;
981
1057
  }
982
- function renderPopupFooter(buttonTag, iconTag) {
1058
+ function renderPopupFooter(buttonTag, iconTag, tooltipTag) {
983
1059
  return fastElement.html`
984
1060
  <div class="footer">
985
- <span class="footer-title" id="color-picker-footer-title"
986
- ><slot name="swatches-text"
987
- >${(x) => x.locale.colorPicker.swatchesLabel}</slot
988
- ></span
989
- >
1061
+ <div class="footer-header">
1062
+ <span class="footer-title" id="color-picker-footer-title"
1063
+ ><slot name="swatches-text"
1064
+ >${(x) => x.locale.colorPicker.swatchesLabel}</slot
1065
+ ></span
1066
+ >
1067
+ ${fastElement.when((x) => !x.disableSavedColors, renderSwatchesCount())}
1068
+ </div>
990
1069
  <div
991
1070
  class="palette"
992
1071
  role="grid"
@@ -997,41 +1076,62 @@ function renderPopupFooter(buttonTag, iconTag) {
997
1076
  >
998
1077
  ${fastElement.repeat(
999
1078
  (x) => x.allSwatches,
1000
- (x) => x._renderColorSwatch(iconTag),
1079
+ (x) => x._renderColorSwatch(iconTag, tooltipTag),
1001
1080
  { positioning: true }
1002
1081
  )}
1003
1082
  ${fastElement.when(
1004
1083
  (x) => !x.disableSavedColors,
1005
1084
  fastElement.html`
1006
- <${buttonTag}
1007
- appearance="outlined"
1008
- size="super-condensed"
1009
- role="gridcell"
1010
- tabindex="${(x) => x.allSwatches.length ? "-1" : "0"}"
1011
- aria-label="${(x) => x.locale.colorPicker.saveButtonLabel}"
1012
- @click="${(x) => x._saveCurrentColor()}"
1013
- @keydown="${(x, c) => x._handleCellKeydown(
1085
+ <${tooltipTag} placement="top"
1086
+ text="${(x) => x.locale.colorPicker.saveButtonLabel}"
1087
+ exportparts="vvd-theme-alternate">
1088
+ <${buttonTag}
1089
+ slot="anchor"
1090
+ appearance="outlined"
1091
+ size="super-condensed"
1092
+ role="gridcell"
1093
+ tabindex="${(x) => x.allSwatches.length ? "-1" : "0"}"
1094
+ aria-label="${(x) => x.locale.colorPicker.saveButtonLabel}"
1095
+ @click="${(x) => x._saveCurrentColor()}"
1096
+ @keydown="${(x, c) => x._handleCellKeydown(
1014
1097
  c.event,
1015
1098
  x.value,
1016
1099
  x.allSwatches.length,
1017
1100
  true
1018
1101
  )}">
1019
- >
1020
- <${iconTag} slot="icon" name="plus-line"></${iconTag}>
1021
- </${buttonTag}>
1022
- `
1102
+ <${iconTag} slot="icon" name="plus-line"></${iconTag}>
1103
+ </${buttonTag}>
1104
+ </${tooltipTag}>
1105
+ `
1023
1106
  )}
1024
1107
  </div>
1025
1108
  </div>
1026
1109
  `;
1027
1110
  }
1111
+ function renderSwatchesCount() {
1112
+ return fastElement.html`
1113
+ <span
1114
+ id="swatches-count"
1115
+ class="swatches-count"
1116
+ aria-label="${(x) => x.locale.colorPicker.maxSwatchesMessage(
1117
+ x.allSwatches.length,
1118
+ x.maxSwatches
1119
+ )}"
1120
+ >${(x) => `${x.allSwatches.length}/${x.maxSwatches}`}</span
1121
+ >
1122
+ `;
1123
+ }
1028
1124
  const ColorPickerTemplate = (context) => {
1029
1125
  const textFieldTag = context.tagFor(textField_definition.VwcTextFieldElement);
1030
1126
  const iconTag = context.tagFor(icon_definition.VwcIconElement);
1031
1127
  const popupTag = context.tagFor(popup_definition.Popup);
1032
1128
  const buttonTag = context.tagFor(button_definition.Button);
1129
+ const tooltipTag = context.tagFor(tooltip_definition.VwcTooltipElement);
1033
1130
  return fastElement.html`
1034
- <div class="base">
1131
+ <div class="base" @keydown="${(x, { event }) => x._onBaseKeydown(event)}">
1132
+ <span aria-live="assertive" aria-relevant="text" class="visually-hidden">
1133
+ ${(x) => x._ariaLiveDescription}
1134
+ </span>
1035
1135
  ${renderTextField(textFieldTag, iconTag)}
1036
1136
  <${popupTag}
1037
1137
  :open="${(x) => x.open}"
@@ -1044,10 +1144,10 @@ const ColorPickerTemplate = (context) => {
1044
1144
  aria-modal="true"
1045
1145
  aria-labelledby="color-picker-title">
1046
1146
  ${renderPopupHeader(buttonTag, iconTag)}
1047
- ${renderPopupBody(buttonTag, iconTag)}
1147
+ ${renderPopupBody(buttonTag, iconTag, tooltipTag)}
1048
1148
  ${fastElement.when(
1049
1149
  (x) => !x.disableSavedColors || x.allSwatches.length > 0,
1050
- renderPopupFooter(buttonTag, iconTag)
1150
+ renderPopupFooter(buttonTag, iconTag, tooltipTag)
1051
1151
  )}
1052
1152
  </div>
1053
1153
  </${popupTag}>
@@ -1064,6 +1164,7 @@ const colorPickerDefinition = vividElement.defineVividComponent(
1064
1164
  icon_definition.iconDefinition,
1065
1165
  textField_definition.textFieldDefinition,
1066
1166
  button_definition.buttonDefinition,
1167
+ tooltip_definition.tooltipDefinition,
1067
1168
  mixins.feedbackMessageDefinition
1068
1169
  ],
1069
1170
  {