@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,56 +1,66 @@
1
- import { F as C } from "./form-associated.js";
2
- import { U as g, h as p, a as v, o as y } from "./vivid-element.js";
3
- import { w as S } from "./when.js";
4
- import { L as b } from "./localized.js";
5
- import { F as I } from "./form-element.js";
6
- import { c as B } from "./class-names.js";
7
- function _(o) {
8
- if (!o) return null;
9
- const s = o.trim().replace(/^#/, "");
10
- return /^[0-9a-fA-F]{3}$/.test(s) ? s.split("").map((a) => a + a).join("").toLowerCase() : /^[0-9a-fA-F]{6}$/.test(s) ? s.toLowerCase() : null;
1
+ import { F as g } from "./form-associated.js";
2
+ import { U as y, h as m, a as S, o as w } from "./vivid-element.js";
3
+ import { w as b } from "./when.js";
4
+ import { L as I } from "./localized.js";
5
+ import { F as B } from "./form-element.js";
6
+ import { c as $ } from "./class-names.js";
7
+ function C(a) {
8
+ if (!a) return null;
9
+ const s = a.trim().replace(/^#/, "");
10
+ return /^[0-9a-fA-F]{3}$/.test(s) ? s.split("").map((n) => n + n).join("").toLowerCase() : /^[0-9a-fA-F]{6}$/.test(s) ? s.toLowerCase() : null;
11
11
  }
12
- function P(o) {
13
- return _(o) !== null;
12
+ function P(a) {
13
+ return C(a) !== null;
14
14
  }
15
- function w(o) {
16
- const s = _(o);
15
+ function _(a) {
16
+ const s = C(a);
17
17
  if (!s) return 0;
18
- const a = parseInt(s.slice(0, 2), 16) / 255, r = parseInt(s.slice(2, 4), 16) / 255, e = parseInt(s.slice(4, 6), 16) / 255, t = a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4), l = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), n = e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
19
- return 0.2126 * t + 0.7152 * l + 0.0722 * n;
18
+ const n = parseInt(s.slice(0, 2), 16) / 255, t = parseInt(s.slice(2, 4), 16) / 255, o = parseInt(s.slice(4, 6), 16) / 255, e = n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4), r = t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4), l = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
19
+ return 0.2126 * e + 0.7152 * r + 0.0722 * l;
20
20
  }
21
- function A(o, s) {
22
- const a = w(o), r = w(s), e = Math.max(a, r), t = Math.min(a, r);
23
- return (e + 0.05) / (t + 0.05);
21
+ function A(a, s) {
22
+ const n = _(a), t = _(s), o = Math.max(n, t), e = Math.min(n, t);
23
+ return (o + 0.05) / (e + 0.05);
24
24
  }
25
- function $(o, s) {
26
- return s || (s = document.querySelector(".vvd-root") || document.documentElement), getComputedStyle(s).getPropertyValue(o).trim();
25
+ function v(a, s) {
26
+ return s || (s = document.querySelector(".vvd-root") || document.documentElement), getComputedStyle(s).getPropertyValue(a).trim();
27
27
  }
28
- var x = Object.defineProperty, m = (o, s, a, r) => {
29
- for (var e = void 0, t = o.length - 1, l; t >= 0; t--)
30
- (l = o[t]) && (e = l(s, a, e) || e);
31
- return e && x(s, a, e), e;
28
+ var x = Object.defineProperty, f = (a, s, n, t) => {
29
+ for (var o = void 0, e = a.length - 1, r; e >= 0; e--)
30
+ (r = a[e]) && (o = r(s, n, o) || o);
31
+ return o && x(s, n, o), o;
32
32
  };
33
- const q = (o) => {
34
- class s extends b(
35
- I(C(o))
33
+ const q = (a) => {
34
+ class s extends I(
35
+ B(g(a))
36
36
  ) {
37
37
  constructor() {
38
38
  super(...arguments), this.proxy = document.createElement("input"), this.open = !1, this.swatches = [], this._canvasColor = "";
39
39
  }
40
40
  connectedCallback() {
41
- super.connectedCallback(), this._refreshCanvasColor();
41
+ super.connectedCallback(), requestAnimationFrame(() => {
42
+ this._refreshCanvasColor();
43
+ });
44
+ }
45
+ /**
46
+ * @internal
47
+ */
48
+ get _computedCanvasColor() {
49
+ return this._canvasColor || (this._canvasColor = v("--vvd-color-canvas", this)), this._canvasColor;
42
50
  }
43
51
  /**
44
52
  * @internal
45
53
  */
46
54
  _refreshCanvasColor() {
47
- this._canvasColor = $("--vvd-color-canvas", this);
55
+ this._canvasColor = v("--vvd-color-canvas", this);
48
56
  }
49
57
  /**
50
58
  * @internal
51
59
  */
52
- _applyContrastClass(r, e = 3) {
53
- return !r || !this._canvasColor ? !1 : A(r, this._canvasColor) < e;
60
+ _applyContrastClass(t, o = 3) {
61
+ if (!t) return !1;
62
+ const e = this._computedCanvasColor;
63
+ return e ? A(t, e) < o : !1;
54
64
  }
55
65
  /**
56
66
  * @internal
@@ -61,12 +71,13 @@ const q = (o) => {
61
71
  /**
62
72
  * @internal
63
73
  */
64
- _handleSwatchSelection(r) {
65
- this.value === r ? this.value = "" : this.value = r, this.$emit("change"), this.open = !1;
74
+ _handleSwatchSelection(t) {
75
+ this.value === t ? this.value = "" : this.value = t, this.$emit("change"), this.open = !1;
66
76
  }
67
77
  /**
68
78
  * @internal
69
- */
79
+ * /
80
+ /* v8 ignore next -- @preserve */
70
81
  _handleColorSaving() {
71
82
  }
72
83
  /**
@@ -79,16 +90,16 @@ const q = (o) => {
79
90
  * @internal
80
91
  */
81
92
  _returnFocusToAnchor() {
82
- const r = this._getFocusReturnEl();
83
- r && g.enqueue(() => r.focus());
93
+ const t = this._getFocusReturnEl();
94
+ t && y.enqueue(() => t.focus());
84
95
  }
85
96
  /**
86
97
  * @internal
87
98
  */
88
99
  _getGridCells() {
89
- const r = this.shadowRoot?.querySelector('[role="grid"]');
90
- return r ? Array.from(
91
- r.querySelectorAll(
100
+ const t = this.shadowRoot?.querySelector('[role="grid"]');
101
+ return t ? Array.from(
102
+ t.querySelectorAll(
92
103
  '[role="gridcell"], [data-vvd-role="gridcell"]'
93
104
  )
94
105
  ) : [];
@@ -96,36 +107,41 @@ const q = (o) => {
96
107
  /**
97
108
  * @internal
98
109
  */
99
- _handleCellKeydown(r, e, t, l) {
100
- const n = this._getRowLength(), c = this._getGridCells().length, u = Math.floor(t / n), h = t % n, f = Math.ceil(c / n);
101
- switch (r.key) {
102
- case "ArrowRight":
103
- return h < n - 1 && t + 1 < c && this._focusSwatchByIndex(t + 1), !1;
110
+ _handleCellKeydown(t, o, e, r) {
111
+ const l = this._getRowLength(), c = this._getGridCells().length, u = Math.floor(e / l), h = e % l, d = Math.ceil(c / l);
112
+ switch (t.key) {
113
+ case "ArrowRight": {
114
+ /* v8 ignore else -- @preserve */
115
+ return h < l - 1 && e + 1 < c && this._focusSwatchByIndex(e + 1), !1;
116
+ }
104
117
  case "ArrowLeft":
105
- return h > 0 && this._focusSwatchByIndex(t - 1), !1;
106
- case "ArrowDown":
107
- return u < f - 1 && t + n < c && this._focusSwatchByIndex(t + n), !1;
118
+ return h > 0 && this._focusSwatchByIndex(e - 1), !1;
119
+ case "ArrowDown": {
120
+ /* v8 ignore else -- @preserve */
121
+ return u < d - 1 && e + l < c && this._focusSwatchByIndex(e + l), !1;
122
+ }
108
123
  case "ArrowUp":
109
- return u > 0 && this._focusSwatchByIndex(t - n), !1;
124
+ return u > 0 && this._focusSwatchByIndex(e - l), !1;
110
125
  case "PageDown": {
111
- const i = (f - 1) * n, d = Math.min(
126
+ const i = (d - 1) * l, p = Math.min(
112
127
  i + h,
113
128
  c - 1
114
129
  );
115
- return t !== d && this._focusSwatchByIndex(d), !1;
130
+ /* v8 ignore else -- @preserve */
131
+ return e !== p && this._focusSwatchByIndex(p), !1;
116
132
  }
117
133
  case "PageUp": {
118
134
  const i = Math.min(h, c - 1);
119
- return t !== i && this._focusSwatchByIndex(i), !1;
135
+ return e !== i && this._focusSwatchByIndex(i), !1;
120
136
  }
121
137
  case "Home":
122
- return r.ctrlKey ? this._focusSwatchByIndex(0) : this._focusSwatchByIndex(u * n), !1;
138
+ return t.ctrlKey ? this._focusSwatchByIndex(0) : this._focusSwatchByIndex(u * l), !1;
123
139
  case "End":
124
- if (r.ctrlKey)
140
+ if (t.ctrlKey)
125
141
  this._focusSwatchByIndex(c - 1);
126
142
  else {
127
143
  const i = Math.min(
128
- (u + 1) * n - 1,
144
+ (u + 1) * l - 1,
129
145
  c - 1
130
146
  );
131
147
  this._focusSwatchByIndex(i);
@@ -133,7 +149,7 @@ const q = (o) => {
133
149
  return !1;
134
150
  case "Enter":
135
151
  case " ":
136
- return l && this._handleColorSaving(), e && !l && (this._handleSwatchSelection(e), this._returnFocusToAnchor()), !1;
152
+ return r && this._handleColorSaving(), o && !r && (this._handleSwatchSelection(o), this._returnFocusToAnchor()), !1;
137
153
  case "Escape":
138
154
  return this.open = !1, this._returnFocusToAnchor(), !1;
139
155
  case "Tab":
@@ -145,48 +161,55 @@ const q = (o) => {
145
161
  /**
146
162
  * @internal
147
163
  */
148
- _focusSwatchByIndex(r) {
149
- const e = this._getGridCells();
150
- r < 0 || r >= e.length || e[r]?.focus();
164
+ _focusSwatchByIndex(t) {
165
+ const o = this._getGridCells();
166
+ t < 0 || t >= o.length || o[t]?.focus();
151
167
  }
152
168
  /**
153
169
  * @internal
154
170
  */
155
- _renderColorSwatch(r) {
156
- return p`
157
- <button
158
- class="swatch ${(e, t) => B(
159
- t.parent.value === e.value ? "selected" : "",
160
- t.parent._applyContrastClass(e.value) ? "contrast" : ""
171
+ _renderColorSwatch(t, o) {
172
+ return m`
173
+ <${o} placement="top"
174
+ text="${(e) => e.label ?? e.value}"
175
+ exportparts="vvd-theme-alternate">
176
+ <button
177
+ slot="anchor"
178
+ class="swatch ${(e, r) => $(
179
+ r.parent.value === e.value ? "selected" : "",
180
+ r.parent._applyContrastClass(e.value) ? "contrast" : ""
161
181
  )}"
162
- role="gridcell"
163
- style="--swatch-color: ${(e) => e.value};"
164
- tabindex="${(e, t) => t.index === 0 ? "0" : "-1"}"
165
- aria-label="${(e, t) => t.parent.locale.baseColorPicker.colorSwatchLabel(
182
+ role="gridcell"
183
+ style="--swatch-color: ${(e) => e.value};"
184
+ tabindex="${(e, r) => r.index === 0 ? "0" : "-1"}"
185
+ aria-label="${(e, r) => r.parent.locale.baseColorPicker.colorSwatchLabel(
166
186
  e.value,
167
187
  e.label,
168
- t.parent.value === e.value
188
+ r.parent.value === e.value
169
189
  )}"
170
- @click="${(e, t) => t.parent._handleSwatchSelection(e.value)}"
171
- @keydown="${(e, t) => t.parent._handleCellKeydown(
172
- t.event,
190
+ @click="${(e, r) => r.parent._handleSwatchSelection(e.value)}"
191
+ @keydown="${(e, r) => r.parent._handleCellKeydown(
192
+ r.event,
173
193
  e.value,
174
- t.index
194
+ r.index
175
195
  )}"
176
- >
177
- ${S(
178
- (e, t) => t.parent.value === e.value,
179
- p`<${r} size="-6" name="check-solid" aria-hidden="true"></${r}>`
196
+ >
197
+ ${b(
198
+ (e, r) => r.parent.value === e.value,
199
+ m`<${t} size="-6" name="check-solid" aria-hidden="true"></${t}>`
180
200
  )}
181
- </button>
201
+ </button>
202
+ </${o}>
182
203
  `;
183
204
  }
184
205
  }
185
- return m([
186
- v({ mode: "boolean" })
187
- ], s.prototype, "open"), m([
188
- y
189
- ], s.prototype, "swatches"), s;
206
+ return f([
207
+ S({ mode: "boolean" })
208
+ ], s.prototype, "open"), f([
209
+ w
210
+ ], s.prototype, "swatches"), f([
211
+ w
212
+ ], s.prototype, "_canvasColor"), s;
190
213
  };
191
214
  export {
192
215
  q as B,
@@ -1 +1 @@
1
- "use strict";const t=require("./vivid-element.cjs");var c=Object.defineProperty,o=(a,n,s,i)=>{for(var e=void 0,l=a.length-1,p;l>=0;l--)(p=a[l])&&(e=p(n,s,e)||e);return e&&c(n,s,e),e};class r extends t.VividElement{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const n=typeof this.min=="number"?this.min:0,s=typeof this.max=="number"?this.max:100,i=typeof this.value=="number"?this.value:0,e=s-n;this.percentComplete=e===0?0:Math.fround((i-n)/e*100)}}o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"value");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"min");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"max");o([t.attr({mode:"boolean"})],r.prototype,"paused");o([t.observable],r.prototype,"percentComplete");exports.BaseProgress=r;
1
+ "use strict";const t=require("./vivid-element.cjs");var c=Object.defineProperty,o=(a,n,s,i)=>{for(var e=void 0,l=a.length-1,p;l>=0;l--)(p=a[l])&&(e=p(n,s,e)||e);return e&&c(n,s,e),e};class r extends t.VividElement{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const n=typeof this.min=="number"?this.min:0,s=typeof this.max=="number"?this.max:100,i=typeof this.value=="number"?this.value:0,e=s-n;this.percentComplete=e===0?0:Math.fround((i-n)/e*100)}}o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"value");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"min");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"max");o([t.attr({mode:"boolean"})],r.prototype,"paused");o([t.observable],r.prototype,"percentComplete");exports.BaseProgress=r;
@@ -12,18 +12,21 @@ class o extends m {
12
12
  * @internal
13
13
  */
14
14
  valueChanged() {
15
+ /* v8 ignore if -- @preserve */
15
16
  this.$fastController.isConnected && this.updatePercentComplete();
16
17
  }
17
18
  /**
18
19
  * @internal
19
20
  */
20
21
  minChanged() {
22
+ /* v8 ignore if -- @preserve */
21
23
  this.$fastController.isConnected && this.updatePercentComplete();
22
24
  }
23
25
  /**
24
26
  * @private
25
27
  */
26
28
  maxChanged() {
29
+ /* v8 ignore if -- @preserve */
27
30
  this.$fastController.isConnected && this.updatePercentComplete();
28
31
  }
29
32
  /**
@@ -1 +1 @@
1
- "use strict";const c=require("./delegates-aria.cjs"),e=require("./vivid-element.cjs"),d=require("./form-associated.cjs");var l=Object.defineProperty,r=(n,t,o,p)=>{for(var s=void 0,a=n.length-1,h;a>=0;a--)(h=n[a])&&(s=h(t,o,s)||s);return s&&l(t,o,s),s};class i extends c.DelegatesAria(d.FormAssociated(e.VividElement)){constructor(){super(...arguments),this.proxy=document.createElement("input"),this.handleClick=t=>{this.disabled&&t.stopPropagation()},this.handleSubmission=()=>{this.form&&(this.attachProxy(),this.form.requestSubmit(this.proxy),this.detachProxy())},this.handleFormReset=()=>{this.form?.reset()},this.handleUnsupportedDelegatesFocus=()=>{this.$fastController.definition.shadowOptions&&window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&this.$fastController.definition.shadowOptions.delegatesFocus&&Object.defineProperty(this,"focus",{value:()=>{this.control.focus()},configurable:!0})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(t,o){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),o==="submit"&&this.addEventListener("click",this.handleSubmission),t==="submit"&&this.removeEventListener("click",this.handleSubmission),o==="reset"&&this.addEventListener("click",this.handleFormReset),t==="reset"&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus(),this.autofocus&&e.Updates.enqueue(()=>{this.focus()});const t=Array.from(this.control.children);t&&t.forEach(o=>{o.addEventListener("click",this.handleClick)})}disconnectedCallback(){super.disconnectedCallback();const t=Array.from(this.control.children);t&&t.forEach(o=>{o.removeEventListener("click",this.handleClick)})}}r([e.attr({mode:"boolean"})],i.prototype,"autofocus");r([e.attr({attribute:"form"})],i.prototype,"formId");r([e.attr],i.prototype,"formaction");r([e.attr],i.prototype,"formenctype");r([e.attr],i.prototype,"formmethod");r([e.attr({mode:"boolean"})],i.prototype,"formnovalidate");r([e.attr],i.prototype,"formtarget");r([e.attr],i.prototype,"type");exports.VividFoundationButton=i;
1
+ "use strict";const c=require("./delegates-aria.cjs"),t=require("./vivid-element.cjs"),d=require("./form-associated.cjs");var l=Object.defineProperty,r=(n,e,o,p)=>{for(var s=void 0,a=n.length-1,h;a>=0;a--)(h=n[a])&&(s=h(e,o,s)||s);return s&&l(e,o,s),s};class i extends c.DelegatesAria(d.FormAssociated(t.VividElement)){constructor(){super(...arguments),this.proxy=document.createElement("input"),this.handleClick=e=>{/* v8 ignore else -- @preserve */this.disabled&&e.stopPropagation()},this.handleSubmission=()=>{this.form&&(this.attachProxy(),this.form.requestSubmit(this.proxy),this.detachProxy())},this.handleFormReset=()=>{this.form?.reset()},this.handleUnsupportedDelegatesFocus=()=>{/* v8 ignore else -- @preserve */this.$fastController.definition.shadowOptions&&window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&this.$fastController.definition.shadowOptions.delegatesFocus&&Object.defineProperty(this,"focus",{value:()=>{this.control.focus()},configurable:!0})}}formactionChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,o){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),o==="submit"&&this.addEventListener("click",this.handleSubmission),e==="submit"&&this.removeEventListener("click",this.handleSubmission),o==="reset"&&this.addEventListener("click",this.handleFormReset),e==="reset"&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus(),this.autofocus&&t.Updates.enqueue(()=>{this.focus()}),Array.from(this.control.children).forEach(o=>{o.addEventListener("click",this.handleClick)})}disconnectedCallback(){super.disconnectedCallback(),Array.from(this.control.children).forEach(o=>{o.removeEventListener("click",this.handleClick)})}}r([t.attr({mode:"boolean"})],i.prototype,"autofocus");r([t.attr({attribute:"form"})],i.prototype,"formId");r([t.attr],i.prototype,"formaction");r([t.attr],i.prototype,"formenctype");r([t.attr],i.prototype,"formmethod");r([t.attr({mode:"boolean"})],i.prototype,"formnovalidate");r([t.attr],i.prototype,"formtarget");r([t.attr],i.prototype,"type");exports.VividFoundationButton=i;
package/bundled/button.js CHANGED
@@ -1,22 +1,24 @@
1
1
  import { D as c } from "./delegates-aria.js";
2
- import { V as d, U as p, a as o } from "./vivid-element.js";
3
- import { F as l } from "./form-associated.js";
2
+ import { V as d, U as l, a as o } from "./vivid-element.js";
3
+ import { F as p } from "./form-associated.js";
4
4
  var f = Object.defineProperty, i = (n, t, e, m) => {
5
5
  for (var r = void 0, a = n.length - 1, h; a >= 0; a--)
6
6
  (h = n[a]) && (r = h(t, e, r) || r);
7
7
  return r && f(t, e, r), r;
8
8
  };
9
9
  class s extends c(
10
- l(d)
10
+ p(d)
11
11
  ) {
12
12
  constructor() {
13
13
  super(...arguments), this.proxy = document.createElement("input"), this.handleClick = (t) => {
14
+ /* v8 ignore else -- @preserve */
14
15
  this.disabled && t.stopPropagation();
15
16
  }, this.handleSubmission = () => {
16
17
  this.form && (this.attachProxy(), this.form.requestSubmit(this.proxy), this.detachProxy());
17
18
  }, this.handleFormReset = () => {
18
19
  this.form?.reset();
19
20
  }, this.handleUnsupportedDelegatesFocus = () => {
21
+ /* v8 ignore else -- @preserve */
20
22
  this.$fastController.definition.shadowOptions && window.ShadowRoot && /* eslint-disable-next-line */
21
23
  !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && this.$fastController.definition.shadowOptions.delegatesFocus && Object.defineProperty(this, "focus", {
22
24
  value: () => {
@@ -28,26 +30,32 @@ class s extends c(
28
30
  }
29
31
  // @ts-expect-error Function is delcared but not used
30
32
  formactionChanged() {
33
+ /* v8 ignore if -- @preserve */
31
34
  this.proxy instanceof HTMLInputElement && (this.proxy.formAction = this.formaction);
32
35
  }
33
36
  // @ts-expect-error Function is delcared but not used
34
37
  formenctypeChanged() {
38
+ /* v8 ignore if -- @preserve */
35
39
  this.proxy instanceof HTMLInputElement && (this.proxy.formEnctype = this.formenctype);
36
40
  }
37
41
  // @ts-expect-error Function is delcared but not used
38
42
  formmethodChanged() {
43
+ /* v8 ignore if -- @preserve */
39
44
  this.proxy instanceof HTMLInputElement && (this.proxy.formMethod = this.formmethod);
40
45
  }
41
46
  // @ts-expect-error Function is delcared but not used
42
47
  formnovalidateChanged() {
48
+ /* v8 ignore if -- @preserve */
43
49
  this.proxy instanceof HTMLInputElement && (this.proxy.formNoValidate = this.formnovalidate);
44
50
  }
45
51
  // @ts-expect-error Function is delcared but not used
46
52
  formtargetChanged() {
53
+ /* v8 ignore if -- @preserve */
47
54
  this.proxy instanceof HTMLInputElement && (this.proxy.formTarget = this.formtarget);
48
55
  }
49
56
  // @ts-expect-error Function is delcared but not used
50
57
  typeChanged(t, e) {
58
+ /* v8 ignore if -- @preserve */
51
59
  this.proxy instanceof HTMLInputElement && (this.proxy.type = this.type), e === "submit" && this.addEventListener("click", this.handleSubmission), t === "submit" && this.removeEventListener("click", this.handleSubmission), e === "reset" && this.addEventListener("click", this.handleFormReset), t === "reset" && this.removeEventListener("click", this.handleFormReset);
52
60
  }
53
61
  /** {@inheritDoc (FormAssociated:interface).validate} */
@@ -58,11 +66,9 @@ class s extends c(
58
66
  * @internal
59
67
  */
60
68
  connectedCallback() {
61
- super.connectedCallback(), this.proxy.setAttribute("type", this.type), this.handleUnsupportedDelegatesFocus(), this.autofocus && p.enqueue(() => {
69
+ super.connectedCallback(), this.proxy.setAttribute("type", this.type), this.handleUnsupportedDelegatesFocus(), this.autofocus && l.enqueue(() => {
62
70
  this.focus();
63
- });
64
- const t = Array.from(this.control.children);
65
- t && t.forEach((e) => {
71
+ }), Array.from(this.control.children).forEach((e) => {
66
72
  e.addEventListener("click", this.handleClick);
67
73
  });
68
74
  }
@@ -70,9 +76,7 @@ class s extends c(
70
76
  * @internal
71
77
  */
72
78
  disconnectedCallback() {
73
- super.disconnectedCallback();
74
- const t = Array.from(this.control.children);
75
- t && t.forEach((e) => {
79
+ super.disconnectedCallback(), Array.from(this.control.children).forEach((e) => {
76
80
  e.removeEventListener("click", this.handleClick);
77
81
  });
78
82
  }