vectis-ui 0.8.1 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/README.md +3 -3
  2. package/dist/components/VAccordion/VAccordionItem.d.ts +4 -6
  3. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +21 -19
  5. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/VAccordion/context.d.ts +6 -1
  7. package/dist/components/VAccordion/context.js.map +1 -1
  8. package/dist/components/VAvatar/VAvatar.css +1 -1
  9. package/dist/components/VAvatar/VAvatar.d.ts +5 -3
  10. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  11. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +53 -39
  12. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/VAvatar/VAvatarGroup.d.ts +12 -3
  14. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  15. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -20
  16. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/VAvatar/context.d.ts +2 -2
  18. package/dist/components/VAvatar/context.js.map +1 -1
  19. package/dist/components/VBadge/VBadge.css +1 -1
  20. package/dist/components/VBadge/VBadge.d.ts +8 -4
  21. package/dist/components/VBadge/VBadge.js.map +1 -1
  22. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +6 -3
  23. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +5 -4
  25. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  26. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +8 -3
  27. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VButton/VButton.css +1 -1
  29. package/dist/components/VButton/VButton.d.ts +4 -1
  30. package/dist/components/VButton/VButton.js.map +1 -1
  31. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +8 -7
  32. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  34. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendar.css +1 -1
  36. package/dist/components/VCalendar/VCalendar.d.ts +15 -6
  37. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  38. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +144 -126
  39. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  41. package/dist/components/VCalendar/VCalendarEvent.d.ts +1 -1
  42. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  43. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  45. package/dist/components/VCalendar/VCalendarMonth.d.ts +1 -1
  46. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  47. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +99 -90
  48. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  50. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  51. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  52. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +256 -246
  53. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  55. package/dist/components/VCalendar/VCalendarYear.d.ts +8 -1
  56. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  57. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +39 -32
  58. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/VCalendar/color.d.ts +1 -1
  60. package/dist/components/VCalendar/color.js.map +1 -1
  61. package/dist/components/VCalendar/edgeStep.d.ts +3 -3
  62. package/dist/components/VCalendar/edgeStep.js +5 -0
  63. package/dist/components/VCalendar/edgeStep.js.map +1 -1
  64. package/dist/components/VCalendar/gesture.d.ts +10 -9
  65. package/dist/components/VCalendar/gesture.js +60 -45
  66. package/dist/components/VCalendar/gesture.js.map +1 -1
  67. package/dist/components/VCalendar/keyboard.d.ts +22 -5
  68. package/dist/components/VCalendar/keyboard.js +17 -16
  69. package/dist/components/VCalendar/keyboard.js.map +1 -1
  70. package/dist/components/VCalendar/layout.d.ts +47 -37
  71. package/dist/components/VCalendar/layout.js +47 -37
  72. package/dist/components/VCalendar/layout.js.map +1 -1
  73. package/dist/components/VCalendar/timeGrid.d.ts +4 -4
  74. package/dist/components/VCalendar/timeGrid.js +6 -6
  75. package/dist/components/VCalendar/timeGrid.js.map +1 -1
  76. package/dist/components/VCalendar/types.d.ts +5 -5
  77. package/dist/components/VCarousel/VCarousel.css +1 -1
  78. package/dist/components/VCarousel/VCarousel.d.ts +59 -38
  79. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  80. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +161 -132
  81. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/VCarousel/VCarouselItem.d.ts +1 -1
  83. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  84. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/VCarousel/context.d.ts +1 -1
  86. package/dist/components/VCarousel/context.js.map +1 -1
  87. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  88. package/dist/components/VCheckbox/VCheckbox.d.ts +2 -2
  89. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  90. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +10 -8
  91. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/components/VChip/VChip.css +1 -1
  93. package/dist/components/VChip/VChip.d.ts +7 -2
  94. package/dist/components/VChip/VChip.js.map +1 -1
  95. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +69 -55
  96. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  97. package/dist/components/VCombobox/VCombobox.css +1 -1
  98. package/dist/components/VCombobox/VCombobox.d.ts +50 -36
  99. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  100. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +167 -161
  101. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  103. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  104. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  105. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/components/VCombobox/infiniteScroll.d.ts +12 -3
  107. package/dist/components/VCombobox/infiniteScroll.js +18 -12
  108. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +55 -24
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +192 -155
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.css +1 -1
  115. package/dist/components/VDateInput/VDateInput.d.ts +15 -12
  116. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +180 -160
  118. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/VDateInput/mask.d.ts +95 -0
  120. package/dist/components/VDateInput/mask.js +118 -0
  121. package/dist/components/VDateInput/mask.js.map +1 -0
  122. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  123. package/dist/components/VDatePicker/VDatePicker.d.ts +6 -5
  124. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  125. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +204 -173
  126. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/components/VDatePicker/keyboard.d.ts +3 -3
  128. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  129. package/dist/components/VDatePicker/names.d.ts +34 -0
  130. package/dist/components/VDatePicker/names.js +42 -0
  131. package/dist/components/VDatePicker/names.js.map +1 -0
  132. package/dist/components/VDialog/VDialog.css +1 -1
  133. package/dist/components/VDialog/VDialog.d.ts +2 -2
  134. package/dist/components/VDialog/VDialog.js.map +1 -1
  135. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +63 -41
  136. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/VFileInput/VFileInput.d.ts +38 -25
  138. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  139. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +74 -71
  140. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  141. package/dist/components/VFileInput/truncate.d.ts +4 -4
  142. package/dist/components/VFileInput/truncate.js.map +1 -1
  143. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  144. package/dist/components/VFilePicker/VFilePicker.d.ts +54 -37
  145. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  146. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +152 -135
  147. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  148. package/dist/components/VFilePicker/fileKind.d.ts +2 -2
  149. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  150. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  151. package/dist/components/VHotkeys/VHotkeys.d.ts +10 -8
  152. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  153. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +22 -20
  154. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/VHotkeys/platform.d.ts +9 -7
  156. package/dist/components/VHotkeys/platform.js +41 -30
  157. package/dist/components/VHotkeys/platform.js.map +1 -1
  158. package/dist/components/VIcon/VIcon.css +1 -1
  159. package/dist/components/VIcon/VIcon.d.ts +6 -6
  160. package/dist/components/VIcon/VIcon.js.map +1 -1
  161. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/VIcon/iconProps.d.ts +4 -4
  163. package/dist/components/VIcon/iconProps.js.map +1 -1
  164. package/dist/components/VIcon/icons/index.d.ts +1 -1
  165. package/dist/components/VIcon/icons/index.js.map +1 -1
  166. package/dist/components/VIcon/icons/names.d.ts +1 -1
  167. package/dist/components/VIcon/icons/names.js.map +1 -1
  168. package/dist/components/VIcon/resolver.d.ts +3 -3
  169. package/dist/components/VIcon/resolver.js +23 -20
  170. package/dist/components/VIcon/resolver.js.map +1 -1
  171. package/dist/components/VIcon/types.d.ts +4 -4
  172. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  173. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  174. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VInput/VInput.d.ts +16 -8
  176. package/dist/components/VInput/VInput.js.map +1 -1
  177. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +22 -16
  178. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/VInput/VInputGroup.css +1 -1
  180. package/dist/components/VInput/VInputGroup.js.map +1 -1
  181. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +43 -28
  182. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  183. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  184. package/dist/components/VInputOTP/VInputOTP.d.ts +3 -3
  185. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  186. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +152 -85
  187. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  188. package/dist/components/VMenu/VMenu.d.ts +4 -4
  189. package/dist/components/VMenu/VMenu.js.map +1 -1
  190. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/VMenu/VMenuGroup.css +1 -1
  192. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  193. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +18 -11
  194. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/VMenu/VMenuItem.css +1 -1
  196. package/dist/components/VMenu/VMenuItem.d.ts +6 -6
  197. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  198. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +83 -69
  199. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/components/VMenu/VMenuPanel.css +1 -1
  201. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  202. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  203. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +56 -55
  204. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/components/VMenu/context.d.ts +2 -2
  206. package/dist/components/VMenu/context.js.map +1 -1
  207. package/dist/components/VPagination/VPagination.css +1 -1
  208. package/dist/components/VPagination/VPagination.d.ts +31 -9
  209. package/dist/components/VPagination/VPagination.js.map +1 -1
  210. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +82 -52
  211. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VPopover/VPopover.css +1 -1
  213. package/dist/components/VPopover/VPopover.d.ts +1 -1
  214. package/dist/components/VPopover/VPopover.js.map +1 -1
  215. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  217. package/dist/components/VProgressCircular/VProgressCircular.d.ts +12 -7
  218. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  219. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  221. package/dist/components/VProgressLinear/VProgressLinear.d.ts +15 -10
  222. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  223. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  224. package/dist/components/VRadio/VRadio.css +1 -1
  225. package/dist/components/VRadio/VRadio.js.map +1 -1
  226. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +3 -3
  227. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VSeparator/VSeparator.d.ts +1 -1
  229. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  230. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/components/VSideNavigation/VSideNavigation.d.ts +2 -2
  232. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  233. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +1 -1
  234. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  236. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  237. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  238. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  239. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  240. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +12 -13
  241. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  242. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +87 -68
  243. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  244. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  245. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +10 -7
  246. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  247. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +5 -5
  248. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/components/VSlider/VSlider.css +1 -1
  250. package/dist/components/VSlider/VSlider.d.ts +21 -7
  251. package/dist/components/VSlider/VSlider.js.map +1 -1
  252. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +159 -140
  253. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  255. package/dist/components/VSnackbar/VSnackbar.d.ts +4 -4
  256. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  257. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +85 -59
  258. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  259. package/dist/components/VSnackbar/state.d.ts +7 -7
  260. package/dist/components/VSnackbar/state.js +13 -11
  261. package/dist/components/VSnackbar/state.js.map +1 -1
  262. package/dist/components/VSpinner/VSpinner.css +1 -1
  263. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  264. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  265. package/dist/components/VSwitch/VSwitch.css +1 -1
  266. package/dist/components/VSwitch/VSwitch.d.ts +1 -1
  267. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  268. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +4 -4
  269. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/components/VTabs/VTab.css +1 -1
  271. package/dist/components/VTabs/VTab.d.ts +4 -0
  272. package/dist/components/VTabs/VTab.js.map +1 -1
  273. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +9 -8
  274. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  275. package/dist/components/VTabs/VTabs.css +1 -1
  276. package/dist/components/VTabs/VTabs.d.ts +17 -7
  277. package/dist/components/VTabs/VTabs.js.map +1 -1
  278. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +84 -77
  279. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VTextarea/VTextarea.d.ts +8 -8
  281. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  282. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +71 -69
  283. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  284. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  285. package/dist/components/VTimeInput/VTimeInput.d.ts +21 -12
  286. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  287. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +230 -206
  288. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VTimeInput/search.d.ts +17 -2
  290. package/dist/components/VTimeInput/search.js +19 -9
  291. package/dist/components/VTimeInput/search.js.map +1 -1
  292. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  293. package/dist/components/VTimePicker/VTimePicker.d.ts +8 -7
  294. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  295. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +128 -106
  296. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  297. package/dist/components/VTimePicker/limits.d.ts +11 -4
  298. package/dist/components/VTimePicker/limits.js +3 -2
  299. package/dist/components/VTimePicker/limits.js.map +1 -1
  300. package/dist/components/VToast/VToast.css +1 -1
  301. package/dist/components/VToast/VToast.js.map +1 -1
  302. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +33 -37
  303. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  304. package/dist/components/VToast/VToaster.js.map +1 -1
  305. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +91 -61
  306. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  307. package/dist/components/VToast/state.d.ts +8 -6
  308. package/dist/components/VToast/state.js +15 -13
  309. package/dist/components/VToast/state.js.map +1 -1
  310. package/dist/components/VToggle/VToggle.css +1 -1
  311. package/dist/components/VToggle/VToggle.d.ts +9 -4
  312. package/dist/components/VToggle/VToggle.js.map +1 -1
  313. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +2 -1
  314. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/components/VToggle/VToggleItem.d.ts +4 -0
  316. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  317. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +5 -5
  318. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/components/VTooltip/VTooltip.css +1 -1
  320. package/dist/components/VTooltip/VTooltip.d.ts +17 -10
  321. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  322. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +46 -26
  323. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  324. package/dist/components/VTypography/VTypography.css +1 -1
  325. package/dist/components/VTypography/VTypography.d.ts +6 -4
  326. package/dist/components/VTypography/VTypography.js.map +1 -1
  327. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  328. package/dist/composables/useAriaLabel.js +1 -1
  329. package/dist/composables/useAriaLabel.js.map +1 -1
  330. package/dist/composables/useClearable.d.ts +2 -2
  331. package/dist/composables/useClearable.js.map +1 -1
  332. package/dist/composables/useDetailsOpen.d.ts +3 -3
  333. package/dist/composables/useDetailsOpen.js +14 -12
  334. package/dist/composables/useDetailsOpen.js.map +1 -1
  335. package/dist/composables/useFieldIds.d.ts +2 -1
  336. package/dist/composables/useFieldIds.js +6 -5
  337. package/dist/composables/useFieldIds.js.map +1 -1
  338. package/dist/composables/useFieldPanel.d.ts +2 -2
  339. package/dist/composables/useFieldPanel.js +47 -37
  340. package/dist/composables/useFieldPanel.js.map +1 -1
  341. package/dist/composables/useFileDrop.js +3 -3
  342. package/dist/composables/useFileDrop.js.map +1 -1
  343. package/dist/composables/useFileField.d.ts +1 -1
  344. package/dist/composables/useFileField.js +62 -41
  345. package/dist/composables/useFileField.js.map +1 -1
  346. package/dist/composables/useIconClickHandlers.d.ts +3 -3
  347. package/dist/composables/useIconClickHandlers.js +14 -13
  348. package/dist/composables/useIconClickHandlers.js.map +1 -1
  349. package/dist/composables/useInertLink.js +12 -10
  350. package/dist/composables/useInertLink.js.map +1 -1
  351. package/dist/composables/useLiveAnnouncer.d.ts +5 -0
  352. package/dist/composables/useLiveAnnouncer.js +23 -0
  353. package/dist/composables/useLiveAnnouncer.js.map +1 -0
  354. package/dist/composables/useMaskedField.d.ts +5 -5
  355. package/dist/composables/useMaskedField.js.map +1 -1
  356. package/dist/composables/usePopover.d.ts +3 -3
  357. package/dist/composables/usePopover.js +6 -4
  358. package/dist/composables/usePopover.js.map +1 -1
  359. package/dist/composables/useProgressValue.js +11 -2
  360. package/dist/composables/useProgressValue.js.map +1 -1
  361. package/dist/composables/useRootAttrs.d.ts +1 -1
  362. package/dist/composables/useRootAttrs.js.map +1 -1
  363. package/dist/composables/useSlotNodes.d.ts +18 -0
  364. package/dist/composables/useSlotNodes.js +13 -0
  365. package/dist/composables/useSlotNodes.js.map +1 -0
  366. package/dist/composables/useTextLimit.d.ts +2 -1
  367. package/dist/composables/useTextLimit.js +2 -2
  368. package/dist/composables/useTextLimit.js.map +1 -1
  369. package/dist/composables/useTimer.d.ts +5 -0
  370. package/dist/composables/useTimer.js +22 -11
  371. package/dist/composables/useTimer.js.map +1 -1
  372. package/dist/i18n/en.js +1 -1
  373. package/dist/i18n/en.js.map +1 -1
  374. package/dist/i18n/fr.js +14 -14
  375. package/dist/i18n/fr.js.map +1 -1
  376. package/dist/i18n/state.d.ts +7 -7
  377. package/dist/i18n/state.js +37 -28
  378. package/dist/i18n/state.js.map +1 -1
  379. package/dist/i18n/types.d.ts +12 -12
  380. package/dist/icons.d.ts +2 -2
  381. package/dist/index.d.ts +12 -11
  382. package/dist/styles.css +1 -1
  383. package/dist/tokens/css.d.ts +1 -1
  384. package/dist/tokens/css.js.map +1 -1
  385. package/dist/tokens/index.d.ts +6 -0
  386. package/dist/tokens/semantic.d.ts +6 -0
  387. package/dist/tokens/semantic.js +66 -60
  388. package/dist/tokens/semantic.js.map +1 -1
  389. package/dist/tokens/themes/dark.js +3 -3
  390. package/dist/tokens/themes/dark.js.map +1 -1
  391. package/dist/tokens.json +130 -66
  392. package/dist/types.d.ts +1 -1
  393. package/dist/utils/arrowNav.d.ts +4 -1
  394. package/dist/utils/arrowNav.js +7 -7
  395. package/dist/utils/arrowNav.js.map +1 -1
  396. package/dist/utils/chip.d.ts +1 -1
  397. package/dist/utils/chip.js.map +1 -1
  398. package/dist/utils/clock.d.ts +113 -0
  399. package/dist/utils/clock.js +84 -0
  400. package/dist/utils/clock.js.map +1 -0
  401. package/dist/utils/css.d.ts +6 -4
  402. package/dist/utils/css.js +2 -2
  403. package/dist/utils/css.js.map +1 -1
  404. package/dist/utils/date.d.ts +7 -102
  405. package/dist/utils/date.js +33 -160
  406. package/dist/utils/date.js.map +1 -1
  407. package/dist/utils/direction.d.ts +1 -1
  408. package/dist/utils/direction.js.map +1 -1
  409. package/dist/utils/env.d.ts +12 -3
  410. package/dist/utils/env.js +6 -0
  411. package/dist/utils/env.js.map +1 -0
  412. package/dist/utils/file.d.ts +3 -3
  413. package/dist/utils/file.js +1 -1
  414. package/dist/utils/file.js.map +1 -1
  415. package/dist/utils/focus.d.ts +1 -1
  416. package/dist/utils/focus.js.map +1 -1
  417. package/dist/utils/hostWarns.d.ts +1 -1
  418. package/dist/utils/hostWarns.js.map +1 -1
  419. package/dist/utils/ids.d.ts +1 -1
  420. package/dist/utils/ids.js.map +1 -1
  421. package/dist/utils/matcher.d.ts +2 -2
  422. package/dist/utils/matcher.js.map +1 -1
  423. package/dist/utils/memo.d.ts +1 -1
  424. package/dist/utils/memo.js.map +1 -1
  425. package/dist/utils/text.d.ts +3 -3
  426. package/dist/utils/text.js.map +1 -1
  427. package/dist/utils/time.d.ts +2 -101
  428. package/dist/utils/time.js +22 -98
  429. package/dist/utils/time.js.map +1 -1
  430. package/dist/utils/vnode.d.ts +5 -3
  431. package/dist/utils/vnode.js.map +1 -1
  432. package/package.json +2 -2
