@vonage/vivid 4.13.0 → 4.14.1

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 (512) hide show
  1. package/custom-elements.json +3088 -1610
  2. package/elevation/index.cjs +1 -1
  3. package/elevation/index.js +1 -1
  4. package/index.cjs +70 -136
  5. package/index.d.ts +0 -1
  6. package/index.js +60 -62
  7. package/lib/accordion/accordion.d.ts +2 -2
  8. package/lib/accordion/accordion.template.d.ts +1 -2
  9. package/lib/accordion/definition.d.ts +1 -1
  10. package/lib/accordion-item/accordion-item.d.ts +2 -2
  11. package/lib/accordion-item/accordion-item.template.d.ts +2 -3
  12. package/lib/accordion-item/definition.d.ts +1 -1
  13. package/lib/action-group/action-group.d.ts +2 -2
  14. package/lib/action-group/action-group.template.d.ts +1 -3
  15. package/lib/action-group/definition.d.ts +1 -1
  16. package/lib/alert/alert.d.ts +2 -2
  17. package/lib/alert/alert.template.d.ts +2 -3
  18. package/lib/alert/definition.d.ts +1 -1
  19. package/lib/audio-player/audio-player.d.ts +2 -2
  20. package/lib/audio-player/audio-player.template.d.ts +2 -3
  21. package/lib/audio-player/definition.d.ts +1 -3
  22. package/lib/avatar/avatar.d.ts +2 -2
  23. package/lib/avatar/avatar.template.d.ts +2 -3
  24. package/lib/avatar/definition.d.ts +1 -1
  25. package/lib/badge/badge.d.ts +2 -2
  26. package/lib/badge/badge.template.d.ts +2 -3
  27. package/lib/badge/definition.d.ts +1 -3
  28. package/lib/banner/banner.d.ts +2 -2
  29. package/lib/banner/banner.template.d.ts +2 -3
  30. package/lib/banner/definition.d.ts +1 -1
  31. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  32. package/lib/breadcrumb/breadcrumb.template.d.ts +3 -4
  33. package/lib/breadcrumb/definition.d.ts +1 -1
  34. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  35. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +2 -3
  36. package/lib/breadcrumb-item/definition.d.ts +1 -1
  37. package/lib/button/button.d.ts +2 -2
  38. package/lib/button/button.template.d.ts +2 -4
  39. package/lib/button/definition.d.ts +1 -1
  40. package/lib/calendar/calendar.d.ts +2 -2
  41. package/lib/calendar/calendar.template.d.ts +1 -3
  42. package/lib/calendar/definition.d.ts +1 -1
  43. package/lib/calendar-event/calendar-event.d.ts +2 -2
  44. package/lib/calendar-event/calendar-event.template.d.ts +1 -3
  45. package/lib/calendar-event/definition.d.ts +1 -1
  46. package/lib/card/card.d.ts +2 -2
  47. package/lib/card/card.template.d.ts +2 -3
  48. package/lib/card/definition.d.ts +1 -1
  49. package/lib/checkbox/checkbox.form-associated.d.ts +3 -2
  50. package/lib/checkbox/checkbox.template.d.ts +2 -3
  51. package/lib/checkbox/definition.d.ts +1 -1
  52. package/lib/combobox/combobox.d.ts +17 -2
  53. package/lib/combobox/combobox.options.d.ts +7 -0
  54. package/lib/combobox/combobox.template.d.ts +2 -3
  55. package/lib/combobox/definition.d.ts +1 -2
  56. package/lib/data-grid/data-grid-cell.d.ts +16 -13
  57. package/lib/data-grid/data-grid-cell.template.d.ts +2 -3
  58. package/lib/data-grid/data-grid-row.d.ts +19 -2
  59. package/lib/data-grid/data-grid-row.template.d.ts +2 -2
  60. package/lib/data-grid/data-grid.d.ts +45 -4
  61. package/lib/data-grid/data-grid.template.d.ts +2 -2
  62. package/lib/data-grid/definition.d.ts +1 -6
  63. package/lib/date-picker/definition.d.ts +1 -3
  64. package/lib/date-range-picker/definition.d.ts +1 -3
  65. package/lib/dial-pad/definition.d.ts +1 -3
  66. package/lib/dial-pad/dial-pad.d.ts +2 -2
  67. package/lib/dial-pad/dial-pad.template.d.ts +2 -3
  68. package/lib/dialog/definition.d.ts +1 -1
  69. package/lib/dialog/dialog.d.ts +2 -2
  70. package/lib/dialog/dialog.template.d.ts +2 -3
  71. package/lib/divider/definition.d.ts +1 -1
  72. package/lib/divider/divider.d.ts +2 -2
  73. package/lib/divider/divider.template.d.ts +1 -3
  74. package/lib/elevation/definition.d.ts +1 -1
  75. package/lib/elevation/elevation.d.ts +3 -2
  76. package/lib/elevation/elevation.template.d.ts +1 -3
  77. package/lib/empty-state/definition.d.ts +1 -3
  78. package/lib/empty-state/empty-state.d.ts +2 -2
  79. package/lib/empty-state/empty-state.template.d.ts +2 -3
  80. package/lib/fab/definition.d.ts +1 -3
  81. package/lib/fab/fab.template.d.ts +2 -3
  82. package/lib/file-picker/definition.d.ts +1 -3
  83. package/lib/file-picker/file-picker.form-associated.d.ts +3 -2
  84. package/lib/file-picker/file-picker.template.d.ts +2 -3
  85. package/lib/header/definition.d.ts +1 -3
  86. package/lib/header/header.d.ts +2 -2
  87. package/lib/header/header.template.d.ts +2 -3
  88. package/lib/icon/definition.d.ts +1 -3
  89. package/lib/icon/icon.d.ts +2 -2
  90. package/lib/icon/icon.template.d.ts +1 -3
  91. package/lib/layout/definition.d.ts +1 -3
  92. package/lib/layout/layout.d.ts +2 -2
  93. package/lib/layout/layout.template.d.ts +1 -3
  94. package/lib/listbox/definition.d.ts +1 -3
  95. package/lib/listbox/listbox.template.d.ts +1 -3
  96. package/lib/menu/definition.d.ts +1 -11
  97. package/lib/menu/menu.d.ts +2 -2
  98. package/lib/menu/menu.template.d.ts +3 -3
  99. package/lib/menu-item/definition.d.ts +1 -3
  100. package/lib/menu-item/menu-item.d.ts +2 -2
  101. package/lib/menu-item/menu-item.template.d.ts +2 -3
  102. package/lib/nav/definition.d.ts +1 -3
  103. package/lib/nav/nav.d.ts +2 -2
  104. package/lib/nav/nav.template.d.ts +1 -3
  105. package/lib/nav-disclosure/definition.d.ts +1 -3
  106. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  107. package/lib/nav-disclosure/nav-disclosure.template.d.ts +2 -3
  108. package/lib/nav-item/definition.d.ts +1 -3
  109. package/lib/nav-item/nav-item.template.d.ts +2 -3
  110. package/lib/note/definition.d.ts +1 -3
  111. package/lib/note/note.d.ts +2 -2
  112. package/lib/note/note.template.d.ts +2 -3
  113. package/lib/number-field/definition.d.ts +1 -4
  114. package/lib/number-field/number-field.form-associated.d.ts +3 -2
  115. package/lib/number-field/number-field.template.d.ts +2 -3
  116. package/lib/option/definition.d.ts +1 -3
  117. package/lib/option/option.d.ts +3 -2
  118. package/lib/option/option.template.d.ts +2 -3
  119. package/lib/pagination/definition.d.ts +1 -3
  120. package/lib/pagination/pagination.d.ts +2 -2
  121. package/lib/pagination/pagination.template.d.ts +2 -3
  122. package/lib/popup/definition.d.ts +1 -3
  123. package/lib/popup/popup.template.d.ts +2 -3
  124. package/lib/progress/definition.d.ts +1 -3
  125. package/lib/progress/progress.d.ts +1 -1
  126. package/lib/progress/progress.template.d.ts +1 -4
  127. package/lib/progress-ring/definition.d.ts +1 -3
  128. package/lib/progress-ring/progress-ring.d.ts +1 -1
  129. package/lib/progress-ring/progress-ring.template.d.ts +1 -3
  130. package/lib/radio/definition.d.ts +1 -3
  131. package/lib/radio/radio.form-associated.d.ts +5 -2
  132. package/lib/radio/radio.template.d.ts +1 -3
  133. package/lib/radio-group/definition.d.ts +1 -11
  134. package/lib/radio-group/radio-group.d.ts +2 -2
  135. package/lib/radio-group/radio-group.template.d.ts +2 -3
  136. package/lib/range-slider/definition.d.ts +1 -3
  137. package/lib/range-slider/range-slider.form-associated.d.ts +3 -2
  138. package/lib/range-slider/range-slider.template.d.ts +2 -3
  139. package/lib/searchable-select/definition.d.ts +1 -4
  140. package/lib/searchable-select/option-tag.template.d.ts +2 -3
  141. package/lib/searchable-select/searchable-select.form-associated.d.ts +3 -2
  142. package/lib/searchable-select/searchable-select.template.d.ts +2 -3
  143. package/lib/select/definition.d.ts +1 -3
  144. package/lib/select/select.d.ts +14 -4
  145. package/lib/select/select.form-associated.d.ts +11 -0
  146. package/lib/select/select.template.d.ts +2 -3
  147. package/lib/selectable-box/definition.d.ts +1 -3
  148. package/lib/selectable-box/selectable-box.d.ts +2 -2
  149. package/lib/selectable-box/selectable-box.template.d.ts +2 -3
  150. package/lib/side-drawer/definition.d.ts +1 -3
  151. package/lib/side-drawer/side-drawer.d.ts +2 -2
  152. package/lib/side-drawer/side-drawer.template.d.ts +1 -3
  153. package/lib/slider/definition.d.ts +1 -3
  154. package/lib/slider/slider.form-associated.d.ts +3 -2
  155. package/lib/slider/slider.template.d.ts +3 -4
  156. package/lib/split-button/definition.d.ts +1 -1
  157. package/lib/split-button/split-button.d.ts +2 -2
  158. package/lib/split-button/split-button.template.d.ts +2 -3
  159. package/lib/switch/definition.d.ts +1 -3
  160. package/lib/switch/switch.form-associated.d.ts +3 -2
  161. package/lib/switch/switch.template.d.ts +1 -3
  162. package/lib/tab/definition.d.ts +1 -3
  163. package/lib/tab/tab.d.ts +2 -2
  164. package/lib/tab/tab.template.d.ts +2 -2
  165. package/lib/tab-panel/definition.d.ts +1 -3
  166. package/lib/tab-panel/tab-panel.d.ts +2 -2
  167. package/lib/tab-panel/tab-panel.template.d.ts +1 -1
  168. package/lib/tabs/definition.d.ts +1 -3
  169. package/lib/tabs/tabs.d.ts +3 -7
  170. package/lib/tabs/tabs.template.d.ts +1 -1
  171. package/lib/tag/definition.d.ts +1 -4
  172. package/lib/tag/tag.d.ts +2 -2
  173. package/lib/tag/tag.template.d.ts +2 -3
  174. package/lib/tag-group/definition.d.ts +1 -3
  175. package/lib/tag-group/tag-group.d.ts +2 -2
  176. package/lib/tag-group/tag-group.template.d.ts +1 -3
  177. package/lib/text-anchor/definition.d.ts +1 -3
  178. package/lib/text-anchor/text-anchor.d.ts +4 -3
  179. package/lib/text-anchor/text-anchor.template.d.ts +2 -3
  180. package/lib/text-area/definition.d.ts +1 -3
  181. package/lib/text-area/text-area.d.ts +1 -1
  182. package/lib/text-area/{text-field.form-associated.d.ts → text-area.form-associated.d.ts} +3 -2
  183. package/lib/text-area/text-area.template.d.ts +2 -3
  184. package/lib/text-field/definition.d.ts +1 -3
  185. package/lib/text-field/text-field.form-associated.d.ts +3 -2
  186. package/lib/text-field/text-field.template.d.ts +2 -3
  187. package/lib/time-picker/definition.d.ts +1 -3
  188. package/lib/time-picker/time-picker.form-associated.d.ts +3 -2
  189. package/lib/time-picker/time-picker.template.d.ts +2 -2
  190. package/lib/toggletip/definition.d.ts +1 -3
  191. package/lib/toggletip/toggletip.d.ts +2 -2
  192. package/lib/toggletip/toggletip.template.d.ts +2 -3
  193. package/lib/tooltip/definition.d.ts +1 -3
  194. package/lib/tooltip/tooltip.d.ts +2 -2
  195. package/lib/tooltip/tooltip.template.d.ts +2 -3
  196. package/lib/tree-item/definition.d.ts +1 -3
  197. package/lib/tree-item/tree-item.d.ts +11 -2
  198. package/lib/tree-item/tree-item.template.d.ts +3 -3
  199. package/lib/tree-view/definition.d.ts +1 -3
  200. package/lib/tree-view/tree-view.d.ts +16 -2
  201. package/lib/tree-view/tree-view.template.d.ts +1 -1
  202. package/lib/video-player/definition.d.ts +1 -3
  203. package/lib/video-player/video-player.d.ts +2 -2
  204. package/lib/video-player/video-player.template.d.ts +1 -3
  205. package/listbox/index.cjs +37 -39
  206. package/listbox/index.js +37 -39
  207. package/menu/index.cjs +1 -1
  208. package/menu/index.js +1 -1
  209. package/nav/index.cjs +1 -1
  210. package/nav/index.js +1 -1
  211. package/nav-disclosure/index.cjs +1 -1
  212. package/nav-disclosure/index.js +1 -1
  213. package/nav-item/index.cjs +1 -1
  214. package/nav-item/index.js +1 -1
  215. package/note/index.cjs +1 -1
  216. package/note/index.js +1 -1
  217. package/number-field/index.cjs +1 -1
  218. package/number-field/index.js +1 -1
  219. package/option/index.cjs +1 -1
  220. package/option/index.js +1 -1
  221. package/package.json +1 -1
  222. package/pagination/index.cjs +1 -1
  223. package/pagination/index.js +1 -1
  224. package/popup/index.cjs +1 -1
  225. package/popup/index.js +1 -1
  226. package/progress/index.cjs +1 -1
  227. package/progress/index.js +1 -1
  228. package/progress-ring/index.cjs +1 -1
  229. package/progress-ring/index.js +1 -1
  230. package/radio/index.cjs +1 -1
  231. package/radio/index.js +1 -1
  232. package/radio-group/index.cjs +1 -1
  233. package/radio-group/index.js +1 -1
  234. package/range-slider/index.cjs +1 -1
  235. package/range-slider/index.js +1 -1
  236. package/searchable-select/index.cjs +1 -1
  237. package/searchable-select/index.js +1 -1
  238. package/select/index.cjs +1 -1
  239. package/select/index.js +1 -1
  240. package/selectable-box/index.cjs +1 -1
  241. package/selectable-box/index.js +1 -1
  242. package/shared/affix.cjs +10 -10
  243. package/shared/affix.js +2 -2
  244. package/shared/anchor.cjs +59 -0
  245. package/shared/anchor.js +57 -0
  246. package/shared/anchored.cjs +6 -6
  247. package/shared/anchored.js +2 -2
  248. package/shared/apply-mixins.cjs +15 -17
  249. package/shared/apply-mixins.js +15 -17
  250. package/shared/apply-mixins2.cjs +25 -0
  251. package/shared/apply-mixins2.js +23 -0
  252. package/shared/applyMixinsWithObservables.cjs +4 -4
  253. package/shared/applyMixinsWithObservables.js +2 -2
  254. package/shared/aria-global.cjs +86 -67
  255. package/shared/aria-global.js +86 -67
  256. package/shared/aria-global2.cjs +68 -86
  257. package/shared/aria-global2.js +68 -86
  258. package/shared/base-progress.cjs +69 -63
  259. package/shared/base-progress.js +69 -63
  260. package/shared/breadcrumb-item.cjs +6 -58
  261. package/shared/breadcrumb-item.js +3 -55
  262. package/shared/button.cjs +177 -0
  263. package/shared/button.js +175 -0
  264. package/shared/calendar-event.cjs +9 -9
  265. package/shared/calendar-event.js +2 -2
  266. package/shared/children.cjs +2 -2
  267. package/shared/children.js +1 -1
  268. package/shared/date-picker/date-picker-base.form-associated.d.ts +3 -2
  269. package/shared/date-picker/date-picker-base.template.d.ts +2 -3
  270. package/shared/definition.cjs +25 -24
  271. package/shared/definition.js +16 -14
  272. package/shared/definition10.cjs +14 -12
  273. package/shared/definition10.js +14 -11
  274. package/shared/definition11.cjs +52 -248
  275. package/shared/definition11.js +24 -218
  276. package/shared/definition12.cjs +18 -14
  277. package/shared/definition12.js +17 -12
  278. package/shared/definition13.cjs +19 -19
  279. package/shared/definition13.js +10 -9
  280. package/shared/definition14.cjs +35 -38
  281. package/shared/definition14.js +15 -17
  282. package/shared/definition15.cjs +27 -26
  283. package/shared/definition15.js +16 -14
  284. package/shared/definition16.cjs +480 -612
  285. package/shared/definition16.js +473 -604
  286. package/shared/definition17.cjs +933 -1113
  287. package/shared/definition17.js +911 -1090
  288. package/shared/definition18.cjs +16 -20
  289. package/shared/definition18.js +19 -22
  290. package/shared/definition19.cjs +26 -30
  291. package/shared/definition19.js +21 -24
  292. package/shared/definition2.cjs +19 -22
  293. package/shared/definition2.js +20 -22
  294. package/shared/definition20.cjs +50 -52
  295. package/shared/definition20.js +34 -35
  296. package/shared/definition21.cjs +43 -47
  297. package/shared/definition21.js +19 -22
  298. package/shared/definition22.cjs +15 -13
  299. package/shared/definition22.js +14 -11
  300. package/shared/definition23.cjs +21 -20
  301. package/shared/definition23.js +14 -12
  302. package/shared/definition24.cjs +21 -173
  303. package/shared/definition24.js +18 -169
  304. package/shared/definition25.cjs +26 -28
  305. package/shared/definition25.js +18 -19
  306. package/shared/definition26.cjs +16 -14
  307. package/shared/definition26.js +14 -11
  308. package/shared/definition27.cjs +264 -12
  309. package/shared/definition27.js +261 -10
  310. package/shared/definition28.cjs +19 -17
  311. package/shared/definition28.js +15 -12
  312. package/shared/definition29.cjs +142 -68
  313. package/shared/definition29.js +101 -29
  314. package/shared/definition3.cjs +20 -16
  315. package/shared/definition3.js +16 -11
  316. package/shared/definition30.cjs +98 -76
  317. package/shared/definition30.js +97 -74
  318. package/shared/definition31.cjs +24 -97
  319. package/shared/definition31.js +25 -97
  320. package/shared/definition32.cjs +9 -25
  321. package/shared/definition32.js +8 -23
  322. package/shared/definition33.cjs +52 -14
  323. package/shared/definition33.js +51 -12
  324. package/shared/definition34.cjs +639 -34
  325. package/shared/definition34.js +636 -30
  326. package/shared/definition35.cjs +203 -596
  327. package/shared/definition35.js +197 -591
  328. package/shared/definition36.cjs +197 -233
  329. package/shared/definition36.js +192 -226
  330. package/shared/definition37.cjs +79 -206
  331. package/shared/definition37.js +75 -202
  332. package/shared/definition38.cjs +50 -56
  333. package/shared/definition38.js +48 -52
  334. package/shared/definition39.cjs +259 -56
  335. package/shared/definition39.js +258 -54
  336. package/shared/definition4.cjs +32 -35
  337. package/shared/definition4.js +19 -21
  338. package/shared/definition40.cjs +156 -225
  339. package/shared/definition40.js +152 -221
  340. package/shared/definition41.cjs +626 -36
  341. package/shared/definition41.js +625 -34
  342. package/shared/definition42.cjs +974 -487
  343. package/shared/definition42.js +971 -482
  344. package/shared/definition43.cjs +725 -932
  345. package/shared/definition43.js +713 -918
  346. package/shared/definition44.cjs +115 -734
  347. package/shared/definition44.js +113 -731
  348. package/shared/definition45.cjs +92 -116
  349. package/shared/definition45.js +92 -115
  350. package/shared/definition46.cjs +468 -89
  351. package/shared/definition46.js +465 -86
  352. package/shared/definition47.cjs +118 -470
  353. package/shared/definition47.js +115 -465
  354. package/shared/definition48.cjs +113 -120
  355. package/shared/definition48.js +111 -117
  356. package/shared/definition49.cjs +16 -134
  357. package/shared/definition49.js +15 -132
  358. package/shared/definition5.cjs +47 -49
  359. package/shared/definition5.js +18 -19
  360. package/shared/definition50.cjs +111 -15
  361. package/shared/definition50.js +109 -12
  362. package/shared/definition51.cjs +862 -84
  363. package/shared/definition51.js +858 -79
  364. package/shared/definition52.cjs +30 -873
  365. package/shared/definition52.js +28 -870
  366. package/shared/definition53.cjs +125 -28
  367. package/shared/definition53.js +123 -25
  368. package/shared/definition54.cjs +267 -107
  369. package/shared/definition54.js +261 -100
  370. package/shared/definition55.cjs +63 -278
  371. package/shared/definition55.js +61 -275
  372. package/shared/definition56.cjs +867 -76
  373. package/shared/definition56.js +866 -74
  374. package/shared/definition57.cjs +107 -826
  375. package/shared/definition57.js +105 -823
  376. package/shared/definition58.cjs +73 -100
  377. package/shared/definition58.js +69 -95
  378. package/shared/definition59.cjs +180 -106
  379. package/shared/definition59.js +174 -101
  380. package/shared/definition6.cjs +22 -21
  381. package/shared/definition6.js +14 -12
  382. package/shared/definition60.cjs +272 -70
  383. package/shared/definition60.js +272 -69
  384. package/shared/definition61.cjs +66154 -271
  385. package/shared/definition61.js +66153 -269
  386. package/shared/definition62.cjs +38 -66173
  387. package/shared/definition62.js +35 -66170
  388. package/shared/definition63.cjs +2153 -27
  389. package/shared/definition63.js +2150 -25
  390. package/shared/definition7.cjs +18 -15
  391. package/shared/definition7.js +13 -10
  392. package/shared/definition8.cjs +25 -27
  393. package/shared/definition8.js +16 -17
  394. package/shared/definition9.cjs +21 -21
  395. package/shared/definition9.js +18 -17
  396. package/shared/design-system/createRegisterFunction.d.ts +2 -0
  397. package/shared/design-system/defineVividComponent.d.ts +15 -0
  398. package/shared/{localization.js → direction.js} +11 -11
  399. package/shared/dom.cjs +0 -13
  400. package/shared/dom.js +1 -13
  401. package/shared/form-associated.cjs +422 -457
  402. package/shared/form-associated.js +422 -457
  403. package/shared/form-associated2.cjs +383 -0
  404. package/shared/form-associated2.js +381 -0
  405. package/shared/form-elements.cjs +15 -42
  406. package/shared/form-elements.js +2 -29
  407. package/shared/foundation/anchor/anchor.d.ts +1 -0
  408. package/shared/foundation/button/button.d.ts +3 -2
  409. package/shared/foundation/button/button.template.d.ts +2 -4
  410. package/shared/foundation/form-associated/form-associated.d.ts +51 -0
  411. package/shared/foundation/listbox/listbox.d.ts +22 -0
  412. package/shared/foundation/progress/base-progress.d.ts +9 -0
  413. package/shared/foundation/utilities/apply-mixins.d.ts +1 -0
  414. package/shared/foundation/vivid-element/vivid-element.d.ts +3 -0
  415. package/shared/index.cjs +7 -5097
  416. package/shared/index.js +7 -5079
  417. package/shared/key-codes.cjs +10 -0
  418. package/shared/key-codes.js +6 -1
  419. package/shared/key-codes2.cjs +1463 -6
  420. package/shared/key-codes2.js +1461 -4
  421. package/shared/listbox.cjs +427 -1195
  422. package/shared/listbox.js +411 -1176
  423. package/shared/listbox2.cjs +1267 -0
  424. package/shared/listbox2.js +1264 -0
  425. package/shared/localized.cjs +2 -2
  426. package/shared/localized.js +1 -1
  427. package/shared/numbers.cjs +12 -0
  428. package/shared/numbers.js +12 -1
  429. package/shared/patterns/affix.d.ts +2 -2
  430. package/shared/patterns/chevron.d.ts +2 -2
  431. package/shared/patterns/form-elements/form-elements.d.ts +2 -2
  432. package/shared/presentationDate.cjs +49 -49
  433. package/shared/presentationDate.js +6 -6
  434. package/shared/ref.cjs +2 -2
  435. package/shared/ref.js +1 -1
  436. package/shared/repeat.cjs +22 -22
  437. package/shared/repeat.js +1 -1
  438. package/shared/slider.template.cjs +5 -5
  439. package/shared/slider.template.js +2 -2
  440. package/shared/slotted.cjs +4 -4
  441. package/shared/slotted.js +1 -1
  442. package/shared/strings.cjs +0 -26
  443. package/shared/strings.js +1 -25
  444. package/shared/strings2.cjs +37 -0
  445. package/shared/strings2.js +33 -0
  446. package/shared/text-anchor.cjs +7 -89
  447. package/shared/text-anchor.js +4 -86
  448. package/shared/text-anchor.template.cjs +2 -2
  449. package/shared/text-anchor.template.js +1 -1
  450. package/shared/text-field2.cjs +28 -28
  451. package/shared/text-field2.js +5 -5
  452. package/shared/vivid-element.cjs +2616 -0
  453. package/shared/vivid-element.js +2595 -0
  454. package/side-drawer/index.cjs +1 -1
  455. package/side-drawer/index.js +1 -1
  456. package/slider/index.cjs +1 -1
  457. package/slider/index.js +1 -1
  458. package/split-button/index.cjs +1 -1
  459. package/split-button/index.js +1 -1
  460. package/styles/core/all.css +40 -1
  461. package/styles/core/theme.css +40 -1
  462. package/styles/core/typography.css +1 -1
  463. package/styles/tokens/theme-dark.css +25 -4
  464. package/styles/tokens/theme-light.css +25 -4
  465. package/styles/tokens/vivid-2-compat.css +1 -1
  466. package/switch/index.cjs +1 -1
  467. package/switch/index.js +1 -1
  468. package/tab/index.cjs +1 -1
  469. package/tab/index.js +1 -1
  470. package/tab-panel/index.cjs +1 -1
  471. package/tab-panel/index.js +1 -1
  472. package/tabs/index.cjs +1 -1
  473. package/tabs/index.js +1 -1
  474. package/tag/index.cjs +1 -1
  475. package/tag/index.js +1 -1
  476. package/tag-group/index.cjs +1 -1
  477. package/tag-group/index.js +1 -1
  478. package/text-anchor/index.cjs +10 -7
  479. package/text-anchor/index.js +10 -7
  480. package/text-area/index.cjs +1 -1
  481. package/text-area/index.js +1 -1
  482. package/text-field/index.cjs +1 -1
  483. package/text-field/index.js +1 -1
  484. package/time-picker/index.cjs +1 -1
  485. package/time-picker/index.js +1 -1
  486. package/toggletip/index.cjs +1 -1
  487. package/toggletip/index.js +1 -1
  488. package/tooltip/index.cjs +1 -1
  489. package/tooltip/index.js +1 -1
  490. package/tree-item/index.cjs +1 -1
  491. package/tree-item/index.js +1 -1
  492. package/tree-view/index.cjs +1 -1
  493. package/tree-view/index.js +1 -1
  494. package/video-player/index.cjs +1 -1
  495. package/video-player/index.js +1 -1
  496. package/vivid.api.json +2846 -7860
  497. package/shared/definition64.cjs +0 -2175
  498. package/shared/definition64.js +0 -2170
  499. package/shared/design-system/index.d.ts +0 -3
  500. package/shared/icon.cjs +0 -261
  501. package/shared/icon.js +0 -258
  502. package/shared/index2.cjs +0 -11
  503. package/shared/index2.js +0 -9
  504. package/shared/radio.cjs +0 -126
  505. package/shared/radio.js +0 -124
  506. package/shared/select.options.cjs +0 -12
  507. package/shared/select.options.js +0 -10
  508. package/shared/start-end.cjs +0 -52
  509. package/shared/start-end.js +0 -50
  510. package/shared/tree-item.cjs +0 -154
  511. package/shared/tree-item.js +0 -151
  512. package/shared/{localization.cjs → direction.cjs} +9 -9
