@vonage/vivid 5.23.1-preview.0 → 5.24.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 (746) hide show
  1. package/accordion/index.cjs +1 -1
  2. package/accordion/index.js +1 -1
  3. package/accordion-item/index.cjs +1 -1
  4. package/accordion-item/index.js +1 -1
  5. package/action-group/index.cjs +1 -1
  6. package/action-group/index.js +1 -1
  7. package/alert/definition.cjs +1 -1
  8. package/alert/definition.js +1 -1
  9. package/alert/index.cjs +7 -7
  10. package/alert/index.js +13 -14
  11. package/audio-player/definition.cjs +1 -1
  12. package/audio-player/definition.js +1 -1
  13. package/audio-player/index.cjs +19 -17
  14. package/audio-player/index.js +24 -22
  15. package/avatar/definition.cjs +1 -1
  16. package/avatar/definition.js +1 -1
  17. package/avatar/index.cjs +4 -4
  18. package/avatar/index.js +6 -6
  19. package/badge/definition.cjs +1 -1
  20. package/badge/definition.js +1 -1
  21. package/badge/index.cjs +1 -1
  22. package/badge/index.js +1 -1
  23. package/banner/definition.cjs +1 -1
  24. package/banner/definition.js +1 -1
  25. package/banner/index.cjs +3 -3
  26. package/banner/index.js +8 -8
  27. package/breadcrumb/definition.cjs +1 -1
  28. package/breadcrumb/definition.js +1 -1
  29. package/breadcrumb-item/definition.cjs +1 -1
  30. package/breadcrumb-item/definition.js +1 -1
  31. package/breadcrumb-item/index.cjs +2 -2
  32. package/breadcrumb-item/index.js +5 -5
  33. package/bundled/affix.cjs +1 -1
  34. package/bundled/affix.js +1 -1
  35. package/bundled/base-color-picker.cjs +2 -2
  36. package/bundled/base-color-picker.js +5 -5
  37. package/bundled/calendar-picker.template.cjs +1 -1
  38. package/bundled/calendar-picker.template.js +1 -1
  39. package/bundled/definition11.cjs +4 -4
  40. package/bundled/definition11.js +5 -5
  41. package/bundled/definition12.cjs +9 -7
  42. package/bundled/definition12.js +28 -26
  43. package/bundled/definition13.cjs +9 -7
  44. package/bundled/definition13.js +16 -15
  45. package/bundled/definition15.cjs +8 -7
  46. package/bundled/definition15.js +26 -24
  47. package/bundled/definition16.cjs +4 -2
  48. package/bundled/definition16.js +8 -6
  49. package/bundled/definition17.cjs +8 -6
  50. package/bundled/definition17.js +15 -14
  51. package/bundled/definition18.cjs +12 -83
  52. package/bundled/definition18.js +35 -420
  53. package/bundled/definition19.cjs +87 -5
  54. package/bundled/definition19.js +432 -14
  55. package/bundled/definition2.cjs +1 -13
  56. package/bundled/definition2.js +181 -48
  57. package/bundled/definition20.cjs +7 -35
  58. package/bundled/definition20.js +17 -170
  59. package/bundled/definition21.cjs +35 -27
  60. package/bundled/definition21.js +154 -155
  61. package/bundled/definition22.cjs +29 -4
  62. package/bundled/definition22.js +171 -17
  63. package/bundled/definition23.cjs +6 -12
  64. package/bundled/definition23.js +17 -32
  65. package/bundled/definition24.cjs +12 -39
  66. package/bundled/definition24.js +32 -67
  67. package/bundled/definition25.cjs +44 -0
  68. package/bundled/definition25.js +77 -0
  69. package/bundled/definition3.cjs +13 -1
  70. package/bundled/definition3.js +48 -181
  71. package/bundled/definition4.cjs +9 -7
  72. package/bundled/definition4.js +18 -16
  73. package/bundled/definition5.cjs +5 -5
  74. package/bundled/definition5.js +9 -9
  75. package/bundled/definition6.cjs +3 -3
  76. package/bundled/definition6.js +16 -16
  77. package/bundled/definition7.cjs +1 -1
  78. package/bundled/definition7.js +1 -1
  79. package/bundled/definition8.cjs +7 -7
  80. package/bundled/definition8.js +9 -7
  81. package/bundled/definition9.cjs +4 -4
  82. package/bundled/definition9.js +12 -12
  83. package/bundled/extractOptions.cjs +1 -0
  84. package/bundled/extractOptions.js +11 -0
  85. package/bundled/listbox.cjs +1 -1
  86. package/bundled/listbox.js +24 -11
  87. package/bundled/mixins.cjs +3 -3
  88. package/bundled/mixins.js +5 -5
  89. package/bundled/numberConverter.cjs +1 -1
  90. package/bundled/numberConverter.js +36 -1
  91. package/bundled/picker-field.template.cjs +13 -13
  92. package/bundled/picker-field.template.js +16 -16
  93. package/bundled/render-in-light-dom.cjs +1 -1
  94. package/bundled/render-in-light-dom.js +16 -19
  95. package/bundled/slider.template.cjs +8 -8
  96. package/bundled/slider.template.js +9 -9
  97. package/bundled/text-field.cjs +1 -1
  98. package/bundled/text-field.js +1 -1
  99. package/bundled/time-selection-picker.template.cjs +3 -3
  100. package/bundled/time-selection-picker.template.js +9 -9
  101. package/bundled/vivid-element.cjs +1 -1
  102. package/bundled/vivid-element.js +9 -1
  103. package/button/definition.cjs +1 -1
  104. package/button/definition.js +1 -1
  105. package/calendar/definition.cjs +1 -1
  106. package/calendar/definition.js +1 -1
  107. package/calendar/index.cjs +9 -9
  108. package/calendar/index.js +7 -7
  109. package/calendar-event/definition.cjs +1 -1
  110. package/calendar-event/definition.js +1 -1
  111. package/calendar-event/index.cjs +2 -2
  112. package/calendar-event/index.js +2 -2
  113. package/card/definition.cjs +1 -1
  114. package/card/definition.js +1 -1
  115. package/card/index.cjs +3 -3
  116. package/card/index.js +6 -6
  117. package/color-picker/index.cjs +10 -10
  118. package/color-picker/index.js +52 -52
  119. package/combobox/definition.cjs +1 -1
  120. package/combobox/definition.js +1 -1
  121. package/combobox/index.cjs +11 -8
  122. package/combobox/index.js +59 -49
  123. package/country/definition.cjs +1 -1
  124. package/country/definition.js +1 -1
  125. package/country/index.cjs +1 -1
  126. package/country/index.js +1 -1
  127. package/country-group/definition.cjs +1 -1
  128. package/country-group/definition.js +1 -1
  129. package/country-group/index.cjs +1 -1
  130. package/country-group/index.js +2 -2
  131. package/custom-elements.json +837 -1225
  132. package/data-grid/definition.cjs +1 -1
  133. package/data-grid/definition.js +1 -1
  134. package/data-grid/index.cjs +8 -6
  135. package/data-grid/index.js +22 -20
  136. package/date-picker/definition.cjs +1 -1
  137. package/date-picker/definition.js +1 -1
  138. package/date-picker/index.cjs +1 -1
  139. package/date-picker/index.js +1 -1
  140. package/date-range-picker/definition.cjs +1 -1
  141. package/date-range-picker/definition.js +1 -1
  142. package/date-range-picker/index.cjs +1 -1
  143. package/date-range-picker/index.js +1 -1
  144. package/date-time-picker/definition.cjs +1 -1
  145. package/date-time-picker/definition.js +1 -1
  146. package/date-time-picker/index.cjs +1 -1
  147. package/date-time-picker/index.js +1 -1
  148. package/dial-pad/definition.cjs +1 -1
  149. package/dial-pad/definition.js +1 -1
  150. package/dial-pad/index.cjs +25 -23
  151. package/dial-pad/index.js +127 -56
  152. package/dialog/definition.cjs +1 -1
  153. package/dialog/definition.js +1 -1
  154. package/dialog/index.cjs +14 -14
  155. package/dialog/index.js +17 -18
  156. package/divider/definition.cjs +1 -1
  157. package/divider/definition.js +1 -1
  158. package/divider/index.cjs +1 -1
  159. package/divider/index.js +1 -1
  160. package/elevation/definition.cjs +1 -1
  161. package/elevation/definition.js +1 -1
  162. package/empty-state/definition.cjs +1 -1
  163. package/empty-state/definition.js +1 -1
  164. package/empty-state/index.cjs +4 -4
  165. package/empty-state/index.js +7 -11
  166. package/fab/definition.cjs +1 -1
  167. package/fab/definition.js +1 -1
  168. package/fab/index.cjs +4 -4
  169. package/fab/index.js +9 -13
  170. package/file-picker/definition.cjs +1 -1
  171. package/file-picker/definition.js +1 -1
  172. package/file-picker/index.cjs +8 -8
  173. package/file-picker/index.js +19 -19
  174. package/flag/definition.cjs +1 -1
  175. package/flag/definition.js +1 -1
  176. package/flag/index.cjs +5 -5
  177. package/flag/index.js +8 -12
  178. package/header/definition.cjs +1 -1
  179. package/header/definition.js +1 -1
  180. package/header/index.cjs +7 -7
  181. package/header/index.js +6 -10
  182. package/icon/index.cjs +1 -1
  183. package/icon/index.js +1 -1
  184. package/index.cjs +214 -209
  185. package/index.js +67 -66
  186. package/kbd-key/definition.cjs +1 -1
  187. package/kbd-key/definition.js +1 -1
  188. package/kbd-key/index.cjs +3 -3
  189. package/kbd-key/index.js +2 -6
  190. package/kbd-shortcut/definition.cjs +1 -1
  191. package/kbd-shortcut/definition.js +1 -1
  192. package/layout/definition.cjs +1 -1
  193. package/layout/definition.js +1 -1
  194. package/layout/index.cjs +3 -1
  195. package/layout/index.js +3 -1
  196. package/lib/accordion/variations.browser-spec.d.ts +1 -0
  197. package/lib/accordion-item/accordion-item.d.ts +2 -1
  198. package/lib/accordion-item/variations.browser-spec.d.ts +1 -0
  199. package/lib/action-group/action-group.d.ts +1 -1
  200. package/lib/action-group/variations.browser-spec.d.ts +1 -0
  201. package/lib/alert/alert.d.ts +2 -2
  202. package/lib/alert/variations.browser-spec.d.ts +1 -0
  203. package/lib/audio-player/audio-player.d.ts +1 -1
  204. package/lib/audio-player/variations.browser-spec.d.ts +1 -0
  205. package/lib/avatar/avatar.d.ts +1 -1
  206. package/lib/avatar/variations.browser-spec.d.ts +1 -0
  207. package/lib/badge/badge.d.ts +5 -5
  208. package/lib/badge/badge.template.d.ts +1 -2
  209. package/lib/badge/variations.browser-spec.d.ts +1 -0
  210. package/lib/banner/banner.d.ts +3 -3
  211. package/lib/banner/variations.browser-spec.d.ts +1 -0
  212. package/lib/breadcrumb/breadcrumb.d.ts +1 -1
  213. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  214. package/lib/breadcrumb-item/variations.browser-spec.d.ts +1 -0
  215. package/lib/button/button.d.ts +3 -3
  216. package/lib/button/variations.browser-spec.d.ts +1 -0
  217. package/lib/calendar/variations.browser-spec.d.ts +1 -0
  218. package/lib/calendar-event/calendar-event.d.ts +1 -1
  219. package/lib/calendar-event/variations.browser-spec.d.ts +1 -0
  220. package/lib/card/card.d.ts +5 -5
  221. package/lib/card/variations.browser-spec.d.ts +1 -0
  222. package/lib/checkbox/checkbox.d.ts +6 -6
  223. package/lib/checkbox/variations.browser-spec.d.ts +1 -0
  224. package/lib/color-picker/color-picker.d.ts +8 -8
  225. package/lib/color-picker/variations.browser-spec.d.ts +1 -0
  226. package/lib/combobox/combobox.d.ts +7 -7
  227. package/lib/combobox/variations.browser-spec.d.ts +1 -0
  228. package/lib/components.d.ts +1 -0
  229. package/lib/contextual-help/variations.browser-spec.d.ts +1 -0
  230. package/lib/country/variations.browser-spec.d.ts +1 -0
  231. package/lib/country-group/country-group.d.ts +2 -2
  232. package/lib/data-grid/data-grid-cell.d.ts +4 -3
  233. package/lib/data-grid/data-grid-row.d.ts +3 -2
  234. package/lib/data-grid/data-grid.options.d.ts +5 -0
  235. package/lib/data-grid/variations.browser-spec.d.ts +1 -0
  236. package/lib/date-picker/date-picker.d.ts +8 -8
  237. package/lib/date-picker/variations.browser-spec.d.ts +1 -0
  238. package/lib/date-range-picker/date-range-picker.d.ts +4 -4
  239. package/lib/date-range-picker/variations.browser-spec.d.ts +1 -0
  240. package/lib/date-time-picker/date-time-picker.d.ts +8 -8
  241. package/lib/date-time-picker/variations.browser-spec.d.ts +1 -0
  242. package/lib/dial-pad/dial-pad.d.ts +2 -1
  243. package/lib/dial-pad/variations.browser-spec.d.ts +1 -0
  244. package/lib/dialog/dialog.d.ts +2 -2
  245. package/lib/dialog/variations.browser-spec.d.ts +1 -0
  246. package/lib/divider/divider.d.ts +1 -1
  247. package/lib/divider/variations.browser-spec.d.ts +1 -0
  248. package/lib/empty-state/variations.browser-spec.d.ts +1 -0
  249. package/lib/fab/fab.d.ts +6 -6
  250. package/lib/fab/variations.browser-spec.d.ts +1 -0
  251. package/lib/file-picker/file-picker.d.ts +7 -7
  252. package/lib/file-picker/variations.browser-spec.d.ts +1 -0
  253. package/lib/flag/variations.browser-spec.d.ts +1 -0
  254. package/lib/header/header.d.ts +1 -1
  255. package/lib/header/variations.browser-spec.d.ts +1 -0
  256. package/lib/icon/variations.browser-spec.d.ts +1 -0
  257. package/lib/kbd-key/variations.browser-spec.d.ts +1 -0
  258. package/lib/kbd-shortcut/variations.browser-spec.d.ts +1 -0
  259. package/lib/layout/variations.browser-spec.d.ts +1 -0
  260. package/lib/menu/menu.d.ts +2 -2
  261. package/lib/menu/variations.browser-spec.d.ts +1 -0
  262. package/lib/menu-item/menu-item.d.ts +3 -3
  263. package/lib/menu-item/variations.browser-spec.d.ts +1 -0
  264. package/lib/nav/nav.d.ts +1 -1
  265. package/lib/nav/variations.browser-spec.d.ts +1 -0
  266. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  267. package/lib/nav-disclosure/variations.browser-spec.d.ts +1 -0
  268. package/lib/nav-item/nav-item.d.ts +2 -2
  269. package/lib/nav-item/variations.browser-spec.d.ts +1 -0
  270. package/lib/note/note.d.ts +1 -1
  271. package/lib/note/variations.browser-spec.d.ts +1 -0
  272. package/lib/number-field/number-field.d.ts +9 -9
  273. package/lib/number-field/variations.browser-spec.d.ts +1 -0
  274. package/lib/optgroup/definition.d.ts +3 -0
  275. package/lib/optgroup/index.d.ts +1 -0
  276. package/lib/optgroup/optgroup.d.ts +430 -0
  277. package/lib/optgroup/optgroup.template.d.ts +2 -0
  278. package/lib/optgroup/variations.browser-spec.d.ts +1 -0
  279. package/lib/option/option.d.ts +2 -2
  280. package/lib/option/variations.browser-spec.d.ts +1 -0
  281. package/lib/pagination/pagination.d.ts +1 -1
  282. package/lib/pagination/variations.browser-spec.d.ts +1 -0
  283. package/lib/popover/popover.d.ts +2 -2
  284. package/lib/popover/variations.browser-spec.d.ts +1 -0
  285. package/lib/progress/progress.d.ts +1 -1
  286. package/lib/progress/variations.browser-spec.d.ts +1 -0
  287. package/lib/progress-ring/progress-ring.d.ts +1 -1
  288. package/lib/progress-ring/variations.browser-spec.d.ts +1 -0
  289. package/lib/radio/radio.d.ts +3 -3
  290. package/lib/radio/variations.browser-spec.d.ts +1 -0
  291. package/lib/radio-group/radio-group.d.ts +1 -1
  292. package/lib/radio-group/variations.browser-spec.d.ts +1 -0
  293. package/lib/range-slider/range-slider.d.ts +3 -3
  294. package/lib/range-slider/variations.browser-spec.d.ts +1 -0
  295. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
  296. package/lib/rich-text-editor/rte/features/internal/cursor-fix.d.ts +6 -1
  297. package/lib/rich-text-editor/variations.browser-spec.d.ts +1 -0
  298. package/lib/rich-text-view/variations.browser-spec.d.ts +1 -0
  299. package/lib/searchable-select/option-tag.d.ts +1 -1
  300. package/lib/searchable-select/searchable-select.d.ts +47 -47
  301. package/lib/searchable-select/variations.browser-spec.d.ts +1 -0
  302. package/lib/select/select.d.ts +9 -9
  303. package/lib/select/variations.browser-spec.d.ts +1 -0
  304. package/lib/selectable-box/selectable-box.d.ts +1 -1
  305. package/lib/selectable-box/variations.browser-spec.d.ts +1 -0
  306. package/lib/side-drawer/variations.browser-spec.d.ts +1 -0
  307. package/lib/simple-color-picker/simple-color-picker.d.ts +4 -4
  308. package/lib/simple-color-picker/variations.browser-spec.d.ts +1 -0
  309. package/lib/slider/slider.d.ts +3 -3
  310. package/lib/slider/variations.browser-spec.d.ts +1 -0
  311. package/lib/split-button/split-button.d.ts +3 -3
  312. package/lib/split-button/variations.browser-spec.d.ts +1 -0
  313. package/lib/status/status.d.ts +1 -1
  314. package/lib/status/variations.browser-spec.d.ts +1 -0
  315. package/lib/switch/switch.d.ts +2 -2
  316. package/lib/switch/variations.browser-spec.d.ts +1 -0
  317. package/lib/tab/tab.d.ts +15 -15
  318. package/lib/tab-panel/tab-panel.d.ts +1 -1
  319. package/lib/table/table-cell.d.ts +1 -1
  320. package/lib/table/table-header-cell.d.ts +1 -1
  321. package/lib/table/table-row.d.ts +1 -1
  322. package/lib/table/table-sorting-button.d.ts +1 -1
  323. package/lib/table/variations.browser-spec.d.ts +1 -0
  324. package/lib/tabs/variations.browser-spec.d.ts +1 -0
  325. package/lib/tag/tag.d.ts +15 -15
  326. package/lib/tag/variations.browser-spec.d.ts +1 -0
  327. package/lib/tag-group/tag-group.d.ts +1 -1
  328. package/lib/tag-name-map.d.ts +2 -1
  329. package/lib/text-area/text-area.d.ts +8 -8
  330. package/lib/text-area/text-area.template.d.ts +1 -2
  331. package/lib/text-area/variations.browser-spec.d.ts +1 -0
  332. package/lib/text-field/text-field.d.ts +9 -9
  333. package/lib/text-field/variations.browser-spec.d.ts +1 -0
  334. package/lib/time-picker/time-picker.d.ts +4 -4
  335. package/lib/time-picker/variations.browser-spec.d.ts +1 -0
  336. package/lib/toggletip/toggletip.d.ts +2 -2
  337. package/lib/toggletip/variations.browser-spec.d.ts +1 -0
  338. package/lib/tooltip/tooltip.d.ts +2 -2
  339. package/lib/tooltip/variations.browser-spec.d.ts +1 -0
  340. package/lib/tree-item/tree-item.d.ts +2 -2
  341. package/lib/tree-item/variations.browser-spec.d.ts +1 -0
  342. package/lib/tree-view/tree-view.d.ts +1 -1
  343. package/lib/video-player/variations.browser-spec.d.ts +1 -0
  344. package/lib/video-player/video-player.d.ts +1 -1
  345. package/menu/definition.cjs +1 -1
  346. package/menu/definition.js +1 -1
  347. package/menu/index.cjs +1 -1
  348. package/menu/index.js +1 -1
  349. package/menu-item/definition.cjs +1 -1
  350. package/menu-item/definition.js +1 -1
  351. package/menu-item/index.cjs +1 -1
  352. package/menu-item/index.js +1 -1
  353. package/nav/definition.cjs +1 -1
  354. package/nav/definition.js +1 -1
  355. package/nav-disclosure/definition.cjs +1 -1
  356. package/nav-disclosure/definition.js +1 -1
  357. package/nav-disclosure/index.cjs +6 -6
  358. package/nav-disclosure/index.js +11 -15
  359. package/nav-item/definition.cjs +1 -1
  360. package/nav-item/definition.js +1 -1
  361. package/nav-item/index.cjs +2 -2
  362. package/nav-item/index.js +11 -15
  363. package/note/definition.cjs +1 -1
  364. package/note/definition.js +1 -1
  365. package/note/index.cjs +5 -5
  366. package/note/index.js +10 -11
  367. package/number-field/definition.cjs +1 -1
  368. package/number-field/definition.js +1 -1
  369. package/number-field/index.cjs +12 -12
  370. package/number-field/index.js +35 -36
  371. package/optgroup/definition.cjs +5 -0
  372. package/optgroup/definition.js +2 -0
  373. package/optgroup/index.cjs +1 -0
  374. package/optgroup/index.js +4 -0
  375. package/package.json +15 -6
  376. package/pagination/definition.cjs +1 -1
  377. package/pagination/definition.js +1 -1
  378. package/platform-switch/definition.cjs +1 -1
  379. package/platform-switch/definition.js +1 -1
  380. package/popover/definition.cjs +1 -1
  381. package/popover/definition.js +1 -1
  382. package/popover/index.cjs +8 -8
  383. package/popover/index.js +11 -15
  384. package/popup/definition.cjs +1 -1
  385. package/popup/definition.js +1 -1
  386. package/progress/definition.cjs +1 -1
  387. package/progress/definition.js +1 -1
  388. package/progress/index.cjs +8 -8
  389. package/progress/index.js +9 -10
  390. package/radio/definition.cjs +1 -1
  391. package/radio/definition.js +1 -1
  392. package/radio-group/definition.cjs +1 -1
  393. package/radio-group/definition.js +1 -1
  394. package/range-slider/definition.cjs +1 -1
  395. package/range-slider/definition.js +1 -1
  396. package/range-slider/index.cjs +10 -8
  397. package/range-slider/index.js +26 -24
  398. package/rich-text-editor/definition.cjs +1 -1
  399. package/rich-text-editor/definition.js +1 -1
  400. package/rich-text-editor/index.cjs +3 -3
  401. package/rich-text-editor/index.js +762 -751
  402. package/rich-text-view/definition.cjs +1 -1
  403. package/rich-text-view/definition.js +1 -1
  404. package/searchable-select/definition.cjs +2 -1
  405. package/searchable-select/definition.js +2 -2
  406. package/searchable-select/index.cjs +30 -27
  407. package/searchable-select/index.js +104 -85
  408. package/select/definition.cjs +1 -1
  409. package/select/definition.js +1 -1
  410. package/select/index.cjs +1 -1
  411. package/select/index.js +1 -1
  412. package/selectable-box/definition.cjs +1 -1
  413. package/selectable-box/definition.js +1 -1
  414. package/selectable-box/index.cjs +8 -8
  415. package/selectable-box/index.js +8 -9
  416. package/shared/aria/delegates-aria.d.ts +1 -1
  417. package/shared/aria/host-semantics.d.ts +1 -1
  418. package/shared/color-picker/base-color-picker.d.ts +1 -1
  419. package/shared/feedback/feedback-message.d.ts +1 -1
  420. package/shared/feedback/mixins.d.ts +2 -2
  421. package/shared/foundation/button/button.d.ts +2 -2
  422. package/shared/foundation/form-associated/form-associated.d.ts +2 -2
  423. package/shared/foundation/listbox/extractOptions.d.ts +2 -0
  424. package/shared/foundation/listbox/listbox.d.ts +2 -0
  425. package/shared/patterns/affix.d.ts +2 -2
  426. package/shared/patterns/anchored.d.ts +2 -2
  427. package/shared/patterns/char-count/char-count.d.ts +1 -1
  428. package/shared/patterns/form-elements/form-element.d.ts +1 -1
  429. package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
  430. package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
  431. package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
  432. package/shared/patterns/kbd-shortcut.d.ts +1 -1
  433. package/shared/patterns/linkable.d.ts +1 -1
  434. package/shared/patterns/localized.d.ts +2 -2
  435. package/shared/patterns/trapped-focus.d.ts +1 -1
  436. package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
  437. package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
  438. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
  439. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
  440. package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
  441. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
  442. package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
  443. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
  444. package/shared/picker-field/picker-field.d.ts +7 -7
  445. package/side-drawer/definition.cjs +1 -1
  446. package/side-drawer/definition.js +1 -1
  447. package/side-drawer/index.cjs +3 -3
  448. package/side-drawer/index.js +3 -3
  449. package/simple-color-picker/definition.cjs +1 -1
  450. package/simple-color-picker/definition.js +1 -1
  451. package/simple-color-picker/index.cjs +4 -4
  452. package/simple-color-picker/index.js +6 -6
  453. package/slider/definition.cjs +1 -1
  454. package/slider/definition.js +1 -1
  455. package/slider/index.cjs +1 -1
  456. package/slider/index.js +1 -1
  457. package/split-button/definition.cjs +1 -1
  458. package/split-button/definition.js +1 -1
  459. package/split-button/index.cjs +5 -4
  460. package/split-button/index.js +10 -9
  461. package/status/definition.cjs +1 -1
  462. package/status/definition.js +1 -1
  463. package/status/index.cjs +7 -5
  464. package/status/index.js +14 -12
  465. package/styles/core/all.css +5 -7
  466. package/styles/core/theme.css +5 -7
  467. package/styles/core/typography.css +0 -3
  468. package/styles/tokens/vivid-2-compat.css +1 -6
  469. package/switch/definition.cjs +1 -1
  470. package/switch/definition.js +1 -1
  471. package/switch/index.cjs +5 -4
  472. package/switch/index.js +14 -12
  473. package/tab/definition.cjs +1 -1
  474. package/tab/definition.js +1 -1
  475. package/tab-panel/definition.cjs +1 -1
  476. package/tab-panel/definition.js +1 -1
  477. package/table/definition.cjs +1 -1
  478. package/table/definition.js +1 -1
  479. package/table/index.cjs +10 -10
  480. package/table/index.js +12 -12
  481. package/tabs/definition.cjs +1 -1
  482. package/tabs/definition.js +1 -1
  483. package/tabs/index.cjs +6 -4
  484. package/tabs/index.js +10 -9
  485. package/tag/definition.cjs +1 -1
  486. package/tag/definition.js +1 -1
  487. package/tag/index.cjs +6 -6
  488. package/tag/index.js +8 -8
  489. package/tag-group/definition.cjs +1 -1
  490. package/tag-group/definition.js +1 -1
  491. package/text-area/definition.cjs +1 -1
  492. package/text-area/definition.js +1 -1
  493. package/text-area/index.cjs +8 -6
  494. package/text-area/index.js +20 -19
  495. package/time-picker/definition.cjs +1 -1
  496. package/time-picker/definition.js +1 -1
  497. package/tree-item/definition.cjs +1 -1
  498. package/tree-item/definition.js +1 -1
  499. package/tree-view/definition.cjs +1 -1
  500. package/tree-view/definition.js +1 -1
  501. package/unbundled/affix.cjs +2 -7
  502. package/unbundled/affix.js +2 -7
  503. package/unbundled/anchored.cjs +2 -6
  504. package/unbundled/anchored.js +2 -6
  505. package/unbundled/aria-binding-directive.cjs +1 -3
  506. package/unbundled/aria-binding-directive.js +1 -3
  507. package/unbundled/base-color-picker.cjs +18 -52
  508. package/unbundled/base-color-picker.js +18 -52
  509. package/unbundled/base-progress.cjs +4 -14
  510. package/unbundled/base-progress.js +4 -14
  511. package/unbundled/button.cjs +2 -8
  512. package/unbundled/button.js +2 -8
  513. package/unbundled/calendar-picker.template.cjs +31 -85
  514. package/unbundled/calendar-picker.template.js +30 -84
  515. package/unbundled/char-count.cjs +2 -4
  516. package/unbundled/char-count.js +2 -4
  517. package/unbundled/data-grid.options.cjs +3 -19
  518. package/unbundled/data-grid.options.js +3 -19
  519. package/unbundled/definition.cjs +3 -8
  520. package/unbundled/definition.js +3 -8
  521. package/unbundled/definition10.cjs +316 -211
  522. package/unbundled/definition10.js +313 -202
  523. package/unbundled/definition11.cjs +262 -356
  524. package/unbundled/definition11.js +248 -354
  525. package/unbundled/definition12.cjs +243 -274
  526. package/unbundled/definition12.js +241 -260
  527. package/unbundled/definition13.cjs +341 -255
  528. package/unbundled/definition13.js +338 -252
  529. package/unbundled/definition14.cjs +61 -371
  530. package/unbundled/definition14.js +57 -367
  531. package/unbundled/definition15.cjs +32 -77
  532. package/unbundled/definition15.js +28 -73
  533. package/unbundled/definition16.cjs +120 -32
  534. package/unbundled/definition16.js +117 -29
  535. package/unbundled/definition17.cjs +24 -132
  536. package/unbundled/definition17.js +24 -126
  537. package/unbundled/definition18.cjs +74 -26
  538. package/unbundled/definition18.js +67 -25
  539. package/unbundled/definition19.cjs +33 -79
  540. package/unbundled/definition19.js +32 -73
  541. package/unbundled/definition2.cjs +11 -8
  542. package/unbundled/definition2.js +11 -8
  543. package/unbundled/definition20.cjs +272 -29
  544. package/unbundled/definition20.js +264 -27
  545. package/unbundled/definition21.cjs +135 -263
  546. package/unbundled/definition21.js +133 -260
  547. package/unbundled/definition22.cjs +17 -155
  548. package/unbundled/definition22.js +13 -151
  549. package/unbundled/definition23.cjs +9 -17
  550. package/unbundled/definition23.js +10 -18
  551. package/unbundled/definition24.cjs +4 -10
  552. package/unbundled/definition24.js +4 -10
  553. package/unbundled/definition25.cjs +2 -10
  554. package/unbundled/definition25.js +2 -10
  555. package/unbundled/definition26.cjs +28 -70
  556. package/unbundled/definition26.js +28 -70
  557. package/unbundled/definition27.cjs +6 -13
  558. package/unbundled/definition27.js +6 -13
  559. package/unbundled/definition28.cjs +30 -77
  560. package/unbundled/definition28.js +30 -77
  561. package/unbundled/definition29.cjs +7 -14
  562. package/unbundled/definition29.js +7 -14
  563. package/unbundled/definition3.cjs +5 -16
  564. package/unbundled/definition3.js +5 -16
  565. package/unbundled/definition30.cjs +66 -516
  566. package/unbundled/definition30.js +58 -514
  567. package/unbundled/definition31.cjs +502 -42
  568. package/unbundled/definition31.js +500 -40
  569. package/unbundled/definition32.cjs +42 -253
  570. package/unbundled/definition32.js +39 -250
  571. package/unbundled/definition33.cjs +238 -81
  572. package/unbundled/definition33.js +235 -78
  573. package/unbundled/definition34.cjs +75 -2059
  574. package/unbundled/definition34.js +72 -2032
  575. package/unbundled/definition35.cjs +1990 -25
  576. package/unbundled/definition35.js +1960 -24
  577. package/unbundled/definition36.cjs +27 -134
  578. package/unbundled/definition36.js +24 -126
  579. package/unbundled/definition37.cjs +71 -368
  580. package/unbundled/definition37.js +66 -363
  581. package/unbundled/definition38.cjs +300 -176
  582. package/unbundled/definition38.js +295 -171
  583. package/unbundled/definition39.cjs +184 -374
  584. package/unbundled/definition39.js +180 -370
  585. package/unbundled/definition4.cjs +2 -11
  586. package/unbundled/definition4.js +2 -7
  587. package/unbundled/definition40.cjs +392 -237
  588. package/unbundled/definition40.js +389 -234
  589. package/unbundled/definition41.cjs +264 -50
  590. package/unbundled/definition41.js +259 -45
  591. package/unbundled/definition42.cjs +48 -71
  592. package/unbundled/definition42.js +46 -69
  593. package/unbundled/definition43.cjs +56 -426
  594. package/unbundled/definition43.js +55 -425
  595. package/unbundled/definition44.cjs +387 -48
  596. package/unbundled/definition44.js +383 -44
  597. package/unbundled/definition45.cjs +54 -48
  598. package/unbundled/definition45.js +50 -44
  599. package/unbundled/definition46.cjs +40 -173
  600. package/unbundled/definition46.js +36 -169
  601. package/unbundled/definition47.cjs +172 -33
  602. package/unbundled/definition47.js +168 -28
  603. package/unbundled/definition48.cjs +31 -97
  604. package/unbundled/definition48.js +23 -95
  605. package/unbundled/definition49.cjs +71 -38
  606. package/unbundled/definition49.js +68 -35
  607. package/unbundled/definition5.cjs +2 -5
  608. package/unbundled/definition5.js +2 -5
  609. package/unbundled/definition50.cjs +55 -26
  610. package/unbundled/definition50.js +53 -21
  611. package/unbundled/definition51.cjs +24 -43
  612. package/unbundled/definition51.js +18 -40
  613. package/unbundled/definition52.cjs +30 -340
  614. package/unbundled/definition52.js +28 -338
  615. package/unbundled/definition53.cjs +295 -197
  616. package/unbundled/definition53.js +292 -194
  617. package/unbundled/definition54.cjs +211 -45
  618. package/unbundled/definition54.js +207 -41
  619. package/unbundled/definition55.cjs +42 -308
  620. package/unbundled/definition55.js +38 -304
  621. package/unbundled/definition56.cjs +266 -53
  622. package/unbundled/definition56.js +263 -49
  623. package/unbundled/definition57.cjs +51 -162
  624. package/unbundled/definition57.js +49 -160
  625. package/unbundled/definition58.cjs +135 -253
  626. package/unbundled/definition58.js +130 -251
  627. package/unbundled/definition59.cjs +209 -457
  628. package/unbundled/definition59.js +206 -454
  629. package/unbundled/definition6.cjs +179 -17
  630. package/unbundled/definition6.js +170 -14
  631. package/unbundled/definition60.cjs +441 -3722
  632. package/unbundled/definition60.js +435 -3553
  633. package/unbundled/definition61.cjs +3713 -761
  634. package/unbundled/definition61.js +3540 -751
  635. package/unbundled/definition62.cjs +761 -95
  636. package/unbundled/definition62.js +758 -92
  637. package/unbundled/definition63.cjs +106 -1055
  638. package/unbundled/definition63.js +98 -1047
  639. package/unbundled/definition64.cjs +991 -103
  640. package/unbundled/definition64.js +986 -101
  641. package/unbundled/definition65.cjs +111 -83
  642. package/unbundled/definition65.js +106 -77
  643. package/unbundled/definition66.cjs +71 -179
  644. package/unbundled/definition66.js +62 -176
  645. package/unbundled/definition67.cjs +154 -120
  646. package/unbundled/definition67.js +151 -117
  647. package/unbundled/definition68.cjs +126 -52
  648. package/unbundled/definition68.js +122 -48
  649. package/unbundled/definition69.cjs +52 -94
  650. package/unbundled/definition69.js +50 -91
  651. package/unbundled/definition7.cjs +31 -177
  652. package/unbundled/definition7.js +24 -170
  653. package/unbundled/definition70.cjs +92 -22
  654. package/unbundled/definition70.js +87 -17
  655. package/unbundled/definition71.cjs +21 -93
  656. package/unbundled/definition71.js +15 -90
  657. package/unbundled/definition72.cjs +77 -309
  658. package/unbundled/definition72.js +72 -232
  659. package/unbundled/definition73.cjs +288 -335
  660. package/unbundled/definition73.js +217 -329
  661. package/unbundled/definition74.cjs +327 -29
  662. package/unbundled/definition74.js +318 -26
  663. package/unbundled/definition75.cjs +28 -129
  664. package/unbundled/definition75.js +23 -125
  665. package/unbundled/definition76.cjs +107 -271
  666. package/unbundled/definition76.js +103 -267
  667. package/unbundled/definition77.cjs +258 -27
  668. package/unbundled/definition77.js +249 -25
  669. package/unbundled/definition78.cjs +30 -155
  670. package/unbundled/definition78.js +28 -140
  671. package/unbundled/definition79.cjs +117 -183
  672. package/unbundled/definition79.js +108 -179
  673. package/unbundled/definition8.cjs +152 -36
  674. package/unbundled/definition8.js +148 -31
  675. package/unbundled/definition80.cjs +180 -492
  676. package/unbundled/definition80.js +175 -486
  677. package/unbundled/definition81.cjs +517 -0
  678. package/unbundled/definition81.js +497 -0
  679. package/unbundled/definition9.cjs +200 -135
  680. package/unbundled/definition9.js +189 -130
  681. package/unbundled/delegates-aria.cjs +1 -3
  682. package/unbundled/delegates-aria.js +1 -3
  683. package/unbundled/divider.cjs +2 -7
  684. package/unbundled/divider.js +2 -7
  685. package/unbundled/extractOptions.cjs +21 -0
  686. package/unbundled/extractOptions.js +16 -0
  687. package/unbundled/form-associated.cjs +20 -60
  688. package/unbundled/form-associated.js +20 -60
  689. package/unbundled/form-element.cjs +5 -15
  690. package/unbundled/form-element.js +5 -15
  691. package/unbundled/host-semantics.cjs +1 -3
  692. package/unbundled/host-semantics.js +1 -3
  693. package/unbundled/kbd-shortcut.cjs +1 -3
  694. package/unbundled/kbd-shortcut.js +1 -3
  695. package/unbundled/linkable.cjs +1 -3
  696. package/unbundled/linkable.js +1 -3
  697. package/unbundled/listbox.cjs +29 -26
  698. package/unbundled/listbox.js +29 -26
  699. package/unbundled/localized.cjs +3 -9
  700. package/unbundled/localized.js +3 -9
  701. package/unbundled/mixins.cjs +9 -25
  702. package/unbundled/mixins.js +9 -25
  703. package/unbundled/numberConverter.cjs +39 -9
  704. package/unbundled/numberConverter.js +39 -9
  705. package/unbundled/picker-field.template.cjs +16 -36
  706. package/unbundled/picker-field.template.js +16 -36
  707. package/unbundled/platform.cjs +1 -3
  708. package/unbundled/platform.js +1 -3
  709. package/unbundled/playbackRates.cjs +1 -3
  710. package/unbundled/playbackRates.js +1 -3
  711. package/unbundled/randomId.cjs +1 -3
  712. package/unbundled/randomId.js +1 -3
  713. package/unbundled/single-date-picker.cjs +6 -18
  714. package/unbundled/single-date-picker.js +6 -18
  715. package/unbundled/single-value-picker.cjs +7 -21
  716. package/unbundled/single-value-picker.js +7 -21
  717. package/unbundled/slider.template.cjs +6 -14
  718. package/unbundled/slider.template.js +6 -14
  719. package/unbundled/slottable-request.cjs +2 -6
  720. package/unbundled/slottable-request.js +2 -6
  721. package/unbundled/text-field.cjs +1 -1
  722. package/unbundled/text-field.js +1 -1
  723. package/unbundled/time-selection-picker.template.cjs +27 -79
  724. package/unbundled/time-selection-picker.template.js +27 -79
  725. package/unbundled/trapped-focus.cjs +1 -3
  726. package/unbundled/trapped-focus.js +1 -3
  727. package/unbundled/vivid-element.cjs +16 -19
  728. package/unbundled/vivid-element.js +16 -19
  729. package/unbundled/with-contextual-help.cjs +4 -13
  730. package/unbundled/with-contextual-help.js +4 -13
  731. package/unbundled/with-error-text.cjs +2 -6
  732. package/unbundled/with-error-text.js +2 -6
  733. package/unbundled/with-success-text.cjs +1 -3
  734. package/unbundled/with-success-text.js +1 -3
  735. package/video-player/definition.cjs +1 -1
  736. package/video-player/definition.js +1 -1
  737. package/video-player/index.cjs +3 -3
  738. package/video-player/index.js +5 -5
  739. package/visually-hidden/definition.cjs +1 -1
  740. package/visually-hidden/definition.js +1 -1
  741. package/vivid.api.json +194 -0
  742. package/shared/color-picker/index.d.ts +0 -3
  743. package/shared/foundation/button/index.d.ts +0 -2
  744. package/shared/patterns/char-count/index.d.ts +0 -1
  745. package/shared/patterns/form-elements/index.d.ts +0 -4
  746. package/shared/patterns/index.d.ts +0 -7
