@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,58 +1,522 @@
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";
1
+ import { d as createRegisterFunction, u as defineVividComponent } from "./vivid-element.js";
2
+ import { t as iconDefinition } from "./definition.js";
3
3
  import { t as __decorate } from "./decorate.js";
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)}";
4
+ import { a as affixIconTemplateFactory, i as IconWrapper, t as AffixIcon } from "./affix.js";
5
+ import { n as FormAssociated } from "./form-associated.js";
6
+ import { r as chevronTemplateFactory } from "./definition6.js";
7
+ import { t as handleEscapeKeyAndStopPropogation } from "./dialog.js";
8
+ import { i as Popup, t as popupDefinition } from "./definition9.js";
9
+ import { r as feedbackMessageDefinition, t as WithFeedback } from "./mixins.js";
10
+ import { t as FormElement } from "./form-element.js";
11
+ import { t as WithErrorText } from "./with-error-text.js";
12
+ import { t as WithSuccessText } from "./with-success-text.js";
13
+ import { t as WithContextualHelp } from "./with-contextual-help.js";
14
+ import { t as text_field_default } from "./text-field.js";
15
+ import { n as isListboxOption } from "./option.js";
16
+ import { t as listboxOptionDefinition } from "./definition29.js";
17
+ import { n as isOptgroup } from "./optgroup.js";
18
+ import { t as optgroupDefinition } from "./definition30.js";
19
+ import { t as Listbox } from "./listbox.js";
20
+ import { Observable, attr, html, observable, ref, slotted, when } from "@microsoft/fast-element";
21
+ import { classNames, limit, uniqueId } from "@microsoft/fast-web-utilities";
22
+ //#region src/lib/combobox/combobox.scss?inline
23
+ var combobox_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}.chevron{font:var(--vvd-typography-base-extended);flex-shrink:0;display:flex;transform:rotate(0)}@media (prefers-reduced-motion:no-preference){.chevron{transition:transform .2s}}:host([data-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:not(.disabled) .chevron{cursor:pointer}.disabled .chevron{color:var(--_low-ink-color);cursor:not-allowed}:host{--_low-ink-color:var(--vvd-color-neutral-600);flex-direction:column;gap:4px;display:inline-flex;position:relative}:host([disabled]){--_low-ink-color:var(--vvd-color-neutral-400);cursor:not-allowed}.base{--_text-field-gutter-end:8px;--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-500)}.base.appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-700)}.base:hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-700)}.base.hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base:disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.base:disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.base.disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:var(--vvd-color-neutral-400)}.base.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base.error:where(:not(.disabled,:disabled)){--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-alert-50);--_appearance-color-outline:var(--vvd-color-alert-500)}.base.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-alert-50);--_appearance-color-outline:transparent}.base.success:where(:not(.disabled,:disabled)){--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-success-50);--_appearance-color-outline:var(--vvd-color-success-500)}.base.success:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-success-50);--_appearance-color-outline:transparent}.base:not(.shape-pill) .base{border-radius:var(--_text-field-border-radius)}.base.shape-pill .base{border-radius:var(--_text-field-pill-border-radius)}.base slot[name=icon]{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);pointer-events:none;line-height:1;display:inline-block;position:absolute;inset-block-start:50%;inset-inline-start:var(--_text-field-gutter-start);transform:translateY(-50%)}.base.has-meta{padding-inline-end:16px}.control{text-overflow:ellipsis;white-space:nowrap}.fieldset .leading-items-wrapper{flex-shrink:0;align-items:center;gap:8px;padding-inline-end:16px;display:flex;position:relative}.listbox{max-height:var(--combobox-height,408px);contain:paint;border-radius:8px;flex-direction:column;gap:2px;padding:4px;display:flex;overflow-y:auto}::part(popup-base){inline-size:max-content;min-inline-size:var(--_combobox-fixed-width,100%)}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .fieldset:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}}:host(:not(.has-activedescendant)){--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0}";
8
24
  //#endregion
