@vonage/vivid 5.23.1 → 5.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/README.md +1 -1
  2. package/accordion/index.cjs +1 -1
  3. package/accordion/index.js +1 -1
  4. package/accordion-item/index.cjs +1 -1
  5. package/accordion-item/index.js +1 -1
  6. package/audio-player/index.cjs +2 -2
  7. package/audio-player/index.js +3 -3
  8. package/avatar/index.cjs +10 -10
  9. package/avatar/index.js +4 -3
  10. package/badge/index.cjs +1 -1
  11. package/badge/index.js +1 -1
  12. package/breadcrumb-item/index.cjs +9 -5
  13. package/breadcrumb-item/index.js +11 -6
  14. package/bundled/affix.cjs +1 -1
  15. package/bundled/affix.js +1 -1
  16. package/bundled/definition10.cjs +2 -1
  17. package/bundled/definition10.js +3 -2
  18. package/bundled/definition11.cjs +4 -4
  19. package/bundled/definition11.js +4 -3
  20. package/bundled/definition12.cjs +1 -1
  21. package/bundled/definition12.js +1 -0
  22. package/bundled/definition15.cjs +8 -7
  23. package/bundled/definition15.js +27 -24
  24. package/bundled/definition17.cjs +7 -7
  25. package/bundled/definition17.js +22 -109
  26. package/bundled/definition18.cjs +12 -83
  27. package/bundled/definition18.js +20 -426
  28. package/bundled/definition19.cjs +87 -7
  29. package/bundled/definition19.js +433 -16
  30. package/bundled/definition20.cjs +7 -37
  31. package/bundled/definition20.js +17 -172
  32. package/bundled/definition21.cjs +35 -27
  33. package/bundled/definition21.js +155 -154
  34. package/bundled/definition22.cjs +29 -6
  35. package/bundled/definition22.js +172 -20
  36. package/bundled/definition23.cjs +6 -12
  37. package/bundled/definition23.js +17 -32
  38. package/bundled/definition24.cjs +12 -39
  39. package/bundled/definition24.js +33 -67
  40. package/bundled/definition25.cjs +44 -0
  41. package/bundled/definition25.js +81 -0
  42. package/bundled/definition3.cjs +5 -5
  43. package/bundled/definition3.js +10 -40
  44. package/bundled/definition4.cjs +6 -6
  45. package/bundled/definition4.js +4 -3
  46. package/bundled/definition6.cjs +11 -11
  47. package/bundled/definition6.js +4 -3
  48. package/bundled/definition9.cjs +12 -6
  49. package/bundled/definition9.js +66 -43
  50. package/bundled/extractOptions.cjs +1 -0
  51. package/bundled/extractOptions.js +11 -0
  52. package/bundled/icon.cjs +1 -0
  53. package/bundled/icon.js +34 -0
  54. package/bundled/listbox.cjs +1 -1
  55. package/bundled/listbox.js +28 -12
  56. package/bundled/mixins.cjs +8 -8
  57. package/bundled/mixins.js +4 -3
  58. package/bundled/optgroup.cjs +1 -0
  59. package/bundled/optgroup.js +27 -0
  60. package/bundled/option.cjs +1 -0
  61. package/bundled/option.js +93 -0
  62. package/bundled/render-in-light-dom.cjs +1 -1
  63. package/bundled/render-in-light-dom.js +16 -19
  64. package/bundled/vivid-element.cjs +1 -1
  65. package/bundled/vivid-element.js +9 -1
  66. package/card/index.cjs +22 -22
  67. package/card/index.js +4 -3
  68. package/color-picker/index.cjs +18 -18
  69. package/color-picker/index.js +4 -3
  70. package/combobox/definition.cjs +1 -1
  71. package/combobox/definition.js +1 -1
  72. package/combobox/index.cjs +7 -7
  73. package/combobox/index.js +31 -21
  74. package/country/definition.cjs +1 -1
  75. package/country/definition.js +1 -1
  76. package/country/index.cjs +1 -1
  77. package/country/index.js +1 -1
  78. package/country-group/definition.cjs +1 -1
  79. package/country-group/definition.js +1 -1
  80. package/country-group/index.cjs +1 -1
  81. package/country-group/index.js +2 -2
  82. package/custom-elements.json +8438 -7866
  83. package/data-grid/definition.cjs +1 -1
  84. package/data-grid/definition.js +1 -1
  85. package/data-grid/index.cjs +26 -26
  86. package/data-grid/index.js +9 -8
  87. package/date-picker/definition.cjs +1 -1
  88. package/date-picker/definition.js +1 -1
  89. package/date-picker/index.cjs +1 -1
  90. package/date-picker/index.js +1 -1
  91. package/date-range-picker/definition.cjs +1 -1
  92. package/date-range-picker/definition.js +1 -1
  93. package/date-range-picker/index.cjs +1 -1
  94. package/date-range-picker/index.js +1 -1
  95. package/date-time-picker/definition.cjs +1 -1
  96. package/date-time-picker/definition.js +1 -1
  97. package/date-time-picker/index.cjs +1 -1
  98. package/date-time-picker/index.js +1 -1
  99. package/dial-pad/definition.cjs +1 -1
  100. package/dial-pad/definition.js +1 -1
  101. package/dial-pad/index.cjs +7 -7
  102. package/dial-pad/index.js +124 -54
  103. package/dialog/definition.cjs +1 -1
  104. package/dialog/definition.js +1 -1
  105. package/dialog/index.cjs +14 -14
  106. package/dialog/index.js +4 -3
  107. package/divider/definition.cjs +1 -1
  108. package/divider/definition.js +1 -1
  109. package/divider/index.cjs +1 -1
  110. package/divider/index.js +1 -1
  111. package/empty-state/definition.cjs +1 -1
  112. package/empty-state/definition.js +1 -1
  113. package/empty-state/index.cjs +3 -3
  114. package/empty-state/index.js +4 -3
  115. package/fab/definition.cjs +1 -1
  116. package/fab/definition.js +1 -1
  117. package/file-picker/definition.cjs +1 -1
  118. package/file-picker/definition.js +1 -1
  119. package/file-picker/index.cjs +7 -7
  120. package/file-picker/index.js +4 -3
  121. package/flag/definition.cjs +1 -1
  122. package/flag/definition.js +1 -1
  123. package/header/definition.cjs +1 -1
  124. package/header/definition.js +1 -1
  125. package/header/index.cjs +3 -3
  126. package/header/index.js +3 -3
  127. package/icon/definition.cjs +2 -1
  128. package/icon/definition.js +2 -1
  129. package/index.cjs +209 -198
  130. package/index.js +59 -54
  131. package/kbd-key/definition.cjs +1 -1
  132. package/kbd-key/definition.js +1 -1
  133. package/kbd-shortcut/definition.cjs +1 -1
  134. package/kbd-shortcut/definition.js +1 -1
  135. package/layout/definition.cjs +1 -1
  136. package/layout/definition.js +1 -1
  137. package/lib/accordion-item/accordion-item.d.ts +3 -1
  138. package/lib/action-group/action-group.d.ts +1 -1
  139. package/lib/alert/alert.d.ts +2 -2
  140. package/lib/audio-player/audio-player.d.ts +1 -1
  141. package/lib/avatar/avatar.d.ts +1 -1
  142. package/lib/badge/badge.d.ts +1 -1
  143. package/lib/banner/banner.d.ts +3 -3
  144. package/lib/breadcrumb/breadcrumb.d.ts +1 -1
  145. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  146. package/lib/button/button.d.ts +3 -3
  147. package/lib/calendar-event/calendar-event.d.ts +1 -1
  148. package/lib/card/card.d.ts +1 -1
  149. package/lib/checkbox/checkbox.d.ts +6 -6
  150. package/lib/color-picker/color-picker.d.ts +7 -7
  151. package/lib/combobox/combobox.d.ts +8 -8
  152. package/lib/components.d.ts +2 -0
  153. package/lib/country-group/country-group.d.ts +2 -2
  154. package/lib/data-grid/data-grid-cell.d.ts +4 -3
  155. package/lib/data-grid/data-grid-row.d.ts +3 -2
  156. package/lib/data-grid/data-grid.options.d.ts +5 -0
  157. package/lib/date-picker/date-picker.d.ts +8 -8
  158. package/lib/date-range-picker/date-range-picker.d.ts +4 -4
  159. package/lib/date-time-picker/date-time-picker.d.ts +8 -8
  160. package/lib/dial-pad/dial-pad.d.ts +2 -2
  161. package/lib/dialog/dialog.d.ts +2 -2
  162. package/lib/divider/divider.d.ts +1 -1
  163. package/lib/fab/fab.d.ts +1 -1
  164. package/lib/file-picker/file-picker.d.ts +7 -7
  165. package/lib/header/header.d.ts +1 -1
  166. package/lib/listbox/definition.d.ts +3 -0
  167. package/lib/listbox/index.d.ts +1 -0
  168. package/lib/listbox/listbox.d.ts +1302 -0
  169. package/lib/listbox/listbox.template.d.ts +3 -0
  170. package/lib/listbox/variations.browser-spec.d.ts +1 -0
  171. package/lib/menu/menu.d.ts +2 -3
  172. package/lib/menu-item/menu-item.d.ts +3 -3
  173. package/lib/nav/nav.d.ts +1 -1
  174. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  175. package/lib/nav-item/nav-item.d.ts +2 -2
  176. package/lib/note/note.d.ts +1 -1
  177. package/lib/number-field/number-field.d.ts +9 -10
  178. package/lib/optgroup/definition.d.ts +3 -0
  179. package/lib/optgroup/index.d.ts +1 -0
  180. package/lib/optgroup/optgroup.d.ts +430 -0
  181. package/lib/optgroup/optgroup.template.d.ts +2 -0
  182. package/lib/optgroup/variations.browser-spec.d.ts +1 -0
  183. package/lib/option/option.d.ts +2 -2
  184. package/lib/pagination/pagination.d.ts +1 -1
  185. package/lib/popover/popover.d.ts +2 -2
  186. package/lib/progress/progress.d.ts +1 -1
  187. package/lib/progress-ring/progress-ring.d.ts +1 -1
  188. package/lib/radio/radio.d.ts +3 -3
  189. package/lib/radio-group/radio-group.d.ts +1 -1
  190. package/lib/range-slider/range-slider.d.ts +3 -3
  191. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
  192. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  193. package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
  194. package/lib/searchable-select/option-tag.d.ts +1 -1
  195. package/lib/searchable-select/searchable-select.d.ts +47 -47
  196. package/lib/select/select.d.ts +9 -9
  197. package/lib/selectable-box/selectable-box.d.ts +1 -1
  198. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
  199. package/lib/slider/slider.d.ts +3 -3
  200. package/lib/split-button/split-button.d.ts +3 -3
  201. package/lib/status/status.d.ts +1 -1
  202. package/lib/switch/switch.d.ts +2 -2
  203. package/lib/tab/tab.d.ts +3 -3
  204. package/lib/tab-panel/tab-panel.d.ts +1 -1
  205. package/lib/table/table-cell.d.ts +1 -1
  206. package/lib/table/table-header-cell.d.ts +1 -1
  207. package/lib/table/table-row.d.ts +1 -1
  208. package/lib/table/table-sorting-button.d.ts +1 -1
  209. package/lib/tag/tag.d.ts +3 -3
  210. package/lib/tag-group/tag-group.d.ts +1 -1
  211. package/lib/tag-name-map.d.ts +3 -1
  212. package/lib/text-area/text-area.d.ts +8 -8
  213. package/lib/text-field/text-field.d.ts +10 -9
  214. package/lib/time-picker/time-picker.d.ts +4 -4
  215. package/lib/toggletip/toggletip.d.ts +3 -2
  216. package/lib/tooltip/tooltip.d.ts +3 -2
  217. package/lib/tree-item/tree-item.d.ts +2 -2
  218. package/lib/tree-view/tree-view.d.ts +1 -1
  219. package/lib/video-player/video-player.d.ts +1 -1
  220. package/listbox/definition.cjs +5 -0
  221. package/listbox/definition.js +2 -0
  222. package/listbox/index.cjs +11 -0
  223. package/listbox/index.js +540 -0
  224. package/menu/index.cjs +1 -1
  225. package/menu/index.js +1 -1
  226. package/menu-item/index.cjs +1 -1
  227. package/menu-item/index.js +1 -1
  228. package/nav/definition.cjs +1 -1
  229. package/nav/definition.js +1 -1
  230. package/nav-disclosure/definition.cjs +1 -1
  231. package/nav-disclosure/definition.js +1 -1
  232. package/nav-disclosure/index.cjs +4 -4
  233. package/nav-disclosure/index.js +4 -3
  234. package/nav-item/definition.cjs +1 -1
  235. package/nav-item/definition.js +1 -1
  236. package/note/definition.cjs +1 -1
  237. package/note/definition.js +1 -1
  238. package/number-field/definition.cjs +1 -1
  239. package/number-field/definition.js +1 -1
  240. package/number-field/index.cjs +1 -1
  241. package/number-field/index.js +1 -1
  242. package/optgroup/definition.cjs +6 -0
  243. package/optgroup/definition.js +3 -0
  244. package/optgroup/index.cjs +1 -0
  245. package/optgroup/index.js +4 -0
  246. package/option/definition.cjs +2 -1
  247. package/option/definition.js +2 -1
  248. package/package.json +9 -8
  249. package/pagination/definition.cjs +1 -1
  250. package/pagination/definition.js +1 -1
  251. package/platform-switch/definition.cjs +1 -1
  252. package/platform-switch/definition.js +1 -1
  253. package/popover/definition.cjs +1 -1
  254. package/popover/definition.js +1 -1
  255. package/popover/index.cjs +5 -5
  256. package/popover/index.js +4 -3
  257. package/progress/definition.cjs +1 -1
  258. package/progress/definition.js +1 -1
  259. package/radio/definition.cjs +1 -1
  260. package/radio/definition.js +1 -1
  261. package/radio-group/definition.cjs +1 -1
  262. package/radio-group/definition.js +1 -1
  263. package/range-slider/definition.cjs +1 -1
  264. package/range-slider/definition.js +1 -1
  265. package/rich-text-editor/definition.cjs +1 -1
  266. package/rich-text-editor/definition.js +1 -1
  267. package/rich-text-editor/index.cjs +13 -13
  268. package/rich-text-editor/index.js +26 -23
  269. package/rich-text-view/definition.cjs +1 -1
  270. package/rich-text-view/definition.js +1 -1
  271. package/searchable-select/definition.cjs +1 -1
  272. package/searchable-select/definition.js +1 -1
  273. package/searchable-select/index.cjs +23 -23
  274. package/searchable-select/index.js +67 -49
  275. package/select/definition.cjs +1 -1
  276. package/select/definition.js +1 -1
  277. package/select/index.cjs +1 -1
  278. package/select/index.js +1 -1
  279. package/selectable-box/definition.cjs +1 -1
  280. package/selectable-box/definition.js +1 -1
  281. package/shared/aria/delegates-aria.d.ts +1 -1
  282. package/shared/aria/host-semantics.d.ts +1 -1
  283. package/shared/color-picker/base-color-picker.d.ts +1 -1
  284. package/shared/feedback/feedback-message.d.ts +1 -1
  285. package/shared/feedback/mixins.d.ts +2 -2
  286. package/shared/foundation/button/button.d.ts +2 -2
  287. package/shared/foundation/form-associated/form-associated.d.ts +2 -2
  288. package/shared/foundation/listbox/extractOptions.d.ts +2 -0
  289. package/shared/foundation/listbox/listbox.d.ts +2 -0
  290. package/shared/listbox/commands.d.ts +17 -0
  291. package/shared/listbox/move.d.ts +6 -0
  292. package/shared/listbox/options.d.ts +12 -0
  293. package/shared/listbox/selection.d.ts +28 -0
  294. package/shared/listbox/state.d.ts +26 -0
  295. package/shared/listbox/typeahead.d.ts +8 -0
  296. package/shared/listbox/with-options-filter.d.ts +440 -0
  297. package/shared/listbox/with-options.d.ts +862 -0
  298. package/shared/patterns/affix.d.ts +2 -2
  299. package/shared/patterns/anchored.d.ts +2 -2
  300. package/shared/patterns/char-count/char-count.d.ts +1 -1
  301. package/shared/patterns/form-elements/form-element.d.ts +1 -1
  302. package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
  303. package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
  304. package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
  305. package/shared/patterns/kbd-shortcut.d.ts +1 -1
  306. package/shared/patterns/linkable.d.ts +1 -1
  307. package/shared/patterns/localized.d.ts +2 -2
  308. package/shared/patterns/trapped-focus.d.ts +1 -1
  309. package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
  310. package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
  311. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
  312. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
  313. package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
  314. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
  315. package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
  316. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
  317. package/shared/picker-field/picker-field.d.ts +7 -7
  318. package/side-drawer/definition.cjs +1 -1
  319. package/side-drawer/definition.js +1 -1
  320. package/simple-color-picker/definition.cjs +1 -1
  321. package/simple-color-picker/definition.js +1 -1
  322. package/simple-color-picker/index.cjs +6 -6
  323. package/simple-color-picker/index.js +4 -3
  324. package/split-button/definition.cjs +1 -1
  325. package/split-button/definition.js +1 -1
  326. package/split-button/index.cjs +1 -0
  327. package/split-button/index.js +1 -0
  328. package/status/definition.cjs +1 -1
  329. package/status/definition.js +1 -1
  330. package/switch/definition.cjs +1 -1
  331. package/switch/definition.js +1 -1
  332. package/switch/index.cjs +6 -5
  333. package/switch/index.js +16 -14
  334. package/tab/definition.cjs +1 -1
  335. package/tab/definition.js +1 -1
  336. package/tab-panel/definition.cjs +1 -1
  337. package/tab-panel/definition.js +1 -1
  338. package/table/definition.cjs +1 -1
  339. package/table/definition.js +1 -1
  340. package/table/index.cjs +13 -13
  341. package/table/index.js +4 -3
  342. package/tabs/definition.cjs +1 -1
  343. package/tabs/definition.js +1 -1
  344. package/tag/definition.cjs +1 -1
  345. package/tag/definition.js +1 -1
  346. package/tag/index.cjs +11 -11
  347. package/tag/index.js +4 -3
  348. package/tag-group/definition.cjs +1 -1
  349. package/tag-group/definition.js +1 -1
  350. package/text-area/definition.cjs +1 -1
  351. package/text-area/definition.js +1 -1
  352. package/time-picker/definition.cjs +1 -1
  353. package/time-picker/definition.js +1 -1
  354. package/tree-item/definition.cjs +1 -1
  355. package/tree-item/definition.js +1 -1
  356. package/tree-view/definition.cjs +1 -1
  357. package/tree-view/definition.js +1 -1
  358. package/unbundled/affix.cjs +2 -2
  359. package/unbundled/affix.js +1 -1
  360. package/unbundled/base-progress.cjs +1 -1
  361. package/unbundled/base-progress.js +1 -1
  362. package/unbundled/button.cjs +2 -2
  363. package/unbundled/button.js +2 -2
  364. package/unbundled/definition.cjs +2 -65
  365. package/unbundled/definition.js +4 -61
  366. package/unbundled/definition11.cjs +4 -3
  367. package/unbundled/definition11.js +3 -2
  368. package/unbundled/definition12.cjs +3 -2
  369. package/unbundled/definition12.js +3 -2
  370. package/unbundled/definition13.cjs +1 -1
  371. package/unbundled/definition13.js +1 -1
  372. package/unbundled/definition14.cjs +2 -1
  373. package/unbundled/definition14.js +2 -1
  374. package/unbundled/definition17.cjs +9 -4
  375. package/unbundled/definition17.js +9 -4
  376. package/unbundled/definition2.cjs +14 -3
  377. package/unbundled/definition2.js +15 -4
  378. package/unbundled/definition21.cjs +2 -1
  379. package/unbundled/definition21.js +2 -1
  380. package/unbundled/definition23.cjs +3 -1
  381. package/unbundled/definition23.js +4 -2
  382. package/unbundled/definition24.cjs +6 -4
  383. package/unbundled/definition24.js +6 -4
  384. package/unbundled/definition25.cjs +2 -1
  385. package/unbundled/definition25.js +2 -1
  386. package/unbundled/definition26.cjs +7 -4
  387. package/unbundled/definition26.js +7 -4
  388. package/unbundled/definition27.cjs +39 -5
  389. package/unbundled/definition27.js +40 -6
  390. package/unbundled/definition28.cjs +4 -3
  391. package/unbundled/definition28.js +4 -3
  392. package/unbundled/definition29.cjs +5 -168
  393. package/unbundled/definition29.js +11 -162
  394. package/unbundled/definition30.cjs +26 -506
  395. package/unbundled/definition30.js +24 -498
  396. package/unbundled/definition31.cjs +503 -39
  397. package/unbundled/definition31.js +501 -37
  398. package/unbundled/definition32.cjs +39 -239
  399. package/unbundled/definition32.js +36 -236
  400. package/unbundled/definition33.cjs +236 -74
  401. package/unbundled/definition33.js +233 -71
  402. package/unbundled/definition34.cjs +74 -1968
  403. package/unbundled/definition34.js +70 -1940
  404. package/unbundled/definition35.cjs +1993 -26
  405. package/unbundled/definition35.js +1965 -27
  406. package/unbundled/definition36.cjs +26 -111
  407. package/unbundled/definition36.js +23 -103
  408. package/unbundled/definition37.cjs +53 -294
  409. package/unbundled/definition37.js +50 -291
  410. package/unbundled/definition38.cjs +282 -132
  411. package/unbundled/definition38.js +279 -129
  412. package/unbundled/definition39.cjs +165 -339
  413. package/unbundled/definition39.js +163 -337
  414. package/unbundled/definition40.cjs +395 -227
  415. package/unbundled/definition40.js +393 -225
  416. package/unbundled/definition41.cjs +269 -47
  417. package/unbundled/definition41.js +264 -42
  418. package/unbundled/definition42.cjs +48 -67
  419. package/unbundled/definition42.js +45 -64
  420. package/unbundled/definition43.cjs +56 -383
  421. package/unbundled/definition43.js +55 -382
  422. package/unbundled/definition44.cjs +387 -44
  423. package/unbundled/definition44.js +383 -40
  424. package/unbundled/definition45.cjs +53 -45
  425. package/unbundled/definition45.js +49 -41
  426. package/unbundled/definition46.cjs +40 -164
  427. package/unbundled/definition46.js +36 -160
  428. package/unbundled/definition47.cjs +171 -31
  429. package/unbundled/definition47.js +168 -22
  430. package/unbundled/definition48.cjs +30 -89
  431. package/unbundled/definition48.js +22 -87
  432. package/unbundled/definition49.cjs +589 -48
  433. package/unbundled/definition49.js +587 -47
  434. package/unbundled/definition50.cjs +90 -21
  435. package/unbundled/definition50.js +88 -16
  436. package/unbundled/definition51.cjs +47 -32
  437. package/unbundled/definition51.js +44 -29
  438. package/unbundled/definition52.cjs +22 -323
  439. package/unbundled/definition52.js +16 -320
  440. package/unbundled/definition53.cjs +33 -212
  441. package/unbundled/definition53.js +29 -208
  442. package/unbundled/definition54.cjs +318 -41
  443. package/unbundled/definition54.js +314 -37
  444. package/unbundled/definition55.cjs +199 -253
  445. package/unbundled/definition55.js +193 -247
  446. package/unbundled/definition56.cjs +45 -53
  447. package/unbundled/definition56.js +42 -49
  448. package/unbundled/definition57.cjs +255 -133
  449. package/unbundled/definition57.js +253 -128
  450. package/unbundled/definition58.cjs +49 -245
  451. package/unbundled/definition58.js +47 -244
  452. package/unbundled/definition59.cjs +127 -444
  453. package/unbundled/definition59.js +124 -444
  454. package/unbundled/definition6.cjs +2 -1
  455. package/unbundled/definition6.js +2 -1
  456. package/unbundled/definition60.cjs +230 -3746
  457. package/unbundled/definition60.js +223 -3576
  458. package/unbundled/definition61.cjs +427 -739
  459. package/unbundled/definition61.js +425 -737
  460. package/unbundled/definition62.cjs +3762 -103
  461. package/unbundled/definition62.js +3593 -97
  462. package/unbundled/definition63.cjs +678 -886
  463. package/unbundled/definition63.js +672 -877
  464. package/unbundled/definition64.cjs +104 -108
  465. package/unbundled/definition64.js +100 -104
  466. package/unbundled/definition65.cjs +999 -65
  467. package/unbundled/definition65.js +995 -58
  468. package/unbundled/definition66.cjs +105 -155
  469. package/unbundled/definition66.js +101 -151
  470. package/unbundled/definition67.cjs +71 -121
  471. package/unbundled/definition67.js +63 -119
  472. package/unbundled/definition68.cjs +162 -51
  473. package/unbundled/definition68.js +158 -47
  474. package/unbundled/definition69.cjs +117 -75
  475. package/unbundled/definition69.js +116 -71
  476. package/unbundled/definition70.cjs +59 -21
  477. package/unbundled/definition70.js +56 -15
  478. package/unbundled/definition71.cjs +80 -75
  479. package/unbundled/definition71.js +76 -74
  480. package/unbundled/definition72.cjs +20 -305
  481. package/unbundled/definition72.js +14 -230
  482. package/unbundled/definition73.cjs +75 -315
  483. package/unbundled/definition73.js +74 -307
  484. package/unbundled/definition74.cjs +308 -30
  485. package/unbundled/definition74.js +231 -24
  486. package/unbundled/definition75.cjs +314 -109
  487. package/unbundled/definition75.js +304 -106
  488. package/unbundled/definition76.cjs +26 -250
  489. package/unbundled/definition76.js +21 -246
  490. package/unbundled/definition77.cjs +133 -27
  491. package/unbundled/definition77.js +124 -25
  492. package/unbundled/definition78.cjs +230 -116
  493. package/unbundled/definition78.js +227 -107
  494. package/unbundled/definition79.cjs +28 -203
  495. package/unbundled/definition79.js +26 -193
  496. package/unbundled/definition80.cjs +126 -477
  497. package/unbundled/definition80.js +118 -473
  498. package/unbundled/definition81.cjs +221 -0
  499. package/unbundled/definition81.js +202 -0
  500. package/unbundled/definition82.cjs +517 -0
  501. package/unbundled/definition82.js +497 -0
  502. package/unbundled/extractOptions.cjs +21 -0
  503. package/unbundled/extractOptions.js +16 -0
  504. package/unbundled/icon.cjs +67 -0
  505. package/unbundled/icon.js +61 -0
  506. package/unbundled/linkable.cjs +1 -1
  507. package/unbundled/linkable.js +1 -1
  508. package/unbundled/listbox.cjs +29 -7
  509. package/unbundled/listbox.js +29 -7
  510. package/unbundled/mixins.cjs +2 -1
  511. package/unbundled/mixins.js +2 -1
  512. package/unbundled/optgroup.cjs +66 -0
  513. package/unbundled/optgroup.js +54 -0
  514. package/unbundled/option.cjs +176 -0
  515. package/unbundled/option.js +164 -0
  516. package/unbundled/time-selection-picker.template.cjs +1 -1
  517. package/unbundled/time-selection-picker.template.js +1 -1
  518. package/unbundled/vivid-element.cjs +10 -1
  519. package/unbundled/vivid-element.js +10 -1
  520. package/video-player/definition.cjs +1 -1
  521. package/video-player/definition.js +1 -1
  522. package/vivid.api.json +568 -231