@@ -1,765 +1,147 @@
1
- import { D as DOM, O as Observable, _ as __decorate, a as attr, v as volatile, o as observable, h as html, r as registerFactory } from './index.js';
2
- import { P as Popup, p as popupRegistries } from './definition64.js';
3
- import { a as iconRegistries } from './definition27.js';
4
- import { L as ListboxOption, a as listboxOptionRegistries } from './definition36.js';
5
- import { L as ListboxElement, b as Listbox, D as DelegatesARIAListbox, a as Listbox$1 } from './listbox.js';
6
- import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
7
- import { S as StartEnd } from './start-end.js';
8
- import { a as applyMixins } from './apply-mixins.js';
9
- import { F as FormAssociated } from './form-associated.js';
10
- import { S as SelectPosition } from './select.options.js';
11
- import { u as uniqueId } from './strings.js';
12
- import { c as keyTab, b as keyEscape, k as keyEnter, d as keyEnd, g as keyHome, a as keySpace, f as keyArrowDown, e as keyArrowUp } from './key-codes2.js';
13
- import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, g as getFeedbackTemplate } from './form-elements.js';
14
- import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
15
- import { d as chevronTemplateFactory } from './definition11.js';
16
- import { h as handleEscapeKeyAndStopPropogation } from './index2.js';
17
- import { r as ref } from './ref.js';
18
- import { w as when } from './when.js';
19
- import { s as slotted } from './slotted.js';
1
+ import { C as Checkbox, c as checkboxDefinition } from './definition15.js';
2
+ import { R as Radio, r as radioDefinition } from './definition40.js';
3
+ import { V as VividElement, a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
4
+ import { C as Connotation } from './enums.js';
20
5
  import { c as classNames } from './class-names.js';
6
+ import { w as when } from './when.js';
21
7
 
22
- class _Select extends ListboxElement {
23
- }
24
- /**
25
- * A form-associated base class for the {@link @microsoft/fast-foundation#(Select:class)} component.
26
- *
27
- * @internal
28
- */
29
- class FormAssociatedSelect extends FormAssociated(_Select) {
30
- constructor() {
31
- super(...arguments);
32
- this.proxy = document.createElement("select");
33
- }
34
- }
35
-
36
- /**
37
- * A Select Custom HTML Element.
38
- * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
39
- *
40
- * @slot start - Content which can be provided before the button content
41
- * @slot end - Content which can be provided after the button content
42
- * @slot button-container - The element representing the select button
43
- * @slot selected-value - The selected value
44
- * @slot indicator - The visual indicator for the expand/collapse state of the button
45
- * @slot - The default slot for slotted options
46
- * @csspart control - The element representing the select invoking element
47
- * @csspart selected-value - The element wrapping the selected value
48
- * @csspart indicator - The element wrapping the visual indicator
49
- * @csspart listbox - The listbox element
50
- * @fires input - Fires a custom 'input' event when the value updates
51
- * @fires change - Fires a custom 'change' event when the value updates
52
- *
53
- * @public
54
- */
55
- let Select$1 = class Select extends FormAssociatedSelect {
56
- constructor() {
57
- super(...arguments);
58
- /**
59
- * The open attribute.
60
- *
61
- * @public
62
- * @remarks
63
- * HTML Attribute: open
64
- */
65
- this.open = false;
66
- /**
67
- * Indicates the initial state of the position attribute.
68
- *
69
- * @internal
70
- */
71
- this.forcedPosition = false;
72
- /**
73
- * The unique id for the internal listbox element.
74
- *
75
- * @internal
76
- */
77
- this.listboxId = uniqueId("listbox-");
78
- /**
79
- * The max height for the listbox when opened.
80
- *
81
- * @internal
82
- */
83
- this.maxHeight = 0;
84
- }
85
- /**
86
- * Sets focus and synchronizes ARIA attributes when the open property changes.
87
- *
88
- * @param prev - the previous open value
89
- * @param next - the current open value
90
- *
91
- * @internal
92
- */
93
- openChanged(prev, next) {
94
- if (!this.collapsible) {
95
- return;
96
- }
97
- if (this.open) {
98
- this.ariaControls = this.listboxId;
99
- this.ariaExpanded = "true";
100
- this.setPositioning();
101
- this.focusAndScrollOptionIntoView();
102
- this.indexWhenOpened = this.selectedIndex;
103
- // focus is directed to the element when `open` is changed programmatically
104
- DOM.queueUpdate(() => this.focus());
105
- return;
106
- }
107
- this.ariaControls = "";
108
- this.ariaExpanded = "false";
109
- }
110
- /**
111
- * The component is collapsible when in single-selection mode with no size attribute.
112
- *
113
- * @internal
114
- */
115
- get collapsible() {
116
- return !(this.multiple || typeof this.size === "number");
117
- }
118
- /**
119
- * The value property.
120
- *
121
- * @public
122
- */
123
- get value() {
124
- Observable.track(this, "value");
125
- return this._value;
126
- }
127
- set value(next) {
128
- var _a, _b, _c, _d, _e, _f, _g;
129
- const prev = `${this._value}`;
130
- if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
131
- const selectedIndex = this._options.findIndex(el => el.value === next);
132
- const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
133
- const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
134
- if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
135
- next = "";
136
- this.selectedIndex = selectedIndex;
137
- }
138
- next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
139
- }
140
- if (prev !== next) {
141
- this._value = next;
142
- super.valueChanged(prev, next);
143
- Observable.notify(this, "value");
144
- this.updateDisplayValue();
145
- }
146
- }
147
- /**
148
- * Sets the value and display value to match the first selected option.
149
- *
150
- * @param shouldEmit - if true, the input and change events will be emitted
151
- *
152
- * @internal
153
- */
154
- updateValue(shouldEmit) {
155
- var _a, _b;
156
- if (this.$fastController.isConnected) {
157
- this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
158
- }
159
- if (shouldEmit) {
160
- this.$emit("input");
161
- this.$emit("change", this, {
162
- bubbles: true,
163
- composed: undefined,
164
- });
165
- }
166
- }
167
- /**
168
- * Updates the proxy value when the selected index changes.
169
- *
170
- * @param prev - the previous selected index
171
- * @param next - the next selected index
172
- *
173
- * @internal
174
- */
175
- selectedIndexChanged(prev, next) {
176
- super.selectedIndexChanged(prev, next);
177
- this.updateValue();
178
- }
179
- positionChanged(prev, next) {
180
- this.positionAttribute = next;
181
- this.setPositioning();
182
- }
183
- /**
184
- * Calculate and apply listbox positioning based on available viewport space.
185
- *
186
- * @public
187
- */
188
- setPositioning() {
189
- const currentBox = this.getBoundingClientRect();
190
- const viewportHeight = window.innerHeight;
191
- const availableBottom = viewportHeight - currentBox.bottom;
192
- this.position = this.forcedPosition
193
- ? this.positionAttribute
194
- : currentBox.top > availableBottom
195
- ? SelectPosition.above
196
- : SelectPosition.below;
197
- this.positionAttribute = this.forcedPosition
198
- ? this.positionAttribute
199
- : this.position;
200
- this.maxHeight =
201
- this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
202
- }
203
- /**
204
- * The value displayed on the button.
205
- *
206
- * @public
207
- */
208
- get displayValue() {
209
- var _a, _b;
210
- Observable.track(this, "displayValue");
211
- return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
212
- }
213
- /**
214
- * Synchronize the `aria-disabled` property when the `disabled` property changes.
215
- *
216
- * @param prev - The previous disabled value
217
- * @param next - The next disabled value
218
- *
219
- * @internal
220
- */
221
- disabledChanged(prev, next) {
222
- if (super.disabledChanged) {
223
- super.disabledChanged(prev, next);
224
- }
225
- this.ariaDisabled = this.disabled ? "true" : "false";
226
- }
227
- /**
228
- * Reset the element to its first selectable option when its parent form is reset.
229
- *
230
- * @internal
231
- */
232
- formResetCallback() {
233
- this.setProxyOptions();
234
- // Call the base class's implementation setDefaultSelectedOption instead of the select's
235
- // override, in order to reset the selectedIndex without using the value property.
236
- super.setDefaultSelectedOption();
237
- if (this.selectedIndex === -1) {
238
- this.selectedIndex = 0;
239
- }
240
- }
241
- /**
242
- * Handle opening and closing the listbox when the select is clicked.
243
- *
244
- * @param e - the mouse event
245
- * @internal
246
- */
247
- clickHandler(e) {
248
- // do nothing if the select is disabled
249
- if (this.disabled) {
250
- return;
251
- }
252
- if (this.open) {
253
- const captured = e.target.closest(`option,[role=option]`);
254
- if (captured && captured.disabled) {
255
- return;
256
- }
257
- }
258
- super.clickHandler(e);
259
- this.open = this.collapsible && !this.open;
260
- if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
261
- this.updateValue(true);
262
- }
263
- return true;
264
- }
265
- /**
266
- * Handles focus state when the element or its children lose focus.
267
- *
268
- * @param e - The focus event
269
- * @internal
270
- */
271
- focusoutHandler(e) {
272
- var _a;
273
- super.focusoutHandler(e);
274
- if (!this.open) {
275
- return true;
276
- }
277
- const focusTarget = e.relatedTarget;
278
- if (this.isSameNode(focusTarget)) {
279
- this.focus();
280
- return;
281
- }
282
- if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
283
- this.open = false;
284
- if (this.indexWhenOpened !== this.selectedIndex) {
285
- this.updateValue(true);
286
- }
287
- }
288
- }
289
- /**
290
- * Updates the value when an option's value changes.
291
- *
292
- * @param source - the source object
293
- * @param propertyName - the property to evaluate
294
- *
295
- * @internal
296
- * @override
297
- */
298
- handleChange(source, propertyName) {
299
- super.handleChange(source, propertyName);
300
- if (propertyName === "value") {
301
- this.updateValue();
302
- }
303
- }
304
- /**
305
- * Synchronize the form-associated proxy and updates the value property of the element.
306
- *
307
- * @param prev - the previous collection of slotted option elements
308
- * @param next - the next collection of slotted option elements
309
- *
310
- * @internal
311
- */
312
- slottedOptionsChanged(prev, next) {
313
- this.options.forEach(o => {
314
- const notifier = Observable.getNotifier(o);
315
- notifier.unsubscribe(this, "value");
316
- });
317
- super.slottedOptionsChanged(prev, next);
318
- this.options.forEach(o => {
319
- const notifier = Observable.getNotifier(o);
320
- notifier.subscribe(this, "value");
321
- });
322
- this.setProxyOptions();
323
- this.updateValue();
324
- }
325
- /**
326
- * Prevents focus when size is set and a scrollbar is clicked.
327
- *
328
- * @param e - the mouse event object
329
- *
330
- * @override
331
- * @internal
332
- */
333
- mousedownHandler(e) {
334
- var _a;
335
- if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
336
- return super.mousedownHandler(e);
337
- }
338
- return this.collapsible;
339
- }
340
- /**
341
- * Sets the multiple property on the proxy element.
342
- *
343
- * @param prev - the previous multiple value
344
- * @param next - the current multiple value
345
- */
346
- multipleChanged(prev, next) {
347
- super.multipleChanged(prev, next);
348
- if (this.proxy) {
349
- this.proxy.multiple = next;
350
- }
351
- }
352
- /**
353
- * Updates the selectedness of each option when the list of selected options changes.
354
- *
355
- * @param prev - the previous list of selected options
356
- * @param next - the current list of selected options
357
- *
358
- * @override
359
- * @internal
360
- */
361
- selectedOptionsChanged(prev, next) {
362
- var _a;
363
- super.selectedOptionsChanged(prev, next);
364
- (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
365
- var _a;
366
- const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
367
- if (proxyOption) {
368
- proxyOption.selected = o.selected;
369
- }
370
- });
371
- }
372
- /**
373
- * Sets the selected index to match the first option with the selected attribute, or
374
- * the first selectable option.
375
- *
376
- * @override
377
- * @internal
378
- */
379
- setDefaultSelectedOption() {
380
- var _a;
381
- const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
382
- const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
383
- if (selectedIndex !== -1) {
384
- this.selectedIndex = selectedIndex;
385
- return;
386
- }
387
- this.selectedIndex = 0;
388
- }
389
- /**
390
- * Resets and fills the proxy to match the component's options.
391
- *
392
- * @internal
393
- */
394
- setProxyOptions() {
395
- if (this.proxy instanceof HTMLSelectElement && this.options) {
396
- this.proxy.options.length = 0;
397
- this.options.forEach(option => {
398
- const proxyOption = option.proxy ||
399
- (option instanceof HTMLOptionElement ? option.cloneNode() : null);
400
- if (proxyOption) {
401
- this.proxy.options.add(proxyOption);
402
- }
403
- });
404
- }
405
- }
406
- /**
407
- * Handle keyboard interaction for the select.
408
- *
409
- * @param e - the keyboard event
410
- * @internal
411
- */
412
- keydownHandler(e) {
413
- super.keydownHandler(e);
414
- const key = e.key || e.key.charCodeAt(0);
415
- switch (key) {
416
- case keySpace: {
417
- e.preventDefault();
418
- if (this.collapsible && this.typeAheadExpired) {
419
- this.open = !this.open;
420
- }
421
- break;
422
- }
423
- case keyHome:
424
- case keyEnd: {
425
- e.preventDefault();
426
- break;
427
- }
428
- case keyEnter: {
429
- e.preventDefault();
430
- this.open = !this.open;
431
- break;
432
- }
433
- case keyEscape: {
434
- if (this.collapsible && this.open) {
435
- e.preventDefault();
436
- this.open = false;
437
- }
438
- break;
439
- }
440
- case keyTab: {
441
- if (this.collapsible && this.open) {
442
- e.preventDefault();
443
- this.open = false;
444
- }
445
- return true;
446
- }
447
- }
448
- if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
449
- this.updateValue(true);
450
- this.indexWhenOpened = this.selectedIndex;
451
- }
452
- return !(key === keyArrowDown || key === keyArrowUp);
453
- }
454
- connectedCallback() {
455
- super.connectedCallback();
456
- this.forcedPosition = !!this.positionAttribute;
457
- this.addEventListener("contentchange", this.updateDisplayValue);
458
- }
459
- disconnectedCallback() {
460
- this.removeEventListener("contentchange", this.updateDisplayValue);
461
- super.disconnectedCallback();
462
- }
463
- /**
464
- * Updates the proxy's size property when the size attribute changes.
465
- *
466
- * @param prev - the previous size
467
- * @param next - the current size
468
- *
469
- * @override
470
- * @internal
471
- */
472
- sizeChanged(prev, next) {
473
- super.sizeChanged(prev, next);
474
- if (this.proxy) {
475
- this.proxy.size = next;
476
- }
477
- }
478
- /**
479
- *
480
- * @internal
481
- */
482
- updateDisplayValue() {
483
- if (this.collapsible) {
484
- Observable.notify(this, "displayValue");
485
- }
486
- }
487
- };
488
- __decorate([
489
- attr({ attribute: "open", mode: "boolean" })
490
- ], Select$1.prototype, "open", void 0);
491
- __decorate([
492
- volatile
493
- ], Select$1.prototype, "collapsible", null);
494
- __decorate([
495
- observable
496
- ], Select$1.prototype, "control", void 0);
497
- __decorate([
498
- attr({ attribute: "position" })
499
- ], Select$1.prototype, "positionAttribute", void 0);
500
- __decorate([
501
- observable
502
- ], Select$1.prototype, "position", void 0);
503
- __decorate([
504
- observable
505
- ], Select$1.prototype, "maxHeight", void 0);
506
- /**
507
- * Includes ARIA states and properties relating to the ARIA select role.
508
- *
509
- * @public
510
- */
511
- class DelegatesARIASelect {
512
- }
513
- __decorate([
514
- observable
515
- ], DelegatesARIASelect.prototype, "ariaControls", void 0);
516
- applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
517
- applyMixins(Select$1, StartEnd, DelegatesARIASelect);
518
-
519
- const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-flex;flex-direction:column;gap:4px;--_low-ink-color: var(--vvd-color-neutral-600);--focus-stroke-gap-color: transparent}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);contain:inline-size;font:var(--vvd-typography-base)}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.control.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.control:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.control:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.control:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.control:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-select-accent-fierce, var(--vvd-color-neutral-700))}.control{border-radius:var(--_select-control-border-radius);block-size:var(--_select-block-size);padding-inline:var(--_select-padding-inline)}.control{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_select-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;transition:box-shadow .2s,background-color .2s}.control.size-condensed{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_select-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) }.control-wrapper{position:relative}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.control:not(.shape-pill){--_select-control-border-radius: 8px}.control.shape-pill{--_select-control-border-radius: 24px}:host(:focus-visible) .control{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.listbox{display:flex;max-height:var(--select-height, 408px);flex-direction:column;padding:4px;gap:2px;overflow-y:auto}:host([multiple]:focus-visible) .listbox{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));border-radius:8px}.selected-value{display:flex;overflow:hidden;flex-grow:1;align-items:center;column-gap:12px;white-space:nowrap}.selected-value .text{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis}.control.shows-placeholder .selected-value .text{color:var(--vvd-color-neutral-600)}.selected-value slot[name=icon]{flex:0 0 var(--_select-icon-size);font-size:var(--_select-icon-size);line-height:1}.control.has-meta .selected-value{padding-inline-end:8px}.feedback-wrapper{display:contents}::part(popup-base){inline-size:max-content;min-inline-size:var(--_select-fixed-width, 100%)}:host([multiple]) ::part(popup-base){position:static}";
8
+ const styles = ":host{display:flex}.base.connotation-cta{--_connotation-color-firm-all: var(--vvd-selectable-box-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-pale: var(--vvd-selectable-box-cta-pale, var(--vvd-color-cta-300));--_connotation-color-fierce: var(--vvd-selectable-box-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-faint: var(--vvd-selectable-box-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-selectable-box-cta-soft, var(--vvd-color-cta-100))}.base:not(.connotation-cta){--_connotation-color-firm-all: var(--vvd-selectable-box-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-pale: var(--vvd-selectable-box-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-selectable-box-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-selectable-box-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-selectable-box-accent-soft, var(--vvd-color-neutral-100))}.base{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-firm-all)}.base{position:relative;padding:var(--selectable-box-spacing, 16px);border:1px solid var(--_appearance-color-outline);border-radius:8px;background-color:var(--_appearance-color-fill);inline-size:100%;padding-block-start:calc(var(--selectable-box-spacing, 16px) + 36px);text-align:start}.base:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.base.tight{overflow:hidden;min-height:calc(var(--selectable-box-spacing, 16px) * 2 + 22px);padding:0}.base.clickable{cursor:pointer}.control{position:absolute;inset-block-start:var(--selectable-box-spacing, 16px);inset-inline-end:var(--selectable-box-spacing, 16px)}";
520
9
 