9
- //#region src/lib/country/country.ts
25
+ //#region src/lib/combobox/combobox.options.ts
26
+ /** Autocomplete values for combobox. */
27
+ var ComboboxAutocomplete = {
28
+ inline: "inline",
29
+ list: "list",
30
+ both: "both",
31
+ none: "none"
32
+ };
33
+ //#endregion
34
+ //#region src/lib/combobox/combobox.ts
10
35
  /**
11
36
  * @public
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.
37
+ * @component combobox
38
+ * @slot - Default slot.
39
+ * @slot icon - The preferred way to add an icon to the combobox control.
40
+ * @slot meta - Slot to add meta content to the combobox control.
41
+ * @slot helper-text - Describes how to use the combobox. Alternative to the `helper-text` attribute.
42
+ * @event {CustomEvent<undefined>} change - Fires a custom 'change' event when the value updates
43
+ * @vueModel modelValue value change `event.currentTarget.value`
44
+ * @testAction fill comboboxFill
45
+ * @testAction clear comboboxClear
46
+ * @testAction selectOptionByText selectOptionByText
47
+ * @testAction selectOptionByValue selectOptionByValue
48
+ * @testRef control shadow input.control
14
49
  */
15
- var Country = class extends VividElement {
50
+ var Combobox = class extends WithContextualHelp(WithFeedback(WithErrorText(WithSuccessText(FormElement(AffixIcon(FormAssociated(Listbox))))))) {
51
+ constructor(..._args) {
52
+ super(..._args);
53
+ this.filteredOptions = [];
54
+ this.filter = "";
55
+ this._isNavigatingWithKeyboard = false;
56
+ this.fixedDropdown = false;
57
+ this.listboxId = uniqueId("listbox-");
58
+ this.maxHeight = 0;
59
+ this.open = false;
60
+ this.proxy = document.createElement("input");
61
+ }
62
+ /** @internal */
63
+ formResetCallback() {
64
+ super.formResetCallback();
65
+ this.selectedIndex = this._newDefaultSelectedIndex([], this.options, -1) ?? -1;
66
+ this.value = this.firstSelectedOption?.text || "";
67
+ }
68
+ /** Validates the element against its constraints (e.g. `required`) and updates its validity state. */
69
+ validate() {
70
+ super.validate(this.control);
71
+ }
72
+ get isAutocompleteInline() {
73
+ return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth;
74
+ }
75
+ get isAutocompleteList() {
76
+ return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth;
77
+ }
78
+ get isAutocompleteBoth() {
79
+ return this.autocomplete === ComboboxAutocomplete.both;
80
+ }
81
+ /** @internal */
82
+ openChanged() {
83
+ if (this.open) this.enqueueScrollSelectedOptionIntoViewIfNeeded();
84
+ }
85
+ /** A read-only list of options. */
86
+ get options() {
87
+ Observable.track(this, "options");
88
+ return this.filteredOptions.length ? this.filteredOptions : this._options;
89
+ }
90
+ set options(value) {
91
+ super.options = value;
92
+ }
93
+ /**
94
+ * Updates the placeholder on the proxy element.
95
+ * @internal
96
+ */
97
+ placeholderChanged() {
98
+ /* v8 ignore if -- @preserve */
99
+ if (this.proxy instanceof HTMLInputElement) this.proxy.placeholder = this.placeholder;
100
+ }
101
+ /** @internal */
102
+ valueChanged(prev, next) {
103
+ if (this.$fastController.isConnected && this.options) {
104
+ const selectedIndex = this.options.findIndex((el) => el.text.toLowerCase() === next.toLowerCase());
105
+ const prevSelectedValue = this.options[this.selectedIndex]?.text;
106
+ const nextSelectedValue = this.options[selectedIndex]?.text;
107
+ this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex;
108
+ }
109
+ super.valueChanged(prev, next);
110
+ }
111
+ /**
112
+ * Handle opening and closing the listbox when the combobox is clicked.
113
+ *
114
+ * @param e - the mouse event
115
+ * @internal
116
+ */
117
+ clickHandler(e) {
118
+ if (this.disabled || this._isFromContextualHelp(e)) return;
119
+ if (this.open) {
120
+ const capturedOption = e.target.closest(`option,[role=option],[data-vvd-component=option]`);
121
+ if (!capturedOption || capturedOption.disabled) return;
122
+ this.selectedOptions = [capturedOption];
123
+ this.control.value = capturedOption.text;
124
+ this.clearSelectionRange();
125
+ this.updateValue(true);
126
+ }
127
+ this.open = !this.open;
128
+ if (this.open) this.control.focus();
129
+ return true;
130
+ }
131
+ /**
132
+ * Handle closing the listbox when the combobox is open and the chevron icon is clicked.
133
+ *
134
+ * @param e - the mouse event
135
+ * @internal
136
+ */
137
+ _chevronIconClickHandler(e) {
138
+ if (!this.open) return;
139
+ e.stopPropagation();
140
+ this.open = false;
141
+ }
142
+ connectedCallback() {
143
+ super.connectedCallback();
144
+ if (this.value) this.initialValue = this.value;
145
+ this._popup.anchor = this._anchor;
146
+ }
147
+ /** Filter available options by text value. */
148
+ filterOptions() {
149
+ if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) this.filter = "";
150
+ this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase()));
151
+ if (this.isAutocompleteList) {
152
+ this._options.forEach((o) => {
153
+ o.hidden = !this.filteredOptions.includes(o);
154
+ });
155
+ for (const el of Array.from(this.children)) if (isOptgroup(el)) {
156
+ const hasVisibleOption = Array.from(el.children).some((child) => isListboxOption(child) && !child.hidden);
157
+ el.style.display = hasVisibleOption ? "" : "none";
158
+ }
159
+ }
160
+ }
161
+ /**
162
+ * Focus the control and scroll the first selected option into view.
163
+ *
164
+ * @internal
165
+ */
166
+ focusAndScrollOptionIntoView() {
167
+ if (this.contains(document.activeElement)) {
168
+ this.control.focus();
169
+ this.enqueueScrollSelectedOptionIntoViewIfNeeded();
170
+ }
171
+ }
16
172
  /** @internal */
