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