521
10
  var __defProp = Object.defineProperty;
522
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
523
11
  var __decorateClass = (decorators, target, key, kind) => {
524
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
12
+ var result = void 0 ;
525
13
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
526
14
  if (decorator = decorators[i])
527
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
528
- if (kind && result) __defProp(target, key, result);
15
+ result = (decorator(target, key, result) ) || result;
16
+ if (result) __defProp(target, key, result);
529
17
  return result;
530
18
  };
531
- let Select = class extends Select$1 {
19
+ class SelectableBox extends VividElement {
532
20
  constructor() {
533
21
  super(...arguments);
534
- this.fixedDropdown = false;
535
- this.placeholderOption = null;
536
- this._feedbackWrapper = null;
537
- }
538
- labelChanged() {
539
- if (!this.ariaLabel) {
540
- this.ariaLabel = this.label;
541
- }
542
- }
543
- connectedCallback() {
544
- super.connectedCallback();
545
- }
546
- get displayValue() {
547
- Observable.track(this, "displayValue");
548
- return this.firstSelectedOption?.getAttribute("label") ?? this.firstSelectedOption?.text ?? this.placeholder ?? "";
549
- }
550
- setDefaultSelectedOption() {
551
- const options = Array.from(this.children).filter(
552
- Listbox$1.slottedOptionFilter
553
- );
554
- const selectedIndex = options.findIndex(
555
- (el) => el.hasAttribute("selected") || el.selected || el.value === this.value
556
- );
557
- if (selectedIndex === -1 && !this.placeholderOption) {
558
- this.selectedIndex = 0;
559
- return;
560
- }
561
- if (selectedIndex !== -1 || this.placeholder !== "") {
562
- this.selectedIndex = selectedIndex;
563
- return;
564
- }
22
+ this.ariaLabel = null;
23
+ this.checked = false;
24
+ this.clickable = false;
25
+ this.clickableBox = false;
26
+ this.tight = false;
565
27
  }
566
- /*
28
+ /**
567
29
  * @internal
568
30
  */
569
- slottedOptionsChanged(prev, next) {
570
- super.slottedOptionsChanged(prev, next);
571
- const scale = this.getAttribute("scale") || this.scale;
572
- next.forEach((element) => {
573
- if (scale) {
574
- element.setAttribute("scale", scale);
575
- element.scale = scale;
576
- }
577
- });
578
- this.proxy.value = this.value;
579
- this.validate();
31
+ _handleCheckedChange() {
32
+ if (this.controlType === "radio" && this.checked) return;
33
+ this.checked = !this.checked;
34
+ if (this.clickableBox || this.clickable) this.$emit("change");
580
35
  }
581
- formResetCallback() {
582
- super.formResetCallback();
583
- if (this.placeholder) {
584
- this.selectedIndex = -1;
585
- }
36
+ /**
37
+ * @internal
38
+ */
39
+ _handleKeydown(event) {
40
+ if ((event.code === "Space" || event.code === "Enter") && (this.clickableBox || this.clickable))
41
+ return this._handleCheckedChange();
42
+ return true;
586
43
  }
587
- };
588
- __decorateClass([
589
- observable
590
- ], Select.prototype, "_anchor", 2);
44
+ }
591
45
  __decorateClass([
592
- attr()
593
- ], Select.prototype, "scale", 2);
46
+ attr({ attribute: "aria-label" })
47
+ ], SelectableBox.prototype, "ariaLabel");
594
48
  __decorateClass([
595
- attr
596
- ], Select.prototype, "appearance", 2);
49
+ attr({ mode: "boolean" })
50
+ ], SelectableBox.prototype, "checked");
597
51
  __decorateClass([
598
- attr
599
- ], Select.prototype, "shape", 2);
52
+ attr({ mode: "boolean" })
53
+ ], SelectableBox.prototype, "clickable");
600
54
  __decorateClass([
601
- attr({ mode: "boolean", attribute: "fixed-dropdown" })
602
- ], Select.prototype, "fixedDropdown", 2);
55
+ attr({ attribute: "clickable-box", mode: "boolean" })
56
+ ], SelectableBox.prototype, "clickableBox");
603
57
  __decorateClass([
604
58
  attr
605
- ], Select.prototype, "placeholder", 2);
606
- __decorateClass([
607
- observable
608
- ], Select.prototype, "placeholderOption", 2);
59
+ ], SelectableBox.prototype, "connotation");
609
60
  __decorateClass([
610
- observable
611
- ], Select.prototype, "_feedbackWrapper", 2);
61
+ attr({ attribute: "control-type" })
62
+ ], SelectableBox.prototype, "controlType");
612
63
  __decorateClass([
613
- observable
614
- ], Select.prototype, "metaSlottedContent", 2);
615
- Select = __decorateClass([
616
- errorText,
617
- formElements
618
- ], Select);
619
- applyMixinsWithObservables(
620
- Select,
621
- AffixIconWithTrailing,
622
- FormElementHelperText,
623
- FormElementSuccessText
624
- );
64
+ attr({ mode: "boolean" })
65
+ ], SelectableBox.prototype, "tight");
625
66
 
