@vonage/vivid 4.23.0 → 4.25.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 (396) hide show
  1. package/custom-elements.json +21830 -14295
  2. package/elevation/index.cjs +1 -1
  3. package/elevation/index.js +1 -1
  4. package/index.cjs +112 -150
  5. package/index.js +37 -35
  6. package/lib/accordion-item/accordion-item.d.ts +6 -0
  7. package/lib/action-group/action-group.d.ts +6 -0
  8. package/lib/alert/alert.d.ts +20 -0
  9. package/lib/audio-player/audio-player.d.ts +6 -0
  10. package/lib/badge/badge.d.ts +9 -1
  11. package/lib/banner/banner.d.ts +25 -0
  12. package/lib/breadcrumb/breadcrumb.d.ts +6 -0
  13. package/lib/breadcrumb-item/breadcrumb-item.d.ts +63 -7
  14. package/lib/button/button.d.ts +732 -7
  15. package/lib/button/locale.d.ts +3 -0
  16. package/lib/calendar-event/calendar-event.d.ts +6 -0
  17. package/lib/card/card.d.ts +394 -2
  18. package/lib/card/card.template.d.ts +2 -1
  19. package/lib/checkbox/checkbox.d.ts +1822 -5
  20. package/lib/combobox/combobox.d.ts +1827 -20
  21. package/lib/data-grid/data-grid-cell.d.ts +339 -1
  22. package/lib/data-grid/locale.d.ts +5 -0
  23. package/lib/date-picker/date-picker.d.ts +1676 -207
  24. package/lib/date-range-picker/date-range-picker.d.ts +840 -107
  25. package/lib/date-time-picker/date-time-picker.d.ts +1678 -209
  26. package/lib/dial-pad/dial-pad.d.ts +8 -0
  27. package/lib/dialog/dialog.d.ts +12 -0
  28. package/lib/divider/divider.d.ts +6 -0
  29. package/lib/fab/fab.d.ts +6 -0
  30. package/lib/file-picker/file-picker.d.ts +1510 -32
  31. package/lib/file-picker/locale.d.ts +1 -0
  32. package/lib/header/header.d.ts +6 -0
  33. package/lib/icon/icon.d.ts +1 -0
  34. package/lib/icon/icon.template.d.ts +2 -1
  35. package/lib/menu/menu.d.ts +16 -7
  36. package/lib/menu/name.d.ts +1 -0
  37. package/lib/menu-item/menu-item.d.ts +14 -2
  38. package/lib/nav/nav.d.ts +6 -0
  39. package/lib/nav-disclosure/nav-disclosure.d.ts +13 -0
  40. package/lib/nav-item/nav-item.d.ts +405 -3
  41. package/lib/note/note.d.ts +6 -0
  42. package/lib/number-field/number-field.d.ts +1857 -36
  43. package/lib/option/option.d.ts +12 -0
  44. package/lib/progress/progress.d.ts +6 -0
  45. package/lib/progress-ring/progress-ring.d.ts +6 -0
  46. package/lib/radio/radio.d.ts +1137 -4
  47. package/lib/radio-group/radio-group.d.ts +20 -2
  48. package/lib/range-slider/range-slider.d.ts +752 -5
  49. package/lib/rich-text-editor/definition.d.ts +2 -2
  50. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +3 -1
  51. package/lib/rich-text-editor/locale.d.ts +10 -0
  52. package/lib/rich-text-editor/menubar/menubar.d.ts +340 -1
  53. package/lib/rich-text-editor/rich-text-editor.d.ts +352 -2
  54. package/lib/searchable-select/locale.d.ts +1 -0
  55. package/lib/searchable-select/option-tag.d.ts +6 -0
  56. package/lib/searchable-select/searchable-select.d.ts +1857 -35
  57. package/lib/select/select.d.ts +1843 -28
  58. package/lib/selectable-box/selectable-box.d.ts +6 -0
  59. package/lib/slider/slider.d.ts +384 -2
  60. package/lib/split-button/split-button.d.ts +18 -0
  61. package/lib/switch/switch.d.ts +386 -3
  62. package/lib/tab/tab.d.ts +18 -1
  63. package/lib/tab-panel/tab-panel.d.ts +6 -0
  64. package/lib/tabs/tabs.d.ts +5 -21
  65. package/lib/tag/tag.d.ts +12 -0
  66. package/lib/tag-group/tag-group.d.ts +6 -0
  67. package/lib/text-area/text-area.d.ts +2174 -19
  68. package/lib/text-field/text-field.d.ts +2195 -31
  69. package/lib/time-picker/time-picker.d.ts +839 -106
  70. package/lib/toggletip/toggletip.d.ts +10 -4
  71. package/lib/tooltip/tooltip.d.ts +10 -4
  72. package/lib/tree-item/tree-item.d.ts +12 -0
  73. package/lib/tree-view/tree-view.d.ts +6 -0
  74. package/lib/video-player/video-player.d.ts +6 -0
  75. package/lib/visually-hidden/definition.d.ts +4 -0
  76. package/lib/visually-hidden/visually-hidden.d.ts +3 -0
  77. package/lib/visually-hidden/visually-hidden.template.d.ts +3 -0
  78. package/locales/de-DE.cjs +47 -1
  79. package/locales/de-DE.js +47 -1
  80. package/locales/en-GB.cjs +47 -1
  81. package/locales/en-GB.js +47 -1
  82. package/locales/en-US.cjs +47 -1
  83. package/locales/en-US.js +47 -1
  84. package/locales/ja-JP.cjs +47 -1
  85. package/locales/ja-JP.js +47 -1
  86. package/locales/zh-CN.cjs +47 -1
  87. package/locales/zh-CN.js +47 -1
  88. package/menu/index.cjs +1 -1
  89. package/menu/index.js +1 -1
  90. package/nav/index.cjs +1 -1
  91. package/nav/index.js +1 -1
  92. package/nav-disclosure/index.cjs +1 -1
  93. package/nav-disclosure/index.js +1 -1
  94. package/nav-item/index.cjs +1 -1
  95. package/nav-item/index.js +1 -1
  96. package/note/index.cjs +1 -1
  97. package/note/index.js +1 -1
  98. package/number-field/index.cjs +1 -1
  99. package/number-field/index.js +1 -1
  100. package/option/index.cjs +1 -1
  101. package/option/index.js +1 -1
  102. package/package.json +1 -1
  103. package/pagination/index.cjs +1 -1
  104. package/pagination/index.js +1 -1
  105. package/popup/index.cjs +1 -1
  106. package/popup/index.js +1 -1
  107. package/progress/index.cjs +1 -1
  108. package/progress/index.js +1 -1
  109. package/progress-ring/index.cjs +1 -1
  110. package/progress-ring/index.js +1 -1
  111. package/radio/index.cjs +1 -1
  112. package/radio/index.js +1 -1
  113. package/radio-group/index.cjs +1 -1
  114. package/radio-group/index.js +1 -1
  115. package/range-slider/index.cjs +1 -1
  116. package/range-slider/index.js +1 -1
  117. package/rich-text-editor/index.cjs +1 -1
  118. package/rich-text-editor/index.js +1 -1
  119. package/searchable-select/index.cjs +1 -1
  120. package/searchable-select/index.js +1 -1
  121. package/select/index.cjs +1 -1
  122. package/select/index.js +1 -1
  123. package/selectable-box/index.cjs +1 -1
  124. package/selectable-box/index.js +1 -1
  125. package/shared/affix.cjs +13 -7
  126. package/shared/affix.js +13 -8
  127. package/shared/aria/delegates-aria.d.ts +6 -0
  128. package/shared/aria/host-semantics.d.ts +6 -0
  129. package/shared/breadcrumb-item.cjs +2 -5
  130. package/shared/breadcrumb-item.js +2 -5
  131. package/shared/button.cjs +19 -14
  132. package/shared/button.js +19 -14
  133. package/shared/calendar-picker.template.cjs +3 -3
  134. package/shared/calendar-picker.template.js +1 -1
  135. package/shared/char-count.cjs +92 -0
  136. package/shared/char-count.js +90 -0
  137. package/shared/definition.js +1 -1
  138. package/shared/definition10.js +1 -1
  139. package/shared/definition11.cjs +27 -44
  140. package/shared/definition11.js +28 -45
  141. package/shared/definition12.cjs +1 -1
  142. package/shared/definition12.js +2 -2
  143. package/shared/definition13.js +1 -1
  144. package/shared/definition14.cjs +53 -22
  145. package/shared/definition14.js +54 -23
  146. package/shared/definition15.cjs +31 -36
  147. package/shared/definition15.js +30 -36
  148. package/shared/definition16.cjs +43 -63
  149. package/shared/definition16.js +42 -63
  150. package/shared/definition17.cjs +12 -5
  151. package/shared/definition17.js +12 -5
  152. package/shared/definition18.cjs +10 -14
  153. package/shared/definition18.js +9 -14
  154. package/shared/definition19.cjs +85 -100
  155. package/shared/definition19.js +75 -91
  156. package/shared/definition2.js +1 -1
  157. package/shared/definition20.cjs +15 -20
  158. package/shared/definition20.js +14 -20
  159. package/shared/definition21.cjs +22 -3
  160. package/shared/definition21.js +23 -4
  161. package/shared/definition22.cjs +12 -6
  162. package/shared/definition22.js +13 -7
  163. package/shared/definition23.cjs +5 -38
  164. package/shared/definition23.js +5 -37
  165. package/shared/definition24.cjs +2 -7
  166. package/shared/definition24.js +3 -8
  167. package/shared/definition25.js +1 -1
  168. package/shared/definition26.cjs +160 -163
  169. package/shared/definition26.js +159 -163
  170. package/shared/definition27.cjs +1 -1
  171. package/shared/definition27.js +2 -2
  172. package/shared/definition28.cjs +32 -17
  173. package/shared/definition28.js +33 -18
  174. package/shared/definition29.js +1 -1
  175. package/shared/definition3.js +1 -1
  176. package/shared/definition30.cjs +96 -482
  177. package/shared/definition30.js +99 -482
  178. package/shared/definition31.cjs +334 -57
  179. package/shared/definition31.js +333 -56
  180. package/shared/definition32.cjs +104 -19
  181. package/shared/definition32.js +105 -20
  182. package/shared/definition33.cjs +67 -15
  183. package/shared/definition33.js +66 -14
  184. package/shared/definition34.cjs +15 -50
  185. package/shared/definition34.js +14 -49
  186. package/shared/definition35.cjs +28 -397
  187. package/shared/definition35.js +27 -397
  188. package/shared/definition36.cjs +404 -54
  189. package/shared/definition36.js +404 -55
  190. package/shared/definition37.cjs +57 -234
  191. package/shared/definition37.js +57 -233
  192. package/shared/definition38.cjs +221 -66
  193. package/shared/definition38.js +220 -65
  194. package/shared/definition39.cjs +52 -44
  195. package/shared/definition39.js +51 -43
  196. package/shared/definition4.cjs +31 -24
  197. package/shared/definition4.js +33 -26
  198. package/shared/definition40.cjs +56 -266
  199. package/shared/definition40.js +55 -265
  200. package/shared/definition41.cjs +285 -142
  201. package/shared/definition41.js +285 -142
  202. package/shared/definition42.cjs +156 -564
  203. package/shared/definition42.js +156 -565
  204. package/shared/definition43.cjs +557 -14317
  205. package/shared/definition43.js +556 -14316
  206. package/shared/definition44.cjs +14418 -1085
  207. package/shared/definition44.js +14416 -1085
  208. package/shared/definition45.cjs +1049 -671
  209. package/shared/definition45.js +1050 -672
  210. package/shared/definition46.cjs +848 -113
  211. package/shared/definition46.js +847 -112
  212. package/shared/definition47.cjs +125 -90
  213. package/shared/definition47.js +124 -89
  214. package/shared/definition48.cjs +88 -455
  215. package/shared/definition48.js +87 -454
  216. package/shared/definition49.cjs +466 -109
  217. package/shared/definition49.js +466 -109
  218. package/shared/definition5.cjs +8 -7
  219. package/shared/definition5.js +6 -5
  220. package/shared/definition50.cjs +106 -106
  221. package/shared/definition50.js +105 -105
  222. package/shared/definition51.cjs +136 -15
  223. package/shared/definition51.js +135 -14
  224. package/shared/definition52.cjs +16 -115
  225. package/shared/definition52.js +15 -114
  226. package/shared/definition53.cjs +78 -490
  227. package/shared/definition53.js +77 -488
  228. package/shared/definition54.cjs +445 -23
  229. package/shared/definition54.js +443 -22
  230. package/shared/definition55.cjs +22 -136
  231. package/shared/definition55.js +21 -135
  232. package/shared/definition56.cjs +95 -291
  233. package/shared/definition56.js +95 -292
  234. package/shared/definition57.cjs +192 -480
  235. package/shared/definition57.js +190 -479
  236. package/shared/definition58.cjs +411 -24
  237. package/shared/definition58.js +410 -24
  238. package/shared/definition59.cjs +27 -144
  239. package/shared/definition59.js +27 -143
  240. package/shared/definition6.js +1 -1
  241. package/shared/definition60.cjs +83 -54
  242. package/shared/definition60.js +82 -53
  243. package/shared/definition61.cjs +78 -166
  244. package/shared/definition61.js +77 -164
  245. package/shared/definition62.cjs +143 -232
  246. package/shared/definition62.js +141 -231
  247. package/shared/definition63.cjs +234 -69417
  248. package/shared/definition63.js +233 -69416
  249. package/shared/definition64.cjs +69454 -28
  250. package/shared/definition64.js +69453 -27
  251. package/shared/definition65.cjs +28 -2168
  252. package/shared/definition65.js +27 -2166
  253. package/shared/definition66.cjs +27 -0
  254. package/shared/definition66.js +23 -0
  255. package/shared/definition67.cjs +2195 -0
  256. package/shared/definition67.js +2190 -0
  257. package/shared/definition7.cjs +11 -2
  258. package/shared/definition7.js +12 -3
  259. package/shared/definition8.cjs +24 -11
  260. package/shared/definition8.js +26 -13
  261. package/shared/definition9.cjs +1 -2
  262. package/shared/definition9.js +2 -3
  263. package/shared/delegates-aria.js +1 -1
  264. package/shared/deprecation/replaced-props.d.ts +20 -0
  265. package/shared/divider.cjs +41 -0
  266. package/shared/divider.js +38 -0
  267. package/shared/feedback/feedback-message.d.ts +345 -0
  268. package/shared/feedback/locale.d.ts +4 -0
  269. package/{lib/text-anchor/text-anchor.d.ts → shared/feedback/mixins.d.ts} +62 -39
  270. package/shared/form-associated.cjs +124 -100
  271. package/shared/form-associated.js +125 -101
  272. package/shared/form-element.cjs +84 -0
  273. package/shared/form-element.js +82 -0
  274. package/shared/foundation/button/button.d.ts +378 -2
  275. package/shared/foundation/form-associated/form-associated.d.ts +753 -49
  276. package/shared/foundation/listbox/listbox.d.ts +1 -1
  277. package/shared/foundation/vivid-element/vivid-element.d.ts +14 -0
  278. package/shared/host-semantics.js +1 -1
  279. package/shared/key-codes.js +1 -1
  280. package/shared/linkable.cjs +70 -0
  281. package/shared/linkable.js +68 -0
  282. package/shared/localization/Locale.d.ts +16 -0
  283. package/shared/mixins.cjs +306 -0
  284. package/shared/mixins.js +300 -0
  285. package/shared/patterns/affix.d.ts +16 -1
  286. package/shared/patterns/anchored.d.ts +20 -8
  287. package/shared/patterns/char-count/char-count.d.ts +351 -0
  288. package/shared/patterns/char-count/index.d.ts +1 -0
  289. package/shared/patterns/char-count/locale.d.ts +4 -0
  290. package/shared/patterns/form-elements/form-element.d.ts +744 -0
  291. package/shared/patterns/form-elements/index.d.ts +3 -1
  292. package/shared/patterns/form-elements/with-error-text.d.ts +1122 -0
  293. package/shared/patterns/form-elements/with-success-text.d.ts +341 -0
  294. package/shared/patterns/index.d.ts +2 -0
  295. package/shared/patterns/linkable.d.ts +394 -0
  296. package/shared/patterns/localized.d.ts +6 -0
  297. package/shared/patterns/trapped-focus.d.ts +6 -0
  298. package/shared/picker-field/mixins/calendar-picker.d.ts +420 -52
  299. package/shared/picker-field/mixins/calendar-picker.template.d.ts +420 -52
  300. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +6 -0
  301. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +843 -107
  302. package/shared/picker-field/mixins/single-date-picker.d.ts +1259 -155
  303. package/shared/picker-field/mixins/single-value-picker.d.ts +417 -49
  304. package/shared/picker-field/mixins/time-selection-picker.d.ts +842 -106
  305. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +839 -103
  306. package/shared/picker-field/picker-field.d.ts +1491 -15
  307. package/shared/picker-field.template.cjs +13 -22
  308. package/shared/picker-field.template.js +14 -23
  309. package/shared/repeat.js +1 -1
  310. package/shared/slider.template.cjs +1 -1
  311. package/shared/slider.template.js +1 -1
  312. package/shared/time-selection-picker.template.cjs +10 -15
  313. package/shared/time-selection-picker.template.js +10 -16
  314. package/shared/vivid-element.cjs +53 -4
  315. package/shared/vivid-element.js +53 -3
  316. package/shared/with-error-text.cjs +56 -0
  317. package/shared/with-error-text.js +54 -0
  318. package/shared/with-success-text.cjs +23 -0
  319. package/shared/with-success-text.js +21 -0
  320. package/side-drawer/index.cjs +1 -1
  321. package/side-drawer/index.js +1 -1
  322. package/slider/index.cjs +1 -1
  323. package/slider/index.js +1 -1
  324. package/split-button/index.cjs +1 -1
  325. package/split-button/index.js +1 -1
  326. package/styles/core/all.css +1 -1
  327. package/styles/core/theme.css +1 -1
  328. package/styles/core/typography.css +1 -1
  329. package/styles/tokens/theme-dark.css +4 -4
  330. package/styles/tokens/theme-light.css +4 -4
  331. package/styles/tokens/vivid-2-compat.css +1 -1
  332. package/switch/index.cjs +1 -1
  333. package/switch/index.js +1 -1
  334. package/tab/index.cjs +1 -1
  335. package/tab/index.js +1 -1
  336. package/tab-panel/index.cjs +1 -1
  337. package/tab-panel/index.js +1 -1
  338. package/tabs/index.cjs +1 -1
  339. package/tabs/index.js +1 -1
  340. package/tag/index.cjs +1 -1
  341. package/tag/index.js +1 -1
  342. package/tag-group/index.cjs +1 -1
  343. package/tag-group/index.js +1 -1
  344. package/text-area/index.cjs +1 -1
  345. package/text-area/index.js +1 -1
  346. package/text-field/index.cjs +1 -1
  347. package/text-field/index.js +1 -1
  348. package/time-picker/index.cjs +1 -1
  349. package/time-picker/index.js +1 -1
  350. package/toggletip/index.cjs +1 -1
  351. package/toggletip/index.js +1 -1
  352. package/tooltip/index.cjs +1 -1
  353. package/tooltip/index.js +1 -1
  354. package/tree-item/index.cjs +1 -1
  355. package/tree-item/index.js +1 -1
  356. package/tree-view/index.cjs +1 -1
  357. package/tree-view/index.js +1 -1
  358. package/video-player/index.cjs +1 -1
  359. package/video-player/index.js +1 -1
  360. package/visually-hidden/index.cjs +5 -0
  361. package/visually-hidden/index.js +3 -0
  362. package/vivid.api.json +762 -1478
  363. package/lib/checkbox/checkbox.form-associated.d.ts +0 -11
  364. package/lib/file-picker/file-picker.form-associated.d.ts +0 -11
  365. package/lib/number-field/number-field.form-associated.d.ts +0 -11
  366. package/lib/radio/radio.form-associated.d.ts +0 -13
  367. package/lib/range-slider/range-slider.form-associated.d.ts +0 -11
  368. package/lib/searchable-select/searchable-select.form-associated.d.ts +0 -11
  369. package/lib/select/select.form-associated.d.ts +0 -11
  370. package/lib/slider/slider.form-associated.d.ts +0 -11
  371. package/lib/switch/switch.form-associated.d.ts +0 -11
  372. package/lib/text-anchor/definition.d.ts +0 -2
  373. package/lib/text-anchor/text-anchor.template.d.ts +0 -3
  374. package/lib/text-area/text-area.form-associated.d.ts +0 -11
  375. package/lib/text-field/text-field.form-associated.d.ts +0 -11
  376. package/shared/anchor.cjs +0 -49
  377. package/shared/anchor.js +0 -47
  378. package/shared/apply-mixins.cjs +0 -23
  379. package/shared/apply-mixins.js +0 -21
  380. package/shared/applyMixinsWithObservables.cjs +0 -15
  381. package/shared/applyMixinsWithObservables.js +0 -13
  382. package/shared/direction.cjs +0 -17
  383. package/shared/direction.js +0 -15
  384. package/shared/form-elements.cjs +0 -209
  385. package/shared/form-elements.js +0 -202
  386. package/shared/foundation/anchor/anchor.d.ts +0 -11
  387. package/shared/foundation/utilities/apply-mixins.d.ts +0 -1
  388. package/shared/patterns/form-elements/form-elements.d.ts +0 -58
  389. package/shared/picker-field/picker-field.form-associated.d.ts +0 -11
  390. package/shared/text-anchor.cjs +0 -38
  391. package/shared/text-anchor.js +0 -36
  392. package/shared/text-anchor.template.cjs +0 -35
  393. package/shared/text-anchor.template.js +0 -33
  394. package/shared/utils/applyMixinsWithObservables.d.ts +0 -1
  395. package/text-anchor/index.cjs +0 -17
  396. package/text-anchor/index.js +0 -15
