@vonage/vivid 5.23.1 → 5.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/accordion/index.cjs +1 -1
  2. package/accordion/index.js +1 -1
  3. package/accordion-item/index.cjs +1 -1
  4. package/accordion-item/index.js +1 -1
  5. package/audio-player/index.cjs +2 -2
  6. package/audio-player/index.js +3 -3
  7. package/badge/index.cjs +1 -1
  8. package/badge/index.js +1 -1
  9. package/bundled/definition15.cjs +8 -7
  10. package/bundled/definition15.js +26 -24
  11. package/bundled/definition17.cjs +2 -2
  12. package/bundled/definition17.js +2 -2
  13. package/bundled/definition18.cjs +12 -83
  14. package/bundled/definition18.js +35 -419
  15. package/bundled/definition19.cjs +87 -7
  16. package/bundled/definition19.js +432 -16
  17. package/bundled/definition20.cjs +7 -37
  18. package/bundled/definition20.js +17 -172
  19. package/bundled/definition21.cjs +35 -27
  20. package/bundled/definition21.js +154 -154
  21. package/bundled/definition22.cjs +29 -6
  22. package/bundled/definition22.js +172 -20
  23. package/bundled/definition23.cjs +6 -12
  24. package/bundled/definition23.js +17 -32
  25. package/bundled/definition24.cjs +12 -39
  26. package/bundled/definition24.js +32 -67
  27. package/bundled/definition25.cjs +44 -0
  28. package/bundled/definition25.js +77 -0
  29. package/bundled/extractOptions.cjs +1 -0
  30. package/bundled/extractOptions.js +11 -0
  31. package/bundled/listbox.cjs +1 -1
  32. package/bundled/listbox.js +24 -11
  33. package/bundled/render-in-light-dom.cjs +1 -1
  34. package/bundled/render-in-light-dom.js +16 -19
  35. package/bundled/vivid-element.cjs +1 -1
  36. package/bundled/vivid-element.js +9 -1
  37. package/combobox/definition.cjs +1 -1
  38. package/combobox/definition.js +1 -1
  39. package/combobox/index.cjs +7 -7
  40. package/combobox/index.js +29 -21
  41. package/country/definition.cjs +1 -1
  42. package/country/definition.js +1 -1
  43. package/country/index.cjs +1 -1
  44. package/country/index.js +1 -1
  45. package/country-group/definition.cjs +1 -1
  46. package/country-group/definition.js +1 -1
  47. package/country-group/index.cjs +1 -1
  48. package/country-group/index.js +2 -2
  49. package/custom-elements.json +3102 -2842
  50. package/data-grid/definition.cjs +1 -1
  51. package/data-grid/definition.js +1 -1
  52. package/data-grid/index.cjs +4 -4
  53. package/data-grid/index.js +5 -5
  54. package/date-picker/definition.cjs +1 -1
  55. package/date-picker/definition.js +1 -1
  56. package/date-picker/index.cjs +1 -1
  57. package/date-picker/index.js +1 -1
  58. package/date-range-picker/definition.cjs +1 -1
  59. package/date-range-picker/definition.js +1 -1
  60. package/date-range-picker/index.cjs +1 -1
  61. package/date-range-picker/index.js +1 -1
  62. package/date-time-picker/definition.cjs +1 -1
  63. package/date-time-picker/definition.js +1 -1
  64. package/date-time-picker/index.cjs +1 -1
  65. package/date-time-picker/index.js +1 -1
  66. package/dial-pad/definition.cjs +1 -1
  67. package/dial-pad/definition.js +1 -1
  68. package/dial-pad/index.cjs +24 -24
  69. package/dial-pad/index.js +120 -51
  70. package/dialog/definition.cjs +1 -1
  71. package/dialog/definition.js +1 -1
  72. package/divider/definition.cjs +1 -1
  73. package/divider/definition.js +1 -1
  74. package/divider/index.cjs +1 -1
  75. package/divider/index.js +1 -1
  76. package/empty-state/definition.cjs +1 -1
  77. package/empty-state/definition.js +1 -1
  78. package/fab/definition.cjs +1 -1
  79. package/fab/definition.js +1 -1
  80. package/file-picker/definition.cjs +1 -1
  81. package/file-picker/definition.js +1 -1
  82. package/flag/definition.cjs +1 -1
  83. package/flag/definition.js +1 -1
  84. package/header/definition.cjs +1 -1
  85. package/header/definition.js +1 -1
  86. package/header/index.cjs +3 -3
  87. package/header/index.js +3 -3
  88. package/index.cjs +200 -196
  89. package/index.js +53 -52
  90. package/kbd-key/definition.cjs +1 -1
  91. package/kbd-key/definition.js +1 -1
  92. package/kbd-shortcut/definition.cjs +1 -1
  93. package/kbd-shortcut/definition.js +1 -1
  94. package/layout/definition.cjs +1 -1
  95. package/layout/definition.js +1 -1
  96. package/lib/accordion-item/accordion-item.d.ts +2 -1
  97. package/lib/action-group/action-group.d.ts +1 -1
  98. package/lib/alert/alert.d.ts +2 -2
  99. package/lib/audio-player/audio-player.d.ts +1 -1
  100. package/lib/avatar/avatar.d.ts +1 -1
  101. package/lib/badge/badge.d.ts +1 -1
  102. package/lib/banner/banner.d.ts +3 -3
  103. package/lib/breadcrumb/breadcrumb.d.ts +1 -1
  104. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  105. package/lib/button/button.d.ts +3 -3
  106. package/lib/calendar-event/calendar-event.d.ts +1 -1
  107. package/lib/card/card.d.ts +1 -1
  108. package/lib/checkbox/checkbox.d.ts +6 -6
  109. package/lib/color-picker/color-picker.d.ts +7 -7
  110. package/lib/combobox/combobox.d.ts +7 -7
  111. package/lib/components.d.ts +1 -0
  112. package/lib/country-group/country-group.d.ts +2 -2
  113. package/lib/data-grid/data-grid-cell.d.ts +4 -3
  114. package/lib/data-grid/data-grid-row.d.ts +3 -2
  115. package/lib/data-grid/data-grid.options.d.ts +5 -0
  116. package/lib/date-picker/date-picker.d.ts +8 -8
  117. package/lib/date-range-picker/date-range-picker.d.ts +4 -4
  118. package/lib/date-time-picker/date-time-picker.d.ts +8 -8
  119. package/lib/dial-pad/dial-pad.d.ts +2 -1
  120. package/lib/dialog/dialog.d.ts +2 -2
  121. package/lib/divider/divider.d.ts +1 -1
  122. package/lib/fab/fab.d.ts +1 -1
  123. package/lib/file-picker/file-picker.d.ts +7 -7
  124. package/lib/header/header.d.ts +1 -1
  125. package/lib/menu/menu.d.ts +2 -2
  126. package/lib/menu-item/menu-item.d.ts +3 -3
  127. package/lib/nav/nav.d.ts +1 -1
  128. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  129. package/lib/nav-item/nav-item.d.ts +2 -2
  130. package/lib/note/note.d.ts +1 -1
  131. package/lib/number-field/number-field.d.ts +9 -9
  132. package/lib/optgroup/definition.d.ts +3 -0
  133. package/lib/optgroup/index.d.ts +1 -0
  134. package/lib/optgroup/optgroup.d.ts +430 -0
  135. package/lib/optgroup/optgroup.template.d.ts +2 -0
  136. package/lib/optgroup/variations.browser-spec.d.ts +1 -0
  137. package/lib/option/option.d.ts +2 -2
  138. package/lib/pagination/pagination.d.ts +1 -1
  139. package/lib/popover/popover.d.ts +2 -2
  140. package/lib/progress/progress.d.ts +1 -1
  141. package/lib/progress-ring/progress-ring.d.ts +1 -1
  142. package/lib/radio/radio.d.ts +3 -3
  143. package/lib/radio-group/radio-group.d.ts +1 -1
  144. package/lib/range-slider/range-slider.d.ts +3 -3
  145. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
  146. package/lib/searchable-select/option-tag.d.ts +1 -1
  147. package/lib/searchable-select/searchable-select.d.ts +47 -47
  148. package/lib/select/select.d.ts +9 -9
  149. package/lib/selectable-box/selectable-box.d.ts +1 -1
  150. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
  151. package/lib/slider/slider.d.ts +3 -3
  152. package/lib/split-button/split-button.d.ts +3 -3
  153. package/lib/status/status.d.ts +1 -1
  154. package/lib/switch/switch.d.ts +2 -2
  155. package/lib/tab/tab.d.ts +3 -3
  156. package/lib/tab-panel/tab-panel.d.ts +1 -1
  157. package/lib/table/table-cell.d.ts +1 -1
  158. package/lib/table/table-header-cell.d.ts +1 -1
  159. package/lib/table/table-row.d.ts +1 -1
  160. package/lib/table/table-sorting-button.d.ts +1 -1
  161. package/lib/tag/tag.d.ts +3 -3
  162. package/lib/tag-group/tag-group.d.ts +1 -1
  163. package/lib/tag-name-map.d.ts +2 -1
  164. package/lib/text-area/text-area.d.ts +8 -8
  165. package/lib/text-field/text-field.d.ts +9 -9
  166. package/lib/time-picker/time-picker.d.ts +4 -4
  167. package/lib/toggletip/toggletip.d.ts +2 -2
  168. package/lib/tooltip/tooltip.d.ts +2 -2
  169. package/lib/tree-item/tree-item.d.ts +2 -2
  170. package/lib/tree-view/tree-view.d.ts +1 -1
  171. package/lib/video-player/video-player.d.ts +1 -1
  172. package/menu/index.cjs +1 -1
  173. package/menu/index.js +1 -1
  174. package/menu-item/index.cjs +1 -1
  175. package/menu-item/index.js +1 -1
  176. package/nav/definition.cjs +1 -1
  177. package/nav/definition.js +1 -1
  178. package/nav-disclosure/definition.cjs +1 -1
  179. package/nav-disclosure/definition.js +1 -1
  180. package/nav-item/definition.cjs +1 -1
  181. package/nav-item/definition.js +1 -1
  182. package/note/definition.cjs +1 -1
  183. package/note/definition.js +1 -1
  184. package/number-field/definition.cjs +1 -1
  185. package/number-field/definition.js +1 -1
  186. package/number-field/index.cjs +1 -1
  187. package/number-field/index.js +1 -1
  188. package/optgroup/definition.cjs +5 -0
  189. package/optgroup/definition.js +2 -0
  190. package/optgroup/index.cjs +1 -0
  191. package/optgroup/index.js +4 -0
  192. package/package.json +6 -6
  193. package/pagination/definition.cjs +1 -1
  194. package/pagination/definition.js +1 -1
  195. package/platform-switch/definition.cjs +1 -1
  196. package/platform-switch/definition.js +1 -1
  197. package/popover/definition.cjs +1 -1
  198. package/popover/definition.js +1 -1
  199. package/progress/definition.cjs +1 -1
  200. package/progress/definition.js +1 -1
  201. package/radio/definition.cjs +1 -1
  202. package/radio/definition.js +1 -1
  203. package/radio-group/definition.cjs +1 -1
  204. package/radio-group/definition.js +1 -1
  205. package/range-slider/definition.cjs +1 -1
  206. package/range-slider/definition.js +1 -1
  207. package/rich-text-editor/definition.cjs +1 -1
  208. package/rich-text-editor/definition.js +1 -1
  209. package/rich-text-editor/index.cjs +1 -1
  210. package/rich-text-editor/index.js +4 -4
  211. package/rich-text-view/definition.cjs +1 -1
  212. package/rich-text-view/definition.js +1 -1
  213. package/searchable-select/definition.cjs +1 -1
  214. package/searchable-select/definition.js +1 -1
  215. package/searchable-select/index.cjs +19 -19
  216. package/searchable-select/index.js +60 -45
  217. package/select/definition.cjs +1 -1
  218. package/select/definition.js +1 -1
  219. package/select/index.cjs +1 -1
  220. package/select/index.js +1 -1
  221. package/selectable-box/definition.cjs +1 -1
  222. package/selectable-box/definition.js +1 -1
  223. package/shared/aria/delegates-aria.d.ts +1 -1
  224. package/shared/aria/host-semantics.d.ts +1 -1
  225. package/shared/color-picker/base-color-picker.d.ts +1 -1
  226. package/shared/feedback/feedback-message.d.ts +1 -1
  227. package/shared/feedback/mixins.d.ts +2 -2
  228. package/shared/foundation/button/button.d.ts +2 -2
  229. package/shared/foundation/form-associated/form-associated.d.ts +2 -2
  230. package/shared/foundation/listbox/extractOptions.d.ts +2 -0
  231. package/shared/foundation/listbox/listbox.d.ts +2 -0
  232. package/shared/patterns/affix.d.ts +2 -2
  233. package/shared/patterns/anchored.d.ts +2 -2
  234. package/shared/patterns/char-count/char-count.d.ts +1 -1
  235. package/shared/patterns/form-elements/form-element.d.ts +1 -1
  236. package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
  237. package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
  238. package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
  239. package/shared/patterns/kbd-shortcut.d.ts +1 -1
  240. package/shared/patterns/linkable.d.ts +1 -1
  241. package/shared/patterns/localized.d.ts +2 -2
  242. package/shared/patterns/trapped-focus.d.ts +1 -1
  243. package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
  244. package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
  245. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
  246. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
  247. package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
  248. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
  249. package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
  250. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
  251. package/shared/picker-field/picker-field.d.ts +7 -7
  252. package/side-drawer/definition.cjs +1 -1
  253. package/side-drawer/definition.js +1 -1
  254. package/simple-color-picker/definition.cjs +1 -1
  255. package/simple-color-picker/definition.js +1 -1
  256. package/split-button/definition.cjs +1 -1
  257. package/split-button/definition.js +1 -1
  258. package/split-button/index.cjs +1 -0
  259. package/split-button/index.js +1 -0
  260. package/status/definition.cjs +1 -1
  261. package/status/definition.js +1 -1
  262. package/switch/definition.cjs +1 -1
  263. package/switch/definition.js +1 -1
  264. package/switch/index.cjs +6 -5
  265. package/switch/index.js +16 -14
  266. package/tab/definition.cjs +1 -1
  267. package/tab/definition.js +1 -1
  268. package/tab-panel/definition.cjs +1 -1
  269. package/tab-panel/definition.js +1 -1
  270. package/table/definition.cjs +1 -1
  271. package/table/definition.js +1 -1
  272. package/tabs/definition.cjs +1 -1
  273. package/tabs/definition.js +1 -1
  274. package/tag/definition.cjs +1 -1
  275. package/tag/definition.js +1 -1
  276. package/tag-group/definition.cjs +1 -1
  277. package/tag-group/definition.js +1 -1
  278. package/text-area/definition.cjs +1 -1
  279. package/text-area/definition.js +1 -1
  280. package/time-picker/definition.cjs +1 -1
  281. package/time-picker/definition.js +1 -1
  282. package/tree-item/definition.cjs +1 -1
  283. package/tree-item/definition.js +1 -1
  284. package/tree-view/definition.cjs +1 -1
  285. package/tree-view/definition.js +1 -1
  286. package/unbundled/definition13.cjs +1 -1
  287. package/unbundled/definition13.js +1 -1
  288. package/unbundled/definition2.cjs +9 -3
  289. package/unbundled/definition2.js +9 -3
  290. package/unbundled/definition23.cjs +1 -0
  291. package/unbundled/definition23.js +2 -1
  292. package/unbundled/definition29.cjs +2 -2
  293. package/unbundled/definition29.js +2 -2
  294. package/unbundled/definition30.cjs +65 -484
  295. package/unbundled/definition30.js +57 -482
  296. package/unbundled/definition31.cjs +501 -39
  297. package/unbundled/definition31.js +499 -37
  298. package/unbundled/definition32.cjs +38 -239
  299. package/unbundled/definition32.js +35 -236
  300. package/unbundled/definition33.cjs +236 -74
  301. package/unbundled/definition33.js +233 -71
  302. package/unbundled/definition34.cjs +74 -1968
  303. package/unbundled/definition34.js +70 -1940
  304. package/unbundled/definition35.cjs +1992 -26
  305. package/unbundled/definition35.js +1964 -27
  306. package/unbundled/definition36.cjs +26 -111
  307. package/unbundled/definition36.js +23 -103
  308. package/unbundled/definition37.cjs +53 -294
  309. package/unbundled/definition37.js +50 -291
  310. package/unbundled/definition38.cjs +282 -132
  311. package/unbundled/definition38.js +279 -129
  312. package/unbundled/definition39.cjs +165 -339
  313. package/unbundled/definition39.js +163 -337
  314. package/unbundled/definition40.cjs +394 -228
  315. package/unbundled/definition40.js +391 -225
  316. package/unbundled/definition41.cjs +263 -46
  317. package/unbundled/definition41.js +258 -41
  318. package/unbundled/definition42.cjs +47 -67
  319. package/unbundled/definition42.js +45 -65
  320. package/unbundled/definition43.cjs +56 -383
  321. package/unbundled/definition43.js +55 -382
  322. package/unbundled/definition44.cjs +386 -44
  323. package/unbundled/definition44.js +382 -40
  324. package/unbundled/definition45.cjs +53 -45
  325. package/unbundled/definition45.js +49 -41
  326. package/unbundled/definition46.cjs +40 -164
  327. package/unbundled/definition46.js +36 -160
  328. package/unbundled/definition47.cjs +171 -31
  329. package/unbundled/definition47.js +168 -22
  330. package/unbundled/definition48.cjs +30 -89
  331. package/unbundled/definition48.js +22 -87
  332. package/unbundled/definition49.cjs +70 -33
  333. package/unbundled/definition49.js +67 -30
  334. package/unbundled/definition50.cjs +54 -23
  335. package/unbundled/definition50.js +52 -18
  336. package/unbundled/definition51.cjs +23 -39
  337. package/unbundled/definition51.js +17 -36
  338. package/unbundled/definition52.cjs +29 -314
  339. package/unbundled/definition52.js +27 -312
  340. package/unbundled/definition53.cjs +301 -195
  341. package/unbundled/definition53.js +297 -191
  342. package/unbundled/definition54.cjs +210 -40
  343. package/unbundled/definition54.js +206 -36
  344. package/unbundled/definition55.cjs +42 -266
  345. package/unbundled/definition55.js +38 -262
  346. package/unbundled/definition56.cjs +266 -50
  347. package/unbundled/definition56.js +263 -46
  348. package/unbundled/definition57.cjs +48 -146
  349. package/unbundled/definition57.js +47 -143
  350. package/unbundled/definition58.cjs +127 -225
  351. package/unbundled/definition58.js +122 -223
  352. package/unbundled/definition59.cjs +199 -418
  353. package/unbundled/definition59.js +196 -415
  354. package/unbundled/definition60.cjs +441 -3738
  355. package/unbundled/definition60.js +431 -3565
  356. package/unbundled/definition61.cjs +3712 -728
  357. package/unbundled/definition61.js +3538 -717
  358. package/unbundled/definition62.cjs +769 -97
  359. package/unbundled/definition62.js +766 -94
  360. package/unbundled/definition63.cjs +100 -981
  361. package/unbundled/definition63.js +98 -976
  362. package/unbundled/definition64.cjs +988 -93
  363. package/unbundled/definition64.js +982 -90
  364. package/unbundled/definition65.cjs +109 -73
  365. package/unbundled/definition65.js +105 -63
  366. package/unbundled/definition66.cjs +69 -155
  367. package/unbundled/definition66.js +60 -152
  368. package/unbundled/definition67.cjs +154 -118
  369. package/unbundled/definition67.js +151 -115
  370. package/unbundled/definition68.cjs +124 -49
  371. package/unbundled/definition68.js +120 -45
  372. package/unbundled/definition69.cjs +51 -84
  373. package/unbundled/definition69.js +50 -80
  374. package/unbundled/definition70.cjs +91 -19
  375. package/unbundled/definition70.js +86 -14
  376. package/unbundled/definition71.cjs +20 -87
  377. package/unbundled/definition71.js +14 -84
  378. package/unbundled/definition72.cjs +76 -294
  379. package/unbundled/definition72.js +71 -217
  380. package/unbundled/definition73.cjs +288 -311
  381. package/unbundled/definition73.js +218 -306
  382. package/unbundled/definition74.cjs +326 -26
  383. package/unbundled/definition74.js +317 -23
  384. package/unbundled/definition75.cjs +27 -122
  385. package/unbundled/definition75.js +22 -118
  386. package/unbundled/definition76.cjs +103 -232
  387. package/unbundled/definition76.js +99 -228
  388. package/unbundled/definition77.cjs +259 -26
  389. package/unbundled/definition77.js +249 -23
  390. package/unbundled/definition78.cjs +29 -148
  391. package/unbundled/definition78.js +27 -133
  392. package/unbundled/definition79.cjs +117 -173
  393. package/unbundled/definition79.js +108 -169
  394. package/unbundled/definition80.cjs +181 -477
  395. package/unbundled/definition80.js +176 -471
  396. package/unbundled/definition81.cjs +517 -0
  397. package/unbundled/definition81.js +497 -0
  398. package/unbundled/extractOptions.cjs +21 -0
  399. package/unbundled/extractOptions.js +16 -0
  400. package/unbundled/listbox.cjs +23 -6
  401. package/unbundled/listbox.js +23 -6
  402. package/unbundled/vivid-element.cjs +10 -1
  403. package/unbundled/vivid-element.js +10 -1
  404. package/video-player/definition.cjs +1 -1
  405. package/video-player/definition.js +1 -1
  406. package/vivid.api.json +194 -0