17
- get flagIconName() {
18
- return getFlagIconName(this.code);
173
+ enqueueScrollSelectedOptionIntoViewIfNeeded() {
174
+ const firstSelectedOption = this.firstSelectedOption;
175
+ /* v8 ignore else -- @preserve */
176
+ if (firstSelectedOption) requestAnimationFrame(() => {
177
+ firstSelectedOption.scrollIntoView({ block: "nearest" });
178
+ });
179
+ }
180
+ /**
181
+ * Handle focus state when the element or its children lose focus.
182
+ *
183
+ * @param e - The focus event
184
+ * @internal
185
+ */
186
+ focusoutHandler(e) {
187
+ this.syncValue();
188
+ if (!this.open) return true;
189
+ const focusTarget = e.relatedTarget;
190
+ if (this.isSameNode(focusTarget)) {
191
+ this.focus();
192
+ return;
193
+ }
194
+ this.open = false;
195
+ }
196
+ /**
197
+ * Handle content changes on the control input.
198
+ *
199
+ * @param e - the input event
200
+ * @internal
201
+ */
202
+ inputHandler(e) {
203
+ this.filter = this.control.value;
204
+ this.filterOptions();
205
+ if (!this.isAutocompleteInline) this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value);
206
+ if (e.inputType.includes("deleteContent") || !this.filter.length) return true;
207
+ if (this.isAutocompleteList && !this.open) this.open = true;
208
+ if (this.isAutocompleteInline) if (this.filteredOptions.length) {
209
+ this.selectedOptions = [this.filteredOptions[0]];
210
+ this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
211
+ this.setInlineSelection();
212
+ } else this.selectedIndex = -1;
213
+ }
214
+ /**
215
+ * Handle keydown actions for listbox navigation.
216
+ *
217
+ * @param e - the keyboard event
218
+ * @internal
219
+ */
220
+ keydownHandler(e) {
221
+ const key = e.key;
222
+ if (e.ctrlKey || e.shiftKey) return true;
223
+ switch (key) {
224
+ case "Enter":
225
+ this.syncValue();
226
+ /* v8 ignore else -- @preserve */
227
+ if (this.isAutocompleteInline) this.filter = this.value;
228
+ this.open = false;
229
+ this.clearSelectionRange();
230
+ return;
231
+ case "Escape":
232
+ /* v8 ignore else -- @preserve */
233
+ if (!this.isAutocompleteInline) this.selectedIndex = -1;
234
+ if (this.open) {
235
+ this.open = false;
236
+ return;
237
+ }
238
+ this.value = "";
239
+ this.control.value = "";
240
+ this.filter = "";
241
+ this.filterOptions();
242
+ return;
243
+ case "Tab":
244
+ this.setInputToSelection();
245
+ if (!this.open) return true;
246
+ e.preventDefault();
247
+ this.open = false;
248
+ return;
249
+ case "ArrowUp":
250
+ case "ArrowDown":
251
+ this.filterOptions();
252
+ if (!this.open) {
253
+ this.open = true;
254
+ return;
255
+ }
256
+ /* v8 ignore else -- @preserve */
257
+ if (this.filteredOptions.length > 0) {
258
+ this._isNavigatingWithKeyboard = true;
259
+ super.keydownHandler(e);
260
+ this._isNavigatingWithKeyboard = false;
261
+ }
262
+ if (this.isAutocompleteInline) this.setInlineSelection();
263
+ return;
264
+ default: return true;
265
+ }
19
266
  }