@@ -7,9 +7,9 @@ var b = [
7
7
  "data-spread",
8
8
  "data-readonly"
9
9
  ], x = { class: "v-choice-row" }, S = [
10
- "disabled",
11
10
  "aria-invalid",
12
11
  "aria-readonly",
12
+ "disabled",
13
13
  "aria-describedby"
14
14
  ], C = {
15
15
  key: 0,
@@ -51,10 +51,11 @@ var b = [
51
51
  emits: ["update:modelValue"],
52
52
  setup(o, { expose: s }) {
53
53
  let T = o, { attrs: E, rootClass: D, rootStyle: O, forwardedAttrs: k } = e(), { hintId: A, describedBy: j } = t(E, () => !!T.hint), M = g(o, "modelValue"), N = f(null);
54
- v(() => {
54
+ function P() {
55
55
  N.value && (N.value.indeterminate = T.indeterminate);
56
- }, { flush: "post" });
57
- function P(e) {
56
+ }
57
+ v(P, { flush: "post" });
58
+ function F(e) {
58
59
  T.readonly && e.preventDefault();
59
60
  }
60
61
  return s({
@@ -72,13 +73,14 @@ var b = [
72
73
  ref: N,
73
74
  "onUpdate:modelValue": t[0] ||= (e) => M.value = e,
74
75
  type: "checkbox",
75
- class: "v-checkbox-input v-hidden-input"
76
+ class: "v-checkbox-input v-hidden-input",
77
+ "aria-invalid": o.invalid || void 0,
78
+ "aria-readonly": o.readonly || void 0
76
79
  }, h(k), {
77
80
  disabled: o.disabled,
78
- "aria-invalid": o.invalid || void 0,
79
- "aria-readonly": o.readonly || void 0,
80
81
  "aria-describedby": h(j),
81
- onClick: P
82
+ onClick: F,
83
+ onChange: P
82
84
  }), null, 16, S), [[_, M.value]]),
83
85
  t[1] ||= i("span", {
84
86
  class: "v-checkbox-box",
@@ -1 +1 @@
1
- {"version":3,"file":"VCheckbox.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VCheckbox/VCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A checkbox whose square is drawn by the library rather than by the browser.\n *\n * The real `<input type=\"checkbox\">` is still there, hidden with `opacity: 0` and never\n * removed, so it keeps everything a checkbox is owed — focus, keyboard, form submission,\n * native validity — and the drawn square follows its state in CSS.\n *\n * The root is a container rather than the `<label>` itself, because the hint must sit\n * OUTSIDE the label: whatever a label holds becomes the control's accessible name.\n *\n * Two pieces of JS besides the v-model. `indeterminate`, the third \"partially checked\" look,\n * exists solely as a DOM property with no HTML attribute to set it from a template. And\n * `readonly` has no native meaning on a checkbox, so refusing the change is ours to do.\n */\n\nimport { ref, watchEffect } from 'vue'\n\nimport { useFieldIds } from '../../composables/useFieldIds'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\n/** Which side of the box the label sits on. */\nexport type CheckboxLabelPosition = 'start' | 'end'\n\ninterface CheckboxProps {\n /** The text beside the box, which names it. The default slot replaces it. */\n label?: string\n /**\n * A line of help under the label. It is tied to the checkbox for assistive technology,\n * so it is read out after the label rather than as part of it.\n */\n hint?: string\n /**\n * Shows the box as partially checked, a dash instead of a tick. This is what a\n * parent checkbox looks like when some of its children are ticked and others are\n * not; it is a state of its own, not a value the v-model can hold.\n */\n indeterminate?: boolean\n /** Which side of the box the label sits on. */\n labelPosition?: CheckboxLabelPosition\n /**\n * Pushes the label and the box to opposite ends of the line, the row taking the\n * full width available. This is the usual shape for a list of settings.\n */\n spread?: boolean\n /**\n * Marks the field as invalid, which colours the box and tells assistive technology\n * so. Use it for a rule the browser cannot check by itself; native validity is\n * already handled without it.\n */\n invalid?: boolean\n /** Makes the checkbox unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the state without allowing it to be changed. The checkbox can still be\n * focused, is announced as read-only and is still submitted with its form; a click\n * or the Space key simply changes nothing.\n */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<CheckboxProps>(), {\n label: undefined,\n hint: undefined,\n indeterminate: false,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y\n// The root element is a layout box, so the attributes the consumer passes must be\n// redirected: `name`, `value`, `required` and the aria-* belong on the input, and left on\n// the wrapper they would take part in neither the form nor the accessibility tree.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\nconst { hintId, describedBy } = useFieldIds(attrs, () => !!props.hint)\n\n/**\n * Whether the box is ticked. It starts unticked, and `indeterminate` is a separate prop —\n * the dash is a third appearance, never a third value of this one.\n */\nconst model = defineModel<boolean>({ default: false })\n\ndefineSlots<{\n /** The label, when it needs more than the `label` prop's text. It is clickable. */\n default?(): unknown\n}>()\n\nconst inputEl = ref<HTMLInputElement | null>(null)\n\n// @ssr @core\n// On the server there is no element, so the effect simply does nothing. The\n// `flush: 'post'` is load-bearing: it makes the effect run AFTER the DOM has been\n// updated, and on the very first pass the template ref is not filled in before\n// that — in the default timing the property would be written to nothing at all.\nwatchEffect(\n () => {\n if (inputEl.value) inputEl.value.indeterminate = props.indeterminate\n },\n { flush: 'post' },\n)\n\n// @core\n// The native `readonly` attribute does nothing on a checkbox. Cancelling the click is what\n// refuses the change: the browser then puts `checked` AND `indeterminate` back as they were\n// and fires no `change`, so the v-model never hears of it. It covers the Space key, which a\n// checkbox turns into a click, and a click on the label, which is forwarded to the input.\nfunction refuseWhenReadonly(event: MouseEvent) {\n if (props.readonly) event.preventDefault()\n}\n\n// The root is a wrapper, so a template ref on the component reaches the layout box and not\n// the control: these two are the way to the real checkbox.\ndefineExpose({\n /** Moves the focus to the real checkbox. */\n focus: (options?: FocusOptions) => inputEl.value?.focus(options),\n /** The real `<input type=\"checkbox\">`, for what `focus` does not cover. */\n el: inputEl,\n})\n</script>\n\n<template>\n <span\n class=\"v-checkbox v-choice\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-label-position=\"labelPosition\"\n :data-spread=\"spread ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n >\n <label class=\"v-choice-row\">\n <!-- `aria-describedby` comes AFTER the forwarded attributes, which is what lets the\n aggregated list, the consumer's references plus the hint, replace theirs. -->\n <input\n ref=\"inputEl\"\n v-model=\"model\"\n type=\"checkbox\"\n class=\"v-checkbox-input v-hidden-input\"\n v-bind=\"forwardedAttrs\"\n :disabled=\"disabled\"\n :aria-invalid=\"invalid || undefined\"\n :aria-readonly=\"readonly || undefined\"\n :aria-describedby=\"describedBy\"\n @click=\"refuseWhenReadonly\"\n />\n <span class=\"v-checkbox-box\" aria-hidden=\"true\">\n <svg class=\"v-checkbox-mark\" viewBox=\"0 0 12 12\">\n <path\n class=\"v-checkbox-mark-check\"\n d=\"M2.5 6.5l2.5 2.5 4.5-5.5\"\n fill=\"none\"\n stroke=\"currentcolor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"v-checkbox-mark-dash\"\n d=\"M3 6h6\"\n fill=\"none\"\n stroke=\"currentcolor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n />\n </svg>\n </span>\n <span v-if=\"$slots.default || label\" class=\"v-checkbox-label v-choice-label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n <span v-if=\"hint\" :id=\"hintId\" class=\"v-checkbox-hint v-choice-hint\">{{ hint }}</span>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The corner follows the control radius, capped at a QUARTER of the box rather than at\n the half a row takes. A pill override on --vectis-radius-interactive would otherwise\n turn the box into a disc, and a round checkbox reads as a radio. */\n .v-checkbox-box {\n display: inline-grid;\n place-items: center;\n width: var(--vectis-control-size-check);\n height: var(--vectis-control-size-check);\n background: transparent;\n border: var(--vectis-control-border-width) solid var(--vectis-color-border-strong);\n border-radius: min(\n var(--vectis-radius-interactive),\n calc(var(--vectis-control-size-check) / 4)\n );\n color: var(--vectis-color-text-on-accent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-checkbox-mark {\n width: var(--vectis-control-size-check-mark);\n height: var(--vectis-control-size-check-mark);\n }\n\n .v-checkbox-mark-check,\n .v-checkbox-mark-dash {\n opacity: 0;\n transition: opacity var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* The state painting, rule for rule the same as VRadio's with its own classes: keep the\n two ALIGNED. Every state below but the hovers weighs (0,3,0), so their ORDER arbitrates\n them: checked, read-only, invalid, then disabled last. The two hovers exclude every state\n they must not repaint, so no order argument reaches them. */\n .v-checkbox:not([data-readonly])\n .v-choice-row:hover\n .v-checkbox-input:not(:disabled, :checked, :indeterminate)\n + .v-checkbox-box {\n border-color: color-mix(\n in oklab,\n var(--vectis-color-border-strong),\n var(--vectis-color-text) 15%\n );\n }\n\n .v-checkbox-input:is(:checked, :indeterminate) + .v-checkbox-box {\n background: var(--vectis-color-accent);\n border-color: var(--vectis-color-accent);\n }\n\n .v-checkbox:not([data-readonly])\n .v-choice-row:hover\n .v-checkbox-input:not(:disabled):is(:checked, :indeterminate)\n + .v-checkbox-box {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /* Read-only sinks like a read-only field, and a selected control trades the accent for the\n muted text colour: still plainly on, no longer inviting a click. The mark takes the\n surface colour, which contrasts with that fill in both themes, where white would vanish\n against the light grey of the dark theme. `:where()` keeps both rules at the weight of\n the states they sit between. */\n :where(.v-checkbox[data-readonly]) .v-checkbox-input + .v-checkbox-box {\n background: var(--vectis-color-surface-sunken);\n border-color: var(--vectis-color-border);\n }\n\n :where(.v-checkbox[data-readonly])\n .v-checkbox-input:is(:checked, :indeterminate)\n + .v-checkbox-box {\n background: var(--vectis-color-text-muted);\n border-color: var(--vectis-color-text-muted);\n color: var(--vectis-color-surface);\n }\n\n .v-checkbox-input:user-invalid + .v-checkbox-box,\n .v-checkbox-input[aria-invalid='true'] + .v-checkbox-box {\n border-color: var(--vectis-color-danger);\n }\n\n .v-checkbox-input:disabled + .v-checkbox-box {\n background: var(--vectis-color-surface-muted);\n border-color: var(--vectis-color-border);\n color: var(--vectis-color-text-subtle);\n }\n\n /*\n TRAP — the two rules below are (0,4,0) and `checked` and `indeterminate` are\n INDEPENDENT DOM properties, so a box can be both at once. Nothing but the source\n order decides what such a box shows: the second rule hides the tick and the dash\n wins. Swap them, or slip a rule between them, and a checked-and-indeterminate box\n shows the tick with nothing in the console to say why — and this component is the\n one that sets `indeterminate` by hand, so it is the one that can reach that state. */\n .v-checkbox-input:checked + .v-checkbox-box .v-checkbox-mark-check {\n opacity: 1;\n }\n\n .v-checkbox-input:indeterminate + .v-checkbox-box .v-checkbox-mark-check {\n opacity: 0;\n }\n\n .v-checkbox-input:indeterminate + .v-checkbox-box .v-checkbox-mark-dash {\n opacity: 1;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-checkbox-box,\n .v-checkbox-mark-check,\n .v-checkbox-mark-dash {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DA,IAAM,IAAQ,GAgBR,EAAE,UAAO,cAAW,cAAW,sBAAmB,EAAa,GAC/D,EAAE,WAAQ,mBAAgB,EAAY,SAAa,CAAC,CAAC,EAAM,IAAI,GAM/D,IAAQ,EAAoB,GAAA,YAAmB,GAO/C,IAAU,EAA6B,IAAI;EAOjD,QACQ;GACJ,AAAI,EAAQ,UAAO,EAAQ,MAAM,gBAAgB,EAAM;EACzD,GACA,EAAE,OAAO,OAAO,CAClB;EAOA,SAAS,EAAmB,GAAmB;GAC7C,AAAI,EAAM,YAAU,EAAM,eAAe;EAC3C;SAIA,EAAa;GAEX,QAAQ,MAA2B,EAAQ,OAAO,MAAM,CAAO;GAE/D,IAAI;EACN,CAAC,mBAIC,EAiDO,QAAA;GAhDL,OAAK,EAAA,CAAC,uBACE,EAAA,CAAA,CAAS,CAAA;GAChB,OAAK,EAAE,EAAA,CAAA,CAAS;GAChB,uBAAqB,EAAA;GACrB,eAAa,EAAA,SAAM,KAAQ,KAAA;GAC3B,iBAAe,EAAA,WAAQ,KAAQ,KAAA;MAEhC,EAuCQ,SAvCR,GAuCQ;KApCN,EAWE,SAXF,EAWE;aAVI;IAAJ,KAAI;6CACU,QAAA;IACd,MAAK;IACL,OAAM;MACE,EAAA,CAAA,GAAc;IACrB,UAAU,EAAA;IACV,gBAAc,EAAA,WAAW,KAAA;IACzB,iBAAe,EAAA,YAAY,KAAA;IAC3B,oBAAkB,EAAA,CAAA;IAClB,SAAO;0BARC,EAAA,KAAK,CAAA,CAAA;YAUhB,EAoBO,QAAA;IApBD,OAAM;IAAiB,eAAY;OACvC,EAkBM,OAAA;IAlBD,OAAM;IAAkB,SAAQ;OACnC,EAQE,QAAA;IAPA,OAAM;IACN,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;IACb,kBAAe;IACf,mBAAgB;OAElB,EAOE,QAAA;IANA,OAAM;IACN,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;IACb,kBAAe;;GAITA,EAAAA,OAAO,WAAW,EAAA,SAAA,EAAA,GAA9B,EAEO,QAFP,GAEO,CADL,EAAwB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;MAGN,EAAA,QAAA,EAAA,GAAZ,EAAsF,QAAA;;GAAnE,IAAI,EAAA,CAAA;GAAQ,OAAM;OAAmC,EAAA,IAAI,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"VCheckbox.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VCheckbox/VCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A checkbox whose square is drawn by the library rather than by the browser.\n *\n * The real `<input type=\"checkbox\">` is still there, hidden with `opacity: 0` and never\n * removed, so it keeps everything a checkbox is owed — focus, keyboard, form submission,\n * native validity — and the drawn square follows its state in CSS.\n *\n * The root is a container rather than the `<label>` itself, because the hint must sit\n * OUTSIDE the label: whatever a label holds becomes the control's accessible name.\n *\n * Two pieces of JS besides the v-model. `indeterminate`, the third \"partially checked\" look,\n * exists solely as a DOM property with no HTML attribute to set it from a template. And\n * `readonly` has no native meaning on a checkbox, so refusing the change is ours to do.\n */\n\nimport { ref, watchEffect } from 'vue'\n\nimport { useFieldIds } from '../../composables/useFieldIds'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\n/** Which side of the box the label sits on. */\nexport type CheckboxLabelPosition = 'start' | 'end'\n\ninterface CheckboxProps {\n /** The text beside the box, which names it. The default slot replaces it. */\n label?: string\n /**\n * A line of help under the label. It is tied to the checkbox for assistive technology,\n * so it is read out after the label rather than as part of it.\n */\n hint?: string\n /**\n * Shows the box as partially checked, a dash instead of a tick. This is what a\n * parent checkbox looks like when some of its children are ticked and others are\n * not; it is a state of its own, not a value the v-model can hold.\n */\n indeterminate?: boolean\n /** Which side of the box the label sits on. */\n labelPosition?: CheckboxLabelPosition\n /**\n * Pushes the label and the box to opposite ends of the line, the row taking the\n * full width available. This is the usual shape for a list of settings.\n */\n spread?: boolean\n /**\n * Marks the field as invalid, which colours the box and tells assistive technology\n * so. Use it for a rule the browser cannot check by itself; native validity is\n * already handled without it.\n */\n invalid?: boolean\n /** Makes the checkbox unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the state without allowing it to be changed. The checkbox can still be\n * focused, is announced as read-only and is still submitted with its form; a click\n * or the Space key simply changes nothing.\n */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<CheckboxProps>(), {\n label: undefined,\n hint: undefined,\n indeterminate: false,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y\n// The root element is a layout box, so the attributes the consumer passes must be\n// redirected: `name`, `value`, `required` and the aria-* belong on the input, and left on\n// the wrapper they would take part in neither the form nor the accessibility tree.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\nconst { hintId, describedBy } = useFieldIds(attrs, () => !!props.hint)\n\n/**\n * Whether the box is ticked. It starts unticked. `indeterminate` is a separate prop: the\n * dash is a third appearance, never a third value of this one.\n */\nconst model = defineModel<boolean>({ default: false })\n\ndefineSlots<{\n /** The label, when it needs more than the `label` prop's text. It is clickable. */\n default?(): unknown\n}>()\n\nconst inputEl = ref<HTMLInputElement | null>(null)\n\n// @ssr @core\n// The \"partially checked\" look exists only as a DOM property, so it is written by hand,\n// from two places.\n//\n// The effect covers the prop moving. On the server there is no element and it simply does\n// nothing; the `flush: 'post'` is load-bearing, since on the very first pass the template\n// ref is not filled in before the DOM has been updated — in the default timing the\n// property would be written to nothing at all.\n//\n// TRAP — the effect alone is not enough. Activating a checkbox CLEARS the property as part\n// of the gesture, and the prop it reads has not moved, so nothing re-runs it and the dash\n// never comes back. Re-asserting it from `change` is what covers that, and it covers it\n// even when the parent refuses the new value, where watching the model would not. That\n// handler is bound after the forwarded attributes, so `mergeProps` keeps a consumer's own\n// `@change` beside it rather than replacing it.\nfunction syncIndeterminate() {\n if (inputEl.value) inputEl.value.indeterminate = props.indeterminate\n}\n\nwatchEffect(syncIndeterminate, { flush: 'post' })\n\n// @core\n// The native `readonly` attribute does nothing on a checkbox. Cancelling the click is what\n// refuses the change: the browser then puts `checked` AND `indeterminate` back as they were\n// and fires no `change`, so the v-model never hears of it. It covers the Space key, which a\n// checkbox turns into a click, and a click on the label, which is forwarded to the input.\nfunction refuseWhenReadonly(event: MouseEvent) {\n if (props.readonly) event.preventDefault()\n}\n\n// The root is a wrapper, so a template ref on the component reaches the layout box and not\n// the control: these two are the way to the real checkbox.\ndefineExpose({\n /** Moves the focus to the real checkbox. */\n focus: (options?: FocusOptions) => inputEl.value?.focus(options),\n /** The real `<input type=\"checkbox\">`, for what `focus` does not cover. */\n el: inputEl,\n})\n</script>\n\n<template>\n <span\n class=\"v-checkbox v-choice\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-label-position=\"labelPosition\"\n :data-spread=\"spread ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n >\n <label class=\"v-choice-row\">\n <!-- `aria-describedby` comes AFTER the forwarded attributes, which is what lets the\n aggregated list, the consumer's references plus the hint, replace theirs. -->\n <input\n ref=\"inputEl\"\n v-model=\"model\"\n type=\"checkbox\"\n class=\"v-checkbox-input v-hidden-input\"\n :aria-invalid=\"invalid || undefined\"\n :aria-readonly=\"readonly || undefined\"\n v-bind=\"forwardedAttrs\"\n :disabled=\"disabled\"\n :aria-describedby=\"describedBy\"\n @click=\"refuseWhenReadonly\"\n @change=\"syncIndeterminate\"\n />\n <span class=\"v-checkbox-box\" aria-hidden=\"true\">\n <svg class=\"v-checkbox-mark\" viewBox=\"0 0 12 12\">\n <path\n class=\"v-checkbox-mark-check\"\n d=\"M2.5 6.5l2.5 2.5 4.5-5.5\"\n fill=\"none\"\n stroke=\"currentcolor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n class=\"v-checkbox-mark-dash\"\n d=\"M3 6h6\"\n fill=\"none\"\n stroke=\"currentcolor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n />\n </svg>\n </span>\n <span v-if=\"$slots.default || label\" class=\"v-checkbox-label v-choice-label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n <span v-if=\"hint\" :id=\"hintId\" class=\"v-checkbox-hint v-choice-hint\">{{ hint }}</span>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The corner follows the control radius, capped at a QUARTER of the box rather than at\n the half a row takes. A pill override on --vectis-radius-interactive would otherwise\n turn the box into a disc, and a round checkbox reads as a radio. */\n .v-checkbox-box {\n display: inline-grid;\n place-items: center;\n width: var(--vectis-control-size-check);\n height: var(--vectis-control-size-check);\n background: transparent;\n border: var(--vectis-control-border-width) solid var(--vectis-color-border-strong);\n border-radius: min(\n var(--vectis-radius-interactive),\n calc(var(--vectis-control-size-check) / 4)\n );\n color: var(--vectis-color-text-on-accent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-checkbox-mark {\n width: var(--vectis-control-size-check-mark);\n height: var(--vectis-control-size-check-mark);\n }\n\n .v-checkbox-mark-check,\n .v-checkbox-mark-dash {\n opacity: 0;\n transition: opacity var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* The state painting, rule for rule the same as VRadio's with its own classes: keep the\n two ALIGNED. The states below weigh (0,3,0), bar the read-only base at (0,2,0), so their\n ORDER arbitrates them: checked, read-only, invalid, then disabled last.\n\n The two hovers sit at (0,7,0) and therefore beat every one of them on specificity, order\n or no order — which is why they have to EXCLUDE by hand each state they must not repaint.\n Forgetting the invalid pair is what once rubbed the danger border out under the pointer,\n on a control whose whole point at that moment is to look wrong. */\n .v-checkbox:not([data-readonly])\n .v-choice-row:hover\n .v-checkbox-input:not(:disabled, :checked, :indeterminate, :user-invalid, [aria-invalid='true'])\n + .v-checkbox-box {\n border-color: color-mix(\n in oklab,\n var(--vectis-color-border-strong),\n var(--vectis-color-text) 15%\n );\n }\n\n .v-checkbox-input:is(:checked, :indeterminate) + .v-checkbox-box {\n background: var(--vectis-color-accent);\n border-color: var(--vectis-color-accent);\n }\n\n .v-checkbox:not([data-readonly])\n .v-choice-row:hover\n .v-checkbox-input:not(:disabled, :user-invalid, [aria-invalid='true']):is(\n :checked,\n :indeterminate\n )\n + .v-checkbox-box {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /* Read-only sinks like a read-only field, and a selected control trades the accent for the\n muted text colour: still plainly on, no longer inviting a click. The mark takes the\n surface colour, which contrasts with that fill in both themes, where white would vanish\n against the light grey of the dark theme. `:where()` keeps both rules at the weight of\n the states they sit between. */\n :where(.v-checkbox[data-readonly]) .v-checkbox-input + .v-checkbox-box {\n background: var(--vectis-color-surface-sunken);\n border-color: var(--vectis-color-border);\n }\n\n :where(.v-checkbox[data-readonly])\n .v-checkbox-input:is(:checked, :indeterminate)\n + .v-checkbox-box {\n background: var(--vectis-color-text-muted);\n border-color: var(--vectis-color-text-muted);\n color: var(--vectis-color-surface);\n }\n\n .v-checkbox-input:user-invalid + .v-checkbox-box,\n .v-checkbox-input[aria-invalid='true'] + .v-checkbox-box {\n border-color: var(--vectis-color-danger);\n }\n\n .v-checkbox-input:disabled + .v-checkbox-box {\n background: var(--vectis-color-surface-muted);\n border-color: var(--vectis-color-border);\n color: var(--vectis-color-text-subtle);\n }\n\n /*\n TRAP — the two rules below are (0,4,0) and `checked` and `indeterminate` are\n INDEPENDENT DOM properties, so a box can be both at once. Nothing but the source\n order decides what such a box shows: the second rule hides the tick and the dash\n wins. Swap them, or slip a rule between them, and a checked-and-indeterminate box\n shows the tick with nothing in the console to say why — and this component is the\n one that sets `indeterminate` by hand, so it is the one that can reach that state. */\n .v-checkbox-input:checked + .v-checkbox-box .v-checkbox-mark-check {\n opacity: 1;\n }\n\n .v-checkbox-input:indeterminate + .v-checkbox-box .v-checkbox-mark-check {\n opacity: 0;\n }\n\n .v-checkbox-input:indeterminate + .v-checkbox-box .v-checkbox-mark-dash {\n opacity: 1;\n }\n\n @media (forced-colors: active) {\n /* Windows forced colors erase every author colour: a `background` becomes `Canvas` and a\n `border-color` becomes `CanvasText`, so a ticked box keeps the tick its `stroke` gives it and nothing else. The system\n Highlight pair is what says \"selected\" here, as it does on a pressed VToggleItem, a\n selected VChip and the current VPagination page.\n\n The class is repeated to (0,8,0) so the row's own hover rules, which reach (0,7,0),\n cannot repaint it: `forced-color-adjust: none` takes the forcing off this element, and\n a hover left winning would then paint its REAL grey over the system colour. */\n .v-checkbox-input.v-checkbox-input.v-checkbox-input.v-checkbox-input.v-checkbox-input:is(\n :checked,\n :indeterminate\n ):not(:disabled)\n + .v-checkbox-box {\n forced-color-adjust: none;\n background: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-checkbox-box,\n .v-checkbox-mark-check,\n .v-checkbox-mark-dash {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DA,IAAM,IAAQ,GAgBR,EAAE,UAAO,cAAW,cAAW,sBAAmB,EAAa,GAC/D,EAAE,WAAQ,mBAAgB,EAAY,SAAa,CAAC,CAAC,EAAM,IAAI,GAM/D,IAAQ,EAAoB,GAAA,YAAmB,GAO/C,IAAU,EAA6B,IAAI;EAiBjD,SAAS,IAAoB;GAC3B,AAAI,EAAQ,UAAO,EAAQ,MAAM,gBAAgB,EAAM;EACzD;EAEA,EAAY,GAAmB,EAAE,OAAO,OAAO,CAAC;EAOhD,SAAS,EAAmB,GAAmB;GAC7C,AAAI,EAAM,YAAU,EAAM,eAAe;EAC3C;SAIA,EAAa;GAEX,QAAQ,MAA2B,EAAQ,OAAO,MAAM,CAAO;GAE/D,IAAI;EACN,CAAC,mBAIC,EAkDO,QAAA;GAjDL,OAAK,EAAA,CAAC,uBACE,EAAA,CAAA,CAAS,CAAA;GAChB,OAAK,EAAE,EAAA,CAAA,CAAS;GAChB,uBAAqB,EAAA;GACrB,eAAa,EAAA,SAAM,KAAQ,KAAA;GAC3B,iBAAe,EAAA,WAAQ,KAAQ,KAAA;MAEhC,EAwCQ,SAxCR,GAwCQ;KArCN,EAYE,SAZF,EAYE;aAXI;IAAJ,KAAI;6CACU,QAAA;IACd,MAAK;IACL,OAAM;IACL,gBAAc,EAAA,WAAW,KAAA;IACzB,iBAAe,EAAA,YAAY,KAAA;MACpB,EAAA,CAAA,GAAc;IACrB,UAAU,EAAA;IACV,oBAAkB,EAAA,CAAA;IAClB,SAAO;IACP,UAAQ;0BATA,EAAA,KAAK,CAAA,CAAA;YAWhB,EAoBO,QAAA;IApBD,OAAM;IAAiB,eAAY;OACvC,EAkBM,OAAA;IAlBD,OAAM;IAAkB,SAAQ;OACnC,EAQE,QAAA;IAPA,OAAM;IACN,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;IACb,kBAAe;IACf,mBAAgB;OAElB,EAOE,QAAA;IANA,OAAM;IACN,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;IACb,kBAAe;;GAITA,EAAAA,OAAO,WAAW,EAAA,SAAA,EAAA,GAA9B,EAEO,QAFP,GAEO,CADL,EAAwB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;MAGN,EAAA,QAAA,EAAA,GAAZ,EAAsF,QAAA;;GAAnE,IAAI,EAAA,CAAA;GAAQ,OAAM;OAAmC,EAAA,IAAI,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-chip{height:var(--control-height);border-radius:var(--vectis-radius-chip);font-family:var(--vectis-text-family);font-size:var(--control-font-size);font-weight:var(--vectis-text-control-weight);line-height:var(--vectis-text-control-leading);transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default), border-color var(--vectis-duration-fast) var(--vectis-ease-default), color var(--vectis-duration-fast) var(--vectis-ease-default);border:1px solid #0000;align-items:center;display:inline-flex}.v-chip[data-shape=pill]{border-radius:var(--vectis-radius-pill)}.v-chip[data-custom]{--tone-bg-solid:var(--custom-color);--tone-bg-solid-hover:color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);--tone-bg-solid-active:color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);--tone-text-solid:var(--vectis-color-text-on-accent);--tone-text-tinted:color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 30%);--tone-bg-soft:color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);--tone-border-soft:color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%)}.v-variant.v-chip[data-selected]{background:var(--tone-bg-solid);color:var(--tone-text-solid);border-color:#0000}.v-chip[data-variant=outline]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:hover){background:var(--tone-bg-soft)}.v-chip[data-variant=outline]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:active),.v-chip[data-variant=soft]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:hover){background:color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%)}.v-chip[data-variant=soft]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:active){background:color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%)}.v-chip[data-variant=solid]:not([data-disabled]):has(:is(button,a).v-chip-action:hover),.v-chip[data-selected]:not([data-disabled]):has(:is(button,a).v-chip-action:hover){background:var(--tone-bg-solid-hover)}.v-chip[data-variant=solid]:not([data-disabled]):has(:is(button,a).v-chip-action:active),.v-chip[data-selected]:not([data-disabled]):has(:is(button,a).v-chip-action:active){background:var(--tone-bg-solid-active)}.v-chip-action{align-items:center;gap:var(--control-gap);height:100%;padding-block:0;padding-inline:var(--control-padding-inline);color:inherit;font:inherit;border-radius:inherit;cursor:default;background:0 0;border:none;text-decoration:none;display:inline-flex}.v-chip[data-icon-only] .v-chip-action{aspect-ratio:1;justify-content:center;padding-inline:0}:is(button,a).v-chip-action{cursor:pointer}:is(button,a).v-chip-action:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-chip-dismiss{width:var(--control-action-size);height:var(--control-action-size);margin-inline:calc(var(--vectis-space-1) * -1) var(--vectis-space-1);color:inherit;border-radius:var(--vectis-radius-pill);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.v-chip-dismiss:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:calc(-1 * var(--vectis-focus-ring-width))}.v-variant.v-chip[data-disabled]{background:var(--vectis-color-surface-muted);color:var(--vectis-color-text-subtle);border-color:#0000}.v-variant.v-chip[data-disabled][data-variant=outline]{border-color:var(--vectis-color-border);background:0 0}.v-chip[data-disabled] :is(:is(button,a).v-chip-action,.v-chip-dismiss){cursor:not-allowed}@media (prefers-reduced-motion:reduce){.v-chip{transition:none}}}
2
+ @layer vectis.components{.v-chip{block-size:var(--control-height);border-radius:var(--vectis-radius-chip);font-family:var(--vectis-text-family);font-size:var(--control-font-size);font-weight:var(--vectis-text-control-weight);line-height:var(--vectis-text-control-leading);transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default), border-color var(--vectis-duration-fast) var(--vectis-ease-default), color var(--vectis-duration-fast) var(--vectis-ease-default);border:1px solid #0000;align-items:center;display:inline-flex}.v-chip[data-shape=pill]{border-radius:var(--vectis-radius-pill)}.v-chip[data-custom]{--tone-bg-solid-hover:color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);--tone-bg-solid-active:color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);--tone-border-soft:color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%)}.v-variant.v-chip[data-selected]{background:var(--tone-bg-solid);color:var(--tone-text-solid);border-color:#0000}.v-chip[data-variant=outline]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:hover){background:var(--tone-bg-soft)}.v-chip[data-variant=outline]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:active),.v-chip[data-variant=soft]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:hover){background:color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%)}.v-chip[data-variant=soft]:not([data-disabled],[data-selected]):has(:is(button,a).v-chip-action:active){background:color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%)}.v-chip[data-variant=solid]:not([data-disabled]):has(:is(button,a).v-chip-action:hover),.v-chip[data-selected]:not([data-disabled]):has(:is(button,a).v-chip-action:hover){background:var(--tone-bg-solid-hover)}.v-chip[data-variant=solid]:not([data-disabled]):has(:is(button,a).v-chip-action:active),.v-chip[data-selected]:not([data-disabled]):has(:is(button,a).v-chip-action:active){background:var(--tone-bg-solid-active)}.v-chip-action{align-items:center;gap:var(--control-gap);block-size:100%;padding-block:0;padding-inline:var(--control-padding-inline);color:inherit;font:inherit;border-radius:inherit;cursor:default;background:0 0;border:none;text-decoration:none;display:inline-flex}.v-chip[data-icon-only] .v-chip-action{aspect-ratio:1;justify-content:center;padding-inline:0}:is(button,a).v-chip-action{cursor:pointer}:is(button,a).v-chip-action:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-chip-dismiss{inline-size:var(--control-action-size);block-size:var(--control-action-size);margin-inline:calc(var(--vectis-space-1) * -1) var(--vectis-space-1);color:inherit;border-radius:var(--vectis-radius-pill);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.v-chip-dismiss:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:calc(-1 * var(--vectis-focus-ring-width))}.v-variant.v-chip[data-disabled]{background:var(--vectis-color-surface-muted);color:var(--vectis-color-text-subtle);border-color:#0000}.v-variant.v-chip[data-disabled][data-variant=outline]{border-color:var(--vectis-color-border);background:0 0}.v-chip[data-disabled] :is(:is(button,a).v-chip-action,.v-chip-dismiss){cursor:not-allowed}@media (prefers-reduced-motion:reduce){.v-chip{transition:none}}@media (forced-colors:active){.v-chip.v-chip.v-chip.v-chip[data-selected]:not([data-disabled]){forced-color-adjust:none;color:highlighttext;background-color:highlight;border-color:highlight;outline-color:canvastext}}}
@@ -21,7 +21,7 @@ interface ChipProps {
21
21
  tone?: ChipTone;
22
22
  /**
23
23
  * A colour of your own (hex, CSS name or `oklch()`), which REPLACES the tone. Every
24
- * shade it needs — the tinted background, the text, the hover — is derived from that
24
+ * shade it needs (the tinted background, the text, the hover) is derived from that
25
25
  * one colour, so it follows the light and the dark theme with nothing to rebuild.
26
26
  * Only the contrast of the text on a fully coloured chip is yours to check.
27
27
  */
@@ -94,7 +94,12 @@ type __VLS_ModelProps = {
94
94
  'selected'?: boolean;
95
95
  };
96
96
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
97
- declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
97
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
98
+ /** Moves the focus to the chip's action: its button or link. */
99
+ focus: (options?: FocusOptions) => void | undefined;
100
+ /** The action element, which is also where the consumer's attributes land. */
101
+ el: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
102
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
98
103
  dismiss: () => any;
99
104
  "update:selected": (value: boolean) => any;
100
105
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"VChip.js","names":[],"sources":["../../../src/components/VChip/VChip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * A small labelled pill standing for a value: a filter in force, a tag, a chosen file, a\n * person picked in a field.\n *\n * What it renders follows what it is asked to DO, each shape being the native element for\n * it, so focus, keyboard and disabling come free: selectable is a button with `aria-pressed`,\n * `href` is a link, `clickable` is a button, and none of those is plain text with no hover.\n *\n * A dismissible chip carries a SECOND button BESIDE the first, never inside it — a button\n * within a button is invalid HTML and unreachable by keyboard.\n *\n * The only JS makes a disabled link inert, the platform having no `disabled` for links, and\n * splits the consumer's attributes between the pill and the element that acts.\n */\n\nimport { computed } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\n// TRAP — neither import may be named after a prop (`check`, `checkIcon`): every top-level\n// binding of a `<script setup>` reaches the template, where it shadows the prop of that name.\nimport { check as checkMark } from '../VIcon/icons/check'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport type { IconSource } from '../VIcon/types'\nimport { useMessages } from '../../i18n/state'\n\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { customColorStyle } from '../../utils/css'\n\n/** How much visual weight the chip carries. */\nexport type ChipVariant = 'soft' | 'solid' | 'outline'\n\n/** What the chip means, in colour. */\nexport type ChipTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\n/** The silhouette: softly rounded, or a full pill. */\nexport type ChipShape = 'chip' | 'pill'\n\n/** The height of the chip: 24 or 32 pixels. */\nexport type ChipSize = 'xs' | 'sm'\n\ninterface ChipProps {\n /**\n * How strongly the chip is painted: a tinted background, the full colour, or a\n * border alone.\n */\n variant?: ChipVariant\n /**\n * What the chip means, expressed as a colour: `neutral` by default, then `accent` for\n * something singled out and `danger`/`success`/`warning` for a state being reported. A\n * chip may report a state where a button may not, which is why it offers five.\n */\n tone?: ChipTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which REPLACES the tone. Every\n * shade it needs — the tinted background, the text, the hover — is derived from that\n * one colour, so it follows the light and the dark theme with nothing to rebuild.\n * Only the contrast of the text on a fully coloured chip is yours to check.\n */\n color?: string\n /** The silhouette: softly rounded corners, or a full pill. */\n shape?: ChipShape\n /** The height of the chip. */\n size?: ChipSize\n /** Takes 4px off the height, leaving the padding, the text and the icons as they are. */\n compact?: boolean\n /** Makes the chip a button that reacts to clicks, without holding a state. */\n clickable?: boolean\n /**\n * Where the chip leads, which makes it a link. A disabled link is made inert by\n * hand.\n */\n href?: string\n /**\n * Makes the chip something that stays chosen, bound to `v-model:selected`. It wins\n * over `href` and `clickable`.\n */\n selectable?: boolean\n /**\n * Shows a tick before the label while the chip is selected. It REPLACES whatever\n * start icon was given, so the two are never shown together.\n */\n check?: boolean\n /** The icon of that tick, a built-in check mark by default. `iconFilled` does not reach it. */\n checkIcon?: IconSource\n /** An icon before the label. The `#start` slot replaces it. */\n iconStart?: IconSource\n /** An icon after the label. The `#end` slot replaces it. */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis). It has\n * no effect on the `#start`/`#end` slots, whose icons the consumer builds, nor on the tick\n * or the removal cross.\n */\n iconFilled?: boolean\n /**\n * Adds a button that asks for the chip to be removed. It only EMITS that request:\n * actually taking the chip away is the consumer's decision.\n */\n dismissible?: boolean\n /** The icon of that removal button. */\n dismissIcon?: IconSource\n /**\n * What the removal button does, in words. It falls back to the design system\n * dictionary.\n */\n dismissLabel?: string\n /** Makes the chip unusable, greyed out through the colour tokens. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ChipProps>(), {\n variant: 'soft',\n tone: 'neutral',\n color: undefined,\n shape: 'chip',\n size: 'xs',\n compact: false,\n clickable: false,\n href: undefined,\n selectable: false,\n check: false,\n checkIcon: () => checkMark,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n dismissible: false,\n dismissIcon: () => closeIcon,\n dismissLabel: undefined,\n disabled: false,\n})\n\nconst m = useMessages()\nconst resolvedDismissLabel = computed(() => props.dismissLabel ?? m.value.common.dismiss)\n\n/**\n * Whether the chip is selected, which is also what makes it selectable at all: binding this\n * turns it into a toggle button and takes precedence over `href` and `clickable`. It starts\n * unselected.\n */\nconst selected = defineModel<boolean>('selected', { default: false })\n\ndefineEmits<{\n /** The removal button was pressed. The chip is still there: removing it is up to you. */\n dismiss: []\n}>()\n\nconst slots = defineSlots<{\n /** The label. It may be left out entirely, which gives a chip made of icons alone. */\n default?(): unknown\n /** Content before the label, which takes the place of `iconStart`. */\n start?(): unknown\n /** Content after the label, which takes the place of `iconEnd`. */\n end?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n// The wrapper-root split: the pill is the box a consumer positions, and the ACTION is the\n// element that is focused, named and clicked, so everything else goes there.\nconst { rootClass, rootStyle: consumerStyle, forwardedAttrs } = useRootAttrs()\n\n/* What the chip does, in order of precedence: staying selected wins over leading\n somewhere, which wins over merely reacting to clicks; asked for none of them, it is\n plain text. A selectable chip is therefore never a link, whatever `href` says. */\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: actionAttrs,\n} = useInertLink({\n href: () => (props.selectable ? undefined : props.href),\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\nconst actionTag = computed(() =>\n props.selectable ? 'button' : isLink.value ? 'a' : props.clickable ? 'button' : 'span',\n)\n\nconst rootStyle = computed<StyleValue>(() => [customColorStyle(props.color), consumerStyle.value])\n\nconst showCheck = computed(() => props.check && props.selectable && selected.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/** An icon and no label at all: the chip becomes a square, as wide as it is tall. */\nfunction iconOnly() {\n return !slots.default && !!(slots.start || slots.end || props.iconStart || props.iconEnd)\n}\n</script>\n\n<template>\n <span\n :class=\"['v-chip v-control v-tone v-variant', rootClass]\"\n :style=\"rootStyle\"\n :data-variant=\"variant\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-selected=\"selectable && selected ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n >\n <component\n :is=\"actionTag\"\n v-bind=\"actionAttrs\"\n class=\"v-chip-action\"\n :type=\"actionTag === 'button' ? 'button' : undefined\"\n :href=\"linkHref\"\n :disabled=\"actionTag === 'button' ? disabled : undefined\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n :aria-pressed=\"selectable ? selected : undefined\"\n @click=\"selectable && !disabled && (selected = !selected)\"\n >\n <VIcon v-if=\"showCheck\" v-bind=\"iconProps(checkIcon)\" />\n <slot v-else name=\"start\">\n <VIcon v-if=\"iconStart\" v-bind=\"iconProps(iconStart)\" :filled=\"iconFilled\" />\n </slot>\n <slot />\n <slot name=\"end\">\n <VIcon v-if=\"iconEnd\" v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </slot>\n </component>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"v-chip-dismiss\"\n :aria-label=\"resolvedDismissLabel\"\n :disabled=\"disabled\"\n @click=\"$emit('dismiss')\"\n >\n <VIcon v-bind=\"iconProps(dismissIcon)\" />\n </button>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The height comes from the shared size class set on this element. The scale itself\n holds five steps; the component's type restricts it to the two smallest, a chip\n larger than that being a button. */\n .v-chip {\n display: inline-flex;\n align-items: center;\n height: var(--control-height);\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-chip);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-chip[data-shape='pill'] {\n border-radius: var(--vectis-radius-pill);\n }\n\n /* The tone table itself lives in styles/tones.css, in a layer below the components.\n All five tones are taken exactly as they come; the only values redefined here are\n those of a custom colour, and they win over the shared table by LAYER rather than\n by order, so no bundling can change the outcome. */\n\n /* A custom colour replaces the tone entirely. Every shade it needs is derived from\n that one colour mixed with the theme's own surface and text, so the same value\n produces a legible chip in the light theme and in the dark one, with nothing to\n rebuild. */\n .v-chip[data-custom] {\n --tone-bg-solid: var(--custom-color);\n --tone-bg-solid-hover: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);\n --tone-bg-solid-active: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);\n /* Fixed white, whatever the colour: on a fully coloured chip the contrast of the\n text is the consumer's to check, as it is in VBadge. */\n --tone-text-solid: var(--vectis-color-text-on-accent);\n --tone-text-tinted: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 30%);\n --tone-bg-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --tone-border-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%);\n }\n\n /* A selected chip is painted in the full colour of its CURRENT tone, whichever variant it\n was given. It COMPOUNDS `.v-variant`: the variant table weighs (0,2,0) like this rule and\n lives in another sheet, so at equal specificity the winner would be whichever one the\n consumer's bundler put last. At (0,3,0) it wins by construction. */\n .v-variant.v-chip[data-selected] {\n background: var(--tone-bg-solid);\n color: var(--tone-text-solid);\n border-color: transparent;\n }\n\n /* Hovering and pressing are conditioned on the ACTION being a real control, which\n buys two things at once: a chip that merely displays a value never lights up, and\n hovering the removal button does not repaint the whole chip as though it were\n about to be activated. */\n /* The same steps as VButton's, rule for rule: an outline sits on the soft surface while\n hovered and one tint further when pressed, and that tint is where a soft chip starts\n on hover. Held in each sheet rather than in `variants.css`, which every consumer\n downloads whether or not it renders a single button or chip. */\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: var(--tone-bg-soft);\n }\n\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ),\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%);\n }\n\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:hover),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:hover) {\n background: var(--tone-bg-solid-hover);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:active),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:active) {\n background: var(--tone-bg-solid-active);\n }\n\n .v-chip-action {\n display: inline-flex;\n align-items: center;\n gap: var(--control-gap);\n height: 100%;\n padding-block: 0;\n padding-inline: var(--control-padding-inline);\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n border-radius: inherit;\n text-decoration: none;\n cursor: default;\n }\n\n /* With an icon and no label the action becomes square, its width taken from its own\n height through the ratio rather than from a new measurement to keep in step. */\n .v-chip[data-icon-only] .v-chip-action {\n aspect-ratio: 1;\n justify-content: center;\n padding-inline: 0;\n }\n\n :is(button, a).v-chip-action {\n cursor: pointer;\n }\n\n :is(button, a).v-chip-action:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The removal button carries no background of its own, not even on hover — the same\n treatment as a field's inner buttons — and the cursor is what signals it can be\n used.\n\n Its icon takes the chip's colour AT FULL strength. Dimming it, as one would\n instinctively do for a secondary control, took the cross down to 3.9:1 on a tinted\n chip and 2.8:1 on a solid one. That matters because the cross is drawn from the\n icon font here, and a glyph from a font is real text, to which the contrast rule\n applies. */\n .v-chip-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--control-action-size);\n height: var(--control-action-size);\n margin-inline: calc(var(--vectis-space-1) * -1) var(--vectis-space-1);\n padding: 0;\n border: none;\n background: transparent;\n color: inherit;\n border-radius: var(--vectis-radius-pill);\n cursor: pointer;\n flex: none;\n }\n\n .v-chip-dismiss:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n /* A disabled chip greys out through the colour tokens, which is what makes it follow\n the dark theme without a rule of its own. */\n .v-variant.v-chip[data-disabled] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n border-color: transparent;\n }\n\n .v-variant.v-chip[data-disabled][data-variant='outline'] {\n background: transparent;\n border-color: var(--vectis-color-border);\n }\n\n .v-chip[data-disabled] :is(:is(button, a).v-chip-action, .v-chip-dismiss) {\n cursor: not-allowed;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-chip {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VChip.js","names":[],"sources":["../../../src/components/VChip/VChip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A small labelled pill standing for a value: a filter in force, a tag, a chosen file, a\n * person picked in a field.\n *\n * What it renders follows what it is asked to DO, each shape being the native element for\n * it, so focus, keyboard and disabling come free: selectable is a button with `aria-pressed`,\n * `href` is a link, `clickable` is a button, and none of those is plain text with no hover.\n *\n * A dismissible chip carries a SECOND button BESIDE the first, never inside it — a button\n * within a button is invalid HTML and unreachable by keyboard.\n *\n * The only JS makes a disabled link inert, the platform having no `disabled` for links, and\n * splits the consumer's attributes between the pill and the element that acts.\n */\n\nimport { computed, onMounted, ref, useAttrs } from 'vue'\nimport type { StyleValue, VNode } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\n// TRAP — neither import may be named after a prop (`check`, `checkIcon`): every top-level\n// binding of a `<script setup>` reaches the template, where it shadows the prop of that name.\nimport { check as checkMark } from '../VIcon/icons/check'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport type { IconSource } from '../VIcon/types'\nimport { useMessages } from '../../i18n/state'\n\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\nimport { flattenSlot } from '../../utils/vnode'\n\n/** How much visual weight the chip carries. */\nexport type ChipVariant = 'soft' | 'solid' | 'outline'\n\n/** What the chip means, in colour. */\nexport type ChipTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\n/** The silhouette: softly rounded, or a full pill. */\nexport type ChipShape = 'chip' | 'pill'\n\n/** The height of the chip: 24 or 32 pixels. */\nexport type ChipSize = 'xs' | 'sm'\n\ninterface ChipProps {\n /**\n * How strongly the chip is painted: a tinted background, the full colour, or a\n * border alone.\n */\n variant?: ChipVariant\n /**\n * What the chip means, expressed as a colour: `neutral` by default, then `accent` for\n * something singled out and `danger`/`success`/`warning` for a state being reported. A\n * chip may report a state where a button may not, which is why it offers five.\n */\n tone?: ChipTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which REPLACES the tone. Every\n * shade it needs (the tinted background, the text, the hover) is derived from that\n * one colour, so it follows the light and the dark theme with nothing to rebuild.\n * Only the contrast of the text on a fully coloured chip is yours to check.\n */\n color?: string\n /** The silhouette: softly rounded corners, or a full pill. */\n shape?: ChipShape\n /** The height of the chip. */\n size?: ChipSize\n /** Takes 4px off the height, leaving the padding, the text and the icons as they are. */\n compact?: boolean\n /** Makes the chip a button that reacts to clicks, without holding a state. */\n clickable?: boolean\n /**\n * Where the chip leads, which makes it a link. A disabled link is made inert by\n * hand.\n */\n href?: string\n /**\n * Makes the chip something that stays chosen, bound to `v-model:selected`. It wins\n * over `href` and `clickable`.\n */\n selectable?: boolean\n /**\n * Shows a tick before the label while the chip is selected. It REPLACES whatever\n * start icon was given, so the two are never shown together.\n */\n check?: boolean\n /** The icon of that tick, a built-in check mark by default. `iconFilled` does not reach it. */\n checkIcon?: IconSource\n /** An icon before the label. The `#start` slot replaces it. */\n iconStart?: IconSource\n /** An icon after the label. The `#end` slot replaces it. */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis). It has\n * no effect on the `#start`/`#end` slots, whose icons the consumer builds, nor on the tick\n * or the removal cross.\n */\n iconFilled?: boolean\n /**\n * Adds a button that asks for the chip to be removed. It only EMITS that request:\n * actually taking the chip away is the consumer's decision.\n */\n dismissible?: boolean\n /** The icon of that removal button. */\n dismissIcon?: IconSource\n /**\n * What the removal button does, in words. It falls back to the design system\n * dictionary.\n */\n dismissLabel?: string\n /** Makes the chip unusable, greyed out through the colour tokens. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ChipProps>(), {\n variant: 'soft',\n tone: 'neutral',\n color: undefined,\n shape: 'chip',\n size: 'xs',\n compact: false,\n clickable: false,\n href: undefined,\n selectable: false,\n check: false,\n checkIcon: () => checkMark,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n dismissible: false,\n dismissIcon: () => closeIcon,\n dismissLabel: undefined,\n disabled: false,\n})\n\nconst m = useMessages()\nconst resolvedDismissLabel = computed(() => props.dismissLabel ?? m.value.common.dismiss)\n\n/**\n * Whether the chip is selected, which is also what makes it selectable at all: binding this\n * turns it into a toggle button and takes precedence over `href` and `clickable`. It starts\n * unselected.\n */\nconst selected = defineModel<boolean>('selected', { default: false })\n\ndefineEmits<{\n /** The removal button was pressed. The chip is still there: removing it is up to you. */\n dismiss: []\n}>()\n\nconst slots = defineSlots<{\n /** The label. It may be left out entirely, which gives a chip made of icons alone. */\n default?(): unknown\n /** Content before the label, which takes the place of `iconStart`. */\n start?(): unknown\n /** Content after the label, which takes the place of `iconEnd`. */\n end?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n// The wrapper-root split: the pill is the box a consumer positions, and the ACTION is the\n// element that is focused, named and clicked, so everything else goes there.\nconst { rootClass, rootStyle: consumerStyle, forwardedAttrs } = useRootAttrs()\n\n/* What the chip does, in order of precedence: staying selected wins over leading\n somewhere, which wins over merely reacting to clicks; asked for none of them, it is\n plain text. A selectable chip is therefore never a link, whatever `href` says. */\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: actionAttrs,\n} = useInertLink({\n href: () => (props.selectable ? undefined : props.href),\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\nconst actionTag = computed(() =>\n props.selectable ? 'button' : isLink.value ? 'a' : props.clickable ? 'button' : 'span',\n)\n\nconst rootStyle = computed<StyleValue>(() => [customColorStyle(props.color), consumerStyle.value])\n\nconst actionEl = ref<HTMLElement | null>(null)\n\nconst showCheck = computed(() => props.check && props.selectable && selected.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 and no label at all: the chip becomes a square, as wide as it is tall. The default\n * slot is asked what it RENDERS, not whether it was passed: a wrapper forwarding an empty\n * label still hands one down.\n */\nfunction iconOnly() {\n return (\n flattenSlot(slots.default?.() as VNode[] | undefined).length === 0 &&\n !!(slots.start || slots.end || props.iconStart || props.iconEnd)\n )\n}\n\n// @devwarn\n// A chip drawn with an icon alone has no accessible name: the icon is decorative, so a\n// clickable, selectable or linked one is announced as a bare button or link. Nothing fails\n// visibly, hence the message. Read once, on mount, off the rendered pill: calling the slot\n// here, outside the render, would draw a Vue warning of its own.\nif (isDev) {\n const attrs = useAttrs()\n onMounted(() => {\n if (\n actionTag.value !== 'span' &&\n actionEl.value?.parentElement?.hasAttribute('data-icon-only') &&\n attrs['aria-label'] === undefined &&\n attrs['aria-labelledby'] === undefined\n ) {\n console.warn(\n '[VChip] a chip made of an icon alone has no accessible name: set aria-label or aria-labelledby on it.',\n )\n }\n })\n}\n\n// A template ref on the chip reaches the pill, a layout box; the element that is focused,\n// named and clicked is the action inside it.\ndefineExpose({\n /** Moves the focus to the chip's action: its button or link. */\n focus: (options?: FocusOptions) => actionEl.value?.focus(options),\n /** The action element, which is also where the consumer's attributes land. */\n el: actionEl,\n})\n</script>\n\n<template>\n <span\n :class=\"['v-chip v-control v-tone v-variant', rootClass]\"\n :style=\"rootStyle\"\n :data-variant=\"variant\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-selected=\"selectable && selected ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n >\n <component\n :is=\"actionTag\"\n ref=\"actionEl\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n :aria-pressed=\"selectable ? selected : undefined\"\n v-bind=\"actionAttrs\"\n class=\"v-chip-action\"\n :type=\"actionTag === 'button' ? 'button' : undefined\"\n :href=\"linkHref\"\n :disabled=\"actionTag === 'button' ? disabled : undefined\"\n @click=\"selectable && !disabled && (selected = !selected)\"\n >\n <VIcon v-if=\"showCheck\" v-bind=\"iconProps(checkIcon)\" />\n <slot v-else name=\"start\">\n <VIcon v-if=\"iconStart\" v-bind=\"iconProps(iconStart)\" :filled=\"iconFilled\" />\n </slot>\n <slot />\n <slot name=\"end\">\n <VIcon v-if=\"iconEnd\" v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </slot>\n </component>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"v-chip-dismiss\"\n :aria-label=\"resolvedDismissLabel\"\n :disabled=\"disabled\"\n @click=\"$emit('dismiss')\"\n >\n <VIcon v-bind=\"iconProps(dismissIcon)\" />\n </button>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The height comes from the shared size class set on this element. The scale itself\n holds five steps; the component's type restricts it to the two smallest, a chip\n larger than that being a button. */\n .v-chip {\n display: inline-flex;\n align-items: center;\n block-size: var(--control-height);\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-chip);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-chip[data-shape='pill'] {\n border-radius: var(--vectis-radius-pill);\n }\n\n /* The tone table itself lives in styles/tones.css, in a layer below the components.\n All five tones are taken exactly as they come; the only values redefined here are\n those of a custom colour, and they win over the shared table by LAYER rather than\n by order, so no bundling can change the outcome. */\n\n /* A custom colour replaces the tone entirely. The shared table derives the four values\n every adopter reads (styles/tones.css, `.v-tone[data-custom]`); the chip adds the\n three only it paints, its hover and active steps and its outline, from the same colour\n mixed with the theme's own text and surface. */\n .v-chip[data-custom] {\n --tone-bg-solid-hover: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);\n --tone-bg-solid-active: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);\n --tone-border-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%);\n }\n\n /* A selected chip is painted in the full colour of its CURRENT tone, whichever variant it\n was given. It COMPOUNDS `.v-variant`: the variant table weighs (0,2,0) like this rule and\n lives in another sheet, so at equal specificity the winner would be whichever one the\n consumer's bundler put last. At (0,3,0) it wins by construction. */\n .v-variant.v-chip[data-selected] {\n background: var(--tone-bg-solid);\n color: var(--tone-text-solid);\n border-color: transparent;\n }\n\n /* Hovering and pressing are conditioned on the ACTION being a real control, which\n buys two things at once: a chip that merely displays a value never lights up, and\n hovering the removal button does not repaint the whole chip as though it were\n about to be activated. */\n /* The same steps as VButton's, rule for rule: an outline sits on the soft surface while\n hovered and one tint further when pressed, and that tint is where a soft chip starts\n on hover. Held in each sheet rather than in `variants.css`, which every consumer\n downloads whether or not it renders a single button or chip. */\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: var(--tone-bg-soft);\n }\n\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ),\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%);\n }\n\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:hover),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:hover) {\n background: var(--tone-bg-solid-hover);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:active),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:active) {\n background: var(--tone-bg-solid-active);\n }\n\n .v-chip-action {\n display: inline-flex;\n align-items: center;\n gap: var(--control-gap);\n block-size: 100%;\n padding-block: 0;\n padding-inline: var(--control-padding-inline);\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n border-radius: inherit;\n text-decoration: none;\n cursor: default;\n }\n\n /* With an icon and no label the action becomes square, its width taken from its own\n height through the ratio rather than from a new measurement to keep in step. */\n .v-chip[data-icon-only] .v-chip-action {\n aspect-ratio: 1;\n justify-content: center;\n padding-inline: 0;\n }\n\n :is(button, a).v-chip-action {\n cursor: pointer;\n }\n\n :is(button, a).v-chip-action:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The removal button carries no background of its own, not even on hover — the same\n treatment as a field's inner buttons — and the cursor is what signals it can be\n used.\n\n Its icon takes the chip's colour AT FULL strength. Dimming it, as one would\n instinctively do for a secondary control, took the cross down to 3.9:1 on a tinted\n chip and 2.8:1 on a solid one. That matters because the cross is drawn from the\n icon font here, and a glyph from a font is real text, to which the contrast rule\n applies. */\n .v-chip-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-action-size);\n block-size: var(--control-action-size);\n margin-inline: calc(var(--vectis-space-1) * -1) var(--vectis-space-1);\n padding: 0;\n border: none;\n background: transparent;\n color: inherit;\n border-radius: var(--vectis-radius-pill);\n cursor: pointer;\n flex: none;\n }\n\n .v-chip-dismiss:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n /* A disabled chip greys out through the colour tokens, which is what makes it follow\n the dark theme without a rule of its own. */\n .v-variant.v-chip[data-disabled] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n border-color: transparent;\n }\n\n .v-variant.v-chip[data-disabled][data-variant='outline'] {\n background: transparent;\n border-color: var(--vectis-color-border);\n }\n\n .v-chip[data-disabled] :is(:is(button, a).v-chip-action, .v-chip-dismiss) {\n cursor: not-allowed;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-chip {\n transition: none;\n }\n }\n\n /*\n * Windows forced colors replace every background with the page's, so a selected chip would look\n * exactly like the others there: the fill is its only cue, the state being in an ARIA\n * attribute a sighted reader never sees. It takes the system's own selection pair\n * instead, and opts out of the forcing for that element alone so the pair is painted.\n *\n * TRAP — the class is repeated to reach (0,6,0). The variant, hover and active rules\n * reach (0,5,0), and with the forcing turned off any of them that still won would paint\n * its tone over the selection, with HighlightText on top of it.\n */\n @media (forced-colors: active) {\n .v-chip.v-chip.v-chip.v-chip[data-selected]:not([data-disabled]) {\n forced-color-adjust: none;\n background-color: Highlight;\n color: HighlightText;\n border-color: Highlight;\n outline-color: CanvasText;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -1,14 +1,16 @@
1
- import { useMessages as e } from "../../i18n/state.js";
2
- import { iconProps as t } from "../VIcon/iconProps.js";
3
- import { customColorStyle as n } from "../../utils/css.js";
4
- import r from "../VIcon/VIcon.js";
5
- import { useInertLink as i } from "../../composables/useInertLink.js";
6
- import { useRootAttrs as a } from "../../composables/useRootAttrs.js";
7
- import { close as o } from "../VIcon/icons/close.js";
8
- import { check as s } from "../VIcon/icons/check.js";
9
- import { computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, openBlock as b, renderSlot as x, resolveDynamicComponent as S, unref as C, useModel as w, useSlots as T, withCtx as E } from "vue";
1
+ import { isDev as e } from "../../utils/env.js";
2
+ import { useMessages as t } from "../../i18n/state.js";
3
+ import { iconProps as n } from "../VIcon/iconProps.js";
4
+ import { customColorStyle as r } from "../../utils/css.js";
5
+ import i from "../VIcon/VIcon.js";
6
+ import { useInertLink as a } from "../../composables/useInertLink.js";
7
+ import { useRootAttrs as o } from "../../composables/useRootAttrs.js";
8
+ import { close as s } from "../VIcon/icons/close.js";
9
+ import { flattenSlot as c } from "../../utils/vnode.js";
10
+ import { check as l } from "../VIcon/icons/check.js";
11
+ import { computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeClass as y, normalizeProps as b, normalizeStyle as x, onMounted as S, openBlock as C, ref as w, renderSlot as T, resolveDynamicComponent as E, unref as D, useAttrs as O, useModel as k, useSlots as A, withCtx as j } from "vue";
10
12
  //#region src/components/VChip/VChip.vue?vue&type=script&setup=true&lang.ts
11
- var D = [
13
+ var M = [
12
14
  "data-variant",
13
15
  "data-tone",
14
16
  "data-custom",
@@ -18,10 +20,10 @@ var D = [
18
20
  "data-selected",
19
21
  "data-disabled",
20
22
  "data-icon-only"
21
- ], O = ["aria-label", "disabled"], k = /*@__PURE__*/ p({
23
+ ], N = ["aria-label", "disabled"], P = /*@__PURE__*/ h({
22
24
  inheritAttrs: !1,
23
25
  __name: "VChip",
24
- props: /*@__PURE__*/ h({
26
+ props: /*@__PURE__*/ _({
25
27
  variant: { default: "soft" },
26
28
  tone: { default: "neutral" },
27
29
  color: { default: void 0 },
@@ -44,7 +46,7 @@ var D = [
44
46
  type: Boolean,
45
47
  default: !1
46
48
  },
47
- checkIcon: { default: () => s },
49
+ checkIcon: { default: () => l },
48
50
  iconStart: { default: void 0 },
49
51
  iconEnd: { default: void 0 },
50
52
  iconFilled: {
@@ -55,7 +57,7 @@ var D = [
55
57
  type: Boolean,
56
58
  default: !1
57
59
  },
58
- dismissIcon: { default: () => o },
60
+ dismissIcon: { default: () => s },
59
61
  dismissLabel: { default: void 0 },
60
62
  disabled: {
61
63
  type: Boolean,
@@ -68,60 +70,72 @@ var D = [
68
70
  },
69
71
  selectedModifiers: {}
70
72
  }),
71
- emits: /*@__PURE__*/ h(["dismiss"], ["update:selected"]),
72
- setup(o) {
73
- let s = o, p = e(), h = c(() => s.dismissLabel ?? p.value.common.dismiss), k = w(o, "selected"), A = T(), { rootClass: j, rootStyle: M, forwardedAttrs: N } = a(), { isLink: P, isInertLink: F, linkHref: I, attrs: L } = i({
74
- href: () => s.selectable ? void 0 : s.href,
75
- inert: () => s.disabled,
76
- attrs: () => N.value
77
- }), R = c(() => s.selectable ? "button" : P.value ? "a" : s.clickable ? "button" : "span"), z = c(() => [n(s.color), M.value]), B = c(() => s.check && s.selectable && k.value);
78
- function V() {
79
- return !A.default && !!(A.start || A.end || s.iconStart || s.iconEnd);
73
+ emits: /*@__PURE__*/ _(["dismiss"], ["update:selected"]),
74
+ setup(s, { expose: l }) {
75
+ let h = s, _ = t(), P = u(() => h.dismissLabel ?? _.value.common.dismiss), F = k(s, "selected"), I = A(), { rootClass: L, rootStyle: R, forwardedAttrs: z } = o(), { isLink: B, isInertLink: V, linkHref: H, attrs: U } = a({
76
+ href: () => h.selectable ? void 0 : h.href,
77
+ inert: () => h.disabled,
78
+ attrs: () => z.value
79
+ }), W = u(() => h.selectable ? "button" : B.value ? "a" : h.clickable ? "button" : "span"), G = u(() => [r(h.color), R.value]), K = w(null), q = u(() => h.check && h.selectable && F.value);
80
+ function J() {
81
+ return c(I.default?.()).length === 0 && !!(I.start || I.end || h.iconStart || h.iconEnd);
80
82
  }
81
- return (e, n) => (b(), d("span", {
82
- class: _(["v-chip v-control v-tone v-variant", C(j)]),
83
- style: y(z.value),
84
- "data-variant": o.variant,
85
- "data-tone": o.tone,
86
- "data-custom": o.color === void 0 ? void 0 : "",
87
- "data-shape": o.shape,
88
- "data-size": o.size,
89
- "data-compact": o.compact ? "" : void 0,
90
- "data-selected": o.selectable && k.value ? "" : void 0,
91
- "data-disabled": o.disabled ? "" : void 0,
92
- "data-icon-only": V() ? "" : void 0
93
- }, [(b(), l(S(R.value), g(C(L), {
83
+ if (e) {
84
+ let e = O();
85
+ S(() => {
86
+ W.value !== "span" && K.value?.parentElement?.hasAttribute("data-icon-only") && e["aria-label"] === void 0 && e["aria-labelledby"] === void 0 && console.warn("[VChip] a chip made of an icon alone has no accessible name: set aria-label or aria-labelledby on it.");
87
+ });
88
+ }
89
+ return l({
90
+ focus: (e) => K.value?.focus(e),
91
+ el: K
92
+ }), (e, t) => (C(), p("span", {
93
+ class: y(["v-chip v-control v-tone v-variant", D(L)]),
94
+ style: x(G.value),
95
+ "data-variant": s.variant,
96
+ "data-tone": s.tone,
97
+ "data-custom": s.color === void 0 ? void 0 : "",
98
+ "data-shape": s.shape,
99
+ "data-size": s.size,
100
+ "data-compact": s.compact ? "" : void 0,
101
+ "data-selected": s.selectable && F.value ? "" : void 0,
102
+ "data-disabled": s.disabled ? "" : void 0,
103
+ "data-icon-only": J() ? "" : void 0
104
+ }, [(C(), d(E(W.value), v({
105
+ ref_key: "actionEl",
106
+ ref: K,
107
+ "aria-disabled": D(V) ? "true" : void 0,
108
+ "aria-pressed": s.selectable ? F.value : void 0
109
+ }, D(U), {
94
110
  class: "v-chip-action",
95
- type: R.value === "button" ? "button" : void 0,
96
- href: C(I),
97
- disabled: R.value === "button" ? o.disabled : void 0,
98
- "aria-disabled": C(F) ? "true" : void 0,
99
- "aria-pressed": o.selectable ? k.value : void 0,
100
- onClick: n[0] ||= (e) => o.selectable && !o.disabled && (k.value = !k.value)
111
+ type: W.value === "button" ? "button" : void 0,
112
+ href: D(H),
113
+ disabled: W.value === "button" ? s.disabled : void 0,
114
+ onClick: t[0] ||= (e) => s.selectable && !s.disabled && (F.value = !F.value)
101
115
  }), {
102
- default: E(() => [
103
- B.value ? (b(), l(r, v(g({ key: 0 }, C(t)(o.checkIcon))), null, 16)) : x(e.$slots, "start", {}, () => [o.iconStart ? (b(), l(r, g({ key: 0 }, C(t)(o.iconStart), { filled: o.iconFilled }), null, 16, ["filled"])) : u("", !0)], void 0, 1),
104
- x(e.$slots, "default"),
105
- x(e.$slots, "end", {}, () => [o.iconEnd ? (b(), l(r, g({ key: 0 }, C(t)(o.iconEnd), { filled: o.iconFilled }), null, 16, ["filled"])) : u("", !0)])
116
+ default: j(() => [
117
+ q.value ? (C(), d(i, b(v({ key: 0 }, D(n)(s.checkIcon))), null, 16)) : T(e.$slots, "start", {}, () => [s.iconStart ? (C(), d(i, v({ key: 0 }, D(n)(s.iconStart), { filled: s.iconFilled }), null, 16, ["filled"])) : f("", !0)], void 0, 1),
118
+ T(e.$slots, "default"),
119
+ T(e.$slots, "end", {}, () => [s.iconEnd ? (C(), d(i, v({ key: 0 }, D(n)(s.iconEnd), { filled: s.iconFilled }), null, 16, ["filled"])) : f("", !0)])
106
120
  ]),
107
121
  _: 3
108
122
  }, 16, [
123
+ "aria-disabled",
124
+ "aria-pressed",
109
125
  "type",
110
126
  "href",
111
- "disabled",
112
- "aria-disabled",
113
- "aria-pressed"
114
- ])), o.dismissible ? (b(), d("button", {
127
+ "disabled"
128
+ ])), s.dismissible ? (C(), p("button", {
115
129
  key: 0,
116
130
  type: "button",
117
131
  class: "v-chip-dismiss",
118
- "aria-label": h.value,
119
- disabled: o.disabled,
120
- onClick: n[1] ||= (t) => e.$emit("dismiss")
121
- }, [f(r, v(m(C(t)(o.dismissIcon))), null, 16)], 8, O)) : u("", !0)], 14, D));
132
+ "aria-label": P.value,
133
+ disabled: s.disabled,
134
+ onClick: t[1] ||= (t) => e.$emit("dismiss")
135
+ }, [m(i, b(g(D(n)(s.dismissIcon))), null, 16)], 8, N)) : f("", !0)], 14, M));
122
136
  }
123
137
  });
124
138
  //#endregion
125
- export { k as default };
139
+ export { P as default };
126
140
 
127
141
  //# sourceMappingURL=VChip.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VChip.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/VChip/VChip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * A small labelled pill standing for a value: a filter in force, a tag, a chosen file, a\n * person picked in a field.\n *\n * What it renders follows what it is asked to DO, each shape being the native element for\n * it, so focus, keyboard and disabling come free: selectable is a button with `aria-pressed`,\n * `href` is a link, `clickable` is a button, and none of those is plain text with no hover.\n *\n * A dismissible chip carries a SECOND button BESIDE the first, never inside it — a button\n * within a button is invalid HTML and unreachable by keyboard.\n *\n * The only JS makes a disabled link inert, the platform having no `disabled` for links, and\n * splits the consumer's attributes between the pill and the element that acts.\n */\n\nimport { computed } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\n// TRAP — neither import may be named after a prop (`check`, `checkIcon`): every top-level\n// binding of a `<script setup>` reaches the template, where it shadows the prop of that name.\nimport { check as checkMark } from '../VIcon/icons/check'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport type { IconSource } from '../VIcon/types'\nimport { useMessages } from '../../i18n/state'\n\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { customColorStyle } from '../../utils/css'\n\n/** How much visual weight the chip carries. */\nexport type ChipVariant = 'soft' | 'solid' | 'outline'\n\n/** What the chip means, in colour. */\nexport type ChipTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\n/** The silhouette: softly rounded, or a full pill. */\nexport type ChipShape = 'chip' | 'pill'\n\n/** The height of the chip: 24 or 32 pixels. */\nexport type ChipSize = 'xs' | 'sm'\n\ninterface ChipProps {\n /**\n * How strongly the chip is painted: a tinted background, the full colour, or a\n * border alone.\n */\n variant?: ChipVariant\n /**\n * What the chip means, expressed as a colour: `neutral` by default, then `accent` for\n * something singled out and `danger`/`success`/`warning` for a state being reported. A\n * chip may report a state where a button may not, which is why it offers five.\n */\n tone?: ChipTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which REPLACES the tone. Every\n * shade it needs — the tinted background, the text, the hover — is derived from that\n * one colour, so it follows the light and the dark theme with nothing to rebuild.\n * Only the contrast of the text on a fully coloured chip is yours to check.\n */\n color?: string\n /** The silhouette: softly rounded corners, or a full pill. */\n shape?: ChipShape\n /** The height of the chip. */\n size?: ChipSize\n /** Takes 4px off the height, leaving the padding, the text and the icons as they are. */\n compact?: boolean\n /** Makes the chip a button that reacts to clicks, without holding a state. */\n clickable?: boolean\n /**\n * Where the chip leads, which makes it a link. A disabled link is made inert by\n * hand.\n */\n href?: string\n /**\n * Makes the chip something that stays chosen, bound to `v-model:selected`. It wins\n * over `href` and `clickable`.\n */\n selectable?: boolean\n /**\n * Shows a tick before the label while the chip is selected. It REPLACES whatever\n * start icon was given, so the two are never shown together.\n */\n check?: boolean\n /** The icon of that tick, a built-in check mark by default. `iconFilled` does not reach it. */\n checkIcon?: IconSource\n /** An icon before the label. The `#start` slot replaces it. */\n iconStart?: IconSource\n /** An icon after the label. The `#end` slot replaces it. */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis). It has\n * no effect on the `#start`/`#end` slots, whose icons the consumer builds, nor on the tick\n * or the removal cross.\n */\n iconFilled?: boolean\n /**\n * Adds a button that asks for the chip to be removed. It only EMITS that request:\n * actually taking the chip away is the consumer's decision.\n */\n dismissible?: boolean\n /** The icon of that removal button. */\n dismissIcon?: IconSource\n /**\n * What the removal button does, in words. It falls back to the design system\n * dictionary.\n */\n dismissLabel?: string\n /** Makes the chip unusable, greyed out through the colour tokens. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ChipProps>(), {\n variant: 'soft',\n tone: 'neutral',\n color: undefined,\n shape: 'chip',\n size: 'xs',\n compact: false,\n clickable: false,\n href: undefined,\n selectable: false,\n check: false,\n checkIcon: () => checkMark,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n dismissible: false,\n dismissIcon: () => closeIcon,\n dismissLabel: undefined,\n disabled: false,\n})\n\nconst m = useMessages()\nconst resolvedDismissLabel = computed(() => props.dismissLabel ?? m.value.common.dismiss)\n\n/**\n * Whether the chip is selected, which is also what makes it selectable at all: binding this\n * turns it into a toggle button and takes precedence over `href` and `clickable`. It starts\n * unselected.\n */\nconst selected = defineModel<boolean>('selected', { default: false })\n\ndefineEmits<{\n /** The removal button was pressed. The chip is still there: removing it is up to you. */\n dismiss: []\n}>()\n\nconst slots = defineSlots<{\n /** The label. It may be left out entirely, which gives a chip made of icons alone. */\n default?(): unknown\n /** Content before the label, which takes the place of `iconStart`. */\n start?(): unknown\n /** Content after the label, which takes the place of `iconEnd`. */\n end?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n// The wrapper-root split: the pill is the box a consumer positions, and the ACTION is the\n// element that is focused, named and clicked, so everything else goes there.\nconst { rootClass, rootStyle: consumerStyle, forwardedAttrs } = useRootAttrs()\n\n/* What the chip does, in order of precedence: staying selected wins over leading\n somewhere, which wins over merely reacting to clicks; asked for none of them, it is\n plain text. A selectable chip is therefore never a link, whatever `href` says. */\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: actionAttrs,\n} = useInertLink({\n href: () => (props.selectable ? undefined : props.href),\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\nconst actionTag = computed(() =>\n props.selectable ? 'button' : isLink.value ? 'a' : props.clickable ? 'button' : 'span',\n)\n\nconst rootStyle = computed<StyleValue>(() => [customColorStyle(props.color), consumerStyle.value])\n\nconst showCheck = computed(() => props.check && props.selectable && selected.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/** An icon and no label at all: the chip becomes a square, as wide as it is tall. */\nfunction iconOnly() {\n return !slots.default && !!(slots.start || slots.end || props.iconStart || props.iconEnd)\n}\n</script>\n\n<template>\n <span\n :class=\"['v-chip v-control v-tone v-variant', rootClass]\"\n :style=\"rootStyle\"\n :data-variant=\"variant\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-selected=\"selectable && selected ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n >\n <component\n :is=\"actionTag\"\n v-bind=\"actionAttrs\"\n class=\"v-chip-action\"\n :type=\"actionTag === 'button' ? 'button' : undefined\"\n :href=\"linkHref\"\n :disabled=\"actionTag === 'button' ? disabled : undefined\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n :aria-pressed=\"selectable ? selected : undefined\"\n @click=\"selectable && !disabled && (selected = !selected)\"\n >\n <VIcon v-if=\"showCheck\" v-bind=\"iconProps(checkIcon)\" />\n <slot v-else name=\"start\">\n <VIcon v-if=\"iconStart\" v-bind=\"iconProps(iconStart)\" :filled=\"iconFilled\" />\n </slot>\n <slot />\n <slot name=\"end\">\n <VIcon v-if=\"iconEnd\" v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </slot>\n </component>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"v-chip-dismiss\"\n :aria-label=\"resolvedDismissLabel\"\n :disabled=\"disabled\"\n @click=\"$emit('dismiss')\"\n >\n <VIcon v-bind=\"iconProps(dismissIcon)\" />\n </button>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The height comes from the shared size class set on this element. The scale itself\n holds five steps; the component's type restricts it to the two smallest, a chip\n larger than that being a button. */\n .v-chip {\n display: inline-flex;\n align-items: center;\n height: var(--control-height);\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-chip);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-chip[data-shape='pill'] {\n border-radius: var(--vectis-radius-pill);\n }\n\n /* The tone table itself lives in styles/tones.css, in a layer below the components.\n All five tones are taken exactly as they come; the only values redefined here are\n those of a custom colour, and they win over the shared table by LAYER rather than\n by order, so no bundling can change the outcome. */\n\n /* A custom colour replaces the tone entirely. Every shade it needs is derived from\n that one colour mixed with the theme's own surface and text, so the same value\n produces a legible chip in the light theme and in the dark one, with nothing to\n rebuild. */\n .v-chip[data-custom] {\n --tone-bg-solid: var(--custom-color);\n --tone-bg-solid-hover: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);\n --tone-bg-solid-active: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);\n /* Fixed white, whatever the colour: on a fully coloured chip the contrast of the\n text is the consumer's to check, as it is in VBadge. */\n --tone-text-solid: var(--vectis-color-text-on-accent);\n --tone-text-tinted: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 30%);\n --tone-bg-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --tone-border-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%);\n }\n\n /* A selected chip is painted in the full colour of its CURRENT tone, whichever variant it\n was given. It COMPOUNDS `.v-variant`: the variant table weighs (0,2,0) like this rule and\n lives in another sheet, so at equal specificity the winner would be whichever one the\n consumer's bundler put last. At (0,3,0) it wins by construction. */\n .v-variant.v-chip[data-selected] {\n background: var(--tone-bg-solid);\n color: var(--tone-text-solid);\n border-color: transparent;\n }\n\n /* Hovering and pressing are conditioned on the ACTION being a real control, which\n buys two things at once: a chip that merely displays a value never lights up, and\n hovering the removal button does not repaint the whole chip as though it were\n about to be activated. */\n /* The same steps as VButton's, rule for rule: an outline sits on the soft surface while\n hovered and one tint further when pressed, and that tint is where a soft chip starts\n on hover. Held in each sheet rather than in `variants.css`, which every consumer\n downloads whether or not it renders a single button or chip. */\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: var(--tone-bg-soft);\n }\n\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ),\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%);\n }\n\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:hover),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:hover) {\n background: var(--tone-bg-solid-hover);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:active),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:active) {\n background: var(--tone-bg-solid-active);\n }\n\n .v-chip-action {\n display: inline-flex;\n align-items: center;\n gap: var(--control-gap);\n height: 100%;\n padding-block: 0;\n padding-inline: var(--control-padding-inline);\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n border-radius: inherit;\n text-decoration: none;\n cursor: default;\n }\n\n /* With an icon and no label the action becomes square, its width taken from its own\n height through the ratio rather than from a new measurement to keep in step. */\n .v-chip[data-icon-only] .v-chip-action {\n aspect-ratio: 1;\n justify-content: center;\n padding-inline: 0;\n }\n\n :is(button, a).v-chip-action {\n cursor: pointer;\n }\n\n :is(button, a).v-chip-action:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The removal button carries no background of its own, not even on hover — the same\n treatment as a field's inner buttons — and the cursor is what signals it can be\n used.\n\n Its icon takes the chip's colour AT FULL strength. Dimming it, as one would\n instinctively do for a secondary control, took the cross down to 3.9:1 on a tinted\n chip and 2.8:1 on a solid one. That matters because the cross is drawn from the\n icon font here, and a glyph from a font is real text, to which the contrast rule\n applies. */\n .v-chip-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--control-action-size);\n height: var(--control-action-size);\n margin-inline: calc(var(--vectis-space-1) * -1) var(--vectis-space-1);\n padding: 0;\n border: none;\n background: transparent;\n color: inherit;\n border-radius: var(--vectis-radius-pill);\n cursor: pointer;\n flex: none;\n }\n\n .v-chip-dismiss:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n /* A disabled chip greys out through the colour tokens, which is what makes it follow\n the dark theme without a rule of its own. */\n .v-variant.v-chip[data-disabled] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n border-color: transparent;\n }\n\n .v-variant.v-chip[data-disabled][data-variant='outline'] {\n background: transparent;\n border-color: var(--vectis-color-border);\n }\n\n .v-chip[data-disabled] :is(:is(button, a).v-chip-action, .v-chip-dismiss) {\n cursor: not-allowed;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-chip {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmHA,IAAM,IAAQ,GAqBR,IAAI,EAAY,GAChB,IAAuB,QAAe,EAAM,gBAAgB,EAAE,MAAM,OAAO,OAAO,GAOlF,IAAW,EAAoB,GAAC,UAA8B,GAO9D,IAAQ,EAAA,GAaR,EAAE,cAAW,WAAW,GAAe,sBAAmB,EAAa,GAKvE,EACJ,WACA,gBACA,aACA,OAAO,MACL,EAAa;GACf,YAAa,EAAM,aAAa,KAAA,IAAY,EAAM;GAClD,aAAa,EAAM;GACnB,aAAa,EAAe;EAC9B,CAAC,GACK,IAAY,QAChB,EAAM,aAAa,WAAW,EAAO,QAAQ,MAAM,EAAM,YAAY,WAAW,MAClF,GAEM,IAAY,QAA2B,CAAC,EAAiB,EAAM,KAAK,GAAG,EAAc,KAAK,CAAC,GAE3F,IAAY,QAAe,EAAM,SAAS,EAAM,cAAc,EAAS,KAAK;EAKlF,SAAS,IAAW;GAClB,OAAO,CAAC,EAAM,WAAW,CAAC,EAAE,EAAM,SAAS,EAAM,OAAO,EAAM,aAAa,EAAM;EACnF;yBAIE,EA2CO,QAAA;GA1CJ,OAAK,EAAA,CAAA,qCAAwC,EAAA,CAAA,CAAS,CAAA;GACtD,OAAK,EAAE,EAAA,KAAS;GAChB,gBAAc,EAAA;GACd,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,cAAY,EAAA;GACZ,aAAW,EAAA;GACX,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAC7B,iBAAe,EAAA,cAAc,EAAA,QAAQ,KAAQ,KAAA;GAC7C,iBAAe,EAAA,WAAQ,KAAQ,KAAA;GAC/B,kBAAgB,EAAQ,IAAA,KAAU,KAAA;YAEnC,EAmBY,EAlBL,EAAA,KAAS,GADhB,EAEU,EAiBE,CAAA,GAjBS;GACnB,OAAM;GACL,MAAM,EAAA,UAAS,WAAA,WAA2B,KAAA;GAC1C,MAAM,EAAA,CAAA;GACN,UAAU,EAAA,UAAS,WAAgB,EAAA,WAAW,KAAA;GAC9C,iBAAe,EAAA,CAAA,IAAW,SAAY,KAAA;GACtC,gBAAc,EAAA,aAAa,EAAA,QAAW,KAAA;GACtC,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,cAAU,CAAK,EAAA,aAAa,EAAA,QAAQ,CAAI,EAAA;;oBAEQ;IAA3C,EAAA,SAAA,EAAA,GAAb,EAAwD,GAAA,EAAA,EAAA,EAAA,KAAA,EAAA,GAAxB,EAAA,CAAA,CAAS,CAAC,EAAA,SAAS,CAAA,CAAA,GAAA,MAAA,EAAA,KACnD,EAEO,EAAA,QAAA,SAAA,CAAA,SAAA,CADQ,EAAA,aAAA,EAAA,GAAb,EAA6E,GAA7E,EAA6E,EAAA,KAAA,EAAA,GAA7C,EAAA,CAAA,CAAS,CAAC,EAAA,SAAS,GAAA,EAAI,QAAQ,EAAA,WAAU,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,KAAA,GAAA,CAAA;IAE3E,EAAQ,EAAA,QAAA,SAAA;IACR,EAEO,EAAA,QAAA,OAAA,CAAA,SAAA,CADQ,EAAA,WAAA,EAAA,GAAb,EAAyE,GAAzE,EAAyE,EAAA,KAAA,EAAA,GAA3C,EAAA,CAAA,CAAS,CAAC,EAAA,OAAO,GAAA,EAAI,QAAQ,EAAA,WAAU,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;;;;;;;;OAIjE,EAAA,eAAA,EAAA,GADR,EASS,UAAA;;GAPP,MAAK;GACL,OAAM;GACL,cAAY,EAAA;GACZ,UAAU,EAAA;GACV,SAAK,AAAA,EAAA,QAAA,MAAEA,EAAAA,MAAK,SAAA;MAEb,EAAyC,GAAA,EAAA,EAA1B,EAAA,CAAA,CAAS,CAAC,EAAA,WAAW,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"VChip.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/VChip/VChip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A small labelled pill standing for a value: a filter in force, a tag, a chosen file, a\n * person picked in a field.\n *\n * What it renders follows what it is asked to DO, each shape being the native element for\n * it, so focus, keyboard and disabling come free: selectable is a button with `aria-pressed`,\n * `href` is a link, `clickable` is a button, and none of those is plain text with no hover.\n *\n * A dismissible chip carries a SECOND button BESIDE the first, never inside it — a button\n * within a button is invalid HTML and unreachable by keyboard.\n *\n * The only JS makes a disabled link inert, the platform having no `disabled` for links, and\n * splits the consumer's attributes between the pill and the element that acts.\n */\n\nimport { computed, onMounted, ref, useAttrs } from 'vue'\nimport type { StyleValue, VNode } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\n// TRAP — neither import may be named after a prop (`check`, `checkIcon`): every top-level\n// binding of a `<script setup>` reaches the template, where it shadows the prop of that name.\nimport { check as checkMark } from '../VIcon/icons/check'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport type { IconSource } from '../VIcon/types'\nimport { useMessages } from '../../i18n/state'\n\nimport { useInertLink } from '../../composables/useInertLink'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\nimport { flattenSlot } from '../../utils/vnode'\n\n/** How much visual weight the chip carries. */\nexport type ChipVariant = 'soft' | 'solid' | 'outline'\n\n/** What the chip means, in colour. */\nexport type ChipTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\n/** The silhouette: softly rounded, or a full pill. */\nexport type ChipShape = 'chip' | 'pill'\n\n/** The height of the chip: 24 or 32 pixels. */\nexport type ChipSize = 'xs' | 'sm'\n\ninterface ChipProps {\n /**\n * How strongly the chip is painted: a tinted background, the full colour, or a\n * border alone.\n */\n variant?: ChipVariant\n /**\n * What the chip means, expressed as a colour: `neutral` by default, then `accent` for\n * something singled out and `danger`/`success`/`warning` for a state being reported. A\n * chip may report a state where a button may not, which is why it offers five.\n */\n tone?: ChipTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which REPLACES the tone. Every\n * shade it needs (the tinted background, the text, the hover) is derived from that\n * one colour, so it follows the light and the dark theme with nothing to rebuild.\n * Only the contrast of the text on a fully coloured chip is yours to check.\n */\n color?: string\n /** The silhouette: softly rounded corners, or a full pill. */\n shape?: ChipShape\n /** The height of the chip. */\n size?: ChipSize\n /** Takes 4px off the height, leaving the padding, the text and the icons as they are. */\n compact?: boolean\n /** Makes the chip a button that reacts to clicks, without holding a state. */\n clickable?: boolean\n /**\n * Where the chip leads, which makes it a link. A disabled link is made inert by\n * hand.\n */\n href?: string\n /**\n * Makes the chip something that stays chosen, bound to `v-model:selected`. It wins\n * over `href` and `clickable`.\n */\n selectable?: boolean\n /**\n * Shows a tick before the label while the chip is selected. It REPLACES whatever\n * start icon was given, so the two are never shown together.\n */\n check?: boolean\n /** The icon of that tick, a built-in check mark by default. `iconFilled` does not reach it. */\n checkIcon?: IconSource\n /** An icon before the label. The `#start` slot replaces it. */\n iconStart?: IconSource\n /** An icon after the label. The `#end` slot replaces it. */\n iconEnd?: IconSource\n /**\n * Renders `iconStart` and `iconEnd` in their filled form (the font's `FILL` axis). It has\n * no effect on the `#start`/`#end` slots, whose icons the consumer builds, nor on the tick\n * or the removal cross.\n */\n iconFilled?: boolean\n /**\n * Adds a button that asks for the chip to be removed. It only EMITS that request:\n * actually taking the chip away is the consumer's decision.\n */\n dismissible?: boolean\n /** The icon of that removal button. */\n dismissIcon?: IconSource\n /**\n * What the removal button does, in words. It falls back to the design system\n * dictionary.\n */\n dismissLabel?: string\n /** Makes the chip unusable, greyed out through the colour tokens. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ChipProps>(), {\n variant: 'soft',\n tone: 'neutral',\n color: undefined,\n shape: 'chip',\n size: 'xs',\n compact: false,\n clickable: false,\n href: undefined,\n selectable: false,\n check: false,\n checkIcon: () => checkMark,\n iconStart: undefined,\n iconEnd: undefined,\n iconFilled: false,\n dismissible: false,\n dismissIcon: () => closeIcon,\n dismissLabel: undefined,\n disabled: false,\n})\n\nconst m = useMessages()\nconst resolvedDismissLabel = computed(() => props.dismissLabel ?? m.value.common.dismiss)\n\n/**\n * Whether the chip is selected, which is also what makes it selectable at all: binding this\n * turns it into a toggle button and takes precedence over `href` and `clickable`. It starts\n * unselected.\n */\nconst selected = defineModel<boolean>('selected', { default: false })\n\ndefineEmits<{\n /** The removal button was pressed. The chip is still there: removing it is up to you. */\n dismiss: []\n}>()\n\nconst slots = defineSlots<{\n /** The label. It may be left out entirely, which gives a chip made of icons alone. */\n default?(): unknown\n /** Content before the label, which takes the place of `iconStart`. */\n start?(): unknown\n /** Content after the label, which takes the place of `iconEnd`. */\n end?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\n// The wrapper-root split: the pill is the box a consumer positions, and the ACTION is the\n// element that is focused, named and clicked, so everything else goes there.\nconst { rootClass, rootStyle: consumerStyle, forwardedAttrs } = useRootAttrs()\n\n/* What the chip does, in order of precedence: staying selected wins over leading\n somewhere, which wins over merely reacting to clicks; asked for none of them, it is\n plain text. A selectable chip is therefore never a link, whatever `href` says. */\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: actionAttrs,\n} = useInertLink({\n href: () => (props.selectable ? undefined : props.href),\n inert: () => props.disabled,\n attrs: () => forwardedAttrs.value,\n})\nconst actionTag = computed(() =>\n props.selectable ? 'button' : isLink.value ? 'a' : props.clickable ? 'button' : 'span',\n)\n\nconst rootStyle = computed<StyleValue>(() => [customColorStyle(props.color), consumerStyle.value])\n\nconst actionEl = ref<HTMLElement | null>(null)\n\nconst showCheck = computed(() => props.check && props.selectable && selected.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 and no label at all: the chip becomes a square, as wide as it is tall. The default\n * slot is asked what it RENDERS, not whether it was passed: a wrapper forwarding an empty\n * label still hands one down.\n */\nfunction iconOnly() {\n return (\n flattenSlot(slots.default?.() as VNode[] | undefined).length === 0 &&\n !!(slots.start || slots.end || props.iconStart || props.iconEnd)\n )\n}\n\n// @devwarn\n// A chip drawn with an icon alone has no accessible name: the icon is decorative, so a\n// clickable, selectable or linked one is announced as a bare button or link. Nothing fails\n// visibly, hence the message. Read once, on mount, off the rendered pill: calling the slot\n// here, outside the render, would draw a Vue warning of its own.\nif (isDev) {\n const attrs = useAttrs()\n onMounted(() => {\n if (\n actionTag.value !== 'span' &&\n actionEl.value?.parentElement?.hasAttribute('data-icon-only') &&\n attrs['aria-label'] === undefined &&\n attrs['aria-labelledby'] === undefined\n ) {\n console.warn(\n '[VChip] a chip made of an icon alone has no accessible name: set aria-label or aria-labelledby on it.',\n )\n }\n })\n}\n\n// A template ref on the chip reaches the pill, a layout box; the element that is focused,\n// named and clicked is the action inside it.\ndefineExpose({\n /** Moves the focus to the chip's action: its button or link. */\n focus: (options?: FocusOptions) => actionEl.value?.focus(options),\n /** The action element, which is also where the consumer's attributes land. */\n el: actionEl,\n})\n</script>\n\n<template>\n <span\n :class=\"['v-chip v-control v-tone v-variant', rootClass]\"\n :style=\"rootStyle\"\n :data-variant=\"variant\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-selected=\"selectable && selected ? '' : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-icon-only=\"iconOnly() ? '' : undefined\"\n >\n <component\n :is=\"actionTag\"\n ref=\"actionEl\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n :aria-pressed=\"selectable ? selected : undefined\"\n v-bind=\"actionAttrs\"\n class=\"v-chip-action\"\n :type=\"actionTag === 'button' ? 'button' : undefined\"\n :href=\"linkHref\"\n :disabled=\"actionTag === 'button' ? disabled : undefined\"\n @click=\"selectable && !disabled && (selected = !selected)\"\n >\n <VIcon v-if=\"showCheck\" v-bind=\"iconProps(checkIcon)\" />\n <slot v-else name=\"start\">\n <VIcon v-if=\"iconStart\" v-bind=\"iconProps(iconStart)\" :filled=\"iconFilled\" />\n </slot>\n <slot />\n <slot name=\"end\">\n <VIcon v-if=\"iconEnd\" v-bind=\"iconProps(iconEnd)\" :filled=\"iconFilled\" />\n </slot>\n </component>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"v-chip-dismiss\"\n :aria-label=\"resolvedDismissLabel\"\n :disabled=\"disabled\"\n @click=\"$emit('dismiss')\"\n >\n <VIcon v-bind=\"iconProps(dismissIcon)\" />\n </button>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The height comes from the shared size class set on this element. The scale itself\n holds five steps; the component's type restricts it to the two smallest, a chip\n larger than that being a button. */\n .v-chip {\n display: inline-flex;\n align-items: center;\n block-size: var(--control-height);\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-chip);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-chip[data-shape='pill'] {\n border-radius: var(--vectis-radius-pill);\n }\n\n /* The tone table itself lives in styles/tones.css, in a layer below the components.\n All five tones are taken exactly as they come; the only values redefined here are\n those of a custom colour, and they win over the shared table by LAYER rather than\n by order, so no bundling can change the outcome. */\n\n /* A custom colour replaces the tone entirely. The shared table derives the four values\n every adopter reads (styles/tones.css, `.v-tone[data-custom]`); the chip adds the\n three only it paints, its hover and active steps and its outline, from the same colour\n mixed with the theme's own text and surface. */\n .v-chip[data-custom] {\n --tone-bg-solid-hover: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 8%);\n --tone-bg-solid-active: color-mix(in oklab, var(--custom-color), var(--vectis-color-text) 14%);\n --tone-border-soft: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 60%);\n }\n\n /* A selected chip is painted in the full colour of its CURRENT tone, whichever variant it\n was given. It COMPOUNDS `.v-variant`: the variant table weighs (0,2,0) like this rule and\n lives in another sheet, so at equal specificity the winner would be whichever one the\n consumer's bundler put last. At (0,3,0) it wins by construction. */\n .v-variant.v-chip[data-selected] {\n background: var(--tone-bg-solid);\n color: var(--tone-text-solid);\n border-color: transparent;\n }\n\n /* Hovering and pressing are conditioned on the ACTION being a real control, which\n buys two things at once: a chip that merely displays a value never lights up, and\n hovering the removal button does not repaint the whole chip as though it were\n about to be activated. */\n /* The same steps as VButton's, rule for rule: an outline sits on the soft surface while\n hovered and one tint further when pressed, and that tint is where a soft chip starts\n on hover. Held in each sheet rather than in `variants.css`, which every consumer\n downloads whether or not it renders a single button or chip. */\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: var(--tone-bg-soft);\n }\n\n .v-chip[data-variant='outline']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ),\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:hover\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 8%);\n }\n\n .v-chip[data-variant='soft']:not([data-disabled], [data-selected]):has(\n :is(button, a).v-chip-action:active\n ) {\n background: color-mix(in oklab, var(--tone-bg-soft), var(--tone-text-tinted) 14%);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:hover),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:hover) {\n background: var(--tone-bg-solid-hover);\n }\n\n .v-chip[data-variant='solid']:not([data-disabled]):has(:is(button, a).v-chip-action:active),\n .v-chip[data-selected]:not([data-disabled]):has(:is(button, a).v-chip-action:active) {\n background: var(--tone-bg-solid-active);\n }\n\n .v-chip-action {\n display: inline-flex;\n align-items: center;\n gap: var(--control-gap);\n block-size: 100%;\n padding-block: 0;\n padding-inline: var(--control-padding-inline);\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n border-radius: inherit;\n text-decoration: none;\n cursor: default;\n }\n\n /* With an icon and no label the action becomes square, its width taken from its own\n height through the ratio rather than from a new measurement to keep in step. */\n .v-chip[data-icon-only] .v-chip-action {\n aspect-ratio: 1;\n justify-content: center;\n padding-inline: 0;\n }\n\n :is(button, a).v-chip-action {\n cursor: pointer;\n }\n\n :is(button, a).v-chip-action:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The removal button carries no background of its own, not even on hover — the same\n treatment as a field's inner buttons — and the cursor is what signals it can be\n used.\n\n Its icon takes the chip's colour AT FULL strength. Dimming it, as one would\n instinctively do for a secondary control, took the cross down to 3.9:1 on a tinted\n chip and 2.8:1 on a solid one. That matters because the cross is drawn from the\n icon font here, and a glyph from a font is real text, to which the contrast rule\n applies. */\n .v-chip-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-action-size);\n block-size: var(--control-action-size);\n margin-inline: calc(var(--vectis-space-1) * -1) var(--vectis-space-1);\n padding: 0;\n border: none;\n background: transparent;\n color: inherit;\n border-radius: var(--vectis-radius-pill);\n cursor: pointer;\n flex: none;\n }\n\n .v-chip-dismiss:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n /* A disabled chip greys out through the colour tokens, which is what makes it follow\n the dark theme without a rule of its own. */\n .v-variant.v-chip[data-disabled] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n border-color: transparent;\n }\n\n .v-variant.v-chip[data-disabled][data-variant='outline'] {\n background: transparent;\n border-color: var(--vectis-color-border);\n }\n\n .v-chip[data-disabled] :is(:is(button, a).v-chip-action, .v-chip-dismiss) {\n cursor: not-allowed;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-chip {\n transition: none;\n }\n }\n\n /*\n * Windows forced colors replace every background with the page's, so a selected chip would look\n * exactly like the others there: the fill is its only cue, the state being in an ARIA\n * attribute a sighted reader never sees. It takes the system's own selection pair\n * instead, and opts out of the forcing for that element alone so the pair is painted.\n *\n * TRAP — the class is repeated to reach (0,6,0). The variant, hover and active rules\n * reach (0,5,0), and with the forcing turned off any of them that still won would paint\n * its tone over the selection, with HighlightText on top of it.\n */\n @media (forced-colors: active) {\n .v-chip.v-chip.v-chip.v-chip[data-selected]:not([data-disabled]) {\n forced-color-adjust: none;\n background-color: Highlight;\n color: HighlightText;\n border-color: Highlight;\n outline-color: CanvasText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqHA,IAAM,IAAQ,GAqBR,IAAI,EAAY,GAChB,IAAuB,QAAe,EAAM,gBAAgB,EAAE,MAAM,OAAO,OAAO,GAOlF,IAAW,EAAoB,GAAC,UAA8B,GAO9D,IAAQ,EAAA,GAaR,EAAE,cAAW,WAAW,GAAe,sBAAmB,EAAa,GAKvE,EACJ,WACA,gBACA,aACA,OAAO,MACL,EAAa;GACf,YAAa,EAAM,aAAa,KAAA,IAAY,EAAM;GAClD,aAAa,EAAM;GACnB,aAAa,EAAe;EAC9B,CAAC,GACK,IAAY,QAChB,EAAM,aAAa,WAAW,EAAO,QAAQ,MAAM,EAAM,YAAY,WAAW,MAClF,GAEM,IAAY,QAA2B,CAAC,EAAiB,EAAM,KAAK,GAAG,EAAc,KAAK,CAAC,GAE3F,IAAW,EAAwB,IAAI,GAEvC,IAAY,QAAe,EAAM,SAAS,EAAM,cAAc,EAAS,KAAK;EASlF,SAAS,IAAW;GAClB,OACE,EAAY,EAAM,UAAU,CAAwB,CAAC,CAAC,WAAW,KACjE,CAAC,EAAE,EAAM,SAAS,EAAM,OAAO,EAAM,aAAa,EAAM;EAE5D;EAOA,IAAI,GAAO;GACT,IAAM,IAAQ,EAAS;GACvB,QAAgB;IACd,AACE,EAAU,UAAU,UACpB,EAAS,OAAO,eAAe,aAAa,gBAAgB,KAC5D,EAAM,kBAAkB,KAAA,KACxB,EAAM,uBAAuB,KAAA,KAE7B,QAAQ,KACN,uGACF;GAEJ,CAAC;EACH;SAIA,EAAa;GAEX,QAAQ,MAA2B,EAAS,OAAO,MAAM,CAAO;GAEhE,IAAI;EACN,CAAC,mBAIC,EA4CO,QAAA;GA3CJ,OAAK,EAAA,CAAA,qCAAwC,EAAA,CAAA,CAAS,CAAA;GACtD,OAAK,EAAE,EAAA,KAAS;GAChB,gBAAc,EAAA;GACd,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,cAAY,EAAA;GACZ,aAAW,EAAA;GACX,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAC7B,iBAAe,EAAA,cAAc,EAAA,QAAQ,KAAQ,KAAA;GAC7C,iBAAe,EAAA,WAAQ,KAAQ,KAAA;GAC/B,kBAAgB,EAAQ,IAAA,KAAU,KAAA;YAEnC,EAoBY,EAnBL,EAAA,KAAS,GADhB,EAoBY;YAlBN;GAAJ,KAAI;GACH,iBAAe,EAAA,CAAA,IAAW,SAAY,KAAA;GACtC,gBAAc,EAAA,aAAa,EAAA,QAAW,KAAA;KAC/B,EAAA,CAAA,GAAW;GACnB,OAAM;GACL,MAAM,EAAA,UAAS,WAAA,WAA2B,KAAA;GAC1C,MAAM,EAAA,CAAA;GACN,UAAU,EAAA,UAAS,WAAgB,EAAA,WAAW,KAAA;GAC9C,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,cAAU,CAAK,EAAA,aAAa,EAAA,QAAQ,CAAI,EAAA;;oBAEQ;IAA3C,EAAA,SAAA,EAAA,GAAb,EAAwD,GAAA,EAAA,EAAA,EAAA,KAAA,EAAA,GAAxB,EAAA,CAAA,CAAS,CAAC,EAAA,SAAS,CAAA,CAAA,GAAA,MAAA,EAAA,KACnD,EAEO,EAAA,QAAA,SAAA,CAAA,SAAA,CADQ,EAAA,aAAA,EAAA,GAAb,EAA6E,GAA7E,EAA6E,EAAA,KAAA,EAAA,GAA7C,EAAA,CAAA,CAAS,CAAC,EAAA,SAAS,GAAA,EAAI,QAAQ,EAAA,WAAU,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,KAAA,GAAA,CAAA;IAE3E,EAAQ,EAAA,QAAA,SAAA;IACR,EAEO,EAAA,QAAA,OAAA,CAAA,SAAA,CADQ,EAAA,WAAA,EAAA,GAAb,EAAyE,GAAzE,EAAyE,EAAA,KAAA,EAAA,GAA3C,EAAA,CAAA,CAAS,CAAC,EAAA,OAAO,GAAA,EAAI,QAAQ,EAAA,WAAU,CAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;;;;;;;;OAIjE,EAAA,eAAA,EAAA,GADR,EASS,UAAA;;GAPP,MAAK;GACL,OAAM;GACL,cAAY,EAAA;GACZ,UAAU,EAAA;GACV,SAAK,AAAA,EAAA,QAAA,MAAEA,EAAAA,MAAK,SAAA;MAEb,EAAyC,GAAA,EAAA,EAA1B,EAAA,CAAA,CAAS,CAAC,EAAA,WAAW,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-combobox{anchor-scope:--combobox-anchor;width:100%;font-family:var(--vectis-text-family)}.v-combobox-control{display:block}.v-combobox-control .v-input-field{anchor-name:--combobox-anchor}.v-combobox-panel{max-block-size:var(--vectis-control-size-combobox-list-max-block);overflow:auto}.v-combobox-chevron,.v-combobox-spinner{color:var(--vectis-color-text-muted)}.v-combobox-chevron{transition:rotate var(--vectis-duration-fast) var(--vectis-ease-default)}.v-combobox[data-open] .v-combobox-chevron{rotate:180deg}.v-combobox[data-collapsed] .v-input-control{width:0;height:0;padding:0;position:absolute}.v-combobox-text{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;overflow:hidden}.v-combobox:not([data-collapsed]) .v-combobox-text{max-inline-size:50%}.v-combobox-overflow{white-space:nowrap;color:var(--vectis-color-text-muted);flex:none}.v-combobox:has(.v-combobox-text){min-inline-size:0}.v-combobox-state{align-items:center;gap:var(--control-gap);min-height:var(--control-height);padding:var(--vectis-space-1) var(--control-padding-inline);font-size:var(--control-font-size);color:var(--vectis-color-text-muted);flex:none;display:flex}.v-combobox-more{min-height:var(--vectis-space-6);color:var(--vectis-color-text-muted);flex:none;justify-content:center;align-items:center;display:flex}@media (prefers-reduced-motion:reduce){.v-combobox-chevron{transition:none}}}
2
+ @layer vectis.components{.v-combobox{anchor-scope:--combobox-anchor;width:100%;font-family:var(--vectis-text-family)}.v-combobox-control{display:block}.v-combobox-control .v-input-field{anchor-name:--combobox-anchor}.v-combobox-panel{max-block-size:var(--vectis-control-size-combobox-list-max-block);overflow:auto}.v-combobox-chevron,.v-combobox-spinner{color:var(--vectis-color-text-muted)}.v-combobox-chevron{transition:rotate var(--vectis-duration-fast) var(--vectis-ease-default)}.v-combobox[data-open] .v-combobox-chevron{rotate:180deg}.v-combobox[data-collapsed] .v-input-control{width:0;height:0;padding:0;position:absolute}.v-combobox-text{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;overflow:hidden}.v-combobox:not([data-collapsed]) .v-combobox-text{max-inline-size:50%}.v-combobox-overflow{white-space:nowrap;color:var(--vectis-color-text-muted);flex:none}.v-combobox:has(.v-combobox-text){min-inline-size:0}.v-combobox-state{align-items:center;gap:var(--control-gap);min-height:var(--control-height);padding:var(--vectis-space-1) var(--control-padding-inline);font-size:var(--control-font-size);color:var(--vectis-color-text-muted);flex:none;display:flex}.v-combobox-more{min-height:var(--vectis-control-height-xs);color:var(--vectis-color-text-muted);flex:none;justify-content:center;align-items:center;display:flex}@media (prefers-reduced-motion:reduce){.v-combobox-chevron{transition:none}}}