@@ -1,75 +1,245 @@
1
1
  require("./chunk.cjs");
2
2
  const require_vivid_element = require("./vivid-element.cjs");
3
3
  const require_decorate = require("./decorate.cjs");
4
- const require_platform = require("./platform.cjs");
4
+ const require_localized = require("./localized.cjs");
5
+ const require_definition = require("./definition6.cjs");
6
+ const require_enums = require("./enums.cjs");
5
7
  let _microsoft_fast_element = require("@microsoft/fast-element");
6
- //#region src/lib/platform-switch/platform-switch.scss?inline
7
- var platform_switch_default = ":host{display:contents}";
8
+ let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
9
+ //#region src/lib/pagination/pagination.scss?inline
10
+ var pagination_default = ".control{justify-content:space-between;display:inline-flex}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{column-gap:4px;display:flex}.vwc-pagination-button[size=super-condensed]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16))}.vwc-pagination-button[size=condensed]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8))}.vwc-pagination-button[size=normal]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)))}.vwc-pagination-button::part(button){padding-inline:0}.dots{text-align:center;align-self:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16))}.dots.size-condensed{inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8))}.dots.size-normal{inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)))}";
8
11
  //#endregion
9
- //#region src/lib/platform-switch/platform-switch.ts
12
+ //#region src/lib/pagination/pagination.ts
13
+ var MAX_DIGITS_AND_PLACEHOLDERS = 7;
14
+ var totalConverter = {
15
+ fromView: (value) => parseInt(value, 10),
16
+ toView: (value) => value.toString()
17
+ };
10
18
  /**
11
19
  * @public
12
- * @component platform-switch
13
- * @slot - Default slot accepts children with optional platform constraints.
20
+ * @component pagination
21
+ * @event {CustomEvent<{selectedIndex: number, total: number, oldIndex: number}>} pagination-change - Fires when the page changes.
22
+ * @vueModel modelValue selectedIndex pagination-change `event.currentTarget.selectedIndex`
23
+ * @testAction clickNext click #nextButton
24
+ * @testAction clickPrev click #prevButton
25
+ * @testAction clickPageIndex clickPaginationPage
26
+ * @testQuery total total
27
+ * @testQuery selectedPage paginationSelectedPage
28
+ * @testRef nextButton shadow .next-button
29
+ * @testRef prevButton shadow .prev-button
14
30
  */