@@ -1,16 +1,17 @@
1
1
  import { I as Icon, i as iconDefinition } from './definition28.js';
2
2
  import { B as Button, b as buttonDefinition } from './definition11.js';
3
- import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
4
- import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
3
+ import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
4
+ import { a as WithFeedback, f as feedbackMessageDefinition } from './mixins.js';
5
5
  import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
6
6
  import { F as FormAssociated } from './form-associated.js';
7
+ import { W as WithErrorText } from './with-error-text.js';
8
+ import { F as FormElement } from './form-element.js';
7
9
  import { L as Localized } from './localized.js';
8
- import { a as FormElementHelperText, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
9
10
  import { w as when } from './when.js';
10
11
  import { r as ref } from './ref.js';
11
12
  import { c as classNames } from './class-names.js';
12
13
 
13
- const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column;block-size:inherit;max-block-size:inherit}.control{display:flex;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;padding:16px;border:1px dashed var(--vvd-color-neutral-400);border-radius:8px;background-color:var(--vvd-color-cta-50);color:var(--vvd-color-neutral-600);cursor:pointer;font:var(--vvd-typography-base);gap:8px;inline-size:100%;min-block-size:52px;outline:none;transition:all .3s ease}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.control:hover,.control:active,.control:focus-visible{background-color:var(--vvd-color-cta-100)}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:8px;border:1px solid var(--vvd-color-neutral-300);border-radius:8px;background-color:var(--file-picker-list-item-background-color, var(--vvd-color-canvas));grid-template-columns:1fr auto;grid-template-rows:auto auto;inline-size:100%}.dz-preview .dz-details{display:flex;min-width:0;flex-direction:column;max-inline-size:100%}.dz-preview .dz-details .dz-filename{overflow:hidden;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-overflow:ellipsis;white-space:nowrap}.dz-preview .dz-details .dz-size{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed)}.dz-preview .dz-error-message{display:flex;align-items:center;color:var(--vvd-color-alert-600);font:var(--vvd-typography-base-condensed-bold);gap:4px;margin-block-start:4px}.dz-preview:not(.dz-error) .dz-error-message{display:none}.dz-preview.dz-error{border:1px solid var(--vvd-color-alert-500);background-color:var(--vvd-color-alert-50)}.dz-preview.dz-error .dz-details .dz-size,.dz-preview.dz-error .dz-progress{display:none}.dz-preview .remove-btn{display:inline;align-self:center;grid-column:2/-1;grid-row:1/-1}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}.preview-list{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.preview-list{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.preview-list ::-webkit-scrollbar{width:4px}.preview-list ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.preview-list ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.preview-list{display:flex;flex-direction:column;gap:12px;margin-block-start:12px;overflow-y:auto}.preview-list:empty{display:none}";
14
+ const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column;block-size:inherit;max-block-size:inherit;--_low-ink-color: var(--vvd-color-neutral-600)}.control-wrapper{display:flex;flex-direction:column;block-size:inherit;gap:4px;max-block-size:inherit}.control{display:flex;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;padding:16px;border:1px dashed var(--vvd-color-neutral-400);border-radius:8px;background-color:var(--vvd-color-cta-50);color:var(--vvd-color-neutral-600);cursor:pointer;font:var(--vvd-typography-base);gap:8px;inline-size:100%;min-block-size:52px;outline:none;transition:all .3s ease}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.control:hover,.control:active,.control:focus-visible{background-color:var(--vvd-color-cta-100)}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:8px;border:1px solid var(--vvd-color-neutral-300);border-radius:8px;background-color:var(--file-picker-list-item-background-color, var(--vvd-color-canvas));grid-template-columns:1fr auto;grid-template-rows:auto auto;inline-size:100%}.dz-preview .dz-details{display:flex;min-width:0;flex-direction:column;max-inline-size:100%}.dz-preview .dz-details .dz-filename{overflow:hidden;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-overflow:ellipsis;white-space:nowrap}.dz-preview .dz-details .dz-size{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed)}.dz-preview .dz-error-message{display:flex;align-items:center;color:var(--vvd-color-alert-600);font:var(--vvd-typography-base-condensed-bold);gap:4px;margin-block-start:4px}.dz-preview:not(.dz-error) .dz-error-message{display:none}.dz-preview.dz-error{border:1px solid var(--vvd-color-alert-500);background-color:var(--vvd-color-alert-50)}.dz-preview.dz-error .dz-details .dz-size,.dz-preview.dz-error .dz-progress{display:none}.dz-preview .remove-btn{display:inline;align-self:center;grid-column:2/-1;grid-row:1/-1}.preview-list{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.preview-list{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.preview-list ::-webkit-scrollbar{width:4px}.preview-list ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.preview-list ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.preview-list{display:flex;flex-direction:column;gap:12px;margin-block-start:12px;overflow-y:auto}.preview-list:empty{display:none}";
14
15
 
15
16
  var objectExtend = extend;
16
17
 
@@ -2138,34 +2139,15 @@ function $3ed269f2f0fb224b$var$__guardMethod__(obj, methodName, transform) {
2138
2139
  else return undefined;
2139
2140
  }
2140
2141
 
2141
- class _FilePicker extends VividElement {
2142
- }
2143
- class FormAssociatedFilePicker extends FormAssociated(_FilePicker) {
2144
- constructor() {
2145
- super(...arguments);
2146
- this.proxy = document.createElement("input");
2147
- }
2148
- }
2149
-
2150
2142
  var __defProp = Object.defineProperty;
2151
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2152
- var __typeError = (msg) => {
2153
- throw TypeError(msg);
2154
- };
2155
2143
  var __decorateClass = (decorators, target, key, kind) => {
2156
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
2144
+ var result = void 0 ;
2157
2145
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2158
2146
  if (decorator = decorators[i])
2159
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2160
- if (kind && result) __defProp(target, key, result);
2147
+ result = (decorator(target, key, result) ) || result;
2148
+ if (result) __defProp(target, key, result);
2161
2149
  return result;
2162
2150
  };
2163
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
2164
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
2165
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2166
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
2167
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
2168
- var _dropzone, _FilePicker_instances, syncSingleFileState_fn, _localizeErrorMessage, _localizeFileSizeNumberAndUnits, addRemoveButtonToFilesPreview_fn, chooseFile_fn, updateHiddenFileInput_fn, keepOnlyNewestFile_fn, handleFilesChanged_fn, updateFormValue_fn, setValueToAFakePathLikeNativeInput_fn, formatNumbersInMessage_fn;
2169
2151
  const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
2170
2152
  const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
2171
2153
  return `<div class="dz-preview dz-file-preview">
@@ -2180,13 +2162,13 @@ const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
2180
2162
  <${buttonTag} class="remove-btn" icon="delete-line" appearance="ghost-light" size="condensed" aria-label="${locale.filePicker.removeFileLabel}"></${buttonTag}>
2181
2163
  </div>`;
2182
2164
  };
2183
- let FilePicker = class extends DelegatesAria(
2184
- Localized(FormAssociatedFilePicker)
2165
+ class FilePicker extends WithFeedback(
2166
+ WithErrorText(
2167
+ FormElement(DelegatesAria(Localized(FormAssociated(VividElement))))
2168
+ )
2185
2169
  ) {
2186
2170
  constructor() {
2187
2171
  super();
2188
- __privateAdd(this, _FilePicker_instances);
2189
- __privateAdd(this, _dropzone);
2190
2172
  this.singleFile = false;
2191
2173
  this.maxFileSize = 256;
2192
2174
  /**
@@ -2206,7 +2188,7 @@ let FilePicker = class extends DelegatesAria(
2206
2188
  * Used internally to hold the tag that icon is registered at.
2207
2189
  */
2208
2190
  this.iconTag = "vwc-icon";
2209
- __privateAdd(this, _localizeErrorMessage, (file, message) => {
2191
+ this.#localizeErrorMessage = (file, message) => {
2210
2192
  if (file.previewElement) {
2211
2193
  file.previewElement.classList.add("dz-error");
2212
2194
  if (typeof message !== "string" && message.error) {
@@ -2215,15 +2197,21 @@ let FilePicker = class extends DelegatesAria(
2215
2197
  for (const node of file.previewElement.querySelectorAll(
2216
2198
  "[data-dz-errormessage]"
2217
2199
  )) {
2218
- node.textContent = __privateMethod(this, _FilePicker_instances, formatNumbersInMessage_fn).call(this, message);
2200
+ node.textContent = this.#formatNumbersInMessage(message);
2219
2201
  }
2220
2202
  }
2221
- });
2222
- __privateAdd(this, _localizeFileSizeNumberAndUnits, () => {
2223
- __privateGet(this, _dropzone).filesize = (size) => {
2224
- return __privateMethod(this, _FilePicker_instances, formatNumbersInMessage_fn).call(this, $3ed269f2f0fb224b$export$2e2bcd8739ae039.prototype.filesize.call(__privateGet(this, _dropzone), size));
2203
+ };
2204
+ this.#localizeFileSizeNumberAndUnits = () => {
2205
+ this.#dropzone.filesize = (size) => {
2206
+ return this.#formatNumbersInMessage(
2207
+ $3ed269f2f0fb224b$export$2e2bcd8739ae039.prototype.filesize.call(this.#dropzone, size)
2208
+ );
2225
2209
  };
2226
- });
2210
+ };
2211
+ /**
2212
+ * @internal
2213
+ */
2214
+ this.proxy = document.createElement("input");
2227
2215
  this.setFormValue = (value, state) => {
2228
2216
  if (isFormAssociatedTryingToSetFormValueToFakePath(value)) {
2229
2217
  return;
@@ -2232,13 +2220,14 @@ let FilePicker = class extends DelegatesAria(
2232
2220
  };
2233
2221
  $3ed269f2f0fb224b$export$2e2bcd8739ae039.autoDiscover = false;
2234
2222
  }
2223
+ #dropzone;
2235
2224
  /**
2236
2225
  * Files that have been added to the file picker and passed validation.
2237
2226
  *
2238
2227
  * @public
2239
2228
  */
2240
2229
  get files() {
2241
- return __privateGet(this, _dropzone)?.getAcceptedFiles() ?? [];
2230
+ return this.#dropzone?.getAcceptedFiles() ?? [];
2242
2231
  }
2243
2232
  /**
2244
2233
  * Files that have been rejected by the file picker for failing validation.
@@ -2246,45 +2235,71 @@ let FilePicker = class extends DelegatesAria(
2246
2235
  * @public
2247
2236
  */
2248
2237
  get rejectedFiles() {
2249
- return __privateGet(this, _dropzone)?.getRejectedFiles() ?? [];
2238
+ return this.#dropzone?.getRejectedFiles() ?? [];
2239
+ }
2240
+ #syncSingleFileState() {
2241
+ if (this.singleFile) {
2242
+ this.#dropzone?.hiddenFileInput?.removeAttribute("multiple");
2243
+ } else {
2244
+ this.#dropzone?.hiddenFileInput?.setAttribute("multiple", "multiple");
2245
+ }
2250
2246
  }
2251
2247
  singleFileChanged() {
2252
- __privateMethod(this, _FilePicker_instances, syncSingleFileState_fn).call(this);
2248
+ this.#syncSingleFileState();
2253
2249
  }
2254
2250
  maxFilesChanged(_oldValue, newValue) {
2255
- if (!__privateGet(this, _dropzone)) {
2251
+ if (!this.#dropzone) {
2256
2252
  return;
2257
2253
  }
2258
- __privateGet(this, _dropzone).options.maxFiles = newValue;
2259
- __privateMethod(this, _FilePicker_instances, updateHiddenFileInput_fn).call(this);
2254
+ this.#dropzone.options.maxFiles = newValue;
2255
+ this.#updateHiddenFileInput();
2260
2256
  }
2261
2257
  maxFileSizeChanged(_oldValue, newValue) {
2262
- if (!__privateGet(this, _dropzone)) {
2258
+ if (!this.#dropzone) {
2263
2259
  return;
2264
2260
  }
2265
- __privateGet(this, _dropzone).options.maxFilesize = newValue;
2261
+ this.#dropzone.options.maxFilesize = newValue;
2266
2262
  }
2267
2263
  acceptChanged(_oldValue, newValue) {
2268
- if (!__privateGet(this, _dropzone)) {
2264
+ if (!this.#dropzone) {
2269
2265
  return;
2270
2266
  }
2271
- __privateGet(this, _dropzone).options.acceptedFiles = newValue;
2267
+ this.#dropzone.options.acceptedFiles = newValue;
2272
2268
  }
2273
2269
  invalidFileTypeErrorChanged(_oldValue, newValue) {
2274
- if (__privateGet(this, _dropzone))
2275
- __privateGet(this, _dropzone).options.dictInvalidFileType = newValue || this.locale.filePicker.invalidFileTypeError;
2270
+ if (this.#dropzone)
2271
+ this.#dropzone.options.dictInvalidFileType = newValue || this.locale.filePicker.invalidFileTypeError;
2276
2272
  }
2277
2273
  maxFilesExceededErrorChanged(_oldValue, newValue) {
2278
- if (__privateGet(this, _dropzone))
2279
- __privateGet(this, _dropzone).options.dictMaxFilesExceeded = newValue || this.locale.filePicker.maxFilesExceededError;
2274
+ if (this.#dropzone)
2275
+ this.#dropzone.options.dictMaxFilesExceeded = newValue || this.locale.filePicker.maxFilesExceededError;
2280
2276
  }
2281
2277
  fileTooBigErrorChanged(_oldValue, newValue) {
2282
- if (__privateGet(this, _dropzone))
2283
- __privateGet(this, _dropzone).options.dictFileTooBig = newValue || this.locale.filePicker.fileTooBigError;
2278
+ if (this.#dropzone)
2279
+ this.#dropzone.options.dictFileTooBig = newValue || this.locale.filePicker.fileTooBigError;
2284
2280
  }
2285
2281
  nameChanged(previous, next) {
2286
2282
  super.nameChanged(previous, next);
2287
- __privateMethod(this, _FilePicker_instances, updateFormValue_fn).call(this);
2283
+ this.#updateFormValue();
2284
+ }
2285
+ #localizeErrorMessage;
2286
+ #localizeFileSizeNumberAndUnits;
2287
+ #addRemoveButtonToFilesPreview() {
2288
+ this.#dropzone.on("addedfiles", (files) => {
2289
+ for (const file of files) {
2290
+ if (file.previewElement) {
2291
+ const removeButton = file.previewElement.querySelector(
2292
+ ".remove-btn"
2293
+ );
2294
+ removeButton.addEventListener("click", (e) => {
2295
+ e.preventDefault();
2296
+ e.stopPropagation();
2297
+ this.#dropzone.removeFile(file);
2298
+ });
2299
+ }
2300
+ }
2301
+ this.#handleFilesChanged();
2302
+ });
2288
2303
  }
2289
2304
  connectedCallback() {
2290
2305
  super.connectedCallback();
@@ -2294,7 +2309,7 @@ let FilePicker = class extends DelegatesAria(
2294
2309
  const previewList = this.shadowRoot.querySelector(
2295
2310
  ".preview-list"
2296
2311
  );
2297
- __privateSet(this, _dropzone, new $3ed269f2f0fb224b$export$2e2bcd8739ae039(control, {
2312
+ this.#dropzone = new $3ed269f2f0fb224b$export$2e2bcd8739ae039(control, {
2298
2313
  url: "/",
2299
2314
  // dummy url, we do not use dropzone's upload functionality
2300
2315
  maxFiles: this.maxFiles ?? null,
@@ -2312,18 +2327,18 @@ let FilePicker = class extends DelegatesAria(
2312
2327
  dictInvalidFileType: this.invalidFileTypeError || this.locale.filePicker.invalidFileTypeError,
2313
2328
  dictMaxFilesExceeded: this.maxFilesExceededError || this.locale.filePicker.maxFilesExceededError,
2314
2329
  dictFileTooBig: this.fileTooBigError || this.locale.filePicker.fileTooBigError,
2315
- error: __privateGet(this, _localizeErrorMessage)
2316
- }));
2317
- __privateGet(this, _localizeFileSizeNumberAndUnits).call(this);
2318
- __privateMethod(this, _FilePicker_instances, addRemoveButtonToFilesPreview_fn).call(this);
2319
- __privateGet(this, _dropzone).on("removedfile", () => {
2320
- __privateMethod(this, _FilePicker_instances, handleFilesChanged_fn).call(this);
2330
+ error: this.#localizeErrorMessage
2331
+ });
2332
+ this.#localizeFileSizeNumberAndUnits();
2333
+ this.#addRemoveButtonToFilesPreview();
2334
+ this.#dropzone.on("removedfile", () => {
2335
+ this.#handleFilesChanged();
2321
2336
  });
2322
- __privateMethod(this, _FilePicker_instances, syncSingleFileState_fn).call(this);
2337
+ this.#syncSingleFileState();
2323
2338
  }
2324
2339
  disconnectedCallback() {
2325
2340
  super.disconnectedCallback();
2326
- __privateGet(this, _dropzone).destroy();
2341
+ this.#dropzone.destroy();
2327
2342
  }
2328
2343
  /**
2329
2344
  * Used internally to set the button tag.
@@ -2344,126 +2359,104 @@ let FilePicker = class extends DelegatesAria(
2344
2359
  */
2345
2360
  handleKeydown(e) {
2346
2361
  if (e.key === "Enter" || e.key === " ") {
2347
- __privateMethod(this, _FilePicker_instances, chooseFile_fn).call(this);
2362
+ this.#chooseFile();
2348
2363
  }
2349
2364
  return true;
2350
2365
  }
2351
- validate() {
2352
- super.validate(this.control);
2366
+ #chooseFile() {
2367
+ if (this.#dropzone.hiddenFileInput) {
2368
+ this.#dropzone.hiddenFileInput.click();
2369
+ }
2353
2370
  }
2354
- formResetCallback() {
2355
- super.formResetCallback();
2356
- __privateGet(this, _dropzone).removeAllFiles();
2371
+ #updateHiddenFileInput() {
2372
+ this.#dropzone.hiddenFileInput.dispatchEvent(
2373
+ new Event("change", { bubbles: false })
2374
+ );
2357
2375
  }
2358
- /**
2359
- * Removes all files from the File Picker.
2360
- */
2361
- removeAllFiles() {
2362
- __privateGet(this, _dropzone)?.removeAllFiles();
2376
+ #keepOnlyNewestFile() {
2377
+ for (let i = 0; i < this.files.length - 1; i++) {
2378
+ this.#dropzone.removeFile(this.files[i]);
2379
+ }
2363
2380
  }
2364
- };
2365
- _dropzone = new WeakMap();
2366
- _FilePicker_instances = new WeakSet();
2367
- syncSingleFileState_fn = function() {
2368
- if (this.singleFile) {
2369
- __privateGet(this, _dropzone)?.hiddenFileInput?.removeAttribute("multiple");
2370
- } else {
2371
- __privateGet(this, _dropzone)?.hiddenFileInput?.setAttribute("multiple", "multiple");
2381
+ #handleFilesChanged() {
2382
+ if (this.singleFile && this.files.length >= 1) {
2383
+ this.#keepOnlyNewestFile();
2384
+ }
2385
+ this.$emit("change");
2386
+ this.#updateFormValue();
2387
+ this.validate();
2388
+ requestAnimationFrame(() => this.#syncSingleFileState());
2372
2389
  }
2373
- };
2374
- _localizeErrorMessage = new WeakMap();
2375
- _localizeFileSizeNumberAndUnits = new WeakMap();
2376
- addRemoveButtonToFilesPreview_fn = function() {
2377
- __privateGet(this, _dropzone).on("addedfiles", (files) => {
2378
- for (const file of files) {
2379
- if (file.previewElement) {
2380
- const removeButton = file.previewElement.querySelector(
2381
- ".remove-btn"
2382
- );
2383
- removeButton.addEventListener("click", (e) => {
2384
- e.preventDefault();
2385
- e.stopPropagation();
2386
- __privateGet(this, _dropzone).removeFile(file);
2387
- });
2390
+ #updateFormValue() {
2391
+ const files = this.files;
2392
+ if (!this.name) {
2393
+ this.setFormValue(null);
2394
+ } else {
2395
+ const formData = new FormData();
2396
+ for (const file of files) {
2397
+ formData.append(this.name, file);
2388
2398
  }
2399
+ this.setFormValue(formData);
2389
2400
  }
2390
- __privateMethod(this, _FilePicker_instances, handleFilesChanged_fn).call(this);
2391
- });
2392
- };
2393
- chooseFile_fn = function() {
2394
- if (__privateGet(this, _dropzone).hiddenFileInput) {
2395
- __privateGet(this, _dropzone).hiddenFileInput.click();
2401
+ this.#setValueToAFakePathLikeNativeInput();
2396
2402
  }
2397
- };
2398
- updateHiddenFileInput_fn = function() {
2399
- __privateGet(this, _dropzone).hiddenFileInput.dispatchEvent(
2400
- new Event("change", { bubbles: false })
2401
- );
2402
- };
2403
- keepOnlyNewestFile_fn = function() {
2404
- for (let i = 0; i < this.files.length - 1; i++) {
2405
- __privateGet(this, _dropzone).removeFile(this.files[i]);
2403
+ #setValueToAFakePathLikeNativeInput() {
2404
+ this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
2406
2405
  }
2407
- };
2408
- handleFilesChanged_fn = function() {
2409
- if (this.singleFile && this.files.length >= 1) {
2410
- __privateMethod(this, _FilePicker_instances, keepOnlyNewestFile_fn).call(this);
2406
+ #getCustomValidationError() {
2407
+ if (this.rejectedFiles.length > 0) {
2408
+ return this.locale.filePicker.invalidFilesError;
2409
+ }
2410
+ return null;
2411
2411
  }
2412
- this.$emit("change");
2413
- __privateMethod(this, _FilePicker_instances, updateFormValue_fn).call(this);
2414
- requestAnimationFrame(() => __privateMethod(this, _FilePicker_instances, syncSingleFileState_fn).call(this));
2415
- };
2416
- updateFormValue_fn = function() {
2417
- const files = this.files;
2418
- if (!this.name) {
2419
- this.setFormValue(null);
2420
- } else {
2421
- const formData = new FormData();
2422
- for (const file of files) {
2423
- formData.append(this.name, file);
2424
- }
2425
- this.setFormValue(formData);
2412
+ /** {@inheritDoc (FormAssociated:interface).validate} */
2413
+ validate() {
2414
+ if (this.proxy) {
2415
+ this.proxy.setCustomValidity(this.#getCustomValidationError() ?? "");
2416
+ }
2417
+ super.validate(this.control);
2426
2418
  }
2427
- __privateMethod(this, _FilePicker_instances, setValueToAFakePathLikeNativeInput_fn).call(this);
2428
- };
2429
- setValueToAFakePathLikeNativeInput_fn = function() {
2430
- this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
2431
- };
2432
- formatNumbersInMessage_fn = function(message) {
2433
- if (this.locale.common.useCommaAsDecimalSeparator) {
2434
- return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
2419
+ formResetCallback() {
2420
+ super.formResetCallback();
2421
+ this.#dropzone.removeAllFiles();
2435
2422
  }
2436
- return message;
2437
- };
2423
+ #formatNumbersInMessage(message) {
2424
+ if (this.locale.common.useCommaAsDecimalSeparator) {
2425
+ return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
2426
+ }
2427
+ return message;
2428
+ }
2429
+ /**
2430
+ * Removes all files from the File Picker.
2431
+ */
2432
+ removeAllFiles() {
2433
+ this.#dropzone?.removeAllFiles();
2434
+ }
2435
+ }
2438
2436
  __decorateClass([
2439
2437
  attr({ attribute: "single-file", mode: "boolean" })
2440
- ], FilePicker.prototype, "singleFile", 2);
2438
+ ], FilePicker.prototype, "singleFile");
2441
2439
  __decorateClass([
2442
2440
  attr({ attribute: "max-files" })
2443
- ], FilePicker.prototype, "maxFiles", 2);
2441
+ ], FilePicker.prototype, "maxFiles");
2444
2442
  __decorateClass([
2445
2443
  attr({ mode: "fromView", attribute: "max-file-size" })
2446
- ], FilePicker.prototype, "maxFileSize", 2);
2444
+ ], FilePicker.prototype, "maxFileSize");
2447
2445
  __decorateClass([
2448
2446
  attr
2449
- ], FilePicker.prototype, "accept", 2);
2447
+ ], FilePicker.prototype, "accept");
2450
2448
  __decorateClass([
2451
2449
  attr
2452
- ], FilePicker.prototype, "size", 2);
2450
+ ], FilePicker.prototype, "size");
2453
2451
  __decorateClass([
2454
2452
  attr({ attribute: "invalid-file-type-error" })
2455
- ], FilePicker.prototype, "invalidFileTypeError", 2);
2453
+ ], FilePicker.prototype, "invalidFileTypeError");
2456
2454
  __decorateClass([
2457
2455
  attr({ attribute: "max-files-exceeded-error" })
2458
- ], FilePicker.prototype, "maxFilesExceededError", 2);
2456
+ ], FilePicker.prototype, "maxFilesExceededError");
2459
2457
  __decorateClass([
2460
2458
  attr({ attribute: "file-too-big-error" })
2461
- ], FilePicker.prototype, "fileTooBigError", 2);
2462
- FilePicker = __decorateClass([
2463
- errorText,
2464
- formElements
2465
- ], FilePicker);
2466
- applyMixinsWithObservables(FilePicker, FormElementHelperText);
2459
+ ], FilePicker.prototype, "fileTooBigError");
2467
2460
 
