@vonage/vivid 5.23.0 → 5.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/action-group/index.cjs +1 -1
  2. package/action-group/index.js +1 -1
  3. package/alert/definition.cjs +1 -1
  4. package/alert/definition.js +1 -1
  5. package/alert/index.cjs +7 -7
  6. package/alert/index.js +13 -14
  7. package/audio-player/definition.cjs +1 -1
  8. package/audio-player/definition.js +1 -1
  9. package/audio-player/index.cjs +18 -16
  10. package/audio-player/index.js +21 -19
  11. package/avatar/definition.cjs +1 -1
  12. package/avatar/definition.js +1 -1
  13. package/avatar/index.cjs +4 -4
  14. package/avatar/index.js +6 -6
  15. package/badge/definition.cjs +1 -1
  16. package/badge/definition.js +1 -1
  17. package/banner/definition.cjs +1 -1
  18. package/banner/definition.js +1 -1
  19. package/banner/index.cjs +3 -3
  20. package/banner/index.js +8 -8
  21. package/breadcrumb/definition.cjs +1 -1
  22. package/breadcrumb/definition.js +1 -1
  23. package/breadcrumb-item/definition.cjs +1 -1
  24. package/breadcrumb-item/definition.js +1 -1
  25. package/breadcrumb-item/index.cjs +2 -2
  26. package/breadcrumb-item/index.js +5 -5
  27. package/bundled/affix.cjs +1 -1
  28. package/bundled/affix.js +1 -1
  29. package/bundled/base-color-picker.cjs +2 -2
  30. package/bundled/base-color-picker.js +5 -5
  31. package/bundled/calendar-picker.template.cjs +1 -1
  32. package/bundled/calendar-picker.template.js +1 -1
  33. package/bundled/definition11.cjs +4 -4
  34. package/bundled/definition11.js +5 -5
  35. package/bundled/definition12.cjs +9 -7
  36. package/bundled/definition12.js +28 -26
  37. package/bundled/definition13.cjs +9 -7
  38. package/bundled/definition13.js +16 -15
  39. package/bundled/definition15.cjs +6 -6
  40. package/bundled/definition15.js +17 -17
  41. package/bundled/definition16.cjs +4 -2
  42. package/bundled/definition16.js +8 -6
  43. package/bundled/definition17.cjs +8 -6
  44. package/bundled/definition17.js +15 -14
  45. package/bundled/definition18.cjs +23 -23
  46. package/bundled/definition18.js +51 -52
  47. package/bundled/definition19.cjs +3 -1
  48. package/bundled/definition19.js +3 -1
  49. package/bundled/definition2.cjs +1 -13
  50. package/bundled/definition2.js +181 -48
  51. package/bundled/definition20.cjs +11 -9
  52. package/bundled/definition20.js +25 -23
  53. package/bundled/definition21.cjs +6 -6
  54. package/bundled/definition21.js +7 -8
  55. package/bundled/definition22.cjs +5 -3
  56. package/bundled/definition22.js +13 -11
  57. package/bundled/definition23.cjs +1 -1
  58. package/bundled/definition23.js +2 -2
  59. package/bundled/definition24.cjs +10 -10
  60. package/bundled/definition24.js +12 -12
  61. package/bundled/definition3.cjs +13 -1
  62. package/bundled/definition3.js +48 -181
  63. package/bundled/definition4.cjs +9 -7
  64. package/bundled/definition4.js +18 -16
  65. package/bundled/definition5.cjs +5 -5
  66. package/bundled/definition5.js +9 -9
  67. package/bundled/definition6.cjs +3 -3
  68. package/bundled/definition6.js +16 -16
  69. package/bundled/definition7.cjs +1 -1
  70. package/bundled/definition7.js +1 -1
  71. package/bundled/definition8.cjs +7 -7
  72. package/bundled/definition8.js +9 -7
  73. package/bundled/definition9.cjs +4 -4
  74. package/bundled/definition9.js +12 -12
  75. package/bundled/mixins.cjs +3 -3
  76. package/bundled/mixins.js +5 -5
  77. package/bundled/numberConverter.cjs +1 -1
  78. package/bundled/numberConverter.js +36 -1
  79. package/bundled/picker-field.template.cjs +13 -13
  80. package/bundled/picker-field.template.js +16 -16
  81. package/bundled/slider.template.cjs +8 -8
  82. package/bundled/slider.template.js +9 -9
  83. package/bundled/text-field.cjs +1 -1
  84. package/bundled/text-field.js +1 -1
  85. package/bundled/time-selection-picker.template.cjs +3 -3
  86. package/bundled/time-selection-picker.template.js +9 -9
  87. package/bundled/vivid-element.cjs +1 -1
  88. package/bundled/vivid-element.js +1 -1
  89. package/button/definition.cjs +1 -1
  90. package/button/definition.js +1 -1
  91. package/calendar/definition.cjs +1 -1
  92. package/calendar/definition.js +1 -1
  93. package/calendar/index.cjs +9 -9
  94. package/calendar/index.js +7 -7
  95. package/calendar-event/definition.cjs +1 -1
  96. package/calendar-event/definition.js +1 -1
  97. package/calendar-event/index.cjs +2 -2
  98. package/calendar-event/index.js +2 -2
  99. package/card/definition.cjs +1 -1
  100. package/card/definition.js +1 -1
  101. package/card/index.cjs +3 -3
  102. package/card/index.js +6 -6
  103. package/color-picker/index.cjs +10 -10
  104. package/color-picker/index.js +52 -52
  105. package/combobox/index.cjs +14 -11
  106. package/combobox/index.js +38 -36
  107. package/custom-elements.json +4235 -4883
  108. package/data-grid/index.cjs +8 -6
  109. package/data-grid/index.js +20 -18
  110. package/dial-pad/index.cjs +22 -20
  111. package/dial-pad/index.js +36 -34
  112. package/dialog/index.cjs +14 -14
  113. package/dialog/index.js +17 -18
  114. package/elevation/definition.cjs +1 -1
  115. package/elevation/definition.js +1 -1
  116. package/empty-state/index.cjs +4 -4
  117. package/empty-state/index.js +7 -11
  118. package/fab/index.cjs +4 -4
  119. package/fab/index.js +9 -13
  120. package/file-picker/index.cjs +8 -8
  121. package/file-picker/index.js +19 -19
  122. package/flag/index.cjs +5 -5
  123. package/flag/index.js +8 -12
  124. package/header/index.cjs +5 -5
  125. package/header/index.js +4 -8
  126. package/icon/index.cjs +1 -1
  127. package/icon/index.js +1 -1
  128. package/index.cjs +15 -14
  129. package/index.js +16 -16
  130. package/kbd-key/index.cjs +3 -3
  131. package/kbd-key/index.js +2 -6
  132. package/layout/index.cjs +3 -1
  133. package/layout/index.js +3 -1
  134. package/lib/accordion/variations.browser-spec.d.ts +1 -0
  135. package/lib/accordion-item/variations.browser-spec.d.ts +1 -0
  136. package/lib/action-group/variations.browser-spec.d.ts +1 -0
  137. package/lib/alert/variations.browser-spec.d.ts +1 -0
  138. package/lib/audio-player/variations.browser-spec.d.ts +1 -0
  139. package/lib/avatar/variations.browser-spec.d.ts +1 -0
  140. package/lib/badge/badge.d.ts +4 -4
  141. package/lib/badge/badge.template.d.ts +1 -2
  142. package/lib/badge/variations.browser-spec.d.ts +1 -0
  143. package/lib/banner/variations.browser-spec.d.ts +1 -0
  144. package/lib/breadcrumb-item/variations.browser-spec.d.ts +1 -0
  145. package/lib/button/variations.browser-spec.d.ts +1 -0
  146. package/lib/calendar/variations.browser-spec.d.ts +1 -0
  147. package/lib/calendar-event/variations.browser-spec.d.ts +1 -0
  148. package/lib/card/card.d.ts +4 -4
  149. package/lib/card/variations.browser-spec.d.ts +1 -0
  150. package/lib/checkbox/variations.browser-spec.d.ts +1 -0
  151. package/lib/color-picker/color-picker.d.ts +1 -1
  152. package/lib/color-picker/variations.browser-spec.d.ts +1 -0
  153. package/lib/combobox/variations.browser-spec.d.ts +1 -0
  154. package/lib/contextual-help/variations.browser-spec.d.ts +1 -0
  155. package/lib/country/variations.browser-spec.d.ts +1 -0
  156. package/lib/data-grid/variations.browser-spec.d.ts +1 -0
  157. package/lib/date-picker/variations.browser-spec.d.ts +1 -0
  158. package/lib/date-range-picker/variations.browser-spec.d.ts +1 -0
  159. package/lib/date-time-picker/variations.browser-spec.d.ts +1 -0
  160. package/lib/dial-pad/variations.browser-spec.d.ts +1 -0
  161. package/lib/dialog/variations.browser-spec.d.ts +1 -0
  162. package/lib/divider/variations.browser-spec.d.ts +1 -0
  163. package/lib/empty-state/variations.browser-spec.d.ts +1 -0
  164. package/lib/fab/fab.d.ts +5 -5
  165. package/lib/fab/variations.browser-spec.d.ts +1 -0
  166. package/lib/file-picker/variations.browser-spec.d.ts +1 -0
  167. package/lib/flag/variations.browser-spec.d.ts +1 -0
  168. package/lib/header/variations.browser-spec.d.ts +1 -0
  169. package/lib/icon/variations.browser-spec.d.ts +1 -0
  170. package/lib/kbd-key/variations.browser-spec.d.ts +1 -0
  171. package/lib/kbd-shortcut/variations.browser-spec.d.ts +1 -0
  172. package/lib/layout/variations.browser-spec.d.ts +1 -0
  173. package/lib/menu/variations.browser-spec.d.ts +1 -0
  174. package/lib/menu-item/variations.browser-spec.d.ts +1 -0
  175. package/lib/nav/variations.browser-spec.d.ts +1 -0
  176. package/lib/nav-disclosure/variations.browser-spec.d.ts +1 -0
  177. package/lib/nav-item/variations.browser-spec.d.ts +1 -0
  178. package/lib/note/variations.browser-spec.d.ts +1 -0
  179. package/lib/number-field/variations.browser-spec.d.ts +1 -0
  180. package/lib/option/variations.browser-spec.d.ts +1 -0
  181. package/lib/pagination/variations.browser-spec.d.ts +1 -0
  182. package/lib/popover/variations.browser-spec.d.ts +1 -0
  183. package/lib/progress/variations.browser-spec.d.ts +1 -0
  184. package/lib/progress-ring/variations.browser-spec.d.ts +1 -0
  185. package/lib/radio/variations.browser-spec.d.ts +1 -0
  186. package/lib/radio-group/variations.browser-spec.d.ts +1 -0
  187. package/lib/range-slider/variations.browser-spec.d.ts +1 -0
  188. package/lib/rich-text-editor/rte/features/internal/cursor-fix.d.ts +6 -1
  189. package/lib/rich-text-editor/variations.browser-spec.d.ts +1 -0
  190. package/lib/rich-text-view/variations.browser-spec.d.ts +1 -0
  191. package/lib/searchable-select/variations.browser-spec.d.ts +1 -0
  192. package/lib/select/variations.browser-spec.d.ts +1 -0
  193. package/lib/selectable-box/variations.browser-spec.d.ts +1 -0
  194. package/lib/side-drawer/variations.browser-spec.d.ts +1 -0
  195. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
  196. package/lib/simple-color-picker/variations.browser-spec.d.ts +1 -0
  197. package/lib/slider/variations.browser-spec.d.ts +1 -0
  198. package/lib/split-button/variations.browser-spec.d.ts +1 -0
  199. package/lib/status/variations.browser-spec.d.ts +1 -0
  200. package/lib/switch/variations.browser-spec.d.ts +1 -0
  201. package/lib/tab/tab.d.ts +12 -12
  202. package/lib/table/variations.browser-spec.d.ts +1 -0
  203. package/lib/tabs/variations.browser-spec.d.ts +1 -0
  204. package/lib/tag/tag.d.ts +12 -12
  205. package/lib/tag/variations.browser-spec.d.ts +1 -0
  206. package/lib/text-area/text-area.template.d.ts +1 -2
  207. package/lib/text-area/variations.browser-spec.d.ts +1 -0
  208. package/lib/text-field/variations.browser-spec.d.ts +1 -0
  209. package/lib/time-picker/variations.browser-spec.d.ts +1 -0
  210. package/lib/toggletip/variations.browser-spec.d.ts +1 -0
  211. package/lib/tooltip/variations.browser-spec.d.ts +1 -0
  212. package/lib/tree-item/variations.browser-spec.d.ts +1 -0
  213. package/lib/video-player/variations.browser-spec.d.ts +1 -0
  214. package/menu/definition.cjs +1 -1
  215. package/menu/definition.js +1 -1
  216. package/menu-item/definition.cjs +1 -1
  217. package/menu-item/definition.js +1 -1
  218. package/nav-disclosure/index.cjs +6 -6
  219. package/nav-disclosure/index.js +11 -15
  220. package/nav-item/index.cjs +2 -2
  221. package/nav-item/index.js +11 -15
  222. package/note/index.cjs +5 -5
  223. package/note/index.js +10 -11
  224. package/number-field/index.cjs +12 -12
  225. package/number-field/index.js +34 -35
  226. package/package.json +19 -10
  227. package/popover/index.cjs +8 -8
  228. package/popover/index.js +11 -15
  229. package/popup/definition.cjs +1 -1
  230. package/popup/definition.js +1 -1
  231. package/progress/index.cjs +8 -8
  232. package/progress/index.js +9 -10
  233. package/range-slider/index.cjs +10 -8
  234. package/range-slider/index.js +26 -24
  235. package/rich-text-editor/index.cjs +3 -3
  236. package/rich-text-editor/index.js +758 -747
  237. package/searchable-select/definition.cjs +1 -0
  238. package/searchable-select/definition.js +2 -2
  239. package/searchable-select/index.cjs +30 -27
  240. package/searchable-select/index.js +80 -76
  241. package/selectable-box/index.cjs +8 -8
  242. package/selectable-box/index.js +8 -9
  243. package/side-drawer/index.cjs +3 -3
  244. package/side-drawer/index.js +3 -3
  245. package/simple-color-picker/index.cjs +4 -4
  246. package/simple-color-picker/index.js +6 -6
  247. package/slider/definition.cjs +1 -1
  248. package/slider/definition.js +1 -1
  249. package/slider/index.cjs +1 -1
  250. package/slider/index.js +1 -1
  251. package/split-button/index.cjs +4 -4
  252. package/split-button/index.js +9 -9
  253. package/status/index.cjs +7 -5
  254. package/status/index.js +14 -12
  255. package/styles/core/all.css +5 -7
  256. package/styles/core/theme.css +5 -7
  257. package/styles/core/typography.css +0 -3
  258. package/styles/tokens/vivid-2-compat.css +1 -6
  259. package/switch/index.cjs +3 -3
  260. package/switch/index.js +5 -5
  261. package/table/index.cjs +10 -10
  262. package/table/index.js +12 -12
  263. package/tabs/index.cjs +6 -4
  264. package/tabs/index.js +10 -9
  265. package/tag/index.cjs +6 -6
  266. package/tag/index.js +8 -8
  267. package/text-area/index.cjs +8 -6
  268. package/text-area/index.js +20 -19
  269. package/unbundled/affix.cjs +2 -7
  270. package/unbundled/affix.js +2 -7
  271. package/unbundled/anchored.cjs +2 -6
  272. package/unbundled/anchored.js +2 -6
  273. package/unbundled/aria-binding-directive.cjs +1 -3
  274. package/unbundled/aria-binding-directive.js +1 -3
  275. package/unbundled/base-color-picker.cjs +18 -52
  276. package/unbundled/base-color-picker.js +18 -52
  277. package/unbundled/base-progress.cjs +4 -14
  278. package/unbundled/base-progress.js +4 -14
  279. package/unbundled/button.cjs +2 -8
  280. package/unbundled/button.js +2 -8
  281. package/unbundled/calendar-picker.template.cjs +31 -85
  282. package/unbundled/calendar-picker.template.js +30 -84
  283. package/unbundled/char-count.cjs +2 -4
  284. package/unbundled/char-count.js +2 -4
  285. package/unbundled/data-grid.options.cjs +3 -19
  286. package/unbundled/data-grid.options.js +3 -19
  287. package/unbundled/definition.cjs +3 -8
  288. package/unbundled/definition.js +3 -8
  289. package/unbundled/definition10.cjs +316 -211
  290. package/unbundled/definition10.js +313 -202
  291. package/unbundled/definition11.cjs +262 -356
  292. package/unbundled/definition11.js +248 -354
  293. package/unbundled/definition12.cjs +243 -274
  294. package/unbundled/definition12.js +241 -260
  295. package/unbundled/definition13.cjs +341 -255
  296. package/unbundled/definition13.js +338 -252
  297. package/unbundled/definition14.cjs +61 -371
  298. package/unbundled/definition14.js +57 -367
  299. package/unbundled/definition15.cjs +32 -77
  300. package/unbundled/definition15.js +28 -73
  301. package/unbundled/definition16.cjs +120 -32
  302. package/unbundled/definition16.js +117 -29
  303. package/unbundled/definition17.cjs +24 -132
  304. package/unbundled/definition17.js +24 -126
  305. package/unbundled/definition18.cjs +74 -26
  306. package/unbundled/definition18.js +67 -25
  307. package/unbundled/definition19.cjs +33 -79
  308. package/unbundled/definition19.js +32 -73
  309. package/unbundled/definition2.cjs +3 -6
  310. package/unbundled/definition2.js +3 -6
  311. package/unbundled/definition20.cjs +272 -29
  312. package/unbundled/definition20.js +264 -27
  313. package/unbundled/definition21.cjs +135 -263
  314. package/unbundled/definition21.js +133 -260
  315. package/unbundled/definition22.cjs +17 -155
  316. package/unbundled/definition22.js +13 -151
  317. package/unbundled/definition23.cjs +8 -17
  318. package/unbundled/definition23.js +8 -17
  319. package/unbundled/definition24.cjs +4 -10
  320. package/unbundled/definition24.js +4 -10
  321. package/unbundled/definition25.cjs +2 -10
  322. package/unbundled/definition25.js +2 -10
  323. package/unbundled/definition26.cjs +28 -70
  324. package/unbundled/definition26.js +28 -70
  325. package/unbundled/definition27.cjs +6 -13
  326. package/unbundled/definition27.js +6 -13
  327. package/unbundled/definition28.cjs +30 -77
  328. package/unbundled/definition28.js +30 -77
  329. package/unbundled/definition29.cjs +7 -14
  330. package/unbundled/definition29.js +7 -14
  331. package/unbundled/definition3.cjs +5 -16
  332. package/unbundled/definition3.js +5 -16
  333. package/unbundled/definition30.cjs +20 -51
  334. package/unbundled/definition30.js +20 -51
  335. package/unbundled/definition31.cjs +2 -4
  336. package/unbundled/definition31.js +2 -4
  337. package/unbundled/definition32.cjs +7 -17
  338. package/unbundled/definition32.js +7 -17
  339. package/unbundled/definition33.cjs +4 -9
  340. package/unbundled/definition33.js +4 -9
  341. package/unbundled/definition34.cjs +51 -141
  342. package/unbundled/definition34.js +51 -141
  343. package/unbundled/definition35.cjs +4 -5
  344. package/unbundled/definition35.js +4 -5
  345. package/unbundled/definition36.cjs +16 -38
  346. package/unbundled/definition36.js +14 -36
  347. package/unbundled/definition37.cjs +33 -89
  348. package/unbundled/definition37.js +31 -87
  349. package/unbundled/definition38.cjs +18 -44
  350. package/unbundled/definition38.js +16 -42
  351. package/unbundled/definition39.cjs +16 -32
  352. package/unbundled/definition39.js +13 -29
  353. package/unbundled/definition4.cjs +2 -11
  354. package/unbundled/definition4.js +2 -7
  355. package/unbundled/definition40.cjs +9 -20
  356. package/unbundled/definition40.js +9 -20
  357. package/unbundled/definition41.cjs +3 -6
  358. package/unbundled/definition41.js +3 -6
  359. package/unbundled/definition42.cjs +3 -6
  360. package/unbundled/definition42.js +3 -6
  361. package/unbundled/definition43.cjs +24 -67
  362. package/unbundled/definition43.js +24 -67
  363. package/unbundled/definition44.cjs +3 -6
  364. package/unbundled/definition44.js +3 -6
  365. package/unbundled/definition45.cjs +1 -3
  366. package/unbundled/definition45.js +1 -3
  367. package/unbundled/definition46.cjs +5 -14
  368. package/unbundled/definition46.js +5 -14
  369. package/unbundled/definition47.cjs +4 -5
  370. package/unbundled/definition47.js +5 -11
  371. package/unbundled/definition48.cjs +5 -12
  372. package/unbundled/definition48.js +5 -12
  373. package/unbundled/definition49.cjs +3 -7
  374. package/unbundled/definition49.js +3 -7
  375. package/unbundled/definition5.cjs +2 -5
  376. package/unbundled/definition5.js +2 -5
  377. package/unbundled/definition50.cjs +1 -3
  378. package/unbundled/definition50.js +1 -3
  379. package/unbundled/definition51.cjs +2 -5
  380. package/unbundled/definition51.js +2 -5
  381. package/unbundled/definition52.cjs +19 -44
  382. package/unbundled/definition52.js +16 -41
  383. package/unbundled/definition53.cjs +5 -13
  384. package/unbundled/definition53.js +5 -13
  385. package/unbundled/definition54.cjs +2 -6
  386. package/unbundled/definition54.js +2 -6
  387. package/unbundled/definition55.cjs +23 -65
  388. package/unbundled/definition55.js +23 -65
  389. package/unbundled/definition56.cjs +2 -5
  390. package/unbundled/definition56.js +2 -5
  391. package/unbundled/definition57.cjs +11 -24
  392. package/unbundled/definition57.js +11 -26
  393. package/unbundled/definition58.cjs +10 -30
  394. package/unbundled/definition58.js +10 -30
  395. package/unbundled/definition59.cjs +19 -48
  396. package/unbundled/definition59.js +19 -48
  397. package/unbundled/definition6.cjs +179 -17
  398. package/unbundled/definition6.js +170 -14
  399. package/unbundled/definition60.cjs +70 -54
  400. package/unbundled/definition60.js +70 -54
  401. package/unbundled/definition61.cjs +22 -54
  402. package/unbundled/definition61.js +22 -54
  403. package/unbundled/definition62.cjs +3 -9
  404. package/unbundled/definition62.js +3 -9
  405. package/unbundled/definition63.cjs +62 -130
  406. package/unbundled/definition63.js +60 -131
  407. package/unbundled/definition64.cjs +5 -12
  408. package/unbundled/definition64.js +5 -12
  409. package/unbundled/definition65.cjs +6 -14
  410. package/unbundled/definition65.js +6 -19
  411. package/unbundled/definition66.cjs +13 -35
  412. package/unbundled/definition66.js +13 -35
  413. package/unbundled/definition67.cjs +3 -5
  414. package/unbundled/definition67.js +3 -5
  415. package/unbundled/definition68.cjs +4 -5
  416. package/unbundled/definition68.js +4 -5
  417. package/unbundled/definition69.cjs +6 -15
  418. package/unbundled/definition69.js +6 -17
  419. package/unbundled/definition7.cjs +31 -177
  420. package/unbundled/definition7.js +24 -170
  421. package/unbundled/definition70.cjs +1 -3
  422. package/unbundled/definition70.js +1 -3
  423. package/unbundled/definition71.cjs +7 -12
  424. package/unbundled/definition71.js +7 -12
  425. package/unbundled/definition72.cjs +11 -25
  426. package/unbundled/definition72.js +11 -25
  427. package/unbundled/definition73.cjs +15 -39
  428. package/unbundled/definition73.js +15 -39
  429. package/unbundled/definition74.cjs +1 -3
  430. package/unbundled/definition74.js +1 -3
  431. package/unbundled/definition75.cjs +5 -11
  432. package/unbundled/definition75.js +5 -11
  433. package/unbundled/definition76.cjs +24 -59
  434. package/unbundled/definition76.js +24 -59
  435. package/unbundled/definition77.cjs +6 -8
  436. package/unbundled/definition77.js +4 -6
  437. package/unbundled/definition78.cjs +7 -13
  438. package/unbundled/definition78.js +7 -13
  439. package/unbundled/definition79.cjs +5 -15
  440. package/unbundled/definition79.js +5 -15
  441. package/unbundled/definition8.cjs +152 -36
  442. package/unbundled/definition8.js +148 -31
  443. package/unbundled/definition80.cjs +9 -25
  444. package/unbundled/definition80.js +9 -25
  445. package/unbundled/definition9.cjs +200 -135
  446. package/unbundled/definition9.js +189 -130
  447. package/unbundled/delegates-aria.cjs +1 -3
  448. package/unbundled/delegates-aria.js +1 -3
  449. package/unbundled/divider.cjs +2 -7
  450. package/unbundled/divider.js +2 -7
  451. package/unbundled/form-associated.cjs +20 -60
  452. package/unbundled/form-associated.js +20 -60
  453. package/unbundled/form-element.cjs +5 -15
  454. package/unbundled/form-element.js +5 -15
  455. package/unbundled/host-semantics.cjs +1 -3
  456. package/unbundled/host-semantics.js +1 -3
  457. package/unbundled/kbd-shortcut.cjs +1 -3
  458. package/unbundled/kbd-shortcut.js +1 -3
  459. package/unbundled/linkable.cjs +1 -3
  460. package/unbundled/linkable.js +1 -3
  461. package/unbundled/listbox.cjs +6 -20
  462. package/unbundled/listbox.js +6 -20
  463. package/unbundled/localized.cjs +3 -9
  464. package/unbundled/localized.js +3 -9
  465. package/unbundled/mixins.cjs +9 -25
  466. package/unbundled/mixins.js +9 -25
  467. package/unbundled/numberConverter.cjs +39 -9
  468. package/unbundled/numberConverter.js +39 -9
  469. package/unbundled/picker-field.template.cjs +16 -36
  470. package/unbundled/picker-field.template.js +16 -36
  471. package/unbundled/platform.cjs +1 -3
  472. package/unbundled/platform.js +1 -3
  473. package/unbundled/playbackRates.cjs +1 -3
  474. package/unbundled/playbackRates.js +1 -3
  475. package/unbundled/randomId.cjs +1 -3
  476. package/unbundled/randomId.js +1 -3
  477. package/unbundled/single-date-picker.cjs +6 -18
  478. package/unbundled/single-date-picker.js +6 -18
  479. package/unbundled/single-value-picker.cjs +7 -21
  480. package/unbundled/single-value-picker.js +7 -21
  481. package/unbundled/slider.template.cjs +6 -14
  482. package/unbundled/slider.template.js +6 -14
  483. package/unbundled/slottable-request.cjs +2 -6
  484. package/unbundled/slottable-request.js +2 -6
  485. package/unbundled/text-field.cjs +1 -1
  486. package/unbundled/text-field.js +1 -1
  487. package/unbundled/time-selection-picker.template.cjs +27 -79
  488. package/unbundled/time-selection-picker.template.js +27 -79
  489. package/unbundled/trapped-focus.cjs +1 -3
  490. package/unbundled/trapped-focus.js +1 -3
  491. package/unbundled/vivid-element.cjs +7 -19
  492. package/unbundled/vivid-element.js +7 -19
  493. package/unbundled/with-contextual-help.cjs +4 -13
  494. package/unbundled/with-contextual-help.js +4 -13
  495. package/unbundled/with-error-text.cjs +2 -6
  496. package/unbundled/with-error-text.js +2 -6
  497. package/unbundled/with-success-text.cjs +1 -3
  498. package/unbundled/with-success-text.js +1 -3
  499. package/video-player/index.cjs +3 -3
  500. package/video-player/index.js +5 -5
  501. package/visually-hidden/definition.cjs +1 -1
  502. package/visually-hidden/definition.js +1 -1
  503. package/shared/color-picker/index.d.ts +0 -3
  504. package/shared/foundation/button/index.d.ts +0 -2
  505. package/shared/patterns/char-count/index.d.ts +0 -1
  506. package/shared/patterns/form-elements/index.d.ts +0 -4
  507. package/shared/patterns/index.d.ts +0 -7