@@ -1,277 +1,77 @@
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("./definition9.cjs");
7
- const require_definition$1 = require("./definition15.cjs");
8
- const require_definition$2 = require("./definition31.cjs");
5
+ const require_icon = require("./icon.cjs");
9
6
  const require_utils = require("./utils.cjs");
10
7
  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}";
8
+ //#region src/lib/country/country.scss?inline
9
+ 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
10
  //#endregion
14
- //#region src/lib/country-group/country-group.ts
15
- var FULLY_VISIBLE_INTERSECTION_RATIO = .99;
11
+ //#region src/lib/country/country.ts
16
12
  /**
17
13
  * @public
18
- * @component country-group
19
- * @slot default - One or more `vwc-country` elements (Country only).
14
+ * @component country
15
+ * @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
16
  */
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
- /** @internal */
163
- handleMouseEnter() {
164
- this.popupOpen = true;
165
- }
17
+ var Country = class extends require_vivid_element.VividElement {
166
18
  /** @internal */
167
- handleMouseLeave() {
168
- this.popupOpen = false;
19
+ get flagIconName() {
20
+ return require_utils.getFlagIconName(this.code);
169
21
  }
170
22
  /** @internal */
171
- popupOpenChanged(oldValue) {
172
- if (oldValue === void 0) return;
173
- if (this.popupOpen) this.fillOverflowGrid();
174
- }
175
- /** @internal */
176
- fillOverflowGrid() {
177
- if (!this.overflowGridEl) return;
178
- if (this.overflowCount === 0) return;
179
- this.overflowGridEl.replaceChildren();
180
- const overflowed = this.items.slice(this.lastVisibleIndex);
181
- for (const it of overflowed) {
182
- const clone = it.cloneNode(true);
183
- clone.setAttribute("aria-hidden", "true");
184
- clone.removeAttribute("style");
185
- this.overflowGridEl.appendChild(clone);
186
- }
23
+ get displayText() {
24
+ const customLabel = this.label?.trim();
25
+ if (customLabel) return customLabel;
26
+ const codeValue = this.code?.trim();
27
+ return codeValue ? codeValue.toUpperCase() : void 0;
187
28
  }
188
29
  };
189
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "items", void 0);
190
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "lastVisibleIndex", void 0);
191
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "computedAriaLabel", void 0);
192
- require_decorate.__decorate([_microsoft_fast_element.observable], CountryGroup.prototype, "popupOpen", void 0);
30
+ require_decorate.__decorate([_microsoft_fast_element.attr], Country.prototype, "code", void 0);
31
+ require_decorate.__decorate([_microsoft_fast_element.attr], Country.prototype, "label", void 0);
193
32
  //#endregion
