vectis-ui 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/dist/components/VAccordion/VAccordion.css +1 -1
  2. package/dist/components/VAccordion/VAccordion.d.ts +0 -6
  3. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -8
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  8. package/dist/components/VAccordion/context.js.map +1 -1
  9. package/dist/components/VAlert/VAlert.js.map +1 -1
  10. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/components/VAvatar/VAvatar.d.ts +0 -3
  12. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  13. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +21 -27
  14. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/VAvatar/VAvatarGroup.d.ts +0 -6
  16. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +5 -19
  18. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/context.d.ts +0 -1
  20. package/dist/components/VAvatar/context.js.map +1 -1
  21. package/dist/components/VBadge/VBadge.js.map +1 -1
  22. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +1 -1
  23. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  25. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/components/VButton/VButton.d.ts +0 -6
  27. package/dist/components/VButton/VButton.js.map +1 -1
  28. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +11 -17
  29. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VButton/VButtonGroup.d.ts +0 -6
  31. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  32. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +0 -7
  33. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/VButton/context.d.ts +0 -2
  35. package/dist/components/VButton/context.js.map +1 -1
  36. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  37. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  39. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  41. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +5 -17
  42. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  44. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +19 -31
  45. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  47. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/components/VCalendar/color.js.map +1 -1
  49. package/dist/components/VCalendar/edgeStep.js +1 -5
  50. package/dist/components/VCalendar/edgeStep.js.map +1 -1
  51. package/dist/components/VCalendar/gesture.js +4 -12
  52. package/dist/components/VCalendar/gesture.js.map +1 -1
  53. package/dist/components/VCalendar/keyboard.js.map +1 -1
  54. package/dist/components/VCalendar/layout.js +8 -12
  55. package/dist/components/VCalendar/layout.js.map +1 -1
  56. package/dist/components/VCalendar/timeGrid.js +5 -5
  57. package/dist/components/VCalendar/timeGrid.js.map +1 -1
  58. package/dist/components/VCard/VCard.js.map +1 -1
  59. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  60. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  61. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  63. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  64. package/dist/components/VCarousel/context.js.map +1 -1
  65. package/dist/components/VCheckbox/VCheckMark.js.map +1 -1
  66. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  68. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/VChip/VChip.d.ts +0 -3
  70. package/dist/components/VChip/VChip.js.map +1 -1
  71. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +0 -6
  72. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/components/VColorInput/VColorInput.d.ts +0 -3
  74. package/dist/components/VColorInput/VColorInput.js.map +1 -1
  75. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +3 -9
  76. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  77. package/dist/components/VColorPicker/VColorPicker.js.map +1 -1
  78. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +1 -5
  79. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/VColorPicker/color.js.map +1 -1
  81. package/dist/components/VCombobox/VCombobox.d.ts +0 -3
  82. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  83. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +100 -119
  84. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -1
  86. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +0 -1
  87. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -1
  89. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +1 -5
  90. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/VContextMenu/VContextMenu.d.ts +0 -3
  92. package/dist/components/VContextMenu/VContextMenu.js.map +1 -1
  93. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +3 -11
  94. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  95. package/dist/components/VDataTable/VDataTable.css +1 -1
  96. package/dist/components/VDataTable/VDataTable.d.ts +0 -2
  97. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  98. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +69 -88
  99. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VDateInput/VDateInput.d.ts +0 -3
  101. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  102. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +5 -10
  103. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  104. package/dist/components/VDateInput/mask.js.map +1 -1
  105. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  106. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +2 -1
  107. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  109. package/dist/components/VDatePicker/names.js.map +1 -1
  110. package/dist/components/VDialog/VDialog.js.map +1 -1
  111. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  113. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDrawer/VDrawer.js.map +1 -1
  115. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  116. package/dist/components/VEmptyState/VEmptyState.js.map +1 -1
  117. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/components/VField/VField.js.map +1 -1
  119. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VField/VFieldAnnouncer.js.map +1 -1
  121. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VField/VFieldMessage.js.map +1 -1
  123. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  124. package/dist/components/VFieldset/VFieldset.js.map +1 -1
  125. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -1
  126. package/dist/components/VFileInput/VFileInput.d.ts +0 -5
  127. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  128. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +54 -65
  129. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/components/VFileInput/truncate.js.map +1 -1
  131. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  132. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +1 -1
  133. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  134. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  135. package/dist/components/VHotkeys/VHotkeys.d.ts +0 -3
  136. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  137. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +0 -6
  138. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  139. package/dist/components/VHotkeys/platform.js +1 -1
  140. package/dist/components/VHotkeys/platform.js.map +1 -1
  141. package/dist/components/VHoverCard/VHoverCard.js.map +1 -1
  142. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +2 -12
  143. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  144. package/dist/components/VIcon/VIcon.js.map +1 -1
  145. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  146. package/dist/components/VIcon/iconProps.js.map +1 -1
  147. package/dist/components/VIcon/icons/add.js.map +1 -1
  148. package/dist/components/VIcon/icons/arrow_downward.js.map +1 -1
  149. package/dist/components/VIcon/icons/arrow_downward_alt.js.map +1 -1
  150. package/dist/components/VIcon/icons/arrow_drop_down.js.map +1 -1
  151. package/dist/components/VIcon/icons/arrow_drop_up.js.map +1 -1
  152. package/dist/components/VIcon/icons/arrow_left_alt.js.map +1 -1
  153. package/dist/components/VIcon/icons/arrow_right_alt.js.map +1 -1
  154. package/dist/components/VIcon/icons/arrow_upward.js.map +1 -1
  155. package/dist/components/VIcon/icons/arrow_upward_alt.js.map +1 -1
  156. package/dist/components/VIcon/icons/attach_file.js.map +1 -1
  157. package/dist/components/VIcon/icons/audio_file.js.map +1 -1
  158. package/dist/components/VIcon/icons/calendar_today.js.map +1 -1
  159. package/dist/components/VIcon/icons/check.js.map +1 -1
  160. package/dist/components/VIcon/icons/check_circle.js.map +1 -1
  161. package/dist/components/VIcon/icons/chevron_left.js.map +1 -1
  162. package/dist/components/VIcon/icons/chevron_right.js.map +1 -1
  163. package/dist/components/VIcon/icons/close.js.map +1 -1
  164. package/dist/components/VIcon/icons/cloud_upload.js.map +1 -1
  165. package/dist/components/VIcon/icons/code.js.map +1 -1
  166. package/dist/components/VIcon/icons/colorize.js.map +1 -1
  167. package/dist/components/VIcon/icons/description.js.map +1 -1
  168. package/dist/components/VIcon/icons/error.js.map +1 -1
  169. package/dist/components/VIcon/icons/expand_less.js.map +1 -1
  170. package/dist/components/VIcon/icons/expand_more.js.map +1 -1
  171. package/dist/components/VIcon/icons/first_page.js.map +1 -1
  172. package/dist/components/VIcon/icons/folder_zip.js.map +1 -1
  173. package/dist/components/VIcon/icons/image.js.map +1 -1
  174. package/dist/components/VIcon/icons/inbox.js.map +1 -1
  175. package/dist/components/VIcon/icons/index.js.map +1 -1
  176. package/dist/components/VIcon/icons/info.js.map +1 -1
  177. package/dist/components/VIcon/icons/last_page.js.map +1 -1
  178. package/dist/components/VIcon/icons/more_horiz.js.map +1 -1
  179. package/dist/components/VIcon/icons/names.js.map +1 -1
  180. package/dist/components/VIcon/icons/notifications.js.map +1 -1
  181. package/dist/components/VIcon/icons/open_in_new.js.map +1 -1
  182. package/dist/components/VIcon/icons/picture_as_pdf.js.map +1 -1
  183. package/dist/components/VIcon/icons/priority_high.js.map +1 -1
  184. package/dist/components/VIcon/icons/remove.js.map +1 -1
  185. package/dist/components/VIcon/icons/schedule.js.map +1 -1
  186. package/dist/components/VIcon/icons/search.js.map +1 -1
  187. package/dist/components/VIcon/icons/search_off.js.map +1 -1
  188. package/dist/components/VIcon/icons/star.js.map +1 -1
  189. package/dist/components/VIcon/icons/swap_vert.js.map +1 -1
  190. package/dist/components/VIcon/icons/table_chart.js.map +1 -1
  191. package/dist/components/VIcon/icons/video_file.js.map +1 -1
  192. package/dist/components/VIcon/icons/viewBox.js.map +1 -1
  193. package/dist/components/VIcon/icons/warning.js.map +1 -1
  194. package/dist/components/VIcon/resolver.js.map +1 -1
  195. package/dist/components/VIconButton/VIconButton.d.ts +0 -3
  196. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  197. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +0 -6
  198. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  199. package/dist/components/VInput/VInput.css +1 -1
  200. package/dist/components/VInput/VInput.d.ts +0 -3
  201. package/dist/components/VInput/VInput.js.map +1 -1
  202. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +2 -8
  203. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  204. package/dist/components/VInput/VInputGroup.d.ts +0 -3
  205. package/dist/components/VInput/VInputGroup.js.map +1 -1
  206. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +0 -7
  207. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  208. package/dist/components/VInput/context.d.ts +0 -2
  209. package/dist/components/VInput/context.js.map +1 -1
  210. package/dist/components/VInputOTP/VInputOTP.d.ts +0 -3
  211. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  212. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +2 -14
  213. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/components/VLink/VLink.js.map +1 -1
  215. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/components/VListbox/VListboxChevron.js.map +1 -1
  217. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -1
  218. package/dist/components/VListbox/VListboxGroup.js.map +1 -1
  219. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VListbox/VListboxOption.js.map +1 -1
  221. package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/components/VListbox/VListboxPanel.d.ts +0 -3
  223. package/dist/components/VListbox/VListboxPanel.js.map +1 -1
  224. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +0 -6
  225. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  226. package/dist/components/VListbox/VListboxSeparator.js.map +1 -1
  227. package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VListbox/VListboxValues.js.map +1 -1
  229. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +4 -14
  230. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/components/VMenu/VMenu.d.ts +0 -3
  232. package/dist/components/VMenu/VMenu.js.map +1 -1
  233. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +0 -6
  234. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  236. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  237. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  238. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +6 -12
  239. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  240. package/dist/components/VMenu/VMenuPanel.d.ts +0 -3
  241. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  242. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +9 -16
  243. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  244. package/dist/components/VMenu/VMenuSeparator.js.map +1 -1
  245. package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  246. package/dist/components/VMenu/context.js.map +1 -1
  247. package/dist/components/VMeter/VMeter.js.map +1 -1
  248. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/components/VNumberInput/VNumberInput.d.ts +0 -3
  250. package/dist/components/VNumberInput/VNumberInput.js.map +1 -1
  251. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +85 -90
  252. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  253. package/dist/components/VNumberInput/number.js.map +1 -1
  254. package/dist/components/VPagination/VPagination.d.ts +0 -3
  255. package/dist/components/VPagination/VPagination.js.map +1 -1
  256. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +0 -6
  257. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  258. package/dist/components/VPopover/VPopover.js.map +1 -1
  259. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  260. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  261. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  262. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  263. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  264. package/dist/components/VRadio/VRadio.js.map +1 -1
  265. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VRating/VRating.js.map +1 -1
  267. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/components/VResizable/VResizable.js.map +1 -1
  269. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +8 -6
  270. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  271. package/dist/components/VResizable/VResizablePanel.js.map +1 -1
  272. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  273. package/dist/components/VResizable/context.js.map +1 -1
  274. package/dist/components/VResizable/layout.js.map +1 -1
  275. package/dist/components/VSelect/VSelect.d.ts +0 -3
  276. package/dist/components/VSelect/VSelect.js.map +1 -1
  277. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +80 -90
  278. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  279. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  280. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  281. package/dist/components/VSideNavigation/VSideNavigation.d.ts +0 -6
  282. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  283. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +2 -11
  284. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  285. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  286. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  287. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  288. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +1 -5
  289. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  290. package/dist/components/VSideNavigation/VSideNavigationSeparator.js.map +1 -1
  291. package/dist/components/VSideNavigation/context.js.map +1 -1
  292. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +0 -3
  293. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  294. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +0 -6
  295. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  296. package/dist/components/VSlider/VSlider.js.map +1 -1
  297. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +107 -112
  298. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  300. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  301. package/dist/components/VSnackbar/state.js.map +1 -1
  302. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  303. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  304. package/dist/components/VSplitButton/VSplitButton.d.ts +0 -3
  305. package/dist/components/VSplitButton/VSplitButton.js.map +1 -1
  306. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +0 -6
  307. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VStepper/VStepper.js.map +1 -1
  309. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  310. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  311. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  312. package/dist/components/VTabs/VTab.js.map +1 -1
  313. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +0 -2
  314. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  316. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  317. package/dist/components/VTabs/VTabs.css +1 -1
  318. package/dist/components/VTabs/VTabs.d.ts +0 -3
  319. package/dist/components/VTabs/VTabs.js.map +1 -1
  320. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +2 -15
  321. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  322. package/dist/components/VTabs/context.d.ts +0 -2
  323. package/dist/components/VTabs/context.js.map +1 -1
  324. package/dist/components/VTextarea/VTextarea.d.ts +0 -6
  325. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  326. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +0 -6
  327. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  328. package/dist/components/VTimeInput/VTimeInput.d.ts +0 -3
  329. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  330. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +197 -204
  331. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  332. package/dist/components/VTimeInput/search.js.map +1 -1
  333. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  334. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +9 -9
  335. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  336. package/dist/components/VTimePicker/limits.js.map +1 -1
  337. package/dist/components/VTimeline/VTimeline.js.map +1 -1
  338. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -1
  339. package/dist/components/VTimeline/VTimelineItem.js.map +1 -1
  340. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  341. package/dist/components/VTimeline/context.js.map +1 -1
  342. package/dist/components/VTimeline/datetime.js.map +1 -1
  343. package/dist/components/VToast/VToast.js.map +1 -1
  344. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  345. package/dist/components/VToast/VToaster.js.map +1 -1
  346. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +1 -1
  347. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  348. package/dist/components/VToast/state.js.map +1 -1
  349. package/dist/components/VToggle/VToggle.d.ts +0 -3
  350. package/dist/components/VToggle/VToggle.js.map +1 -1
  351. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +1 -13
  352. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.js.map +1 -1
  356. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  358. package/dist/components/VTreeView/VTreeView.js.map +1 -1
  359. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +1 -5
  360. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  361. package/dist/components/VTypography/VTypography.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  363. package/dist/components/VVirtualList/VVirtualList.js.map +1 -1
  364. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useChoice.js.map +1 -1
  367. package/dist/composables/useClearable.js.map +1 -1
  368. package/dist/composables/useControlShape.d.ts +1 -5
  369. package/dist/composables/useControlShape.js +0 -1
  370. package/dist/composables/useControlShape.js.map +1 -1
  371. package/dist/composables/useDebouncedSearch.js.map +1 -1
  372. package/dist/composables/useDetailsOpen.js.map +1 -1
  373. package/dist/composables/useEscapeDismiss.js.map +1 -1
  374. package/dist/composables/useFieldIds.js.map +1 -1
  375. package/dist/composables/useFieldPanel.js +3 -7
  376. package/dist/composables/useFieldPanel.js.map +1 -1
  377. package/dist/composables/useFileDrop.js.map +1 -1
  378. package/dist/composables/useFileField.js +2 -2
  379. package/dist/composables/useFileField.js.map +1 -1
  380. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  381. package/dist/composables/useHotkeyListener.js.map +1 -1
  382. package/dist/composables/useIconClickHandlers.js.map +1 -1
  383. package/dist/composables/useInertLink.js.map +1 -1
  384. package/dist/composables/useInfiniteScroll.js +2 -2
  385. package/dist/composables/useInfiniteScroll.js.map +1 -1
  386. package/dist/composables/useListbox.d.ts +0 -1
  387. package/dist/composables/useListbox.js +4 -10
  388. package/dist/composables/useListbox.js.map +1 -1
  389. package/dist/composables/useLiveAnnouncer.js.map +1 -1
  390. package/dist/composables/useMaskedField.js +28 -48
  391. package/dist/composables/useMaskedField.js.map +1 -1
  392. package/dist/composables/useModalDialog.js +1 -1
  393. package/dist/composables/useModalDialog.js.map +1 -1
  394. package/dist/composables/usePopover.js +1 -1
  395. package/dist/composables/usePopover.js.map +1 -1
  396. package/dist/composables/useProgressValue.js.map +1 -1
  397. package/dist/composables/useRootAttrs.js.map +1 -1
  398. package/dist/composables/useSlotNodes.js.map +1 -1
  399. package/dist/composables/useTextLimit.js.map +1 -1
  400. package/dist/composables/useTimer.js.map +1 -1
  401. package/dist/composables/useTypeahead.js.map +1 -1
  402. package/dist/composables/useVirtualList.js.map +1 -1
  403. package/dist/i18n/en.js.map +1 -1
  404. package/dist/i18n/fr.js.map +1 -1
  405. package/dist/i18n/state.js.map +1 -1
  406. package/dist/styles.css +1 -1
  407. package/dist/tokens/css.js.map +1 -1
  408. package/dist/tokens/index.d.ts +3 -0
  409. package/dist/tokens/index.js.map +1 -1
  410. package/dist/tokens/primitives.js.map +1 -1
  411. package/dist/tokens/semantic.d.ts +3 -0
  412. package/dist/tokens/semantic.js +6 -5
  413. package/dist/tokens/semantic.js.map +1 -1
  414. package/dist/tokens/themes/dark.js.map +1 -1
  415. package/dist/tokens/types.js.map +1 -1
  416. package/dist/tokens.json +12 -5
  417. package/dist/types.d.ts +0 -2
  418. package/dist/utils/array.js.map +1 -1
  419. package/dist/utils/arrowNav.js.map +1 -1
  420. package/dist/utils/attrs.js.map +1 -1
  421. package/dist/utils/chip.d.ts +4 -6
  422. package/dist/utils/chip.js +8 -5
  423. package/dist/utils/chip.js.map +1 -1
  424. package/dist/utils/clock.js +3 -1
  425. package/dist/utils/clock.js.map +1 -1
  426. package/dist/utils/css.js +1 -1
  427. package/dist/utils/css.js.map +1 -1
  428. package/dist/utils/date.js.map +1 -1
  429. package/dist/utils/direction.js.map +1 -1
  430. package/dist/utils/env.js.map +1 -1
  431. package/dist/utils/file.js +13 -31
  432. package/dist/utils/file.js.map +1 -1
  433. package/dist/utils/focus.js.map +1 -1
  434. package/dist/utils/hostWarns.js.map +1 -1
  435. package/dist/utils/ids.js.map +1 -1
  436. package/dist/utils/matcher.js.map +1 -1
  437. package/dist/utils/memo.js.map +1 -1
  438. package/dist/utils/number.js.map +1 -1
  439. package/dist/utils/text.js.map +1 -1
  440. package/dist/utils/time.js.map +1 -1
  441. package/dist/utils/vnode.js.map +1 -1
  442. package/package.json +19 -19
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-accordion{--accordion-pad-delta:0px;--accordion-pad-block:calc(var(--vectis-space-4) - var(--accordion-pad-delta));--accordion-pad-inline:calc(var(--vectis-space-5) - var(--accordion-pad-delta));--accordion-content-pad-start:calc(var(--vectis-space-2) - var(--accordion-pad-delta));font-family:var(--vectis-text-family)}.v-accordion[data-variant=flat]{--accordion-corner-radius:var(--vectis-radius-surface)}.v-accordion[data-compact]{--accordion-pad-delta:var(--vectis-space-1)}.v-accordion:is([data-variant=outline],[data-variant=elevated],[data-variant=filled]){--accordion-corner-radius:calc(var(--vectis-radius-surface) - 1px);border-radius:var(--vectis-radius-surface);border:1px solid #0000;overflow:clip}.v-accordion[data-variant=outline]{background:var(--vectis-color-surface);border-color:var(--vectis-color-border)}.v-accordion[data-variant=elevated]{--accordion-corner-radius:var(--vectis-radius-surface);background:var(--vectis-color-surface-raised);box-shadow:var(--vectis-shadow-sm);border:none}.v-accordion[data-variant=filled]{--accordion-hover-bg:color-mix(in oklab, var(--vectis-color-surface-muted), var(--vectis-color-text) 4%);background:var(--vectis-color-surface-muted)}}
2
+ @layer vectis.components{.v-accordion{--accordion-pad-block:calc(var(--vectis-space-4) - var(--vectis-density-delta));--accordion-pad-inline:calc(var(--vectis-space-5) - var(--vectis-density-delta));--accordion-content-pad-start:calc(var(--vectis-space-2) - var(--vectis-density-delta));font-family:var(--vectis-text-family)}.v-accordion[data-variant=flat]{--accordion-corner-radius:var(--vectis-radius-surface)}.v-accordion:is([data-variant=outline],[data-variant=elevated],[data-variant=filled]){--accordion-corner-radius:calc(var(--vectis-radius-surface) - 1px);border-radius:var(--vectis-radius-surface);border:1px solid #0000;overflow:clip}.v-accordion[data-variant=outline]{background:var(--vectis-color-surface);border-color:var(--vectis-color-border)}.v-accordion[data-variant=elevated]{--accordion-corner-radius:var(--vectis-radius-surface);background:var(--vectis-color-surface-raised);box-shadow:var(--vectis-shadow-sm);border:none}.v-accordion[data-variant=filled]{--accordion-hover-bg:color-mix(in oklab, var(--vectis-color-surface-muted), var(--vectis-color-text) 4%);background:var(--vectis-color-surface-muted)}}
@@ -26,11 +26,6 @@ interface AccordionProps {
26
26
  * rotated 180°; provide one and the two icons are swapped instead.
27
27
  */
28
28
  collapseIcon?: IconSource;
29
- /**
30
- * Reduced density: every padding loses 4px, while the text and the icons keep
31
- * their size.
32
- */
33
- compact?: boolean;
34
29
  }
35
30
  type __VLS_Slots = {
36
31
  /** The `<VAccordionItem>`s that make up the group. */
@@ -38,7 +33,6 @@ type __VLS_Slots = {
38
33
  };
39
34
  declare const __VLS_base: import('vue').DefineComponent<AccordionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AccordionProps> & Readonly<{}>, {
40
35
  variant: AccordionVariant;
41
- compact: boolean;
42
36
  multiple: boolean;
43
37
  expandIcon: IconSource;
44
38
  collapseIcon: IconSource;
@@ -1 +1 @@
1
- {"version":3,"file":"VAccordion.js","names":[],"sources":["../../../src/components/VAccordion/VAccordion.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details elements own disclosure and exclusive groups; multiple removes the shared\n * group name.\n */\n\nimport { provide, useId } from 'vue'\n\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\n\nimport { accordionKey } from './context'\n\n/** How the group is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type AccordionVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n\ninterface AccordionProps {\n /**\n * Lets the reader keep several sections open at once. Left out, only one may stay\n * open and opening one closes the previous one, which the browser does on its own\n * once every item shares the same `<details>` name.\n */\n multiple?: boolean\n /**\n * How the group is set off from the page. `flat`, the default, draws nothing and lets\n * the accordion sit directly on the surface behind it. The other three frame it with\n * rounded corners, like a card: a border on the page surface (`outline`), a shadow over\n * a raised surface (`elevated`), or a muted fill with no border (`filled`).\n */\n variant?: AccordionVariant\n /**\n * The icon shown on a closed item: an icon name, or an explicit `{ src }` /\n * `{ component }`. It is a chevron by default, which rotates by 180° when the\n * item opens.\n */\n expandIcon?: IconSource\n /**\n * The icon shown on an open item. Leave it out and the `expandIcon` is simply\n * rotated 180°; provide one and the two icons are swapped instead.\n */\n collapseIcon?: IconSource\n /**\n * Reduced density: every padding loses 4px, while the text and the icons keep\n * their size.\n */\n compact?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionProps>(), {\n multiple: false,\n variant: 'flat',\n expandIcon: () => expandMoreIcon,\n collapseIcon: undefined,\n compact: false,\n})\n\ndefineSlots<{\n /** The `<VAccordionItem>`s that make up the group. */\n default(): unknown\n}>()\n\nconst groupName = useId()\nprovide(accordionKey, {\n get name() {\n return props.multiple ? undefined : groupName\n },\n get expandIcon() {\n return props.expandIcon\n },\n get collapseIcon() {\n return props.collapseIcon\n },\n})\n</script>\n\n<template>\n <div class=\"v-accordion\" :data-variant=\"variant\" :data-compact=\"compact ? '' : undefined\">\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion {\n --accordion-pad-delta: 0px;\n --accordion-pad-block: calc(var(--vectis-space-4) - var(--accordion-pad-delta));\n --accordion-pad-inline: calc(var(--vectis-space-5) - var(--accordion-pad-delta));\n --accordion-content-pad-start: calc(var(--vectis-space-2) - var(--accordion-pad-delta));\n\n font-family: var(--vectis-text-family);\n }\n\n /* Read by the first and last rows to round their hover. Without a frame there is no clip,\n so the rows carry the whole radius. */\n .v-accordion[data-variant='flat'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n }\n\n .v-accordion[data-compact] {\n --accordion-pad-delta: var(--vectis-space-1);\n }\n\n .v-accordion:is([data-variant='outline'], [data-variant='elevated'], [data-variant='filled']) {\n --accordion-corner-radius: calc(var(--vectis-radius-surface) - 1px);\n\n /* Transparent rather than absent on `filled`: forced colours paint it. `elevated` has\n none, so that the separators and the hover reach the edge its shadow draws. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n /* The clip is what keeps the first and last rows' hover inside the rounded corners, so\n it belongs to the variants that HAVE corners. `clip` and not `hidden`: `hidden` makes\n the box a scroll container, which captures every `position: sticky` in the content\n and pins it to the accordion instead of the page. */\n overflow: clip;\n }\n\n .v-accordion[data-variant='outline'] {\n background: var(--vectis-color-surface);\n border-color: var(--vectis-color-border);\n }\n\n .v-accordion[data-variant='elevated'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n\n border: none;\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n /* The usual hover is the muted surface itself, which would vanish on this fill. */\n .v-accordion[data-variant='filled'] {\n --accordion-hover-bg: color-mix(\n in oklab,\n var(--vectis-color-surface-muted),\n var(--vectis-color-text) 4%\n );\n\n background: var(--vectis-color-surface-muted);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VAccordion.js","names":["_sfc_main","VAccordion_vue_vue_type_script_setup_true_lang_default","VAccordion_default"],"sources":["../../../src/components/VAccordion/VAccordion.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details elements own disclosure and exclusive groups; multiple removes the shared\n * group name.\n */\n\nimport { provide, useId } from 'vue'\n\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\n\nimport { accordionKey } from './context'\n\n/** How the group is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type AccordionVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n\ninterface AccordionProps {\n /**\n * Lets the reader keep several sections open at once. Left out, only one may stay\n * open and opening one closes the previous one, which the browser does on its own\n * once every item shares the same `<details>` name.\n */\n multiple?: boolean\n /**\n * How the group is set off from the page. `flat`, the default, draws nothing and lets\n * the accordion sit directly on the surface behind it. The other three frame it with\n * rounded corners, like a card: a border on the page surface (`outline`), a shadow over\n * a raised surface (`elevated`), or a muted fill with no border (`filled`).\n */\n variant?: AccordionVariant\n /**\n * The icon shown on a closed item: an icon name, or an explicit `{ src }` /\n * `{ component }`. It is a chevron by default, which rotates by 180° when the\n * item opens.\n */\n expandIcon?: IconSource\n /**\n * The icon shown on an open item. Leave it out and the `expandIcon` is simply\n * rotated 180°; provide one and the two icons are swapped instead.\n */\n collapseIcon?: IconSource\n}\n\nconst props = withDefaults(defineProps<AccordionProps>(), {\n multiple: false,\n variant: 'flat',\n expandIcon: () => expandMoreIcon,\n collapseIcon: undefined,\n})\n\ndefineSlots<{\n /** The `<VAccordionItem>`s that make up the group. */\n default(): unknown\n}>()\n\nconst groupName = useId()\nprovide(accordionKey, {\n get name() {\n return props.multiple ? undefined : groupName\n },\n get expandIcon() {\n return props.expandIcon\n },\n get collapseIcon() {\n return props.collapseIcon\n },\n})\n</script>\n\n<template>\n <div class=\"v-accordion\" :data-variant=\"variant\">\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion {\n --accordion-pad-block: calc(var(--vectis-space-4) - var(--vectis-density-delta));\n --accordion-pad-inline: calc(var(--vectis-space-5) - var(--vectis-density-delta));\n --accordion-content-pad-start: calc(var(--vectis-space-2) - var(--vectis-density-delta));\n\n font-family: var(--vectis-text-family);\n }\n\n /* Read by the first and last rows to round their hover. Without a frame there is no clip,\n so the rows carry the whole radius. */\n .v-accordion[data-variant='flat'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n }\n\n .v-accordion:is([data-variant='outline'], [data-variant='elevated'], [data-variant='filled']) {\n --accordion-corner-radius: calc(var(--vectis-radius-surface) - 1px);\n\n /* Transparent rather than absent on `filled`: forced colours paint it. `elevated` has\n none, so that the separators and the hover reach the edge its shadow draws. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n /* The clip is what keeps the first and last rows' hover inside the rounded corners, so\n it belongs to the variants that HAVE corners. `clip` and not `hidden`: `hidden` makes\n the box a scroll container, which captures every `position: sticky` in the content\n and pins it to the accordion instead of the page. */\n overflow: clip;\n }\n\n .v-accordion[data-variant='outline'] {\n background: var(--vectis-color-surface);\n border-color: var(--vectis-color-border);\n }\n\n .v-accordion[data-variant='elevated'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n\n border: none;\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n /* The usual hover is the muted surface itself, which would vanish on this fill. */\n .v-accordion[data-variant='filled'] {\n --accordion-hover-bg: color-mix(\n in oklab,\n var(--vectis-color-surface-muted),\n var(--vectis-color-text) 4%\n );\n\n background: var(--vectis-color-surface-muted);\n }\n}\n</style>\n"],"mappings":""}
@@ -2,7 +2,7 @@ import { expand_more as e } from "../VIcon/icons/expand_more.js";
2
2
  import { accordionKey as t } from "./context.js";
3
3
  import { createElementBlock as n, defineComponent as r, openBlock as i, provide as a, renderSlot as o, useId as s } from "vue";
4
4
  //#region src/components/VAccordion/VAccordion.vue?vue&type=script&setup=true&lang.ts
5
- var c = ["data-variant", "data-compact"], l = /*@__PURE__*/ r({
5
+ var c = ["data-variant"], l = /*@__PURE__*/ r({
6
6
  __name: "VAccordion",
7
7
  props: {
8
8
  multiple: {
@@ -11,11 +11,7 @@ var c = ["data-variant", "data-compact"], l = /*@__PURE__*/ r({
11
11
  },
12
12
  variant: { default: "flat" },
13
13
  expandIcon: { default: () => e },
14
- collapseIcon: { default: void 0 },
15
- compact: {
16
- type: Boolean,
17
- default: !1
18
- }
14
+ collapseIcon: { default: void 0 }
19
15
  },
20
16
  setup(e) {
21
17
  let r = e, l = s();
@@ -31,8 +27,7 @@ var c = ["data-variant", "data-compact"], l = /*@__PURE__*/ r({
31
27
  }
32
28
  }), (t, r) => (i(), n("div", {
33
29
  class: "v-accordion",
34
- "data-variant": e.variant,
35
- "data-compact": e.compact ? "" : void 0
30
+ "data-variant": e.variant
36
31
  }, [o(t.$slots, "default")], 8, c));
37
32
  }
38
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"VAccordion.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VAccordion/VAccordion.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details elements own disclosure and exclusive groups; multiple removes the shared\n * group name.\n */\n\nimport { provide, useId } from 'vue'\n\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\n\nimport { accordionKey } from './context'\n\n/** How the group is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type AccordionVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n\ninterface AccordionProps {\n /**\n * Lets the reader keep several sections open at once. Left out, only one may stay\n * open and opening one closes the previous one, which the browser does on its own\n * once every item shares the same `<details>` name.\n */\n multiple?: boolean\n /**\n * How the group is set off from the page. `flat`, the default, draws nothing and lets\n * the accordion sit directly on the surface behind it. The other three frame it with\n * rounded corners, like a card: a border on the page surface (`outline`), a shadow over\n * a raised surface (`elevated`), or a muted fill with no border (`filled`).\n */\n variant?: AccordionVariant\n /**\n * The icon shown on a closed item: an icon name, or an explicit `{ src }` /\n * `{ component }`. It is a chevron by default, which rotates by 180° when the\n * item opens.\n */\n expandIcon?: IconSource\n /**\n * The icon shown on an open item. Leave it out and the `expandIcon` is simply\n * rotated 180°; provide one and the two icons are swapped instead.\n */\n collapseIcon?: IconSource\n /**\n * Reduced density: every padding loses 4px, while the text and the icons keep\n * their size.\n */\n compact?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionProps>(), {\n multiple: false,\n variant: 'flat',\n expandIcon: () => expandMoreIcon,\n collapseIcon: undefined,\n compact: false,\n})\n\ndefineSlots<{\n /** The `<VAccordionItem>`s that make up the group. */\n default(): unknown\n}>()\n\nconst groupName = useId()\nprovide(accordionKey, {\n get name() {\n return props.multiple ? undefined : groupName\n },\n get expandIcon() {\n return props.expandIcon\n },\n get collapseIcon() {\n return props.collapseIcon\n },\n})\n</script>\n\n<template>\n <div class=\"v-accordion\" :data-variant=\"variant\" :data-compact=\"compact ? '' : undefined\">\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion {\n --accordion-pad-delta: 0px;\n --accordion-pad-block: calc(var(--vectis-space-4) - var(--accordion-pad-delta));\n --accordion-pad-inline: calc(var(--vectis-space-5) - var(--accordion-pad-delta));\n --accordion-content-pad-start: calc(var(--vectis-space-2) - var(--accordion-pad-delta));\n\n font-family: var(--vectis-text-family);\n }\n\n /* Read by the first and last rows to round their hover. Without a frame there is no clip,\n so the rows carry the whole radius. */\n .v-accordion[data-variant='flat'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n }\n\n .v-accordion[data-compact] {\n --accordion-pad-delta: var(--vectis-space-1);\n }\n\n .v-accordion:is([data-variant='outline'], [data-variant='elevated'], [data-variant='filled']) {\n --accordion-corner-radius: calc(var(--vectis-radius-surface) - 1px);\n\n /* Transparent rather than absent on `filled`: forced colours paint it. `elevated` has\n none, so that the separators and the hover reach the edge its shadow draws. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n /* The clip is what keeps the first and last rows' hover inside the rounded corners, so\n it belongs to the variants that HAVE corners. `clip` and not `hidden`: `hidden` makes\n the box a scroll container, which captures every `position: sticky` in the content\n and pins it to the accordion instead of the page. */\n overflow: clip;\n }\n\n .v-accordion[data-variant='outline'] {\n background: var(--vectis-color-surface);\n border-color: var(--vectis-color-border);\n }\n\n .v-accordion[data-variant='elevated'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n\n border: none;\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n /* The usual hover is the muted surface itself, which would vanish on this fill. */\n .v-accordion[data-variant='filled'] {\n --accordion-hover-bg: color-mix(\n in oklab,\n var(--vectis-color-surface-muted),\n var(--vectis-color-text) 4%\n );\n\n background: var(--vectis-color-surface-muted);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAgDA,IAAM,IAAQ,GAaR,IAAY,EAAM;SACxB,EAAQ,GAAc;GACpB,IAAI,OAAO;IACT,OAAO,EAAM,WAAW,KAAA,IAAY;GACtC;GACA,IAAI,aAAa;IACf,OAAO,EAAM;GACf;GACA,IAAI,eAAe;IACjB,OAAO,EAAM;GACf;EACF,CAAC,mBAIC,EAEM,OAAA;GAFD,OAAM;GAAe,gBAAc,EAAA;GAAU,gBAAc,EAAA,UAAO,KAAQ,KAAA;MAC7E,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"VAccordion.vue_vue_type_script_setup_true_lang.js","names":["expandMoreIcon","_openBlock","_createElementBlock","_renderSlot","_hoisted_1","VAccordion_vue_vue_type_script_setup_true_lang_default","expand_more","props","__props","groupName","useId","provide","accordionKey","openBlock","createElementBlock","renderSlot","_ctx"],"sources":["../../../src/components/VAccordion/VAccordion.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details elements own disclosure and exclusive groups; multiple removes the shared\n * group name.\n */\n\nimport { provide, useId } from 'vue'\n\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\n\nimport { accordionKey } from './context'\n\n/** How the group is set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type AccordionVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n\ninterface AccordionProps {\n /**\n * Lets the reader keep several sections open at once. Left out, only one may stay\n * open and opening one closes the previous one, which the browser does on its own\n * once every item shares the same `<details>` name.\n */\n multiple?: boolean\n /**\n * How the group is set off from the page. `flat`, the default, draws nothing and lets\n * the accordion sit directly on the surface behind it. The other three frame it with\n * rounded corners, like a card: a border on the page surface (`outline`), a shadow over\n * a raised surface (`elevated`), or a muted fill with no border (`filled`).\n */\n variant?: AccordionVariant\n /**\n * The icon shown on a closed item: an icon name, or an explicit `{ src }` /\n * `{ component }`. It is a chevron by default, which rotates by 180° when the\n * item opens.\n */\n expandIcon?: IconSource\n /**\n * The icon shown on an open item. Leave it out and the `expandIcon` is simply\n * rotated 180°; provide one and the two icons are swapped instead.\n */\n collapseIcon?: IconSource\n}\n\nconst props = withDefaults(defineProps<AccordionProps>(), {\n multiple: false,\n variant: 'flat',\n expandIcon: () => expandMoreIcon,\n collapseIcon: undefined,\n})\n\ndefineSlots<{\n /** The `<VAccordionItem>`s that make up the group. */\n default(): unknown\n}>()\n\nconst groupName = useId()\nprovide(accordionKey, {\n get name() {\n return props.multiple ? undefined : groupName\n },\n get expandIcon() {\n return props.expandIcon\n },\n get collapseIcon() {\n return props.collapseIcon\n },\n})\n</script>\n\n<template>\n <div class=\"v-accordion\" :data-variant=\"variant\">\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion {\n --accordion-pad-block: calc(var(--vectis-space-4) - var(--vectis-density-delta));\n --accordion-pad-inline: calc(var(--vectis-space-5) - var(--vectis-density-delta));\n --accordion-content-pad-start: calc(var(--vectis-space-2) - var(--vectis-density-delta));\n\n font-family: var(--vectis-text-family);\n }\n\n /* Read by the first and last rows to round their hover. Without a frame there is no clip,\n so the rows carry the whole radius. */\n .v-accordion[data-variant='flat'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n }\n\n .v-accordion:is([data-variant='outline'], [data-variant='elevated'], [data-variant='filled']) {\n --accordion-corner-radius: calc(var(--vectis-radius-surface) - 1px);\n\n /* Transparent rather than absent on `filled`: forced colours paint it. `elevated` has\n none, so that the separators and the hover reach the edge its shadow draws. */\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n /* The clip is what keeps the first and last rows' hover inside the rounded corners, so\n it belongs to the variants that HAVE corners. `clip` and not `hidden`: `hidden` makes\n the box a scroll container, which captures every `position: sticky` in the content\n and pins it to the accordion instead of the page. */\n overflow: clip;\n }\n\n .v-accordion[data-variant='outline'] {\n background: var(--vectis-color-surface);\n border-color: var(--vectis-color-border);\n }\n\n .v-accordion[data-variant='elevated'] {\n --accordion-corner-radius: var(--vectis-radius-surface);\n\n border: none;\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n /* The usual hover is the muted surface itself, which would vanish on this fill. */\n .v-accordion[data-variant='filled'] {\n --accordion-hover-bg: color-mix(\n in oklab,\n var(--vectis-color-surface-muted),\n var(--vectis-color-text) 4%\n );\n\n background: var(--vectis-color-surface-muted);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EA2CA,IAAMO,IAAQC,GAYRC,IAAYC,EAAM;SACxBC,EAAQC,GAAc;GACpB,IAAI,OAAO;IACT,OAAOL,EAAM,WAAW,KAAA,IAAYE;GACtC;GACA,IAAI,aAAa;IACf,OAAOF,EAAM;GACf;GACA,IAAI,eAAe;IACjB,OAAOA,EAAM;GACf;EACF,CAAC,cAICN,EAAA,GAAAC,EAEM,OAAA;GAFD,OAAM;GAAe,gBAAcM,EAAA;EACtCL,GAAAA,CAAAA,EAAQa,EAAA,QAAA,SAAA,CAAA,GAAA,GAAAZ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"VAccordionItem.js","names":[],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details owns disclosure. useDetailsOpen bridges v-model and cancels activation of\n * disabled summaries.\n */\n\nimport { computed, inject, provide } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use the `#title`\n * slot instead when the heading needs markup rather than plain text.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render (`{ src }`,\n * `{ component }`…). The `#icon` slot replaces it.\n */\n icon?: IconSource\n /** Renders the section already open. Bind `v-model:open` to drive it instead. */\n defaultOpen?: boolean\n /** Makes the section inert. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n// \"not bound\" is written as `null` and not `undefined`. A model typed as a plain boolean is\n// declared as such at runtime, and Vue casts an ABSENT boolean prop to `false`, which would\n// silently overwrite `defaultOpen`.\n/**\n * Whether the section is open, when the consumer wants to drive or observe it. Left\n * unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial\n * value. `null` means unbound.\n */\nconst open = defineModel<boolean | null>('open', { default: null })\n\ndefineSlots<{\n /** The content revealed when the section is open. */\n default(): unknown\n /** A title made of markup, which replaces the `title` prop. */\n title?(): unknown\n /** A subtitle made of markup, which replaces the `subtitle` prop. */\n subtitle?(): unknown\n /** Free content before the title, which takes the place of `icon`. */\n icon?(): unknown\n}>()\n\nconst accordion = inject(accordionKey, null)\n// The group stops here: an item nested in this one's content without a VAccordion of its\n// own would otherwise share this group's name, and the browser closes every other member\n// of a name group when one opens, the section holding it included.\nprovide(accordionKey, null)\n\n/**\n * Both icons are chosen on the enclosing group. The chevron fallback is what keeps\n * an item rendering correctly when it is used outside a VAccordion.\n */\nconst expandIcon = computed(() => accordion?.expandIcon ?? expandMoreIcon)\nconst collapseIcon = computed(() => accordion?.collapseIcon)\n\nconst { openAttr, onToggle, onSummaryClick } = useDetailsOpen(open, {\n defaultOpen: () => props.defaultOpen,\n disabled: () => props.disabled,\n})\n</script>\n\n<template>\n <details\n class=\"v-accordion-item v-disclosure\"\n :name=\"accordion?.name\"\n :open=\"openAttr\"\n :data-swap=\"collapseIcon ? '' : undefined\"\n @toggle=\"onToggle\"\n >\n <summary\n class=\"v-accordion-summary\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click=\"onSummaryClick\"\n >\n <slot name=\"icon\">\n <VIcon v-if=\"icon\" class=\"v-accordion-icon\" v-bind=\"iconProps(icon)\" />\n </slot>\n <span class=\"v-accordion-heading\">\n <span class=\"v-accordion-title\"\n ><slot name=\"title\">{{ title }}</slot></span\n >\n <VTypography\n v-if=\"subtitle !== undefined || $slots.subtitle\"\n as=\"span\"\n variant=\"caption\"\n tone=\"muted\"\n class=\"v-accordion-subtitle\"\n ><slot name=\"subtitle\">{{ subtitle }}</slot></VTypography\n >\n </span>\n <VIcon class=\"v-accordion-chevron v-disclosure-chevron\" v-bind=\"iconProps(expandIcon)\" />\n <VIcon\n v-if=\"collapseIcon\"\n class=\"v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open\"\n v-bind=\"iconProps(collapseIcon)\"\n />\n </summary>\n <div class=\"v-accordion-content\">\n <slot />\n </div>\n </details>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion-item + .v-accordion-item {\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n .v-accordion-summary {\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: flex;\n align-items: center;\n gap: var(--vectis-space-3);\n padding: var(--accordion-pad-block, var(--vectis-space-4))\n var(--accordion-pad-inline, var(--vectis-space-5));\n cursor: pointer;\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n color: var(--vectis-color-text);\n }\n\n .v-accordion-summary:hover:not([data-disabled]) {\n background: var(--accordion-hover-bg, var(--vectis-color-surface-muted));\n }\n\n .v-accordion-summary: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 .v-accordion-item:first-child > .v-accordion-summary {\n border-start-start-radius: var(--accordion-corner-radius, 0);\n border-start-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-item:last-child:not([open]) > .v-accordion-summary {\n border-end-start-radius: var(--accordion-corner-radius, 0);\n border-end-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-heading {\n flex: 1;\n display: flex;\n flex-direction: column;\n line-height: var(--vectis-text-label-leading);\n }\n\n .v-accordion-icon {\n flex: none;\n color: var(--vectis-color-text-muted);\n }\n\n /* A disabled item greys out through the colour tokens and never through\n `opacity`, the rule every control in the DS follows. */\n .v-accordion-summary[data-disabled] {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n /* The icon and the subtitle default to text-muted, which is DARKER than the\n text-subtle a disabled title takes: left to themselves they would come out\n stronger than the label they belong to, so they inherit it instead. The chevron\n gets the same treatment from `styles/disclosure.css`. */\n .v-accordion-summary[data-disabled] .v-accordion-icon,\n .v-accordion-summary[data-disabled] .v-accordion-subtitle {\n color: inherit;\n }\n\n .v-accordion-content {\n padding: var(--accordion-content-pad-start, var(--vectis-space-2))\n var(--accordion-pad-inline, var(--vectis-space-5))\n var(--accordion-pad-block, var(--vectis-space-4));\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n color: var(--vectis-color-text-muted);\n }\n\n /* The disclosure animation, the chevron's rotation or swap and the WebKit marker come\n from `styles/disclosure.css`, reduced-motion block included. */\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VAccordionItem.js","names":["_sfc_main","VAccordionItem_vue_vue_type_script_setup_true_lang_default","VAccordionItem_default"],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details owns disclosure. useDetailsOpen bridges v-model and cancels activation of\n * disabled summaries.\n */\n\nimport { computed, inject, provide } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use the `#title`\n * slot instead when the heading needs markup rather than plain text.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render (`{ src }`,\n * `{ component }`…). The `#icon` slot replaces it.\n */\n icon?: IconSource\n /** Renders the section already open. Bind `v-model:open` to drive it instead. */\n defaultOpen?: boolean\n /** Makes the section inert. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n// \"not bound\" is written as `null` and not `undefined`. A model typed as a plain boolean is\n// declared as such at runtime, and Vue casts an ABSENT boolean prop to `false`, which would\n// silently overwrite `defaultOpen`.\n/**\n * Whether the section is open, when the consumer wants to drive or observe it. Left\n * unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial\n * value. `null` means unbound.\n */\nconst open = defineModel<boolean | null>('open', { default: null })\n\ndefineSlots<{\n /** The content revealed when the section is open. */\n default(): unknown\n /** A title made of markup, which replaces the `title` prop. */\n title?(): unknown\n /** A subtitle made of markup, which replaces the `subtitle` prop. */\n subtitle?(): unknown\n /** Free content before the title, which takes the place of `icon`. */\n icon?(): unknown\n}>()\n\nconst accordion = inject(accordionKey, null)\n// The group stops here: an item nested in this one's content without a VAccordion of its\n// own would otherwise share this group's name, and the browser closes every other member\n// of a name group when one opens, the section holding it included.\nprovide(accordionKey, null)\n\n/**\n * Both icons are chosen on the enclosing group. The chevron fallback is what keeps\n * an item rendering correctly when it is used outside a VAccordion.\n */\nconst expandIcon = computed(() => accordion?.expandIcon ?? expandMoreIcon)\nconst collapseIcon = computed(() => accordion?.collapseIcon)\n\nconst { openAttr, onToggle, onSummaryClick } = useDetailsOpen(open, {\n defaultOpen: () => props.defaultOpen,\n disabled: () => props.disabled,\n})\n</script>\n\n<template>\n <details\n class=\"v-accordion-item v-disclosure\"\n :name=\"accordion?.name\"\n :open=\"openAttr\"\n :data-swap=\"collapseIcon ? '' : undefined\"\n @toggle=\"onToggle\"\n >\n <summary\n class=\"v-accordion-summary\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click=\"onSummaryClick\"\n >\n <slot name=\"icon\">\n <VIcon v-if=\"icon\" class=\"v-accordion-icon\" v-bind=\"iconProps(icon)\" />\n </slot>\n <span class=\"v-accordion-heading\">\n <span class=\"v-accordion-title\"\n ><slot name=\"title\">{{ title }}</slot></span\n >\n <VTypography\n v-if=\"subtitle !== undefined || $slots.subtitle\"\n as=\"span\"\n variant=\"caption\"\n tone=\"muted\"\n class=\"v-accordion-subtitle\"\n ><slot name=\"subtitle\">{{ subtitle }}</slot></VTypography\n >\n </span>\n <VIcon class=\"v-accordion-chevron v-disclosure-chevron\" v-bind=\"iconProps(expandIcon)\" />\n <VIcon\n v-if=\"collapseIcon\"\n class=\"v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open\"\n v-bind=\"iconProps(collapseIcon)\"\n />\n </summary>\n <div class=\"v-accordion-content\">\n <slot />\n </div>\n </details>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion-item + .v-accordion-item {\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n .v-accordion-summary {\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: flex;\n align-items: center;\n gap: var(--vectis-space-3);\n padding: var(--accordion-pad-block, var(--vectis-space-4))\n var(--accordion-pad-inline, var(--vectis-space-5));\n cursor: pointer;\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n color: var(--vectis-color-text);\n }\n\n .v-accordion-summary:hover:not([data-disabled]) {\n background: var(--accordion-hover-bg, var(--vectis-color-surface-muted));\n }\n\n .v-accordion-summary: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 .v-accordion-item:first-child > .v-accordion-summary {\n border-start-start-radius: var(--accordion-corner-radius, 0);\n border-start-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-item:last-child:not([open]) > .v-accordion-summary {\n border-end-start-radius: var(--accordion-corner-radius, 0);\n border-end-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-heading {\n flex: 1;\n display: flex;\n flex-direction: column;\n line-height: var(--vectis-text-label-leading);\n }\n\n .v-accordion-icon {\n flex: none;\n color: var(--vectis-color-text-muted);\n }\n\n /* A disabled item greys out through the colour tokens and never through\n `opacity`, the rule every control in the DS follows. */\n .v-accordion-summary[data-disabled] {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n /* The icon and the subtitle default to text-muted, which is DARKER than the\n text-subtle a disabled title takes: left to themselves they would come out\n stronger than the label they belong to, so they inherit it instead. The chevron\n gets the same treatment from `styles/disclosure.css`. */\n .v-accordion-summary[data-disabled] .v-accordion-icon,\n .v-accordion-summary[data-disabled] .v-accordion-subtitle {\n color: inherit;\n }\n\n .v-accordion-content {\n padding: var(--accordion-content-pad-start, var(--vectis-space-2))\n var(--accordion-pad-inline, var(--vectis-space-5))\n var(--accordion-pad-block, var(--vectis-space-4));\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n color: var(--vectis-color-text-muted);\n }\n\n /* The disclosure animation, the chevron's rotation or swap and the WebKit marker come\n from `styles/disclosure.css`, reduced-motion block included. */\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"VAccordionItem.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details owns disclosure. useDetailsOpen bridges v-model and cancels activation of\n * disabled summaries.\n */\n\nimport { computed, inject, provide } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use the `#title`\n * slot instead when the heading needs markup rather than plain text.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render (`{ src }`,\n * `{ component }`…). The `#icon` slot replaces it.\n */\n icon?: IconSource\n /** Renders the section already open. Bind `v-model:open` to drive it instead. */\n defaultOpen?: boolean\n /** Makes the section inert. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n// \"not bound\" is written as `null` and not `undefined`. A model typed as a plain boolean is\n// declared as such at runtime, and Vue casts an ABSENT boolean prop to `false`, which would\n// silently overwrite `defaultOpen`.\n/**\n * Whether the section is open, when the consumer wants to drive or observe it. Left\n * unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial\n * value. `null` means unbound.\n */\nconst open = defineModel<boolean | null>('open', { default: null })\n\ndefineSlots<{\n /** The content revealed when the section is open. */\n default(): unknown\n /** A title made of markup, which replaces the `title` prop. */\n title?(): unknown\n /** A subtitle made of markup, which replaces the `subtitle` prop. */\n subtitle?(): unknown\n /** Free content before the title, which takes the place of `icon`. */\n icon?(): unknown\n}>()\n\nconst accordion = inject(accordionKey, null)\n// The group stops here: an item nested in this one's content without a VAccordion of its\n// own would otherwise share this group's name, and the browser closes every other member\n// of a name group when one opens, the section holding it included.\nprovide(accordionKey, null)\n\n/**\n * Both icons are chosen on the enclosing group. The chevron fallback is what keeps\n * an item rendering correctly when it is used outside a VAccordion.\n */\nconst expandIcon = computed(() => accordion?.expandIcon ?? expandMoreIcon)\nconst collapseIcon = computed(() => accordion?.collapseIcon)\n\nconst { openAttr, onToggle, onSummaryClick } = useDetailsOpen(open, {\n defaultOpen: () => props.defaultOpen,\n disabled: () => props.disabled,\n})\n</script>\n\n<template>\n <details\n class=\"v-accordion-item v-disclosure\"\n :name=\"accordion?.name\"\n :open=\"openAttr\"\n :data-swap=\"collapseIcon ? '' : undefined\"\n @toggle=\"onToggle\"\n >\n <summary\n class=\"v-accordion-summary\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click=\"onSummaryClick\"\n >\n <slot name=\"icon\">\n <VIcon v-if=\"icon\" class=\"v-accordion-icon\" v-bind=\"iconProps(icon)\" />\n </slot>\n <span class=\"v-accordion-heading\">\n <span class=\"v-accordion-title\"\n ><slot name=\"title\">{{ title }}</slot></span\n >\n <VTypography\n v-if=\"subtitle !== undefined || $slots.subtitle\"\n as=\"span\"\n variant=\"caption\"\n tone=\"muted\"\n class=\"v-accordion-subtitle\"\n ><slot name=\"subtitle\">{{ subtitle }}</slot></VTypography\n >\n </span>\n <VIcon class=\"v-accordion-chevron v-disclosure-chevron\" v-bind=\"iconProps(expandIcon)\" />\n <VIcon\n v-if=\"collapseIcon\"\n class=\"v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open\"\n v-bind=\"iconProps(collapseIcon)\"\n />\n </summary>\n <div class=\"v-accordion-content\">\n <slot />\n </div>\n </details>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion-item + .v-accordion-item {\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n .v-accordion-summary {\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: flex;\n align-items: center;\n gap: var(--vectis-space-3);\n padding: var(--accordion-pad-block, var(--vectis-space-4))\n var(--accordion-pad-inline, var(--vectis-space-5));\n cursor: pointer;\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n color: var(--vectis-color-text);\n }\n\n .v-accordion-summary:hover:not([data-disabled]) {\n background: var(--accordion-hover-bg, var(--vectis-color-surface-muted));\n }\n\n .v-accordion-summary: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 .v-accordion-item:first-child > .v-accordion-summary {\n border-start-start-radius: var(--accordion-corner-radius, 0);\n border-start-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-item:last-child:not([open]) > .v-accordion-summary {\n border-end-start-radius: var(--accordion-corner-radius, 0);\n border-end-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-heading {\n flex: 1;\n display: flex;\n flex-direction: column;\n line-height: var(--vectis-text-label-leading);\n }\n\n .v-accordion-icon {\n flex: none;\n color: var(--vectis-color-text-muted);\n }\n\n /* A disabled item greys out through the colour tokens and never through\n `opacity`, the rule every control in the DS follows. */\n .v-accordion-summary[data-disabled] {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n /* The icon and the subtitle default to text-muted, which is DARKER than the\n text-subtle a disabled title takes: left to themselves they would come out\n stronger than the label they belong to, so they inherit it instead. The chevron\n gets the same treatment from `styles/disclosure.css`. */\n .v-accordion-summary[data-disabled] .v-accordion-icon,\n .v-accordion-summary[data-disabled] .v-accordion-subtitle {\n color: inherit;\n }\n\n .v-accordion-content {\n padding: var(--accordion-content-pad-start, var(--vectis-space-2))\n var(--accordion-pad-inline, var(--vectis-space-5))\n var(--accordion-pad-block, var(--vectis-space-4));\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n color: var(--vectis-color-text-muted);\n }\n\n /* The disclosure animation, the chevron's rotation or swap and the WebKit marker come\n from `styles/disclosure.css`, reduced-motion block included. */\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA,IAAM,IAAQ,GAgBR,IAAO,EAA2B,GAAC,MAAyB,GAa5D,IAAY,EAAO,GAAc,IAAI;EAI3C,EAAQ,GAAc,IAAI;EAM1B,IAAM,IAAa,QAAe,GAAW,cAAc,CAAc,GACnE,IAAe,QAAe,GAAW,YAAY,GAErD,EAAE,aAAU,aAAU,sBAAmB,EAAe,GAAM;GAClE,mBAAmB,EAAM;GACzB,gBAAgB,EAAM;EACxB,CAAC;yBAIC,EAwCU,WAAA;GAvCR,OAAM;GACL,MAAM,EAAA,CAAA,CAAS,EAAE;GACjB,MAAM,EAAA,CAAA;GACN,aAAW,EAAA,QAAY,KAAQ,KAAA;GAC/B,UAAM,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,GAAA,CAAA;MAET,EA6BU,WAAA;GA5BR,OAAM;GACL,iBAAe,EAAA,WAAQ,KAAQ,KAAA;GAC/B,iBAAe,EAAA,YAAY,KAAA;GAC3B,UAAU,EAAA,WAAQ,KAAQ,KAAA;GAC1B,SAAK,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,GAAA,CAAA;;GAER,EAEO,EAAA,QAAA,QAAA,CAAA,SAAA,CADQ,EAAA,QAAA,EAAA,GAAb,EAAuE,GAAvE,EAAuE;;IAApD,OAAM;MAA2B,EAAA,CAAA,CAAS,CAAC,EAAA,IAAI,CAAA,GAAA,MAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA;GAEpE,EAYO,QAZP,GAYO,CAXL,EAEC,QAFD,GAEC,CADE,EAAqC,EAAA,QAAA,SAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAGtB,EAAA,aAAa,KAAA,KAAaA,EAAAA,OAAO,YAAA,EAAA,GADzC,EAOC,GAAA;;IALC,IAAG;IACH,SAAQ;IACR,MAAK;IACL,OAAM;;qBACsC,CAA3C,EAA2C,EAAA,QAAA,YAAA,CAAA,SAAA,CAAA,EAAA,EAAlB,EAAA,QAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;GAGtC,EAAyF,GAAzF,EAAyF,EAAlF,OAAM,2CAA0C,GAAS,EAAA,CAAA,CAAS,CAAC,EAAA,KAAU,CAAA,GAAA,MAAA,EAAA;GAE5E,EAAA,SAAA,EAAA,GADR,EAIE,GAJF,EAIE;;IAFA,OAAM;MACE,EAAA,CAAA,CAAS,CAAC,EAAA,KAAY,CAAA,GAAA,MAAA,EAAA,KAAA,EAAA,IAAA,EAAA;YAGlC,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"VAccordionItem.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","expandMoreIcon","_openBlock","_createElementBlock","_unref","_createElementVNode","_renderSlot","_createBlock","VIcon","_mergeProps","_createCommentVNode","_createTextVNode","_toDisplayString","VTypography","_withCtx","_createVNode","VIcon_default","VTypography_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","VAccordionItem_vue_vue_type_script_setup_true_lang_default","\"open\"","\"openModifiers\"","props","__props","open","useModel","accordion","inject","accordionKey","expandIcon","computed","expand_more","collapseIcon","useDetailsOpen","openBlock","createElementBlock","unref","openAttr","_cache","args","onToggle","createElementVNode","onSummaryClick","renderSlot","_ctx","createBlock","mergeProps","iconProps","createCommentVNode","createTextVNode","toDisplayString","withCtx","createVNode"],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Native details owns disclosure. useDetailsOpen bridges v-model and cancels activation of\n * disabled summaries.\n */\n\nimport { computed, inject, provide } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use the `#title`\n * slot instead when the heading needs markup rather than plain text.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render (`{ src }`,\n * `{ component }`…). The `#icon` slot replaces it.\n */\n icon?: IconSource\n /** Renders the section already open. Bind `v-model:open` to drive it instead. */\n defaultOpen?: boolean\n /** Makes the section inert. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n// \"not bound\" is written as `null` and not `undefined`. A model typed as a plain boolean is\n// declared as such at runtime, and Vue casts an ABSENT boolean prop to `false`, which would\n// silently overwrite `defaultOpen`.\n/**\n * Whether the section is open, when the consumer wants to drive or observe it. Left\n * unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial\n * value. `null` means unbound.\n */\nconst open = defineModel<boolean | null>('open', { default: null })\n\ndefineSlots<{\n /** The content revealed when the section is open. */\n default(): unknown\n /** A title made of markup, which replaces the `title` prop. */\n title?(): unknown\n /** A subtitle made of markup, which replaces the `subtitle` prop. */\n subtitle?(): unknown\n /** Free content before the title, which takes the place of `icon`. */\n icon?(): unknown\n}>()\n\nconst accordion = inject(accordionKey, null)\n// The group stops here: an item nested in this one's content without a VAccordion of its\n// own would otherwise share this group's name, and the browser closes every other member\n// of a name group when one opens, the section holding it included.\nprovide(accordionKey, null)\n\n/**\n * Both icons are chosen on the enclosing group. The chevron fallback is what keeps\n * an item rendering correctly when it is used outside a VAccordion.\n */\nconst expandIcon = computed(() => accordion?.expandIcon ?? expandMoreIcon)\nconst collapseIcon = computed(() => accordion?.collapseIcon)\n\nconst { openAttr, onToggle, onSummaryClick } = useDetailsOpen(open, {\n defaultOpen: () => props.defaultOpen,\n disabled: () => props.disabled,\n})\n</script>\n\n<template>\n <details\n class=\"v-accordion-item v-disclosure\"\n :name=\"accordion?.name\"\n :open=\"openAttr\"\n :data-swap=\"collapseIcon ? '' : undefined\"\n @toggle=\"onToggle\"\n >\n <summary\n class=\"v-accordion-summary\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click=\"onSummaryClick\"\n >\n <slot name=\"icon\">\n <VIcon v-if=\"icon\" class=\"v-accordion-icon\" v-bind=\"iconProps(icon)\" />\n </slot>\n <span class=\"v-accordion-heading\">\n <span class=\"v-accordion-title\"\n ><slot name=\"title\">{{ title }}</slot></span\n >\n <VTypography\n v-if=\"subtitle !== undefined || $slots.subtitle\"\n as=\"span\"\n variant=\"caption\"\n tone=\"muted\"\n class=\"v-accordion-subtitle\"\n ><slot name=\"subtitle\">{{ subtitle }}</slot></VTypography\n >\n </span>\n <VIcon class=\"v-accordion-chevron v-disclosure-chevron\" v-bind=\"iconProps(expandIcon)\" />\n <VIcon\n v-if=\"collapseIcon\"\n class=\"v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open\"\n v-bind=\"iconProps(collapseIcon)\"\n />\n </summary>\n <div class=\"v-accordion-content\">\n <slot />\n </div>\n </details>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion-item + .v-accordion-item {\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n .v-accordion-summary {\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: flex;\n align-items: center;\n gap: var(--vectis-space-3);\n padding: var(--accordion-pad-block, var(--vectis-space-4))\n var(--accordion-pad-inline, var(--vectis-space-5));\n cursor: pointer;\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n color: var(--vectis-color-text);\n }\n\n .v-accordion-summary:hover:not([data-disabled]) {\n background: var(--accordion-hover-bg, var(--vectis-color-surface-muted));\n }\n\n .v-accordion-summary: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 .v-accordion-item:first-child > .v-accordion-summary {\n border-start-start-radius: var(--accordion-corner-radius, 0);\n border-start-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-item:last-child:not([open]) > .v-accordion-summary {\n border-end-start-radius: var(--accordion-corner-radius, 0);\n border-end-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-heading {\n flex: 1;\n display: flex;\n flex-direction: column;\n line-height: var(--vectis-text-label-leading);\n }\n\n .v-accordion-icon {\n flex: none;\n color: var(--vectis-color-text-muted);\n }\n\n /* A disabled item greys out through the colour tokens and never through\n `opacity`, the rule every control in the DS follows. */\n .v-accordion-summary[data-disabled] {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n /* The icon and the subtitle default to text-muted, which is DARKER than the\n text-subtle a disabled title takes: left to themselves they would come out\n stronger than the label they belong to, so they inherit it instead. The chevron\n gets the same treatment from `styles/disclosure.css`. */\n .v-accordion-summary[data-disabled] .v-accordion-icon,\n .v-accordion-summary[data-disabled] .v-accordion-subtitle {\n color: inherit;\n }\n\n .v-accordion-content {\n padding: var(--accordion-content-pad-start, var(--vectis-space-2))\n var(--accordion-pad-inline, var(--vectis-space-5))\n var(--accordion-pad-block, var(--vectis-space-4));\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n color: var(--vectis-color-text-muted);\n }\n\n /* The disclosure animation, the chevron's rotation or swap and the WebKit marker come\n from `styles/disclosure.css`, reduced-motion block included. */\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA,IAAM2B,IAAQC,GAgBRC,IAAO5B,EAA2B2B,GAAC,MAAyB,GAa5DG,IAAYC,EAAOC,GAAc,IAAI;EAI3C,EAAQA,GAAc,IAAI;EAM1B,IAAMC,IAAaC,QAAeJ,GAAW,cAAc7B,CAAc,GACnEmC,IAAeF,QAAeJ,GAAW,YAAY,GAErD,EAAE,aAAU,aAAU,sBAAmBO,EAAeT,GAAM;GAClE,mBAAmBF,EAAM;GACzB,gBAAgBA,EAAM;EACxB,CAAC;oBAICxB,EAAA,GAAAC,EAwCU,WAAA;GAvCR,OAAM;GACL,MAAMC,EAAA0B,CAAA,CAAS,EAAE;GACjB,MAAM1B,EAAAqC,CAAA;GACN,aAAWL,EAAA,QAAY,KAAQ,KAAA;GAC/B,UAAM,AAAAM,EAAA,QAAE,GAAAC,MAAAvC,EAAAwC,CAAA,KAAAxC,EAAAwC,CAAA,CAAA,CAAA,GAAAD,CAAA;EAETtC,GAAAA,CAAAA,EA6BU,WAAA;GA5BR,OAAM;GACL,iBAAesB,EAAA,WAAQ,KAAQ,KAAA;GAC/B,iBAAeA,EAAA,YAAY,KAAA;GAC3B,UAAUA,EAAA,WAAQ,KAAQ,KAAA;GAC1B,SAAK,AAAAe,EAAA,QAAE,GAAAC,MAAAvC,EAAA0C,CAAA,KAAA1C,EAAA0C,CAAA,CAAA,CAAA,GAAAH,CAAA;;GAERrC,EAEO0C,EAAA,QAAA,QAAA,CAAA,SAAA,CADQrB,EAAA,QAAbzB,EAAA,GAAAK,EAAuEC,GAAvEC,EAAuE;;IAApD,OAAM;GAA2B,GAAAL,EAAA+C,CAAA,CAAS,CAACxB,EAAA,IAAI,CAAA,GAAA,MAAA,EAAA,KAAAyB,EAAA,IAAA,EAAA,CAAA,CAAA;GAEpE/C,EAYO,QAZPe,GAYO,CAXLf,EAEC,QAFDgB,GAEC,CADEf,EAAqC0C,EAAA,QAAA,SAAA,CAAA,SAAA,CAAfrC,EAAAC,EAAAe,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAGtBA,EAAA,aAAa,KAAA,KAAa5B,EAAAA,OAAO,YADzCG,EAAA,GAAAK,EAOCM,GAAA;;IALC,IAAG;IACH,SAAQ;IACR,MAAK;IACL,OAAM;;IACL,SAAAC,QAA2C,CAA3CR,EAA2C0C,EAAA,QAAA,YAAA,CAAA,SAAA,CAAlBrC,EAAAC,EAAAe,EAAA,QAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;GAGtCZ,EAAyFP,GAAzFC,EAAyF,EAAlF,OAAM,2CAA0C,GAASL,EAAA+C,CAAA,CAAS,CAAClB,EAAA,KAAU,CAAA,GAAA,MAAA,EAAA;GAE5EG,EAAA,SADRlC,EAAA,GAAAK,EAIEC,GAJFC,EAIE;;IAFA,OAAM;GACE,GAAAL,EAAA+C,CAAA,CAAS,CAACf,EAAA,KAAY,CAAA,GAAA,MAAA,EAAA,KAAAgB,EAAA,IAAA,EAAA;EAGlC/C,GAAAA,GAAAA,CAAAA,GAAAA,EAEM,OAFNiB,GAEM,CADJhB,EAAQ0C,EAAA,QAAA,SAAA,CAAA,CAAA,CAAA,GAAA,IAAA9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":[],"sources":["../../../src/components/VAccordion/context.ts"],"sourcesContent":["/** Share group icons through context; compact spacing inherits through CSS variables. */\n\nimport type { InjectionKey } from 'vue'\n\nimport type { IconSource } from '../VIcon/types'\n\nexport interface AccordionContext {\n /** Group name for <details name>; undefined = several items may stay open at once. */\n name: string | undefined\n /** Icon in the closed state: an icon name, or an explicit render. */\n expandIcon: IconSource\n /** Icon in the open state; undefined = a rotation of `expandIcon`. */\n collapseIcon: IconSource | undefined\n}\n\n/**\n * `null` is what an item provides to its own content: an item placed straight inside\n * another one must not join the outer group, since opening it would then close the section\n * that holds it.\n */\nexport const accordionKey: InjectionKey<AccordionContext | null> = Symbol('v-accordion')\n"],"mappings":";AAoBA,IAAa,IAAsD,OAAO,aAAa"}
1
+ {"version":3,"file":"context.js","names":["accordionKey"],"sources":["../../../src/components/VAccordion/context.ts"],"sourcesContent":["/** Share group icons through context; the density reaches the rows through its token. */\n\nimport type { InjectionKey } from 'vue'\n\nimport type { IconSource } from '../VIcon/types'\n\nexport interface AccordionContext {\n /** Group name for <details name>; undefined = several items may stay open at once. */\n name: string | undefined\n /** Icon in the closed state: an icon name, or an explicit render. */\n expandIcon: IconSource\n /** Icon in the open state; undefined = a rotation of `expandIcon`. */\n collapseIcon: IconSource | undefined\n}\n\n/**\n * `null` is what an item provides to its own content: an item placed straight inside\n * another one must not join the outer group, since opening it would then close the section\n * that holds it.\n */\nexport const accordionKey: InjectionKey<AccordionContext | null> = Symbol('v-accordion')\n"],"mappings":";AAoBA,IAAaA,IAAsD,OAAO,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"VAlert.js","names":[],"sources":["../../../src/components/VAlert/VAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A message that stays in the flow of the page. It carries no live role unless asked: a page\n * that renders alerts on load would otherwise have them all read out at once.\n */\n\nimport { computed } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { check_circle as checkCircleIcon } from '../VIcon/icons/check_circle'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport { error as errorIcon } from '../VIcon/icons/error'\nimport { info as infoIcon } from '../VIcon/icons/info'\nimport { warning as warningIcon } from '../VIcon/icons/warning'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport { useMessages } from '../../i18n/state'\n\n/** How the alert is painted: a tinted surface, or the page surface inside a tinted border. */\nexport type AlertVariant = 'soft' | 'outline'\n/** What the alert means, in colour. */\nexport type AlertTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\ninterface AlertProps {\n /**\n * How the alert is painted: a surface tinted with the tone (`soft`, the default), or the page\n * surface inside a border of the tone (`outline`), for an alert that should weigh less.\n */\n variant?: AlertVariant\n /** What the alert means, expressed as a colour. It also picks the default icon. */\n tone?: AlertTone\n /** A short line above the message, in bold. The `#title` slot replaces it. */\n title?: string\n /**\n * The icon before the text: an icon name, or an explicit render (the VIcon contract). Left\n * out, the tone brings its own.\n */\n icon?: IconSource\n /** Draws no icon at all, neither the one given nor the tone's. */\n hideIcon?: boolean\n /** Adds a close cross, which sets `open` to false and emits `close`. */\n closable?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n /**\n * Makes the alert a live region, for a message that appears in answer to what the reader\n * did: `role=\"alert\"` for the `danger` tone, which interrupts, `role=\"status\"` otherwise.\n */\n live?: boolean\n}\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n variant: 'soft',\n tone: 'accent',\n title: undefined,\n icon: undefined,\n hideIcon: false,\n closable: false,\n closeLabel: undefined,\n live: false,\n})\n\n/**\n * Whether the alert is shown. It is true by default, unlike other boolean props: an alert is\n * there until something takes it away, and binding the model is only needed to bring it back.\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst emit = defineEmits<{\n /** The reader closed the alert with its cross. `open` has already turned false. */\n close: []\n}>()\n\ndefineSlots<{\n /** The message. */\n default?(): unknown\n /** Replaces the `title` prop with content of your own. */\n title?(): unknown\n /** Buttons or links under the message. */\n actions?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\nconst DEFAULT_ICONS: Record<AlertTone, IconSource> = {\n neutral: infoIcon,\n accent: infoIcon,\n success: checkCircleIcon,\n danger: errorIcon,\n warning: warningIcon,\n}\n\nconst resolvedIcon = computed(() =>\n props.hideIcon ? undefined : iconProps(props.icon ?? DEFAULT_ICONS[props.tone]),\n)\n\nconst role = computed(() =>\n props.live ? (props.tone === 'danger' ? 'alert' : 'status') : undefined,\n)\n\nfunction close() {\n open.value = false\n emit('close')\n}\n</script>\n\n<template>\n <div v-if=\"open\" :role=\"role\" class=\"v-alert v-tone\" :data-variant=\"variant\" :data-tone=\"tone\">\n <VIcon v-if=\"resolvedIcon\" class=\"v-alert-icon\" v-bind=\"resolvedIcon\" />\n <div class=\"v-alert-body\">\n <p v-if=\"$slots.title || title\" class=\"v-alert-title\">\n <slot name=\"title\">{{ title }}</slot>\n </p>\n <div v-if=\"$slots.default\" class=\"v-alert-message\">\n <slot />\n </div>\n <div v-if=\"$slots.actions\" class=\"v-alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n <VIconButton\n v-if=\"closable\"\n class=\"v-alert-close\"\n :label=\"resolvedCloseLabel\"\n size=\"sm\"\n @click=\"close\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The colours come from the shared tone table (styles/tones.css, `.v-tone`), read here rather\n * than through `.v-variant`: the alert paints its own border and keeps the message in the body\n * text colour, which no shared variant does.\n */\n .v-alert {\n /* The height of one line of text, which the icon and the cross are centred against. */\n --alert-line: calc(var(--vectis-text-body-md-size) * var(--vectis-text-body-md-leading));\n\n display: flex;\n align-items: flex-start;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-4);\n border: 1px solid var(--tone-border-soft);\n border-radius: var(--vectis-radius-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-alert[data-variant='soft'] {\n background: var(--tone-bg-soft);\n }\n\n .v-alert[data-variant='outline'] {\n background: var(--vectis-color-surface);\n }\n\n .v-alert-icon {\n --vectis-icon-size: var(--vectis-icon-size-md);\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-icon-size-md)) / 2);\n color: var(--tone-text-tinted);\n }\n\n /* Long unbroken text, a URL in an error message, wraps instead of widening the alert. */\n .v-alert-body {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--vectis-space-1);\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n\n .v-alert-title {\n color: var(--tone-text-tinted);\n /*\n * The heavier weight marks the title against its own message, which is emphasis rather than\n * a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-alert-actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--vectis-space-2);\n margin-block-start: var(--vectis-space-2);\n }\n\n /*\n * The cross keeps the height of a small control but is centred on the first line, and gives\n * back its own padding so it does not double the alert's gutter.\n */\n .v-alert-close {\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-control-height-sm)) / 2);\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n /*\n * A neutral ghost hovers in grey, which turns muddy on a tinted surface: the cross hovers in a\n * tint of the alert's own tone instead. The tone table sits in a lower layer, so this rebind\n * wins whatever the specificity of the button's `[data-tone]` row.\n */\n .v-alert .v-alert-close[data-tone] {\n --tone-text-tinted: var(--vectis-color-text-muted);\n --tone-bg-soft: color-mix(in oklab, currentcolor, transparent 88%);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VAlert.js","names":["_sfc_main","VAlert_vue_vue_type_script_setup_true_lang_default","VAlert_default"],"sources":["../../../src/components/VAlert/VAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A message that stays in the flow of the page. It carries no live role unless asked: a page\n * that renders alerts on load would otherwise have them all read out at once.\n */\n\nimport { computed } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { check_circle as checkCircleIcon } from '../VIcon/icons/check_circle'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport { error as errorIcon } from '../VIcon/icons/error'\nimport { info as infoIcon } from '../VIcon/icons/info'\nimport { warning as warningIcon } from '../VIcon/icons/warning'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport { useMessages } from '../../i18n/state'\n\n/** How the alert is painted: a tinted surface, or the page surface inside a tinted border. */\nexport type AlertVariant = 'soft' | 'outline'\n/** What the alert means, in colour. */\nexport type AlertTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\ninterface AlertProps {\n /**\n * How the alert is painted: a surface tinted with the tone (`soft`, the default), or the page\n * surface inside a border of the tone (`outline`), for an alert that should weigh less.\n */\n variant?: AlertVariant\n /** What the alert means, expressed as a colour. It also picks the default icon. */\n tone?: AlertTone\n /** A short line above the message, in bold. The `#title` slot replaces it. */\n title?: string\n /**\n * The icon before the text: an icon name, or an explicit render (the VIcon contract). Left\n * out, the tone brings its own.\n */\n icon?: IconSource\n /** Draws no icon at all, neither the one given nor the tone's. */\n hideIcon?: boolean\n /** Adds a close cross, which sets `open` to false and emits `close`. */\n closable?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n /**\n * Makes the alert a live region, for a message that appears in answer to what the reader\n * did: `role=\"alert\"` for the `danger` tone, which interrupts, `role=\"status\"` otherwise.\n */\n live?: boolean\n}\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n variant: 'soft',\n tone: 'accent',\n title: undefined,\n icon: undefined,\n hideIcon: false,\n closable: false,\n closeLabel: undefined,\n live: false,\n})\n\n/**\n * Whether the alert is shown. It is true by default, unlike other boolean props: an alert is\n * there until something takes it away, and binding the model is only needed to bring it back.\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst emit = defineEmits<{\n /** The reader closed the alert with its cross. `open` has already turned false. */\n close: []\n}>()\n\ndefineSlots<{\n /** The message. */\n default?(): unknown\n /** Replaces the `title` prop with content of your own. */\n title?(): unknown\n /** Buttons or links under the message. */\n actions?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\nconst DEFAULT_ICONS: Record<AlertTone, IconSource> = {\n neutral: infoIcon,\n accent: infoIcon,\n success: checkCircleIcon,\n danger: errorIcon,\n warning: warningIcon,\n}\n\nconst resolvedIcon = computed(() =>\n props.hideIcon ? undefined : iconProps(props.icon ?? DEFAULT_ICONS[props.tone]),\n)\n\nconst role = computed(() =>\n props.live ? (props.tone === 'danger' ? 'alert' : 'status') : undefined,\n)\n\nfunction close() {\n open.value = false\n emit('close')\n}\n</script>\n\n<template>\n <div v-if=\"open\" :role=\"role\" class=\"v-alert v-tone\" :data-variant=\"variant\" :data-tone=\"tone\">\n <VIcon v-if=\"resolvedIcon\" class=\"v-alert-icon\" v-bind=\"resolvedIcon\" />\n <div class=\"v-alert-body\">\n <p v-if=\"$slots.title || title\" class=\"v-alert-title\">\n <slot name=\"title\">{{ title }}</slot>\n </p>\n <div v-if=\"$slots.default\" class=\"v-alert-message\">\n <slot />\n </div>\n <div v-if=\"$slots.actions\" class=\"v-alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n <VIconButton\n v-if=\"closable\"\n class=\"v-alert-close\"\n :label=\"resolvedCloseLabel\"\n size=\"sm\"\n @click=\"close\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The colours come from the shared tone table (styles/tones.css, `.v-tone`), read here rather\n * than through `.v-variant`: the alert paints its own border and keeps the message in the body\n * text colour, which no shared variant does.\n */\n .v-alert {\n /* The height of one line of text, which the icon and the cross are centred against. */\n --alert-line: calc(var(--vectis-text-body-md-size) * var(--vectis-text-body-md-leading));\n\n display: flex;\n align-items: flex-start;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-4);\n border: 1px solid var(--tone-border-soft);\n border-radius: var(--vectis-radius-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-alert[data-variant='soft'] {\n background: var(--tone-bg-soft);\n }\n\n .v-alert[data-variant='outline'] {\n background: var(--vectis-color-surface);\n }\n\n .v-alert-icon {\n --vectis-icon-size: var(--vectis-icon-size-md);\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-icon-size-md)) / 2);\n color: var(--tone-text-tinted);\n }\n\n /* Long unbroken text, a URL in an error message, wraps instead of widening the alert. */\n .v-alert-body {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--vectis-space-1);\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n\n .v-alert-title {\n color: var(--tone-text-tinted);\n /*\n * The heavier weight marks the title against its own message, which is emphasis rather than\n * a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-alert-actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--vectis-space-2);\n margin-block-start: var(--vectis-space-2);\n }\n\n /*\n * The cross keeps the height of a small control but is centred on the first line, and gives\n * back its own padding so it does not double the alert's gutter.\n */\n .v-alert-close {\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-control-height-sm)) / 2);\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n /*\n * A neutral ghost hovers in grey, which turns muddy on a tinted surface: the cross hovers in a\n * tint of the alert's own tone instead. The tone table sits in a lower layer, so this rebind\n * wins whatever the specificity of the button's `[data-tone]` row.\n */\n .v-alert .v-alert-close[data-tone] {\n --tone-text-tinted: var(--vectis-color-text-muted);\n --tone-bg-soft: color-mix(in oklab, currentcolor, transparent 88%);\n }\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"VAlert.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VAlert/VAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A message that stays in the flow of the page. It carries no live role unless asked: a page\n * that renders alerts on load would otherwise have them all read out at once.\n */\n\nimport { computed } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { check_circle as checkCircleIcon } from '../VIcon/icons/check_circle'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport { error as errorIcon } from '../VIcon/icons/error'\nimport { info as infoIcon } from '../VIcon/icons/info'\nimport { warning as warningIcon } from '../VIcon/icons/warning'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport { useMessages } from '../../i18n/state'\n\n/** How the alert is painted: a tinted surface, or the page surface inside a tinted border. */\nexport type AlertVariant = 'soft' | 'outline'\n/** What the alert means, in colour. */\nexport type AlertTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\ninterface AlertProps {\n /**\n * How the alert is painted: a surface tinted with the tone (`soft`, the default), or the page\n * surface inside a border of the tone (`outline`), for an alert that should weigh less.\n */\n variant?: AlertVariant\n /** What the alert means, expressed as a colour. It also picks the default icon. */\n tone?: AlertTone\n /** A short line above the message, in bold. The `#title` slot replaces it. */\n title?: string\n /**\n * The icon before the text: an icon name, or an explicit render (the VIcon contract). Left\n * out, the tone brings its own.\n */\n icon?: IconSource\n /** Draws no icon at all, neither the one given nor the tone's. */\n hideIcon?: boolean\n /** Adds a close cross, which sets `open` to false and emits `close`. */\n closable?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n /**\n * Makes the alert a live region, for a message that appears in answer to what the reader\n * did: `role=\"alert\"` for the `danger` tone, which interrupts, `role=\"status\"` otherwise.\n */\n live?: boolean\n}\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n variant: 'soft',\n tone: 'accent',\n title: undefined,\n icon: undefined,\n hideIcon: false,\n closable: false,\n closeLabel: undefined,\n live: false,\n})\n\n/**\n * Whether the alert is shown. It is true by default, unlike other boolean props: an alert is\n * there until something takes it away, and binding the model is only needed to bring it back.\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst emit = defineEmits<{\n /** The reader closed the alert with its cross. `open` has already turned false. */\n close: []\n}>()\n\ndefineSlots<{\n /** The message. */\n default?(): unknown\n /** Replaces the `title` prop with content of your own. */\n title?(): unknown\n /** Buttons or links under the message. */\n actions?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\nconst DEFAULT_ICONS: Record<AlertTone, IconSource> = {\n neutral: infoIcon,\n accent: infoIcon,\n success: checkCircleIcon,\n danger: errorIcon,\n warning: warningIcon,\n}\n\nconst resolvedIcon = computed(() =>\n props.hideIcon ? undefined : iconProps(props.icon ?? DEFAULT_ICONS[props.tone]),\n)\n\nconst role = computed(() =>\n props.live ? (props.tone === 'danger' ? 'alert' : 'status') : undefined,\n)\n\nfunction close() {\n open.value = false\n emit('close')\n}\n</script>\n\n<template>\n <div v-if=\"open\" :role=\"role\" class=\"v-alert v-tone\" :data-variant=\"variant\" :data-tone=\"tone\">\n <VIcon v-if=\"resolvedIcon\" class=\"v-alert-icon\" v-bind=\"resolvedIcon\" />\n <div class=\"v-alert-body\">\n <p v-if=\"$slots.title || title\" class=\"v-alert-title\">\n <slot name=\"title\">{{ title }}</slot>\n </p>\n <div v-if=\"$slots.default\" class=\"v-alert-message\">\n <slot />\n </div>\n <div v-if=\"$slots.actions\" class=\"v-alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n <VIconButton\n v-if=\"closable\"\n class=\"v-alert-close\"\n :label=\"resolvedCloseLabel\"\n size=\"sm\"\n @click=\"close\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The colours come from the shared tone table (styles/tones.css, `.v-tone`), read here rather\n * than through `.v-variant`: the alert paints its own border and keeps the message in the body\n * text colour, which no shared variant does.\n */\n .v-alert {\n /* The height of one line of text, which the icon and the cross are centred against. */\n --alert-line: calc(var(--vectis-text-body-md-size) * var(--vectis-text-body-md-leading));\n\n display: flex;\n align-items: flex-start;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-4);\n border: 1px solid var(--tone-border-soft);\n border-radius: var(--vectis-radius-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-alert[data-variant='soft'] {\n background: var(--tone-bg-soft);\n }\n\n .v-alert[data-variant='outline'] {\n background: var(--vectis-color-surface);\n }\n\n .v-alert-icon {\n --vectis-icon-size: var(--vectis-icon-size-md);\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-icon-size-md)) / 2);\n color: var(--tone-text-tinted);\n }\n\n /* Long unbroken text, a URL in an error message, wraps instead of widening the alert. */\n .v-alert-body {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--vectis-space-1);\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n\n .v-alert-title {\n color: var(--tone-text-tinted);\n /*\n * The heavier weight marks the title against its own message, which is emphasis rather than\n * a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-alert-actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--vectis-space-2);\n margin-block-start: var(--vectis-space-2);\n }\n\n /*\n * The cross keeps the height of a small control but is centred on the first line, and gives\n * back its own padding so it does not double the alert's gutter.\n */\n .v-alert-close {\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-control-height-sm)) / 2);\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n /*\n * A neutral ghost hovers in grey, which turns muddy on a tinted surface: the cross hovers in a\n * tint of the alert's own tone instead. The tone table sits in a lower layer, so this rebind\n * wins whatever the specificity of the button's `[data-tone]` row.\n */\n .v-alert .v-alert-close[data-tone] {\n --tone-text-tinted: var(--vectis-color-text-muted);\n --tone-bg-soft: color-mix(in oklab, currentcolor, transparent 88%);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDA,IAAM,IAAQ,GAeR,IAAO,EAAoB,GAAC,MAAyB,GAErD,IAAO,GAcP,IAAI,EAAY,GAChB,IAAqB,QAAe,EAAM,cAAc,EAAE,MAAM,OAAO,KAAK,GAE5E,IAA+C;GACnD,SAAS;GACT,QAAQ;GACR,SAAS;GACT,QAAQ;GACC;EACX,GAEM,IAAe,QACnB,EAAM,WAAW,KAAA,IAAY,EAAU,EAAM,QAAQ,EAAc,EAAM,KAAK,CAChF,GAEM,IAAO,QACX,EAAM,OAAQ,EAAM,SAAS,WAAW,UAAU,WAAY,KAAA,CAChE;EAEA,SAAS,IAAQ;GAEf,AADA,EAAK,QAAQ,IACb,EAAK,OAAO;EACd;mBAIa,EAAA,SAAA,EAAA,GAAX,EAsBM,OAAA;;GAtBY,MAAM,EAAA;GAAM,OAAM;GAAkB,gBAAc,EAAA;GAAU,aAAW,EAAA;;GAC1E,EAAA,SAAA,EAAA,GAAb,EAAwE,GAAxE,EAAwE;;IAA7C,OAAM;MAAuB,EAAA,KAAY,GAAA,MAAA,EAAA,KAAA,EAAA,IAAA,EAAA;GACpE,EAUM,OAVN,GAUM;IATKA,EAAAA,OAAO,SAAS,EAAA,SAAA,EAAA,GAAzB,EAEI,KAFJ,GAEI,CADF,EAAqC,EAAA,QAAA,SAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAElBA,EAAAA,OAAO,WAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAECA,EAAAA,OAAO,WAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAAuB,EAAA,QAAA,SAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;;GAInB,EAAA,YAAA,EAAA,GADR,EAQc,GAAA;;IANZ,OAAM;IACL,OAAO,EAAA;IACR,MAAK;IACJ,SAAO;;qBAEmB,CAA3B,EAA2B,GAAA,EAAnB,MAAM,EAAA,CAAA,EAAS,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VAlert.vue_vue_type_script_setup_true_lang.js","names":["$slots","_useModel","infoIcon","checkCircleIcon","errorIcon","warningIcon","close","_openBlock","_createElementBlock","_createBlock","VIcon","_mergeProps","_createCommentVNode","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","VIconButton","_withCtx","_createVNode","_unref","closeIcon","VIcon_default","VIconButton_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","VAlert_vue_vue_type_script_setup_true_lang_default","\"open\"","\"openModifiers\"","__emit","props","__props","open","useModel","emit","m","useMessages","resolvedCloseLabel","computed","DEFAULT_ICONS","info","check_circle","error","resolvedIcon","iconProps","role","close$1","openBlock","createElementBlock","createBlock","mergeProps","createCommentVNode","createElementVNode","_ctx","renderSlot","createTextVNode","toDisplayString","withCtx","createVNode","unref","close"],"sources":["../../../src/components/VAlert/VAlert.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * A message that stays in the flow of the page. It carries no live role unless asked: a page\n * that renders alerts on load would otherwise have them all read out at once.\n */\n\nimport { computed } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { check_circle as checkCircleIcon } from '../VIcon/icons/check_circle'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport { error as errorIcon } from '../VIcon/icons/error'\nimport { info as infoIcon } from '../VIcon/icons/info'\nimport { warning as warningIcon } from '../VIcon/icons/warning'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport { useMessages } from '../../i18n/state'\n\n/** How the alert is painted: a tinted surface, or the page surface inside a tinted border. */\nexport type AlertVariant = 'soft' | 'outline'\n/** What the alert means, in colour. */\nexport type AlertTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\n\ninterface AlertProps {\n /**\n * How the alert is painted: a surface tinted with the tone (`soft`, the default), or the page\n * surface inside a border of the tone (`outline`), for an alert that should weigh less.\n */\n variant?: AlertVariant\n /** What the alert means, expressed as a colour. It also picks the default icon. */\n tone?: AlertTone\n /** A short line above the message, in bold. The `#title` slot replaces it. */\n title?: string\n /**\n * The icon before the text: an icon name, or an explicit render (the VIcon contract). Left\n * out, the tone brings its own.\n */\n icon?: IconSource\n /** Draws no icon at all, neither the one given nor the tone's. */\n hideIcon?: boolean\n /** Adds a close cross, which sets `open` to false and emits `close`. */\n closable?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n /**\n * Makes the alert a live region, for a message that appears in answer to what the reader\n * did: `role=\"alert\"` for the `danger` tone, which interrupts, `role=\"status\"` otherwise.\n */\n live?: boolean\n}\n\nconst props = withDefaults(defineProps<AlertProps>(), {\n variant: 'soft',\n tone: 'accent',\n title: undefined,\n icon: undefined,\n hideIcon: false,\n closable: false,\n closeLabel: undefined,\n live: false,\n})\n\n/**\n * Whether the alert is shown. It is true by default, unlike other boolean props: an alert is\n * there until something takes it away, and binding the model is only needed to bring it back.\n */\nconst open = defineModel<boolean>('open', { default: true })\n\nconst emit = defineEmits<{\n /** The reader closed the alert with its cross. `open` has already turned false. */\n close: []\n}>()\n\ndefineSlots<{\n /** The message. */\n default?(): unknown\n /** Replaces the `title` prop with content of your own. */\n title?(): unknown\n /** Buttons or links under the message. */\n actions?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\nconst DEFAULT_ICONS: Record<AlertTone, IconSource> = {\n neutral: infoIcon,\n accent: infoIcon,\n success: checkCircleIcon,\n danger: errorIcon,\n warning: warningIcon,\n}\n\nconst resolvedIcon = computed(() =>\n props.hideIcon ? undefined : iconProps(props.icon ?? DEFAULT_ICONS[props.tone]),\n)\n\nconst role = computed(() =>\n props.live ? (props.tone === 'danger' ? 'alert' : 'status') : undefined,\n)\n\nfunction close() {\n open.value = false\n emit('close')\n}\n</script>\n\n<template>\n <div v-if=\"open\" :role=\"role\" class=\"v-alert v-tone\" :data-variant=\"variant\" :data-tone=\"tone\">\n <VIcon v-if=\"resolvedIcon\" class=\"v-alert-icon\" v-bind=\"resolvedIcon\" />\n <div class=\"v-alert-body\">\n <p v-if=\"$slots.title || title\" class=\"v-alert-title\">\n <slot name=\"title\">{{ title }}</slot>\n </p>\n <div v-if=\"$slots.default\" class=\"v-alert-message\">\n <slot />\n </div>\n <div v-if=\"$slots.actions\" class=\"v-alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n <VIconButton\n v-if=\"closable\"\n class=\"v-alert-close\"\n :label=\"resolvedCloseLabel\"\n size=\"sm\"\n @click=\"close\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The colours come from the shared tone table (styles/tones.css, `.v-tone`), read here rather\n * than through `.v-variant`: the alert paints its own border and keeps the message in the body\n * text colour, which no shared variant does.\n */\n .v-alert {\n /* The height of one line of text, which the icon and the cross are centred against. */\n --alert-line: calc(var(--vectis-text-body-md-size) * var(--vectis-text-body-md-leading));\n\n display: flex;\n align-items: flex-start;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-4);\n border: 1px solid var(--tone-border-soft);\n border-radius: var(--vectis-radius-surface);\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-body-md-size);\n font-weight: var(--vectis-text-body-md-weight);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-alert[data-variant='soft'] {\n background: var(--tone-bg-soft);\n }\n\n .v-alert[data-variant='outline'] {\n background: var(--vectis-color-surface);\n }\n\n .v-alert-icon {\n --vectis-icon-size: var(--vectis-icon-size-md);\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-icon-size-md)) / 2);\n color: var(--tone-text-tinted);\n }\n\n /* Long unbroken text, a URL in an error message, wraps instead of widening the alert. */\n .v-alert-body {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--vectis-space-1);\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n\n .v-alert-title {\n color: var(--tone-text-tinted);\n /*\n * The heavier weight marks the title against its own message, which is emphasis rather than\n * a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-alert-actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--vectis-space-2);\n margin-block-start: var(--vectis-space-2);\n }\n\n /*\n * The cross keeps the height of a small control but is centred on the first line, and gives\n * back its own padding so it does not double the alert's gutter.\n */\n .v-alert-close {\n flex: none;\n margin-block: calc((var(--alert-line) - var(--vectis-control-height-sm)) / 2);\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n /*\n * A neutral ghost hovers in grey, which turns muddy on a tinted surface: the cross hovers in a\n * tint of the alert's own tone instead. The tone table sits in a lower layer, so this rebind\n * wins whatever the specificity of the button's `[data-tone]` row.\n */\n .v-alert .v-alert-close[data-tone] {\n --tone-text-tinted: var(--vectis-color-text-muted);\n --tone-bg-soft: color-mix(in oklab, currentcolor, transparent 88%);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDA,IAAMiC,IAAQC,GAeRC,IAAOlC,EAAoBiC,GAAC,MAAyB,GAErDG,IAAOL,GAcPM,IAAIC,EAAY,GAChBC,IAAqBC,QAAeR,EAAM,cAAcK,EAAE,MAAM,OAAO,KAAK,GAE5EI,IAA+C;GACnD,SAASxC;GACT,QAAQA;GACR,SAASC;GACT,QAAQC;GACCC;EACX,GAEMyC,IAAeL,QACnBR,EAAM,WAAW,KAAA,IAAYc,EAAUd,EAAM,QAAQS,EAAcT,EAAM,KAAK,CAChF,GAEMe,IAAOP,QACXR,EAAM,OAAQA,EAAM,SAAS,WAAW,UAAU,WAAY,KAAA,CAChE;EAEA,SAAS3B,IAAQ;GAEf,AADA,EAAK,QAAQ,IACb+B,EAAK,OAAO;EACd;mBAIaF,EAAA,SAAX5B,EAAA,GAAAC,EAsBM,OAAA;;GAtBY,MAAMwC,EAAA;GAAM,OAAM;GAAkB,gBAAcd,EAAA;GAAU,aAAWA,EAAA;;GAC1EY,EAAA,SAAbvC,EAAA,GAAAE,EAAwEC,GAAxEC,EAAwE;;IAA7C,OAAM;GAAuB,GAAAmC,EAAA,KAAY,GAAA,MAAA,EAAA,KAAAQ,EAAA,IAAA,EAAA;GACpEzC,EAUM,OAVNY,GAUM;IATKzB,EAAAA,OAAO,SAASkC,EAAA,SAAzB3B,EAAA,GAAAC,EAEI,KAFJkB,GAEI,CADFZ,EAAqC0C,EAAA,QAAA,SAAA,CAAA,SAAA,CAAfzC,EAAAC,EAAAkB,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAAoB,EAAA,IAAA,EAAA;IAElBtD,EAAAA,OAAO,WAAlBO,EAAA,GAAAC,EAEM,OAFNmB,GAEM,CADJb,EAAQ0C,EAAA,QAAA,SAAA,CAAA,CAAA,KAAAF,EAAA,IAAA,EAAA;IAECtD,EAAAA,OAAO,WAAlBO,EAAA,GAAAC,EAEM,OAFNoB,GAEM,CADJd,EAAuB0C,EAAA,QAAA,SAAA,CAAA,CAAA,KAAAF,EAAA,IAAA,EAAA;;GAInBpB,EAAA,YADR3B,EAAA,GAAAE,EAQcQ,GAAA;;IANZ,OAAM;IACL,OAAOuB,EAAA;IACR,MAAK;IACJ,SAAOlC;;IAER,SAAAY,QAA2B,CAA3BC,EAA2BT,GAAA,EAAnB,MAAMU,EAAAC,CAAA,EAAS,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA"}
@@ -31,8 +31,6 @@ interface AvatarProps {
31
31
  * here; on its own it is `md`.
32
32
  */
33
33
  size?: AvatarSize;
34
- /** Takes 4px off the diameter, as it does on every other control. */
35
- compact?: boolean;
36
34
  /**
37
35
  * Turns the avatar into an `<a>` pointing at this address. A disabled link becomes inert:
38
36
  * the address is dropped, so it can be neither focused nor followed.
@@ -59,7 +57,6 @@ declare const __VLS_base: import('vue').DefineComponent<AvatarProps, {}, {}, {},
59
57
  size: AvatarSize;
60
58
  src: string;
61
59
  color: string;
62
- compact: boolean;
63
60
  clickable: boolean;
64
61
  href: string;
65
62
  disabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"VAvatar.js","names":[],"sources":["../../../src/components/VAvatar/VAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Resolve image, icon and initials in priority order. JavaScript handles failed images, inert\n * links and merging private colour variables with consumer styles.\n */\n\nimport { computed, inject, onMounted, ref, useAttrs, useSlots, useTemplateRef, watch } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { AVATAR_DEFAULT_SIZE, avatarGroupKey } from './context'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** The diameter of the disc, from the control size scale. */\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\ninterface AvatarProps {\n /**\n * The picture to show. It is what the avatar prefers above everything else, and an image\n * that fails to load hands over to the icon or the initials rather than leaving a gap.\n */\n src?: string\n /**\n * The icon to show when there is no picture. It comes before the initials, so an avatar\n * given both an icon and a name shows the icon.\n */\n icon?: IconSource\n /** The person's full name. */\n name?: string\n /**\n * The accessible name, when it should not simply be `name`: an avatar standing for a team\n * rather than a person, say. It wins over `name`, and a consumer `aria-label` wins over it.\n */\n alt?: string\n /**\n * A colour of your own, as a hex value, a CSS colour name or an `oklch()`. It REPLACES the\n * hue otherwise derived from `name`, and the text on it is always white, so a light colour\n * is the consumer's own risk.\n */\n color?: string\n /**\n * The diameter of the disc, from the size scale shared by every control. Leaving it out\n * inside a VAvatarGroup takes the group's size, which is the point of not defaulting it\n * here; on its own it is `md`.\n */\n size?: AvatarSize\n /** Takes 4px off the diameter, as it does on every other control. */\n compact?: boolean\n /**\n * Turns the avatar into an `<a>` pointing at this address. A disabled link becomes inert:\n * the address is dropped, so it can be neither focused nor followed.\n */\n href?: string\n /**\n * Turns the avatar into a `<button>`. It is ignored as soon as `href` makes it a link.\n * A VTooltip wrapping the avatar reaches this button through fallthrough.\n */\n clickable?: boolean\n /**\n * Makes an interactive avatar unusable: it stops responding, leaves the tab order and greys\n * out. It says nothing on a plain avatar, which was never interactive to begin with.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n src: undefined,\n icon: undefined,\n name: undefined,\n alt: undefined,\n color: undefined,\n size: undefined,\n compact: false,\n href: undefined,\n clickable: false,\n disabled: false,\n})\n\ndefineSlots<{\n /** Fallback content (replaces the initials), e.g. VAvatarGroup's \"+X\". */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst group = inject(avatarGroupKey, null)\n\n// The size is the avatar's own answer first, then the group's; the density is cumulative,\n// the two terms written out in context.ts.\nconst resolvedSize = computed<AvatarSize>(() => props.size ?? group?.size ?? AVATAR_DEFAULT_SIZE)\nconst resolvedCompact = computed(() => props.compact || Boolean(group?.compact))\n\n// Fallthrough without `style`, which rootStyle merges with the component's own; the click\n// handler is also dropped on an inert link.\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: passedAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => Object.fromEntries(Object.entries(attrs).filter(([key]) => key !== 'style')),\n})\n\nconst isInteractive = computed(() => isLink.value || props.clickable)\nconst tag = computed(() => (isLink.value ? 'a' : props.clickable ? 'button' : 'span'))\n\n// @core\n// The image failed to load: the initials take over, so an avatar is never an empty box.\nconst failed = ref(false)\nwatch(\n () => props.src,\n () => {\n failed.value = false\n },\n)\nconst showImage = computed(() => Boolean(props.src) && !failed.value)\n\n/*\n * On a server-rendered page the browser may give up on the picture before hydration attaches\n * `@error`, and that event is never sent again: the disc would stay an empty circle. A picture\n * already settled with no pixels at mount is one that failed.\n */\nconst imageEl = useTemplateRef<HTMLImageElement>('image')\nonMounted(() => {\n const img = imageEl.value\n if (img?.complete && img.naturalWidth === 0) failed.value = true\n})\n\n// @a11y\n/*\n * The name bound on the root: a consumer `aria-labelledby` removes it, a consumer `aria-label`\n * replaces it, and otherwise it is `alt`, then `name`. A picture on show carries that name as\n * its own `alt`, so the root then names itself only with what the consumer wrote.\n */\nconst ariaLabel = useAriaLabel(() => (showImage.value ? undefined : (props.alt ?? props.name)))\nconst named = computed(() => ariaLabel.value !== undefined || attrs['aria-labelledby'] != null)\n\n// @core\nconst initials = computed(() => {\n if (!props.name) return ''\n /* Whole characters, not UTF-16 halves: `part[0]` of \"😀\" is a lone surrogate, drawn as a\n replacement box. And `toUpperCase` rather than its locale-aware sibling, whose answer\n depends on the runtime's locale, which the server and the browser need not share. */\n return props.name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => [...part][0]?.toUpperCase() ?? '')\n .join('')\n})\n\n// @core\n/*\n * Only the hue is inline (a unitless scalar); the CSS composes background/text with L/C fixed\n * per theme (light/dark adaptation without depending on contrast-color). A colour computed\n * outside the tokens, a deliberate exception.\n */\nconst hue = computed(() => {\n if (!props.name) return null\n let hash = 0\n for (let i = 0; i < props.name.length; i++) {\n hash = (hash * 31 + props.name.charCodeAt(i)) | 0\n }\n return Math.abs(hash) % 360\n})\nconst isAuto = computed(() => props.color === undefined && hue.value !== null)\n\n// @a11y\n// A static avatar with no picture is an image named by `alt`/ `name`. Anything else keeps the\n// role that arrived in the attributes; `link` on an inert link, a consumer's own otherwise.\nconst role = computed(() =>\n !isInteractive.value && !showImage.value && named.value\n ? 'img'\n : (passedAttrs.value.role as string | undefined),\n)\n\n// @devwarn\n// A button or a link named by nothing: no `name`, no `alt`, no `aria-*` and no slot text. A\n// picture alone does not count, its `alt` coming from the same two props.\nif (isDev) {\n const slots = useSlots()\n onMounted(() => {\n if (isInteractive.value && !named.value && !props.alt && !props.name && !slots.default) {\n console.warn(\n '[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.',\n )\n }\n })\n}\n\nconst rootStyle = computed<StyleValue>(() => [\n customColorStyle(props.color) ??\n (isAuto.value ? { '--avatar-hue': String(hue.value) } : undefined),\n attrs.style as StyleValue,\n])\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"passedAttrs\"\n class=\"v-avatar v-control\"\n :style=\"rootStyle\"\n :data-size=\"resolvedSize\"\n :data-compact=\"resolvedCompact ? '' : undefined\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-auto=\"isAuto ? '' : undefined\"\n :href=\"linkHref\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n :disabled=\"tag === 'button' ? disabled : undefined\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n >\n <img\n v-if=\"showImage\"\n ref=\"image\"\n class=\"v-avatar-image\"\n :src=\"src\"\n :alt=\"alt ?? name ?? ''\"\n @error=\"failed = true\"\n />\n <VIcon v-else-if=\"icon\" v-bind=\"iconProps(icon)\" class=\"v-avatar-icon\" />\n <slot v-else>\n <span class=\"v-avatar-initials\" aria-hidden=\"true\">{{ initials }}</span>\n </slot>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-avatar {\n --avatar-bg: var(--vectis-color-surface-muted);\n --avatar-text: var(--vectis-color-text-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-height);\n block-size: var(--control-height);\n flex: none;\n overflow: hidden;\n padding: 0;\n border: none;\n background: var(--avatar-bg);\n color: var(--avatar-text);\n border-radius: var(--vectis-radius-pill);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-font-weight-semibold);\n line-height: var(--vectis-text-control-leading);\n text-decoration: none;\n user-select: none;\n /*\n * The `transparent` fallback is what lets a lone avatar render ringless, and it is also\n * what makes a divergence silent: rename it on one side and the discs in a group simply\n * stop being separated, with no error and nothing missing from the box.\n */\n box-shadow: 0 0 0 var(--vectis-control-size-avatar-ring) var(--avatar-ring-color, transparent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /*\n * The lightness/chroma pairs are set on the THEME scopes and inherited, rather than written\n * in a `[data-theme='dark'] .v-avatar` rule: a descendant selector matches ANY dark ancestor,\n * so a light subtree nested in a dark page kept the dark discs. An inherited value is\n * resolved by the NEAREST scope, which is exactly how the semantic tokens behave.\n */\n :root,\n [data-theme='light'] {\n --avatar-auto-bg-lc: 0.9 0.06;\n --avatar-auto-text-lc: 0.42 0.13;\n }\n\n [data-theme='dark'] {\n --avatar-auto-bg-lc: 0.42 0.09;\n --avatar-auto-text-lc: 0.92 0.05;\n }\n\n .v-avatar[data-auto] {\n --avatar-bg: oklch(var(--avatar-auto-bg-lc) var(--avatar-hue));\n --avatar-text: oklch(var(--avatar-auto-text-lc) var(--avatar-hue));\n }\n\n /* Custom colour (--custom-color inline): wins, with a fixed white text (contrast\n is the consumer's responsibility). */\n .v-avatar[data-custom] {\n --avatar-bg: var(--custom-color);\n --avatar-text: var(--vectis-color-text-on-accent);\n }\n\n .v-avatar-image {\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n .v-avatar-icon {\n --vectis-icon-size: calc(var(--control-height) * 0.55);\n }\n\n :is(a, button).v-avatar {\n cursor: pointer;\n }\n\n :is(a, button).v-avatar:hover:not([aria-disabled='true'], :disabled) {\n background: color-mix(in oklab, var(--avatar-bg), var(--vectis-color-text) 10%);\n }\n\n :is(a, button).v-avatar:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-avatar:is(:disabled, [aria-disabled='true']) {\n cursor: not-allowed;\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-avatar {\n transition: none;\n }\n }\n\n /* The outline gives each disc its circle back; the focus ring, at (0,2,0), still wins over it. */\n @media (forced-colors: active) {\n .v-avatar {\n outline: var(--vectis-control-border-width) solid CanvasText;\n outline-offset: calc(-1 * var(--vectis-control-border-width));\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VAvatar.js","names":["_sfc_main","VAvatar_vue_vue_type_script_setup_true_lang_default","VAvatar_default"],"sources":["../../../src/components/VAvatar/VAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Resolve image, icon and initials in priority order. JavaScript handles failed images, inert\n * links and merging private colour variables with consumer styles.\n */\n\nimport { computed, inject, onMounted, ref, useAttrs, useSlots, useTemplateRef, watch } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { AVATAR_DEFAULT_SIZE, avatarGroupKey } from './context'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** The diameter of the disc, from the control size scale. */\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\ninterface AvatarProps {\n /**\n * The picture to show. It is what the avatar prefers above everything else, and an image\n * that fails to load hands over to the icon or the initials rather than leaving a gap.\n */\n src?: string\n /**\n * The icon to show when there is no picture. It comes before the initials, so an avatar\n * given both an icon and a name shows the icon.\n */\n icon?: IconSource\n /** The person's full name. */\n name?: string\n /**\n * The accessible name, when it should not simply be `name`: an avatar standing for a team\n * rather than a person, say. It wins over `name`, and a consumer `aria-label` wins over it.\n */\n alt?: string\n /**\n * A colour of your own, as a hex value, a CSS colour name or an `oklch()`. It REPLACES the\n * hue otherwise derived from `name`, and the text on it is always white, so a light colour\n * is the consumer's own risk.\n */\n color?: string\n /**\n * The diameter of the disc, from the size scale shared by every control. Leaving it out\n * inside a VAvatarGroup takes the group's size, which is the point of not defaulting it\n * here; on its own it is `md`.\n */\n size?: AvatarSize\n /**\n * Turns the avatar into an `<a>` pointing at this address. A disabled link becomes inert:\n * the address is dropped, so it can be neither focused nor followed.\n */\n href?: string\n /**\n * Turns the avatar into a `<button>`. It is ignored as soon as `href` makes it a link.\n * A VTooltip wrapping the avatar reaches this button through fallthrough.\n */\n clickable?: boolean\n /**\n * Makes an interactive avatar unusable: it stops responding, leaves the tab order and greys\n * out. It says nothing on a plain avatar, which was never interactive to begin with.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n src: undefined,\n icon: undefined,\n name: undefined,\n alt: undefined,\n color: undefined,\n size: undefined,\n href: undefined,\n clickable: false,\n disabled: false,\n})\n\ndefineSlots<{\n /** Fallback content (replaces the initials), e.g. VAvatarGroup's \"+X\". */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst group = inject(avatarGroupKey, null)\n\n// The size is the avatar's own answer first, then the group's (context.ts).\nconst resolvedSize = computed<AvatarSize>(() => props.size ?? group?.size ?? AVATAR_DEFAULT_SIZE)\n\n// Fallthrough without `style`, which rootStyle merges with the component's own; the click\n// handler is also dropped on an inert link.\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: passedAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => Object.fromEntries(Object.entries(attrs).filter(([key]) => key !== 'style')),\n})\n\nconst isInteractive = computed(() => isLink.value || props.clickable)\nconst tag = computed(() => (isLink.value ? 'a' : props.clickable ? 'button' : 'span'))\n\n// @core\n// The image failed to load: the initials take over, so an avatar is never an empty box.\nconst failed = ref(false)\nwatch(\n () => props.src,\n () => {\n failed.value = false\n },\n)\nconst showImage = computed(() => Boolean(props.src) && !failed.value)\n\n/*\n * On a server-rendered page the browser may give up on the picture before hydration attaches\n * `@error`, and that event is never sent again: the disc would stay an empty circle. A picture\n * already settled with no pixels at mount is one that failed.\n */\nconst imageEl = useTemplateRef<HTMLImageElement>('image')\nonMounted(() => {\n const img = imageEl.value\n if (img?.complete && img.naturalWidth === 0) failed.value = true\n})\n\n// @a11y\n/*\n * The name bound on the root: a consumer `aria-labelledby` removes it, a consumer `aria-label`\n * replaces it, and otherwise it is `alt`, then `name`. A picture on show carries that name as\n * its own `alt`, so the root then names itself only with what the consumer wrote.\n */\nconst ariaLabel = useAriaLabel(() => (showImage.value ? undefined : (props.alt ?? props.name)))\nconst named = computed(() => ariaLabel.value !== undefined || attrs['aria-labelledby'] != null)\n\n// @core\nconst initials = computed(() => {\n if (!props.name) return ''\n /* Whole characters, not UTF-16 halves: `part[0]` of \"😀\" is a lone surrogate, drawn as a\n replacement box. And `toUpperCase` rather than its locale-aware sibling, whose answer\n depends on the runtime's locale, which the server and the browser need not share. */\n return props.name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => [...part][0]?.toUpperCase() ?? '')\n .join('')\n})\n\n// @core\n/*\n * Only the hue is inline (a unitless scalar); the CSS composes background/text with L/C fixed\n * per theme (light/dark adaptation without depending on contrast-color). A colour computed\n * outside the tokens, a deliberate exception.\n */\nconst hue = computed(() => {\n if (!props.name) return null\n let hash = 0\n for (let i = 0; i < props.name.length; i++) {\n hash = (hash * 31 + props.name.charCodeAt(i)) | 0\n }\n return Math.abs(hash) % 360\n})\nconst isAuto = computed(() => props.color === undefined && hue.value !== null)\n\n// @a11y\n// A static avatar with no picture is an image named by `alt`/ `name`. Anything else keeps the\n// role that arrived in the attributes; `link` on an inert link, a consumer's own otherwise.\nconst role = computed(() =>\n !isInteractive.value && !showImage.value && named.value\n ? 'img'\n : (passedAttrs.value.role as string | undefined),\n)\n\n// @devwarn\n// A button or a link named by nothing: no `name`, no `alt`, no `aria-*` and no slot text. A\n// picture alone does not count, its `alt` coming from the same two props.\nif (isDev) {\n const slots = useSlots()\n onMounted(() => {\n if (isInteractive.value && !named.value && !props.alt && !props.name && !slots.default) {\n console.warn(\n '[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.',\n )\n }\n })\n}\n\nconst rootStyle = computed<StyleValue>(() => [\n customColorStyle(props.color) ??\n (isAuto.value ? { '--avatar-hue': String(hue.value) } : undefined),\n attrs.style as StyleValue,\n])\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"passedAttrs\"\n class=\"v-avatar v-control\"\n :style=\"rootStyle\"\n :data-size=\"resolvedSize\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-auto=\"isAuto ? '' : undefined\"\n :href=\"linkHref\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n :disabled=\"tag === 'button' ? disabled : undefined\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n >\n <img\n v-if=\"showImage\"\n ref=\"image\"\n class=\"v-avatar-image\"\n :src=\"src\"\n :alt=\"alt ?? name ?? ''\"\n @error=\"failed = true\"\n />\n <VIcon v-else-if=\"icon\" v-bind=\"iconProps(icon)\" class=\"v-avatar-icon\" />\n <slot v-else>\n <span class=\"v-avatar-initials\" aria-hidden=\"true\">{{ initials }}</span>\n </slot>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-avatar {\n --avatar-bg: var(--vectis-color-surface-muted);\n --avatar-text: var(--vectis-color-text-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-height);\n block-size: var(--control-height);\n flex: none;\n overflow: hidden;\n padding: 0;\n border: none;\n background: var(--avatar-bg);\n color: var(--avatar-text);\n border-radius: var(--vectis-radius-pill);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-font-weight-semibold);\n line-height: var(--vectis-text-control-leading);\n text-decoration: none;\n user-select: none;\n /*\n * The `transparent` fallback is what lets a lone avatar render ringless, and it is also\n * what makes a divergence silent: rename it on one side and the discs in a group simply\n * stop being separated, with no error and nothing missing from the box.\n */\n box-shadow: 0 0 0 var(--vectis-control-size-avatar-ring) var(--avatar-ring-color, transparent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /*\n * The lightness/chroma pairs are set on the THEME scopes and inherited, rather than written\n * in a `[data-theme='dark'] .v-avatar` rule: a descendant selector matches ANY dark ancestor,\n * so a light subtree nested in a dark page kept the dark discs. An inherited value is\n * resolved by the NEAREST scope, which is exactly how the semantic tokens behave.\n */\n :root,\n [data-theme='light'] {\n --avatar-auto-bg-lc: 0.9 0.06;\n --avatar-auto-text-lc: 0.42 0.13;\n }\n\n [data-theme='dark'] {\n --avatar-auto-bg-lc: 0.42 0.09;\n --avatar-auto-text-lc: 0.92 0.05;\n }\n\n .v-avatar[data-auto] {\n --avatar-bg: oklch(var(--avatar-auto-bg-lc) var(--avatar-hue));\n --avatar-text: oklch(var(--avatar-auto-text-lc) var(--avatar-hue));\n }\n\n /* Custom colour (--custom-color inline): wins, with a fixed white text (contrast\n is the consumer's responsibility). */\n .v-avatar[data-custom] {\n --avatar-bg: var(--custom-color);\n --avatar-text: var(--vectis-color-text-on-accent);\n }\n\n .v-avatar-image {\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n .v-avatar-icon {\n --vectis-icon-size: calc(var(--control-height) * 0.55);\n }\n\n :is(a, button).v-avatar {\n cursor: pointer;\n }\n\n :is(a, button).v-avatar:hover:not([aria-disabled='true'], :disabled) {\n background: color-mix(in oklab, var(--avatar-bg), var(--vectis-color-text) 10%);\n }\n\n :is(a, button).v-avatar:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-avatar:is(:disabled, [aria-disabled='true']) {\n cursor: not-allowed;\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-avatar {\n transition: none;\n }\n }\n\n /* The outline gives each disc its circle back; the focus ring, at (0,2,0), still wins over it. */\n @media (forced-colors: active) {\n .v-avatar {\n outline: var(--vectis-control-border-width) solid CanvasText;\n outline-offset: calc(-1 * var(--vectis-control-border-width));\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -20,10 +20,6 @@ var E = ["src", "alt"], D = {
20
20
  alt: { default: void 0 },
21
21
  color: { default: void 0 },
22
22
  size: { default: void 0 },
23
- compact: {
24
- type: Boolean,
25
- default: !1
26
- },
27
23
  href: { default: void 0 },
28
24
  clickable: {
29
25
  type: Boolean,
@@ -35,59 +31,57 @@ var E = ["src", "alt"], D = {
35
31
  }
36
32
  },
37
33
  setup(d) {
38
- let O = d, k = x(), A = f(o, null), j = s(() => O.size ?? A?.size ?? "md"), M = s(() => O.compact || !!A?.compact), { isLink: N, isInertLink: P, linkHref: F, attrs: I } = i({
34
+ let O = d, k = x(), A = f(o, null), j = s(() => O.size ?? A?.size ?? "md"), { isLink: M, isInertLink: N, linkHref: P, attrs: F } = i({
39
35
  href: () => O.href,
40
36
  inert: () => O.disabled,
41
37
  attrs: () => Object.fromEntries(Object.entries(k).filter(([e]) => e !== "style"))
42
- }), L = s(() => N.value || O.clickable), R = s(() => N.value ? "a" : O.clickable ? "button" : "span"), z = g(!1);
38
+ }), I = s(() => M.value || O.clickable), L = s(() => M.value ? "a" : O.clickable ? "button" : "span"), R = g(!1);
43
39
  w(() => O.src, () => {
44
- z.value = !1;
40
+ R.value = !1;
45
41
  });
46
- let B = s(() => !!O.src && !z.value), V = C("image");
42
+ let z = s(() => !!O.src && !R.value), B = C("image");
47
43
  m(() => {
48
- let e = V.value;
49
- e?.complete && e.naturalWidth === 0 && (z.value = !0);
44
+ let e = B.value;
45
+ e?.complete && e.naturalWidth === 0 && (R.value = !0);
50
46
  });
51
- let H = a(() => B.value ? void 0 : O.alt ?? O.name), U = s(() => H.value !== void 0 || k["aria-labelledby"] != null), W = s(() => O.name ? O.name.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => [...e][0]?.toUpperCase() ?? "").join("") : ""), G = s(() => {
47
+ let V = a(() => z.value ? void 0 : O.alt ?? O.name), H = s(() => V.value !== void 0 || k["aria-labelledby"] != null), U = s(() => O.name ? O.name.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => [...e][0]?.toUpperCase() ?? "").join("") : ""), W = s(() => {
52
48
  if (!O.name) return null;
53
49
  let e = 0;
54
50
  for (let t = 0; t < O.name.length; t++) e = e * 31 + O.name.charCodeAt(t) | 0;
55
51
  return Math.abs(e) % 360;
56
- }), K = s(() => O.color === void 0 && G.value !== null), q = s(() => !L.value && !B.value && U.value ? "img" : I.value.role);
52
+ }), G = s(() => O.color === void 0 && W.value !== null), K = s(() => !I.value && !z.value && H.value ? "img" : F.value.role);
57
53
  if (e) {
58
54
  let e = S();
59
55
  m(() => {
60
- L.value && !U.value && !O.alt && !O.name && !e.default && console.warn("[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.");
56
+ I.value && !H.value && !O.alt && !O.name && !e.default && console.warn("[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.");
61
57
  });
62
58
  }
63
- let J = s(() => [n(O.color) ?? (K.value ? { "--avatar-hue": String(G.value) } : void 0), k.style]);
64
- return (e, n) => (h(), c(v(R.value), p({ "aria-disabled": b(P) ? "true" : void 0 }, b(I), {
59
+ let q = s(() => [n(O.color) ?? (G.value ? { "--avatar-hue": String(W.value) } : void 0), k.style]);
60
+ return (e, n) => (h(), c(v(L.value), p({ "aria-disabled": b(N) ? "true" : void 0 }, b(F), {
65
61
  class: "v-avatar v-control",
66
- style: J.value,
62
+ style: q.value,
67
63
  "data-size": j.value,
68
- "data-compact": M.value ? "" : void 0,
69
64
  "data-custom": d.color === void 0 ? void 0 : "",
70
- "data-auto": K.value ? "" : void 0,
71
- href: b(F),
72
- type: R.value === "button" ? "button" : void 0,
73
- disabled: R.value === "button" ? d.disabled : void 0,
74
- role: q.value,
75
- "aria-label": b(H)
65
+ "data-auto": G.value ? "" : void 0,
66
+ href: b(P),
67
+ type: L.value === "button" ? "button" : void 0,
68
+ disabled: L.value === "button" ? d.disabled : void 0,
69
+ role: K.value,
70
+ "aria-label": b(V)
76
71
  }), {
77
- default: T(() => [B.value ? (h(), l("img", {
72
+ default: T(() => [z.value ? (h(), l("img", {
78
73
  key: 0,
79
74
  ref: "image",
80
75
  class: "v-avatar-image",
81
76
  src: d.src,
82
77
  alt: d.alt ?? d.name ?? "",
83
- onError: n[0] ||= (e) => z.value = !0
84
- }, null, 40, E)) : d.icon ? (h(), c(r, p({ key: 1 }, b(t)(d.icon), { class: "v-avatar-icon" }), null, 16)) : _(e.$slots, "default", {}, () => [u("span", D, y(W.value), 1)], void 0, 2)]),
78
+ onError: n[0] ||= (e) => R.value = !0
79
+ }, null, 40, E)) : d.icon ? (h(), c(r, p({ key: 1 }, b(t)(d.icon), { class: "v-avatar-icon" }), null, 16)) : _(e.$slots, "default", {}, () => [u("span", D, y(U.value), 1)], void 0, 2)]),
85
80
  _: 3
86
81
  }, 16, [
87
82
  "aria-disabled",
88
83
  "style",
89
84
  "data-size",
90
- "data-compact",
91
85
  "data-custom",
92
86
  "data-auto",
93
87
  "href",
@@ -1 +1 @@
1
- {"version":3,"file":"VAvatar.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VAvatar/VAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Resolve image, icon and initials in priority order. JavaScript handles failed images, inert\n * links and merging private colour variables with consumer styles.\n */\n\nimport { computed, inject, onMounted, ref, useAttrs, useSlots, useTemplateRef, watch } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { AVATAR_DEFAULT_SIZE, avatarGroupKey } from './context'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** The diameter of the disc, from the control size scale. */\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\ninterface AvatarProps {\n /**\n * The picture to show. It is what the avatar prefers above everything else, and an image\n * that fails to load hands over to the icon or the initials rather than leaving a gap.\n */\n src?: string\n /**\n * The icon to show when there is no picture. It comes before the initials, so an avatar\n * given both an icon and a name shows the icon.\n */\n icon?: IconSource\n /** The person's full name. */\n name?: string\n /**\n * The accessible name, when it should not simply be `name`: an avatar standing for a team\n * rather than a person, say. It wins over `name`, and a consumer `aria-label` wins over it.\n */\n alt?: string\n /**\n * A colour of your own, as a hex value, a CSS colour name or an `oklch()`. It REPLACES the\n * hue otherwise derived from `name`, and the text on it is always white, so a light colour\n * is the consumer's own risk.\n */\n color?: string\n /**\n * The diameter of the disc, from the size scale shared by every control. Leaving it out\n * inside a VAvatarGroup takes the group's size, which is the point of not defaulting it\n * here; on its own it is `md`.\n */\n size?: AvatarSize\n /** Takes 4px off the diameter, as it does on every other control. */\n compact?: boolean\n /**\n * Turns the avatar into an `<a>` pointing at this address. A disabled link becomes inert:\n * the address is dropped, so it can be neither focused nor followed.\n */\n href?: string\n /**\n * Turns the avatar into a `<button>`. It is ignored as soon as `href` makes it a link.\n * A VTooltip wrapping the avatar reaches this button through fallthrough.\n */\n clickable?: boolean\n /**\n * Makes an interactive avatar unusable: it stops responding, leaves the tab order and greys\n * out. It says nothing on a plain avatar, which was never interactive to begin with.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n src: undefined,\n icon: undefined,\n name: undefined,\n alt: undefined,\n color: undefined,\n size: undefined,\n compact: false,\n href: undefined,\n clickable: false,\n disabled: false,\n})\n\ndefineSlots<{\n /** Fallback content (replaces the initials), e.g. VAvatarGroup's \"+X\". */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst group = inject(avatarGroupKey, null)\n\n// The size is the avatar's own answer first, then the group's; the density is cumulative,\n// the two terms written out in context.ts.\nconst resolvedSize = computed<AvatarSize>(() => props.size ?? group?.size ?? AVATAR_DEFAULT_SIZE)\nconst resolvedCompact = computed(() => props.compact || Boolean(group?.compact))\n\n// Fallthrough without `style`, which rootStyle merges with the component's own; the click\n// handler is also dropped on an inert link.\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: passedAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => Object.fromEntries(Object.entries(attrs).filter(([key]) => key !== 'style')),\n})\n\nconst isInteractive = computed(() => isLink.value || props.clickable)\nconst tag = computed(() => (isLink.value ? 'a' : props.clickable ? 'button' : 'span'))\n\n// @core\n// The image failed to load: the initials take over, so an avatar is never an empty box.\nconst failed = ref(false)\nwatch(\n () => props.src,\n () => {\n failed.value = false\n },\n)\nconst showImage = computed(() => Boolean(props.src) && !failed.value)\n\n/*\n * On a server-rendered page the browser may give up on the picture before hydration attaches\n * `@error`, and that event is never sent again: the disc would stay an empty circle. A picture\n * already settled with no pixels at mount is one that failed.\n */\nconst imageEl = useTemplateRef<HTMLImageElement>('image')\nonMounted(() => {\n const img = imageEl.value\n if (img?.complete && img.naturalWidth === 0) failed.value = true\n})\n\n// @a11y\n/*\n * The name bound on the root: a consumer `aria-labelledby` removes it, a consumer `aria-label`\n * replaces it, and otherwise it is `alt`, then `name`. A picture on show carries that name as\n * its own `alt`, so the root then names itself only with what the consumer wrote.\n */\nconst ariaLabel = useAriaLabel(() => (showImage.value ? undefined : (props.alt ?? props.name)))\nconst named = computed(() => ariaLabel.value !== undefined || attrs['aria-labelledby'] != null)\n\n// @core\nconst initials = computed(() => {\n if (!props.name) return ''\n /* Whole characters, not UTF-16 halves: `part[0]` of \"😀\" is a lone surrogate, drawn as a\n replacement box. And `toUpperCase` rather than its locale-aware sibling, whose answer\n depends on the runtime's locale, which the server and the browser need not share. */\n return props.name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => [...part][0]?.toUpperCase() ?? '')\n .join('')\n})\n\n// @core\n/*\n * Only the hue is inline (a unitless scalar); the CSS composes background/text with L/C fixed\n * per theme (light/dark adaptation without depending on contrast-color). A colour computed\n * outside the tokens, a deliberate exception.\n */\nconst hue = computed(() => {\n if (!props.name) return null\n let hash = 0\n for (let i = 0; i < props.name.length; i++) {\n hash = (hash * 31 + props.name.charCodeAt(i)) | 0\n }\n return Math.abs(hash) % 360\n})\nconst isAuto = computed(() => props.color === undefined && hue.value !== null)\n\n// @a11y\n// A static avatar with no picture is an image named by `alt`/ `name`. Anything else keeps the\n// role that arrived in the attributes; `link` on an inert link, a consumer's own otherwise.\nconst role = computed(() =>\n !isInteractive.value && !showImage.value && named.value\n ? 'img'\n : (passedAttrs.value.role as string | undefined),\n)\n\n// @devwarn\n// A button or a link named by nothing: no `name`, no `alt`, no `aria-*` and no slot text. A\n// picture alone does not count, its `alt` coming from the same two props.\nif (isDev) {\n const slots = useSlots()\n onMounted(() => {\n if (isInteractive.value && !named.value && !props.alt && !props.name && !slots.default) {\n console.warn(\n '[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.',\n )\n }\n })\n}\n\nconst rootStyle = computed<StyleValue>(() => [\n customColorStyle(props.color) ??\n (isAuto.value ? { '--avatar-hue': String(hue.value) } : undefined),\n attrs.style as StyleValue,\n])\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"passedAttrs\"\n class=\"v-avatar v-control\"\n :style=\"rootStyle\"\n :data-size=\"resolvedSize\"\n :data-compact=\"resolvedCompact ? '' : undefined\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-auto=\"isAuto ? '' : undefined\"\n :href=\"linkHref\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n :disabled=\"tag === 'button' ? disabled : undefined\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n >\n <img\n v-if=\"showImage\"\n ref=\"image\"\n class=\"v-avatar-image\"\n :src=\"src\"\n :alt=\"alt ?? name ?? ''\"\n @error=\"failed = true\"\n />\n <VIcon v-else-if=\"icon\" v-bind=\"iconProps(icon)\" class=\"v-avatar-icon\" />\n <slot v-else>\n <span class=\"v-avatar-initials\" aria-hidden=\"true\">{{ initials }}</span>\n </slot>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-avatar {\n --avatar-bg: var(--vectis-color-surface-muted);\n --avatar-text: var(--vectis-color-text-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-height);\n block-size: var(--control-height);\n flex: none;\n overflow: hidden;\n padding: 0;\n border: none;\n background: var(--avatar-bg);\n color: var(--avatar-text);\n border-radius: var(--vectis-radius-pill);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-font-weight-semibold);\n line-height: var(--vectis-text-control-leading);\n text-decoration: none;\n user-select: none;\n /*\n * The `transparent` fallback is what lets a lone avatar render ringless, and it is also\n * what makes a divergence silent: rename it on one side and the discs in a group simply\n * stop being separated, with no error and nothing missing from the box.\n */\n box-shadow: 0 0 0 var(--vectis-control-size-avatar-ring) var(--avatar-ring-color, transparent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /*\n * The lightness/chroma pairs are set on the THEME scopes and inherited, rather than written\n * in a `[data-theme='dark'] .v-avatar` rule: a descendant selector matches ANY dark ancestor,\n * so a light subtree nested in a dark page kept the dark discs. An inherited value is\n * resolved by the NEAREST scope, which is exactly how the semantic tokens behave.\n */\n :root,\n [data-theme='light'] {\n --avatar-auto-bg-lc: 0.9 0.06;\n --avatar-auto-text-lc: 0.42 0.13;\n }\n\n [data-theme='dark'] {\n --avatar-auto-bg-lc: 0.42 0.09;\n --avatar-auto-text-lc: 0.92 0.05;\n }\n\n .v-avatar[data-auto] {\n --avatar-bg: oklch(var(--avatar-auto-bg-lc) var(--avatar-hue));\n --avatar-text: oklch(var(--avatar-auto-text-lc) var(--avatar-hue));\n }\n\n /* Custom colour (--custom-color inline): wins, with a fixed white text (contrast\n is the consumer's responsibility). */\n .v-avatar[data-custom] {\n --avatar-bg: var(--custom-color);\n --avatar-text: var(--vectis-color-text-on-accent);\n }\n\n .v-avatar-image {\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n .v-avatar-icon {\n --vectis-icon-size: calc(var(--control-height) * 0.55);\n }\n\n :is(a, button).v-avatar {\n cursor: pointer;\n }\n\n :is(a, button).v-avatar:hover:not([aria-disabled='true'], :disabled) {\n background: color-mix(in oklab, var(--avatar-bg), var(--vectis-color-text) 10%);\n }\n\n :is(a, button).v-avatar:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-avatar:is(:disabled, [aria-disabled='true']) {\n cursor: not-allowed;\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-avatar {\n transition: none;\n }\n }\n\n /* The outline gives each disc its circle back; the focus ring, at (0,2,0), still wins over it. */\n @media (forced-colors: active) {\n .v-avatar {\n outline: var(--vectis-control-border-width) solid CanvasText;\n outline-offset: calc(-1 * var(--vectis-control-border-width));\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEA,IAAM,IAAQ,GAoBR,IAAQ,EAAS,GACjB,IAAQ,EAAO,GAAgB,IAAI,GAInC,IAAe,QAA2B,EAAM,QAAQ,GAAO,QAAA,IAA2B,GAC1F,IAAkB,QAAe,EAAM,WAAW,EAAQ,GAAO,OAAQ,GAIzE,EACJ,WACA,gBACA,aACA,OAAO,MACL,EAAa;GACf,YAAY,EAAM;GAClB,aAAa,EAAM;GACnB,aAAa,OAAO,YAAY,OAAO,QAAQ,CAAK,CAAC,CAAC,QAAQ,CAAC,OAAS,MAAQ,OAAO,CAAC;EAC1F,CAAC,GAEK,IAAgB,QAAe,EAAO,SAAS,EAAM,SAAS,GAC9D,IAAM,QAAgB,EAAO,QAAQ,MAAM,EAAM,YAAY,WAAW,MAAO,GAI/E,IAAS,EAAI,EAAK;EACxB,QACQ,EAAM,WACN;GACJ,EAAO,QAAQ;EACjB,CACF;EACA,IAAM,IAAY,QAAe,EAAQ,EAAM,OAAQ,CAAC,EAAO,KAAK,GAO9D,IAAU,EAAiC,OAAO;EACxD,QAAgB;GACd,IAAM,IAAM,EAAQ;GACpB,AAAI,GAAK,YAAY,EAAI,iBAAiB,MAAG,EAAO,QAAQ;EAC9D,CAAC;EAQD,IAAM,IAAY,QAAoB,EAAU,QAAQ,KAAA,IAAa,EAAM,OAAO,EAAM,IAAM,GACxF,IAAQ,QAAe,EAAU,UAAU,KAAA,KAAa,EAAM,sBAAsB,IAAI,GAGxF,IAAW,QACV,EAAM,OAIJ,EAAM,KACV,MAAM,KAAK,CAAA,CACX,OAAO,OAAO,CAAA,CACd,MAAM,GAAG,CAAC,CAAA,CACV,KAAK,MAAS,CAAC,GAAG,CAAI,CAAC,CAAC,EAAE,EAAE,YAAY,KAAK,EAAE,CAAA,CAC/C,KAAK,EAAE,IATc,EAUzB,GAQK,IAAM,QAAe;GACzB,IAAI,CAAC,EAAM,MAAM,OAAO;GACxB,IAAI,IAAO;GACX,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,KAAK,QAAQ,KACrC,IAAQ,IAAO,KAAK,EAAM,KAAK,WAAW,CAAC,IAAK;GAElD,OAAO,KAAK,IAAI,CAAI,IAAI;EAC1B,CAAC,GACK,IAAS,QAAe,EAAM,UAAU,KAAA,KAAa,EAAI,UAAU,IAAI,GAKvE,IAAO,QACX,CAAC,EAAc,SAAS,CAAC,EAAU,SAAS,EAAM,QAC9C,QACC,EAAY,MAAM,IACzB;EAKA,IAAI,GAAO;GACT,IAAM,IAAQ,EAAS;GACvB,QAAgB;IACd,AAAI,EAAc,SAAS,CAAC,EAAM,SAAS,CAAC,EAAM,OAAO,CAAC,EAAM,QAAQ,CAAC,EAAM,WAC7E,QAAQ,KACN,qGACF;GAEJ,CAAC;EACH;EAEA,IAAM,IAAY,QAA2B,CAC3C,EAAiB,EAAM,KAAK,MACzB,EAAO,QAAQ,EAAE,gBAAgB,OAAO,EAAI,KAAK,EAAE,IAAI,KAAA,IAC1D,EAAM,KACR,CAAC;yBAIC,EA4BY,EA3BL,EAAA,KAAG,GADV,EA4BY,EA1BT,iBAAe,EAAA,CAAA,IAAW,SAAY,KAAA,EAAA,GAC/B,EAAA,CAAA,GAAW;GACnB,OAAM;GACL,OAAO,EAAA;GACP,aAAW,EAAA;GACX,gBAAc,EAAA,QAAe,KAAQ,KAAA;GACrC,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,aAAW,EAAA,QAAM,KAAQ,KAAA;GACzB,MAAM,EAAA,CAAA;GACN,MAAM,EAAA,UAAG,WAAA,WAA2B,KAAA;GACpC,UAAU,EAAA,UAAG,WAAgB,EAAA,WAAW,KAAA;GACxC,MAAM,EAAA;GACN,cAAY,EAAA,CAAA;;oBASX,CANM,EAAA,SAAA,EAAA,GADR,EAOE,OAAA;;IALA,KAAI;IACJ,OAAM;IACL,KAAK,EAAA;IACL,KAAK,EAAA,OAAO,EAAA,QAAI;IAChB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAM;sBAEE,EAAA,QAAA,EAAA,GAAlB,EAAyE,GAAzE,EAAyE,EAAA,KAAA,EAAA,GAAzC,EAAA,CAAA,CAAS,CAAC,EAAA,IAAI,GAAA,EAAG,OAAM,gBAAe,CAAA,GAAA,MAAA,EAAA,KACtE,EAEO,EAAA,QAAA,WAAA,CAAA,SAAA,CADL,EAAwE,QAAxE,GAAwE,EAAlB,EAAA,KAAQ,GAAA,CAAA,CAAA,GAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VAvatar.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_withCtx","_createElementBlock","VIcon","_renderSlot","_createElementVNode","_toDisplayString","VIcon_default","_hoisted_1","_hoisted_2","VAvatar_vue_vue_type_script_setup_true_lang_default","props","__props","attrs","useAttrs","group","inject","avatarGroupKey","resolvedSize","computed","passedAttrs","useInertLink","key","isInteractive","isLink","tag","failed","ref","showImage","imageEl","useTemplateRef","img","ariaLabel","useAriaLabel","named","initials","part","hue","hash","i","isAuto","role","isDev","slots","useSlots","rootStyle","customColorStyle","openBlock","createBlock","resolveDynamicComponent","mergeProps","unref","isInertLink","linkHref","withCtx","createElementBlock","_cache","iconProps","renderSlot","_ctx","createElementVNode","toDisplayString"],"sources":["../../../src/components/VAvatar/VAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Resolve image, icon and initials in priority order. JavaScript handles failed images, inert\n * links and merging private colour variables with consumer styles.\n */\n\nimport { computed, inject, onMounted, ref, useAttrs, useSlots, useTemplateRef, watch } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport type { IconSource } from '../VIcon/types'\nimport { AVATAR_DEFAULT_SIZE, avatarGroupKey } from './context'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useInertLink } from '../../composables/useInertLink'\nimport { customColorStyle } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** The diameter of the disc, from the control size scale. */\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\ninterface AvatarProps {\n /**\n * The picture to show. It is what the avatar prefers above everything else, and an image\n * that fails to load hands over to the icon or the initials rather than leaving a gap.\n */\n src?: string\n /**\n * The icon to show when there is no picture. It comes before the initials, so an avatar\n * given both an icon and a name shows the icon.\n */\n icon?: IconSource\n /** The person's full name. */\n name?: string\n /**\n * The accessible name, when it should not simply be `name`: an avatar standing for a team\n * rather than a person, say. It wins over `name`, and a consumer `aria-label` wins over it.\n */\n alt?: string\n /**\n * A colour of your own, as a hex value, a CSS colour name or an `oklch()`. It REPLACES the\n * hue otherwise derived from `name`, and the text on it is always white, so a light colour\n * is the consumer's own risk.\n */\n color?: string\n /**\n * The diameter of the disc, from the size scale shared by every control. Leaving it out\n * inside a VAvatarGroup takes the group's size, which is the point of not defaulting it\n * here; on its own it is `md`.\n */\n size?: AvatarSize\n /**\n * Turns the avatar into an `<a>` pointing at this address. A disabled link becomes inert:\n * the address is dropped, so it can be neither focused nor followed.\n */\n href?: string\n /**\n * Turns the avatar into a `<button>`. It is ignored as soon as `href` makes it a link.\n * A VTooltip wrapping the avatar reaches this button through fallthrough.\n */\n clickable?: boolean\n /**\n * Makes an interactive avatar unusable: it stops responding, leaves the tab order and greys\n * out. It says nothing on a plain avatar, which was never interactive to begin with.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n src: undefined,\n icon: undefined,\n name: undefined,\n alt: undefined,\n color: undefined,\n size: undefined,\n href: undefined,\n clickable: false,\n disabled: false,\n})\n\ndefineSlots<{\n /** Fallback content (replaces the initials), e.g. VAvatarGroup's \"+X\". */\n default?(): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst group = inject(avatarGroupKey, null)\n\n// The size is the avatar's own answer first, then the group's (context.ts).\nconst resolvedSize = computed<AvatarSize>(() => props.size ?? group?.size ?? AVATAR_DEFAULT_SIZE)\n\n// Fallthrough without `style`, which rootStyle merges with the component's own; the click\n// handler is also dropped on an inert link.\nconst {\n isLink,\n isInertLink,\n linkHref,\n attrs: passedAttrs,\n} = useInertLink({\n href: () => props.href,\n inert: () => props.disabled,\n attrs: () => Object.fromEntries(Object.entries(attrs).filter(([key]) => key !== 'style')),\n})\n\nconst isInteractive = computed(() => isLink.value || props.clickable)\nconst tag = computed(() => (isLink.value ? 'a' : props.clickable ? 'button' : 'span'))\n\n// @core\n// The image failed to load: the initials take over, so an avatar is never an empty box.\nconst failed = ref(false)\nwatch(\n () => props.src,\n () => {\n failed.value = false\n },\n)\nconst showImage = computed(() => Boolean(props.src) && !failed.value)\n\n/*\n * On a server-rendered page the browser may give up on the picture before hydration attaches\n * `@error`, and that event is never sent again: the disc would stay an empty circle. A picture\n * already settled with no pixels at mount is one that failed.\n */\nconst imageEl = useTemplateRef<HTMLImageElement>('image')\nonMounted(() => {\n const img = imageEl.value\n if (img?.complete && img.naturalWidth === 0) failed.value = true\n})\n\n// @a11y\n/*\n * The name bound on the root: a consumer `aria-labelledby` removes it, a consumer `aria-label`\n * replaces it, and otherwise it is `alt`, then `name`. A picture on show carries that name as\n * its own `alt`, so the root then names itself only with what the consumer wrote.\n */\nconst ariaLabel = useAriaLabel(() => (showImage.value ? undefined : (props.alt ?? props.name)))\nconst named = computed(() => ariaLabel.value !== undefined || attrs['aria-labelledby'] != null)\n\n// @core\nconst initials = computed(() => {\n if (!props.name) return ''\n /* Whole characters, not UTF-16 halves: `part[0]` of \"😀\" is a lone surrogate, drawn as a\n replacement box. And `toUpperCase` rather than its locale-aware sibling, whose answer\n depends on the runtime's locale, which the server and the browser need not share. */\n return props.name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => [...part][0]?.toUpperCase() ?? '')\n .join('')\n})\n\n// @core\n/*\n * Only the hue is inline (a unitless scalar); the CSS composes background/text with L/C fixed\n * per theme (light/dark adaptation without depending on contrast-color). A colour computed\n * outside the tokens, a deliberate exception.\n */\nconst hue = computed(() => {\n if (!props.name) return null\n let hash = 0\n for (let i = 0; i < props.name.length; i++) {\n hash = (hash * 31 + props.name.charCodeAt(i)) | 0\n }\n return Math.abs(hash) % 360\n})\nconst isAuto = computed(() => props.color === undefined && hue.value !== null)\n\n// @a11y\n// A static avatar with no picture is an image named by `alt`/ `name`. Anything else keeps the\n// role that arrived in the attributes; `link` on an inert link, a consumer's own otherwise.\nconst role = computed(() =>\n !isInteractive.value && !showImage.value && named.value\n ? 'img'\n : (passedAttrs.value.role as string | undefined),\n)\n\n// @devwarn\n// A button or a link named by nothing: no `name`, no `alt`, no `aria-*` and no slot text. A\n// picture alone does not count, its `alt` coming from the same two props.\nif (isDev) {\n const slots = useSlots()\n onMounted(() => {\n if (isInteractive.value && !named.value && !props.alt && !props.name && !slots.default) {\n console.warn(\n '[VAvatar] a clickable or linked avatar needs an accessible name: set `name`, `alt` or `aria-label`.',\n )\n }\n })\n}\n\nconst rootStyle = computed<StyleValue>(() => [\n customColorStyle(props.color) ??\n (isAuto.value ? { '--avatar-hue': String(hue.value) } : undefined),\n attrs.style as StyleValue,\n])\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :aria-disabled=\"isInertLink ? 'true' : undefined\"\n v-bind=\"passedAttrs\"\n class=\"v-avatar v-control\"\n :style=\"rootStyle\"\n :data-size=\"resolvedSize\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-auto=\"isAuto ? '' : undefined\"\n :href=\"linkHref\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n :disabled=\"tag === 'button' ? disabled : undefined\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n >\n <img\n v-if=\"showImage\"\n ref=\"image\"\n class=\"v-avatar-image\"\n :src=\"src\"\n :alt=\"alt ?? name ?? ''\"\n @error=\"failed = true\"\n />\n <VIcon v-else-if=\"icon\" v-bind=\"iconProps(icon)\" class=\"v-avatar-icon\" />\n <slot v-else>\n <span class=\"v-avatar-initials\" aria-hidden=\"true\">{{ initials }}</span>\n </slot>\n </component>\n</template>\n\n<style>\n@layer vectis.components {\n .v-avatar {\n --avatar-bg: var(--vectis-color-surface-muted);\n --avatar-text: var(--vectis-color-text-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--control-height);\n block-size: var(--control-height);\n flex: none;\n overflow: hidden;\n padding: 0;\n border: none;\n background: var(--avatar-bg);\n color: var(--avatar-text);\n border-radius: var(--vectis-radius-pill);\n font-family: var(--vectis-text-family);\n font-size: var(--control-font-size);\n font-weight: var(--vectis-font-weight-semibold);\n line-height: var(--vectis-text-control-leading);\n text-decoration: none;\n user-select: none;\n /*\n * The `transparent` fallback is what lets a lone avatar render ringless, and it is also\n * what makes a divergence silent: rename it on one side and the discs in a group simply\n * stop being separated, with no error and nothing missing from the box.\n */\n box-shadow: 0 0 0 var(--vectis-control-size-avatar-ring) var(--avatar-ring-color, transparent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n box-shadow var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /*\n * The lightness/chroma pairs are set on the THEME scopes and inherited, rather than written\n * in a `[data-theme='dark'] .v-avatar` rule: a descendant selector matches ANY dark ancestor,\n * so a light subtree nested in a dark page kept the dark discs. An inherited value is\n * resolved by the NEAREST scope, which is exactly how the semantic tokens behave.\n */\n :root,\n [data-theme='light'] {\n --avatar-auto-bg-lc: 0.9 0.06;\n --avatar-auto-text-lc: 0.42 0.13;\n }\n\n [data-theme='dark'] {\n --avatar-auto-bg-lc: 0.42 0.09;\n --avatar-auto-text-lc: 0.92 0.05;\n }\n\n .v-avatar[data-auto] {\n --avatar-bg: oklch(var(--avatar-auto-bg-lc) var(--avatar-hue));\n --avatar-text: oklch(var(--avatar-auto-text-lc) var(--avatar-hue));\n }\n\n /* Custom colour (--custom-color inline): wins, with a fixed white text (contrast\n is the consumer's responsibility). */\n .v-avatar[data-custom] {\n --avatar-bg: var(--custom-color);\n --avatar-text: var(--vectis-color-text-on-accent);\n }\n\n .v-avatar-image {\n inline-size: 100%;\n block-size: 100%;\n object-fit: cover;\n }\n\n .v-avatar-icon {\n --vectis-icon-size: calc(var(--control-height) * 0.55);\n }\n\n :is(a, button).v-avatar {\n cursor: pointer;\n }\n\n :is(a, button).v-avatar:hover:not([aria-disabled='true'], :disabled) {\n background: color-mix(in oklab, var(--avatar-bg), var(--vectis-color-text) 10%);\n }\n\n :is(a, button).v-avatar:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-avatar:is(:disabled, [aria-disabled='true']) {\n cursor: not-allowed;\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-avatar {\n transition: none;\n }\n }\n\n /* The outline gives each disc its circle back; the focus ring, at (0,2,0), still wins over it. */\n @media (forced-colors: active) {\n .v-avatar {\n outline: var(--vectis-control-border-width) solid CanvasText;\n outline-offset: calc(-1 * var(--vectis-control-border-width));\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEA,IAAMe,IAAQC,GAmBRC,IAAQC,EAAS,GACjBC,IAAQC,EAAOC,GAAgB,IAAI,GAGnCC,IAAeC,QAA2BR,EAAM,QAAQI,GAAO,QAAA,IAA2B,GAI1F,EACJ,WACA,gBACA,aACA,OAAOK,MACLC,EAAa;GACf,YAAYV,EAAM;GAClB,aAAaA,EAAM;GACnB,aAAa,OAAO,YAAY,OAAO,QAAQE,CAAK,CAAC,CAAC,QAAQ,CAACS,OAASA,MAAQ,OAAO,CAAC;EAC1F,CAAC,GAEKC,IAAgBJ,QAAeK,EAAO,SAASb,EAAM,SAAS,GAC9Dc,IAAMN,QAAgBK,EAAO,QAAQ,MAAMb,EAAM,YAAY,WAAW,MAAO,GAI/Ee,IAASC,EAAI,EAAK;EACxB,QACQhB,EAAM,WACN;GACJ,EAAO,QAAQ;EACjB,CACF;EACA,IAAMiB,IAAYT,QAAe,EAAQR,EAAM,OAAQ,CAACe,EAAO,KAAK,GAO9DG,IAAUC,EAAiC,OAAO;EACxD,QAAgB;GACd,IAAMC,IAAMF,EAAQ;GACpB,AAAIE,GAAK,YAAYA,EAAI,iBAAiB,MAAG,EAAO,QAAQ;EAC9D,CAAC;EAQD,IAAMC,IAAYC,QAAoBL,EAAU,QAAQ,KAAA,IAAajB,EAAM,OAAOA,EAAM,IAAM,GACxFuB,IAAQf,QAAea,EAAU,UAAU,KAAA,KAAanB,EAAM,sBAAsB,IAAI,GAGxFsB,IAAWhB,QACVR,EAAM,OAIJA,EAAM,KACV,MAAM,KAAK,CAAA,CACX,OAAO,OAAO,CAAA,CACd,MAAM,GAAG,CAAC,CAAA,CACV,KAAK,MAAS,CAAC,GAAGyB,CAAI,CAAC,CAAC,EAAE,EAAE,YAAY,KAAK,EAAE,CAAA,CAC/C,KAAK,EAAE,IATc,EAUzB,GAQKC,IAAMlB,QAAe;GACzB,IAAI,CAACR,EAAM,MAAM,OAAO;GACxB,IAAI2B,IAAO;GACX,KAAK,IAAIC,IAAI,GAAGA,IAAI5B,EAAM,KAAK,QAAQ,KACrC,IAAQ2B,IAAO,KAAK3B,EAAM,KAAK,WAAW4B,CAAC,IAAK;GAElD,OAAO,KAAK,IAAID,CAAI,IAAI;EAC1B,CAAC,GACKE,IAASrB,QAAeR,EAAM,UAAU,KAAA,KAAa0B,EAAI,UAAU,IAAI,GAKvEI,IAAOtB,QACX,CAACI,EAAc,SAAS,CAACK,EAAU,SAASM,EAAM,QAC9C,QACCd,EAAY,MAAM,IACzB;EAKA,IAAIsB,GAAO;GACT,IAAMC,IAAQC,EAAS;GACvB,QAAgB;IACd,AAAIrB,EAAc,SAAS,CAACW,EAAM,SAAS,CAACvB,EAAM,OAAO,CAACA,EAAM,QAAQ,CAACgC,EAAM,WAC7E,QAAQ,KACN,qGACF;GAEJ,CAAC;EACH;EAEA,IAAME,IAAY1B,QAA2B,CAC3C2B,EAAiBnC,EAAM,KAAK,MACzB6B,EAAO,QAAQ,EAAE,gBAAgB,OAAOH,EAAI,KAAK,EAAE,IAAI,KAAA,IAC1DxB,EAAM,KACR,CAAC;oBAICjB,EAAA,GAAAC,EA2BYC,EA1BL2B,EAAA,KAAG,GADV1B,EA2BY,EAzBT,iBAAeC,EAAAoD,CAAA,IAAW,SAAY,KAAA,EAC/B,GAAApD,EAAAoB,CAAA,GAAW;GACnB,OAAM;GACL,OAAOyB,EAAA;GACP,aAAW3B,EAAA;GACX,eAAaN,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,aAAW4B,EAAA,QAAM,KAAQ,KAAA;GACzB,MAAMxC,EAAAqD,CAAA;GACN,MAAM5B,EAAA,UAAG,WAAA,WAA2B,KAAA;GACpC,UAAUA,EAAA,UAAG,WAAgBb,EAAA,WAAW,KAAA;GACxC,MAAM6B,EAAA;GACN,cAAYzC,EAAAgC,CAAA;;GAEb,SAAA/B,QAOE,CANM2B,EAAA,SADRhC,EAAA,GAAAM,EAOE,OAAA;;IALA,KAAI;IACJ,OAAM;IACL,KAAKU,EAAA;IACL,KAAKA,EAAA,OAAOA,EAAA,QAAI;IAChB,SAAK,AAAA4C,EAAA,QAAA,MAAE,EAAA,QAAM;GAEE,GAAA,MAAA,IAAAhD,CAAA,KAAAI,EAAA,QAAlBhB,EAAA,GAAAC,EAAyEM,GAAzEJ,EAAyE,EAAA,KAAA,EAAA,GAAzCC,EAAAyD,CAAA,CAAS,CAAC7C,EAAA,IAAI,GAAA,EAAG,OAAM,gBAAe,CAAA,GAAA,MAAA,EAAA,KACtER,EAEOuD,EAAA,QAAA,WAAA,CAAA,SAAA,CADLtD,EAAwE,QAAxEI,GAAwEH,EAAlB6B,EAAA,KAAQ,GAAA,CAAA,CAAA,GAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}