@@ -1,287 +1,76 @@
1
1
  require("./chunk.cjs");
2
2
  const require_vivid_element = require("./vivid-element.cjs");
3
+ const require_definition = require("./definition.cjs");
3
4
  const require_decorate = require("./decorate.cjs");
4
- const require_delegates_aria = require("./delegates-aria.cjs");
5
- const require_localized = require("./localized.cjs");
6
- const require_definition = require("./definition10.cjs");
7
- const require_definition$1 = require("./definition16.cjs");
8
- const require_definition$2 = require("./definition31.cjs");
9
5
  const require_utils = require("./utils.cjs");
10
6
  let _microsoft_fast_element = require("@microsoft/fast-element");
11
- //#region src/lib/country-group/country-group.scss?inline
12
- var country_group_default = ":host{flex-direction:column;block-size:100%;inline-size:100%;display:flex;overflow:hidden}.container{flex-wrap:wrap;flex:auto;align-content:flex-start;align-items:center;gap:8px;min-block-size:0;display:flex;position:relative}.container slot{display:contents}.overflow-wrap{align-self:center;line-height:0}.overflow-grid{font:var(--vvd-typography-base);grid-template-columns:repeat(3,auto);gap:8px;padding:8px;display:grid}";
7
+ //#region src/lib/country/country.scss?inline
8
+ var country_default = ":host{display:inline-flex}.base{align-items:center;column-gap:8px;display:inline-flex}.icon{align-items:center;display:inline-flex}.icon [data-vvd-component=icon]{block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16));flex-shrink:0;inline-size:auto}.icon ::slotted(*){block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16));object-fit:contain;border-radius:2px;inline-size:auto;display:block}.text{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}";
13
9
  //#endregion