@@ -1,407 +1,313 @@
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_form_associated = require("./form-associated.cjs");
6
- const require_localized = require("./localized.cjs");
7
- const require_definition = require("./definition10.cjs");
5
+ const require_affix = require("./affix.cjs");
8
6
  const require_key_codes = require("./key-codes.cjs");
9
- const require_slider_template = require("./slider.template.cjs");
7
+ const require_kbd_shortcut = require("./kbd-shortcut.cjs");
8
+ const require_host_semantics = require("./host-semantics.cjs");
10
9
  let _microsoft_fast_element = require("@microsoft/fast-element");
11
10
  let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
12
- //#region src/lib/slider/slider.scss?inline
13
- var slider_default = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary:var(--vvd-slider-cta-primary,var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary:var(--vvd-slider-accent-primary,var(--vvd-color-canvas-text))}.control{--_appearance-color-text:var(--_connotation-color-primary-text);--_appearance-color-fill:var(--_connotation-color-primary);--_appearance-color-outline:transparent;--_thumb-size:12px;--_thumb-interaction-indicator-size:36px;--_track-start-inset-inline-start:0;--_track-start-inset-block-start:0;cursor:pointer;user-select:none;outline:none}.control .positioning-region{position:relative}.control .track{background:var(--_track-background-color);border-radius:4px;position:absolute}.control .track-start{border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;position:absolute;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));min-inline-size:var(--_thumb-size);margin-inline-start:calc(var(--_thumb-size) / 2)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:2px;left:0;right:0}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start:1px;border-top-left-radius:0;border-bottom-left-radius:0}.control.horizontal .track .mark{block-size:6px;inline-size:100%;position:absolute;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{block-size:100%;inline-size:6px;position:absolute;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start:1px;border-radius:0}.control.disabled{--_track-background-color:var(--vvd-color-neutral-100);--_track-start-background-color:var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color:var(--vvd-color-neutral-300);--_track-start-background-color:var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);touch-action:none;border-radius:50%;outline:none;position:absolute}.thumb-container.focus-visible{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;--_thumb-interaction-indicator-alpha:.05;border-radius:50%}.control.horizontal .thumb-container{transform:translateX(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}@media (hover:hover){.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha:.12}}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha:.25}.thumb-container:before{border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha,0);transition:opacity .2s ease-out;display:block;position:absolute}.thumb-container:after{border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2);display:block;position:absolute}.popup{pointer-events:none}.tooltip{width:auto;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold);padding:8px 12px}:host([internal-part]) .thumb-container{opacity:0;transition:opacity .2s}:host([internal-part]) .control.horizontal .track{block-size:4px;top:16px;overflow:hidden}:host([internal-part]) .control:focus .thumb-container{opacity:1}@media (hover:hover){:host([internal-part]) .control:hover .thumb-container{opacity:1}}";
11
+ //#region src/lib/menu-item/menu-item.scss?inline
12
+ var menu_item_default = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{--_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(--_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(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base:active:where(:not(.disabled,:disabled)),.base.active:where(:not(.disabled,:disabled)),.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base.connotation-cta{--_connotation-color-primary:var(--vvd-menu-item-cta-primary,var(--vvd-color-cta-500));--_connotation-color-primary-text:var(--vvd-menu-item-cta-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-menu-item-cta-primary-increment,var(--vvd-color-cta-600));--_connotation-color-firm:var(--vvd-menu-item-cta-firm,var(--vvd-color-cta-600));--_connotation-color-faint:var(--vvd-menu-item-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-menu-item-cta-soft,var(--vvd-color-cta-100));--_connotation-color-pale:var(--vvd-menu-item-cta-pale,var(--vvd-color-cta-300));--_connotation-color-dim:var(--vvd-menu-item-cta-dim,var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary:var(--vvd-menu-item-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-menu-item-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-menu-item-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-firm:var(--vvd-menu-item-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-menu-item-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-menu-item-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-pale:var(--vvd-menu-item-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-dim:var(--vvd-menu-item-accent-dim,var(--vvd-color-neutral-200))}.base{--_menu-item-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);box-sizing:border-box;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);border-radius:8px;align-items:center;inline-size:100%;display:flex}.base:not(.two-lines){min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));padding-block:8px;padding-inline:var(--_menu-item-padding-inline);gap:12px}.base.two-lines{min-block-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)));padding-block:12px;padding-inline:var(--_menu-item-padding-inline);gap:16px}.base{user-select:none}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{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}.icon{font-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);flex-shrink:0;line-height:1}.action,.decorative{place-content:center;display:flex}.action{color:var(--_appearance-color-text)}.base.trailing .action,.base.has-meta .action{order:2}:host(:not([check-appearance],[checked],[disabled])) .action{color:var(--vvd-color-neutral-500)}.base:not(.disabled) .decorative{color:var(--vvd-color-neutral-600)}.base.disabled .decorative{color:var(--vvd-color-neutral-200)}.base.has-meta .decorative{order:1}.chevron{order:3}.text{flex-direction:column;gap:4px;margin-inline-end:auto;display:flex;overflow:hidden}.text-primary,.text-secondary{font:var(--vvd-typography-base);-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.text-primary{font:var(--vvd-typography-base);-webkit-line-clamp:var(--text-primary-line-clamp,1)}.base:not(.disabled) .text-primary{color:var(--vvd-color-canvas-text)}.base.disabled .text-primary{color:var(--_appearance-color-text)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{color:var(--vvd-color-neutral-800);font:var(--vvd-typography-base-condensed);-webkit-line-clamp:var(--text-secondary-line-clamp,1)}.base.two-lines .text-secondary{color:var(--vvd-color-neutral-600)}.base.disabled .text-secondary{color:var(--_appearance-color-text)}.base.selected:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-800)}:host([internal-part]) .text-primary{font:var(--_text-primary-custom-size,var--vvd-typography-base)}";
14
13
  //#endregion