626
- const getStateClasses = ({
627
- shape,
628
- disabled,
629
- appearance,
630
- metaSlottedContent,
631
- errorValidationMessage,
632
- successText,
633
- placeholder,
634
- value,
635
- scale
67
+ const getClasses = ({
68
+ connotation,
69
+ tight,
70
+ checked,
71
+ clickableBox,
72
+ clickable
636
73
  }) => classNames(
637
- ["disabled", disabled],
638
- [`appearance-${appearance}`, Boolean(appearance)],
639
- [`shape-${shape}`, Boolean(shape)],
640
- ["has-meta", Boolean(metaSlottedContent?.length)],
641
- ["error", Boolean(errorValidationMessage)],
642
- ["success", !!successText],
643
- ["has-meta", Boolean(metaSlottedContent?.length)],
644
- ["shows-placeholder", Boolean(placeholder) && !value],
645
- [`size-${scale}`, Boolean(scale)]
74
+ "base",
75
+ [`connotation-${connotation}`, Boolean(connotation)],
76
+ ["tight", tight],
77
+ ["selected", checked],
78
+ ["clickable", clickableBox || clickable],
79
+ ["readonly", !clickableBox && !clickable]
646
80
  );
647
- function renderLabel() {
648
- return html` <label for="control" class="label" id="label">
649
- ${(x) => x.label}
650
- </label>`;
651
- }
652
- function renderPlaceholder(context) {
653
- const optionTag = context.tagFor(ListboxOption);
654
- return html`
655
- <${optionTag} ${ref("placeholderOption")}
656
- text="${(x) => x.placeholder}" hidden disabled>
657
- </${optionTag}>`;
658
- }
659
- function selectValue(context) {
660
- const affixIconTemplate = affixIconTemplateFactory(context);
661
- const chevronTemplate = chevronTemplateFactory(context);
662
- return html` <div
663
- class="control ${getStateClasses}"
664
- ${ref("_anchor")}
665
- id="control"
666
- ?disabled="${(x) => x.disabled}"
667
- >
668
- <div class="selected-value">
669
- ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
670
- <span class="text">${(x) => x.displayValue}</span>
671
- <slot name="meta" ${slotted("metaSlottedContent")}></slot>
672
- </div>
673
- ${chevronTemplate}
674
- </div>`;
81
+ function handleControlChange(x) {
82
+ if (!x.clickableBox) x._handleCheckedChange();
675
83
  }
676
- function setFixedDropdownVarWidth(x) {
677
- return x.open && x.fixedDropdown ? `--_select-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
84
+ function checkbox(context) {
85
+ const checkboxTag = context.tagFor(Checkbox);
86
+ return html`${when(
87
+ (x) => x.controlType !== "radio",
88
+ html`
89
+ <${checkboxTag}
90
+ aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
91
+ @change="${(x) => handleControlChange(x)}"
92
+ class="control checkbox"
93
+ connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
94
+ :checked="${(x) => x.checked}"
95
+ inert="${(x) => x.clickableBox || x.clickable ? true : null}"
96
+ ></${checkboxTag}>`
97
+ )} `;
678
98
  }
679
- function renderControl(context) {
680
- const popupTag = context.tagFor(Popup);
681
- return html`
682
- ${when((x) => x.label, renderLabel())}
683
- <div class="control-wrapper">
684
- ${when((x) => !x.multiple, selectValue(context))}
685
- <${popupTag} class="popup"
686
- style="${setFixedDropdownVarWidth}"
687
- ?open="${(x) => x.collapsible ? x.open : true}"
688
- :anchor="${(x) => x._anchor}"
689
- placement="bottom-start"
690
- strategy="${(x) => x.fixedDropdown ? null : "absolute"}">
691
- <div class="listbox"
692
- id="${(x) => x.listboxId}"
693
- role="listbox"
694
- ?disabled="${(x) => x.disabled}"
695
- ?hidden="${(x) => x.collapsible ? !x.open : false}"
696
- ${ref("listbox")}>
697
- ${when((x) => x.placeholder, renderPlaceholder(context))}
698
- <slot
699
- ${slotted({
700
- filter: Listbox$1.slottedOptionFilter,
701
- flatten: true,
702
- property: "slottedOptions"
703
- })}>
704
- </slot>
705
- </div>
706
- </${popupTag}>
707
- </div>
708
- `;
99
+ function radio(context) {
100
+ const radioTag = context.tagFor(Radio);
101
+ return html`${when(
102
+ (x) => x.controlType === "radio",
103
+ html`
104
+ <${radioTag}
105
+ aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
106
+ @change="${(x) => handleControlChange(x)}"
107
+ class="control radio"
108
+ connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
109
+ :checked="${(x) => x.checked}"
110
+ inert="${(x) => x.clickableBox || x.clickable ? true : null}"
111
+ ></${radioTag}>`
112
+ )} `;
709
113
  }
710
- function ifNotFromFeedback(handler) {
711
- return (x, c) => {
712
- if (!c.event.composedPath().includes(x._feedbackWrapper)) {
713
- return handler(x, c.event);
714
- }
715
- return true;
716
- };
717
- }
718
- const SelectTemplate = (context) => {
719
- return html`
720
- <template
721
- class="base"
722
- aria-label="${(x) => x.ariaLabel}"
723
- aria-activedescendant="${(x) => x.ariaActiveDescendant}"
724
- aria-controls="${(x) => x.ariaControls}"
725
- aria-disabled="${(x) => x.ariaDisabled}"
726
- aria-expanded="${(x) => x.ariaExpanded}"
727
- aria-haspopup="${(x) => x.collapsible ? "listbox" : null}"
728
- aria-multiselectable="${(x) => x.ariaMultiSelectable}"
729
- role="combobox"
730
- tabindex="${(x) => !x.disabled ? "0" : null}"
731
- @click="${ifNotFromFeedback((x, e) => x.clickHandler(e))}"
732
- @focusin="${ifNotFromFeedback((x, e) => x.focusinHandler(e))}"
733
- @focusout="${ifNotFromFeedback(
734
- (x, e) => x.focusoutHandler(e)
735
- )}"
736
- @keydown="${ifNotFromFeedback((x, e) => {
737
- x.open && handleEscapeKeyAndStopPropogation(e);
738
- return x.keydownHandler(e);
739
- })}"
740
- @mousedown="${ifNotFromFeedback(
741
- (x, e) => x.mousedownHandler(e)
742
- )}"
114
+ const SelectableBoxTemplate = (context) => {
115
+ return html`<template role="presentation">
116
+ <div
117
+ class="${getClasses}"
118
+ tabindex="${(x) => x.clickableBox || x.clickable ? "0" : null}"
119
+ role="${(x) => x.clickableBox || x.clickable ? "button" : null}"
120
+ aria-pressed="${(x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null}"
121
+ aria-label="${(x) => x.clickableBox || x.clickable ? x.ariaLabel : null}"
122
+ @keydown="${(x, c) => x._handleKeydown(c.event)}"
123
+ @click="${(x) => x.clickableBox || x.clickable ? x._handleCheckedChange() : null}"
743
124
  >
744
- ${renderControl(context)}
745
- <div class="feedback-wrapper" ${ref("_feedbackWrapper")}>
746
- ${getFeedbackTemplate(context)}
747
- </div>
748
- </template>
749
- `;
125
+ ${checkbox(context)} ${radio(context)}
126
+ <slot></slot>
127
+ </div>
128
+ </template>`;
750
129
  };
751
130
 
752
- const selectDefinition = Select.compose({
753
- baseName: "select",
754
- template: SelectTemplate,
755
- styles
756
- });
757
- const selectRegistries = [
758
- selectDefinition(),
759
- ...popupRegistries,
760
- ...iconRegistries,
761
- ...listboxOptionRegistries
762
- ];
763
- const registerSelect = registerFactory(selectRegistries);
131
+ const selectableBoxDefinition = defineVividComponent(
132
+ "selectable-box",
133
+ SelectableBox,
134
+ SelectableBoxTemplate,
135
+ [checkboxDefinition, radioDefinition],
136
+ {
137
+ styles,
138
+ shadowOptions: {
139
+ delegatesFocus: true
140
+ }
141
+ }
142
+ );
143
+ const registerSelectableBox = createRegisterFunction(
144
+ selectableBoxDefinition
145
+ );
764
146
 
765
- export { selectRegistries as a, registerSelect as r, selectDefinition as s };
147
+ export { registerSelectableBox as r, selectableBoxDefinition as s };