2468
2461
  const getClasses = ({ size }) => classNames("control", "dz-default", "dz-message", [
2469
2462
  `size-${size}`,
@@ -2480,18 +2473,21 @@ const FilePickerTemplate = (context) => {
2480
2473
  (x) => x.label,
2481
2474
  html`<label>${(x) => x.label}</label>`
2482
2475
  )}
2483
- <div
2484
- ${ref("control")}
2485
- class="${getClasses}"
2486
- tabindex="0"
2487
- @keydown="${(x, c) => x.handleKeydown(c.event)}"
2488
- ${delegateAria({
2476
+ <div class="control-wrapper">
2477
+ <div
2478
+ ${ref("control")}
2479
+ class="${getClasses}"
2480
+ tabindex="0"
2481
+ @keydown="${(x, c) => x.handleKeydown(c.event)}"
2482
+ aria-describedby="${(x) => x._feedbackDescribedBy}"
2483
+ ${delegateAria({
2489
2484
  role: "button"
2490
2485
  })}
2491
- >
2492
- <slot class="main"></slot>
2486
+ >
2487
+ <slot class="main"></slot>
2488
+ </div>
2489
+ ${(x) => x._getFeedbackTemplate(context)}
2493
2490
  </div>
2494
- ${getFeedbackTemplate(context)}
2495
2491
  <div class="preview-list"></div>
2496
2492
  </div>
2497
2493
  `;
@@ -2501,7 +2497,7 @@ const filePickerDefinition = defineVividComponent(
2501
2497
  "file-picker",
2502
2498
  FilePicker,
2503
2499
  FilePickerTemplate,
2504
- [iconDefinition, buttonDefinition],
2500
+ [iconDefinition, buttonDefinition, feedbackMessageDefinition],
2505
2501
  {
2506
2502
  styles,
2507
2503
  shadowOptions: {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const definition = require('./definition64.cjs');
3
+ const definition = require('./definition65.cjs');
4
4
  const vividElement = require('./vivid-element.cjs');
5
5
  const delegatesAria = require('./delegates-aria.cjs');
6
6
  const classNames = require('./class-names.cjs');
@@ -1,5 +1,5 @@
1
- import { E as Elevation, e as elevationDefinition } from './definition64.js';
2
- import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
1
+ import { E as Elevation, e as elevationDefinition } from './definition65.js';
2
+ import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
3
3
  import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
4
4
  import { c as classNames } from './class-names.js';
5
5
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const vividElement = require('./vivid-element.cjs');
4
+ const definition = require('./definition66.cjs');
4
5
  const _has = require('./_has.cjs');
5
6
  const classNames = require('./class-names.cjs');
6
7
  const when = require('./when.cjs');
@@ -243,6 +244,9 @@ __decorateClass([
243
244
  __decorateClass([
244
245
  vividElement.observable
245
246
  ], Icon.prototype, "iconLoaded", 2);
247
+ __decorateClass([
248
+ vividElement.attr
249
+ ], Icon.prototype, "label", 2);
246
250
  __decorateClass([
247
251
  vividElement.attr
248
252
  ], Icon.prototype, "name", 2);
@@ -255,24 +259,35 @@ const getClasses = ({ connotation, size }) => classNames.classNames(
255
259
  [`connotation-${connotation}`, Boolean(connotation)],
256
260
  [`size-${size}`, typeof size === "number"]
257
261
  );
258
- const iconTemplate = vividElement.html`
259
- <figure class="${getClasses}" ?aria-busy="${(x) => !x.iconLoaded}">
260
- <slot>
261
- ${when.when(
262
- (x) => !x.iconLoaded,
263
- vividElement.html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
264
- )}
265
- ${when.when(
266
- (x) => x.iconLoaded && x._svg,
267
- (x) => vividElement.html`${x._svg}`
268
- )}
269
- </slot>
270
- </figure>
271
- `;
262
+ const iconTemplate = (context) => {
263
+ const visuallyHiddenTag = context.tagFor(definition.VisuallyHidden);
264
+ const isDecorative = (x) => !x.label || x.label.trim().length === 0;
265
+ return vividElement.html`
266
+ <figure class="${getClasses}" ?aria-hidden="${(x) => isDecorative(x)}" ?aria-busy="${(x) => !x.iconLoaded}">
267
+ <slot>
268
+ ${when.when(
269
+ (x) => !x.iconLoaded,
270
+ vividElement.html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
271
+ )}
272
+ ${when.when(
273
+ (x) => x.iconLoaded && x._svg,
274
+ (x) => vividElement.html`${x._svg}`
275
+ )}
276
+ </slot>
277
+ <${visuallyHiddenTag} class="label">${(x) => x.label}</${visuallyHiddenTag}>
278
+ </figure>
279
+ `;
280
+ };
272
281
 
273
- const iconDefinition = vividElement.defineVividComponent("icon", Icon, iconTemplate, [], {
274
- styles
275
- });
282
+ const iconDefinition = vividElement.defineVividComponent(
283
+ "icon",
284
+ Icon,
285
+ iconTemplate,
286
+ [definition.visuallyHiddenDefinition],
287
+ {
288
+ styles
289
+ }
290
+ );
276
291
  const registerIcon = vividElement.createRegisterFunction(iconDefinition);
277
292
 
278
293
  exports.Icon = Icon;
@@ -1,4 +1,5 @@
1
- import { V as VividElement, a as attr, o as observable, v as volatile, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
1
+ import { V as VividElement, a as attr, o as observable, v as volatile, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
2
+ import { V as VisuallyHidden, v as visuallyHiddenDefinition } from './definition66.js';
2
3
  import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
3
4
  import { c as classNames } from './class-names.js';
4
5
  import { w as when } from './when.js';
@@ -241,6 +242,9 @@ __decorateClass([
241
242
  __decorateClass([
242
243
  observable
243
244
  ], Icon.prototype, "iconLoaded", 2);
245
+ __decorateClass([
246
+ attr
247
+ ], Icon.prototype, "label", 2);
244
248
  __decorateClass([
245
249
  attr
246
250
  ], Icon.prototype, "name", 2);
@@ -253,24 +257,35 @@ const getClasses = ({ connotation, size }) => classNames(
253
257
  [`connotation-${connotation}`, Boolean(connotation)],
254
258
  [`size-${size}`, typeof size === "number"]
255
259
  );
256
- const iconTemplate = html`
257
- <figure class="${getClasses}" ?aria-busy="${(x) => !x.iconLoaded}">
258
- <slot>
259
- ${when(
260
- (x) => !x.iconLoaded,
261
- html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
262
- )}
263
- ${when(
264
- (x) => x.iconLoaded && x._svg,
265
- (x) => html`${x._svg}`
266
- )}
267
- </slot>
268
- </figure>
269
- `;
260
+ const iconTemplate = (context) => {
261
+ const visuallyHiddenTag = context.tagFor(VisuallyHidden);
262
+ const isDecorative = (x) => !x.label || x.label.trim().length === 0;
263
+ return html`
264
+ <figure class="${getClasses}" ?aria-hidden="${(x) => isDecorative(x)}" ?aria-busy="${(x) => !x.iconLoaded}">
265
+ <slot>
266
+ ${when(
267
+ (x) => !x.iconLoaded,
268
+ html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
269
+ )}
270
+ ${when(
271
+ (x) => x.iconLoaded && x._svg,
272
+ (x) => html`${x._svg}`
273
+ )}
274
+ </slot>
275
+ <${visuallyHiddenTag} class="label">${(x) => x.label}</${visuallyHiddenTag}>
276
+ </figure>
277
+ `;
278
+ };
270
279
 
271
- const iconDefinition = defineVividComponent("icon", Icon, iconTemplate, [], {
272
- styles
273
- });
280
+ const iconDefinition = defineVividComponent(
281
+ "icon",
282
+ Icon,
283
+ iconTemplate,
284
+ [visuallyHiddenDefinition],
285
+ {
286
+ styles
287
+ }
288
+ );
274
289
  const registerIcon = createRegisterFunction(iconDefinition);
275
290
 
276
291
  export { Icon as I, iconDefinition as i, memoizeWith as m, registerIcon as r };