vectis-ui 0.1.0 → 0.8.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 (475) hide show
  1. package/README.md +40 -6
  2. package/dist/components/VAccordion/VAccordion.css +1 -1
  3. package/dist/components/VAccordion/VAccordion.d.ts +9 -16
  4. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  6. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
  9. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  10. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
  11. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VAccordion/context.d.ts +1 -8
  13. package/dist/components/VAccordion/context.js.map +1 -1
  14. package/dist/components/VAvatar/VAvatar.css +1 -1
  15. package/dist/components/VAvatar/VAvatar.d.ts +44 -29
  16. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
  18. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
  20. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  21. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
  22. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/VAvatar/context.d.ts +6 -10
  24. package/dist/components/VAvatar/context.js.map +1 -1
  25. package/dist/components/VBadge/VBadge.css +1 -1
  26. package/dist/components/VBadge/VBadge.d.ts +31 -10
  27. package/dist/components/VBadge/VBadge.js.map +1 -1
  28. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
  29. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
  31. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
  32. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  33. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
  34. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VButton/VButton.css +1 -1
  36. package/dist/components/VButton/VButton.d.ts +30 -10
  37. package/dist/components/VButton/VButton.js.map +1 -1
  38. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
  39. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VButton/VButtonGroup.css +1 -1
  41. package/dist/components/VButton/VButtonGroup.d.ts +76 -13
  42. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  43. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
  44. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/VButton/context.d.ts +30 -0
  46. package/dist/components/VButton/context.js +6 -0
  47. package/dist/components/VButton/context.js.map +1 -0
  48. package/dist/components/VCalendar/VCalendar.css +1 -1
  49. package/dist/components/VCalendar/VCalendar.d.ts +50 -36
  50. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  51. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
  52. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  54. package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
  55. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  56. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
  57. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  59. package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
  60. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  61. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
  62. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  64. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
  65. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  66. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
  67. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  69. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  70. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
  71. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/VCalendar/gesture.d.ts +158 -0
  73. package/dist/components/VCalendar/gesture.js +170 -0
  74. package/dist/components/VCalendar/gesture.js.map +1 -0
  75. package/dist/components/VCalendar/keyboard.d.ts +9 -3
  76. package/dist/components/VCalendar/keyboard.js +2 -6
  77. package/dist/components/VCalendar/keyboard.js.map +1 -1
  78. package/dist/components/VCalendar/layout.d.ts +67 -54
  79. package/dist/components/VCalendar/layout.js +77 -69
  80. package/dist/components/VCalendar/layout.js.map +1 -1
  81. package/dist/components/VCalendar/timeGrid.d.ts +55 -0
  82. package/dist/components/VCalendar/timeGrid.js +71 -0
  83. package/dist/components/VCalendar/timeGrid.js.map +1 -0
  84. package/dist/components/VCalendar/types.d.ts +41 -16
  85. package/dist/components/VCarousel/VCarousel.css +1 -1
  86. package/dist/components/VCarousel/VCarousel.d.ts +21 -41
  87. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  88. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
  89. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
  91. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  92. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/VCarousel/context.d.ts +0 -12
  94. package/dist/components/VCarousel/context.js.map +1 -1
  95. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  96. package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
  97. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  98. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
  99. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VChip/VChip.css +1 -1
  101. package/dist/components/VChip/VChip.d.ts +36 -26
  102. package/dist/components/VChip/VChip.js.map +1 -1
  103. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
  104. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VCombobox/VCombobox.css +1 -1
  106. package/dist/components/VCombobox/VCombobox.d.ts +127 -31
  107. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  108. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
  109. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  111. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
  112. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  113. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  114. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/VCombobox/VComboboxOption.css +1 -1
  116. package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
  117. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  118. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
  119. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  121. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  123. package/dist/components/VDataTable/VDataTable.css +1 -1
  124. package/dist/components/VDataTable/VDataTable.d.ts +50 -28
  125. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  126. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
  127. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/VDateInput/VDateInput.css +1 -1
  129. package/dist/components/VDateInput/VDateInput.d.ts +90 -42
  130. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  131. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
  132. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  134. package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
  135. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  136. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
  137. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/VDialog/VDialog.css +1 -1
  139. package/dist/components/VDialog/VDialog.d.ts +45 -33
  140. package/dist/components/VDialog/VDialog.js.map +1 -1
  141. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
  142. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
  144. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  145. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
  146. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/VFileInput/VFileInput.css +1 -1
  148. package/dist/components/VFileInput/VFileInput.d.ts +78 -26
  149. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  150. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
  151. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  153. package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
  154. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  155. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
  156. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/VFilePicker/fileKind.d.ts +2 -27
  158. package/dist/components/VFilePicker/fileKind.js +9 -8
  159. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  160. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  161. package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
  162. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  163. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
  164. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/VHotkeys/platform.js.map +1 -1
  166. package/dist/components/VIcon/VIcon.css +1 -1
  167. package/dist/components/VIcon/VIcon.d.ts +15 -6
  168. package/dist/components/VIcon/VIcon.js.map +1 -1
  169. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
  170. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/VIcon/iconProps.js.map +1 -1
  172. package/dist/components/VIcon/icons/index.d.ts +1 -1
  173. package/dist/components/VIcon/icons/index.js.map +1 -1
  174. package/dist/components/VIcon/icons/names.d.ts +1 -1
  175. package/dist/components/VIcon/icons/names.js.map +1 -1
  176. package/dist/components/VIcon/resolver.d.ts +3 -3
  177. package/dist/components/VIcon/resolver.js.map +1 -1
  178. package/dist/components/VIcon/types.d.ts +12 -12
  179. package/dist/components/VIconButton/VIconButton.css +1 -1
  180. package/dist/components/VIconButton/VIconButton.d.ts +28 -11
  181. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  182. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
  183. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/VInput/VInput.css +1 -1
  185. package/dist/components/VInput/VInput.d.ts +26 -7
  186. package/dist/components/VInput/VInput.js.map +1 -1
  187. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
  188. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/VInput/VInputGroup.css +2 -0
  190. package/dist/components/VInput/VInputGroup.d.ts +47 -0
  191. package/dist/components/VInput/VInputGroup.js +9 -0
  192. package/dist/components/VInput/VInputGroup.js.map +1 -0
  193. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
  194. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  195. package/dist/components/VInput/context.d.ts +11 -0
  196. package/dist/components/VInput/context.js +6 -0
  197. package/dist/components/VInput/context.js.map +1 -0
  198. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  199. package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
  200. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  201. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
  202. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VMenu/VMenu.d.ts +23 -30
  204. package/dist/components/VMenu/VMenu.js.map +1 -1
  205. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
  206. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/VMenu/VMenuGroup.css +1 -1
  208. package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
  209. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  210. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
  211. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VMenu/VMenuItem.css +1 -1
  213. package/dist/components/VMenu/VMenuItem.d.ts +11 -19
  214. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  215. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
  216. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
  218. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  219. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
  220. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/components/VMenu/context.d.ts +2 -6
  222. package/dist/components/VMenu/context.js.map +1 -1
  223. package/dist/components/VPagination/VPagination.css +1 -1
  224. package/dist/components/VPagination/VPagination.d.ts +60 -22
  225. package/dist/components/VPagination/VPagination.js.map +1 -1
  226. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
  227. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VPopover/VPopover.css +1 -1
  229. package/dist/components/VPopover/VPopover.d.ts +26 -7
  230. package/dist/components/VPopover/VPopover.js.map +1 -1
  231. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
  232. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  234. package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
  235. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  236. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
  237. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  239. package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
  240. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  241. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
  242. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/VRadio/VRadio.css +1 -1
  244. package/dist/components/VRadio/VRadio.d.ts +36 -18
  245. package/dist/components/VRadio/VRadio.js.map +1 -1
  246. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
  247. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/components/VSeparator/VSeparator.d.ts +4 -2
  249. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  250. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  251. package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
  252. package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
  253. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  254. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
  255. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  257. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
  258. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  259. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  260. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  261. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  262. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
  263. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  264. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
  265. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VSideNavigation/context.d.ts +0 -14
  267. package/dist/components/VSideNavigation/context.js.map +1 -1
  268. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  269. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
  270. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  271. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/components/VSlider/VSlider.css +1 -1
  273. package/dist/components/VSlider/VSlider.d.ts +52 -27
  274. package/dist/components/VSlider/VSlider.js.map +1 -1
  275. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
  276. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  277. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  278. package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
  279. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  280. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
  281. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/components/VSnackbar/state.d.ts +0 -27
  283. package/dist/components/VSnackbar/state.js.map +1 -1
  284. package/dist/components/VSpinner/VSpinner.css +1 -1
  285. package/dist/components/VSpinner/VSpinner.d.ts +6 -6
  286. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  287. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
  288. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VSwitch/VSwitch.css +1 -1
  290. package/dist/components/VSwitch/VSwitch.d.ts +35 -13
  291. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  292. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
  293. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/components/VTabs/VTab.css +1 -1
  295. package/dist/components/VTabs/VTab.d.ts +12 -12
  296. package/dist/components/VTabs/VTab.js.map +1 -1
  297. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
  298. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VTabs/VTabPanel.d.ts +2 -10
  300. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  301. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
  302. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VTabs/VTabs.css +1 -1
  304. package/dist/components/VTabs/VTabs.d.ts +27 -18
  305. package/dist/components/VTabs/VTabs.js.map +1 -1
  306. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
  307. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VTabs/context.d.ts +9 -19
  309. package/dist/components/VTabs/context.js +1 -1
  310. package/dist/components/VTabs/context.js.map +1 -1
  311. package/dist/components/VTextarea/VTextarea.css +1 -1
  312. package/dist/components/VTextarea/VTextarea.d.ts +34 -6
  313. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  314. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
  315. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  317. package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
  318. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  319. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
  320. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  321. package/dist/components/VTimeInput/search.d.ts +24 -0
  322. package/dist/components/VTimeInput/search.js +22 -0
  323. package/dist/components/VTimeInput/search.js.map +1 -0
  324. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  325. package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
  326. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  327. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
  328. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  329. package/dist/components/VTimePicker/limits.d.ts +88 -0
  330. package/dist/components/VTimePicker/limits.js +70 -0
  331. package/dist/components/VTimePicker/limits.js.map +1 -0
  332. package/dist/components/VToast/VToast.css +1 -1
  333. package/dist/components/VToast/VToast.d.ts +0 -10
  334. package/dist/components/VToast/VToast.js.map +1 -1
  335. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
  336. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/components/VToast/VToaster.css +1 -1
  338. package/dist/components/VToast/VToaster.d.ts +0 -17
  339. package/dist/components/VToast/VToaster.js.map +1 -1
  340. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
  341. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VToast/state.d.ts +10 -19
  343. package/dist/components/VToast/state.js +1 -1
  344. package/dist/components/VToast/state.js.map +1 -1
  345. package/dist/components/VToggle/VToggle.css +1 -1
  346. package/dist/components/VToggle/VToggle.d.ts +56 -11
  347. package/dist/components/VToggle/VToggle.js.map +1 -1
  348. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
  349. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VToggle/VToggleItem.d.ts +16 -2
  351. package/dist/components/VToggle/VToggleItem.js +0 -2
  352. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.d.ts +4 -24
  356. package/dist/components/VToggle/context.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.css +1 -1
  358. package/dist/components/VTooltip/VTooltip.d.ts +9 -33
  359. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  360. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
  361. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.js.map +1 -1
  363. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/dist/composables/useAriaLabel.d.ts +0 -17
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useClearable.d.ts +42 -0
  367. package/dist/composables/useClearable.js +19 -0
  368. package/dist/composables/useClearable.js.map +1 -0
  369. package/dist/composables/useControlShape.d.ts +22 -0
  370. package/dist/composables/useControlShape.js +13 -0
  371. package/dist/composables/useControlShape.js.map +1 -0
  372. package/dist/composables/useDetailsOpen.d.ts +22 -0
  373. package/dist/composables/useDetailsOpen.js +21 -0
  374. package/dist/composables/useDetailsOpen.js.map +1 -0
  375. package/dist/composables/useFieldIds.d.ts +0 -15
  376. package/dist/composables/useFieldIds.js +8 -7
  377. package/dist/composables/useFieldIds.js.map +1 -1
  378. package/dist/composables/useFieldPanel.d.ts +21 -18
  379. package/dist/composables/useFieldPanel.js +43 -23
  380. package/dist/composables/useFieldPanel.js.map +1 -1
  381. package/dist/composables/useFileDrop.d.ts +0 -22
  382. package/dist/composables/useFileDrop.js.map +1 -1
  383. package/dist/composables/useFileField.d.ts +45 -17
  384. package/dist/composables/useFileField.js +40 -20
  385. package/dist/composables/useFileField.js.map +1 -1
  386. package/dist/composables/useFocusoutDismiss.d.ts +0 -15
  387. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  388. package/dist/composables/useIconClickHandlers.d.ts +29 -14
  389. package/dist/composables/useIconClickHandlers.js +15 -5
  390. package/dist/composables/useIconClickHandlers.js.map +1 -1
  391. package/dist/composables/useInertLink.d.ts +20 -0
  392. package/dist/composables/useInertLink.js +23 -0
  393. package/dist/composables/useInertLink.js.map +1 -0
  394. package/dist/composables/useMaskedField.d.ts +33 -10
  395. package/dist/composables/useMaskedField.js +45 -1
  396. package/dist/composables/useMaskedField.js.map +1 -1
  397. package/dist/composables/usePopover.d.ts +15 -1
  398. package/dist/composables/usePopover.js +23 -8
  399. package/dist/composables/usePopover.js.map +1 -1
  400. package/dist/composables/useProgressValue.d.ts +5 -8
  401. package/dist/composables/useProgressValue.js +6 -3
  402. package/dist/composables/useProgressValue.js.map +1 -1
  403. package/dist/composables/useRootAttrs.d.ts +12 -19
  404. package/dist/composables/useRootAttrs.js.map +1 -1
  405. package/dist/composables/useTimer.d.ts +8 -10
  406. package/dist/composables/useTimer.js.map +1 -1
  407. package/dist/i18n/en.d.ts +2 -10
  408. package/dist/i18n/en.js +18 -19
  409. package/dist/i18n/en.js.map +1 -1
  410. package/dist/i18n/fr.d.ts +2 -18
  411. package/dist/i18n/fr.js +18 -19
  412. package/dist/i18n/fr.js.map +1 -1
  413. package/dist/i18n/state.d.ts +44 -47
  414. package/dist/i18n/state.js +20 -17
  415. package/dist/i18n/state.js.map +1 -1
  416. package/dist/i18n/types.d.ts +53 -44
  417. package/dist/icons.d.ts +3 -3
  418. package/dist/index.d.ts +43 -17
  419. package/dist/index.js +45 -44
  420. package/dist/styles.css +1 -1
  421. package/dist/tokens/css.js.map +1 -1
  422. package/dist/tokens/index.d.ts +5 -1
  423. package/dist/tokens/primitives.js.map +1 -1
  424. package/dist/tokens/semantic.d.ts +5 -1
  425. package/dist/tokens/semantic.js +6 -2
  426. package/dist/tokens/semantic.js.map +1 -1
  427. package/dist/tokens/themes/dark.js.map +1 -1
  428. package/dist/tokens/types.d.ts +7 -15
  429. package/dist/tokens/types.js.map +1 -1
  430. package/dist/tokens.json +25 -5
  431. package/dist/types.d.ts +24 -0
  432. package/dist/utils/array.d.ts +3 -6
  433. package/dist/utils/array.js.map +1 -1
  434. package/dist/utils/arrowNav.d.ts +17 -17
  435. package/dist/utils/arrowNav.js +5 -3
  436. package/dist/utils/arrowNav.js.map +1 -1
  437. package/dist/utils/chip.d.ts +11 -15
  438. package/dist/utils/chip.js.map +1 -1
  439. package/dist/utils/css.d.ts +22 -11
  440. package/dist/utils/css.js +5 -2
  441. package/dist/utils/css.js.map +1 -1
  442. package/dist/utils/date.d.ts +42 -19
  443. package/dist/utils/date.js +97 -98
  444. package/dist/utils/date.js.map +1 -1
  445. package/dist/utils/direction.d.ts +6 -12
  446. package/dist/utils/direction.js.map +1 -1
  447. package/dist/utils/env.d.ts +5 -6
  448. package/dist/utils/file.d.ts +46 -58
  449. package/dist/utils/file.js +43 -36
  450. package/dist/utils/file.js.map +1 -1
  451. package/dist/utils/focus.d.ts +8 -17
  452. package/dist/utils/focus.js.map +1 -1
  453. package/dist/utils/hostWarns.d.ts +12 -0
  454. package/dist/utils/hostWarns.js +6 -0
  455. package/dist/utils/hostWarns.js.map +1 -0
  456. package/dist/utils/ids.d.ts +10 -0
  457. package/dist/utils/ids.js +8 -0
  458. package/dist/utils/ids.js.map +1 -0
  459. package/dist/utils/matcher.d.ts +5 -9
  460. package/dist/utils/matcher.js.map +1 -1
  461. package/dist/utils/memo.d.ts +12 -0
  462. package/dist/utils/memo.js +9 -0
  463. package/dist/utils/memo.js.map +1 -0
  464. package/dist/utils/number.d.ts +3 -4
  465. package/dist/utils/number.js.map +1 -1
  466. package/dist/utils/text.d.ts +20 -9
  467. package/dist/utils/text.js +17 -3
  468. package/dist/utils/text.js.map +1 -1
  469. package/dist/utils/time.d.ts +53 -61
  470. package/dist/utils/time.js +49 -45
  471. package/dist/utils/time.js.map +1 -1
  472. package/dist/utils/vnode.d.ts +8 -15
  473. package/dist/utils/vnode.js.map +1 -1
  474. package/package.json +6 -6
  475. package/dist/components/VToggle/VToggleItem.css +0 -2