14
- //#region src/lib/country-group/country-group.ts
15
- var FULLY_VISIBLE_INTERSECTION_RATIO = .99;
10
+ //#region src/lib/country/country.ts
16
11
  /**
17
12
  * @public
18
- * @component country-group
19
- * @slot default - One or more `vwc-country` elements (Country only).
13
+ * @component country
14
+ * @slot icon - Optional custom flag or graphic. When `code` is set and no content is slotted, a default flag icon (Vivid/Vonage icon set) is shown.
20
15
  */
21
- var CountryGroup = class extends require_localized.Localized(require_delegates_aria.DelegatesAria(require_vivid_element.VividElement)) {
22
- constructor(..._args) {
23
- super(..._args);
24
- this.items = [];
25
- this.lastVisibleIndex = 0;
26
- this.computedAriaLabel = null;
27
- this.popupOpen = false;
28
- this.#observer = null;
29
- this.#visibleMap = /* @__PURE__ */ new Map();
30
- this.#candidateVisible = -1;
31
- this.#candidateStreak = 0;
32
- this.#onSlotChange = () => {
33
- this.#syncFromSlot();
34
- this.#updateAriaLabel();
35
- this.#requestFit();
36
- };
37
- this.#handleIntersection = (entries) => {
38
- for (const entry of entries) this.#visibleMap.set(entry.target, (entry.intersectionRatio ?? 0) >= FULLY_VISIBLE_INTERSECTION_RATIO);
39
- this.#requestFit();
40
- let firstHidden = -1;
41
- for (let i = 0; i < this.items.length; i++) if (!(this.#visibleMap.get(this.items[i]) ?? true)) {
42
- firstHidden = i;
43
- break;
44
- }
45
- let nextVisible = firstHidden === -1 ? this.items.length : firstHidden;
46
- if (firstHidden === this.items.length - 1 && this.badgeEl && (this.#visibleMap.get(this.badgeEl) ?? false)) nextVisible = this.items.length;
47
- if (nextVisible < this.items.length && this.badgeEl && this.#visibleMap.has(this.badgeEl) && this.#visibleMap.get(this.badgeEl) === false) nextVisible = Math.max(1, nextVisible - 1);
48
- this.#proposeVisibleCount(nextVisible);
49
- };
50
- }
51
- get overflowCount() {
52
- return Math.max(0, this.items.length - this.lastVisibleIndex);
53
- }
54
- #observer;
55
- #visibleMap;
56
- #candidateVisible;
57
- #candidateStreak;
58
- #countryNameForCode(code) {
59
- if (!code) return "";
60
- return require_utils.countries.find((c) => c.code.toUpperCase() === code.toUpperCase())?.label ?? "";
61
- }
62
- #applyLayout(visibleCount, mode) {
63
- for (let i = 0; i < this.items.length; i++) {
64
- const el = this.items[i];
65
- el.style.order = `${i < visibleCount ? i : i + 1}`;
66
- if (i < visibleCount) {
67
- el.setAttribute("data-visible", "true");
68
- el.style.display = "";
69
- el.style.position = "";
70
- el.style.inset = "";
71
- el.style.visibility = "";
72
- el.style.pointerEvents = "";
73
- continue;
74
- }
75
- el.setAttribute("data-visible", "false");
76
- el.style.display = "";
77
- el.style.pointerEvents = "none";
78
- if (mode === "final") {
79
- el.style.position = "absolute";
80
- el.style.inset = "0 auto auto 0";
81
- el.style.visibility = "hidden";
82
- } else {
83
- el.style.position = "";
84
- el.style.inset = "";
85
- el.style.visibility = "hidden";
86
- }
87
- }
88
- }
89
- connectedCallback() {
90
- super.connectedCallback();
91
- this.#syncFromSlot();
92
- this.#updateAriaLabel();
93
- this.slotEl?.addEventListener("slotchange", this.#onSlotChange);
94
- this.#ensureObserver();
95
- this.#requestFit();
96
- }
97
- disconnectedCallback() {
98
- this.slotEl?.removeEventListener("slotchange", this.#onSlotChange);
99
- this.#observer?.disconnect();
100
- this.#observer = null;
101
- this.#visibleMap.clear();
102
- this.#candidateVisible = -1;
103
- this.#candidateStreak = 0;
104
- super.disconnectedCallback();
105
- }
106
- #onSlotChange;
107
- #ensureObserver() {
108
- if (this.#observer) return;
109
- this.#observer = new IntersectionObserver(this.#handleIntersection, {
110
- root: this,
111
- threshold: [FULLY_VISIBLE_INTERSECTION_RATIO]
112
- });
113
- }
114
- #requestFit() {
115
- this.#prepareForFit();
116
- this.#observeAll();
117
- }
118
- #observeAll() {
119
- const observer = this.#observer;
120
- observer.disconnect();
121
- for (const el of this.items) observer.observe(el);
122
- if (this.badgeEl && this.overflowCount > 0) observer.observe(this.badgeEl);
123
- }
124
- #syncFromSlot() {
125
- const assigned = this.slotEl.assignedElements({ flatten: true });
126
- this.items = assigned.filter((n) => n instanceof require_definition$2.Country);
127
- this.#visibleMap.clear();
128
- for (const el of this.items) this.#visibleMap.set(el, true);
129
- this.lastVisibleIndex = this.items.length;
130
- this.#applyLayout(this.lastVisibleIndex, "final");
131
- }
132
- #updateAriaLabel() {
133
- const prefix = this.locale.countryGroup.ariaLabelPrefix;
134
- const names = [];
135
- for (const el of this.items) {
136
- const label = (el.getAttribute("label") ?? "").trim();
137
- const code = (el.getAttribute("code") ?? "").trim();
138
- const fullName = this.#countryNameForCode(code);
139
- const value = label || fullName || code;
140
- if (value) names.push(value);
141
- }
142
- const joined = names.join(", ");
143
- this.computedAriaLabel = joined ? `${prefix} ${joined}` : prefix;
144
- }
145
- #handleIntersection;
146
- #proposeVisibleCount(nextVisible) {
147
- if (this.#candidateVisible === nextVisible) this.#candidateStreak++;
148
- else {
149
- this.#candidateVisible = nextVisible;
150
- this.#candidateStreak = 1;
151
- }
152
- if (this.#candidateStreak < 2) return;
153
- if (this.lastVisibleIndex === nextVisible) return;
154
- this.lastVisibleIndex = this.#candidateVisible;
155
- this.#applyLayout(this.lastVisibleIndex, "final");
156
- if (this.overflowCount === 0) this.popupOpen = false;
157
- this.fillOverflowGrid();
158
- }
159
- #prepareForFit() {
160
- this.#applyLayout(this.lastVisibleIndex, "fit");
161
- }
162
- /**
163
- * @internal
164
- */
165
- handleMouseEnter() {
166
- this.popupOpen = true;
167
- }
168
- /**
169
- * @internal
170
- */
171
- handleMouseLeave() {
172
- this.popupOpen = false;
173
- }
174
- /**
175
- * @internal
176
- */
177
- popupOpenChanged(oldValue) {
178
- if (oldValue === void 0) return;
179
- if (this.popupOpen) this.fillOverflowGrid();
180
- }
181
- /**
182
- * @internal
183
- */
184
- fillOverflowGrid() {
185
- if (!this.overflowGridEl) return;
186
- if (this.overflowCount === 0) return;
187
- this.overflowGridEl.replaceChildren();
188
- const overflowed = this.items.slice(this.lastVisibleIndex);
189
- for (const it of overflowed) {
190
- const clone = it.cloneNode(true);
191
- clone.setAttribute("aria-hidden", "true");
192
- clone.removeAttribute("style");
193
- this.overflowGridEl.appendChild(clone);
194
- }
16
+ var Country = class extends require_vivid_element.VividElement {
17
+ /** @internal */
18
+ get flagIconName() {
19
+ return require_utils.getFlagIconName(this.code);
20
+ }
21
+ /** @internal */
22
+ get displayText() {
23
+ const customLabel = this.label?.trim();
24
+ if (customLabel) return customLabel;
25
+ const codeValue = this.code?.trim();
26
+ return codeValue ? codeValue.toUpperCase() : void 0;
195
27
  }
196
28
  };
197
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "items", void 0);
198
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "lastVisibleIndex", void 0);
199
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "computedAriaLabel", void 0);
200
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "popupOpen", void 0);
29
+ require_decorate.__decorate([_microsoft_fast_element.attr], Country.prototype, "code", void 0);
30
+ require_decorate.__decorate([_microsoft_fast_element.attr], Country.prototype, "label", void 0);
201
31
  //#endregion