15
- var PlatformSwitch = class extends require_vivid_element.VividElement {
16
- /** @internal */
17
- slottedContentChanged() {
18
- this.#updateVisibility();
31
+ var Pagination = class extends require_localized.Localized(require_vivid_element.VividElement) {
32
+ get pagesList() {
33
+ return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
34
+ if (i === 0) return 1;
35
+ if (i === arr.length - 1) return this.total;
36
+ if (this.selectedIndex !== void 0 && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
37
+ if (this.selectedIndex < 4) {
38
+ if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
39
+ }
40
+ if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
41
+ if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
42
+ /* v8 ignore else -- @preserve */
43
+ if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
44
+ }
45
+ if (this.selectedIndex > this.total - 5) {
46
+ if (i > 1) return this.total - (6 - i);
47
+ /* v8 ignore else -- @preserve */
48
+ if (i === 1) return "...";
49
+ }
50
+ }
51
+ return i + 1;
52
+ });
19
53
  }
20
- #updateVisibility() {
21
- const children = this.slottedContent.filter((n) => n instanceof HTMLElement);
22
- let matched = false;
23
- for (const child of children) {
24
- if (matched) {
25
- child.hidden = true;
26
- continue;
54
+ constructor() {
55
+ super();
56
+ this.navIcons = false;
57
+ this.total = 0;
58
+ this.selectedIndex = 0;
59
+ this.addEventListener("tabpressed", (e) => {
60
+ const { value: currentLabel, shiftKey } = e.detail;
61
+ const index = this.paginationButtons.findIndex((button) => Number(button.label) === currentLabel);
62
+ const focusDirection = shiftKey ? -1 : 1;
63
+ const newIndex = index + focusDirection;
64
+ if (newIndex < 0) {
65
+ this.prevButton.focus();
66
+ return;
67
+ }
68
+ if (newIndex > this.paginationButtons.length - 1) {
69
+ this.nextButton.focus();
70
+ return;
27
71
  }
28
- if (this.#matches(child)) {
29
- child.hidden = false;
30
- matched = true;
31
- } else child.hidden = true;
72
+ /* v8 ignore else -- @preserve */
73
+ if (this.paginationButtons) this.paginationButtons[index + focusDirection].focus();
74
+ });
75
+ }
76
+ /** @internal */
77
+ totalChanged(_, newValue) {
78
+ if (newValue < 0) {
79
+ this.total = 0;
80
+ return;
32
81
  }
82
+ this.#constrainSelectedIndex();
83
+ }
84
+ /** @internal */
85
+ selectedIndexChanged(oldValue, newValue) {
86
+ if (oldValue === void 0) return;
87
+ this.$emit("pagination-change", {
88
+ selectedIndex: newValue,
89
+ total: this.total,
90
+ oldIndex: oldValue
91
+ });
92
+ this.#constrainSelectedIndex();
33
93
  }
34
- #matches(el) {
35
- const keyboard = require_platform.isApplePlatform() ? "apple" : "standard";
36
- const keyboardConstraint = el.dataset.keyboard;
37
- if (keyboardConstraint === void 0) return true;
38
- return keyboardConstraint === keyboard;
94
+ /** @internal */
95
+ paginationButtonsChanged(_, newValue) {
96
+ newValue.forEach((button) => {
97
+ button.shadowRoot.querySelector("button").setAttribute("part", "button");
98
+ });
99
+ }
100
+ get #constrainedSelectedIndex() {
101
+ return Math.max(0, Math.min(this.selectedIndex ?? 0, this.total - 1));
102
+ }
103
+ #constrainSelectedIndex() {
104
+ if (this.selectedIndex !== this.#constrainedSelectedIndex) window.queueMicrotask(() => {
105
+ if (this.selectedIndex !== this.#constrainedSelectedIndex) this.selectedIndex = this.#constrainedSelectedIndex;
106
+ });
39
107
  }