@@ -1,11 +1,10 @@
1
1
  import e from "../VButton/VButtonGroup.js";
2
2
  import { arrowNavigate as t, navigableItems as n } from "../../utils/arrowNav.js";
3
- import { useAriaLabel as r } from "../../composables/useAriaLabel.js";
4
- import { toggleKey as i } from "./context.js";
5
- import { toggleValue as a } from "../../utils/array.js";
6
- import { createBlock as o, defineComponent as s, mergeModels as c, mergeProps as l, openBlock as u, provide as d, renderSlot as f, resolveDynamicComponent as p, unref as m, useModel as h, withCtx as g } from "vue";
3
+ import { toggleKey as r } from "./context.js";
4
+ import { toggleValue as i } from "../../utils/array.js";
5
+ import { computed as a, createBlock as o, defineComponent as s, mergeModels as c, openBlock as l, provide as u, ref as d, renderSlot as f, useModel as p, withCtx as m } from "vue";
7
6
  //#region src/components/VToggle/VToggle.vue?vue&type=script&setup=true&lang.ts
8
- var _ = /*@__PURE__*/ s({
7
+ var h = /*@__PURE__*/ s({
9
8
  __name: "VToggle",
10
9
  props: /*@__PURE__*/ c({
11
10
  multiple: {
@@ -16,18 +15,31 @@ var _ = /*@__PURE__*/ s({
16
15
  type: Boolean,
17
16
  default: !1
18
17
  },
19
- attached: {
18
+ detached: {
20
19
  type: Boolean,
21
- default: !0
20
+ default: !1
21
+ },
22
+ seamless: {
23
+ type: Boolean,
24
+ default: !1
22
25
  },
23
26
  orientation: { default: "horizontal" },
24
- variant: { default: "ghost" },
27
+ fullWidth: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ itemVariant: { default: "ghost" },
32
+ selectedVariant: { default: "solid" },
25
33
  tone: { default: "accent" },
26
34
  size: { default: "md" },
27
35
  compact: {
28
36
  type: Boolean,
29
37
  default: !1
30
38
  },
39
+ elevated: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
31
43
  disabled: {
32
44
  type: Boolean,
33
45
  default: !1
@@ -42,62 +54,84 @@ var _ = /*@__PURE__*/ s({
42
54
  modelModifiers: {}
43
55
  }),
44
56
  emits: ["update:modelValue"],
45
- setup(s) {
46
- let c = s, _ = h(s, "modelValue"), v = r(() => c.label);
47
- function y(e) {
48
- return c.multiple ? Array.isArray(_.value) && _.value.includes(e) : _.value === e;
57
+ setup(s, { expose: c }) {
58
+ let h = s, g = p(s, "modelValue");
59
+ function _(e) {
60
+ return h.multiple ? Array.isArray(g.value) && g.value.includes(e) : g.value === e;
49
61
  }
50
- function b(e) {
51
- if (c.multiple) {
52
- let t = Array.isArray(_.value) ? _.value : [];
53
- if (c.mandatory && t.length === 1 && t.includes(e)) return;
54
- _.value = a(t, e);
62
+ function v(e) {
63
+ if (h.multiple) {
64
+ let t = Array.isArray(g.value) ? g.value : [];
65
+ if (h.mandatory && t.length === 1 && t.includes(e)) return;
66
+ g.value = i(t, e);
55
67
  return;
56
68
  }
57
- if (_.value === e) {
58
- c.mandatory || (_.value = null);
69
+ if (g.value === e) {
70
+ h.mandatory || (g.value = null);
59
71
  return;
60
72
  }
61
- _.value = e;
73
+ g.value = e;
62
74
  }
63
- d(i, {
64
- isSelected: y,
65
- select: b,
66
- get variant() {
67
- return c.variant;
68
- },
69
- get tone() {
70
- return c.tone;
75
+ u(r, {
76
+ isSelected: _,
77
+ select: v,
78
+ get itemVariant() {
79
+ return h.itemVariant;
71
80
  },
72
- get size() {
73
- return c.size;
81
+ get selectedVariant() {
82
+ return h.selectedVariant;
74
83
  },
75
- get compact() {
76
- return c.compact;
77
- },
78
- get disabled() {
79
- return c.disabled;
84
+ get tone() {
85
+ return h.tone;
80
86
  },
81
87
  get selectedIconFilled() {
82
- return c.selectedIconFilled;
88
+ return h.selectedIconFilled;
83
89
  }
84
90
  });
85
- function x(e) {
91
+ function y(e) {
86
92
  let r = e.currentTarget;
87
- t(e, r, n(r, ".v-toggle-item:not(:disabled)"), { vertical: c.orientation === "vertical" });
93
+ t(e, r, () => n(r, ".v-toggle-item:not(:disabled)"), { vertical: h.orientation === "vertical" });
88
94
  }
89
- return (t, n) => (u(), o(p(s.attached ? e : "div"), l(s.attached ? { orientation: s.orientation } : { "data-orientation": s.orientation }, {
95
+ let b = d(null), x = a(() => b.value?.el ?? null);
96
+ return c({
97
+ focus: (e) => {
98
+ let t = x.value, n = ".v-toggle-item:not(:disabled, [aria-disabled=\"true\"])";
99
+ (t?.querySelector(`${n}[aria-pressed="true"]`) ?? t?.querySelector(n))?.focus(e);
100
+ },
101
+ el: x
102
+ }), (t, n) => (l(), o(e, {
103
+ ref_key: "groupRef",
104
+ ref: b,
90
105
  class: "v-toggle",
91
- role: "group",
92
- "aria-label": m(v),
93
- onKeydown: x
94
- }), {
95
- default: g(() => [f(t.$slots, "default")]),
106
+ orientation: s.orientation,
107
+ detached: s.detached,
108
+ seamless: s.seamless,
109
+ "full-width": s.fullWidth,
110
+ size: s.size,
111
+ compact: s.compact || void 0,
112
+ elevated: s.elevated || void 0,
113
+ disabled: s.disabled || void 0,
114
+ label: s.label,
115
+ "data-item-variant": s.itemVariant,
116
+ onKeydown: y
117
+ }, {
118
+ default: m(() => [f(t.$slots, "default")]),
96
119
  _: 3
97
- }, 16, ["aria-label"]));
120
+ }, 8, [
121
+ "orientation",
122
+ "detached",
123
+ "seamless",
124
+ "full-width",
125
+ "size",
126
+ "compact",
127
+ "elevated",
128
+ "disabled",
129
+ "label",
130
+ "data-item-variant"
131
+ ]));
98
132
  }
99
133
  });
100
134
  //#endregion
101
- export { _ as default };
135
+ export { h as default };
102
136
 
103
137
  //# sourceMappingURL=VToggle.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VToggle.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VToggle/VToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @core\n/**\n * A row of buttons where one — or several — stay pressed: choosing a text alignment,\n * a view, a set of filters. A single v-model holds what is chosen.\n *\n * Every item is a VButton, the selected one filled and the others quiet, and by\n * default the whole row is joined into one segmented control. Nothing about hovering,\n * focusing or disabling is written here: it all comes from VButton.\n *\n * The JavaScript covers the two things HTML has no answer for: what a click does to\n * the selection — toggling it off, or refusing to when the last choice may not be\n * given up — and moving between the items with the arrow keys.\n */\nimport { provide } from 'vue'\n\nimport VButtonGroup from '../VButton/VButtonGroup.vue'\nimport { toggleKey } from './context'\n\nimport { toggleValue } from '../../utils/array'\nimport { arrowNavigate, navigableItems } from '../../utils/arrowNav'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\n\nexport type ToggleValue = string | number\n/**\n * What the v-model holds, which follows `multiple`: one value or nothing when a single\n * choice is allowed, and a list of them when several are.\n */\nexport type ToggleModelValue = ToggleValue | ToggleValue[] | null\nexport type ToggleVariant = 'ghost' | 'outline'\nexport type ToggleTone = 'accent' | 'neutral' | 'danger'\nexport type ToggleSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\nexport type ToggleOrientation = 'horizontal' | 'vertical'\n\ninterface ToggleProps {\n /** Allows several items to be chosen at once, which makes the v-model a list. */\n multiple?: boolean\n /**\n * Refuses to let the last chosen item be given up, so that something is always\n * selected once something has been. It is a guard and nothing more: it selects\n * nothing on its own at the start.\n */\n mandatory?: boolean\n /**\n * Joins the items into one segmented control. Turning it off leaves them as separate\n * buttons with a gap between them.\n */\n attached?: boolean\n /** Whether the items run across the page or down it. */\n orientation?: ToggleOrientation\n /**\n * How the UNSELECTED items are drawn. A selected item is always filled, whatever\n * this says.\n */\n variant?: ToggleVariant\n /** The colour a selected item takes. The others stay neutral. */\n tone?: ToggleTone\n /** The height of the items, from the scale shared by every control. */\n size?: ToggleSize\n /** Takes 4px off the height of every item. */\n compact?: boolean\n /** Makes the whole group unusable. */\n disabled?: boolean\n /**\n * Draws the selected item's icon in its filled form, a common way of reinforcing\n * that it is the one in effect.\n */\n selectedIconFilled?: boolean\n /**\n * What screen readers announce for the group — \"Text alignment\", \"Filters\". It is\n * strongly recommended: no default could say what a group of buttons is for.\n */\n label?: string\n}\n\nconst props = withDefaults(defineProps<ToggleProps>(), {\n multiple: false,\n mandatory: false,\n attached: true,\n orientation: 'horizontal',\n variant: 'ghost',\n tone: 'accent',\n size: 'md',\n compact: false,\n disabled: false,\n selectedIconFilled: false,\n label: undefined,\n})\n\ndefineSlots<{\n /** The items of the group. */\n default(): unknown\n}>()\n\nconst model = defineModel<ToggleModelValue>({ default: null })\n\nconst ariaLabel = useAriaLabel(() => props.label)\n\nfunction isSelected(value: ToggleValue): boolean {\n return props.multiple\n ? Array.isArray(model.value) && model.value.includes(value)\n : model.value === value\n}\n\n/*\n * What a click does to the selection.\n *\n * With several choices allowed, the list is NEVER changed in place: each write\n * produces a new one. That is what makes a consumer's own watchers and computed values\n * notice; mutating the existing list would leave some of them silent. A model still\n * holding a single value, or nothing, is treated as an empty list rather than\n * refused.\n *\n * There is no check for the disabled state here, and none is needed: a disabled button\n * emits no click at all.\n */\nfunction select(value: ToggleValue) {\n if (props.multiple) {\n const current = Array.isArray(model.value) ? model.value : []\n if (props.mandatory && current.length === 1 && current.includes(value)) return\n model.value = toggleValue(current, value)\n return\n }\n if (model.value === value) {\n if (!props.mandatory) model.value = null\n return\n }\n model.value = value\n}\n\nprovide(toggleKey, {\n isSelected,\n select,\n get variant() {\n return props.variant\n },\n get tone() {\n return props.tone\n },\n get size() {\n return props.size\n },\n get compact() {\n return props.compact\n },\n get disabled() {\n return props.disabled\n },\n get selectedIconFilled() {\n return props.selectedIconFilled\n },\n})\n\n// @keyboard @a11y\n/*\n * The arrow keys, through the shared implementation in `utils/arrowNav`.\n *\n * Every visible item stays a stop in the tab order here — the VPagination model. The\n * single-stop treatment is reserved for the patterns that require it, a row of tabs or\n * a radio group, and a group of buttons is neither. Disabled items are really disabled\n * buttons, which the selector leaves out.\n *\n * The container is read from the event rather than kept as a reference, because the\n * root is rendered dynamically: a reference would hand back sometimes a plain element,\n * sometimes a component instance.\n */\nfunction onKeydown(event: KeyboardEvent) {\n const group = event.currentTarget as HTMLElement\n arrowNavigate(event, group, navigableItems(group, '.v-toggle-item:not(:disabled)'), {\n vertical: props.orientation === 'vertical',\n })\n}\n</script>\n\n<template>\n <!-- Joined, the row is a VButtonGroup, which merges the borders of its DIRECT\n button children — which is why an item renders the button as its own root, with\n no wrapper in between.\n\n The orientation is passed through ONE key or the other, never both: an\n attribute bound to `undefined` would still be forwarded and would overwrite the\n one VButtonGroup sets for itself. So the group receives a prop, and the plain\n container an attribute.\n\n The role is needed for the plain container, and simply repeats what\n VButtonGroup already sets when the row is joined. -->\n <component\n :is=\"attached ? VButtonGroup : 'div'\"\n v-bind=\"attached ? { orientation } : { 'data-orientation': orientation }\"\n class=\"v-toggle\"\n role=\"group\"\n :aria-label=\"ariaLabel\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * These rules are for the separated row alone, and the exclusion is what makes that\n * true: when the row is joined, the root carries BOTH classes at once. Without it,\n * the centring here and the stretching VButtonGroup declares would collide at equal\n * specificity, and the winner would be decided by whichever sheet the consumer's\n * bundler put last.\n */\n .v-toggle:not(.v-button-group) {\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-1);\n }\n\n .v-toggle:not(.v-button-group)[data-orientation='vertical'] {\n flex-direction: column;\n align-items: stretch;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EA,IAAM,IAAQ,GAmBR,IAAQ,EAA6B,GAAA,YAAkB,GAEvD,IAAY,QAAmB,EAAM,KAAK;EAEhD,SAAS,EAAW,GAA6B;GAC/C,OAAO,EAAM,WACT,MAAM,QAAQ,EAAM,KAAK,KAAK,EAAM,MAAM,SAAS,CAAK,IACxD,EAAM,UAAU;EACtB;EAcA,SAAS,EAAO,GAAoB;GAClC,IAAI,EAAM,UAAU;IAClB,IAAM,IAAU,MAAM,QAAQ,EAAM,KAAK,IAAI,EAAM,QAAQ,CAAC;IAC5D,IAAI,EAAM,aAAa,EAAQ,WAAW,KAAK,EAAQ,SAAS,CAAK,GAAG;IACxE,EAAM,QAAQ,EAAY,GAAS,CAAK;IACxC;GACF;GACA,IAAI,EAAM,UAAU,GAAO;IACzB,AAAK,EAAM,cAAW,EAAM,QAAQ;IACpC;GACF;GACA,EAAM,QAAQ;EAChB;EAEA,EAAQ,GAAW;GACjB;GACA;GACA,IAAI,UAAU;IACZ,OAAO,EAAM;GACf;GACA,IAAI,OAAO;IACT,OAAO,EAAM;GACf;GACA,IAAI,OAAO;IACT,OAAO,EAAM;GACf;GACA,IAAI,UAAU;IACZ,OAAO,EAAM;GACf;GACA,IAAI,WAAW;IACb,OAAO,EAAM;GACf;GACA,IAAI,qBAAqB;IACvB,OAAO,EAAM;GACf;EACF,CAAC;EAeD,SAAS,EAAU,GAAsB;GACvC,IAAM,IAAQ,EAAM;GACpB,EAAc,GAAO,GAAO,EAAe,GAAO,+BAA+B,GAAG,EAClF,UAAU,EAAM,gBAAgB,WAClC,CAAC;EACH;yBAeE,EASY,EARL,EAAA,WAAW,IAAY,KAAA,GAD9B,EAEU,EAOE,WAPM,EAAA,aAAK,EAAA,YAAW,IAAA,EAAA,oBAA2B,EAAA,YAAW,GAAA;GACtE,OAAM;GACN,MAAK;GACJ,cAAY,EAAA,CAAA;GACH;;oBAEF,CAAR,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VToggle.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VToggle/VToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @core\n/**\n * A row of buttons where one — or several — stay pressed: choosing a text alignment,\n * a view, a set of filters. A single v-model holds what is chosen.\n *\n * Every item is a VButton, the selected one drawn in the group's tone and the others\n * quiet. The row itself is a VButtonGroup, which is where the drawing lives: joining the\n * items or leaving them apart, the lines between them, the shared size and the shared\n * elevation are that component's, and the props for them are handed straight over.\n * Nothing about hovering, focusing or disabling is written here either: it all comes\n * from VButton.\n *\n * The JavaScript covers the two things HTML has no answer for: what a click does to\n * the selection — toggling it off, or refusing to when the last choice may not be\n * given up — and moving between the items with the arrow keys.\n */\nimport { computed, provide, ref } from 'vue'\n\nimport VButtonGroup from '../VButton/VButtonGroup.vue'\nimport { toggleKey } from './context'\n\nimport { toggleValue } from '../../utils/array'\nimport { arrowNavigate, navigableItems } from '../../utils/arrowNav'\n\nimport type { ItemValue } from '../../types'\n\n/**\n * What identifies an item. It is the design system's own `ItemValue`, re-exported\n * under the family's name so a consumer typing a toggle need not reach for another module.\n */\nexport type ToggleValue = ItemValue\n/**\n * What the v-model holds, which follows `multiple`: one value or nothing when a single\n * choice is allowed, and a list of them when several are.\n */\nexport type ToggleModelValue = ToggleValue | ToggleValue[] | null\nexport type ToggleItemVariant = 'ghost' | 'outline'\nexport type ToggleSelectedVariant = 'solid' | 'soft' | 'ghost'\nexport type ToggleTone = 'accent' | 'neutral' | 'danger'\nexport type ToggleSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\nexport type ToggleOrientation = 'horizontal' | 'vertical'\n\ninterface ToggleProps {\n /** Allows several items to be chosen at once, which makes the v-model a list. */\n multiple?: boolean\n /**\n * Refuses to let the last chosen item be given up, so that something is always\n * selected once something has been. It is a guard and nothing more: it selects\n * nothing on its own at the start.\n */\n mandatory?: boolean\n /**\n * Leaves the items as separate buttons with a gap between them. Left out, they are\n * joined into one segmented control.\n */\n detached?: boolean\n /**\n * Takes the lines out from between the joined items, so the row reads as one frame\n * rather than as segments. It has no effect under `detached`, where the items are\n * separate buttons already.\n */\n seamless?: boolean\n /** Whether the items run across the page or down it. */\n orientation?: ToggleOrientation\n /**\n * Stretches the row across the whole inline size of its parent, every item taking an equal\n * share of it, on the terms of VButtonGroup's own `fullWidth`.\n */\n fullWidth?: boolean\n /**\n * How the UNSELECTED items are drawn. What the selected one takes is `selectedVariant`.\n * It is named for the ITEMS because that is what it paints: on VTabs and VDataTable\n * `variant` names the decoration of the frame instead.\n */\n itemVariant?: ToggleItemVariant\n /**\n * How the SELECTED item is drawn, in the group's tone: filled, tinted, or the colour\n * of its text alone.\n */\n selectedVariant?: ToggleSelectedVariant\n /** The colour a selected item takes. The others stay neutral. */\n tone?: ToggleTone\n /** The height of the items, from the scale shared by every control. */\n size?: ToggleSize\n /** Takes 4px off the height of every item. */\n compact?: boolean\n /** Raises the row off the page, on the terms of VButtonGroup's own `elevated`. */\n elevated?: boolean\n /** Makes the whole group unusable. */\n disabled?: boolean\n /**\n * Draws the selected item's icon in its filled form, a common way of reinforcing\n * that it is the one in effect.\n */\n selectedIconFilled?: boolean\n /**\n * What screen readers announce for the group — \"Text alignment\", \"Filters\". It is\n * strongly recommended: no default could say what a group of buttons is for.\n */\n label?: string\n}\n\nconst props = withDefaults(defineProps<ToggleProps>(), {\n multiple: false,\n mandatory: false,\n detached: false,\n seamless: false,\n orientation: 'horizontal',\n fullWidth: false,\n itemVariant: 'ghost',\n selectedVariant: 'solid',\n tone: 'accent',\n size: 'md',\n compact: false,\n elevated: false,\n disabled: false,\n selectedIconFilled: false,\n label: undefined,\n})\n\ndefineSlots<{\n /** The items of the group. */\n default(): unknown\n}>()\n\n/**\n * What is selected, and its SHAPE follows `multiple`: a single value — or `null`, which is\n * where it starts — when one item may be chosen, and an array when several may. A null or\n * scalar value passed in `multiple` mode is read as an empty selection.\n *\n * The array is never mutated in place; each change is a new one, which is what wakes the\n * consumer's binding. Re-clicking the selected item deselects it unless `mandatory` is set.\n */\nconst model = defineModel<ToggleModelValue>({ default: null })\n\nfunction isSelected(value: ToggleValue): boolean {\n return props.multiple\n ? Array.isArray(model.value) && model.value.includes(value)\n : model.value === value\n}\n\n/*\n * What a click does to the selection.\n *\n * With several choices allowed, the list is NEVER changed in place: each write\n * produces a new one. That is what makes a consumer's own watchers and computed values\n * notice; mutating the existing list would leave some of them silent. A model still\n * holding a single value, or nothing, is treated as an empty list rather than\n * refused.\n *\n * There is no check for the disabled state here, and none is needed: a disabled button\n * emits no click at all.\n */\nfunction select(value: ToggleValue) {\n if (props.multiple) {\n const current = Array.isArray(model.value) ? model.value : []\n if (props.mandatory && current.length === 1 && current.includes(value)) return\n model.value = toggleValue(current, value)\n return\n }\n if (model.value === value) {\n if (!props.mandatory) model.value = null\n return\n }\n model.value = value\n}\n\nprovide(toggleKey, {\n isSelected,\n select,\n get itemVariant() {\n return props.itemVariant\n },\n get selectedVariant() {\n return props.selectedVariant\n },\n get tone() {\n return props.tone\n },\n get selectedIconFilled() {\n return props.selectedIconFilled\n },\n})\n\n// @keyboard @a11y\n/*\n * The arrow keys, through the shared implementation in `utils/arrowNav`.\n *\n * Every visible item stays a stop in the tab order here — the VPagination model. The\n * single-stop treatment is reserved for the patterns that require it, a row of tabs or\n * a radio group, and a group of buttons is neither. Disabled items are really disabled\n * buttons, which the selector leaves out.\n *\n * The container is read from the event rather than kept as a reference: the root is a\n * VButtonGroup, so a template ref would hand back its component instance rather than the\n * element the items are navigated inside.\n */\nfunction onKeydown(event: KeyboardEvent) {\n const group = event.currentTarget as HTMLElement\n arrowNavigate(event, group, () => navigableItems(group, '.v-toggle-item:not(:disabled)'), {\n vertical: props.orientation === 'vertical',\n })\n}\n\nconst groupRef = ref<InstanceType<typeof VButtonGroup> | null>(null)\nconst groupEl = computed(() => groupRef.value?.el ?? null)\n\n// The root is a VButtonGroup and the items come from the consumer's slot, so a template ref\n// on the toggle reaches no button. `focus` goes to the item that stands for the current\n// choice, the one a keyboard user would expect to resume from.\ndefineExpose({\n /**\n * Moves the focus to the selected item (the first of them when several are), or to the\n * first item that can take it when nothing is selected.\n */\n focus: (options?: FocusOptions) => {\n const group = groupEl.value\n const enabled = '.v-toggle-item:not(:disabled, [aria-disabled=\"true\"])'\n const item =\n group?.querySelector<HTMLElement>(`${enabled}[aria-pressed=\"true\"]`) ??\n group?.querySelector<HTMLElement>(enabled)\n item?.focus(options)\n },\n /** The `role=\"group\"` row, which is also where the consumer's attributes land. */\n el: groupEl,\n})\n</script>\n\n<template>\n <!-- The row is a VButtonGroup, which merges the borders of the buttons among its\n children — which is why an item renders the button as its own root, and why what\n may stand between the two is the wrappers a VTooltip, a VPopover or a VBadge put\n there, and nothing else. It brings the role, its accessible name and the orientation\n attribute with it, and of the props handed to it here it forwards the size, the density,\n the elevation and the disabled state to the buttons itself.\n\n The three booleans go down as `|| undefined`, the VPagination idiom: `undefined` is\n what means \"no opinion\" to a group, where `false` is an order every item would obey,\n and a toggle left at its defaults has no opinion to give. The size is always one, the\n toggle having a default of its own.\n\n The name is resolved by the group, which sees a consumer's `aria-label` or\n `aria-labelledby` too: they fall through this component onto it.\n\n `variant` is deliberately NOT among them, and neither is the tone: the group wins\n over a button that names its own variant, which would erase the one the selected\n item carries. Both stay with the items, through the context.\n\n `data-variant` is a plain attribute, and it is what tells the sheet an outline row\n from a ghost one — something the items cannot say for themselves, since the\n selected one carries its own variant rather than the row's. -->\n <VButtonGroup\n ref=\"groupRef\"\n class=\"v-toggle\"\n :orientation=\"orientation\"\n :detached=\"detached\"\n :seamless=\"seamless\"\n :full-width=\"fullWidth\"\n :size=\"size\"\n :compact=\"compact || undefined\"\n :elevated=\"elevated || undefined\"\n :disabled=\"disabled || undefined\"\n :label=\"label\"\n :data-item-variant=\"itemVariant\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </VButtonGroup>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * Both rules below are written for the two shapes an item can take, exactly as\n * VButtonGroup's own sheet is and for the same reason: a VTooltip, a VPopover or a\n * VBadge puts a wrapper between the row and the item, and a rule reaching for a direct\n * child alone would leave a gap in the frame around whichever item carries one. The\n * `:not(:where(.v-overlay))` guard weighs nothing and keeps a panel from passing for an\n * item; the pair is one specificity, so the arbitration with the group's seamless rules\n * holds on both shapes.\n *\n * The frame of an `outline` row, which only that row has: the colour its unselected\n * items already paint. They are drawn in the NEUTRAL tone, so this is what their\n * `--tone-border-soft` resolves to — naming that variable here instead would read the\n * SELECTED item's tone and tint one segment of the frame accent or red.\n *\n * It is a variable on the root rather than a value in the rule below because a\n * disabled segment greys, and VButton greys an outline border to a different token.\n * Nothing else declares it, so the two rules never arbitrate a border-color between\n * them.\n */\n .v-toggle[data-item-variant='outline'] {\n --toggle-frame: var(--vectis-color-border-strong);\n }\n\n .v-toggle[data-item-variant='outline'] > .v-toggle-item:is(:disabled, [aria-disabled='true']),\n .v-toggle[data-item-variant='outline']\n > :not(:where(.v-overlay, .v-button-group))\n .v-toggle-item:is(:disabled, [aria-disabled='true']):not(:where(.v-overlay *)) {\n --toggle-frame: var(--vectis-color-border);\n }\n\n /*\n * `soft` and `ghost` leave VButton's border transparent, which in an outline row\n * opens a gap in the frame for the whole width of the selected segment. Restoring it\n * on all four sides is what keeps the frame closed wherever the selection sits, in\n * either orientation and in RTL. It is not conditioned on `seamless`, and deliberately\n * so: the border is transparent whether the internal lines are drawn or not. Seamless,\n * the shared edges are cleared again by VButtonGroup's own (0,6,0) rules, which is why\n * they are written at that weight — a middle segment then keeps its top and bottom\n * alone.\n */\n .v-toggle[data-item-variant='outline']\n > .v-toggle-item[aria-pressed='true']:is([data-variant='soft'], [data-variant='ghost']),\n .v-toggle[data-item-variant='outline']\n > :not(:where(.v-overlay, .v-button-group))\n .v-toggle-item[aria-pressed='true']:is([data-variant='soft'], [data-variant='ghost']):not(\n :where(.v-overlay *)\n ) {\n border-color: var(--toggle-frame);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuGA,IAAM,IAAQ,GA+BR,IAAQ,EAA6B,GAAA,YAAkB;EAE7D,SAAS,EAAW,GAA6B;GAC/C,OAAO,EAAM,WACT,MAAM,QAAQ,EAAM,KAAK,KAAK,EAAM,MAAM,SAAS,CAAK,IACxD,EAAM,UAAU;EACtB;EAcA,SAAS,EAAO,GAAoB;GAClC,IAAI,EAAM,UAAU;IAClB,IAAM,IAAU,MAAM,QAAQ,EAAM,KAAK,IAAI,EAAM,QAAQ,CAAC;IAC5D,IAAI,EAAM,aAAa,EAAQ,WAAW,KAAK,EAAQ,SAAS,CAAK,GAAG;IACxE,EAAM,QAAQ,EAAY,GAAS,CAAK;IACxC;GACF;GACA,IAAI,EAAM,UAAU,GAAO;IACzB,AAAK,EAAM,cAAW,EAAM,QAAQ;IACpC;GACF;GACA,EAAM,QAAQ;EAChB;EAEA,EAAQ,GAAW;GACjB;GACA;GACA,IAAI,cAAc;IAChB,OAAO,EAAM;GACf;GACA,IAAI,kBAAkB;IACpB,OAAO,EAAM;GACf;GACA,IAAI,OAAO;IACT,OAAO,EAAM;GACf;GACA,IAAI,qBAAqB;IACvB,OAAO,EAAM;GACf;EACF,CAAC;EAeD,SAAS,EAAU,GAAsB;GACvC,IAAM,IAAQ,EAAM;GACpB,EAAc,GAAO,SAAa,EAAe,GAAO,+BAA+B,GAAG,EACxF,UAAU,EAAM,gBAAgB,WAClC,CAAC;EACH;EAEA,IAAM,IAAW,EAA8C,IAAI,GAC7D,IAAU,QAAe,EAAS,OAAO,MAAM,IAAI;SAKzD,EAAa;GAKX,QAAQ,MAA2B;IACjC,IAAM,IAAQ,EAAQ,OAChB,IAAU;IAIhB,CAFE,GAAO,cAA2B,GAAG,EAAQ,sBAAsB,KACnE,GAAO,cAA2B,CAAO,EAAA,EACrC,MAAM,CAAO;GACrB;GAEA,IAAI;EACN,CAAC,mBA0BC,EAgBe,GAAA;YAfT;GAAJ,KAAI;GACJ,OAAM;GACL,aAAa,EAAA;GACb,UAAU,EAAA;GACV,UAAU,EAAA;GACV,cAAY,EAAA;GACZ,MAAM,EAAA;GACN,SAAS,EAAA,WAAW,KAAA;GACpB,UAAU,EAAA,YAAY,KAAA;GACtB,UAAU,EAAA,YAAY,KAAA;GACtB,OAAO,EAAA;GACP,qBAAmB,EAAA;GACV;;oBAEF,CAAR,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -9,7 +9,19 @@ interface ToggleItemProps {
9
9
  /** The visible label. The default slot replaces it. */
10
10
  label?: string;
11
11
  /** An icon before the label: an icon name, or an explicit render. */
12
- icon?: IconSource;
12
+ iconStart?: IconSource;
13
+ /**
14
+ * An icon after the label. It is NOT switched to its filled form by the group's
15
+ * `selectedIconFilled`, which names the icon standing for the item rather than one
16
+ * trailing it; `iconFilled` fills it for good.
17
+ */
18
+ iconEnd?: IconSource;
19
+ /**
20
+ * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis), whether
21
+ * the item is selected or not. The group's `selectedIconFilled` still fills the start icon
22
+ * of the selected item when this is left out.
23
+ */
24
+ iconFilled?: boolean;
13
25
  /**
14
26
  * Makes this item unusable: it no longer responds, the arrow keys skip over it, and
15
27
  * it greys out through the colour tokens.
@@ -23,7 +35,9 @@ type __VLS_Slots = {
23
35
  declare const __VLS_base: import('vue').DefineComponent<ToggleItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToggleItemProps> & Readonly<{}>, {
24
36
  label: string;
25
37
  disabled: boolean;
26
- icon: IconSource;
38
+ iconStart: IconSource;
39
+ iconEnd: IconSource;
40
+ iconFilled: boolean;
27
41
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
42
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
43
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,4 @@
1
- import './VToggleItem.css';
2
1
  import e from "./VToggleItem.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
4
2
  //#region src/components/VToggle/VToggleItem.vue
5
3
  var t = e;
6
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"VToggleItem.js","names":[],"sources":["../../../src/components/VToggle/VToggleItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One item of a VToggle. It IS a VButton — the colour, the size, the focus ring and\n * the disabled state all come from there — and what this component adds is the one\n * attribute saying whether the button is currently pressed.\n *\n * That button is also this component's own root element, with nothing wrapped around\n * it, which is what lets the group merge the borders of neighbouring items: it only\n * joins its DIRECT children.\n *\n * Used outside a VToggle it still renders perfectly well, simply never selected, the\n * same way a tab does outside its row.\n */\nimport { computed, inject, useSlots } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { toggleKey } from './context'\nimport type { ToggleValue } from './VToggle.vue'\n\ninterface ToggleItemProps {\n /**\n * What choosing this item means. It is what the group's v-model holds when the item\n * is selected, and it must be unique within the group.\n */\n value: ToggleValue\n /** The visible label. The default slot replaces it. */\n label?: string\n /** An icon before the label: an icon name, or an explicit render. */\n icon?: IconSource\n /**\n * Makes this item unusable: it no longer responds, the arrow keys skip over it, and\n * it greys out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ToggleItemProps>(), {\n label: undefined,\n icon: undefined,\n disabled: false,\n})\n\ndefineSlots<{\n /** The content of the item, replacing the `label` prop. */\n default?(): unknown\n}>()\n\nconst slots = useSlots()\nconst toggle = inject(toggleKey, null)\n\nconst selected = computed(() => toggle != null && toggle.isSelected(props.value))\n\n/** An icon and no label at all: the item becomes a square, like a VIconButton. */\nconst iconOnly = computed(() => Boolean(props.icon) && !props.label && !slots.default)\n</script>\n\n<template>\n <!-- The pressed state is always rendered, false included: it is its PRESENCE that\n makes a screen reader announce the button as one that stays pressed, and an\n attribute appearing only when true would leave the unselected items announced\n as ordinary buttons.\n\n The filled form is asked of the icon directly, because VButton's own icon\n options have no effect on an icon handed to it through a slot. -->\n <VButton\n class=\"v-toggle-item\"\n :aria-pressed=\"selected ? 'true' : 'false'\"\n :variant=\"selected ? 'solid' : (toggle?.variant ?? 'ghost')\"\n :tone=\"selected ? (toggle?.tone ?? 'accent') : 'neutral'\"\n :size=\"toggle?.size ?? 'md'\"\n :compact=\"toggle?.compact ?? false\"\n :disabled=\"disabled || toggle?.disabled\"\n :data-icon-only=\"iconOnly ? '' : undefined\"\n @click=\"toggle?.select(value)\"\n >\n <template v-if=\"icon\" #start>\n <VIcon v-bind=\"iconProps(icon)\" :filled=\"selected && (toggle?.selectedIconFilled ?? false)\" />\n </template>\n <slot v-if=\"!iconOnly\">{{ label }}</slot>\n </VButton>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * An item reduced to its icon becomes a square, like a VIconButton. The selector is\n * qualified by an attribute VButton always renders, which is what makes it beat that\n * button's own padding whatever order the two sheets end up in.\n */\n .v-toggle-item[data-size][data-icon-only] {\n padding-inline: 0;\n min-inline-size: var(--control-height);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VToggleItem.js","names":[],"sources":["../../../src/components/VToggle/VToggleItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One item of a VToggle. It IS a VButton — the colour, the size, the focus ring and\n * the disabled state all come from there — and what this component adds is the one\n * attribute saying whether the button is currently pressed.\n *\n * That button is also this component's own root element, with nothing wrapped around\n * it, which is what lets the group merge the borders of neighbouring items: it only\n * joins its DIRECT children. It is also what brings the size, the density, the elevation\n * and a row-wide disabled state here with nothing asked for: the VButtonGroup the VToggle\n * renders hands them to every button it contains, this one included.\n *\n * Used outside a VToggle it renders as a plain neutral VButton that is never pressed: the\n * way it is drawn is the group's decision, and there is no group to take it.\n */\nimport { computed, inject } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { toggleKey } from './context'\nimport type { ToggleValue } from './VToggle.vue'\n\ninterface ToggleItemProps {\n /**\n * What choosing this item means. It is what the group's v-model holds when the item\n * is selected, and it must be unique within the group.\n */\n value: ToggleValue\n /** The visible label. The default slot replaces it. */\n label?: string\n /** An icon before the label: an icon name, or an explicit render. */\n iconStart?: IconSource\n /**\n * An icon after the label. It is NOT switched to its filled form by the group's\n * `selectedIconFilled`, which names the icon standing for the item rather than one\n * trailing it; `iconFilled` fills it for good.\n */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis), whether\n * the item is selected or not. The group's `selectedIconFilled` still fills the start icon\n * of the selected item when this is left out.\n */\n iconFilled?: boolean\n /**\n * Makes this item unusable: it no longer responds, the arrow keys skip over it, and\n * it greys out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ToggleItemProps>(), {\n label: undefined,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n disabled: false,\n})\n\nconst slots = defineSlots<{\n /** The content of the item, replacing the `label` prop. */\n default?(): unknown\n}>()\n\nconst toggle = inject(toggleKey, null)\n\nconst selected = computed(() => toggle != null && toggle.isSelected(props.value))\n\n// TRAP — a function read by the template, never a `computed`: `slots` is not reactive, so a\n// computed would keep its first answer while a slot behind a `v-if` comes and goes.\n/**\n * An icon, on either side, and no label at all: the item becomes a square, like a VIconButton.\n * The same definition as VChip's, and the square itself is VButton's `[data-icon-only]` rule.\n */\nfunction iconOnly() {\n return !props.label && !slots.default && Boolean(props.iconStart || props.iconEnd)\n}\n</script>\n\n<template>\n <!-- The pressed state is always rendered, false included: it is its PRESENCE that\n makes a screen reader announce the button as one that stays pressed, and an\n attribute appearing only when true would leave the unselected items announced\n as ordinary buttons.\n\n The filled form is asked of the icon directly, because VButton's own icon\n options have no effect on an icon handed to it through a slot. -->\n <VButton\n class=\"v-toggle-item\"\n :aria-pressed=\"selected ? 'true' : 'false'\"\n :variant=\"selected && toggle ? toggle.selectedVariant : toggle?.itemVariant\"\n :tone=\"selected && toggle ? toggle.tone : 'neutral'\"\n :disabled=\"disabled\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n @click=\"toggle?.select(value)\"\n >\n <template v-if=\"iconStart\" #start>\n <VIcon\n v-bind=\"iconProps(iconStart)\"\n :filled=\"iconFilled || (selected && toggle?.selectedIconFilled)\"\n />\n </template>\n <template v-if=\"iconEnd\" #end>\n <VIcon v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </template>\n <slot v-if=\"!iconOnly()\">{{ label }}</slot>\n </VButton>\n</template>\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
- import e from "../VIcon/VIcon.js";
2
- import { iconProps as t } from "../VIcon/iconProps.js";
1
+ import { iconProps as e } from "../VIcon/iconProps.js";
2
+ import t from "../VIcon/VIcon.js";
3
3
  import n from "../VButton/VButton.js";
4
4
  import { toggleKey as r } from "./context.js";
5
5
  import { computed as i, createBlock as a, createCommentVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, inject as d, mergeProps as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, useSlots as _, withCtx as v } from "vue";
@@ -9,37 +9,45 @@ var y = /*@__PURE__*/ u({
9
9
  props: {
10
10
  value: {},
11
11
  label: { default: void 0 },
12
- icon: { default: void 0 },
12
+ iconStart: { default: void 0 },
13
+ iconEnd: { default: void 0 },
14
+ iconFilled: {
15
+ type: Boolean,
16
+ default: !1
17
+ },
13
18
  disabled: {
14
19
  type: Boolean,
15
20
  default: !1
16
21
  }
17
22
  },
18
23
  setup(u) {
19
- let y = u, b = _(), x = d(r, null), S = i(() => x != null && x.isSelected(y.value)), C = i(() => !!y.icon && !y.label && !b.default);
24
+ let y = u, b = _(), x = d(r, null), S = i(() => x != null && x.isSelected(y.value));
25
+ function C() {
26
+ return !y.label && !b.default && !!(y.iconStart || y.iconEnd);
27
+ }
20
28
  return (r, i) => (p(), a(n, {
21
29
  class: "v-toggle-item",
22
30
  "aria-pressed": S.value ? "true" : "false",
23
- variant: S.value ? "solid" : g(x)?.variant ?? "ghost",
24
- tone: S.value ? g(x)?.tone ?? "accent" : "neutral",
25
- size: g(x)?.size ?? "md",
26
- compact: g(x)?.compact ?? !1,
27
- disabled: u.disabled || g(x)?.disabled,
28
- "data-icon-only": C.value ? "" : void 0,
31
+ variant: S.value && g(x) ? g(x).selectedVariant : g(x)?.itemVariant,
32
+ tone: S.value && g(x) ? g(x).tone : "neutral",
33
+ disabled: u.disabled,
34
+ "data-icon-only": C() ? "" : void 0,
29
35
  onClick: i[0] ||= (e) => g(x)?.select(u.value)
30
36
  }, s({
31
- default: v(() => [C.value ? o("", !0) : m(r.$slots, "default", {}, () => [c(h(u.label), 1)], void 0, 0)]),
37
+ default: v(() => [C() ? o("", !0) : m(r.$slots, "default", {}, () => [c(h(u.label), 1)], void 0, 0)]),
32
38
  _: 2
33
- }, [u.icon ? {
39
+ }, [u.iconStart ? {
34
40
  name: "start",
35
- fn: v(() => [l(e, f(g(t)(u.icon), { filled: S.value && (g(x)?.selectedIconFilled ?? !1) }), null, 16, ["filled"])]),
41
+ fn: v(() => [l(t, f(g(e)(u.iconStart), { filled: u.iconFilled || S.value && g(x)?.selectedIconFilled }), null, 16, ["filled"])]),
36
42
  key: "0"
43
+ } : void 0, u.iconEnd ? {
44
+ name: "end",
45
+ fn: v(() => [l(t, f(g(e)(u.iconEnd), { filled: u.iconFilled }), null, 16, ["filled"])]),
46
+ key: "1"
37
47
  } : void 0]), 1032, [
38
48
  "aria-pressed",
39
49
  "variant",
40
50
  "tone",
41
- "size",
42
- "compact",
43
51
  "disabled",
44
52
  "data-icon-only"
45
53
  ]));
@@ -1 +1 @@
1
- {"version":3,"file":"VToggleItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VToggle/VToggleItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One item of a VToggle. It IS a VButton — the colour, the size, the focus ring and\n * the disabled state all come from there — and what this component adds is the one\n * attribute saying whether the button is currently pressed.\n *\n * That button is also this component's own root element, with nothing wrapped around\n * it, which is what lets the group merge the borders of neighbouring items: it only\n * joins its DIRECT children.\n *\n * Used outside a VToggle it still renders perfectly well, simply never selected, the\n * same way a tab does outside its row.\n */\nimport { computed, inject, useSlots } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { toggleKey } from './context'\nimport type { ToggleValue } from './VToggle.vue'\n\ninterface ToggleItemProps {\n /**\n * What choosing this item means. It is what the group's v-model holds when the item\n * is selected, and it must be unique within the group.\n */\n value: ToggleValue\n /** The visible label. The default slot replaces it. */\n label?: string\n /** An icon before the label: an icon name, or an explicit render. */\n icon?: IconSource\n /**\n * Makes this item unusable: it no longer responds, the arrow keys skip over it, and\n * it greys out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ToggleItemProps>(), {\n label: undefined,\n icon: undefined,\n disabled: false,\n})\n\ndefineSlots<{\n /** The content of the item, replacing the `label` prop. */\n default?(): unknown\n}>()\n\nconst slots = useSlots()\nconst toggle = inject(toggleKey, null)\n\nconst selected = computed(() => toggle != null && toggle.isSelected(props.value))\n\n/** An icon and no label at all: the item becomes a square, like a VIconButton. */\nconst iconOnly = computed(() => Boolean(props.icon) && !props.label && !slots.default)\n</script>\n\n<template>\n <!-- The pressed state is always rendered, false included: it is its PRESENCE that\n makes a screen reader announce the button as one that stays pressed, and an\n attribute appearing only when true would leave the unselected items announced\n as ordinary buttons.\n\n The filled form is asked of the icon directly, because VButton's own icon\n options have no effect on an icon handed to it through a slot. -->\n <VButton\n class=\"v-toggle-item\"\n :aria-pressed=\"selected ? 'true' : 'false'\"\n :variant=\"selected ? 'solid' : (toggle?.variant ?? 'ghost')\"\n :tone=\"selected ? (toggle?.tone ?? 'accent') : 'neutral'\"\n :size=\"toggle?.size ?? 'md'\"\n :compact=\"toggle?.compact ?? false\"\n :disabled=\"disabled || toggle?.disabled\"\n :data-icon-only=\"iconOnly ? '' : undefined\"\n @click=\"toggle?.select(value)\"\n >\n <template v-if=\"icon\" #start>\n <VIcon v-bind=\"iconProps(icon)\" :filled=\"selected && (toggle?.selectedIconFilled ?? false)\" />\n </template>\n <slot v-if=\"!iconOnly\">{{ label }}</slot>\n </VButton>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * An item reduced to its icon becomes a square, like a VIconButton. The selector is\n * qualified by an attribute VButton always renders, which is what makes it beat that\n * button's own padding whatever order the two sheets end up in.\n */\n .v-toggle-item[data-size][data-icon-only] {\n padding-inline: 0;\n min-inline-size: var(--control-height);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAuCA,IAAM,IAAQ,GAWR,IAAQ,EAAS,GACjB,IAAS,EAAO,GAAW,IAAI,GAE/B,IAAW,QAAe,KAAU,QAAQ,EAAO,WAAW,EAAM,KAAK,CAAC,GAG1E,IAAW,QAAe,EAAQ,EAAM,QAAS,CAAC,EAAM,SAAS,CAAC,EAAM,OAAO;yBAWnF,EAeU,GAAA;GAdR,OAAM;GACL,gBAAc,EAAA,QAAQ,SAAA;GACtB,SAAS,EAAA,QAAQ,UAAc,EAAA,CAAA,CAAM,EAAE,WAAO;GAC9C,MAAM,EAAA,QAAY,EAAA,CAAA,CAAM,EAAE,QAAI,WAAA;GAC9B,MAAM,EAAA,CAAA,CAAM,EAAE,QAAI;GAClB,SAAS,EAAA,CAAA,CAAM,EAAE,WAAO;GACxB,UAAU,EAAA,YAAY,EAAA,CAAA,CAAM,EAAE;GAC9B,kBAAgB,EAAA,QAAQ,KAAQ,KAAA;GAChC,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,CAAA,CAAM,EAAE,OAAO,EAAA,KAAK;;oBAMtB,CADO,EAAA,QAAkB,EAAA,IAAA,EAAA,IAA/B,EAAyC,EAAA,QAAA,WAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,GAAA,KAAA,GAAA,CAAA,CAAA,CAAA;;MAHf,EAAA,OAAA;SAAO;eACyE,CAA9F,EAA8F,GAA9F,EAAe,EAA+E,CAAA,CAAtE,CAAC,EAAA,IAAI,GAAA,EAAI,QAAQ,EAAA,UAAa,EAAA,CAAA,CAAM,EAAE,sBAAkB,IAAA,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VToggleItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VToggle/VToggleItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One item of a VToggle. It IS a VButton — the colour, the size, the focus ring and\n * the disabled state all come from there — and what this component adds is the one\n * attribute saying whether the button is currently pressed.\n *\n * That button is also this component's own root element, with nothing wrapped around\n * it, which is what lets the group merge the borders of neighbouring items: it only\n * joins its DIRECT children. It is also what brings the size, the density, the elevation\n * and a row-wide disabled state here with nothing asked for: the VButtonGroup the VToggle\n * renders hands them to every button it contains, this one included.\n *\n * Used outside a VToggle it renders as a plain neutral VButton that is never pressed: the\n * way it is drawn is the group's decision, and there is no group to take it.\n */\nimport { computed, inject } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { toggleKey } from './context'\nimport type { ToggleValue } from './VToggle.vue'\n\ninterface ToggleItemProps {\n /**\n * What choosing this item means. It is what the group's v-model holds when the item\n * is selected, and it must be unique within the group.\n */\n value: ToggleValue\n /** The visible label. The default slot replaces it. */\n label?: string\n /** An icon before the label: an icon name, or an explicit render. */\n iconStart?: IconSource\n /**\n * An icon after the label. It is NOT switched to its filled form by the group's\n * `selectedIconFilled`, which names the icon standing for the item rather than one\n * trailing it; `iconFilled` fills it for good.\n */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis), whether\n * the item is selected or not. The group's `selectedIconFilled` still fills the start icon\n * of the selected item when this is left out.\n */\n iconFilled?: boolean\n /**\n * Makes this item unusable: it no longer responds, the arrow keys skip over it, and\n * it greys out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ToggleItemProps>(), {\n label: undefined,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n disabled: false,\n})\n\nconst slots = defineSlots<{\n /** The content of the item, replacing the `label` prop. */\n default?(): unknown\n}>()\n\nconst toggle = inject(toggleKey, null)\n\nconst selected = computed(() => toggle != null && toggle.isSelected(props.value))\n\n// TRAP — a function read by the template, never a `computed`: `slots` is not reactive, so a\n// computed would keep its first answer while a slot behind a `v-if` comes and goes.\n/**\n * An icon, on either side, and no label at all: the item becomes a square, like a VIconButton.\n * The same definition as VChip's, and the square itself is VButton's `[data-icon-only]` rule.\n */\nfunction iconOnly() {\n return !props.label && !slots.default && Boolean(props.iconStart || props.iconEnd)\n}\n</script>\n\n<template>\n <!-- The pressed state is always rendered, false included: it is its PRESENCE that\n makes a screen reader announce the button as one that stays pressed, and an\n attribute appearing only when true would leave the unselected items announced\n as ordinary buttons.\n\n The filled form is asked of the icon directly, because VButton's own icon\n options have no effect on an icon handed to it through a slot. -->\n <VButton\n class=\"v-toggle-item\"\n :aria-pressed=\"selected ? 'true' : 'false'\"\n :variant=\"selected && toggle ? toggle.selectedVariant : toggle?.itemVariant\"\n :tone=\"selected && toggle ? toggle.tone : 'neutral'\"\n :disabled=\"disabled\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n @click=\"toggle?.select(value)\"\n >\n <template v-if=\"iconStart\" #start>\n <VIcon\n v-bind=\"iconProps(iconStart)\"\n :filled=\"iconFilled || (selected && toggle?.selectedIconFilled)\"\n />\n </template>\n <template v-if=\"iconEnd\" #end>\n <VIcon v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </template>\n <slot v-if=\"!iconOnly()\">{{ label }}</slot>\n </VButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAqDA,IAAM,IAAQ,GAQR,IAAQ,EAAA,GAKR,IAAS,EAAO,GAAW,IAAI,GAE/B,IAAW,QAAe,KAAU,QAAQ,EAAO,WAAW,EAAM,KAAK,CAAC;EAQhF,SAAS,IAAW;GAClB,OAAO,CAAC,EAAM,SAAS,CAAC,EAAM,WAAW,GAAQ,EAAM,aAAa,EAAM;EAC5E;yBAWE,EAmBU,GAAA;GAlBR,OAAM;GACL,gBAAc,EAAA,QAAQ,SAAA;GACtB,SAAS,EAAA,SAAY,EAAA,CAAA,IAAS,EAAA,CAAA,CAAM,CAAC,kBAAkB,EAAA,CAAA,CAAM,EAAE;GAC/D,MAAM,EAAA,SAAY,EAAA,CAAA,IAAS,EAAA,CAAA,CAAM,CAAC,OAAI;GACtC,UAAU,EAAA;GACV,kBAAgB,EAAQ,IAAA,KAAU,KAAA;GAClC,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,CAAA,CAAM,EAAE,OAAO,EAAA,KAAK;;oBAStB,CAEO,EAAQ,IAAY,EAAA,IAAA,EAAA,IAAjC,EAA2C,EAAA,QAAA,WAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,GAAA,KAAA,GAAA,CAAA,CAAA,CAAA;;MATjB,EAAA,YAAA;SAAY;eAIxB,CAHF,EAGE,GAHF,EACU,EAER,CAAA,CAFiB,CAAC,EAAA,SAAS,GAAA,EAC1B,QAAQ,EAAA,cAAe,EAAA,SAAY,EAAA,CAAA,CAAM,EAAE,mBAAA,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,CAAA,CAAA;;cAGhC,EAAA,UAAA;SAAU;eACkC,CAA1D,EAA0D,GAA1D,EAAe,EAA2C,CAAA,CAAlC,CAAC,EAAA,OAAO,GAAA,EAAI,QAAQ,EAAA,WAAU,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,CAAA,CAAA"}
@@ -1,36 +1,16 @@
1
1
  import { InjectionKey } from 'vue';
2
- import { ToggleSize, ToggleTone, ToggleValue, ToggleVariant } from './VToggle.js';
3
- /**
4
- * What a VToggle passes down to the items inside it. Everything is exposed through
5
- * getters, which is what keeps the group's props reactive on the other side of the
6
- * injection.
7
- *
8
- * There is no identifier and no registry here, unlike VTabs: nothing in this pattern
9
- * points at anything else, and whether an item is selected is a plain comparison of
10
- * values — so the server and the browser reach the same answer with nothing exchanged.
11
- *
12
- * That comparison is offered as a QUESTION rather than as the current value, because
13
- * with several choices allowed it is no longer a simple equality, and only the group
14
- * knows which of the two it is doing.
15
- *
16
- * The size travels through here rather than through CSS inheritance, as it does in
17
- * VAccordion, because each item renders a button that declares its own size on itself.
18
- */
2
+ import { ToggleSelectedVariant, ToggleTone, ToggleValue, ToggleItemVariant } from './VToggle.js';
19
3
  export interface ToggleContext {
20
4
  /** Whether the item carrying this value is currently selected. */
21
5
  isSelected: (value: ToggleValue) => boolean;
22
6
  /** Reports that an item was clicked; the group decides what it does to the selection. */
23
7
  select: (value: ToggleValue) => void;
24
8
  /** How the unselected items are drawn. */
25
- readonly variant: ToggleVariant;
9
+ readonly itemVariant: ToggleItemVariant;
10
+ /** How the selected item is drawn. */
11
+ readonly selectedVariant: ToggleSelectedVariant;
26
12
  /** The colour a selected item takes. */
27
13
  readonly tone: ToggleTone;
28
- /** The height of the items. */
29
- readonly size: ToggleSize;
30
- /** The reduced density. */
31
- readonly compact: boolean;
32
- /** Whether the whole group is unusable. */
33
- readonly disabled: boolean;
34
14
  /** Whether the selected item draws its icon filled. */
35
15
  readonly selectedIconFilled: boolean;
36
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":[],"sources":["../../../src/components/VToggle/context.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\nimport type { ToggleSize, ToggleTone, ToggleValue, ToggleVariant } from './VToggle.vue'\n\n/**\n * What a VToggle passes down to the items inside it. Everything is exposed through\n * getters, which is what keeps the group's props reactive on the other side of the\n * injection.\n *\n * There is no identifier and no registry here, unlike VTabs: nothing in this pattern\n * points at anything else, and whether an item is selected is a plain comparison of\n * values — so the server and the browser reach the same answer with nothing exchanged.\n *\n * That comparison is offered as a QUESTION rather than as the current value, because\n * with several choices allowed it is no longer a simple equality, and only the group\n * knows which of the two it is doing.\n *\n * The size travels through here rather than through CSS inheritance, as it does in\n * VAccordion, because each item renders a button that declares its own size on itself.\n */\nexport interface ToggleContext {\n /** Whether the item carrying this value is currently selected. */\n isSelected: (value: ToggleValue) => boolean\n /** Reports that an item was clicked; the group decides what it does to the selection. */\n select: (value: ToggleValue) => void\n /** How the unselected items are drawn. */\n readonly variant: ToggleVariant\n /** The colour a selected item takes. */\n readonly tone: ToggleTone\n /** The height of the items. */\n readonly size: ToggleSize\n /** The reduced density. */\n readonly compact: boolean\n /** Whether the whole group is unusable. */\n readonly disabled: boolean\n /** Whether the selected item draws its icon filled. */\n readonly selectedIconFilled: boolean\n}\n\nexport const toggleKey: InjectionKey<ToggleContext> = Symbol('v-toggle')\n"],"mappings":";AAuCA,IAAa,IAAyC,OAAO,UAAU"}
1
+ {"version":3,"file":"context.js","names":[],"sources":["../../../src/components/VToggle/context.ts"],"sourcesContent":["/**\n * What a VToggle passes down to the items inside it. Everything is exposed through\n * getters, which is what keeps the group's props reactive on the other side of the\n * injection.\n *\n * There is no identifier and no registry here, unlike VTabs: nothing in this pattern\n * points at anything else, and whether an item is selected is a plain comparison of\n * values — so the server and the browser reach the same answer with nothing exchanged.\n *\n * That comparison is offered as a QUESTION rather than as the current value, because\n * with several choices allowed it is no longer a simple equality, and only the group\n * knows which of the two it is doing.\n *\n * What is here is what SELECTION decides, and nothing else. The size, the density, the\n * elevation and the disabled state are the row's appearance, so they travel down the\n * VButtonGroup the group renders and reach each item's button through `buttonGroupKey`\n * instead. The variant and the tone stay here because they are read per item: which of\n * the two variants applies, and whether the tone or a quiet neutral is used, is decided\n * by whether that item is the selected one.\n */\n\nimport type { InjectionKey } from 'vue'\n\nimport type {\n ToggleSelectedVariant,\n ToggleTone,\n ToggleValue,\n ToggleItemVariant,\n} from './VToggle.vue'\n\nexport interface ToggleContext {\n /** Whether the item carrying this value is currently selected. */\n isSelected: (value: ToggleValue) => boolean\n /** Reports that an item was clicked; the group decides what it does to the selection. */\n select: (value: ToggleValue) => void\n /** How the unselected items are drawn. */\n readonly itemVariant: ToggleItemVariant\n /** How the selected item is drawn. */\n readonly selectedVariant: ToggleSelectedVariant\n /** The colour a selected item takes. */\n readonly tone: ToggleTone\n /** Whether the selected item draws its icon filled. */\n readonly selectedIconFilled: boolean\n}\n\nexport const toggleKey: InjectionKey<ToggleContext> = Symbol('v-toggle')\n"],"mappings":";AA6CA,IAAa,IAAyC,OAAO,UAAU"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-tooltip{anchor-name:--tooltip-anchor;anchor-scope:--tooltip-anchor;align-items:center;display:inline-flex}.v-popover-panel.v-tooltip-panel{width:max-content;max-width:min(18rem, calc(100vw - var(--vectis-space-8)));padding:var(--vectis-space-1) var(--vectis-space-2);background:var(--vectis-color-surface-inverse);color:var(--vectis-color-text-on-inverse);border-radius:var(--vectis-radius-sm);box-shadow:var(--vectis-shadow-sm);font-family:var(--vectis-text-family);font-size:var(--vectis-text-caption-size);line-height:var(--vectis-text-caption-leading);border:none}}
2
+ @layer vectis.components{.v-tooltip{anchor-name:--tooltip-anchor;anchor-scope:--tooltip-anchor;align-items:center;display:inline-flex}.v-popover-panel.v-tooltip-panel{width:max-content;max-width:min(18rem, calc(100vw - var(--vectis-space-8)));padding:var(--vectis-space-1) var(--vectis-space-2);background:var(--vectis-color-surface-inverse);color:var(--vectis-color-text-on-inverse);border-radius:min(var(--vectis-radius-interactive), calc(.5lh + var(--vectis-space-1)));box-shadow:var(--vectis-shadow-sm);font-family:var(--vectis-text-family);font-size:var(--vectis-text-caption-size);line-height:var(--vectis-text-caption-leading);border:none}}
@@ -1,31 +1,9 @@
1
- /**
2
- * A short explanation appearing beside an element when the pointer rests on it or
3
- * when it takes keyboard focus. It is built on VPopover, in the mode where nothing
4
- * closes by itself, since a tooltip has its own rules about when to appear and when
5
- * to go.
6
- *
7
- * Those rules are why there is JavaScript here at all: HTML has no stable way to say
8
- * "show this after a short delay on hover or focus" — the proposal for it is still
9
- * experimental — so the component handles the delay, the pointer, the focus, the press
10
- * on the trigger, and Escape, which must dismiss a tooltip without moving the focus
11
- * (WCAG 1.4.13).
12
- *
13
- * There are four ways out and each covers a case the others do not: the pointer leaves,
14
- * the focus leaves, Escape is pressed, or the trigger is PRESSED — that last one for a
15
- * trigger which opens a panel, where the tooltip would otherwise stand over what it just
16
- * opened. The template says which browser makes it necessary.
17
- *
18
- * The positioning is pure CSS and needs no generated identifier: the wrapper names
19
- * itself as the anchor and confines that name to its own subtree. The confinement is
20
- * essential — a visible panel sits in the top layer, which anchor resolution treats
21
- * as coming after the whole document, so without it every tooltip on the page would
22
- * attach to the last wrapper carrying the name.
23
- *
24
- * The wrapper stays here rather than being delegated to VPopover's trigger slot,
25
- * because a tooltip trigger is not a button that opens a panel — it would then toggle
26
- * on click — but an element the panel DESCRIBES.
27
- */
28
- type Placement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';
1
+ /** Which side of the element the tooltip appears on. */
2
+ export type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';
3
+ /** What the described element has to carry: the link to the tooltip that describes it. */
4
+ export type TooltipTriggerProps = {
5
+ 'aria-describedby': string;
6
+ };
29
7
  interface TooltipProps {
30
8
  /** What the tooltip says. The `#content` slot replaces it when both are given. */
31
9
  text?: string;
@@ -33,7 +11,7 @@ interface TooltipProps {
33
11
  * Which side of the element the tooltip appears on. The browser flips it to the
34
12
  * opposite side by itself when there is not enough room.
35
13
  */
36
- placement?: Placement;
14
+ placement?: TooltipPlacement;
37
15
  /**
38
16
  * How long the pointer must rest on the element before the tooltip appears, in
39
17
  * milliseconds. Keyboard focus opens it at once — the intent is not in doubt there
@@ -48,9 +26,7 @@ type __VLS_Slots = {
48
26
  * something that can take focus, or keyboard users will never see the tooltip.
49
27
  */
50
28
  default(props: {
51
- triggerProps: {
52
- 'aria-describedby': string;
53
- };
29
+ triggerProps: TooltipTriggerProps;
54
30
  }): unknown;
55
31
  /**
56
32
  * Content richer than a plain string: formatting, a keyboard shortcut, an icon. It
@@ -63,7 +39,7 @@ type __VLS_Slots = {
63
39
  };
64
40
  declare const __VLS_base: import('vue').DefineComponent<TooltipProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TooltipProps> & Readonly<{}>, {
65
41
  text: string;
66
- placement: Placement;
42
+ placement: TooltipPlacement;
67
43
  delay: number;
68
44
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
69
45
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1 +1 @@
1
- {"version":3,"file":"VTooltip.js","names":[],"sources":["../../../src/components/VTooltip/VTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, useId } from 'vue'\n\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useTimer } from '../../composables/useTimer'\n\n/**\n * A short explanation appearing beside an element when the pointer rests on it or\n * when it takes keyboard focus. It is built on VPopover, in the mode where nothing\n * closes by itself, since a tooltip has its own rules about when to appear and when\n * to go.\n *\n * Those rules are why there is JavaScript here at all: HTML has no stable way to say\n * \"show this after a short delay on hover or focus\" — the proposal for it is still\n * experimental — so the component handles the delay, the pointer, the focus, the press\n * on the trigger, and Escape, which must dismiss a tooltip without moving the focus\n * (WCAG 1.4.13).\n *\n * There are four ways out and each covers a case the others do not: the pointer leaves,\n * the focus leaves, Escape is pressed, or the trigger is PRESSED — that last one for a\n * trigger which opens a panel, where the tooltip would otherwise stand over what it just\n * opened. The template says which browser makes it necessary.\n *\n * The positioning is pure CSS and needs no generated identifier: the wrapper names\n * itself as the anchor and confines that name to its own subtree. The confinement is\n * essential — a visible panel sits in the top layer, which anchor resolution treats\n * as coming after the whole document, so without it every tooltip on the page would\n * attach to the last wrapper carrying the name.\n *\n * The wrapper stays here rather than being delegated to VPopover's trigger slot,\n * because a tooltip trigger is not a button that opens a panel — it would then toggle\n * on click — but an element the panel DESCRIBES.\n */\ntype Placement =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right'\n\ninterface TooltipProps {\n /** What the tooltip says. The `#content` slot replaces it when both are given. */\n text?: string\n /**\n * Which side of the element the tooltip appears on. The browser flips it to the\n * opposite side by itself when there is not enough room.\n */\n placement?: Placement\n /**\n * How long the pointer must rest on the element before the tooltip appears, in\n * milliseconds. Keyboard focus opens it at once — the intent is not in doubt there\n * — and a delay of 0 disables the wait entirely.\n */\n delay?: number\n}\n\nconst props = withDefaults(defineProps<TooltipProps>(), {\n text: undefined,\n placement: 'top',\n delay: 300,\n})\n\ndefineSlots<{\n /**\n * The element the tooltip describes. Bind the `triggerProps` it receives onto it —\n * that is what ties the two together for assistive technology — and make sure it is\n * something that can take focus, or keyboard users will never see the tooltip.\n */\n default(props: { triggerProps: { 'aria-describedby': string } }): unknown\n /**\n * Content richer than a plain string: formatting, a keyboard shortcut, an icon. It\n * must stay NON-interactive. The tooltip closes as soon as the pointer leaves the\n * element, so a link or a button inside could never be reached, and the description\n * is flattened to plain text for screen readers anyway. Content one can interact\n * with belongs in a panel that stays open, such as VMenu.\n */\n content?(): unknown\n}>()\n\nconst tooltipId = useId()\n// @a11y\n/*\n * The panel is opened and closed by calling it directly rather than through\n * `v-model:open`. Keyboard focus has to open it SYNCHRONOUSLY, and a model would go\n * through VPopover's watcher, hence through a tick. There is nothing lost either way:\n * a tooltip publishes no open state anyone needs to read.\n *\n * Calling twice is harmless — the guards for that live upstream in usePopover.\n */\nconst popoverRef = ref<InstanceType<typeof VPopover> | null>(null)\n\n// The delay before appearing. useTimer is what makes it re-armable and cancels it\n// when the component goes away.\nconst timer = useTimer()\n\n// @core\nfunction show(immediate = false) {\n // A delay of 0 runs the callback synchronously — the design system's convention,\n // and what lets keyboard focus share this code path without waiting a tick.\n timer.start(() => popoverRef.value?.show(), immediate ? 0 : props.delay)\n}\n\nfunction hide() {\n timer.cancel()\n popoverRef.value?.hide()\n}\n\n// @keyboard @a11y — Escape must dismiss a tooltip opened by hover or focus without\n// moving the focus anywhere (WCAG 1.4.13): content appearing on hover has to be\n// dismissible, for a magnifier user whose view it may be covering.\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') hide()\n}\n</script>\n\n<template>\n <!--\n TRAP — `pointerdown` is what stops a tooltip from surviving the click that acted on its\n trigger, and the case it really covers is a trigger that OPENS something: a menu, a\n dialog, a popover of any kind. The tooltip would then stand over what it opened, and\n none of the other three exits applies — the pointer has not left, the focus has not\n moved out on its own, and nobody pressed Escape.\n\n It looks redundant on Chromium and Firefox, where a click focuses the button and the\n panel then takes the focus, which fires this wrapper's `focusout`. Safari on macOS does\n NOT focus a button on click, so nothing leaves the wrapper and the tooltip stays up,\n behind the panel, until the pointer moves. Delete this line and that is the bug that\n comes back, on one browser only.\n\n It is `pointerdown` and not `click`, so the tooltip is gone BEFORE the panel appears\n rather than overlapping it for a frame. Keyboard activation sends no `pointerdown` at\n all, and needs none: focus moving into the panel closes the tooltip everywhere.\n -->\n <span\n class=\"v-tooltip\"\n @pointerenter=\"show()\"\n @pointerleave=\"hide\"\n @pointerdown=\"hide\"\n @focusin=\"show(true)\"\n @focusout=\"hide\"\n @keydown=\"onKeydown\"\n >\n <slot :trigger-props=\"{ 'aria-describedby': tooltipId }\" />\n <VPopover\n :id=\"tooltipId\"\n ref=\"popoverRef\"\n mode=\"manual\"\n anchor=\"--tooltip-anchor\"\n :placement=\"placement\"\n :surface=\"false\"\n role=\"tooltip\"\n class=\"v-tooltip-panel\"\n >\n <slot name=\"content\">{{ text }}</slot>\n </VPopover>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The wrapper is FLEX and not inline-block, for the same reason as `.v-badge-host`:\n both are inline-level atomic boxes, so the surrounding text flows identically, but\n an inline-block establishes an inline formatting context for the trigger — which\n then sits on a line box and adds the strut's descender to the wrapper's height.\n That is not only a couple of pixels in a flex row: this wrapper is also the ANCHOR,\n so the panel is offset by them too.\n\n `align-items: center` covers what is left. A wrapper stretched by a parent in\n `align-items: stretch` would otherwise stretch the trigger with it, where the\n inline-block form left it at its natural height. */\n .v-tooltip {\n display: inline-flex;\n align-items: center;\n anchor-name: --tooltip-anchor;\n /* Confining the name to this subtree is indispensable: a visible panel moves to\n the top layer, where anchor resolution treats it as coming after the whole\n document, so without it every tooltip would attach to the LAST wrapper carrying\n this name. */\n anchor-scope: --tooltip-anchor;\n }\n\n /* The anchoring itself comes from VPopover, through the `anchor` prop.\n\n The selector is written as a compound of two classes that both land on this same\n element, even though the panel class it guards against — `.v-panel` — is never\n present here, VTooltip asking for no surface. It is written that way so it cannot\n break the day that prop changes: at equal specificity the winner between two\n component sheets is decided by the order the consumer's bundler happens to\n produce, which is nobody's decision. */\n .v-popover-panel.v-tooltip-panel {\n width: max-content;\n max-width: min(18rem, calc(100vw - var(--vectis-space-8)));\n padding: var(--vectis-space-1) var(--vectis-space-2);\n /* The tooltip is painted against the page rather than with it: a dark surface in\n both themes, darker still in the dark one, so it reads as an overlay whatever\n it happens to cover. */\n background: var(--vectis-color-surface-inverse);\n color: var(--vectis-color-text-on-inverse);\n border: none;\n border-radius: var(--vectis-radius-sm);\n box-shadow: var(--vectis-shadow-sm);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n line-height: var(--vectis-text-caption-leading);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VTooltip.js","names":[],"sources":["../../../src/components/VTooltip/VTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A short explanation appearing beside an element on hover or keyboard focus. A VPopover in\n * `mode=\"manual\"`, a tooltip having its own rules about when to appear and when to go.\n *\n * Those rules are why there is JS here at all: HTML has no stable way to say \"show this\n * after a delay on hover or focus\", so the component handles the delay, the pointer, the\n * focus, a press on the trigger, and Escape — which must dismiss without moving the focus\n * (WCAG 1.4.13).\n *\n * Four ways out, each covering what the others do not: the pointer leaves, the focus leaves,\n * Escape, or the trigger is PRESSED — that last for a trigger opening a panel, where the\n * tooltip would otherwise stand over what it just opened.\n *\n * Positioning is pure CSS with no generated id: the wrapper names itself as the anchor and\n * confines that name to its own subtree. The confinement is essential — a shown panel moves\n * to the top layer, which anchor resolution treats as coming after the whole document, so\n * without it every tooltip would attach to the last wrapper named on the page.\n *\n * The wrapper stays HERE rather than going through VPopover's `#trigger`: a tooltip trigger\n * is not a `popovertarget` invoker, which would toggle on click, but an element the panel\n * DESCRIBES.\n */\n\nimport { ref, useId } from 'vue'\n\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useTimer } from '../../composables/useTimer'\nimport { isKeyboardFocus } from '../../utils/focus'\n\n/** Which side of the element the tooltip appears on. */\nexport type TooltipPlacement =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right'\n\n/** What the described element has to carry: the link to the tooltip that describes it. */\nexport type TooltipTriggerProps = {\n 'aria-describedby': string\n}\n\ninterface TooltipProps {\n /** What the tooltip says. The `#content` slot replaces it when both are given. */\n text?: string\n /**\n * Which side of the element the tooltip appears on. The browser flips it to the\n * opposite side by itself when there is not enough room.\n */\n placement?: TooltipPlacement\n /**\n * How long the pointer must rest on the element before the tooltip appears, in\n * milliseconds. Keyboard focus opens it at once — the intent is not in doubt there\n * — and a delay of 0 disables the wait entirely.\n */\n delay?: number\n}\n\nconst props = withDefaults(defineProps<TooltipProps>(), {\n text: undefined,\n placement: 'top',\n delay: 300,\n})\n\ndefineSlots<{\n /**\n * The element the tooltip describes. Bind the `triggerProps` it receives onto it —\n * that is what ties the two together for assistive technology — and make sure it is\n * something that can take focus, or keyboard users will never see the tooltip.\n */\n default(props: { triggerProps: TooltipTriggerProps }): unknown\n /**\n * Content richer than a plain string: formatting, a keyboard shortcut, an icon. It\n * must stay NON-interactive. The tooltip closes as soon as the pointer leaves the\n * element, so a link or a button inside could never be reached, and the description\n * is flattened to plain text for screen readers anyway. Content one can interact\n * with belongs in a panel that stays open, such as VMenu.\n */\n content?(): unknown\n}>()\n\nconst tooltipId = useId()\n// @a11y\n/*\n * The panel is opened and closed by calling it directly rather than through\n * `v-model:open`. Keyboard focus has to open it SYNCHRONOUSLY, and a model would go\n * through VPopover's watcher, hence through a tick. There is nothing lost either way:\n * a tooltip publishes no open state anyone needs to read.\n *\n * Calling twice is harmless — the guards for that live upstream in usePopover.\n */\nconst popoverRef = ref<InstanceType<typeof VPopover> | null>(null)\n\n// The delay before appearing. useTimer is what makes it re-armable and cancels it\n// when the component goes away.\nconst timer = useTimer()\n\n// @core\nfunction show(immediate = false) {\n // A delay of 0 runs the callback synchronously — the design system's convention,\n // and what lets keyboard focus share this code path without waiting a tick.\n timer.start(() => popoverRef.value?.show(), immediate ? 0 : props.delay)\n}\n\nfunction hide() {\n timer.cancel()\n popoverRef.value?.close()\n}\n\n// @a11y\n/*\n * The tooltip belongs to the KEYBOARD focus, and a `focusin` says the focus arrived, never\n * how it got there. Three ways in are not a Tab: a click, which the pointer already covers\n * and which the `pointerdown` above has just closed the tooltip for; a tap, which no browser\n * agrees on; and a `focus()` from code — the one a closing panel hands back to the button\n * that opened it, which would raise a tooltip over a page the reader is no longer pointing\n * at. `:focus-visible` is the browser's own answer to the question, the same one VMenu asks\n * to decide where a menu's focus lands.\n *\n * The consequence to know: a tooltip never opens on a tap. Content a touch reader needs\n * cannot live here alone.\n */\nfunction onFocusIn(event: FocusEvent) {\n if (isKeyboardFocus(event.target)) show(true)\n}\n\n// @keyboard @a11y — Escape must dismiss a tooltip opened by hover or focus without\n// moving the focus anywhere (WCAG 1.4.13): content appearing on hover has to be\n// dismissible, for a magnifier user whose view it may be covering.\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') hide()\n}\n</script>\n\n<template>\n <!--\n TRAP — `pointerdown` is what stops a tooltip from surviving the click that acted on its\n trigger, and the case it really covers is a trigger that OPENS something: a menu, a\n dialog, a popover of any kind. The tooltip would then stand over what it opened, and\n none of the other three exits applies — the pointer has not left, the focus has not\n moved out on its own, and nobody pressed Escape.\n\n It looks redundant on Chromium and Firefox, where a click focuses the button and the\n panel then takes the focus, which fires this wrapper's `focusout`. Safari on macOS does\n NOT focus a button on click, so nothing leaves the wrapper and the tooltip stays up,\n behind the panel, until the pointer moves. Delete this line and that is the bug that\n comes back, on one browser only.\n\n It is `pointerdown` and not `click`, so the tooltip is gone BEFORE the panel appears\n rather than overlapping it for a frame. Keyboard activation sends no `pointerdown` at\n all, and needs none: focus moving into the panel closes the tooltip everywhere.\n -->\n <span\n class=\"v-tooltip\"\n @pointerenter=\"show()\"\n @pointerleave=\"hide\"\n @pointerdown=\"hide\"\n @focusin=\"onFocusIn\"\n @focusout=\"hide\"\n @keydown=\"onKeydown\"\n >\n <slot :trigger-props=\"{ 'aria-describedby': tooltipId }\" />\n <VPopover\n :id=\"tooltipId\"\n ref=\"popoverRef\"\n mode=\"manual\"\n anchor=\"--tooltip-anchor\"\n :placement=\"placement\"\n bare\n role=\"tooltip\"\n class=\"v-tooltip-panel\"\n >\n <slot name=\"content\">{{ text }}</slot>\n </VPopover>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The wrapper is FLEX and not inline-block, for the same reason as `.v-badge-host`:\n both are inline-level atomic boxes, so the surrounding text flows identically, but\n an inline-block establishes an inline formatting context for the trigger — which\n then sits on a line box and adds the strut's descender to the wrapper's height.\n That is not only a couple of pixels in a flex row: this wrapper is also the ANCHOR,\n so the panel is offset by them too.\n\n `align-items: center` covers what is left. A wrapper stretched by a parent in\n `align-items: stretch` would otherwise stretch the trigger with it, where the\n inline-block form left it at its natural height. */\n .v-tooltip {\n display: inline-flex;\n align-items: center;\n anchor-name: --tooltip-anchor;\n /* Confining the name to this subtree is indispensable: a visible panel moves to\n the top layer, where anchor resolution treats it as coming after the whole\n document, so without it every tooltip would attach to the LAST wrapper carrying\n this name. */\n anchor-scope: --tooltip-anchor;\n }\n\n /* The anchoring itself comes from VPopover, through the `anchor` prop.\n\n The selector is written as a compound of two classes that both land on this same\n element, even though the panel class it guards against — `.v-panel` — is never\n present here, VTooltip asking for a `bare` panel. It is written that way so it cannot\n break the day that prop changes: at equal specificity the winner between two\n component sheets is decided by the order the consumer's bundler happens to\n produce, which is nobody's decision. */\n .v-popover-panel.v-tooltip-panel {\n width: max-content;\n max-width: min(18rem, calc(100vw - var(--vectis-space-8)));\n padding: var(--vectis-space-1) var(--vectis-space-2);\n /* The tooltip is painted against the page rather than with it: a dark surface in\n both themes, darker still in the dark one, so it reads as an overlay whatever\n it happens to cover. */\n background: var(--vectis-color-surface-inverse);\n color: var(--vectis-color-text-on-inverse);\n border: none;\n /* The control radius capped at half the height of a ONE-line bubble, the row recipe\n of VSideNavigationItem: a tooltip wraps past its max-width, and under a pill\n override a two-line bubble would otherwise round to half of its own height. */\n border-radius: min(var(--vectis-radius-interactive), calc(0.5lh + var(--vectis-space-1)));\n box-shadow: var(--vectis-shadow-sm);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n line-height: var(--vectis-text-caption-leading);\n }\n}\n</style>\n"],"mappings":""}