vectis-ui 0.11.0 → 0.13.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 (511) hide show
  1. package/dist/components/VAccordion/VAccordion.css +1 -1
  2. package/dist/components/VAccordion/VAccordion.d.ts +6 -5
  3. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  6. package/dist/components/VAccordion/VAccordionItem.d.ts +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/VAlert/VAlert.css +2 -0
  10. package/dist/components/VAlert/VAlert.d.ts +73 -0
  11. package/dist/components/VAlert/VAlert.js +9 -0
  12. package/dist/components/VAlert/VAlert.js.map +1 -0
  13. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js +96 -0
  14. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
  15. package/dist/components/VAvatar/VAvatar.d.ts +2 -2
  16. package/dist/components/VAvatar/VAvatarGroup.d.ts +1 -1
  17. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +8 -8
  18. package/dist/components/VBadge/VBadge.d.ts +3 -3
  19. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +9 -9
  20. package/dist/components/VButton/VButton.d.ts +4 -4
  21. package/dist/components/VButton/VButtonGroup.css +1 -1
  22. package/dist/components/VButton/VButtonGroup.d.ts +2 -2
  23. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  24. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/VCalendar/VCalendar.css +1 -1
  26. package/dist/components/VCalendar/VCalendar.d.ts +7 -1
  27. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  28. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +20 -18
  29. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  31. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  33. package/dist/components/VCalendar/VCalendarMonth.d.ts +2 -2
  34. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  37. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  38. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  39. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  41. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  42. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/VCalendar/gesture.d.ts +1 -16
  44. package/dist/components/VCalendar/gesture.js +1 -1
  45. package/dist/components/VCalendar/gesture.js.map +1 -1
  46. package/dist/components/VCalendar/types.d.ts +2 -0
  47. package/dist/components/VCard/VCard.css +2 -0
  48. package/dist/components/VCard/VCard.d.ts +87 -0
  49. package/dist/components/VCard/VCard.js +9 -0
  50. package/dist/components/VCard/VCard.js.map +1 -0
  51. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js +103 -0
  52. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  53. package/dist/components/VCarousel/VCarousel.d.ts +1 -1
  54. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  55. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +18 -18
  56. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/components/VCheckbox/VCheckMark.css +2 -0
  58. package/dist/components/VCheckbox/VCheckMark.js +9 -0
  59. package/dist/components/VCheckbox/VCheckMark.js.map +1 -0
  60. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js +33 -0
  61. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -0
  62. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  63. package/dist/components/VCheckbox/VCheckbox.d.ts +8 -3
  64. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  65. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +54 -69
  66. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/VChip/VChip.d.ts +6 -6
  68. package/dist/components/VChip/VChip.js.map +1 -1
  69. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +26 -26
  70. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/components/VColorInput/VColorInput.css +2 -0
  72. package/dist/components/VColorInput/VColorInput.d.ts +113 -0
  73. package/dist/components/VColorInput/VColorInput.js +9 -0
  74. package/dist/components/VColorInput/VColorInput.js.map +1 -0
  75. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +230 -0
  76. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  77. package/dist/components/VColorPicker/VColorPicker.css +2 -0
  78. package/dist/components/VColorPicker/VColorPicker.d.ts +67 -0
  79. package/dist/components/VColorPicker/VColorPicker.js +9 -0
  80. package/dist/components/VColorPicker/VColorPicker.js.map +1 -0
  81. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +390 -0
  82. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  83. package/dist/components/VColorPicker/color.d.ts +42 -0
  84. package/dist/components/VColorPicker/color.js +158 -0
  85. package/dist/components/VColorPicker/color.js.map +1 -0
  86. package/dist/components/VCombobox/VCombobox.css +1 -1
  87. package/dist/components/VCombobox/VCombobox.d.ts +46 -60
  88. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  89. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +271 -372
  90. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/VCommandPalette/VCommandPalette.css +2 -0
  92. package/dist/components/VCommandPalette/VCommandPalette.d.ts +163 -0
  93. package/dist/components/VCommandPalette/VCommandPalette.js +9 -0
  94. package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -0
  95. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +321 -0
  96. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -0
  97. package/dist/components/VCommandPalette/VCommandPaletteItem.css +2 -0
  98. package/dist/components/VCommandPalette/VCommandPaletteItem.d.ts +38 -0
  99. package/dist/components/VCommandPalette/VCommandPaletteItem.js +9 -0
  100. package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -0
  101. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +69 -0
  102. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  103. package/dist/components/VContextMenu/VContextMenu.css +2 -0
  104. package/dist/components/VContextMenu/VContextMenu.d.ts +66 -0
  105. package/dist/components/VContextMenu/VContextMenu.js +9 -0
  106. package/dist/components/VContextMenu/VContextMenu.js.map +1 -0
  107. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +148 -0
  108. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +41 -23
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +291 -186
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.d.ts +27 -7
  115. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  116. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +170 -162
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/components/VDatePicker/VDatePicker.d.ts +3 -3
  119. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  120. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +228 -227
  121. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VDatePicker/keyboard.d.ts +7 -7
  123. package/dist/components/VDatePicker/keyboard.js +8 -6
  124. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  125. package/dist/components/VDatePicker/names.js +16 -20
  126. package/dist/components/VDatePicker/names.js.map +1 -1
  127. package/dist/components/VDialog/VDialog.d.ts +2 -4
  128. package/dist/components/VDialog/VDialog.js.map +1 -1
  129. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +46 -77
  130. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  131. package/dist/components/VDrawer/VDrawer.css +2 -0
  132. package/dist/components/VDrawer/VDrawer.d.ts +102 -0
  133. package/dist/components/VDrawer/VDrawer.js +9 -0
  134. package/dist/components/VDrawer/VDrawer.js.map +1 -0
  135. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js +128 -0
  136. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  137. package/dist/components/VEmptyState/VEmptyState.css +2 -0
  138. package/dist/components/VEmptyState/VEmptyState.d.ts +43 -0
  139. package/dist/components/VEmptyState/VEmptyState.js +9 -0
  140. package/dist/components/VEmptyState/VEmptyState.js.map +1 -0
  141. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js +48 -0
  142. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -0
  143. package/dist/components/VField/VField.css +2 -0
  144. package/dist/components/VField/VField.d.ts +84 -0
  145. package/dist/components/VField/VField.js +9 -0
  146. package/dist/components/VField/VField.js.map +1 -0
  147. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js +99 -0
  148. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -0
  149. package/dist/components/VField/VFieldAnnouncer.d.ts +7 -0
  150. package/dist/components/VField/VFieldAnnouncer.js +7 -0
  151. package/dist/components/VField/VFieldAnnouncer.js.map +1 -0
  152. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js +19 -0
  153. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  154. package/dist/components/VField/VFieldMessage.d.ts +11 -0
  155. package/dist/components/VField/VFieldMessage.js +7 -0
  156. package/dist/components/VField/VFieldMessage.js.map +1 -0
  157. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js +32 -0
  158. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  159. package/dist/components/VFieldset/VFieldset.css +2 -0
  160. package/dist/components/VFieldset/VFieldset.d.ts +52 -0
  161. package/dist/components/VFieldset/VFieldset.js +9 -0
  162. package/dist/components/VFieldset/VFieldset.js.map +1 -0
  163. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js +63 -0
  164. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
  165. package/dist/components/VFileInput/VFileInput.css +1 -1
  166. package/dist/components/VFileInput/VFileInput.d.ts +31 -7
  167. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  168. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +168 -161
  169. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/components/VFilePicker/VFilePicker.d.ts +4 -4
  171. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  172. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  173. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +27 -30
  174. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VHotkeys/platform.d.ts +2 -0
  176. package/dist/components/VHotkeys/platform.js +24 -5
  177. package/dist/components/VHotkeys/platform.js.map +1 -1
  178. package/dist/components/VHoverCard/VHoverCard.css +2 -0
  179. package/dist/components/VHoverCard/VHoverCard.d.ts +62 -0
  180. package/dist/components/VHoverCard/VHoverCard.js +9 -0
  181. package/dist/components/VHoverCard/VHoverCard.js.map +1 -0
  182. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +97 -0
  183. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/components/VIcon/icons/add.d.ts +5 -0
  185. package/dist/components/VIcon/icons/add.js +9 -0
  186. package/dist/components/VIcon/icons/add.js.map +1 -0
  187. package/dist/components/VIcon/icons/colorize.d.ts +5 -0
  188. package/dist/components/VIcon/icons/colorize.js +9 -0
  189. package/dist/components/VIcon/icons/colorize.js.map +1 -0
  190. package/dist/components/VIcon/icons/inbox.d.ts +5 -0
  191. package/dist/components/VIcon/icons/inbox.js +9 -0
  192. package/dist/components/VIcon/icons/inbox.js.map +1 -0
  193. package/dist/components/VIcon/icons/index.d.ts +42 -2
  194. package/dist/components/VIcon/icons/index.js +88 -72
  195. package/dist/components/VIcon/icons/index.js.map +1 -1
  196. package/dist/components/VIcon/icons/names.d.ts +2 -2
  197. package/dist/components/VIcon/icons/names.js +1 -1
  198. package/dist/components/VIcon/icons/names.js.map +1 -1
  199. package/dist/components/VIcon/icons/open_in_new.d.ts +5 -0
  200. package/dist/components/VIcon/icons/open_in_new.js +9 -0
  201. package/dist/components/VIcon/icons/open_in_new.js.map +1 -0
  202. package/dist/components/VIcon/icons/priority_high.d.ts +5 -0
  203. package/dist/components/VIcon/icons/priority_high.js +9 -0
  204. package/dist/components/VIcon/icons/priority_high.js.map +1 -0
  205. package/dist/components/VIcon/icons/remove.d.ts +5 -0
  206. package/dist/components/VIcon/icons/remove.js +9 -0
  207. package/dist/components/VIcon/icons/remove.js.map +1 -0
  208. package/dist/components/VIcon/icons/search_off.d.ts +5 -0
  209. package/dist/components/VIcon/icons/search_off.js +9 -0
  210. package/dist/components/VIcon/icons/search_off.js.map +1 -0
  211. package/dist/components/VIcon/icons/star.d.ts +5 -0
  212. package/dist/components/VIcon/icons/star.js +9 -0
  213. package/dist/components/VIcon/icons/star.js.map +1 -0
  214. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  215. package/dist/components/VInput/VInput.css +1 -1
  216. package/dist/components/VInput/VInput.d.ts +51 -2
  217. package/dist/components/VInput/VInput.js.map +1 -1
  218. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +129 -106
  219. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VInput/VInputGroup.css +1 -1
  221. package/dist/components/VInput/VInputGroup.d.ts +20 -0
  222. package/dist/components/VInput/VInputGroup.js.map +1 -1
  223. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +50 -51
  224. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  225. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  226. package/dist/components/VInputOTP/VInputOTP.d.ts +27 -4
  227. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  228. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +131 -113
  229. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  230. package/dist/components/VLink/VLink.css +2 -0
  231. package/dist/components/VLink/VLink.d.ts +53 -0
  232. package/dist/components/VLink/VLink.js +9 -0
  233. package/dist/components/VLink/VLink.js.map +1 -0
  234. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js +58 -0
  235. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
  236. package/dist/components/VListbox/VListboxChevron.css +2 -0
  237. package/dist/components/VListbox/VListboxChevron.d.ts +12 -0
  238. package/dist/components/VListbox/VListboxChevron.js +9 -0
  239. package/dist/components/VListbox/VListboxChevron.js.map +1 -0
  240. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js +25 -0
  241. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -0
  242. package/dist/components/VListbox/VListboxGroup.css +2 -0
  243. package/dist/components/VListbox/VListboxGroup.d.ts +27 -0
  244. package/dist/components/VListbox/VListboxGroup.js +9 -0
  245. package/dist/components/VListbox/VListboxGroup.js.map +1 -0
  246. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
  247. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  248. package/dist/components/VListbox/VListboxOption.css +2 -0
  249. package/dist/components/{VCombobox/VComboboxOption.d.ts → VListbox/VListboxOption.d.ts} +4 -4
  250. package/dist/components/VListbox/VListboxOption.js +9 -0
  251. package/dist/components/VListbox/VListboxOption.js.map +1 -0
  252. package/dist/components/{VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js} +6 -6
  253. package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
  254. package/dist/components/VListbox/VListboxPanel.css +2 -0
  255. package/dist/components/VListbox/VListboxPanel.d.ts +59 -0
  256. package/dist/components/VListbox/VListboxPanel.js +9 -0
  257. package/dist/components/VListbox/VListboxPanel.js.map +1 -0
  258. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +123 -0
  259. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  260. package/dist/components/VListbox/VListboxSeparator.css +2 -0
  261. package/dist/components/VListbox/VListboxSeparator.d.ts +3 -0
  262. package/dist/components/VListbox/VListboxSeparator.js +9 -0
  263. package/dist/components/VListbox/VListboxSeparator.js.map +1 -0
  264. package/dist/components/{VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js} +4 -4
  265. package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
  266. package/dist/components/VListbox/VListboxValues.css +2 -0
  267. package/dist/components/VListbox/VListboxValues.d.ts +52 -0
  268. package/dist/components/VListbox/VListboxValues.js +9 -0
  269. package/dist/components/VListbox/VListboxValues.js.map +1 -0
  270. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +103 -0
  271. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -0
  272. package/dist/components/VMenu/VMenu.d.ts +1 -1
  273. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +9 -9
  274. package/dist/components/VMenu/VMenuItem.d.ts +1 -1
  275. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +16 -16
  276. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  277. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  278. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +7 -7
  279. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VMeter/VMeter.css +2 -0
  281. package/dist/components/VMeter/VMeter.d.ts +77 -0
  282. package/dist/components/VMeter/VMeter.js +9 -0
  283. package/dist/components/VMeter/VMeter.js.map +1 -0
  284. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js +113 -0
  285. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -0
  286. package/dist/components/VNumberInput/VNumberInput.css +2 -0
  287. package/dist/components/VNumberInput/VNumberInput.d.ts +114 -0
  288. package/dist/components/VNumberInput/VNumberInput.js +9 -0
  289. package/dist/components/VNumberInput/VNumberInput.js.map +1 -0
  290. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
  291. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  292. package/dist/components/VNumberInput/number.d.ts +30 -0
  293. package/dist/components/VNumberInput/number.js +38 -0
  294. package/dist/components/VNumberInput/number.js.map +1 -0
  295. package/dist/components/VPagination/VPagination.css +1 -1
  296. package/dist/components/VPagination/VPagination.d.ts +4 -12
  297. package/dist/components/VPagination/VPagination.js.map +1 -1
  298. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +89 -96
  299. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  300. package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -2
  301. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  302. package/dist/components/VProgressLinear/VProgressLinear.d.ts +10 -7
  303. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  304. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +52 -34
  305. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  306. package/dist/components/VRadio/VRadio.d.ts +8 -3
  307. package/dist/components/VRadio/VRadio.js.map +1 -1
  308. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +52 -46
  309. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  310. package/dist/components/VRating/VRating.css +2 -0
  311. package/dist/components/VRating/VRating.d.ts +92 -0
  312. package/dist/components/VRating/VRating.js +9 -0
  313. package/dist/components/VRating/VRating.js.map +1 -0
  314. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js +158 -0
  315. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -0
  316. package/dist/components/VResizable/VResizable.css +2 -0
  317. package/dist/components/VResizable/VResizable.d.ts +50 -0
  318. package/dist/components/VResizable/VResizable.js +9 -0
  319. package/dist/components/VResizable/VResizable.js.map +1 -0
  320. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +225 -0
  321. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -0
  322. package/dist/components/VResizable/VResizablePanel.css +2 -0
  323. package/dist/components/VResizable/VResizablePanel.d.ts +60 -0
  324. package/dist/components/VResizable/VResizablePanel.js +9 -0
  325. package/dist/components/VResizable/VResizablePanel.js.map +1 -0
  326. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js +83 -0
  327. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  328. package/dist/components/VResizable/context.d.ts +24 -0
  329. package/dist/components/VResizable/context.js +6 -0
  330. package/dist/components/VResizable/context.js.map +1 -0
  331. package/dist/components/VResizable/layout.d.ts +28 -0
  332. package/dist/components/VResizable/layout.js +41 -0
  333. package/dist/components/VResizable/layout.js.map +1 -0
  334. package/dist/components/VSelect/VSelect.css +2 -0
  335. package/dist/components/VSelect/VSelect.d.ts +193 -0
  336. package/dist/components/VSelect/VSelect.js +9 -0
  337. package/dist/components/VSelect/VSelect.js.map +1 -0
  338. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +424 -0
  339. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
  340. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  341. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +8 -8
  343. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +2 -2
  344. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  345. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +3 -3
  346. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  347. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +3 -3
  348. package/dist/components/VSlider/VSlider.css +1 -1
  349. package/dist/components/VSlider/VSlider.d.ts +34 -8
  350. package/dist/components/VSlider/VSlider.js.map +1 -1
  351. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +236 -215
  352. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +4 -4
  354. package/dist/components/VSnackbar/state.js.map +1 -1
  355. package/dist/components/VSplitButton/VSplitButton.css +2 -0
  356. package/dist/components/VSplitButton/VSplitButton.d.ts +114 -0
  357. package/dist/components/VSplitButton/VSplitButton.js +9 -0
  358. package/dist/components/VSplitButton/VSplitButton.js.map +1 -0
  359. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +148 -0
  360. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  361. package/dist/components/VStepper/VStepper.css +2 -0
  362. package/dist/components/VStepper/VStepper.d.ts +73 -0
  363. package/dist/components/VStepper/VStepper.js +9 -0
  364. package/dist/components/VStepper/VStepper.js.map +1 -0
  365. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js +96 -0
  366. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
  367. package/dist/components/VSwitch/VSwitch.d.ts +8 -3
  368. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  369. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +53 -47
  370. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  371. package/dist/components/VTabs/VTab.css +1 -1
  372. package/dist/components/VTabs/VTab.d.ts +1 -1
  373. package/dist/components/VTabs/VTab.js.map +1 -1
  374. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  375. package/dist/components/VTabs/VTabs.css +1 -1
  376. package/dist/components/VTabs/VTabs.d.ts +13 -5
  377. package/dist/components/VTabs/VTabs.js.map +1 -1
  378. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +20 -20
  379. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  380. package/dist/components/VTextarea/VTextarea.css +1 -1
  381. package/dist/components/VTextarea/VTextarea.d.ts +22 -2
  382. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  383. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +108 -100
  384. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  385. package/dist/components/VTimeInput/VTimeInput.d.ts +27 -7
  386. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  387. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +187 -171
  388. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  389. package/dist/components/VTimePicker/VTimePicker.d.ts +2 -2
  390. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  391. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +15 -15
  392. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  393. package/dist/components/VTimeline/VTimeline.css +2 -0
  394. package/dist/components/VTimeline/VTimeline.d.ts +59 -0
  395. package/dist/components/VTimeline/VTimeline.js +9 -0
  396. package/dist/components/VTimeline/VTimeline.js.map +1 -0
  397. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js +53 -0
  398. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
  399. package/dist/components/VTimeline/VTimelineItem.css +2 -0
  400. package/dist/components/VTimeline/VTimelineItem.d.ts +48 -0
  401. package/dist/components/VTimeline/VTimelineItem.js +9 -0
  402. package/dist/components/VTimeline/VTimelineItem.js.map +1 -0
  403. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js +70 -0
  404. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  405. package/dist/components/VTimeline/context.d.ts +11 -0
  406. package/dist/components/VTimeline/context.js +6 -0
  407. package/dist/components/VTimeline/context.js.map +1 -0
  408. package/dist/components/VTimeline/datetime.d.ts +8 -0
  409. package/dist/components/VTimeline/datetime.js +36 -0
  410. package/dist/components/VTimeline/datetime.js.map +1 -0
  411. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +8 -8
  412. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +12 -12
  413. package/dist/components/VToggle/VToggle.d.ts +4 -4
  414. package/dist/components/VToggle/VToggleItem.d.ts +1 -1
  415. package/dist/components/VTooltip/VTooltip.d.ts +8 -2
  416. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  417. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +45 -43
  418. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  419. package/dist/components/VTreeView/VTreeView.css +2 -0
  420. package/dist/components/VTreeView/VTreeView.d.ts +112 -0
  421. package/dist/components/VTreeView/VTreeView.js +9 -0
  422. package/dist/components/VTreeView/VTreeView.js.map +1 -0
  423. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +321 -0
  424. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
  425. package/dist/components/VTypography/VTypography.d.ts +1 -1
  426. package/dist/components/VVirtualList/VVirtualList.css +2 -0
  427. package/dist/components/VVirtualList/VVirtualList.d.ts +78 -0
  428. package/dist/components/VVirtualList/VVirtualList.js +9 -0
  429. package/dist/components/VVirtualList/VVirtualList.js.map +1 -0
  430. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js +114 -0
  431. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  432. package/dist/composables/useChoice.d.ts +28 -0
  433. package/dist/composables/useChoice.js +28 -0
  434. package/dist/composables/useChoice.js.map +1 -0
  435. package/dist/composables/useDebouncedSearch.d.ts +17 -0
  436. package/dist/composables/useDebouncedSearch.js +18 -0
  437. package/dist/composables/useDebouncedSearch.js.map +1 -0
  438. package/dist/composables/useEscapeDismiss.d.ts +8 -0
  439. package/dist/composables/useEscapeDismiss.js +16 -0
  440. package/dist/composables/useEscapeDismiss.js.map +1 -0
  441. package/dist/composables/useFieldIds.d.ts +2 -1
  442. package/dist/composables/useFieldIds.js +7 -6
  443. package/dist/composables/useFieldIds.js.map +1 -1
  444. package/dist/composables/useFieldPanel.d.ts +1 -0
  445. package/dist/composables/useFieldPanel.js +52 -42
  446. package/dist/composables/useFieldPanel.js.map +1 -1
  447. package/dist/composables/useFileField.d.ts +1 -3
  448. package/dist/composables/useFileField.js +48 -50
  449. package/dist/composables/useFileField.js.map +1 -1
  450. package/dist/composables/useHotkeyListener.d.ts +17 -0
  451. package/dist/composables/useHotkeyListener.js +26 -0
  452. package/dist/composables/useHotkeyListener.js.map +1 -0
  453. package/dist/composables/useIconClickHandlers.d.ts +2 -10
  454. package/dist/composables/useIconClickHandlers.js +1 -1
  455. package/dist/composables/useIconClickHandlers.js.map +1 -1
  456. package/dist/{components/VCombobox/infiniteScroll.d.ts → composables/useInfiniteScroll.d.ts} +6 -0
  457. package/dist/{components/VCombobox/infiniteScroll.js → composables/useInfiniteScroll.js} +7 -7
  458. package/dist/composables/useInfiniteScroll.js.map +1 -0
  459. package/dist/composables/useListbox.d.ts +132 -0
  460. package/dist/composables/useListbox.js +227 -0
  461. package/dist/composables/useListbox.js.map +1 -0
  462. package/dist/composables/useModalDialog.d.ts +28 -0
  463. package/dist/composables/useModalDialog.js +60 -0
  464. package/dist/composables/useModalDialog.js.map +1 -0
  465. package/dist/composables/useRootAttrs.d.ts +2 -3
  466. package/dist/composables/useRootAttrs.js.map +1 -1
  467. package/dist/composables/useVirtualList.d.ts +46 -0
  468. package/dist/composables/useVirtualList.js +145 -0
  469. package/dist/composables/useVirtualList.js.map +1 -0
  470. package/dist/i18n/en.js +50 -0
  471. package/dist/i18n/en.js.map +1 -1
  472. package/dist/i18n/fr.js +50 -0
  473. package/dist/i18n/fr.js.map +1 -1
  474. package/dist/i18n/types.d.ts +103 -2
  475. package/dist/icons.js +45 -37
  476. package/dist/index.d.ts +50 -4
  477. package/dist/index.js +80 -56
  478. package/dist/styles.css +1 -1
  479. package/dist/tokens/index.d.ts +43 -0
  480. package/dist/tokens/semantic.d.ts +42 -0
  481. package/dist/tokens/semantic.js +43 -1
  482. package/dist/tokens/semantic.js.map +1 -1
  483. package/dist/tokens/themes/dark.d.ts +1 -0
  484. package/dist/tokens/themes/dark.js +1 -0
  485. package/dist/tokens/themes/dark.js.map +1 -1
  486. package/dist/tokens.json +215 -1
  487. package/dist/types.d.ts +57 -4
  488. package/dist/utils/arrowNav.js.map +1 -1
  489. package/dist/utils/attrs.d.ts +9 -0
  490. package/dist/utils/attrs.js +14 -0
  491. package/dist/utils/attrs.js.map +1 -0
  492. package/dist/utils/date.d.ts +1 -0
  493. package/dist/utils/date.js +2 -2
  494. package/dist/utils/date.js.map +1 -1
  495. package/package.json +1 -1
  496. package/dist/components/VCombobox/VComboboxGroup.css +0 -2
  497. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -17
  498. package/dist/components/VCombobox/VComboboxGroup.js +0 -9
  499. package/dist/components/VCombobox/VComboboxGroup.js.map +0 -1
  500. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +0 -21
  501. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
  502. package/dist/components/VCombobox/VComboboxOption.css +0 -2
  503. package/dist/components/VCombobox/VComboboxOption.js +0 -9
  504. package/dist/components/VCombobox/VComboboxOption.js.map +0 -1
  505. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +0 -1
  506. package/dist/components/VCombobox/VComboboxSeparator.css +0 -2
  507. package/dist/components/VCombobox/VComboboxSeparator.js +0 -9
  508. package/dist/components/VCombobox/VComboboxSeparator.js.map +0 -1
  509. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +0 -1
  510. package/dist/components/VCombobox/infiniteScroll.js.map +0 -1
  511. /package/dist/components/{VCombobox/VComboboxSeparator.d.ts → VCheckbox/VCheckMark.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"gesture.js","names":[],"sources":["../../../src/components/VCalendar/gesture.ts"],"sourcesContent":["// @keyboard @a11y @core\n/**\n * Share pointer and keyboard editing gestures across month and time-grid views; each view\n * supplies its own cell geometry.\n */\nimport { computed, nextTick, ref, watch } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { isRtl as isElementRtl } from '../../utils/direction'\n\nimport { useMessages } from '../../i18n/state'\n\nimport { EDGE_BAND, useEdgeStep } from './edgeStep'\nimport { calendarIntent, type CalendarIntent } from './keyboard'\nimport { DRAG_THRESHOLD, inlineEdgeAt, pointWithin, type GridGeometry } from './layout'\nimport type { CalendarEvent, CalendarEventId, CalendarEventTimes } from './types'\n\n/**\n * The prefix marking the copy an event leaves behind at its old place while it is being\n * dragged.\n */\nconst GHOST_PREFIX = '__vectis-calendar-ghost__'\n\n/**\n * The id the ghost of a dragged event carries. It has to DIFFER from the event's own, or the\n * two would collide in every map the layout keys by id and only one would ever be drawn.\n */\nexport const ghostIdOf = (id: CalendarEventId) => `${GHOST_PREFIX}${id}`\n/** The dragged event's own id, read back off its ghost's. */\nexport const originalIdOf = (id: CalendarEventId) => String(id).slice(GHOST_PREFIX.length)\nexport const isGhostId = (id: CalendarEventId) => String(id).startsWith(GHOST_PREFIX)\n\n/** The id a card belongs to, read back off the DOM. */\nexport function cardIdOf(card: HTMLElement, has: (id: CalendarEventId) => boolean) {\n const raw = card.dataset.eventId ?? ''\n return has(raw) ? raw : Number(raw)\n}\n\n/**\n * `inlineStart` is the edge the first column starts at, which is the RIGHT one in a\n * right-to-left page.\n */\nexport function gridGeometryOf(rect: DOMRect, columns: number, rtl: boolean): GridGeometry {\n return {\n top: rect.top,\n height: rect.height,\n inlineStart: rtl ? rect.right : rect.left,\n inlineSize: rect.width,\n columns,\n }\n}\n\n/** The state every gesture carries, whatever each grid adds to it. */\nexport interface GestureBase {\n id: CalendarEventId\n /**\n * Where the event was when the gesture began. Every pointer frame is computed from this and\n * never from the frame before it, so a long drag cannot accumulate rounding drift.\n */\n origin: CalendarEventTimes\n /** What the card shows right now. The model is not touched until the gesture ends. */\n preview: CalendarEventTimes\n /** The pointer holding the gesture, or null for a keyboard grab. */\n pointerId: number | null\n originX: number\n originY: number\n /**\n * Where the pointer last was. Two things move the calendar UNDER a still pointer: paging at\n * an edge, and auto-scrolling. Each has to work out afresh what the pointer is now over.\n */\n lastX: number\n lastY: number\n /** Whether it moved past the threshold, which separates a drag from a click. */\n moved: boolean\n /**\n * Whether the pointer is off the calendar altogether: over the toolbar, or over the page\n * beside it. A KEYBOARD grab can never set it, and structurally rather than by a guard:\n * `onPointermove` is the only writer, and it returns on the id mismatch first: a grab's\n * `pointerId` is null, which no real pointer's id ever equals.\n */\n outside: boolean\n /**\n * The reading direction, read once when the gesture begins. It cannot change under a live\n * drag, and asking the document on every frame costs a style resolution each time.\n */\n rtl: boolean\n}\n\n/** What a grid hands over to start a gesture; the rest is filled in here. */\nexport type GestureInit<G extends GestureBase> = Omit<\n G,\n 'preview' | 'lastX' | 'lastY' | 'moved' | 'outside' | 'rtl'\n>\n\n/**\n * A gesture held by the KEYBOARD rather than by a pointer: grabbed with Space, and waiting for\n * the arrows to move it.\n */\nexport const isGrabbed = (state: GestureBase | null) => state !== null && state.pointerId === null\n\n/** The two intents that move a grabbed event, which only a grid can turn into times. */\nexport type GrabStep = Extract<CalendarIntent, { kind: 'grabMove' | 'grabResize' }>\n\nexport interface CalendarGestureOptions<E extends CalendarEvent, G extends GestureBase> {\n /** Every event as it is currently drawn, the ghost's original among them. */\n events: () => readonly E[]\n /** The event drawn under an id, for the handlers. */\n eventOf: (id: CalendarEventId) => E | undefined\n rootEl: Ref<HTMLElement | null>\n /** The element the pointer is captured on once a press travels. */\n captureEl: Ref<HTMLElement | null>\n /** The box the cells occupy, which points and edges are read against. */\n measureEl: Ref<HTMLElement | null>\n /** How many columns that box is divided into. */\n columns: () => number\n /** Whether events may be moved at all. */\n editable: () => boolean\n /** The node every card points at to say how it can be moved. */\n hintId: () => string\n /** The step a grabbed event moves by, handed to the keyboard table. */\n slotMinutes: () => number\n edgeStepDelay: () => number\n /** Whatever the grid's cells are made of, so paging under a still pointer re-places the card. */\n layout: () => unknown\n /** Works out where the gesture's event belongs from the pointer's last position. */\n applyPoint: (state: G, rect: DOMRect) => void\n /** Called on every pointer move past the threshold, after the edge watch, with both rects. */\n onEdges?: (state: G, rootRect: DOMRect | undefined) => void\n /** Everything else a gesture leaves running, dropped on every path out of one. */\n onRelease?: () => void\n /**\n * A pointer gesture let go inside the calendar. Returns true when the grid has answered it\n * itself, such as a slot drawn out, and nothing is left to drop.\n */\n onLetGo?: (state: G) => boolean\n /** A gesture that moved, committed: the grid reports the new times. */\n onDrop: (state: G) => void\n /** What a keyboard grab of this event starts, or null when it cannot be grabbed. */\n grab: (item: E) => GestureInit<G> | null\n /** Applies one arrow step to a grabbed event. Returns false when the step means nothing here. */\n onGrabStep: (state: G, step: GrabStep, item: E) => boolean\n step: (direction: -1 | 1) => void\n announce: (message: string) => void\n}\n\nexport function useCalendarGesture<E extends CalendarEvent, G extends GestureBase>(\n options: CalendarGestureOptions<E, G>,\n) {\n const m = useMessages()\n const gesture = ref<G | null>(null) as Ref<G | null>\n\n /** True while a card is being held by the keyboard rather than dragged by a pointer. */\n const grabbing = computed(() => isGrabbed(gesture.value))\n\n const isRtl = () => isElementRtl(options.measureEl.value)\n\n /**\n * The echo of where the gestured event began, so the reader can see what they are moving it\n * FROM. A press that has not travelled yet produces none, or a click would flash a second\n * card over the first.\n */\n const ghostEvent = computed<E | null>(() => {\n const state = gesture.value\n if (!state?.moved) return null\n const original = options.events().find((event) => event.id === state.id)\n return original ? ({ ...original, ...state.origin, id: ghostIdOf(state.id) } as E) : null\n })\n\n /** A list with the gestured event moved to wherever it is now, plus its echo. */\n function withPreview(events: readonly E[]): E[] {\n const state = gesture.value\n if (!state) return [...events]\n const moving = events.map((event) =>\n event.id === state.id ? ({ ...event, ...state.preview } as E) : event,\n )\n return ghostEvent.value ? [...moving, ghostEvent.value] : moving\n }\n\n /**\n * Set click suppression on pointerup, not pointercancel; clear it before every press guard\n * and keyboard activation. Captured releases may never send their click to an event card.\n */\n let dragged = false\n\n /** Closes the books on the previous gesture. */\n function endLastGesture() {\n dragged = false\n if (grabbing.value) revertGrab()\n }\n\n /** Puts a keyboard grab back where it was taken from, writing nothing, and says so. */\n function revertGrab() {\n const state = gesture.value\n if (!state) return\n gesture.value = null\n options.announce(m.value.calendar.reverted)\n return state\n }\n\n /**\n * A keyboard grab ends when the focus moves on to something else, the toolbar or another\n * control.\n */\n function onFocusout(event: FocusEvent) {\n const state = gesture.value\n const next = event.relatedTarget as HTMLElement | null\n if (!grabbing.value || !state || !next) return\n const card = next.closest<HTMLElement>('.v-calendar-event')\n if (card && card.dataset.eventId === String(state.id)) return\n revertGrab()\n }\n\n /** Whether the gesture that just ended actually moved; asking lowers the flag. */\n function consumeDrag() {\n const was = dragged\n dragged = false\n return was\n }\n\n const edge = useEdgeStep(options.step, options.edgeStepDelay)\n\n /** Which edge is counting down, as the attribute the stylesheet reads. */\n const edgeCue = computed(() =>\n edge.pending.value === -1 ? 'start' : edge.pending.value === 1 ? 'end' : undefined,\n )\n\n function release() {\n edge.cancel()\n options.onRelease?.()\n }\n\n /** Starts a gesture. */\n function start(init: GestureInit<G>, rtl = isRtl()) {\n gesture.value = {\n ...init,\n preview: { ...init.origin },\n lastX: init.originX,\n lastY: init.originY,\n moved: false,\n outside: false,\n rtl,\n } as G\n }\n\n /**\n * Called when the press crosses the drag threshold, never at the press. The browser sends the\n * `click` that follows a captured `pointerup` to the CAPTURE element, so a press captured at\n * once reaches the scroller instead of the card or the cell under it: clicking an event would\n * open nothing and clicking an empty slot would report nothing, on every calendar whose\n * events can be moved or drawn.\n */\n function capture(pointerId: number) {\n // @fallback\n /*\n * Synthetic pointer events may not have a capturable pointer; allow the gesture to continue\n * within the element if capture fails.\n */\n try {\n options.captureEl.value?.setPointerCapture(pointerId)\n } catch {\n /* Synthetic pointers cannot be captured. */\n }\n }\n\n function reapply(state: G) {\n const rect = options.measureEl.value?.getBoundingClientRect()\n if (rect) options.applyPoint(state, rect)\n }\n\n function onPointermove(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId) return\n\n state.lastX = event.clientX\n state.lastY = event.clientY\n\n // Below the threshold nothing has happened yet. That is what keeps a click a click: the\n // hand's tremor during a press would otherwise register as a one-pixel drag.\n if (\n !state.moved &&\n Math.abs(event.clientX - state.originX) < DRAG_THRESHOLD &&\n Math.abs(event.clientY - state.originY) < DRAG_THRESHOLD\n ) {\n return\n }\n\n if (!state.moved) capture(event.pointerId)\n state.moved = true\n const rootRect = options.rootEl.value?.getBoundingClientRect()\n const rect = options.measureEl.value?.getBoundingClientRect()\n\n /*\n * Neither the placement nor the edge watch below is gated on it, and neither may become so.\n * The card must keep following the pointer while it is out, which makes coming back in\n * seamless, and paging must keep running, pushing past the edge being how one crosses into\n * the next period.\n */\n state.outside = rootRect ? !pointWithin({ x: state.lastX, y: state.lastY }, rootRect) : false\n\n if (!rect) return\n options.applyPoint(state, rect)\n edge.watchEdge(\n inlineEdgeAt(\n state.lastX,\n gridGeometryOf(rect, options.columns(), state.rtl),\n EDGE_BAND,\n state.rtl,\n ),\n )\n options.onEdges?.(state, rootRect)\n }\n\n function onPointerup(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId) return\n gesture.value = null\n dragged = state.moved\n release()\n\n /*\n * Nothing is announced: the pointer says nothing on a SUCCESSFUL drop either; `grabbed`,\n * `dropped` and `reverted` belong to the keyboard grab, which has no pointer to show where\n * the event went.\n */\n if (state.outside) return\n if (options.onLetGo?.(state)) return\n // A press that never travelled is an ordinary click, which the button's own click event is\n // about to report. Writing anything here would move an event nobody dragged.\n if (state.moved) options.onDrop(state)\n }\n\n /*\n * The gesture was taken away; a system gesture, a context menu, the page starting to scroll.\n * Nothing is written and nothing is announced: the card goes back to where the model still\n * says it is.\n */\n function onPointercancel(event: PointerEvent) {\n // Another pointer's cancel, a second finger starting to pan, is not this gesture's. A\n // keyboard grab carries no pointer id, so no cancel can end it either.\n if (gesture.value?.pointerId !== event.pointerId) return\n abandon()\n }\n\n function abandon() {\n gesture.value = null\n release()\n }\n\n /*\n * Its `pointerup` then lands outside and never reaches the bindings, so without this the\n * gesture would outlive the press: a mouse keeps the same pointer id, and bringing it back\n * over the calendar with the button up would pick the event up and carry it. A captured\n * pointer never leaves, so a real drag is untouched.\n */\n function onPointerleave(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId || state.moved) return\n abandon()\n }\n\n /*\n * Paging swaps the cells out from under a live drag, and the dragged event's day is then off\n * screen; the card would vanish until the next pointer move, which never comes if the hand is\n * holding still against the edge. Re-applying the last position once the new cells are\n * rendered is what keeps the card under the pointer across the boundary.\n */\n watch(\n options.layout,\n () => {\n const state = gesture.value\n if (state?.moved) reapply(state)\n },\n { flush: 'post' },\n )\n\n /**\n * The card is found by WALKING the cards rather than by building an attribute selector. An id\n * belongs to the consumer, so it may hold a quote or a backslash a selector would need\n * escaped, and `CSS.escape` cannot do that escaping here: jsdom defines no `CSS` object at\n * all, so the call threw on every keyboard grab, from inside a `nextTick` where nothing could\n * catch it; an unhandled rejection, which fails the run while every assertion still passes.\n */\n function refocusCard(id: CalendarEventId) {\n void nextTick(() => {\n // Searched from the view's root: the time grid's all-day bars sit in its sticky header,\n // outside the box the cells occupy.\n const cards = options.rootEl.value?.querySelectorAll<HTMLElement>('.v-calendar-event')\n Array.from(cards ?? [])\n .find((card) => card.dataset.eventId === String(id))\n ?.focus()\n })\n }\n\n /** Puts the focus on a cell by its id, once the render that made it tabbable has run. */\n function focusCell(id: string, deferred = false, focusOptions?: FocusOptions) {\n const move = () => document.getElementById(id)?.focus(focusOptions)\n if (deferred) void nextTick(move)\n else move()\n }\n\n /** The event a card stands for, read back off the attribute the card publishes. */\n const idOfCard = (card: HTMLElement) => cardIdOf(card, (id) => options.eventOf(id) !== undefined)\n\n /**\n * A card answers a different table from the grid it sits in; that is what a grab mode IS.\n * Without it the grid would offer a gesture the pointer alone could reach (WCAG 2.1.1).\n */\n function onCardKeydown(event: KeyboardEvent, card: HTMLElement) {\n // Whatever click follows is this key's, never the end of an earlier drag.\n dragged = false\n const item = options.eventOf(idOfCard(card))\n if (!item) return\n\n const held = grabbing.value && gesture.value?.id === item.id\n const state = held ? gesture.value! : null\n const intent = calendarIntent(\n event,\n held ? 'grabbed' : 'event',\n options.slotMinutes(),\n state?.rtl ?? isRtl(),\n )\n if (!intent) return\n\n if (!state) {\n // An event that cannot be moved keeps a button's ordinary behaviour: Space presses it,\n // which the card's click handler reports.\n const init = intent.kind === 'grab' ? options.grab(item) : null\n if (!init) return\n /*\n * Cancelling the keydown is what stops that press, so the keystroke that takes hold of\n * the event does not open it too: without it every attempt to move something would fire\n * the consumer's editor over it.\n */\n event.preventDefault()\n start(init)\n options.announce(m.value.calendar.grabbed)\n return\n }\n\n event.preventDefault()\n\n if (intent.kind === 'grabMove' || intent.kind === 'grabResize') {\n if (!options.onGrabStep(state, intent, item)) return\n state.moved = true\n refocusCard(state.id)\n return\n }\n\n if (intent.kind === 'activate') {\n gesture.value = null\n if (state.moved) options.onDrop(state)\n options.announce(m.value.calendar.dropped)\n refocusCard(state.id)\n return\n }\n\n if (intent.kind === 'cancel') {\n revertGrab()\n refocusCard(state.id)\n }\n }\n\n /**\n * The five things every card is told about the gesture, bound with `v-bind` so the two grids\n * cannot describe the same state in two different ways.\n */\n function cardState(id: CalendarEventId) {\n const state = gesture.value\n const mine = state !== null && state.id === id\n return {\n /*\n * Only once the press has travelled. A dragged card takes no pointer events, so marked at\n * the press it lets the release land on the cell beneath it: the click then goes to that\n * cell, and clicking an event reports an empty slot instead of opening it.\n */\n dragging: mine && state.pointerId !== null && state.moved,\n rejected: mine && state.outside,\n grabbed: mine && state.pointerId === null,\n hintId: options.editable() && !isGhostId(id) ? options.hintId() : undefined,\n ghostOf: isGhostId(id) ? originalIdOf(id) : undefined,\n }\n }\n\n return {\n gesture,\n grabbing,\n ghostEvent,\n withPreview,\n edgeCue,\n isRtl,\n start,\n reapply,\n release,\n endLastGesture,\n consumeDrag,\n onPointermove,\n onPointerup,\n onPointercancel,\n onPointerleave,\n onFocusout,\n onCardKeydown,\n refocusCard,\n focusCell,\n idOfCard,\n cardState,\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAM,IAAe,6BAMR,KAAa,MAAwB,GAAG,IAAe,KAEvD,KAAgB,MAAwB,OAAO,CAAE,CAAC,CAAC,MAAM,EAAmB,GAC5E,KAAa,MAAwB,OAAO,CAAE,CAAC,CAAC,WAAW,CAAY;AAGpF,SAAgB,EAAS,GAA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C5C,OAAO;GAML,UAAU,KAAQ,EAAM,cAAc,QAAQ,EAAM;GACpD,UAAU,KAAQ,EAAM;GACxB,SAAS,KAAQ,EAAM,cAAc;GACrC,QAAQ,EAAQ,SAAS,KAAK,CAAC,EAAU,CAAE,IAAI,EAAQ,OAAO,IAAI,KAAA;GAClE,SAAS,EAAU,CAAE,IAAI,EAAa,CAAE,IAAI,KAAA;EAC9C;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,OAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"gesture.js","names":[],"sources":["../../../src/components/VCalendar/gesture.ts"],"sourcesContent":["// @keyboard @a11y @core\n/**\n * Share pointer and keyboard editing gestures across month and time-grid views; each view\n * supplies its own cell geometry.\n */\nimport { computed, nextTick, ref, watch } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { isRtl as isElementRtl } from '../../utils/direction'\n\nimport { useMessages } from '../../i18n/state'\n\nimport { EDGE_BAND, useEdgeStep } from './edgeStep'\nimport { calendarIntent, type CalendarIntent } from './keyboard'\nimport { DRAG_THRESHOLD, inlineEdgeAt, pointWithin, type GridGeometry } from './layout'\nimport type { CalendarEvent, CalendarEventId, CalendarEventTimes } from './types'\n\n/**\n * The prefix marking the copy an event leaves behind at its old place while it is being\n * dragged.\n */\nconst GHOST_PREFIX = '__vectis-calendar-ghost__'\n\n/**\n * The id the ghost of a dragged event carries. It has to DIFFER from the event's own, or the\n * two would collide in every map the layout keys by id and only one would ever be drawn.\n */\nconst ghostIdOf = (id: CalendarEventId) => `${GHOST_PREFIX}${id}`\n/** The dragged event's own id, read back off its ghost's. */\nconst originalIdOf = (id: CalendarEventId) => String(id).slice(GHOST_PREFIX.length)\nconst isGhostId = (id: CalendarEventId) => String(id).startsWith(GHOST_PREFIX)\n\n/** The id a card belongs to, read back off the DOM. */\nfunction cardIdOf(card: HTMLElement, has: (id: CalendarEventId) => boolean) {\n const raw = card.dataset.eventId ?? ''\n return has(raw) ? raw : Number(raw)\n}\n\n/**\n * `inlineStart` is the edge the first column starts at, which is the RIGHT one in a\n * right-to-left page.\n */\nexport function gridGeometryOf(rect: DOMRect, columns: number, rtl: boolean): GridGeometry {\n return {\n top: rect.top,\n height: rect.height,\n inlineStart: rtl ? rect.right : rect.left,\n inlineSize: rect.width,\n columns,\n }\n}\n\n/** The state every gesture carries, whatever each grid adds to it. */\nexport interface GestureBase {\n id: CalendarEventId\n /**\n * Where the event was when the gesture began. Every pointer frame is computed from this and\n * never from the frame before it, so a long drag cannot accumulate rounding drift.\n */\n origin: CalendarEventTimes\n /** What the card shows right now. The model is not touched until the gesture ends. */\n preview: CalendarEventTimes\n /** The pointer holding the gesture, or null for a keyboard grab. */\n pointerId: number | null\n originX: number\n originY: number\n /**\n * Where the pointer last was. Two things move the calendar UNDER a still pointer: paging at\n * an edge, and auto-scrolling. Each has to work out afresh what the pointer is now over.\n */\n lastX: number\n lastY: number\n /** Whether it moved past the threshold, which separates a drag from a click. */\n moved: boolean\n /**\n * Whether the pointer is off the calendar altogether: over the toolbar, or over the page\n * beside it. A KEYBOARD grab can never set it, and structurally rather than by a guard:\n * `onPointermove` is the only writer, and it returns on the id mismatch first: a grab's\n * `pointerId` is null, which no real pointer's id ever equals.\n */\n outside: boolean\n /**\n * The reading direction, read once when the gesture begins. It cannot change under a live\n * drag, and asking the document on every frame costs a style resolution each time.\n */\n rtl: boolean\n}\n\n/** What a grid hands over to start a gesture; the rest is filled in here. */\nexport type GestureInit<G extends GestureBase> = Omit<\n G,\n 'preview' | 'lastX' | 'lastY' | 'moved' | 'outside' | 'rtl'\n>\n\n/**\n * A gesture held by the KEYBOARD rather than by a pointer: grabbed with Space, and waiting for\n * the arrows to move it.\n */\nconst isGrabbed = (state: GestureBase | null) => state !== null && state.pointerId === null\n\n/** The two intents that move a grabbed event, which only a grid can turn into times. */\nexport type GrabStep = Extract<CalendarIntent, { kind: 'grabMove' | 'grabResize' }>\n\nexport interface CalendarGestureOptions<E extends CalendarEvent, G extends GestureBase> {\n /** Every event as it is currently drawn, the ghost's original among them. */\n events: () => readonly E[]\n /** The event drawn under an id, for the handlers. */\n eventOf: (id: CalendarEventId) => E | undefined\n rootEl: Ref<HTMLElement | null>\n /** The element the pointer is captured on once a press travels. */\n captureEl: Ref<HTMLElement | null>\n /** The box the cells occupy, which points and edges are read against. */\n measureEl: Ref<HTMLElement | null>\n /** How many columns that box is divided into. */\n columns: () => number\n /** Whether events may be moved at all. */\n editable: () => boolean\n /** The node every card points at to say how it can be moved. */\n hintId: () => string\n /** The step a grabbed event moves by, handed to the keyboard table. */\n slotMinutes: () => number\n edgeStepDelay: () => number\n /** Whatever the grid's cells are made of, so paging under a still pointer re-places the card. */\n layout: () => unknown\n /** Works out where the gesture's event belongs from the pointer's last position. */\n applyPoint: (state: G, rect: DOMRect) => void\n /** Called on every pointer move past the threshold, after the edge watch, with both rects. */\n onEdges?: (state: G, rootRect: DOMRect | undefined) => void\n /** Everything else a gesture leaves running, dropped on every path out of one. */\n onRelease?: () => void\n /**\n * A pointer gesture let go inside the calendar. Returns true when the grid has answered it\n * itself, such as a slot drawn out, and nothing is left to drop.\n */\n onLetGo?: (state: G) => boolean\n /** A gesture that moved, committed: the grid reports the new times. */\n onDrop: (state: G) => void\n /** What a keyboard grab of this event starts, or null when it cannot be grabbed. */\n grab: (item: E) => GestureInit<G> | null\n /** Applies one arrow step to a grabbed event. Returns false when the step means nothing here. */\n onGrabStep: (state: G, step: GrabStep, item: E) => boolean\n step: (direction: -1 | 1) => void\n announce: (message: string) => void\n}\n\nexport function useCalendarGesture<E extends CalendarEvent, G extends GestureBase>(\n options: CalendarGestureOptions<E, G>,\n) {\n const m = useMessages()\n const gesture = ref<G | null>(null) as Ref<G | null>\n\n /** True while a card is being held by the keyboard rather than dragged by a pointer. */\n const grabbing = computed(() => isGrabbed(gesture.value))\n\n const isRtl = () => isElementRtl(options.measureEl.value)\n\n /**\n * The echo of where the gestured event began, so the reader can see what they are moving it\n * FROM. A press that has not travelled yet produces none, or a click would flash a second\n * card over the first.\n */\n const ghostEvent = computed<E | null>(() => {\n const state = gesture.value\n if (!state?.moved) return null\n const original = options.events().find((event) => event.id === state.id)\n return original ? ({ ...original, ...state.origin, id: ghostIdOf(state.id) } as E) : null\n })\n\n /** A list with the gestured event moved to wherever it is now, plus its echo. */\n function withPreview(events: readonly E[]): E[] {\n const state = gesture.value\n if (!state) return [...events]\n const moving = events.map((event) =>\n event.id === state.id ? ({ ...event, ...state.preview } as E) : event,\n )\n return ghostEvent.value ? [...moving, ghostEvent.value] : moving\n }\n\n /**\n * Set click suppression on pointerup, not pointercancel; clear it before every press guard\n * and keyboard activation. Captured releases may never send their click to an event card.\n */\n let dragged = false\n\n /** Closes the books on the previous gesture. */\n function endLastGesture() {\n dragged = false\n if (grabbing.value) revertGrab()\n }\n\n /** Puts a keyboard grab back where it was taken from, writing nothing, and says so. */\n function revertGrab() {\n const state = gesture.value\n if (!state) return\n gesture.value = null\n options.announce(m.value.calendar.reverted)\n return state\n }\n\n /**\n * A keyboard grab ends when the focus moves on to something else, the toolbar or another\n * control.\n */\n function onFocusout(event: FocusEvent) {\n const state = gesture.value\n const next = event.relatedTarget as HTMLElement | null\n if (!grabbing.value || !state || !next) return\n const card = next.closest<HTMLElement>('.v-calendar-event')\n if (card && card.dataset.eventId === String(state.id)) return\n revertGrab()\n }\n\n /** Whether the gesture that just ended actually moved; asking lowers the flag. */\n function consumeDrag() {\n const was = dragged\n dragged = false\n return was\n }\n\n const edge = useEdgeStep(options.step, options.edgeStepDelay)\n\n /** Which edge is counting down, as the attribute the stylesheet reads. */\n const edgeCue = computed(() =>\n edge.pending.value === -1 ? 'start' : edge.pending.value === 1 ? 'end' : undefined,\n )\n\n function release() {\n edge.cancel()\n options.onRelease?.()\n }\n\n /** Starts a gesture. */\n function start(init: GestureInit<G>, rtl = isRtl()) {\n gesture.value = {\n ...init,\n preview: { ...init.origin },\n lastX: init.originX,\n lastY: init.originY,\n moved: false,\n outside: false,\n rtl,\n } as G\n }\n\n /**\n * Called when the press crosses the drag threshold, never at the press. The browser sends the\n * `click` that follows a captured `pointerup` to the CAPTURE element, so a press captured at\n * once reaches the scroller instead of the card or the cell under it: clicking an event would\n * open nothing and clicking an empty slot would report nothing, on every calendar whose\n * events can be moved or drawn.\n */\n function capture(pointerId: number) {\n // @fallback\n /*\n * Synthetic pointer events may not have a capturable pointer; allow the gesture to continue\n * within the element if capture fails.\n */\n try {\n options.captureEl.value?.setPointerCapture(pointerId)\n } catch {\n /* Synthetic pointers cannot be captured. */\n }\n }\n\n function reapply(state: G) {\n const rect = options.measureEl.value?.getBoundingClientRect()\n if (rect) options.applyPoint(state, rect)\n }\n\n function onPointermove(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId) return\n\n state.lastX = event.clientX\n state.lastY = event.clientY\n\n // Below the threshold nothing has happened yet. That is what keeps a click a click: the\n // hand's tremor during a press would otherwise register as a one-pixel drag.\n if (\n !state.moved &&\n Math.abs(event.clientX - state.originX) < DRAG_THRESHOLD &&\n Math.abs(event.clientY - state.originY) < DRAG_THRESHOLD\n ) {\n return\n }\n\n if (!state.moved) capture(event.pointerId)\n state.moved = true\n const rootRect = options.rootEl.value?.getBoundingClientRect()\n const rect = options.measureEl.value?.getBoundingClientRect()\n\n /*\n * Neither the placement nor the edge watch below is gated on it, and neither may become so.\n * The card must keep following the pointer while it is out, which makes coming back in\n * seamless, and paging must keep running, pushing past the edge being how one crosses into\n * the next period.\n */\n state.outside = rootRect ? !pointWithin({ x: state.lastX, y: state.lastY }, rootRect) : false\n\n if (!rect) return\n options.applyPoint(state, rect)\n edge.watchEdge(\n inlineEdgeAt(\n state.lastX,\n gridGeometryOf(rect, options.columns(), state.rtl),\n EDGE_BAND,\n state.rtl,\n ),\n )\n options.onEdges?.(state, rootRect)\n }\n\n function onPointerup(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId) return\n gesture.value = null\n dragged = state.moved\n release()\n\n /*\n * Nothing is announced: the pointer says nothing on a SUCCESSFUL drop either; `grabbed`,\n * `dropped` and `reverted` belong to the keyboard grab, which has no pointer to show where\n * the event went.\n */\n if (state.outside) return\n if (options.onLetGo?.(state)) return\n // A press that never travelled is an ordinary click, which the button's own click event is\n // about to report. Writing anything here would move an event nobody dragged.\n if (state.moved) options.onDrop(state)\n }\n\n /*\n * The gesture was taken away; a system gesture, a context menu, the page starting to scroll.\n * Nothing is written and nothing is announced: the card goes back to where the model still\n * says it is.\n */\n function onPointercancel(event: PointerEvent) {\n // Another pointer's cancel, a second finger starting to pan, is not this gesture's. A\n // keyboard grab carries no pointer id, so no cancel can end it either.\n if (gesture.value?.pointerId !== event.pointerId) return\n abandon()\n }\n\n function abandon() {\n gesture.value = null\n release()\n }\n\n /*\n * Its `pointerup` then lands outside and never reaches the bindings, so without this the\n * gesture would outlive the press: a mouse keeps the same pointer id, and bringing it back\n * over the calendar with the button up would pick the event up and carry it. A captured\n * pointer never leaves, so a real drag is untouched.\n */\n function onPointerleave(event: PointerEvent) {\n const state = gesture.value\n if (!state || state.pointerId !== event.pointerId || state.moved) return\n abandon()\n }\n\n /*\n * Paging swaps the cells out from under a live drag, and the dragged event's day is then off\n * screen; the card would vanish until the next pointer move, which never comes if the hand is\n * holding still against the edge. Re-applying the last position once the new cells are\n * rendered is what keeps the card under the pointer across the boundary.\n */\n watch(\n options.layout,\n () => {\n const state = gesture.value\n if (state?.moved) reapply(state)\n },\n { flush: 'post' },\n )\n\n /**\n * The card is found by WALKING the cards rather than by building an attribute selector. An id\n * belongs to the consumer, so it may hold a quote or a backslash a selector would need\n * escaped, and `CSS.escape` cannot do that escaping here: jsdom defines no `CSS` object at\n * all, so the call threw on every keyboard grab, from inside a `nextTick` where nothing could\n * catch it; an unhandled rejection, which fails the run while every assertion still passes.\n */\n function refocusCard(id: CalendarEventId) {\n void nextTick(() => {\n // Searched from the view's root: the time grid's all-day bars sit in its sticky header,\n // outside the box the cells occupy.\n const cards = options.rootEl.value?.querySelectorAll<HTMLElement>('.v-calendar-event')\n Array.from(cards ?? [])\n .find((card) => card.dataset.eventId === String(id))\n ?.focus()\n })\n }\n\n /** Puts the focus on a cell by its id, once the render that made it tabbable has run. */\n function focusCell(id: string, deferred = false, focusOptions?: FocusOptions) {\n const move = () => document.getElementById(id)?.focus(focusOptions)\n if (deferred) void nextTick(move)\n else move()\n }\n\n /** The event a card stands for, read back off the attribute the card publishes. */\n const idOfCard = (card: HTMLElement) => cardIdOf(card, (id) => options.eventOf(id) !== undefined)\n\n /**\n * A card answers a different table from the grid it sits in; that is what a grab mode IS.\n * Without it the grid would offer a gesture the pointer alone could reach (WCAG 2.1.1).\n */\n function onCardKeydown(event: KeyboardEvent, card: HTMLElement) {\n // Whatever click follows is this key's, never the end of an earlier drag.\n dragged = false\n const item = options.eventOf(idOfCard(card))\n if (!item) return\n\n const held = grabbing.value && gesture.value?.id === item.id\n const state = held ? gesture.value! : null\n const intent = calendarIntent(\n event,\n held ? 'grabbed' : 'event',\n options.slotMinutes(),\n state?.rtl ?? isRtl(),\n )\n if (!intent) return\n\n if (!state) {\n // An event that cannot be moved keeps a button's ordinary behaviour: Space presses it,\n // which the card's click handler reports.\n const init = intent.kind === 'grab' ? options.grab(item) : null\n if (!init) return\n /*\n * Cancelling the keydown is what stops that press, so the keystroke that takes hold of\n * the event does not open it too: without it every attempt to move something would fire\n * the consumer's editor over it.\n */\n event.preventDefault()\n start(init)\n options.announce(m.value.calendar.grabbed)\n return\n }\n\n event.preventDefault()\n\n if (intent.kind === 'grabMove' || intent.kind === 'grabResize') {\n if (!options.onGrabStep(state, intent, item)) return\n state.moved = true\n refocusCard(state.id)\n return\n }\n\n if (intent.kind === 'activate') {\n gesture.value = null\n if (state.moved) options.onDrop(state)\n options.announce(m.value.calendar.dropped)\n refocusCard(state.id)\n return\n }\n\n if (intent.kind === 'cancel') {\n revertGrab()\n refocusCard(state.id)\n }\n }\n\n /**\n * The five things every card is told about the gesture, bound with `v-bind` so the two grids\n * cannot describe the same state in two different ways.\n */\n function cardState(id: CalendarEventId) {\n const state = gesture.value\n const mine = state !== null && state.id === id\n return {\n /*\n * Only once the press has travelled. A dragged card takes no pointer events, so marked at\n * the press it lets the release land on the cell beneath it: the click then goes to that\n * cell, and clicking an event reports an empty slot instead of opening it.\n */\n dragging: mine && state.pointerId !== null && state.moved,\n rejected: mine && state.outside,\n grabbed: mine && state.pointerId === null,\n hintId: options.editable() && !isGhostId(id) ? options.hintId() : undefined,\n ghostOf: isGhostId(id) ? originalIdOf(id) : undefined,\n }\n }\n\n return {\n gesture,\n grabbing,\n ghostEvent,\n withPreview,\n edgeCue,\n isRtl,\n start,\n reapply,\n release,\n endLastGesture,\n consumeDrag,\n onPointermove,\n onPointerup,\n onPointercancel,\n onPointerleave,\n onFocusout,\n onCardKeydown,\n refocusCard,\n focusCell,\n idOfCard,\n cardState,\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAM,IAAe,6BAMf,KAAa,MAAwB,GAAG,IAAe,KAEvD,KAAgB,MAAwB,OAAO,CAAE,CAAC,CAAC,MAAM,EAAmB,GAC5E,KAAa,MAAwB,OAAO,CAAE,CAAC,CAAC,WAAW,CAAY;AAG7E,SAAS,EAAS,GAAmB,GAAuC;CAC1E,IAAM,IAAM,EAAK,QAAQ,WAAW;CACpC,OAAO,EAAI,CAAG,IAAI,IAAM,OAAO,CAAG;AACpC;AAMA,SAAgB,EAAe,GAAe,GAAiB,GAA4B;CACzF,OAAO;EACL,KAAK,EAAK;EACV,QAAQ,EAAK;EACb,aAAa,IAAM,EAAK,QAAQ,EAAK;EACrC,YAAY,EAAK;EACjB;CACF;AACF;AAgDA,IAAM,KAAa,MAA8B,MAAU,QAAQ,EAAM,cAAc;AA+CvF,SAAgB,EACd,GACA;CACA,IAAM,IAAI,EAAY,GAChB,IAAU,EAAc,IAAI,GAG5B,IAAW,QAAe,EAAU,EAAQ,KAAK,CAA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
37
  export type CalendarView = 'day' | '4days' | 'week' | 'month' | 'year' | 'custom';
38
38
  /** Whether times are written on a twelve or a twenty-four hour clock. */
39
39
  export type CalendarFormat = HourFormat;
40
+ /** How the view is set off from the page: nothing, a border, a shadow, or a muted fill. */
41
+ export type CalendarVariant = 'flat' | 'outline' | 'elevated' | 'filled';
40
42
  /**
41
43
  * The shape an event's card takes: a block, which fills the box the calendar gives it and
42
44
  * can show a second line, or a chip, one line high in a row of others.
@@ -0,0 +1,2 @@
1
+ @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
+ @layer vectis.components{.v-card{--card-padding:var(--vectis-space-4);--card-gap:var(--vectis-space-3);border-radius:var(--vectis-radius-surface);background:var(--vectis-color-surface);color:var(--vectis-color-text);font-family:var(--vectis-text-family);font-size:var(--vectis-text-body-md-size);font-weight:var(--vectis-text-body-md-weight);line-height:var(--vectis-text-body-md-leading);transition:border-color var(--vectis-duration-fast) var(--vectis-ease-default), box-shadow var(--vectis-duration-fast) var(--vectis-ease-default), background-color var(--vectis-duration-fast) var(--vectis-ease-default);border:1px solid #0000;flex-direction:column;display:flex;position:relative;overflow:clip}.v-card[data-size=sm]{--card-padding:var(--vectis-space-3);--card-gap:var(--vectis-space-2)}.v-card[data-size=lg]{--card-padding:var(--vectis-space-6);--card-gap:var(--vectis-space-4)}.v-card[data-variant=flat]{background:0 0}.v-card[data-variant=outline]{border-color:var(--vectis-color-border)}.v-card[data-variant=elevated]{background:var(--vectis-color-surface-raised);box-shadow:var(--vectis-shadow-sm)}.v-card[data-variant=filled]{background:var(--vectis-color-surface-muted)}.v-card[data-orientation=horizontal]{flex-flow:wrap}.v-card[data-orientation=horizontal]>.v-card-media{flex:1 1 var(--vectis-control-size-card-media)}.v-card[data-orientation=horizontal]>.v-card-content{flex:999 1 var(--vectis-control-size-card-body-min)}.v-card-media>:is(img,video,picture,svg,iframe){object-fit:cover;block-size:100%;inline-size:100%;display:block}.v-card-media>.v-skeleton-loader{block-size:100%;min-block-size:var(--vectis-control-size-skeleton-surface)}.v-card-content{gap:var(--card-gap);min-inline-size:0;padding:var(--card-padding);flex-direction:column;flex:1;display:flex}.v-card-header{flex-direction:column;display:flex}.v-card-title{font-size:var(--vectis-text-heading-4-size);font-weight:var(--vectis-text-heading-4-weight);line-height:var(--vectis-text-heading-4-leading)}.v-card-subtitle{color:var(--vectis-color-text-muted);font-size:var(--vectis-text-body-sm-size);font-weight:var(--vectis-text-body-sm-weight);line-height:var(--vectis-text-body-sm-leading)}.v-card-footer{align-items:center;gap:var(--vectis-space-2);flex-wrap:wrap;margin-block-start:auto;display:flex}.v-card-link{color:inherit;outline:none;text-decoration:none}.v-card-link:after{content:"";position:absolute;inset:0}.v-card[data-interactive] :is(a[href],button,input,select,textarea,summary,label,[tabindex]):not(.v-card-link){z-index:1;position:relative}.v-card:has(.v-card-link:focus-visible){outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-card[data-interactive][data-variant=flat]:not([data-disabled]):hover{background:var(--vectis-color-surface-muted)}.v-card[data-interactive][data-variant=outline]:not([data-disabled]):hover{border-color:var(--vectis-color-border-strong)}.v-card[data-interactive][data-variant=elevated]:not([data-disabled]):hover{box-shadow:var(--vectis-shadow-md)}.v-card[data-interactive][data-variant=filled]:not([data-disabled]):hover{background:color-mix(in oklab, var(--vectis-color-surface-muted), var(--vectis-color-text) 4%)}.v-card[data-interactive]:not([data-disabled]):hover .v-card-link{text-decoration:underline}.v-card[data-disabled] .v-card-link{color:var(--vectis-color-text-subtle);cursor:not-allowed}.v-card[data-disabled] .v-card-media{opacity:.5}@media (prefers-reduced-motion:reduce){.v-card{transition:none}}}
@@ -0,0 +1,87 @@
1
+ /** How the card is set off from the page: nothing, a border, a shadow, or a muted fill. */
2
+ export type CardVariant = 'flat' | 'outline' | 'elevated' | 'filled';
3
+ /** Whether the media sits above the content or beside it. */
4
+ export type CardOrientation = 'vertical' | 'horizontal';
5
+ /** How much room the card leaves around and between its parts. */
6
+ export type CardSize = 'sm' | 'md' | 'lg';
7
+ /** The heading level of the title, when it should be part of the page outline. */
8
+ export type CardHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
9
+ interface CardProps {
10
+ /**
11
+ * How the card is set off from the page: nothing at all (`flat`), a border (`outline`, the
12
+ * default), a shadow over a raised surface (`elevated`), or a muted fill with no border
13
+ * (`filled`).
14
+ */
15
+ variant?: CardVariant;
16
+ /**
17
+ * Where the `#media` slot sits: above the content (`vertical`, the default), or at its start
18
+ * (`horizontal`). A horizontal card puts the media back above the content when it is too
19
+ * narrow for both side by side.
20
+ */
21
+ orientation?: CardOrientation;
22
+ /** The padding of the card and the gaps between its parts. */
23
+ size?: CardSize;
24
+ /** The title of the card. With `href`, it is the text of the card's link. */
25
+ title?: string;
26
+ /** A line under the title. */
27
+ subtitle?: string;
28
+ /**
29
+ * Renders the title as a heading of this level, so that the card takes its place in the
30
+ * page outline. Left out, the title is a paragraph.
31
+ */
32
+ headingLevel?: CardHeadingLevel;
33
+ /**
34
+ * Makes the whole card a link to this address. The link is the title, whose clickable area
35
+ * covers the card; buttons and links inside the card remain separate targets. It requires
36
+ * `title`.
37
+ */
38
+ href?: string;
39
+ /**
40
+ * Makes a linked card unusable: the link loses its address and is marked disabled, and the
41
+ * title and media are dimmed. Controls in the slots are not affected.
42
+ */
43
+ disabled?: boolean;
44
+ /**
45
+ * Replaces the content with placeholders, and the media too when there is one. The footer
46
+ * is hidden until the content arrives.
47
+ */
48
+ loading?: boolean;
49
+ /**
50
+ * Announces the loading to screen readers with this text. Left out, a loading card is
51
+ * silent, so that a grid of them does not read out the same word a dozen times.
52
+ */
53
+ loadingText?: string;
54
+ /** The element the card is rendered as: `article`, `section` or `li` instead of a `div`. */
55
+ as?: string;
56
+ }
57
+ type __VLS_Slots = {
58
+ /** The body of the card. */
59
+ default?(): unknown;
60
+ /** An image, a video or an illustration, drawn edge to edge. */
61
+ media?(): unknown;
62
+ /** Replaces the title and subtitle with content of your own. A linked card loses its link. */
63
+ header?(): unknown;
64
+ /** Actions at the foot of the card, pushed to the bottom when the card is stretched. */
65
+ footer?(): unknown;
66
+ };
67
+ declare const __VLS_base: import('vue').DefineComponent<CardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CardProps> & Readonly<{}>, {
68
+ loading: boolean;
69
+ size: CardSize;
70
+ title: string;
71
+ variant: CardVariant;
72
+ href: string;
73
+ disabled: boolean;
74
+ subtitle: string;
75
+ as: string;
76
+ orientation: CardOrientation;
77
+ loadingText: string;
78
+ headingLevel: CardHeadingLevel;
79
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
80
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
81
+ declare const _default: typeof __VLS_export;
82
+ export default _default;
83
+ type __VLS_WithSlots<T, S> = T & {
84
+ new (): {
85
+ $slots: S;
86
+ };
87
+ };
@@ -0,0 +1,9 @@
1
+ import './VCard.css';
2
+ import e from "./VCard.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/VCard/VCard.vue
5
+ var t = e;
6
+ //#endregion
7
+ export { t as default };
8
+
9
+ //# sourceMappingURL=VCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VCard.js","names":[],"sources":["../../../src/components/VCard/VCard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A clickable card is one real link, its title, stretched over the card by a pseudo-element:\n * the reader hears one link named by the title, and the controls inside the card stay separate\n * targets. Wrapping the whole card in an `<a>` would name the link with all its text and forbid\n * the buttons it holds.\n */\n\nimport { computed, watchEffect } from 'vue'\n\nimport VSkeletonLoader from '../VSkeletonLoader/VSkeletonLoader.vue'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { isDev } from '../../utils/env'\n\n/** How the card is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type CardVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n/** Whether the media sits above the content or beside it. */\nexport type CardOrientation = 'vertical' | 'horizontal'\n/** How much room the card leaves around and between its parts. */\nexport type CardSize = 'sm' | 'md' | 'lg'\n/** The heading level of the title, when it should be part of the page outline. */\nexport type CardHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\n\ninterface CardProps {\n /**\n * How the card is set off from the page: nothing at all (`flat`), a border (`outline`, the\n * default), a shadow over a raised surface (`elevated`), or a muted fill with no border\n * (`filled`).\n */\n variant?: CardVariant\n /**\n * Where the `#media` slot sits: above the content (`vertical`, the default), or at its start\n * (`horizontal`). A horizontal card puts the media back above the content when it is too\n * narrow for both side by side.\n */\n orientation?: CardOrientation\n /** The padding of the card and the gaps between its parts. */\n size?: CardSize\n /** The title of the card. With `href`, it is the text of the card's link. */\n title?: string\n /** A line under the title. */\n subtitle?: string\n /**\n * Renders the title as a heading of this level, so that the card takes its place in the\n * page outline. Left out, the title is a paragraph.\n */\n headingLevel?: CardHeadingLevel\n /**\n * Makes the whole card a link to this address. The link is the title, whose clickable area\n * covers the card; buttons and links inside the card remain separate targets. It requires\n * `title`.\n */\n href?: string\n /**\n * Makes a linked card unusable: the link loses its address and is marked disabled, and the\n * title and media are dimmed. Controls in the slots are not affected.\n */\n disabled?: boolean\n /**\n * Replaces the content with placeholders, and the media too when there is one. The footer\n * is hidden until the content arrives.\n */\n loading?: boolean\n /**\n * Announces the loading to screen readers with this text. Left out, a loading card is\n * silent, so that a grid of them does not read out the same word a dozen times.\n */\n loadingText?: string\n /** The element the card is rendered as: `article`, `section` or `li` instead of a `div`. */\n as?: string\n}\n\nconst props = withDefaults(defineProps<CardProps>(), {\n variant: 'outline',\n orientation: 'vertical',\n size: 'md',\n title: undefined,\n subtitle: undefined,\n headingLevel: undefined,\n href: undefined,\n disabled: false,\n loading: false,\n loadingText: undefined,\n as: 'div',\n})\n\nconst slots = defineSlots<{\n /** The body of the card. */\n default?(): unknown\n /** An image, a video or an illustration, drawn edge to edge. */\n media?(): unknown\n /** Replaces the title and subtitle with content of your own. A linked card loses its link. */\n header?(): unknown\n /** Actions at the foot of the card, pushed to the bottom when the card is stretched. */\n footer?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n/*\n * A linked card follows the wrapper-root pattern: the link is the element that acts, so it\n * receives the forwarded attributes (`target`, `rel`, a router's click handler) and the root\n * keeps only `class` and `style`. A card that is not a link is a plain container and keeps all\n * of them.\n */\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: linkAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\n\nconst rootAttrs = computed(() =>\n isLink.value ? { class: rootClass.value, style: rootStyle.value } : attrs,\n)\n\nconst titleTag = computed(() => (props.headingLevel ? `h${props.headingLevel}` : 'p'))\n\n// @devwarn\n// The link is the title: without one, the card would hold an empty link.\nif (isDev) {\n watchEffect(() => {\n if (props.href !== undefined && (!props.title || slots.header))\n console.warn(\n '[VCard] `href` needs the `title` prop, which becomes the text of the link; the `#header` slot replaces it and drops the link.',\n )\n })\n}\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"v-card\"\n :data-variant=\"variant\"\n :data-orientation=\"orientation\"\n :data-size=\"size\"\n :data-interactive=\"isLink ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-busy=\"loading || undefined\"\n >\n <div v-if=\"$slots.media\" class=\"v-card-media\">\n <VSkeletonLoader v-if=\"loading\" shape=\"surface\" animation=\"pulse\" />\n <slot v-else name=\"media\" />\n </div>\n <div class=\"v-card-content\">\n <template v-if=\"loading\">\n <VSkeletonLoader v-if=\"title || subtitle || $slots.header\" width=\"60%\" />\n <VSkeletonLoader :lines=\"3\" :label=\"loadingText\" />\n </template>\n <template v-else>\n <div v-if=\"$slots.header || title || subtitle\" class=\"v-card-header\">\n <slot name=\"header\">\n <component :is=\"titleTag\" v-if=\"title\" class=\"v-card-title\">\n <a\n v-if=\"isLink\"\n class=\"v-card-link\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"linkAttrs\"\n :href=\"linkHref\"\n >{{ title }}</a\n >\n <template v-else>{{ title }}</template>\n </component>\n <p v-if=\"subtitle\" class=\"v-card-subtitle\">{{ subtitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.default\" class=\"v-card-body\">\n <slot />\n </div>\n <div v-if=\"$slots.footer\" class=\"v-card-footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </div>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-card {\n --card-padding: var(--vectis-space-4);\n --card-gap: var(--vectis-space-3);\n\n position: relative;\n display: flex;\n flex-direction: column;\n /* Clips the media to the rounded corners, whichever side it ends up on. */\n overflow: clip;\n /* Transparent rather than absent: forced colours paint it, and the card keeps an edge. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n background: var(--vectis-color-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n transition:\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default),\n background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-card[data-size='sm'] {\n --card-padding: var(--vectis-space-3);\n --card-gap: var(--vectis-space-2);\n }\n\n .v-card[data-size='lg'] {\n --card-padding: var(--vectis-space-6);\n --card-gap: var(--vectis-space-4);\n }\n\n .v-card[data-variant='flat'] {\n background: transparent;\n }\n\n .v-card[data-variant='outline'] {\n border-color: var(--vectis-color-border);\n }\n\n .v-card[data-variant='elevated'] {\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n .v-card[data-variant='filled'] {\n background: var(--vectis-color-surface-muted);\n }\n\n /*\n * Side by side without a container query: the content's flex basis is its narrowest\n * comfortable width, and its huge grow factor keeps the media at its own basis. When the card\n * cannot fit both bases on one line, the content wraps under the media and both take the\n * full width. A container query would need size containment on the card, which collapses it\n * to nothing in any parent that sizes it from its content.\n */\n .v-card[data-orientation='horizontal'] {\n flex-flow: row wrap;\n }\n\n .v-card[data-orientation='horizontal'] > .v-card-media {\n flex: 1 1 var(--vectis-control-size-card-media);\n }\n\n .v-card[data-orientation='horizontal'] > .v-card-content {\n flex: 999 1 var(--vectis-control-size-card-body-min);\n }\n\n .v-card-media > :is(img, video, picture, svg, iframe) {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n /*\n * The placeholder has no intrinsic height: the percentage fills a media stretched beside the\n * content, and the minimum gives it the skeleton's surface height everywhere else.\n */\n .v-card-media > .v-skeleton-loader {\n block-size: 100%;\n min-block-size: var(--vectis-control-size-skeleton-surface);\n }\n\n .v-card-content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--card-gap);\n min-inline-size: 0;\n padding: var(--card-padding);\n }\n\n .v-card-header {\n display: flex;\n flex-direction: column;\n }\n\n .v-card-title {\n font-size: var(--vectis-text-heading-4-size);\n font-weight: var(--vectis-text-heading-4-weight);\n line-height: var(--vectis-text-heading-4-leading);\n }\n\n .v-card-subtitle {\n color: var(--vectis-color-text-muted);\n font-size: var(--vectis-text-body-sm-size);\n font-weight: var(--vectis-text-body-sm-weight);\n line-height: var(--vectis-text-body-sm-leading);\n }\n\n /* Pushed to the bottom, so that cards stretched to one height line their actions up. */\n .v-card-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--vectis-space-2);\n margin-block-start: auto;\n }\n\n .v-card-link {\n color: inherit;\n text-decoration: none;\n outline: none;\n }\n\n /* The link's hit area: the whole card, which is its positioned ancestor. */\n .v-card-link::after {\n content: '';\n position: absolute;\n inset: 0;\n }\n\n /*\n * The controls inside a linked card are lifted above the stretched link so that they stay\n * their own targets. Consumer styles are unlayered and still override this positioning.\n */\n .v-card[data-interactive]\n :is(a[href], button, input, select, textarea, summary, label, [tabindex]):not(.v-card-link) {\n position: relative;\n z-index: 1;\n }\n\n /* The link draws no ring of its own; the card does, around the area that is clicked. */\n .v-card:has(.v-card-link:focus-visible) {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-card[data-interactive][data-variant='flat']:not([data-disabled]):hover {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-card[data-interactive][data-variant='outline']:not([data-disabled]):hover {\n border-color: var(--vectis-color-border-strong);\n }\n\n .v-card[data-interactive][data-variant='elevated']:not([data-disabled]):hover {\n box-shadow: var(--vectis-shadow-md);\n }\n\n .v-card[data-interactive][data-variant='filled']:not([data-disabled]):hover {\n background: color-mix(in oklab, var(--vectis-color-surface-muted), var(--vectis-color-text) 4%);\n }\n\n .v-card[data-interactive]:not([data-disabled]):hover .v-card-link {\n text-decoration: underline;\n }\n\n /*\n * Only the link, which carries `aria-disabled`, and the media are dimmed: the rest of the\n * text stays readable, since it is still content rather than a control.\n */\n .v-card[data-disabled] .v-card-link {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n .v-card[data-disabled] .v-card-media {\n opacity: 0.5;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-card {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,103 @@
1
+ import { isDev as e } from "../../utils/env.js";
2
+ import { useInertLink as t } from "../../composables/useInertLink.js";
3
+ import { useRootAttrs as n } from "../../composables/useRootAttrs.js";
4
+ import r from "../VSkeletonLoader/VSkeletonLoader.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, openBlock as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useSlots as y, watchEffect as b, withCtx as x } from "vue";
6
+ //#region src/components/VCard/VCard.vue?vue&type=script&setup=true&lang.ts
7
+ var S = {
8
+ key: 0,
9
+ class: "v-card-media"
10
+ }, C = { class: "v-card-content" }, w = {
11
+ key: 0,
12
+ class: "v-card-header"
13
+ }, T = ["aria-disabled", "href"], E = {
14
+ key: 1,
15
+ class: "v-card-subtitle"
16
+ }, D = {
17
+ key: 1,
18
+ class: "v-card-body"
19
+ }, O = {
20
+ key: 2,
21
+ class: "v-card-footer"
22
+ }, k = /*@__PURE__*/ f({
23
+ inheritAttrs: !1,
24
+ __name: "VCard",
25
+ props: {
26
+ variant: { default: "outline" },
27
+ orientation: { default: "vertical" },
28
+ size: { default: "md" },
29
+ title: { default: void 0 },
30
+ subtitle: { default: void 0 },
31
+ headingLevel: { default: void 0 },
32
+ href: { default: void 0 },
33
+ disabled: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ loading: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ loadingText: { default: void 0 },
42
+ as: { default: "div" }
43
+ },
44
+ setup(f) {
45
+ let k = f, A = y(), { attrs: j, rootClass: M, rootStyle: N, forwardedAttrs: P } = n(), { isLink: F, isInertLink: I, linkHref: L, attrs: R } = t({
46
+ href: () => k.href,
47
+ inert: () => k.disabled,
48
+ attrs: () => P.value
49
+ }), z = a(() => F.value ? {
50
+ class: M.value,
51
+ style: N.value
52
+ } : j), B = a(() => k.headingLevel ? `h${k.headingLevel}` : "p");
53
+ return e && b(() => {
54
+ k.href !== void 0 && (!k.title || A.header) && console.warn("[VCard] `href` needs the `title` prop, which becomes the text of the link; the `#header` slot replaces it and drops the link.");
55
+ }), (e, t) => (m(), o(g(f.as), p(z.value, {
56
+ class: "v-card",
57
+ "data-variant": f.variant,
58
+ "data-orientation": f.orientation,
59
+ "data-size": f.size,
60
+ "data-interactive": v(F) ? "" : void 0,
61
+ "data-disabled": f.disabled ? "" : void 0,
62
+ "aria-busy": f.loading || void 0
63
+ }), {
64
+ default: x(() => [e.$slots.media ? (m(), c("div", S, [f.loading ? (m(), o(r, {
65
+ key: 0,
66
+ shape: "surface",
67
+ animation: "pulse"
68
+ })) : h(e.$slots, "media", {}, void 0, void 0, 1)])) : s("", !0), l("div", C, [f.loading ? (m(), c(i, { key: 0 }, [f.title || f.subtitle || e.$slots.header ? (m(), o(r, {
69
+ key: 0,
70
+ width: "60%"
71
+ })) : s("", !0), d(r, {
72
+ lines: 3,
73
+ label: f.loadingText
74
+ }, null, 8, ["label"])], 64)) : (m(), c(i, { key: 1 }, [
75
+ e.$slots.header || f.title || f.subtitle ? (m(), c("div", w, [h(e.$slots, "header", {}, () => [f.title ? (m(), o(g(B.value), {
76
+ key: 0,
77
+ class: "v-card-title"
78
+ }, {
79
+ default: x(() => [v(F) ? (m(), c("a", p({
80
+ key: 0,
81
+ class: "v-card-link",
82
+ "aria-disabled": v(I) ? "true" : void 0
83
+ }, v(R), { href: v(L) }), _(f.title), 17, T)) : (m(), c(i, { key: 1 }, [u(_(f.title), 1)], 64))]),
84
+ _: 1
85
+ })) : s("", !0), f.subtitle ? (m(), c("p", E, _(f.subtitle), 1)) : s("", !0)])])) : s("", !0),
86
+ e.$slots.default ? (m(), c("div", D, [h(e.$slots, "default")])) : s("", !0),
87
+ e.$slots.footer ? (m(), c("div", O, [h(e.$slots, "footer")])) : s("", !0)
88
+ ], 64))])]),
89
+ _: 3
90
+ }, 16, [
91
+ "data-variant",
92
+ "data-orientation",
93
+ "data-size",
94
+ "data-interactive",
95
+ "data-disabled",
96
+ "aria-busy"
97
+ ]));
98
+ }
99
+ });
100
+ //#endregion
101
+ export { k as default };
102
+
103
+ //# sourceMappingURL=VCard.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VCard.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VCard/VCard.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A clickable card is one real link, its title, stretched over the card by a pseudo-element:\n * the reader hears one link named by the title, and the controls inside the card stay separate\n * targets. Wrapping the whole card in an `<a>` would name the link with all its text and forbid\n * the buttons it holds.\n */\n\nimport { computed, watchEffect } from 'vue'\n\nimport VSkeletonLoader from '../VSkeletonLoader/VSkeletonLoader.vue'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { isDev } from '../../utils/env'\n\n/** How the card is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type CardVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n/** Whether the media sits above the content or beside it. */\nexport type CardOrientation = 'vertical' | 'horizontal'\n/** How much room the card leaves around and between its parts. */\nexport type CardSize = 'sm' | 'md' | 'lg'\n/** The heading level of the title, when it should be part of the page outline. */\nexport type CardHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\n\ninterface CardProps {\n /**\n * How the card is set off from the page: nothing at all (`flat`), a border (`outline`, the\n * default), a shadow over a raised surface (`elevated`), or a muted fill with no border\n * (`filled`).\n */\n variant?: CardVariant\n /**\n * Where the `#media` slot sits: above the content (`vertical`, the default), or at its start\n * (`horizontal`). A horizontal card puts the media back above the content when it is too\n * narrow for both side by side.\n */\n orientation?: CardOrientation\n /** The padding of the card and the gaps between its parts. */\n size?: CardSize\n /** The title of the card. With `href`, it is the text of the card's link. */\n title?: string\n /** A line under the title. */\n subtitle?: string\n /**\n * Renders the title as a heading of this level, so that the card takes its place in the\n * page outline. Left out, the title is a paragraph.\n */\n headingLevel?: CardHeadingLevel\n /**\n * Makes the whole card a link to this address. The link is the title, whose clickable area\n * covers the card; buttons and links inside the card remain separate targets. It requires\n * `title`.\n */\n href?: string\n /**\n * Makes a linked card unusable: the link loses its address and is marked disabled, and the\n * title and media are dimmed. Controls in the slots are not affected.\n */\n disabled?: boolean\n /**\n * Replaces the content with placeholders, and the media too when there is one. The footer\n * is hidden until the content arrives.\n */\n loading?: boolean\n /**\n * Announces the loading to screen readers with this text. Left out, a loading card is\n * silent, so that a grid of them does not read out the same word a dozen times.\n */\n loadingText?: string\n /** The element the card is rendered as: `article`, `section` or `li` instead of a `div`. */\n as?: string\n}\n\nconst props = withDefaults(defineProps<CardProps>(), {\n variant: 'outline',\n orientation: 'vertical',\n size: 'md',\n title: undefined,\n subtitle: undefined,\n headingLevel: undefined,\n href: undefined,\n disabled: false,\n loading: false,\n loadingText: undefined,\n as: 'div',\n})\n\nconst slots = defineSlots<{\n /** The body of the card. */\n default?(): unknown\n /** An image, a video or an illustration, drawn edge to edge. */\n media?(): unknown\n /** Replaces the title and subtitle with content of your own. A linked card loses its link. */\n header?(): unknown\n /** Actions at the foot of the card, pushed to the bottom when the card is stretched. */\n footer?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n/*\n * A linked card follows the wrapper-root pattern: the link is the element that acts, so it\n * receives the forwarded attributes (`target`, `rel`, a router's click handler) and the root\n * keeps only `class` and `style`. A card that is not a link is a plain container and keeps all\n * of them.\n */\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: linkAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\n\nconst rootAttrs = computed(() =>\n isLink.value ? { class: rootClass.value, style: rootStyle.value } : attrs,\n)\n\nconst titleTag = computed(() => (props.headingLevel ? `h${props.headingLevel}` : 'p'))\n\n// @devwarn\n// The link is the title: without one, the card would hold an empty link.\nif (isDev) {\n watchEffect(() => {\n if (props.href !== undefined && (!props.title || slots.header))\n console.warn(\n '[VCard] `href` needs the `title` prop, which becomes the text of the link; the `#header` slot replaces it and drops the link.',\n )\n })\n}\n</script>\n\n<template>\n <component\n :is=\"as\"\n v-bind=\"rootAttrs\"\n class=\"v-card\"\n :data-variant=\"variant\"\n :data-orientation=\"orientation\"\n :data-size=\"size\"\n :data-interactive=\"isLink ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-busy=\"loading || undefined\"\n >\n <div v-if=\"$slots.media\" class=\"v-card-media\">\n <VSkeletonLoader v-if=\"loading\" shape=\"surface\" animation=\"pulse\" />\n <slot v-else name=\"media\" />\n </div>\n <div class=\"v-card-content\">\n <template v-if=\"loading\">\n <VSkeletonLoader v-if=\"title || subtitle || $slots.header\" width=\"60%\" />\n <VSkeletonLoader :lines=\"3\" :label=\"loadingText\" />\n </template>\n <template v-else>\n <div v-if=\"$slots.header || title || subtitle\" class=\"v-card-header\">\n <slot name=\"header\">\n <component :is=\"titleTag\" v-if=\"title\" class=\"v-card-title\">\n <a\n v-if=\"isLink\"\n class=\"v-card-link\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"linkAttrs\"\n :href=\"linkHref\"\n >{{ title }}</a\n >\n <template v-else>{{ title }}</template>\n </component>\n <p v-if=\"subtitle\" class=\"v-card-subtitle\">{{ subtitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.default\" class=\"v-card-body\">\n <slot />\n </div>\n <div v-if=\"$slots.footer\" class=\"v-card-footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </div>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-card {\n --card-padding: var(--vectis-space-4);\n --card-gap: var(--vectis-space-3);\n\n position: relative;\n display: flex;\n flex-direction: column;\n /* Clips the media to the rounded corners, whichever side it ends up on. */\n overflow: clip;\n /* Transparent rather than absent: forced colours paint it, and the card keeps an edge. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n background: var(--vectis-color-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n transition:\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default),\n background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-card[data-size='sm'] {\n --card-padding: var(--vectis-space-3);\n --card-gap: var(--vectis-space-2);\n }\n\n .v-card[data-size='lg'] {\n --card-padding: var(--vectis-space-6);\n --card-gap: var(--vectis-space-4);\n }\n\n .v-card[data-variant='flat'] {\n background: transparent;\n }\n\n .v-card[data-variant='outline'] {\n border-color: var(--vectis-color-border);\n }\n\n .v-card[data-variant='elevated'] {\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n .v-card[data-variant='filled'] {\n background: var(--vectis-color-surface-muted);\n }\n\n /*\n * Side by side without a container query: the content's flex basis is its narrowest\n * comfortable width, and its huge grow factor keeps the media at its own basis. When the card\n * cannot fit both bases on one line, the content wraps under the media and both take the\n * full width. A container query would need size containment on the card, which collapses it\n * to nothing in any parent that sizes it from its content.\n */\n .v-card[data-orientation='horizontal'] {\n flex-flow: row wrap;\n }\n\n .v-card[data-orientation='horizontal'] > .v-card-media {\n flex: 1 1 var(--vectis-control-size-card-media);\n }\n\n .v-card[data-orientation='horizontal'] > .v-card-content {\n flex: 999 1 var(--vectis-control-size-card-body-min);\n }\n\n .v-card-media > :is(img, video, picture, svg, iframe) {\n display: block;\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n /*\n * The placeholder has no intrinsic height: the percentage fills a media stretched beside the\n * content, and the minimum gives it the skeleton's surface height everywhere else.\n */\n .v-card-media > .v-skeleton-loader {\n block-size: 100%;\n min-block-size: var(--vectis-control-size-skeleton-surface);\n }\n\n .v-card-content {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--card-gap);\n min-inline-size: 0;\n padding: var(--card-padding);\n }\n\n .v-card-header {\n display: flex;\n flex-direction: column;\n }\n\n .v-card-title {\n font-size: var(--vectis-text-heading-4-size);\n font-weight: var(--vectis-text-heading-4-weight);\n line-height: var(--vectis-text-heading-4-leading);\n }\n\n .v-card-subtitle {\n color: var(--vectis-color-text-muted);\n font-size: var(--vectis-text-body-sm-size);\n font-weight: var(--vectis-text-body-sm-weight);\n line-height: var(--vectis-text-body-sm-leading);\n }\n\n /* Pushed to the bottom, so that cards stretched to one height line their actions up. */\n .v-card-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--vectis-space-2);\n margin-block-start: auto;\n }\n\n .v-card-link {\n color: inherit;\n text-decoration: none;\n outline: none;\n }\n\n /* The link's hit area: the whole card, which is its positioned ancestor. */\n .v-card-link::after {\n content: '';\n position: absolute;\n inset: 0;\n }\n\n /*\n * The controls inside a linked card are lifted above the stretched link so that they stay\n * their own targets. Consumer styles are unlayered and still override this positioning.\n */\n .v-card[data-interactive]\n :is(a[href], button, input, select, textarea, summary, label, [tabindex]):not(.v-card-link) {\n position: relative;\n z-index: 1;\n }\n\n /* The link draws no ring of its own; the card does, around the area that is clicked. */\n .v-card:has(.v-card-link:focus-visible) {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-card[data-interactive][data-variant='flat']:not([data-disabled]):hover {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-card[data-interactive][data-variant='outline']:not([data-disabled]):hover {\n border-color: var(--vectis-color-border-strong);\n }\n\n .v-card[data-interactive][data-variant='elevated']:not([data-disabled]):hover {\n box-shadow: var(--vectis-shadow-md);\n }\n\n .v-card[data-interactive][data-variant='filled']:not([data-disabled]):hover {\n background: color-mix(in oklab, var(--vectis-color-surface-muted), var(--vectis-color-text) 4%);\n }\n\n .v-card[data-interactive]:not([data-disabled]):hover .v-card-link {\n text-decoration: underline;\n }\n\n /*\n * Only the link, which carries `aria-disabled`, and the media are dimmed: the rest of the\n * text stays readable, since it is still content rather than a control.\n */\n .v-card[data-disabled] .v-card-link {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n .v-card[data-disabled] .v-card-media {\n opacity: 0.5;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-card {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings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O,EAAA;yCAEtC,EAuBW,GAAA,EAAA,KAAA,EAAA,GAAA;IAtBEA,EAAAA,OAAO,UAAU,EAAA,SAAS,EAAA,YAAA,EAAA,GAArC,EAeM,OAfN,GAeM,CAdJ,EAaO,EAAA,QAAA,UAAA,CAAA,SAAA,CAZ2B,EAAA,SAAA,EAAA,GAAhC,EAUY,EAVI,EAAA,KAAQ,GAAA;;KAAe,OAAM;;sBAQ1C,CANO,EAAA,CAAA,KAAA,EAAA,GADR,EAOC,KAPD,EAOC;;MALC,OAAM;MACL,iBAAe,EAAA,CAAA,IAAW,SAAY,KAAA;QAC/B,EAAA,CAAA,GAAS,EAChB,MAAM,EAAA,CAAA,EAAQ,CAAA,GAAA,EACX,EAAA,KAAK,GAAA,IAAA,CAAA,MAAA,EAAA,GAEX,EAAuC,GAAA,EAAA,KAAA,EAAA,GAAA,CAAA,EAAA,EAAnB,EAAA,KAAK,GAAA,CAAA,CAAA,GAAA,EAAA,EAAA,CAAA;;qBAElB,EAAA,YAAA,EAAA,GAAT,EAA6D,KAA7D,GAA6D,EAAf,EAAA,QAAQ,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAG/CA,EAAAA,OAAO,WAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAECA,EAAAA,OAAO,UAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAsB,EAAA,QAAA,QAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
@@ -145,13 +145,13 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
145
145
  label: string;
146
146
  indicators: CarouselIndicators;
147
147
  orientation: CarouselOrientation;
148
+ height: number | string;
148
149
  controls: CarouselControls;
149
150
  prevIcon: IconSource;
150
151
  nextIcon: IconSource;
151
152
  gap: number | string;
152
153
  prevLabel: string;
153
154
  nextLabel: string;
154
- height: number | string;
155
155
  itemsPerView: number;
156
156
  itemMinSize: number | string;
157
157
  peek: number | string;