194
- //#region src/lib/country-group/country-group.template.ts
195
- var CountryGroupTemplate = (context) => {
196
- const badgeTag = context.tagFor(require_definition$1.Badge);
197
- const popupTag = context.tagFor(require_definition.Popup);
33
+ //#region src/lib/country/country.template.ts
34
+ var CountryTemplate = (context) => {
35
+ const iconTag = context.tagFor(require_icon.Icon);
198
36
  return _microsoft_fast_element.html`
199
- <div
200
- class="container"
201
- ${require_delegates_aria.delegateAria({
202
- role: "group",
203
- ariaLabel: (x) => x.ariaLabel || x.computedAriaLabel
204
- })}
205
- >
206
- <slot ${(0, _microsoft_fast_element.ref)("slotEl")}></slot>
207
- ${(0, _microsoft_fast_element.when)((x) => x.overflowCount > 0, _microsoft_fast_element.html`
208
- <div
209
- class="overflow-wrap"
210
- ${(0, _microsoft_fast_element.ref)("overflowWrapEl")}
211
- style="order: ${(x) => x.lastVisibleIndex};"
212
- @mouseenter="${(x) => x.handleMouseEnter()}"
213
- @mouseleave="${(x) => x.handleMouseLeave()}"
214
- >
215
- <${badgeTag}
216
- ${(0, _microsoft_fast_element.ref)("badgeEl")}
217
- connotation="cta"
218
- appearance="duotone"
219
- shape="pill"
220
- text="${(x) => `+${x.overflowCount}`}"
221
- ></${badgeTag}>
222
- </div>
223
- `)}
224
- </div>
225
-
226
- ${(0, _microsoft_fast_element.when)((x) => x.overflowCount > 0, _microsoft_fast_element.html`
227
- <${popupTag}
228
- strategy="fixed"
229
- placement="top"
230
- alternate
231
- arrow
232
- :anchor="${(x) => x.overflowWrapEl}"
233
- :open="${(x) => x.popupOpen}"
234
- exportparts="vvd-theme-alternate"
235
- >
236
- <div
237
- class="overflow-grid"
238
- ${(0, _microsoft_fast_element.ref)("overflowGridEl")}
37
+ <div class="base">
38
+ <slot name="icon" class="icon">
39
+ ${(0, _microsoft_fast_element.when)((x) => x.flagIconName, _microsoft_fast_element.html`<${iconTag}
40
+ size="-4"
41
+ name="${(x) => x.flagIconName}"
239
42
  aria-hidden="true"
240
- ></div>
241
- </${popupTag}>
242
- `)}
43
+ ></${iconTag}>`)}
44
+ </slot>
45
+ ${(0, _microsoft_fast_element.when)((x) => x.displayText, _microsoft_fast_element.html`<span class="text">${(x) => x.displayText}</span>`)}
46
+ </div>
243
47
  `;
244
48
  };
245
49
  //#endregion
246
- //#region src/lib/country-group/definition.ts
50
+ //#region src/lib/country/definition.ts
247
51
  /** @internal */
248
- var countryGroupDefinition = require_vivid_element.defineVividComponent("country-group", CountryGroup, CountryGroupTemplate, [
249
- require_definition$2.countryDefinition,
250
- require_definition$1.badgeDefinition,
251
- require_definition.popupDefinition
252
- ], { styles: country_group_default });
52
+ var countryDefinition = require_vivid_element.defineVividComponent("country", Country, CountryTemplate, [require_definition.iconDefinition], { styles: country_default });
253
53
  /**
254
- * Registers the country-group element with the design system.
54
+ * Registers the country element with the design system.
255
55
  *
256
56
  * @param prefix - the prefix to use for the component name
257
57
  */
258
- var registerCountryGroup = require_vivid_element.createRegisterFunction(countryGroupDefinition);
58
+ var registerCountry = require_vivid_element.createRegisterFunction(countryDefinition);
259
59
  //#endregion
260
- Object.defineProperty(exports, "CountryGroup", {
60
+ Object.defineProperty(exports, "Country", {
261
61
  enumerable: true,
262
62
  get: function() {
263
- return CountryGroup;
63
+ return Country;
264
64
  }
265
65
  });
266
- Object.defineProperty(exports, "countryGroupDefinition", {
66
+ Object.defineProperty(exports, "countryDefinition", {
267
67
  enumerable: true,
268
68
  get: function() {
269
- return countryGroupDefinition;
69
+ return countryDefinition;
270
70
  }
271
71
  });
272
- Object.defineProperty(exports, "registerCountryGroup", {
72
+ Object.defineProperty(exports, "registerCountry", {
273
73
  enumerable: true,
274
74
  get: function() {
275
- return registerCountryGroup;
75
+ return registerCountry;
276
76
  }
277
77
  });
@@ -1,259 +1,59 @@
1
1
  import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
2
+ import { 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 "./definition9.js";
6
- import { r as Badge, t as badgeDefinition } from "./definition15.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 Icon } from "./icon.js";
5
+ import { t as getFlagIconName } from "./utils.js";
6
+ import { attr, html, when } from "@microsoft/fast-element";
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)}";
12
9
  //#endregion
13
- //#region src/lib/country-group/country-group.ts
14
- var FULLY_VISIBLE_INTERSECTION_RATIO = .99;
10
+ //#region src/lib/country/country.ts
15
11
  /**
16
12
  * @public
17
- * @component country-group
18
- * @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.
19
15
  */
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
- /** @internal */
162
- handleMouseEnter() {
163
- this.popupOpen = true;
164
- }
16
+ var Country = class extends VividElement {
165
17
  /** @internal */
166
- handleMouseLeave() {
167
- this.popupOpen = false;
18
+ get flagIconName() {
19
+ return getFlagIconName(this.code);
168
20
  }
169
21
  /** @internal */
170
- popupOpenChanged(oldValue) {
171
- if (oldValue === void 0) return;
172
- if (this.popupOpen) this.fillOverflowGrid();
173
- }
174
- /** @internal */
175
- fillOverflowGrid() {
176
- if (!this.overflowGridEl) return;
177
- if (this.overflowCount === 0) return;
178
- this.overflowGridEl.replaceChildren();
179
- const overflowed = this.items.slice(this.lastVisibleIndex);
180
- for (const it of overflowed) {
181
- const clone = it.cloneNode(true);
182
- clone.setAttribute("aria-hidden", "true");
183
- clone.removeAttribute("style");
184
- this.overflowGridEl.appendChild(clone);
185
- }
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;
186
27
  }
187
28
  };
188
- __decorate([observable], CountryGroup.prototype, "items", void 0);
189
- __decorate([observable], CountryGroup.prototype, "lastVisibleIndex", void 0);
190
- __decorate([observable], CountryGroup.prototype, "computedAriaLabel", void 0);
191
- __decorate([observable], CountryGroup.prototype, "popupOpen", void 0);
29
+ __decorate([attr], Country.prototype, "code", void 0);
30
+ __decorate([attr], Country.prototype, "label", void 0);
192
31
  //#endregion
193
- //#region src/lib/country-group/country-group.template.ts
194
- var CountryGroupTemplate = (context) => {
195
- const badgeTag = context.tagFor(Badge);
196
- const popupTag = context.tagFor(Popup);
32
+ //#region src/lib/country/country.template.ts
33
+ var CountryTemplate = (context) => {
34
+ const iconTag = context.tagFor(Icon);
197
35
  return html`
198
- <div
199
- class="container"
200
- ${delegateAria({
201
- role: "group",
202
- ariaLabel: (x) => x.ariaLabel || x.computedAriaLabel
203
- })}
204
- >
205
- <slot ${ref("slotEl")}></slot>
206
- ${when((x) => x.overflowCount > 0, html`
207
- <div
208
- class="overflow-wrap"
209
- ${ref("overflowWrapEl")}
210
- style="order: ${(x) => x.lastVisibleIndex};"
211
- @mouseenter="${(x) => x.handleMouseEnter()}"
212
- @mouseleave="${(x) => x.handleMouseLeave()}"
213
- >
214
- <${badgeTag}
215
- ${ref("badgeEl")}
216
- connotation="cta"
217
- appearance="duotone"
218
- shape="pill"
219
- text="${(x) => `+${x.overflowCount}`}"
220
- ></${badgeTag}>
221
- </div>
222
- `)}
223
- </div>
224
-
225
- ${when((x) => x.overflowCount > 0, html`
226
- <${popupTag}
227
- strategy="fixed"
228
- placement="top"
229
- alternate
230
- arrow
231
- :anchor="${(x) => x.overflowWrapEl}"
232
- :open="${(x) => x.popupOpen}"
233
- exportparts="vvd-theme-alternate"
234
- >
235
- <div
236
- class="overflow-grid"
237
- ${ref("overflowGridEl")}
36
+ <div class="base">
37
+ <slot name="icon" class="icon">
38
+ ${when((x) => x.flagIconName, html`<${iconTag}
39
+ size="-4"
40
+ name="${(x) => x.flagIconName}"
238
41
  aria-hidden="true"
239
- ></div>
240
- </${popupTag}>
241
- `)}
42
+ ></${iconTag}>`)}
43
+ </slot>
44
+ ${when((x) => x.displayText, html`<span class="text">${(x) => x.displayText}</span>`)}
45
+ </div>
242
46
  `;
243
47
  };
244
48
  //#endregion
245
- //#region src/lib/country-group/definition.ts
49
+ //#region src/lib/country/definition.ts
246
50
  /** @internal */
247
- var countryGroupDefinition = defineVividComponent("country-group", CountryGroup, CountryGroupTemplate, [
248
- countryDefinition,
249
- badgeDefinition,
250
- popupDefinition
251
- ], { styles: country_group_default });
51
+ var countryDefinition = defineVividComponent("country", Country, CountryTemplate, [iconDefinition], { styles: country_default });
252
52
  /**
253
- * Registers the country-group element with the design system.
53
+ * Registers the country element with the design system.
254
54
  *
255
55
  * @param prefix - the prefix to use for the component name
256
56
  */
257
- var registerCountryGroup = createRegisterFunction(countryGroupDefinition);
57
+ var registerCountry = createRegisterFunction(countryDefinition);
258
58
  //#endregion
259
- export { registerCountryGroup as n, CountryGroup as r, countryGroupDefinition as t };
59
+ export { registerCountry as n, Country as r, countryDefinition as t };