15
- //#region src/shared/foundation/utilities/direction.ts
16
- /**
17
- * a method to determine the current localization direction of the view
18
- * @param rootNode - the HTMLElement to begin the query from, usually "this" when used in a component controller
19
- * @public
20
- */
21
- var getDirection = (rootNode) => {
22
- const dirNode = rootNode.closest("[dir]");
23
- return dirNode !== null && dirNode.dir === "rtl" ? _microsoft_fast_web_utilities.Direction.rtl : _microsoft_fast_web_utilities.Direction.ltr;
14
+ //#region src/lib/menu-item/menu-item-role.ts
15
+ var MenuItemRole = {
16
+ menuitem: "menuitem",
17
+ menuitemcheckbox: "menuitemcheckbox",
18
+ menuitemradio: "menuitemradio",
19
+ presentation: "presentation"
24
20
  };
25
21
  //#endregion
26
- //#region src/lib/slider/slider.ts
22
+ //#region src/lib/menu-item/menu-item.ts
27
23
  /**
28
- * The selection modes of a Slider.
29
24
  * @public
25
+ * @component menu-item
26
+ * @slot meta - Assign nodes to the `meta` slot to set a badge or an additional icon.
27
+ * @slot trailing-meta - Assign nodes to the `meta` slot to set a badge or an additional icon.
28
+ * @slot submenu - Assign a Menu to the `submenu` slot to add a submenu.
29
+ * @event {CustomEvent<HTMLElement>} expanded-change - Fired when the expanded state changes.
30
+ * @event {CustomEvent<undefined>} change - Fired when the item is triggered. Does not fire when a submenu is collapsed or expanded.
31
+ * @vueModel modelValue checked change `event.currentTarget.checked`
32
+ * @testSelector byText byText
33
+ * @testAction click click #base
34
+ * @testQuery checked checked true
35
+ * @testQuery unchecked checked false
36
+ * @testQuery disabled disabled
37
+ * @testRef base shadow .base
30
38
  */
31
- var SliderMode = { singleValue: "single-value" };
32
- /**
33
- * @public
34
- * @component slider
35
- * @event {CustomEvent<undefined>} change - Fires a custom 'change' event when the slider value changes
36
- * @vueModel modelValue value change `event.currentTarget.value`
37
- * @vueModel valueAsNumber valueAsNumber change `event.currentTarget.valueAsNumber`
38
- * @testSelector byLabel byLabel
39
- * @testAction slideTo slideTo #track #thumb
40
- * @testQuery valueAsNumber valueAsNumber
41
- * @testRef track shadow .control
42
- * @testRef thumb shadow .thumb-container
43
- */
44
- var Slider = class extends require_localized.Localized(require_delegates_aria.DelegatesAria(require_form_associated.FormAssociated(require_vivid_element.VividElement))) {
45
- constructor(..._args) {
46
- super(..._args);
47
- this.proxy = document.createElement("input");
48
- this.direction = _microsoft_fast_web_utilities.Direction.ltr;
49
- this.isDragging = false;
50
- this.trackWidth = 0;
51
- this.trackMinWidth = 0;
52
- this.trackHeight = 0;
53
- this.trackLeft = 0;
54
- this.trackMinHeight = 0;
55
- this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
56
- this.min = 0;
57
- this.max = 10;
58
- this.step = 1;
59
- this.orientation = _microsoft_fast_web_utilities.Orientation.horizontal;
60
- this.mode = SliderMode.singleValue;
61
- this.keypressHandler = (e) => {
62
- this._focusVisible = true;
63
- if (this.readOnly) return;
64
- if (e.key === _microsoft_fast_web_utilities.keyHome) {
65
- e.preventDefault();
66
- this.value = `${this.min}`;
67
- } else if (e.key === _microsoft_fast_web_utilities.keyEnd) {
68
- e.preventDefault();
69
- this.value = `${this.max}`;
70
- } else {
71
- if (e.shiftKey) return;
72
- switch (e.key) {
73
- case require_key_codes.keyArrowRight:
74
- case _microsoft_fast_web_utilities.keyArrowUp:
75
- e.preventDefault();
76
- this.increment();
77
- break;
78
- case require_key_codes.keyArrowLeft:
79
- case _microsoft_fast_web_utilities.keyArrowDown:
80
- e.preventDefault();
81
- this.decrement();
82
- break;
83
- }
84
- }
85
- };
86
- this.setupTrackConstraints = () => {
87
- const clientRect = this.track.getBoundingClientRect();
88
- this.trackWidth = this.track.clientWidth;
89
- this.trackMinWidth = this.track.clientLeft;
90
- this.trackHeight = clientRect.bottom;
91
- this.trackMinHeight = clientRect.top;
92
- this.trackLeft = this.getBoundingClientRect().left;
93
- if (this.trackWidth === 0) this.trackWidth = 1;
94
- };
95
- this.setupListeners = (remove = false) => {
96
- const eventAction = remove ? "removeEventListener" : "addEventListener";
97
- this[eventAction]("keydown", this.keypressHandler);
98
- this[eventAction]("mousedown", this.handleMouseDown);
99
- this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { passive: true });
100
- this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { passive: true });
101
- if (remove) {
102
- this.handleMouseDown(null);
103
- this.handleThumbMouseDown(null);
104
- }
105
- };
106
- this.initialValue = "";
107
- this.handleThumbMouseDown = (event) => {
108
- if (event) {
109
- if (this.readOnly || this.disabled || event.defaultPrevented) return;
110
- this.#isNonVisibleFocus = true;
111
- event.target.focus();
112
- this.#isNonVisibleFocus = false;
113
- }
114
- const eventAction = event !== null ? "addEventListener" : "removeEventListener";
115
- window[eventAction]("mouseup", this.handleWindowMouseUp);
116
- window[eventAction]("mousemove", this.handleMouseMove, { passive: true });
117
- window[eventAction]("touchmove", this.handleMouseMove, { passive: true });
118
- window[eventAction]("touchend", this.handleWindowMouseUp);
119
- this.isDragging = event !== null;
120
- };
121
- this.handleMouseMove = (e) => {
122
- if (this.readOnly || this.disabled || e.defaultPrevented) return;
123
- const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
124
- const value = this.#calculateValueFromMouseEvent(sourceEvent);
125
- this.value = `${this.#roundToNearestStep(value)}`;
126
- };
127
- this.handleWindowMouseUp = (_) => {
128
- this.stopDragging();
129
- };
130
- this.stopDragging = () => {
131
- this.isDragging = false;
132
- this.handleMouseDown(null);
133
- this.handleThumbMouseDown(null);
134
- };
135
- this.handleMouseDown = (e) => {
136
- const eventAction = e !== null ? "addEventListener" : "removeEventListener";
137
- if (e === null || !this.disabled && !this.readOnly) {
138
- window[eventAction]("mouseup", this.handleWindowMouseUp);
139
- window.document[eventAction]("mouseleave", this.handleWindowMouseUp);
140
- window[eventAction]("mousemove", this.handleMouseMove);
141
- if (e) {
142
- e.preventDefault();
143
- this.setupTrackConstraints();
144
- this.#isNonVisibleFocus = true;
145
- e.target.focus();
146
- this.#isNonVisibleFocus = false;
147
- const value = this.#calculateValueFromMouseEvent(e);
148
- this.value = `${this.#roundToNearestStep(value)}`;
149
- this.isDragging = true;
150
- }
151
- }
152
- };
153
- this.markers = false;
154
- this.pin = false;
155
- this._focusVisible = false;
156
- this._hoveringOnThumb = false;
157
- this.#isNonVisibleFocus = false;
158
- this._onFocusIn = () => {
159
- if (!this.#isNonVisibleFocus) this._focusVisible = true;
160
- this.#isNonVisibleFocus = false;
161
- };
162
- this._onFocusOut = () => {
163
- this._focusVisible = false;
164
- };
165
- this.#onVisibilityChange = () => {
166
- if (document.hidden && this.shadowRoot.activeElement !== null) this.#isNonVisibleFocus = true;
167
- };
168
- this.#onMouseOver = () => {
169
- this._hoveringOnThumb = true;
170
- };
171
- this.#onMouseOut = () => {
172
- this._hoveringOnThumb = false;
173
- };
174
- }
175
- /**
176
- * @internal
177
- */
178
- readOnlyChanged() {
39
+ var MenuItem = class extends require_kbd_shortcut.WithKbdShortcut(require_host_semantics.HostSemantics(require_affix.AffixIcon(require_vivid_element.VividElement))) {
40
+ /** @internal */
41
+ expandedChanged() {
179
42
  /* v8 ignore if -- @preserve */
180
- if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
181
- }
182
- /**
183
- * The value property, typed as a number.
184
- *
185
- * @public
186
- */
187
- get valueAsNumber() {
188
- return parseFloat(this.value);
189
- }
190
- set valueAsNumber(next) {
191
- this.value = next.toString();
192
- }
193
- /**
194
- * @internal
195
- */
196
- valueChanged(previous, next) {
197
- super.valueChanged(previous, next);
198
43
  if (this.$fastController.isConnected) {
199
- const nextAsNumber = parseFloat(next);
200
- const value = this.#roundToNearestStep(nextAsNumber).toString();
201
- if (value !== next) {
202
- this.value = value;
203
- return;
204
- }
205
- this.setThumbPositionForOrientation(this.direction);
206
- this.$emit("change");
44
+ if (this.submenu && !this.expanded) this.submenu.collapseExpandedItem();
45
+ this.$emit("expanded-change", this, { bubbles: false });
207
46
  }
208
47
  }
209
- /**
210
- * @internal
211
- */
212
- minChanged() {
213
- /* v8 ignore if -- @preserve */
214
- if (this.proxy instanceof HTMLInputElement) this.proxy.min = `${this.min}`;
215
- this.validate();
216
- }
217
- /**
218
- * @internal
219
- */
220
- maxChanged() {
221
- /* v8 ignore if -- @preserve */
222
- if (this.proxy instanceof HTMLInputElement) this.proxy.max = `${this.max}`;
223
- this.validate();
48
+ #ensureRoleMatchesPresentational() {
49
+ if (this._isPresentational) {
50
+ if (this.role === "menuitem") this.role = "presentation";
51
+ } else if (this.role === "presentation") this.role = MenuItemRole.menuitem;
224
52
  }
225
- /**
226
- * @internal
227
- */
228
- stepChanged() {
229
- /* v8 ignore if -- @preserve */
230
- if (this.proxy instanceof HTMLInputElement) this.proxy.step = `${this.step}`;
231
- this.updateStepMultiplier();
232
- this.validate();
53
+ /** @internal */
54
+ _isPresentationalChanged() {
55
+ if (this.$fastController.isConnected) this.#ensureRoleMatchesPresentational();
233
56
  }
234
- /**
235
- * @internal
236
- */
237
- orientationChanged() {
238
- if (this.$fastController.isConnected) this.setThumbPositionForOrientation(this.direction);
57
+ /** @internal */
58
+ checkedChanged() {
59
+ if (this.$fastController.isConnected) this.$emit("change");
239
60
  }
240
- /**
241
- * @internal
242
- */
61
+ /** @internal */
243
62
  connectedCallback() {
244
63
  super.connectedCallback();
245
- this.proxy.setAttribute("type", "range");
246
- this.direction = getDirection(this);
247
- this.updateStepMultiplier();
248
- this.setupTrackConstraints();
249
- this.setupListeners();
250
- this.setupDefaultValue();
251
- this.setThumbPositionForOrientation(this.direction);
252
- this.#registerThumbListeners();
253
- document.addEventListener("visibilitychange", this.#onVisibilityChange);
254
- }
255
- /**
256
- * @internal
257
- */
258
- disconnectedCallback() {
259
- this.setupListeners(true);
260
- this.#unregisterThumbListeners();
261
- document.removeEventListener("visibilitychange", this.#onVisibilityChange);
262
- }
263
- /**
264
- * Increment the value by the step
265
- *
266
- * @public
267
- */
268
- increment() {
269
- const newVal = this.direction !== _microsoft_fast_web_utilities.Direction.rtl && this.orientation !== _microsoft_fast_web_utilities.Orientation.vertical ? Number(this.value) + this.step : Number(this.value) - this.step;
270
- this.value = this.#roundToNearestStep(newVal).toString();
271
- }
272
- /**
273
- * Decrement the value by the step
274
- *
275
- * @public
276
- */
277
- decrement() {
278
- const newVal = this.direction !== _microsoft_fast_web_utilities.Direction.rtl && this.orientation !== _microsoft_fast_web_utilities.Orientation.vertical ? Number(this.value) - this.step : Number(this.value) + this.step;
279
- this.value = this.#roundToNearestStep(newVal).toString();
280
- }
281
- /**
282
- * Places the thumb based on the current value
283
- *
284
- * @public
285
- * @param direction - writing mode
286
- */
287
- setThumbPositionForOrientation(_) {
288
- const percentage = this.#thumbTrackEndOffset(this.valueAsNumber);
289
- if (this.orientation === _microsoft_fast_web_utilities.Orientation.horizontal) this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: right 0.2s ease;`;
290
- else this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: bottom 0.2s ease;`;
64
+ _microsoft_fast_element.Updates.enqueue(() => {
65
+ this._isPresentational = this._isPresentational ?? true;
66
+ this.#ensureRoleMatchesPresentational();
67
+ });
291
68
  }
292
- #thumbTrackEndOffset(value) {
293
- return (1 - require_slider_template.inverseLerp(this.min, this.max, value)) * 100;
69
+ /** @internal */
70
+ _kbdAriaShortcutsValueChanged() {
71
+ _microsoft_fast_element.DOM.setAttribute(this, "aria-keyshortcuts", this._kbdAriaShortcutsValue);
294
72
  }
295
- /**
296
- * Update the step multiplier used to ensure rounding errors from steps that
297
- * are not whole numbers
298
- */
299
- updateStepMultiplier() {
300
- const stepString = String(this.step);
301
- const decimalPlacesOfStep = this.step % 1 ? stepString.length - stepString.indexOf(".") - 1 : 0;
302
- this.stepMultiplier = Math.pow(10, decimalPlacesOfStep);
73
+ /** @internal */
74
+ slottedSubmenuChanged() {
75
+ if (this.submenu) {
76
+ this.submenu.anchor = this;
77
+ this.submenu.placement = "right-start";
78
+ this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
79
+ this.submenu._popupOffset = 5;
80
+ }
303
81
  }
304
- get midpoint() {
305
- return `${this.#roundToNearestStep((this.max + this.min) / 2)}`;
82
+ /** @internal */
83
+ get submenu() {
84
+ if (this.slottedSubmenu?.length) return this.slottedSubmenu[0];
85
+ else return null;
306
86
  }
307
- setupDefaultValue() {
308
- /* v8 ignore else -- @preserve */
309
- if (typeof this.value === "string") if (this.value.length === 0) this.initialValue = this.midpoint;
310
- else {
311
- const value = parseFloat(this.value);
312
- if (!Number.isNaN(value) && (value < this.min || value > this.max)) this.value = this.midpoint;
313
- }
87
+ /** @internal */
88
+ get hasSubmenu() {
89
+ return this.submenu !== null;
314
90
  }
315
- #calculateValueFromMouseEvent(e) {
316
- const trackClientRect = this.track.getBoundingClientRect();
317
- const [minPos, maxPos, valuePos] = this.orientation === _microsoft_fast_web_utilities.Orientation.horizontal ? [
318
- this.track.clientLeft,
319
- this.track.clientWidth,
320
- e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
321
- ] : [
322
- trackClientRect.top,
323
- trackClientRect.bottom,
324
- e.pageY - document.documentElement.scrollTop
325
- ];
326
- return require_slider_template.lerp(this.min, this.max, require_slider_template.inverseLerp(minPos, maxPos, valuePos));
91
+ constructor() {
92
+ super();
93
+ this.role = MenuItemRole.menuitem;
94
+ this.checked = false;
95
+ this.handleMenuItemClick = (e) => {
96
+ if (this._isSyntheticClickEvent(e)) return true;
97
+ this.invoke();
98
+ return Boolean(this._isPresentational);
99
+ };
100
+ this.handleMouseOver = (_) => {
101
+ if (this.disabled || !this.submenu || this.expanded) return false;
102
+ this.expanded = true;
103
+ return false;
104
+ };
105
+ this.handleMouseOut = (_) => {
106
+ if (!this.expanded || this.contains(document.activeElement)) return false;
107
+ this.expanded = false;
108
+ return false;
109
+ };
110
+ this.invoke = () => {
111
+ if (this.disabled || this._isPresentational) return;
112
+ switch (this.controlType) {
113
+ case "checkbox":
114
+ this.checked = !this.checked;
115
+ break;
116
+ case "radio":
117
+ if (!this.checked) this.checked = true;
118
+ break;
119
+ default:
120
+ if (this.submenu) this.expanded = true;
121
+ else this.$emit("change");
122
+ break;
123
+ }
124
+ };
125
+ this.checkTrailing = false;
126
+ this.handleMenuItemKeyDown = (e) => {
127
+ if (e.defaultPrevented) return false;
128
+ switch (e.key) {
129
+ case _microsoft_fast_web_utilities.keyEnter:
130
+ case _microsoft_fast_web_utilities.keySpace:
131
+ this.invoke();
132
+ if (!this.disabled) this.#emitSyntheticClick();
133
+ return false;
134
+ case require_key_codes.keyArrowRight:
135
+ /* v8 ignore else -- @preserve */
136
+ if (this.submenu) {
137
+ this.expanded = true;
138
+ this.#emitSyntheticClick();
139
+ }
140
+ return false;
141
+ case require_key_codes.keyArrowLeft: if (this.expanded) {
142
+ this.#emitSyntheticClick();
143
+ this.expanded = false;
144
+ this.focus();
145
+ return false;
146
+ }
147
+ }
148
+ return true;
149
+ };
150
+ this.#syntheticClickEvents = /* @__PURE__ */ new WeakSet();
151
+ this.addEventListener("expanded-change", this.#expandedChange);
327
152
  }
328
- #roundToNearestStep(value) {
329
- return (0, _microsoft_fast_web_utilities.limit)(this.min, this.max, require_slider_template.roundToStepValue(value - this.min, this.step) + this.min);
153
+ #collapseExpandedItem() {
154
+ this.expanded = false;
330
155
  }
331
- /**
332
- * @internal
333
- */
334
- get _isThumbPopupOpen() {
335
- return this._focusVisible || this._hoveringOnThumb || this.isDragging;
156
+ #expandedChange() {
157
+ if (this.submenu) this.submenu.open = this.expanded;
336
158
  }
337
- #isNonVisibleFocus;
338
- #registerThumbListeners() {
339
- this.thumb.addEventListener("mouseover", this.#onMouseOver, { passive: true });
340
- this.thumb.addEventListener("mouseout", this.#onMouseOut, { passive: true });
159
+ #syntheticClickEvents;
160
+ /** @internal */
161
+ _isSyntheticClickEvent(event) {
162
+ return this.#syntheticClickEvents.has(event);
341
163
  }
342
- #unregisterThumbListeners() {
343
- this.thumb.removeEventListener("mouseover", this.#onMouseOver);
344
- this.thumb.removeEventListener("mouseout", this.#onMouseOut);
164
+ #emitSyntheticClick() {
165
+ const mouseEvent = new MouseEvent("click", {
166
+ bubbles: true,
167
+ composed: true
168
+ });
169
+ this.#syntheticClickEvents.add(mouseEvent);
170
+ this.dispatchEvent(mouseEvent);
345
171
  }
346
- #onVisibilityChange;
347
- #onMouseOver;
348
- #onMouseOut;
349
172
  };
173
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], MenuItem.prototype, "disabled", void 0);
174
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], MenuItem.prototype, "expanded", void 0);
175
+ require_decorate.__decorate([_microsoft_fast_element.observable], MenuItem.prototype, "_isPresentational", void 0);
176
+ require_decorate.__decorate([require_vivid_element.replaces({
177
+ deprecatedPropertyName: "role",
178
+ fromDeprecated: (role) => {
179
+ switch (role) {
180
+ case "menuitemcheckbox": return "checkbox";
181
+ case "menuitemradio": return "radio";
182
+ default: return;
183
+ }
184
+ },
185
+ toDeprecated: (controlType) => {
186
+ switch (controlType) {
187
+ case "checkbox": return "menuitemcheckbox";
188
+ case "radio": return "menuitemradio";
189
+ default: return "menuitem";
190
+ }
191
+ }
192
+ }), (0, _microsoft_fast_element.attr)({ attribute: "control-type" })], MenuItem.prototype, "controlType", void 0);
193
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], MenuItem.prototype, "checked", void 0);
194
+ require_decorate.__decorate([_microsoft_fast_element.attr], MenuItem.prototype, "text", void 0);
195
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "text-secondary" })], MenuItem.prototype, "textSecondary", void 0);
196
+ require_decorate.__decorate([_microsoft_fast_element.attr], MenuItem.prototype, "connotation", void 0);
350
197
  require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
351
- attribute: "readonly",
352
- mode: "boolean"
353
- })], Slider.prototype, "readOnly", void 0);
354
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "direction", void 0);
355
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "isDragging", void 0);
356
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "position", void 0);
357
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "trackWidth", void 0);
358
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "trackMinWidth", void 0);
359
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "trackHeight", void 0);
360
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "trackLeft", void 0);
361
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "trackMinHeight", void 0);
362
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "valueTextFormatter", void 0);
363
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: _microsoft_fast_element.nullableNumberConverter })], Slider.prototype, "min", void 0);
364
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: _microsoft_fast_element.nullableNumberConverter })], Slider.prototype, "max", void 0);
365
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: require_slider_template.defaultToOneConverter })], Slider.prototype, "step", void 0);
366
- require_decorate.__decorate([_microsoft_fast_element.attr], Slider.prototype, "orientation", void 0);
367
- require_decorate.__decorate([_microsoft_fast_element.attr], Slider.prototype, "mode", void 0);
368
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], Slider.prototype, "markers", void 0);
369
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], Slider.prototype, "pin", void 0);
370
- require_decorate.__decorate([_microsoft_fast_element.attr], Slider.prototype, "connotation", void 0);
371
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "_focusVisible", void 0);
372
- require_decorate.__decorate([_microsoft_fast_element.observable], Slider.prototype, "_hoveringOnThumb", void 0);
373
- require_decorate.__decorate([_microsoft_fast_element.volatile], Slider.prototype, "_isThumbPopupOpen", null);
198
+ mode: "boolean",
199
+ attribute: "check-trailing"
200
+ })], MenuItem.prototype, "checkTrailing", void 0);
201
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "check-appearance" })], MenuItem.prototype, "checkedAppearance", void 0);
202
+ require_decorate.__decorate([_microsoft_fast_element.observable], MenuItem.prototype, "metaSlottedContent", void 0);
203
+ require_decorate.__decorate([_microsoft_fast_element.observable], MenuItem.prototype, "trailingMetaSlottedContent", void 0);
204
+ require_decorate.__decorate([_microsoft_fast_element.observable], MenuItem.prototype, "slottedSubmenu", void 0);
374
205
  //#endregion