20
267
  /** @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;
268
+ setSelectedOptions() {
269
+ super.setSelectedOptions();
270
+ if (!this._isNavigatingWithKeyboard) this._activeDescendant = "";
271
+ }
272
+ /**
273
+ * Ensure that the selectedIndex is within the current allowable filtered range.
274
+ *
275
+ * @param prev - the previous selected index value
276
+ * @param next - the current selected index value
277
+ *
278
+ * @internal
279
+ */
280
+ selectedIndexChanged(prev, next) {
281
+ if (this.$fastController.isConnected) {
282
+ next = limit(-1, this.options.length - 1, next);
283
+ if (next !== this.selectedIndex) {
284
+ this.selectedIndex = next;
285
+ return;
286
+ }
287
+ super.selectedIndexChanged(prev, next);
288
+ }
289
+ }
290
+ /**
291
+ * Move focus to the previous selectable option.
292
+ *
293
+ * @internal
294
+ */
295
+ selectPreviousOption() {
296
+ if (!this.disabled && this.selectedIndex >= 0) this.selectedIndex = this.selectedIndex - 1;
297
+ }
298
+ _isDefaultSelected(option) {
299
+ return super._isDefaultSelected(option) || option.text !== "" && option.text === this.initialValue;
300
+ }
301
+ /**
302
+ * Focus and set the content of the control based on the first selected option.
303
+ *
304
+ * @internal
305
+ */
306
+ setInputToSelection() {
307
+ if (this.firstSelectedOption) {
308
+ this.control.value = this.firstSelectedOption.text;
309
+ this.control.focus();
310
+ }
311
+ }
312
+ /**
313
+ * Focus, set and select the content of the control based on the first selected option.
314
+ *
315
+ * @internal
316
+ */
317
+ setInlineSelection() {
318
+ /* v8 ignore else -- @preserve */
319
+ if (this.firstSelectedOption) {
320
+ this.setInputToSelection();
321
+ this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward");
322
+ }
323
+ }
324
+ /**
325
+ * Determines if a value update should involve emitting a change event, then updates the value.
326
+ *
327
+ * @internal
328
+ */
329
+ syncValue() {
330
+ const newValue = this.firstSelectedOption?.text ?? this.control.value;
331
+ this.updateValue(this.value !== newValue);
332
+ }
333
+ /**
334
+ * Ensure that the entire list of options is used when setting the selected property.
335
+ *
336
+ * @param prev - the previous list of selected options
337
+ * @param next - the current list of selected options
338
+ *
339
+ * @internal
340
+ */
341
+ selectedOptionsChanged(_prev, next) {
342
+ if (this.$fastController.isConnected) this._options.forEach((o) => {
343
+ o.selected = next.includes(o);
344
+ });
345
+ }
346
+ /**
347
+ * Synchronize the form-associated proxy and update the value property of the element.
348
+ *
349
+ * @param prev - the previous collection of slotted option elements
350
+ * @param next - the next collection of slotted option elements
351
+ *
352
+ * @internal
353
+ */
354
+ slottedOptionsChanged(prev, next) {
355
+ super.slottedOptionsChanged(prev, next);
356
+ this.updateValue();
357
+ const scale = this.getAttribute("scale") || this.scale;
358
+ next.forEach((element) => {
359
+ if (scale) {
360
+ element.setAttribute("scale", scale);
361
+ element.scale = scale;
362
+ }
363
+ });
364
+ }
365
+ /**
366
+ * Sets the value and to match the first selected option.
367
+ *
368
+ * @param shouldEmit - if true, the change event will be emitted
369
+ *
370
+ * @internal
371
+ */
372
+ updateValue(shouldEmit) {
373
+ if (this.$fastController.isConnected) this.value = this.firstSelectedOption?.text || this.control.value;
374
+ if (shouldEmit) this.$emit("change");
375
+ }
376
+ /** @internal */
377
+ clearSelectionRange() {
378
+ const controlValueLength = this.control.value.length;
379
+ this.control.setSelectionRange(controlValueLength, controlValueLength);
26
380
  }