40
108
  };
41
- require_decorate.__decorate([_microsoft_fast_element.observable], PlatformSwitch.prototype, "slottedContent", void 0);
109
+ require_decorate.__decorate([_microsoft_fast_element.attr], Pagination.prototype, "size", void 0);
110
+ require_decorate.__decorate([_microsoft_fast_element.attr], Pagination.prototype, "shape", void 0);
111
+ require_decorate.__decorate([_microsoft_fast_element.observable], Pagination.prototype, "paginationButtons", void 0);
112
+ require_decorate.__decorate([_microsoft_fast_element.observable], Pagination.prototype, "prevButton", void 0);
113
+ require_decorate.__decorate([_microsoft_fast_element.observable], Pagination.prototype, "nextButton", void 0);
114
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
115
+ attribute: "nav-icons",
116
+ mode: "boolean"
117
+ })], Pagination.prototype, "navIcons", void 0);
118
+ require_decorate.__decorate([_microsoft_fast_element.volatile], Pagination.prototype, "pagesList", null);
119
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
120
+ mode: "reflect",
121
+ converter: totalConverter
122
+ })], Pagination.prototype, "total", void 0);
123
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
124
+ mode: "reflect",
125
+ converter: totalConverter,
126
+ attribute: "selected-index"
127
+ })], Pagination.prototype, "selectedIndex", void 0);
42
128
  //#endregion