375
- //#region src/lib/slider/definition.ts
376
- /**
377
- * @internal
378
- */
379
- var sliderDefinition = require_vivid_element.defineVividComponent("slider", Slider, require_slider_template.SliderTemplate, [require_definition.popupDefinition], {
380
- styles: slider_default,
381
- shadowOptions: { delegatesFocus: true }
382
- });
206
+ //#region src/lib/menu/name.ts
207
+ var menuName = "menu";
208
+ //#endregion
209
+ //#region src/lib/menu-item/menu-item.template.ts
210
+ var getIndicatorIcon = (x) => {
211
+ if (x.checkedAppearance === "tick-only") return x.checked ? "check-line" : "";
212
+ return `${x.controlType === "checkbox" ? "checkbox" : "radio"}-${x.checked ? "checked" : "unchecked"}-2-line`;
213
+ };
214
+ function checkIndicator(context) {
215
+ const iconTag = context.tagFor(require_definition.Icon);
216
+ return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => Boolean(x.controlType), _microsoft_fast_element.html`<span class="action"><${iconTag} class="icon" name="${(x) => getIndicatorIcon(x)}"></${iconTag}></span>`)}`;
217
+ }
218
+ function text() {
219
+ return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => x.text || x.textSecondary, _microsoft_fast_element.html`<span class="text">
220
+ ${(0, _microsoft_fast_element.when)((x) => x.text, _microsoft_fast_element.html`<span class="text-primary">${(x) => x.text}</span>`)}
221
+ ${(0, _microsoft_fast_element.when)((x) => x.textSecondary, _microsoft_fast_element.html`<span class="text-secondary">${(x) => x.textSecondary}</span>`)}
222
+ </span>`)}`;
223
+ }
224
+ var MenuItemTemplate = (context) => {
225
+ const affixIconTemplate = require_affix.affixIconTemplateFactory(context);
226
+ const iconTag = context.tagFor(require_definition.Icon);
227
+ return _microsoft_fast_element.html`
228
+ <template
229
+ ${require_host_semantics.applyHostSemantics({
230
+ ariaHasPopup: (x) => x.hasSubmenu ? "menu" : void 0,
231
+ ariaChecked: (x) => x.controlType ? x.checked : void 0,
232
+ ariaDisabled: (x) => x.disabled,
233
+ ariaExpanded: (x) => x.expanded
234
+ })}
235
+ @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
236
+ @click="${(x, c) => x.handleMenuItemClick(c.event)}"
237
+ @mouseover="${(x, c) => x.handleMouseOver(c.event)}"
238
+ @mouseout="${(x, c) => x.handleMouseOut(c.event)}"
239
+ >
240
+ <div
241
+ class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], ["disabled", x.disabled], ["selected", Boolean(x.controlType && x.checked)], ["trailing", Boolean(x.controlType && (x.checkTrailing || Boolean(x.icon)))], ["item-checkbox", x.controlType === "checkbox"], ["item-radio", x.controlType === "radio"], ["two-lines", Boolean(x.text?.length) && Boolean(x.textSecondary?.length)], ["has-meta", Boolean(x.metaSlottedContent?.length)])}"
242
+ >
243
+ <slot name="meta" ${(0, _microsoft_fast_element.slotted)("metaSlottedContent")}></slot>
244
+ ${checkIndicator(context)}
245
+ ${(0, _microsoft_fast_element.when)((x) => x.icon, _microsoft_fast_element.html`<span class="decorative"
246
+ >${(x) => affixIconTemplate(x.icon)}</span
247
+ >`)}
248
+ ${text()}
249
+ <slot
250
+ name="trailing-meta"
251
+ ${(0, _microsoft_fast_element.slotted)("trailingMetaSlottedContent")}
252
+ ></slot>
253
+ <slot
254
+ name="kbd-shortcut"
255
+ class="kbd-shortcut-slot"
256
+ ${(0, _microsoft_fast_element.slotted)({
257
+ property: "_kbdShortcutSlotted",
258
+ filter: (0, _microsoft_fast_element.elements)()
259
+ })}
260
+ ></slot>
261
+ ${(0, _microsoft_fast_element.when)((x) => x.hasSubmenu, _microsoft_fast_element.html`<${iconTag} class="chevron" name="chevron-right-line"></${iconTag}>`)}
262
+ </div>
263
+ <slot
264
+ name="submenu"
265
+ ${(0, _microsoft_fast_element.slotted)({
266
+ property: "slottedSubmenu",
267
+ filter: (0, _microsoft_fast_element.elements)(context.tagForNonDependency(menuName))
268
+ })}
269
+ ></slot>
270
+ </template>
271
+ `;
272
+ };
273
+ //#endregion
274
+ //#region src/lib/menu-item/definition.ts
275
+ /** @internal */
276
+ var menuItemDefinition = require_vivid_element.defineVividComponent("menu-item", MenuItem, MenuItemTemplate, [require_definition.iconDefinition], { styles: menu_item_default });
383
277
  /**
384
- * Registers the slider elements with the design system.
278
+ * Registers the menu-item elements with the design system.
385
279
  *
386
280
  * @param prefix - the prefix to use for the component name
387
281
  */