202
- //#region src/lib/country-group/country-group.template.ts
203
- var CountryGroupTemplate = (context) => {
204
- const badgeTag = context.tagFor(require_definition$1.Badge);
205
- const popupTag = context.tagFor(require_definition.Popup);
32
+ //#region src/lib/country/country.template.ts
33
+ var CountryTemplate = (context) => {
34
+ const iconTag = context.tagFor(require_definition.Icon);
206
35
  return _microsoft_fast_element.html`
207
- <div
208
- class="container"
209
- ${require_delegates_aria.delegateAria({
210
- role: "group",
211
- ariaLabel: (x) => x.ariaLabel || x.computedAriaLabel
212
- })}
213
- >
214
- <slot ${(0, _microsoft_fast_element.ref)("slotEl")}></slot>
215
- ${(0, _microsoft_fast_element.when)((x) => x.overflowCount > 0, _microsoft_fast_element.html`
216
- <div
217
- class="overflow-wrap"
218
- ${(0, _microsoft_fast_element.ref)("overflowWrapEl")}
219
- style="order: ${(x) => x.lastVisibleIndex};"
220
- @mouseenter="${(x) => x.handleMouseEnter()}"
221
- @mouseleave="${(x) => x.handleMouseLeave()}"
222
- >
223
- <${badgeTag}
224
- ${(0, _microsoft_fast_element.ref)("badgeEl")}
225
- connotation="cta"
226
- appearance="duotone"
227
- shape="pill"
228
- text="${(x) => `+${x.overflowCount}`}"
229
- ></${badgeTag}>
230
- </div>
231
- `)}
232
- </div>
233
-
234
- ${(0, _microsoft_fast_element.when)((x) => x.overflowCount > 0, _microsoft_fast_element.html`
235
- <${popupTag}
236
- strategy="fixed"
237
- placement="top"
238
- alternate
239
- arrow
240
- :anchor="${(x) => x.overflowWrapEl}"
241
- :open="${(x) => x.popupOpen}"
242
- exportparts="vvd-theme-alternate"
243
- >
244
- <div
245
- class="overflow-grid"
246
- ${(0, _microsoft_fast_element.ref)("overflowGridEl")}
36
+ <div class="base">
37
+ <slot name="icon" class="icon">
38
+ ${(0, _microsoft_fast_element.when)((x) => x.flagIconName, _microsoft_fast_element.html`<${iconTag}
39
+ size="-4"
40
+ name="${(x) => x.flagIconName}"
247
41
  aria-hidden="true"
248
- ></div>
249
- </${popupTag}>
250
- `)}
42
+ ></${iconTag}>`)}
43
+ </slot>
44
+ ${(0, _microsoft_fast_element.when)((x) => x.displayText, _microsoft_fast_element.html`<span class="text">${(x) => x.displayText}</span>`)}
45
+ </div>
251
46
  `;
252
47
  };
253
48
  //#endregion
254
- //#region src/lib/country-group/definition.ts
255
- /**
256
- * @internal
257
- */
258
- var countryGroupDefinition = require_vivid_element.defineVividComponent("country-group", CountryGroup, CountryGroupTemplate, [
259
- require_definition$2.countryDefinition,
260
- require_definition$1.badgeDefinition,
261
- require_definition.popupDefinition
262
- ], { styles: country_group_default });
49
+ //#region src/lib/country/definition.ts
50
+ /** @internal */
51
+ var countryDefinition = require_vivid_element.defineVividComponent("country", Country, CountryTemplate, [require_definition.iconDefinition], { styles: country_default });
263
52
  /**
264
- * Registers the country-group element with the design system.
53
+ * Registers the country element with the design system.
265
54
  *
266
55
  * @param prefix - the prefix to use for the component name
267
56
  */
268
- var registerCountryGroup = require_vivid_element.createRegisterFunction(countryGroupDefinition);
57
+ var registerCountry = require_vivid_element.createRegisterFunction(countryDefinition);
269
58
  //#endregion
270
- Object.defineProperty(exports, "CountryGroup", {
59
+ Object.defineProperty(exports, "Country", {
271
60
  enumerable: true,
272
61
  get: function() {
273
- return CountryGroup;
62
+ return Country;
274
63
  }
275
64
  });
276
- Object.defineProperty(exports, "countryGroupDefinition", {
65
+ Object.defineProperty(exports, "countryDefinition", {
277
66
  enumerable: true,
278
67
  get: function() {
279
- return countryGroupDefinition;
68
+ return countryDefinition;
280
69
  }
281
70
  });
282
- Object.defineProperty(exports, "registerCountryGroup", {
71
+ Object.defineProperty(exports, "registerCountry", {
283
72
  enumerable: true,
284
73
  get: function() {
285
- return registerCountryGroup;
74
+ return registerCountry;
286
75
  }
287
76
  });
@@ -1,269 +1,58 @@
1
1
  import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
2
+ import { r as Icon, t as iconDefinition } from "./definition.js";
2
3
  import { t as __decorate } from "./decorate.js";
3
- import { n as delegateAria, t as DelegatesAria } from "./delegates-aria.js";
4
- import { t as Localized } from "./localized.js";
5
- import { i as Popup, t as popupDefinition } from "./definition10.js";
6
- import { r as Badge, t as badgeDefinition } from "./definition16.js";
7
- import { r as Country, t as countryDefinition } from "./definition31.js";
8
- import { n as countries } from "./utils.js";
9
- import { html, observable, ref, when } from "@microsoft/fast-element";
10
- //#region src/lib/country-group/country-group.scss?inline
11
- var country_group_default = ":host{flex-direction:column;block-size:100%;inline-size:100%;display:flex;overflow:hidden}.container{flex-wrap:wrap;flex:auto;align-content:flex-start;align-items:center;gap:8px;min-block-size:0;display:flex;position:relative}.container slot{display:contents}.overflow-wrap{align-self:center;line-height:0}.overflow-grid{font:var(--vvd-typography-base);grid-template-columns:repeat(3,auto);gap:8px;padding:8px;display:grid}";
4
+ import { t as getFlagIconName } from "./utils.js";
5
+ import { attr, html, when } from "@microsoft/fast-element";
6
+ //#region src/lib/country/country.scss?inline
7
+ var country_default = ":host{display:inline-flex}.base{align-items:center;column-gap:8px;display:inline-flex}.icon{align-items:center;display:inline-flex}.icon [data-vvd-component=icon]{block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16));flex-shrink:0;inline-size:auto}.icon ::slotted(*){block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16));object-fit:contain;border-radius:2px;inline-size:auto;display:block}.text{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}";
12
8
  //#endregion
13
- //#region src/lib/country-group/country-group.ts
14
- var FULLY_VISIBLE_INTERSECTION_RATIO = .99;
9
+ //#region src/lib/country/country.ts
15
10
  /**
16
11
  * @public
17
- * @component country-group
18
- * @slot default - One or more `vwc-country` elements (Country only).
12
+ * @component country
13
+ * @slot icon - Optional custom flag or graphic. When `code` is set and no content is slotted, a default flag icon (Vivid/Vonage icon set) is shown.
19
14
  */
20
- var CountryGroup = class extends Localized(DelegatesAria(VividElement)) {
21
- constructor(..._args) {
22
- super(..._args);
23
- this.items = [];
24
- this.lastVisibleIndex = 0;
25
- this.computedAriaLabel = null;
26
- this.popupOpen = false;
27
- this.#observer = null;
28
- this.#visibleMap = /* @__PURE__ */ new Map();
29
- this.#candidateVisible = -1;
30
- this.#candidateStreak = 0;
31
- this.#onSlotChange = () => {
32
- this.#syncFromSlot();
33
- this.#updateAriaLabel();
34
- this.#requestFit();
35
- };
36
- this.#handleIntersection = (entries) => {
37
- for (const entry of entries) this.#visibleMap.set(entry.target, (entry.intersectionRatio ?? 0) >= FULLY_VISIBLE_INTERSECTION_RATIO);
38
- this.#requestFit();
39
- let firstHidden = -1;
40
- for (let i = 0; i < this.items.length; i++) if (!(this.#visibleMap.get(this.items[i]) ?? true)) {
41
- firstHidden = i;
42
- break;
43
- }
44
- let nextVisible = firstHidden === -1 ? this.items.length : firstHidden;
45
- if (firstHidden === this.items.length - 1 && this.badgeEl && (this.#visibleMap.get(this.badgeEl) ?? false)) nextVisible = this.items.length;
46
- if (nextVisible < this.items.length && this.badgeEl && this.#visibleMap.has(this.badgeEl) && this.#visibleMap.get(this.badgeEl) === false) nextVisible = Math.max(1, nextVisible - 1);
47
- this.#proposeVisibleCount(nextVisible);
48
- };
49
- }
50
- get overflowCount() {
51
- return Math.max(0, this.items.length - this.lastVisibleIndex);
52
- }
53
- #observer;
54
- #visibleMap;
55
- #candidateVisible;
56
- #candidateStreak;
57
- #countryNameForCode(code) {
58
- if (!code) return "";
59
- return countries.find((c) => c.code.toUpperCase() === code.toUpperCase())?.label ?? "";
60
- }
61
- #applyLayout(visibleCount, mode) {
62
- for (let i = 0; i < this.items.length; i++) {
63
- const el = this.items[i];
64
- el.style.order = `${i < visibleCount ? i : i + 1}`;
65
- if (i < visibleCount) {
66
- el.setAttribute("data-visible", "true");
67
- el.style.display = "";
68
- el.style.position = "";
69
- el.style.inset = "";
70
- el.style.visibility = "";
71
- el.style.pointerEvents = "";
72
- continue;
73
- }
74
- el.setAttribute("data-visible", "false");
75
- el.style.display = "";
76
- el.style.pointerEvents = "none";
77
- if (mode === "final") {
78
- el.style.position = "absolute";
79
- el.style.inset = "0 auto auto 0";
80
- el.style.visibility = "hidden";
81
- } else {
82
- el.style.position = "";
83
- el.style.inset = "";
84
- el.style.visibility = "hidden";
85
- }
86
- }
87
- }
88
- connectedCallback() {
89
- super.connectedCallback();
90
- this.#syncFromSlot();
91
- this.#updateAriaLabel();
92
- this.slotEl?.addEventListener("slotchange", this.#onSlotChange);
93
- this.#ensureObserver();
94
- this.#requestFit();
95
- }
96
- disconnectedCallback() {
97
- this.slotEl?.removeEventListener("slotchange", this.#onSlotChange);
98
- this.#observer?.disconnect();
99
- this.#observer = null;
100
- this.#visibleMap.clear();
101
- this.#candidateVisible = -1;
102
- this.#candidateStreak = 0;
103
- super.disconnectedCallback();
104
- }
105
- #onSlotChange;
106
- #ensureObserver() {
107
- if (this.#observer) return;
108
- this.#observer = new IntersectionObserver(this.#handleIntersection, {
109
- root: this,
110
- threshold: [FULLY_VISIBLE_INTERSECTION_RATIO]
111
- });
112
- }
113
- #requestFit() {
114
- this.#prepareForFit();
115
- this.#observeAll();
116
- }
117
- #observeAll() {
118
- const observer = this.#observer;
119
- observer.disconnect();
120
- for (const el of this.items) observer.observe(el);
121
- if (this.badgeEl && this.overflowCount > 0) observer.observe(this.badgeEl);
122
- }
123
- #syncFromSlot() {
124
- const assigned = this.slotEl.assignedElements({ flatten: true });
125
- this.items = assigned.filter((n) => n instanceof Country);
126
- this.#visibleMap.clear();
127
- for (const el of this.items) this.#visibleMap.set(el, true);
128
- this.lastVisibleIndex = this.items.length;
129
- this.#applyLayout(this.lastVisibleIndex, "final");
130
- }
131
- #updateAriaLabel() {
132
- const prefix = this.locale.countryGroup.ariaLabelPrefix;
133
- const names = [];
134
- for (const el of this.items) {
135
- const label = (el.getAttribute("label") ?? "").trim();
136
- const code = (el.getAttribute("code") ?? "").trim();
137
- const fullName = this.#countryNameForCode(code);
138
- const value = label || fullName || code;
139
- if (value) names.push(value);
140
- }
141
- const joined = names.join(", ");
142
- this.computedAriaLabel = joined ? `${prefix} ${joined}` : prefix;
143
- }
144
- #handleIntersection;
145
- #proposeVisibleCount(nextVisible) {
146
- if (this.#candidateVisible === nextVisible) this.#candidateStreak++;
147
- else {
148
- this.#candidateVisible = nextVisible;
149
- this.#candidateStreak = 1;
150
- }
151
- if (this.#candidateStreak < 2) return;
152
- if (this.lastVisibleIndex === nextVisible) return;
153
- this.lastVisibleIndex = this.#candidateVisible;
154
- this.#applyLayout(this.lastVisibleIndex, "final");
155
- if (this.overflowCount === 0) this.popupOpen = false;
156
- this.fillOverflowGrid();
157
- }
158
- #prepareForFit() {
159
- this.#applyLayout(this.lastVisibleIndex, "fit");
160
- }
161
- /**
162
- * @internal
163
- */
164
- handleMouseEnter() {
165
- this.popupOpen = true;
166
- }
167
- /**
168
- * @internal
169
- */
170
- handleMouseLeave() {
171
- this.popupOpen = false;
172
- }
173
- /**
174
- * @internal
175
- */
176
- popupOpenChanged(oldValue) {
177
- if (oldValue === void 0) return;
178
- if (this.popupOpen) this.fillOverflowGrid();
179
- }
180
- /**
181
- * @internal
182
- */
183
- fillOverflowGrid() {
184
- if (!this.overflowGridEl) return;
185
- if (this.overflowCount === 0) return;
186
- this.overflowGridEl.replaceChildren();
187
- const overflowed = this.items.slice(this.lastVisibleIndex);
188
- for (const it of overflowed) {
189
- const clone = it.cloneNode(true);
190
- clone.setAttribute("aria-hidden", "true");
191
- clone.removeAttribute("style");
192
- this.overflowGridEl.appendChild(clone);
193
- }
15
+ var Country = class extends VividElement {
16
+ /** @internal */
17
+ get flagIconName() {
18
+ return getFlagIconName(this.code);
19
+ }
20
+ /** @internal */
21
+ get displayText() {
22
+ const customLabel = this.label?.trim();
23
+ if (customLabel) return customLabel;
24
+ const codeValue = this.code?.trim();
25
+ return codeValue ? codeValue.toUpperCase() : void 0;
194
26
  }
195
27
  };
196
- __decorate([observable], CountryGroup.prototype, "items", void 0);
197
- __decorate([observable], CountryGroup.prototype, "lastVisibleIndex", void 0);
198
- __decorate([observable], CountryGroup.prototype, "computedAriaLabel", void 0);
199
- __decorate([observable], CountryGroup.prototype, "popupOpen", void 0);
28
+ __decorate([attr], Country.prototype, "code", void 0);
29
+ __decorate([attr], Country.prototype, "label", void 0);
200
30
  //#endregion
201
- //#region src/lib/country-group/country-group.template.ts
202
- var CountryGroupTemplate = (context) => {
203
- const badgeTag = context.tagFor(Badge);
204
- const popupTag = context.tagFor(Popup);
31
+ //#region src/lib/country/country.template.ts
32
+ var CountryTemplate = (context) => {
33
+ const iconTag = context.tagFor(Icon);
205
34
  return html`
206
- <div
207
- class="container"
208
- ${delegateAria({
209
- role: "group",
210
- ariaLabel: (x) => x.ariaLabel || x.computedAriaLabel
211
- })}
212
- >
213
- <slot ${ref("slotEl")}></slot>
214
- ${when((x) => x.overflowCount > 0, html`
215
- <div
216
- class="overflow-wrap"
217
- ${ref("overflowWrapEl")}
218
- style="order: ${(x) => x.lastVisibleIndex};"
219
- @mouseenter="${(x) => x.handleMouseEnter()}"
220
- @mouseleave="${(x) => x.handleMouseLeave()}"
221
- >
222
- <${badgeTag}
223
- ${ref("badgeEl")}
224
- connotation="cta"
225
- appearance="duotone"
226
- shape="pill"
227
- text="${(x) => `+${x.overflowCount}`}"
228
- ></${badgeTag}>
229
- </div>
230
- `)}
231
- </div>
232
-
233
- ${when((x) => x.overflowCount > 0, html`
234
- <${popupTag}
235
- strategy="fixed"
236
- placement="top"
237
- alternate
238
- arrow
239
- :anchor="${(x) => x.overflowWrapEl}"
240
- :open="${(x) => x.popupOpen}"
241
- exportparts="vvd-theme-alternate"
242
- >
243
- <div
244
- class="overflow-grid"
245
- ${ref("overflowGridEl")}
35
+ <div class="base">
36
+ <slot name="icon" class="icon">
37
+ ${when((x) => x.flagIconName, html`<${iconTag}
38
+ size="-4"
39
+ name="${(x) => x.flagIconName}"
246
40
  aria-hidden="true"
247
- ></div>
248
- </${popupTag}>
249
- `)}
41
+ ></${iconTag}>`)}
42
+ </slot>
43
+ ${when((x) => x.displayText, html`<span class="text">${(x) => x.displayText}</span>`)}
44
+ </div>
250
45
  `;
251
46
  };
252
47
  //#endregion
253
- //#region src/lib/country-group/definition.ts
254
- /**
255
- * @internal
256
- */
257
- var countryGroupDefinition = defineVividComponent("country-group", CountryGroup, CountryGroupTemplate, [
258
- countryDefinition,
259
- badgeDefinition,
260
- popupDefinition
261
- ], { styles: country_group_default });
48
+ //#region src/lib/country/definition.ts
49
+ /** @internal */
50
+ var countryDefinition = defineVividComponent("country", Country, CountryTemplate, [iconDefinition], { styles: country_default });
262
51
  /**
263
- * Registers the country-group element with the design system.
52
+ * Registers the country element with the design system.
264
53
  *
265
54
  * @param prefix - the prefix to use for the component name
266
55
  */
267
- var registerCountryGroup = createRegisterFunction(countryGroupDefinition);
56
+ var registerCountry = createRegisterFunction(countryDefinition);
268
57
  //#endregion
269
- export { registerCountryGroup as n, CountryGroup as r, countryGroupDefinition as t };
58
+ export { registerCountry as n, Country as r, countryDefinition as t };