43
- //#region src/lib/platform-switch/platform-switch.template.ts
44
- var PlatformSwitchTemplate = () => {
45
- return _microsoft_fast_element.html`<slot ${(0, _microsoft_fast_element.slotted)("slottedContent")}></slot>`;
129
+ //#region src/lib/pagination/pagination.template.ts
130
+ var ALLOWED_SIZES = [
131
+ require_enums.Size.SuperCondensed,
132
+ require_enums.Size.Condensed,
133
+ require_enums.Size.Normal
134
+ ];
135
+ var ALLOWED_SHAPES = [require_enums.Shape.Rounded, require_enums.Shape.Pill];
136
+ var handleSelection = (value, { parent: x }) => {
137
+ return x.selectedIndex = Number(value) - 1;
138
+ };
139
+ var handleKeyDown = (value, { event, parent }) => {
140
+ if (event.key === " " || event.key === "Enter") handleSelection(value, { parent });
141
+ if (event.key === "Tab") event.target.dispatchEvent(new CustomEvent("tabpressed", {
142
+ detail: {
143
+ value,
144
+ shiftKey: event.shiftKey
145
+ },
146
+ bubbles: true,
147
+ composed: true
148
+ }));
149
+ };
150
+ var getClasses = (_) => (0, _microsoft_fast_web_utilities.classNames)("control");
151
+ function getButtonAppearance(value, { parent }) {
152
+ return parent.selectedIndex === Number(value) - 1 ? "filled" : "ghost";
153
+ }
154
+ var paginationButtonRenderer = (buttonTag) => _microsoft_fast_element.html` ${(0, _microsoft_fast_element.when)((value) => value !== "...", _microsoft_fast_element.html`
155
+ <${buttonTag} class="vwc-pagination-button"
156
+ label="${(value) => value}"
157
+ appearance="${getButtonAppearance}"
158
+ size="${(_, { parent: x }) => getPaginationSize(x)}"
159
+ shape="${(_, { parent: x }) => getPaginationShape(x)}"
160
+ style="inline-size: ${(value) => getPaginationButtonWidth(value)};"
161
+ tabindex="0"
162
+ aria-label="${(value, { parent: x }) => x.locale.pagination.goToPageLabel(value)}"
163
+ aria-current="${(value, { parent }) => parent.selectedIndex === Number(value) - 1}"
164
+ @click="${handleSelection}"
165
+ @keydown="${handleKeyDown}">
166
+ </${buttonTag}>
167
+ `)}
168
+ ${(0, _microsoft_fast_element.when)((value) => value === "...", _microsoft_fast_element.html` <div
169
+ class="dots size-${(_, { parent: x }) => getPaginationSize(x)}"
170
+ aria-hidden="true"
171
+ >
172
+ ...
173
+ </div>`)}`;
174
+ var getPaginationSize = (x) => {
175
+ if (!x.size || !ALLOWED_SIZES.includes(x.size)) return require_enums.Size.SuperCondensed;
176
+ return x.size;
177
+ };
178
+ var getPaginationShape = (x) => {
179
+ if (!x.shape || !ALLOWED_SHAPES.includes(x.shape)) return require_enums.Shape.Rounded;
180
+ return x.shape;
181
+ };
182
+ var getPaginationButtonWidth = (value) => {
183
+ return `calc(var(--base-size) + ${String(value).length - 1}ch)`;
184
+ };
185
+ var PaginationTemplate = (context) => {
186
+ const buttonTag = context.tagFor(require_definition.Button);
187
+ const buttonTagName = context.tagFor(require_definition.Button, true);
188
+ const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
189
+ return _microsoft_fast_element.html`
190
+ <div class="${getClasses}">
191
+ <${buttonTag} class="prev-button" ${(0, _microsoft_fast_element.ref)("prevButton")}
192
+ label="${(x) => !x.navIcons ? "Previous" : null}"
193
+ icon="${(x) => x.navIcons ? "chevron-left-line" : null}"
194
+ size="${getPaginationSize}"
195
+ shape="${getPaginationShape}"
196
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === 0}"
197
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex--}"
198
+ aria-label="${(x) => x.locale.pagination.previousPageLabel}"
199
+ ></${buttonTag}>
200
+ <div id="buttons-wrapper" class="buttons-wrapper" ${(0, _microsoft_fast_element.children)({
201
+ property: "paginationButtons",
202
+ filter: (0, _microsoft_fast_element.elements)(buttonTagName)
203
+ })}>
204
+ ${(0, _microsoft_fast_element.repeat)((x) => x.pagesList, paginationButtonTemplate, { positioning: true })}
205
+ </div>
206
+ <${buttonTag} class="next-button" ${(0, _microsoft_fast_element.ref)("nextButton")}
207
+ label="${(x) => !x.navIcons ? "Next" : null}"
208
+ icon="${(x) => x.navIcons ? "chevron-right-line" : null}"
209
+ size="${getPaginationSize}"
210
+ shape="${getPaginationShape}"
211
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === x.total - 1}"
212
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex++}"
213
+ aria-label="${(x) => x.locale.pagination.nextPageLabel}"
214
+ ></${buttonTag}>
215
+ </div>`;
46
216
  };
47
217
  //#endregion
48
- //#region src/lib/platform-switch/definition.ts
218
+ //#region src/lib/pagination/definition.ts
49
219
  /** @internal */
50
- var platformSwitchDefinition = require_vivid_element.defineVividComponent("platform-switch", PlatformSwitch, PlatformSwitchTemplate, [], { styles: platform_switch_default });
220
+ var paginationDefinition = require_vivid_element.defineVividComponent("pagination", Pagination, PaginationTemplate, [require_definition.buttonDefinition], { styles: pagination_default });
51
221
  /**
52
- * Registers the platform-switch element with the design system.
222
+ * Registers the pagination element with the design system.
53
223
  *
54
224
  * @param prefix - the prefix to use for the component name
55
225
  */
56
- var registerPlatformSwitch = require_vivid_element.createRegisterFunction(platformSwitchDefinition);
226
+ var registerPagination = require_vivid_element.createRegisterFunction(paginationDefinition);
57
227
  //#endregion
58
- Object.defineProperty(exports, "PlatformSwitch", {
228
+ Object.defineProperty(exports, "Pagination", {
59
229
  enumerable: true,
60
230
  get: function() {
61
- return PlatformSwitch;
231
+ return Pagination;
62
232
  }
63
233
  });
64
- Object.defineProperty(exports, "platformSwitchDefinition", {
234
+ Object.defineProperty(exports, "paginationDefinition", {
65
235
  enumerable: true,
66
236
  get: function() {
67
- return platformSwitchDefinition;
237
+ return paginationDefinition;
68
238
  }
69
239
  });
70
- Object.defineProperty(exports, "registerPlatformSwitch", {
240
+ Object.defineProperty(exports, "registerPagination", {
71
241
  enumerable: true,
72
242
  get: function() {
73
- return registerPlatformSwitch;
243
+ return registerPagination;
74
244
  }
75
245
  });
@@ -1,57 +1,227 @@
1
1
  import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
2
2
  import { t as __decorate } from "./decorate.js";
3
- import { t as isApplePlatform } from "./platform.js";
4
- import { html, observable, slotted } from "@microsoft/fast-element";
5
- //#region src/lib/platform-switch/platform-switch.scss?inline
6
- var platform_switch_default = ":host{display:contents}";
3
+ import { t as Localized } from "./localized.js";
4
+ import { i as Button, t as buttonDefinition } from "./definition6.js";
5
+ import { d as Size, u as Shape } from "./enums.js";
6
+ import { attr, children, elements, html, observable, ref, repeat, volatile, when } from "@microsoft/fast-element";
7
+ import { classNames } from "@microsoft/fast-web-utilities";
8
+ //#region src/lib/pagination/pagination.scss?inline
9
+ var pagination_default = ".control{justify-content:space-between;display:inline-flex}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{column-gap:4px;display:flex}.vwc-pagination-button[size=super-condensed]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16))}.vwc-pagination-button[size=condensed]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8))}.vwc-pagination-button[size=normal]{--base-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)))}.vwc-pagination-button::part(button){padding-inline:0}.dots{text-align:center;align-self:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16))}.dots.size-condensed{inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8))}.dots.size-normal{inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)))}";
7
10
  //#endregion
8
- //#region src/lib/platform-switch/platform-switch.ts
11
+ //#region src/lib/pagination/pagination.ts
12
+ var MAX_DIGITS_AND_PLACEHOLDERS = 7;
13
+ var totalConverter = {
14
+ fromView: (value) => parseInt(value, 10),
15
+ toView: (value) => value.toString()
16
+ };
9
17
  /**
10
18
  * @public
11
- * @component platform-switch
12
- * @slot - Default slot accepts children with optional platform constraints.
19
+ * @component pagination
20
+ * @event {CustomEvent<{selectedIndex: number, total: number, oldIndex: number}>} pagination-change - Fires when the page changes.
21
+ * @vueModel modelValue selectedIndex pagination-change `event.currentTarget.selectedIndex`
22
+ * @testAction clickNext click #nextButton
23
+ * @testAction clickPrev click #prevButton
24
+ * @testAction clickPageIndex clickPaginationPage
25
+ * @testQuery total total
26
+ * @testQuery selectedPage paginationSelectedPage
27
+ * @testRef nextButton shadow .next-button
28
+ * @testRef prevButton shadow .prev-button
13
29
  */
14
- var PlatformSwitch = class extends VividElement {
15
- /** @internal */
16
- slottedContentChanged() {
17
- this.#updateVisibility();
30
+ var Pagination = class extends Localized(VividElement) {
31
+ get pagesList() {
32
+ return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
33
+ if (i === 0) return 1;
34
+ if (i === arr.length - 1) return this.total;
35
+ if (this.selectedIndex !== void 0 && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
36
+ if (this.selectedIndex < 4) {
37
+ if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
38
+ }
39
+ if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
40
+ if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
41
+ /* v8 ignore else -- @preserve */
42
+ if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return "...";
43
+ }
44
+ if (this.selectedIndex > this.total - 5) {
45
+ if (i > 1) return this.total - (6 - i);
46
+ /* v8 ignore else -- @preserve */
47
+ if (i === 1) return "...";
48
+ }
49
+ }
50
+ return i + 1;
51
+ });
18
52
  }
19
- #updateVisibility() {
20
- const children = this.slottedContent.filter((n) => n instanceof HTMLElement);
21
- let matched = false;
22
- for (const child of children) {
23
- if (matched) {
24
- child.hidden = true;
25
- continue;
53
+ constructor() {
54
+ super();
55
+ this.navIcons = false;
56
+ this.total = 0;
57
+ this.selectedIndex = 0;
58
+ this.addEventListener("tabpressed", (e) => {
59
+ const { value: currentLabel, shiftKey } = e.detail;
60
+ const index = this.paginationButtons.findIndex((button) => Number(button.label) === currentLabel);
61
+ const focusDirection = shiftKey ? -1 : 1;
62
+ const newIndex = index + focusDirection;
63
+ if (newIndex < 0) {
64
+ this.prevButton.focus();
65
+ return;
66
+ }
67
+ if (newIndex > this.paginationButtons.length - 1) {
68
+ this.nextButton.focus();
69
+ return;
26
70
  }
27
- if (this.#matches(child)) {
28
- child.hidden = false;
29
- matched = true;
30
- } else child.hidden = true;
71
+ /* v8 ignore else -- @preserve */
72
+ if (this.paginationButtons) this.paginationButtons[index + focusDirection].focus();
73
+ });
74
+ }
75
+ /** @internal */
76
+ totalChanged(_, newValue) {
77
+ if (newValue < 0) {
78
+ this.total = 0;
79
+ return;
31
80
  }
81
+ this.#constrainSelectedIndex();
82
+ }
83
+ /** @internal */
84
+ selectedIndexChanged(oldValue, newValue) {
85
+ if (oldValue === void 0) return;
86
+ this.$emit("pagination-change", {
87
+ selectedIndex: newValue,
88
+ total: this.total,
89
+ oldIndex: oldValue
90
+ });
91
+ this.#constrainSelectedIndex();
32
92
  }
33
- #matches(el) {
34
- const keyboard = isApplePlatform() ? "apple" : "standard";
35
- const keyboardConstraint = el.dataset.keyboard;
36
- if (keyboardConstraint === void 0) return true;
37
- return keyboardConstraint === keyboard;
93
+ /** @internal */
94
+ paginationButtonsChanged(_, newValue) {
95
+ newValue.forEach((button) => {
96
+ button.shadowRoot.querySelector("button").setAttribute("part", "button");
97
+ });
98
+ }
99
+ get #constrainedSelectedIndex() {
100
+ return Math.max(0, Math.min(this.selectedIndex ?? 0, this.total - 1));
101
+ }
102
+ #constrainSelectedIndex() {
103
+ if (this.selectedIndex !== this.#constrainedSelectedIndex) window.queueMicrotask(() => {
104
+ if (this.selectedIndex !== this.#constrainedSelectedIndex) this.selectedIndex = this.#constrainedSelectedIndex;
105
+ });
38
106
  }
39
107
  };
40
- __decorate([observable], PlatformSwitch.prototype, "slottedContent", void 0);
108
+ __decorate([attr], Pagination.prototype, "size", void 0);
109
+ __decorate([attr], Pagination.prototype, "shape", void 0);
110
+ __decorate([observable], Pagination.prototype, "paginationButtons", void 0);
111
+ __decorate([observable], Pagination.prototype, "prevButton", void 0);
112
+ __decorate([observable], Pagination.prototype, "nextButton", void 0);
113
+ __decorate([attr({
114
+ attribute: "nav-icons",
115
+ mode: "boolean"
116
+ })], Pagination.prototype, "navIcons", void 0);
117
+ __decorate([volatile], Pagination.prototype, "pagesList", null);
118
+ __decorate([attr({
119
+ mode: "reflect",
120
+ converter: totalConverter
121
+ })], Pagination.prototype, "total", void 0);
122
+ __decorate([attr({
123
+ mode: "reflect",
124
+ converter: totalConverter,
125
+ attribute: "selected-index"
126
+ })], Pagination.prototype, "selectedIndex", void 0);
41
127
  //#endregion
42
- //#region src/lib/platform-switch/platform-switch.template.ts
43
- var PlatformSwitchTemplate = () => {
44
- return html`<slot ${slotted("slottedContent")}></slot>`;
128
+ //#region src/lib/pagination/pagination.template.ts
129
+ var ALLOWED_SIZES = [
130
+ Size.SuperCondensed,
131
+ Size.Condensed,
132
+ Size.Normal
133
+ ];
134
+ var ALLOWED_SHAPES = [Shape.Rounded, Shape.Pill];
135
+ var handleSelection = (value, { parent: x }) => {
136
+ return x.selectedIndex = Number(value) - 1;
137
+ };
138
+ var handleKeyDown = (value, { event, parent }) => {
139
+ if (event.key === " " || event.key === "Enter") handleSelection(value, { parent });
140
+ if (event.key === "Tab") event.target.dispatchEvent(new CustomEvent("tabpressed", {
141
+ detail: {
142
+ value,
143
+ shiftKey: event.shiftKey
144
+ },
145
+ bubbles: true,
146
+ composed: true
147
+ }));
148
+ };
149
+ var getClasses = (_) => classNames("control");
150
+ function getButtonAppearance(value, { parent }) {
151
+ return parent.selectedIndex === Number(value) - 1 ? "filled" : "ghost";
152
+ }
153
+ var paginationButtonRenderer = (buttonTag) => html` ${when((value) => value !== "...", html`
154
+ <${buttonTag} class="vwc-pagination-button"
155
+ label="${(value) => value}"
156
+ appearance="${getButtonAppearance}"
157
+ size="${(_, { parent: x }) => getPaginationSize(x)}"
158
+ shape="${(_, { parent: x }) => getPaginationShape(x)}"
159
+ style="inline-size: ${(value) => getPaginationButtonWidth(value)};"
160
+ tabindex="0"
161
+ aria-label="${(value, { parent: x }) => x.locale.pagination.goToPageLabel(value)}"
162
+ aria-current="${(value, { parent }) => parent.selectedIndex === Number(value) - 1}"
163
+ @click="${handleSelection}"
164
+ @keydown="${handleKeyDown}">
165
+ </${buttonTag}>
166
+ `)}
167
+ ${when((value) => value === "...", html` <div
168
+ class="dots size-${(_, { parent: x }) => getPaginationSize(x)}"
169
+ aria-hidden="true"
170
+ >
171
+ ...
172
+ </div>`)}`;
173
+ var getPaginationSize = (x) => {
174
+ if (!x.size || !ALLOWED_SIZES.includes(x.size)) return Size.SuperCondensed;
175
+ return x.size;
176
+ };
177
+ var getPaginationShape = (x) => {
178
+ if (!x.shape || !ALLOWED_SHAPES.includes(x.shape)) return Shape.Rounded;
179
+ return x.shape;
180
+ };
181
+ var getPaginationButtonWidth = (value) => {
182
+ return `calc(var(--base-size) + ${String(value).length - 1}ch)`;
183
+ };
184
+ var PaginationTemplate = (context) => {
185
+ const buttonTag = context.tagFor(Button);
186
+ const buttonTagName = context.tagFor(Button, true);
187
+ const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
188
+ return html`
189
+ <div class="${getClasses}">
190
+ <${buttonTag} class="prev-button" ${ref("prevButton")}
191
+ label="${(x) => !x.navIcons ? "Previous" : null}"
192
+ icon="${(x) => x.navIcons ? "chevron-left-line" : null}"
193
+ size="${getPaginationSize}"
194
+ shape="${getPaginationShape}"
195
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === 0}"
196
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex--}"
197
+ aria-label="${(x) => x.locale.pagination.previousPageLabel}"
198
+ ></${buttonTag}>
199
+ <div id="buttons-wrapper" class="buttons-wrapper" ${children({
200
+ property: "paginationButtons",
201
+ filter: elements(buttonTagName)
202
+ })}>
203
+ ${repeat((x) => x.pagesList, paginationButtonTemplate, { positioning: true })}
204
+ </div>
205
+ <${buttonTag} class="next-button" ${ref("nextButton")}
206
+ label="${(x) => !x.navIcons ? "Next" : null}"
207
+ icon="${(x) => x.navIcons ? "chevron-right-line" : null}"
208
+ size="${getPaginationSize}"
209
+ shape="${getPaginationShape}"
210
+ ?disabled="${(x) => x.total === 0 || x.selectedIndex === x.total - 1}"
211
+ @click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex++}"
212
+ aria-label="${(x) => x.locale.pagination.nextPageLabel}"
213
+ ></${buttonTag}>
214
+ </div>`;
45
215
  };
46
216
  //#endregion
47
- //#region src/lib/platform-switch/definition.ts
217
+ //#region src/lib/pagination/definition.ts
48
218
  /** @internal */
49
- var platformSwitchDefinition = defineVividComponent("platform-switch", PlatformSwitch, PlatformSwitchTemplate, [], { styles: platform_switch_default });
219
+ var paginationDefinition = defineVividComponent("pagination", Pagination, PaginationTemplate, [buttonDefinition], { styles: pagination_default });
50
220
  /**
51
- * Registers the platform-switch element with the design system.
221
+ * Registers the pagination element with the design system.
52
222
  *
53
223
  * @param prefix - the prefix to use for the component name
54
224
  */
55
- var registerPlatformSwitch = createRegisterFunction(platformSwitchDefinition);
225
+ var registerPagination = createRegisterFunction(paginationDefinition);
56
226
  //#endregion
57
- export { registerPlatformSwitch as n, PlatformSwitch as r, platformSwitchDefinition as t };
227
+ export { registerPagination as n, Pagination as r, paginationDefinition as t };