388
- var registerSlider = require_vivid_element.createRegisterFunction(sliderDefinition);
282
+ var registerMenuItem = require_vivid_element.createRegisterFunction(menuItemDefinition);
389
283
  //#endregion
390
- Object.defineProperty(exports, "Slider", {
284
+ Object.defineProperty(exports, "MenuItem", {
285
+ enumerable: true,
286
+ get: function() {
287
+ return MenuItem;
288
+ }
289
+ });
290
+ Object.defineProperty(exports, "MenuItemRole", {
291
+ enumerable: true,
292
+ get: function() {
293
+ return MenuItemRole;
294
+ }
295
+ });
296
+ Object.defineProperty(exports, "menuItemDefinition", {
391
297
  enumerable: true,
392
298
  get: function() {
393
- return Slider;
299
+ return menuItemDefinition;
394
300
  }
395
301
  });
396
- Object.defineProperty(exports, "registerSlider", {
302
+ Object.defineProperty(exports, "menuName", {
397
303
  enumerable: true,
398
304
  get: function() {
399
- return registerSlider;
305
+ return menuName;
400
306
  }
401
307
  });
402
- Object.defineProperty(exports, "sliderDefinition", {
308
+ Object.defineProperty(exports, "registerMenuItem", {
403
309
  enumerable: true,
404
310
  get: function() {
405
- return sliderDefinition;
311
+ return registerMenuItem;
406
312
  }
407
313
  });