27
381
  };
28
- __decorate([attr], Country.prototype, "code", void 0);
29
- __decorate([attr], Country.prototype, "label", void 0);
382
+ __decorate([attr({
383
+ attribute: "autocomplete",
384
+ mode: "fromView"
385
+ })], Combobox.prototype, "autocomplete", void 0);
386
+ __decorate([attr], Combobox.prototype, "appearance", void 0);
387
+ __decorate([attr], Combobox.prototype, "shape", void 0);
388
+ __decorate([attr()], Combobox.prototype, "scale", void 0);
389
+ __decorate([attr], Combobox.prototype, "placement", void 0);
390
+ __decorate([attr({
391
+ mode: "boolean",
392
+ attribute: "fixed-dropdown"
393
+ })], Combobox.prototype, "fixedDropdown", void 0);
394
+ __decorate([observable], Combobox.prototype, "metaSlottedContent", void 0);
395
+ __decorate([observable], Combobox.prototype, "maxHeight", void 0);
396
+ __decorate([attr({
397
+ attribute: "open",
398
+ mode: "boolean"
399
+ })], Combobox.prototype, "open", void 0);
400
+ __decorate([attr], Combobox.prototype, "placeholder", void 0);
30
401
  //#endregion
31
- //#region src/lib/country/country.template.ts
32
- var CountryTemplate = (context) => {
33
- const iconTag = context.tagFor(Icon);
34
- return html`
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}"
40
- aria-hidden="true"
41
- ></${iconTag}>`)}
42
- </slot>
43
- ${when((x) => x.displayText, html`<span class="text">${(x) => x.displayText}</span>`)}
402
+ //#region src/lib/combobox/combobox.template.ts
403
+ function renderLabel() {
404
+ return html` <label for="control" class="label">
405
+ ${(x) => x.label}
406
+ </label>`;
407
+ }
408
+ function setFixedDropdownVarWidth(x) {
409
+ return x.open && x.fixedDropdown ? `--_combobox-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
410
+ }
411
+ function renderInput(context) {
412
+ const affixIconTemplate = affixIconTemplateFactory(context);
413
+ const chevronTemplate = chevronTemplateFactory(context);
414
+ return html` <div
415
+ class="${(x) => classNames("base", ["disabled", x.disabled], [`shape-${x.shape}`, Boolean(x.shape)], [`size-${x.scale}`, Boolean(x.scale)], ["placeholder", Boolean(x.placeholder)], [`appearance-${x.appearance}`, Boolean(x.appearance)], ["no-label", !x.label], ["has-icon", !!x.icon || Boolean(x.iconSlottedContent?.length)], ["has-meta", Boolean(x.metaSlottedContent?.length)], ["has-activedescendant", Boolean(x._activeDescendant) && x.open], ["error", Boolean(x.errorValidationMessage)], ["success", !!x.successText])}"
416
+ ${ref("_anchor")}
417
+ >
418
+ <div
419
+ class="label-wrapper"
420
+ ?hidden=${(x) => !x.label && !x._hasContextualHelp}
421
+ >
422
+ ${when((x) => x.label, renderLabel())}
423
+ <slot
424
+ name="contextual-help"
425
+ ${slotted("_contextualHelpSlottedContent")}
426
+ ></slot>
44
427
  </div>
428
+ <div class="fieldset">
429
+ ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
430
+ <div class="wrapper">
431
+ <input
432
+ id="control"
433
+ autocomplete="off"
434
+ class="control"
435
+ aria-activedescendant="${(x) => x.open ? x._activeDescendant : null}"
436
+ aria-autocomplete="${(x) => x.autocomplete}"
437
+ aria-controls="${(x) => x.listboxId}"
438
+ aria-expanded="${(x) => x.open}"
439
+ aria-haspopup="listbox"
440
+ aria-describedby="${(x) => x._feedbackDescribedBy}"
441
+ placeholder="${(x) => x.placeholder}"
442
+ role="combobox"
443
+ type="text"
444
+ ?disabled="${(x) => x.disabled}"
445
+ :value="${(x) => x.value}"
446
+ @input="${(x, c) => x.inputHandler(c.event)}"
447
+ ${ref("control")}
448
+ />
449
+ </div>
450
+ <div class="leading-items-wrapper">
451
+ <slot name="meta" ${slotted("metaSlottedContent")}></slot>
452
+ <div
453
+ @click="${(x, c) => x._chevronIconClickHandler(c.event)}"
454
+ >
455
+ ${chevronTemplate}
456
+ </div>
457
+ </div>
458
+ </div>
459
+ </div>`;
460
+ }
461
+ var comboboxTemplate = (context) => {
462
+ const popupTag = context.tagFor(Popup);
463
+ return html`
464
+ <template
465
+ tabindex="${(x) => !x.disabled ? "0" : null}"
466
+ class="${(x) => classNames(["has-activedescendant", Boolean(x._activeDescendant) && x.open])}"
467
+ @click="${(x, c) => x.clickHandler(c.event)}"
468
+ @focusout="${(x, c) => x.focusoutHandler(c.event)}"
469
+ @keydown="${(x, { event }) => {
470
+ if (x.open) handleEscapeKeyAndStopPropogation(event);
471
+ return x.keydownHandler(event);
472
+ }}"
473
+ >
474
+ <div class="control-wrapper">
475
+ ${() => renderInput(context)}
476
+ <${popupTag} class="popup"
477
+ style="${setFixedDropdownVarWidth}"
478
+ ?open="${(x) => x.open}"
479
+ placement="${(x) => x.placement ?? "bottom-start"}"
480
+ strategy="${(x) => x.fixedDropdown ? "fixed" : "absolute"}"
481
+ ${ref("_popup")}>
482
+ <div id="${(x) => x.listboxId}"
483
+ class="listbox"
484
+ role="listbox"
485
+ ?disabled="${(x) => x.disabled}"
486
+ ${ref("listbox")}>
487
+ <slot ${slotted({
488
+ filter: Listbox.slottedOptionFilter,
489
+ flatten: true,
490
+ property: "slottedOptions"
491
+ })}>
492
+ </slot>
493
+ </div>
494
+ </${popupTag}>
495
+ </div>
496
+ <div class="feedback-wrapper" @click="${(_, c) => c.event.stopPropagation()}">
497
+ ${(x) => x._getFeedbackTemplate(context)}
498
+ </div>
499
+ </template>
45
500
  `;
46
501
  };
47
502
  //#endregion
48
- //#region src/lib/country/definition.ts
503
+ //#region src/lib/combobox/definition.ts
49
504
  /** @internal */
50
- var countryDefinition = defineVividComponent("country", Country, CountryTemplate, [iconDefinition], { styles: country_default });
505
+ var comboboxDefinition = defineVividComponent("combobox", Combobox, comboboxTemplate, [
506
+ iconDefinition,
507
+ popupDefinition,
508
+ listboxOptionDefinition,
509
+ optgroupDefinition,
510
+ feedbackMessageDefinition
511
+ ], {
512
+ styles: [text_field_default, combobox_default],
513
+ shadowOptions: { delegatesFocus: true }
514
+ });
51
515
  /**
52
- * Registers the country element with the design system.
516
+ * Registers the combobox elements with the design system.
53
517
  *
54
518
  * @param prefix - the prefix to use for the component name
55
519
  */
56
- var registerCountry = createRegisterFunction(countryDefinition);
520
+ var registerCombobox = createRegisterFunction(comboboxDefinition);
57
521
  //#endregion
58
- export { registerCountry as n, Country as r, countryDefinition as t };
522
+ export { registerCombobox as n, Combobox as r, comboboxDefinition as t };