vectis-ui 0.1.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/README.md +40 -6
  2. package/dist/components/VAccordion/VAccordion.css +1 -1
  3. package/dist/components/VAccordion/VAccordion.d.ts +9 -16
  4. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  6. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
  9. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  10. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
  11. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VAccordion/context.d.ts +1 -8
  13. package/dist/components/VAccordion/context.js.map +1 -1
  14. package/dist/components/VAvatar/VAvatar.css +1 -1
  15. package/dist/components/VAvatar/VAvatar.d.ts +44 -29
  16. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
  18. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
  20. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  21. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
  22. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/VAvatar/context.d.ts +6 -10
  24. package/dist/components/VAvatar/context.js.map +1 -1
  25. package/dist/components/VBadge/VBadge.css +1 -1
  26. package/dist/components/VBadge/VBadge.d.ts +31 -10
  27. package/dist/components/VBadge/VBadge.js.map +1 -1
  28. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
  29. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
  31. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
  32. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  33. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
  34. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VButton/VButton.css +1 -1
  36. package/dist/components/VButton/VButton.d.ts +30 -10
  37. package/dist/components/VButton/VButton.js.map +1 -1
  38. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
  39. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VButton/VButtonGroup.css +1 -1
  41. package/dist/components/VButton/VButtonGroup.d.ts +76 -13
  42. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  43. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
  44. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/VButton/context.d.ts +30 -0
  46. package/dist/components/VButton/context.js +6 -0
  47. package/dist/components/VButton/context.js.map +1 -0
  48. package/dist/components/VCalendar/VCalendar.css +1 -1
  49. package/dist/components/VCalendar/VCalendar.d.ts +50 -36
  50. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  51. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
  52. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  54. package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
  55. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  56. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
  57. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  59. package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
  60. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  61. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
  62. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  64. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
  65. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  66. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
  67. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  69. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  70. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
  71. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/VCalendar/gesture.d.ts +158 -0
  73. package/dist/components/VCalendar/gesture.js +170 -0
  74. package/dist/components/VCalendar/gesture.js.map +1 -0
  75. package/dist/components/VCalendar/keyboard.d.ts +9 -3
  76. package/dist/components/VCalendar/keyboard.js +2 -6
  77. package/dist/components/VCalendar/keyboard.js.map +1 -1
  78. package/dist/components/VCalendar/layout.d.ts +67 -54
  79. package/dist/components/VCalendar/layout.js +77 -69
  80. package/dist/components/VCalendar/layout.js.map +1 -1
  81. package/dist/components/VCalendar/timeGrid.d.ts +55 -0
  82. package/dist/components/VCalendar/timeGrid.js +71 -0
  83. package/dist/components/VCalendar/timeGrid.js.map +1 -0
  84. package/dist/components/VCalendar/types.d.ts +41 -16
  85. package/dist/components/VCarousel/VCarousel.css +1 -1
  86. package/dist/components/VCarousel/VCarousel.d.ts +21 -41
  87. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  88. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
  89. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
  91. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  92. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/VCarousel/context.d.ts +0 -12
  94. package/dist/components/VCarousel/context.js.map +1 -1
  95. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  96. package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
  97. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  98. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
  99. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VChip/VChip.css +1 -1
  101. package/dist/components/VChip/VChip.d.ts +36 -26
  102. package/dist/components/VChip/VChip.js.map +1 -1
  103. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
  104. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VCombobox/VCombobox.css +1 -1
  106. package/dist/components/VCombobox/VCombobox.d.ts +127 -31
  107. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  108. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
  109. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  111. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
  112. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  113. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  114. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/VCombobox/VComboboxOption.css +1 -1
  116. package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
  117. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  118. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
  119. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  121. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  123. package/dist/components/VDataTable/VDataTable.css +1 -1
  124. package/dist/components/VDataTable/VDataTable.d.ts +50 -28
  125. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  126. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
  127. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/VDateInput/VDateInput.css +1 -1
  129. package/dist/components/VDateInput/VDateInput.d.ts +90 -42
  130. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  131. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
  132. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  134. package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
  135. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  136. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
  137. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/VDialog/VDialog.css +1 -1
  139. package/dist/components/VDialog/VDialog.d.ts +45 -33
  140. package/dist/components/VDialog/VDialog.js.map +1 -1
  141. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
  142. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
  144. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  145. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
  146. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/VFileInput/VFileInput.css +1 -1
  148. package/dist/components/VFileInput/VFileInput.d.ts +78 -26
  149. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  150. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
  151. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  153. package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
  154. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  155. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
  156. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/VFilePicker/fileKind.d.ts +2 -27
  158. package/dist/components/VFilePicker/fileKind.js +9 -8
  159. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  160. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  161. package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
  162. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  163. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
  164. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/VHotkeys/platform.js.map +1 -1
  166. package/dist/components/VIcon/VIcon.css +1 -1
  167. package/dist/components/VIcon/VIcon.d.ts +15 -6
  168. package/dist/components/VIcon/VIcon.js.map +1 -1
  169. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
  170. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/VIcon/iconProps.js.map +1 -1
  172. package/dist/components/VIcon/icons/index.d.ts +1 -1
  173. package/dist/components/VIcon/icons/index.js.map +1 -1
  174. package/dist/components/VIcon/icons/names.d.ts +1 -1
  175. package/dist/components/VIcon/icons/names.js.map +1 -1
  176. package/dist/components/VIcon/resolver.d.ts +3 -3
  177. package/dist/components/VIcon/resolver.js.map +1 -1
  178. package/dist/components/VIcon/types.d.ts +12 -12
  179. package/dist/components/VIconButton/VIconButton.css +1 -1
  180. package/dist/components/VIconButton/VIconButton.d.ts +28 -11
  181. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  182. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
  183. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/VInput/VInput.css +1 -1
  185. package/dist/components/VInput/VInput.d.ts +26 -7
  186. package/dist/components/VInput/VInput.js.map +1 -1
  187. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
  188. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/VInput/VInputGroup.css +2 -0
  190. package/dist/components/VInput/VInputGroup.d.ts +47 -0
  191. package/dist/components/VInput/VInputGroup.js +9 -0
  192. package/dist/components/VInput/VInputGroup.js.map +1 -0
  193. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
  194. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  195. package/dist/components/VInput/context.d.ts +11 -0
  196. package/dist/components/VInput/context.js +6 -0
  197. package/dist/components/VInput/context.js.map +1 -0
  198. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  199. package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
  200. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  201. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
  202. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VMenu/VMenu.d.ts +23 -30
  204. package/dist/components/VMenu/VMenu.js.map +1 -1
  205. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
  206. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/VMenu/VMenuGroup.css +1 -1
  208. package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
  209. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  210. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
  211. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VMenu/VMenuItem.css +1 -1
  213. package/dist/components/VMenu/VMenuItem.d.ts +11 -19
  214. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  215. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
  216. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
  218. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  219. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
  220. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/components/VMenu/context.d.ts +2 -6
  222. package/dist/components/VMenu/context.js.map +1 -1
  223. package/dist/components/VPagination/VPagination.css +1 -1
  224. package/dist/components/VPagination/VPagination.d.ts +60 -22
  225. package/dist/components/VPagination/VPagination.js.map +1 -1
  226. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
  227. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VPopover/VPopover.css +1 -1
  229. package/dist/components/VPopover/VPopover.d.ts +26 -7
  230. package/dist/components/VPopover/VPopover.js.map +1 -1
  231. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
  232. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  234. package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
  235. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  236. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
  237. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  239. package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
  240. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  241. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
  242. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/VRadio/VRadio.css +1 -1
  244. package/dist/components/VRadio/VRadio.d.ts +36 -18
  245. package/dist/components/VRadio/VRadio.js.map +1 -1
  246. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
  247. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/components/VSeparator/VSeparator.d.ts +4 -2
  249. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  250. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  251. package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
  252. package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
  253. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  254. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
  255. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  257. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
  258. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  259. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  260. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  261. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  262. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
  263. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  264. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
  265. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VSideNavigation/context.d.ts +0 -14
  267. package/dist/components/VSideNavigation/context.js.map +1 -1
  268. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  269. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
  270. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  271. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/components/VSlider/VSlider.css +1 -1
  273. package/dist/components/VSlider/VSlider.d.ts +52 -27
  274. package/dist/components/VSlider/VSlider.js.map +1 -1
  275. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
  276. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  277. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  278. package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
  279. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  280. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
  281. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/components/VSnackbar/state.d.ts +0 -27
  283. package/dist/components/VSnackbar/state.js.map +1 -1
  284. package/dist/components/VSpinner/VSpinner.css +1 -1
  285. package/dist/components/VSpinner/VSpinner.d.ts +6 -6
  286. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  287. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
  288. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VSwitch/VSwitch.css +1 -1
  290. package/dist/components/VSwitch/VSwitch.d.ts +35 -13
  291. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  292. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
  293. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/components/VTabs/VTab.css +1 -1
  295. package/dist/components/VTabs/VTab.d.ts +12 -12
  296. package/dist/components/VTabs/VTab.js.map +1 -1
  297. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
  298. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VTabs/VTabPanel.d.ts +2 -10
  300. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  301. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
  302. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VTabs/VTabs.css +1 -1
  304. package/dist/components/VTabs/VTabs.d.ts +27 -18
  305. package/dist/components/VTabs/VTabs.js.map +1 -1
  306. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
  307. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VTabs/context.d.ts +9 -19
  309. package/dist/components/VTabs/context.js +1 -1
  310. package/dist/components/VTabs/context.js.map +1 -1
  311. package/dist/components/VTextarea/VTextarea.css +1 -1
  312. package/dist/components/VTextarea/VTextarea.d.ts +34 -6
  313. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  314. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
  315. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  317. package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
  318. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  319. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
  320. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  321. package/dist/components/VTimeInput/search.d.ts +24 -0
  322. package/dist/components/VTimeInput/search.js +22 -0
  323. package/dist/components/VTimeInput/search.js.map +1 -0
  324. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  325. package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
  326. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  327. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
  328. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  329. package/dist/components/VTimePicker/limits.d.ts +88 -0
  330. package/dist/components/VTimePicker/limits.js +70 -0
  331. package/dist/components/VTimePicker/limits.js.map +1 -0
  332. package/dist/components/VToast/VToast.css +1 -1
  333. package/dist/components/VToast/VToast.d.ts +0 -10
  334. package/dist/components/VToast/VToast.js.map +1 -1
  335. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
  336. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/components/VToast/VToaster.css +1 -1
  338. package/dist/components/VToast/VToaster.d.ts +0 -17
  339. package/dist/components/VToast/VToaster.js.map +1 -1
  340. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
  341. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VToast/state.d.ts +10 -19
  343. package/dist/components/VToast/state.js +1 -1
  344. package/dist/components/VToast/state.js.map +1 -1
  345. package/dist/components/VToggle/VToggle.css +1 -1
  346. package/dist/components/VToggle/VToggle.d.ts +56 -11
  347. package/dist/components/VToggle/VToggle.js.map +1 -1
  348. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
  349. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VToggle/VToggleItem.d.ts +16 -2
  351. package/dist/components/VToggle/VToggleItem.js +0 -2
  352. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.d.ts +4 -24
  356. package/dist/components/VToggle/context.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.css +1 -1
  358. package/dist/components/VTooltip/VTooltip.d.ts +9 -33
  359. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  360. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
  361. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.js.map +1 -1
  363. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/dist/composables/useAriaLabel.d.ts +0 -17
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useClearable.d.ts +42 -0
  367. package/dist/composables/useClearable.js +19 -0
  368. package/dist/composables/useClearable.js.map +1 -0
  369. package/dist/composables/useControlShape.d.ts +22 -0
  370. package/dist/composables/useControlShape.js +13 -0
  371. package/dist/composables/useControlShape.js.map +1 -0
  372. package/dist/composables/useDetailsOpen.d.ts +22 -0
  373. package/dist/composables/useDetailsOpen.js +21 -0
  374. package/dist/composables/useDetailsOpen.js.map +1 -0
  375. package/dist/composables/useFieldIds.d.ts +0 -15
  376. package/dist/composables/useFieldIds.js +8 -7
  377. package/dist/composables/useFieldIds.js.map +1 -1
  378. package/dist/composables/useFieldPanel.d.ts +21 -18
  379. package/dist/composables/useFieldPanel.js +43 -23
  380. package/dist/composables/useFieldPanel.js.map +1 -1
  381. package/dist/composables/useFileDrop.d.ts +0 -22
  382. package/dist/composables/useFileDrop.js.map +1 -1
  383. package/dist/composables/useFileField.d.ts +45 -17
  384. package/dist/composables/useFileField.js +40 -20
  385. package/dist/composables/useFileField.js.map +1 -1
  386. package/dist/composables/useFocusoutDismiss.d.ts +0 -15
  387. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  388. package/dist/composables/useIconClickHandlers.d.ts +29 -14
  389. package/dist/composables/useIconClickHandlers.js +15 -5
  390. package/dist/composables/useIconClickHandlers.js.map +1 -1
  391. package/dist/composables/useInertLink.d.ts +20 -0
  392. package/dist/composables/useInertLink.js +23 -0
  393. package/dist/composables/useInertLink.js.map +1 -0
  394. package/dist/composables/useMaskedField.d.ts +33 -10
  395. package/dist/composables/useMaskedField.js +45 -1
  396. package/dist/composables/useMaskedField.js.map +1 -1
  397. package/dist/composables/usePopover.d.ts +15 -1
  398. package/dist/composables/usePopover.js +23 -8
  399. package/dist/composables/usePopover.js.map +1 -1
  400. package/dist/composables/useProgressValue.d.ts +5 -8
  401. package/dist/composables/useProgressValue.js +6 -3
  402. package/dist/composables/useProgressValue.js.map +1 -1
  403. package/dist/composables/useRootAttrs.d.ts +12 -19
  404. package/dist/composables/useRootAttrs.js.map +1 -1
  405. package/dist/composables/useTimer.d.ts +8 -10
  406. package/dist/composables/useTimer.js.map +1 -1
  407. package/dist/i18n/en.d.ts +2 -10
  408. package/dist/i18n/en.js +18 -19
  409. package/dist/i18n/en.js.map +1 -1
  410. package/dist/i18n/fr.d.ts +2 -18
  411. package/dist/i18n/fr.js +18 -19
  412. package/dist/i18n/fr.js.map +1 -1
  413. package/dist/i18n/state.d.ts +44 -47
  414. package/dist/i18n/state.js +20 -17
  415. package/dist/i18n/state.js.map +1 -1
  416. package/dist/i18n/types.d.ts +53 -44
  417. package/dist/icons.d.ts +3 -3
  418. package/dist/index.d.ts +43 -17
  419. package/dist/index.js +45 -44
  420. package/dist/styles.css +1 -1
  421. package/dist/tokens/css.js.map +1 -1
  422. package/dist/tokens/index.d.ts +5 -1
  423. package/dist/tokens/primitives.js.map +1 -1
  424. package/dist/tokens/semantic.d.ts +5 -1
  425. package/dist/tokens/semantic.js +6 -2
  426. package/dist/tokens/semantic.js.map +1 -1
  427. package/dist/tokens/themes/dark.js.map +1 -1
  428. package/dist/tokens/types.d.ts +7 -15
  429. package/dist/tokens/types.js.map +1 -1
  430. package/dist/tokens.json +25 -5
  431. package/dist/types.d.ts +24 -0
  432. package/dist/utils/array.d.ts +3 -6
  433. package/dist/utils/array.js.map +1 -1
  434. package/dist/utils/arrowNav.d.ts +17 -17
  435. package/dist/utils/arrowNav.js +5 -3
  436. package/dist/utils/arrowNav.js.map +1 -1
  437. package/dist/utils/chip.d.ts +11 -15
  438. package/dist/utils/chip.js.map +1 -1
  439. package/dist/utils/css.d.ts +22 -11
  440. package/dist/utils/css.js +5 -2
  441. package/dist/utils/css.js.map +1 -1
  442. package/dist/utils/date.d.ts +42 -19
  443. package/dist/utils/date.js +97 -98
  444. package/dist/utils/date.js.map +1 -1
  445. package/dist/utils/direction.d.ts +6 -12
  446. package/dist/utils/direction.js.map +1 -1
  447. package/dist/utils/env.d.ts +5 -6
  448. package/dist/utils/file.d.ts +46 -58
  449. package/dist/utils/file.js +43 -36
  450. package/dist/utils/file.js.map +1 -1
  451. package/dist/utils/focus.d.ts +8 -17
  452. package/dist/utils/focus.js.map +1 -1
  453. package/dist/utils/hostWarns.d.ts +12 -0
  454. package/dist/utils/hostWarns.js +6 -0
  455. package/dist/utils/hostWarns.js.map +1 -0
  456. package/dist/utils/ids.d.ts +10 -0
  457. package/dist/utils/ids.js +8 -0
  458. package/dist/utils/ids.js.map +1 -0
  459. package/dist/utils/matcher.d.ts +5 -9
  460. package/dist/utils/matcher.js.map +1 -1
  461. package/dist/utils/memo.d.ts +12 -0
  462. package/dist/utils/memo.js +9 -0
  463. package/dist/utils/memo.js.map +1 -0
  464. package/dist/utils/number.d.ts +3 -4
  465. package/dist/utils/number.js.map +1 -1
  466. package/dist/utils/text.d.ts +20 -9
  467. package/dist/utils/text.js +17 -3
  468. package/dist/utils/text.js.map +1 -1
  469. package/dist/utils/time.d.ts +53 -61
  470. package/dist/utils/time.js +49 -45
  471. package/dist/utils/time.js.map +1 -1
  472. package/dist/utils/vnode.d.ts +8 -15
  473. package/dist/utils/vnode.js.map +1 -1
  474. package/package.json +6 -6
  475. package/dist/components/VToggle/VToggleItem.css +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":[],"sources":["../../../src/components/VHotkeys/platform.ts"],"sourcesContent":["import { isDev } from '../../utils/env'\n\n// @core — module-wide: pure, no Vue and no lifecycle. `detectPlatform` is the\n// exception below.\n/**\n * Everything VHotkeys needs to know about keyboards: which system this one belongs to,\n * and how a written token relates to the symbol engraved on the key, to the word for\n * it, and to what the browser reports when it is pressed.\n *\n * An operating system is not a language, and the distinction matters here. Whether a\n * key shows ⌘ or Ctrl is a fact about the hardware, so it does NOT depend on the\n * reader's language. Only the WORDS do — Shift becomes Maj in French — and those live\n * in the dictionary: this module hands back the dictionary KEY and never the text\n * itself.\n *\n * What earns the module its existence is the alias table. The SAME table normalizes\n * the tokens a consumer writes in `keys` and the key names the browser reports, so a\n * shortcut cannot be declared in a spelling the matcher would fail to recognize.\n *\n * TRAP — detecting the platform must only ever be done once a component is mounted.\n * There is nothing to read it from on a server, and sniffing a request header is not\n * this library's business.\n */\nexport type HotkeysPlatform = 'mac' | 'windows' | 'linux' | 'other'\n\n/**\n * The dictionary entries naming a key, and only those — the sentence framing the\n * shortcut is not one of them.\n *\n * The list is written out here rather than derived from the dictionary's own type,\n * which would tie this module to the dictionary's shape. Nothing is lost: reading an\n * entry by one of these names is checked just as strictly at the point of use.\n */\nexport type HotkeysWord =\n | 'command'\n | 'ctrl'\n | 'alt'\n | 'shift'\n | 'windows'\n | 'super'\n | 'enter'\n | 'escape'\n | 'space'\n | 'backspace'\n | 'delete'\n | 'tab'\n | 'up'\n | 'down'\n | 'left'\n | 'right'\n\n/** One key of a shortcut, once resolved for a given platform. */\nexport interface ResolvedKey {\n /** Its canonical name, which is what the matcher compares a key press against. */\n token: string\n /** The symbol engraved on that key, where the system engraves one. */\n glyph?: string\n /**\n * Which dictionary entry names it. Nothing here means the design system does not\n * know this key, and it is printed as it was written.\n */\n word?: HotkeysWord\n}\n\n// @ssr\n/**\n * What a SERVER renders, and therefore what the browser's FIRST render must be as\n * well. It shares its words with Windows and Linux — Ctrl, Alt, Shift — so only a Mac\n * visitor pays a single frame of \"Ctrl\" before it is corrected to ⌘.\n */\nexport const DEFAULT_PLATFORM: HotkeysPlatform = 'other'\n\n// @ssr @fallback — the DS's ONLY `navigator` read, with a two-source ladder.\n/**\n * Works out which system the keyboard belongs to, from two sources in order. The\n * modern one is the more reliable; the older one is deprecated and frozen, but it is\n * still the only one Firefox and Safari provide.\n *\n * The modern one is missing from TypeScript's own definitions, so it is described by a\n * type declared LOCALLY rather than added to the global ones — the latter would leak\n * out into every consumer's compilation.\n */\nexport function detectPlatform(): HotkeysPlatform {\n if (typeof navigator === 'undefined') return DEFAULT_PLATFORM\n const nav = navigator as Navigator & { userAgentData?: { platform?: string } }\n const source = (nav.userAgentData?.platform || nav.platform || '').toLowerCase()\n /* iPadOS reports itself as a Mac, which is fine here: an attached keyboard carries\n the same modifier symbols either way. */\n if (/mac|iphone|ipad|ipod/.test(source)) return 'mac'\n if (source.includes('win')) return 'windows'\n /* ChromeOS spells itself two different ways depending on which of the two sources\n answered. Both have to be listed, or the branch is dead precisely where it\n matters. */\n if (/linux|android|cros|chrome os/.test(source)) return 'linux'\n return DEFAULT_PLATFORM\n}\n\n/* Every spelling accepted in the `keys` prop, and at the same time the table that\n normalizes what the browser reports. Serving both is what guarantees the two can\n never disagree.\n\n The `+` key is canonically named `plus`, since `+` is the separator and cannot name\n itself in the prop — but the browser does report it as `'+'`, hence its presence\n here. */\nconst ALIASES: Record<string, string> = {\n cmd: 'meta',\n command: 'meta',\n win: 'meta',\n windows: 'meta',\n super: 'meta',\n os: 'meta',\n cmdorctrl: 'mod',\n commandorcontrol: 'mod',\n control: 'ctrl',\n option: 'alt',\n opt: 'alt',\n return: 'enter',\n escape: 'esc',\n spacebar: 'space',\n ' ': 'space',\n del: 'delete',\n arrowup: 'up',\n arrowdown: 'down',\n arrowleft: 'left',\n arrowright: 'right',\n '+': 'plus',\n}\n\n/* The symbols engraved on an Apple keyboard, and on no other. Escape and the space bar\n are deliberately absent: the Mac key really does read \"esc\", and the space bar\n carries no symbol at all. */\nconst MAC_GLYPHS: Record<string, string> = {\n mod: '⌘',\n meta: '⌘',\n ctrl: '⌃',\n alt: '⌥',\n shift: '⇧',\n enter: '↵',\n backspace: '⌫',\n delete: '⌦',\n tab: '⇥',\n}\n\n/* Symbols that are the same everywhere: an arrow key is engraved with an arrow on\n every keyboard ever made. */\nconst GLYPHS: Record<string, string> = {\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n plus: '+',\n}\n\nconst WORDS: Record<string, HotkeysWord> = {\n ctrl: 'ctrl',\n alt: 'alt',\n shift: 'shift',\n enter: 'enter',\n esc: 'escape',\n space: 'space',\n backspace: 'backspace',\n delete: 'delete',\n tab: 'tab',\n up: 'up',\n down: 'down',\n left: 'left',\n right: 'right',\n}\n\nconst MODIFIERS = new Set(['mod', 'meta', 'ctrl', 'alt', 'shift'])\n\n/**\n * The kinds of field one cannot type prose into. A shortcut stays live over a\n * checkbox, a button or a colour picker: there is no sentence to interrupt there.\n */\nconst NON_TEXT_INPUT_TYPES = new Set([\n 'button',\n 'submit',\n 'reset',\n 'checkbox',\n 'radio',\n 'file',\n 'range',\n 'color',\n 'image',\n])\n\n/**\n * Reads a combination as it was written and returns its keys in canonical form:\n * `'mod+k'` and `' Mod + K '` both give the same two. Empty segments are dropped, so a\n * trailing separator is harmless — and the `+` KEY itself is written `plus`.\n */\nexport function parseHotkeys(keys: string): string[] {\n const tokens = keys\n .split('+')\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean)\n .map((token) => ALIASES[token] ?? token)\n if (isDev && tokens.length === 0) {\n console.warn(`[VHotkeys] \\`keys\\` is empty: \"${keys}\" declares no key.`)\n }\n return tokens\n}\n\n/** Whether this key is one that is held down rather than pressed. */\nfunction isModifier(token: string): boolean {\n return MODIFIERS.has(token)\n}\n\n/**\n * How a key nobody has a word or a symbol for is printed: as it was written, merely\n * capitalized — `k` becomes K, `f5` becomes F5, and a slash stays a slash.\n */\nexport function capLabel(token: string): string {\n return token.charAt(0).toUpperCase() + token.slice(1)\n}\n\nfunction wordOf(token: string, platform: HotkeysPlatform): HotkeysWord | undefined {\n /* The two keys whose name depends on the system. `mod` is the modifier a consumer\n writes when they mean \"the usual one here\" — Command on a Mac, Ctrl elsewhere —\n while `meta` names that physical key literally, and it is called something\n different on each system. */\n if (token === 'mod') return platform === 'mac' ? 'command' : 'ctrl'\n if (token === 'meta') {\n if (platform === 'mac') return 'command'\n return platform === 'windows' ? 'windows' : 'super'\n }\n return WORDS[token]\n}\n\n/**\n * Resolves each key of a combination for a given system, attaching the symbol engraved\n * on it and the dictionary entry naming it, where either exists.\n */\nexport function resolveKeys(tokens: string[], platform: HotkeysPlatform): ResolvedKey[] {\n return tokens.map((token) => ({\n token,\n glyph: (platform === 'mac' ? MAC_GLYPHS[token] : undefined) ?? GLYPHS[token],\n word: wordOf(token, platform),\n }))\n}\n\nfunction normalizeEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n return ALIASES[key] ?? key\n}\n\n/**\n * Whether a key press IS this combination.\n *\n * The modifiers are compared EXACTLY, and never as \"at least these ones\". Without\n * that, `mod+k` and `mod+shift+k` could not coexist in one application: the first\n * would swallow every press meant for the second.\n */\nexport function matchesEvent(\n event: KeyboardEvent,\n tokens: string[],\n platform: HotkeysPlatform,\n): boolean {\n const wantCtrl = tokens.includes('ctrl') || (platform !== 'mac' && tokens.includes('mod'))\n const wantMeta = tokens.includes('meta') || (platform === 'mac' && tokens.includes('mod'))\n if (event.ctrlKey !== wantCtrl) return false\n if (event.metaKey !== wantMeta) return false\n if (event.altKey !== tokens.includes('alt')) return false\n if (event.shiftKey !== tokens.includes('shift')) return false\n const main = tokens.find((token) => !isModifier(token))\n /* A combination made of modifiers alone never fires: there is no key to press. */\n if (main === undefined) return false\n /* Both sides go through the same normalization, which is also what makes a press\n reported as \"K\" — because Shift was held — match a shortcut written `k`. */\n return normalizeEventKey(event) === main\n}\n\n// @keyboard — what `allowInInput` is asked about: a shortcut must not fire in the\n// middle of someone typing a sentence.\nexport function isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false\n if (target.isContentEditable) return true\n const tag = target.tagName\n if (tag === 'TEXTAREA' || tag === 'SELECT') return true\n if (tag !== 'INPUT') return false\n return !NON_TEXT_INPUT_TYPES.has((target as HTMLInputElement).type)\n}\n"],"mappings":";AAsEA,IAAa,IAAoC;AAYjD,SAAgB,IAAkC;CAChD,IAAI,OAAO,YAAc,KAAa,OAAO;CAC7C,IAAM,IAAM,WACN,KAAU,EAAI,eAAe,YAAY,EAAI,YAAY,GAAA,CAAI,YAAY;CAS/E,OANI,uBAAuB,KAAK,CAAM,IAAU,QAC5C,EAAO,SAAS,KAAK,IAAU,YAI/B,+BAA+B,KAAK,CAAM,IAAU,UACjD;AACT;AASA,IAAM,IAAkC;CACtC,KAAK;CACL,SAAS;CACT,KAAK;CACL,SAAS;CACT,OAAO;CACP,IAAI;CACJ,WAAW;CACX,kBAAkB;CAClB,SAAS;CACT,QAAQ;CACR,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,KAAK;CACL,KAAK;CACL,SAAS;CACT,WAAW;CACX,WAAW;CACX,YAAY;CACZ,KAAK;AACP,GAKM,IAAqC;CACzC,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,WAAW;CACX,QAAQ;CACR,KAAK;AACP,GAIM,IAAiC;CACrC,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACR,GAEM,IAAqC;CACzC,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,KAAK;CACL,OAAO;CACP,WAAW;CACX,QAAQ;CACR,KAAK;CACL,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;AACT,GAEM,oBAAY,IAAI,IAAI;CAAC;CAAO;CAAQ;CAAQ;CAAO;AAAO,CAAC,GAM3D,oBAAuB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAOD,SAAgB,EAAa,GAAwB;CASnD,OARe,EACZ,MAAM,GAAG,CAAC,CACV,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO,CAAC,CACf,KAAK,MAAU,EAAQ,MAAU,CAI7B;AACT;AAGA,SAAS,EAAW,GAAwB;CAC1C,OAAO,EAAU,IAAI,CAAK;AAC5B;AAMA,SAAgB,EAAS,GAAuB;CAC9C,OAAO,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAM,MAAM,CAAC;AACtD;AAEA,SAAS,EAAO,GAAe,GAAoD;CAUjF,OALI,MAAU,QAAc,MAAa,QAAQ,YAAY,SACzD,MAAU,SACR,MAAa,QAAc,YACxB,MAAa,YAAY,YAAY,UAEvC,EAAM;AACf;AAMA,SAAgB,EAAY,GAAkB,GAA0C;CACtF,OAAO,EAAO,KAAK,OAAW;EAC5B;EACA,QAAQ,MAAa,QAAQ,EAAW,KAAS,KAAA,MAAc,EAAO;EACtE,MAAM,EAAO,GAAO,CAAQ;CAC9B,EAAE;AACJ;AAEA,SAAS,EAAkB,GAA8B;CACvD,IAAM,IAAM,EAAM,IAAI,YAAY;CAClC,OAAO,EAAQ,MAAQ;AACzB;AASA,SAAgB,EACd,GACA,GACA,GACS;CACT,IAAM,IAAW,EAAO,SAAS,MAAM,KAAM,MAAa,SAAS,EAAO,SAAS,KAAK,GAClF,IAAW,EAAO,SAAS,MAAM,KAAM,MAAa,SAAS,EAAO,SAAS,KAAK;CAIxF,IAHI,EAAM,YAAY,KAClB,EAAM,YAAY,KAClB,EAAM,WAAW,EAAO,SAAS,KAAK,KACtC,EAAM,aAAa,EAAO,SAAS,OAAO,GAAG,OAAO;CACxD,IAAM,IAAO,EAAO,MAAM,MAAU,CAAC,EAAW,CAAK,CAAC;CAKtD,OAHI,MAAS,KAAA,KAGN,EAAkB,CAAK,MAAM;AACtC;AAIA,SAAgB,EAAiB,GAAqC;CACpE,IAAI,EAAE,aAAkB,cAAc,OAAO;CAC7C,IAAI,EAAO,mBAAmB,OAAO;CACrC,IAAM,IAAM,EAAO;CAGnB,OAFI,MAAQ,cAAc,MAAQ,YAC9B,MAAQ,WACL,CAAC,EAAqB,IAAK,EAA4B,IAAI;AACpE"}
1
+ {"version":3,"file":"platform.js","names":[],"sources":["../../../src/components/VHotkeys/platform.ts"],"sourcesContent":["// @core — module-wide: pure, no Vue and no lifecycle. `detectPlatform` is the\n// exception below.\n/**\n * Everything VHotkeys needs to know about keyboards: which system this one belongs to,\n * and how a written token relates to the symbol engraved on the key, to the word for\n * it, and to what the browser reports when it is pressed.\n *\n * An operating system is not a language, and the distinction matters here. Whether a\n * key shows ⌘ or Ctrl is a fact about the hardware, so it does NOT depend on the\n * reader's language. Only the WORDS do — Shift becomes Maj in French — and those live\n * in the dictionary: this module hands back the dictionary KEY and never the text\n * itself.\n *\n * What earns the module its existence is the alias table. The SAME table normalizes\n * the tokens a consumer writes in `keys` and the key names the browser reports, so a\n * shortcut cannot be declared in a spelling the matcher would fail to recognize.\n *\n * TRAP — detecting the platform must only ever be done once a component is mounted.\n * There is nothing to read it from on a server, and sniffing a request header is not\n * this library's business.\n */\n\nimport { isDev } from '../../utils/env'\n\nexport type HotkeysPlatform = 'mac' | 'windows' | 'linux' | 'other'\n\n/**\n * The dictionary entries naming a key, and only those — the sentence framing the\n * shortcut is not one of them.\n *\n * The list is written out here rather than derived from the dictionary's own type,\n * which would tie this module to the dictionary's shape. Nothing is lost: reading an\n * entry by one of these names is checked just as strictly at the point of use.\n */\nexport type HotkeysWord =\n | 'command'\n | 'ctrl'\n | 'alt'\n | 'shift'\n | 'windows'\n | 'super'\n | 'enter'\n | 'escape'\n | 'space'\n | 'backspace'\n | 'delete'\n | 'tab'\n | 'up'\n | 'down'\n | 'left'\n | 'right'\n\n/** One key of a shortcut, once resolved for a given platform. */\nexport interface ResolvedKey {\n /** Its canonical name, which is what the matcher compares a key press against. */\n token: string\n /** The symbol engraved on that key, where the system engraves one. */\n glyph?: string\n /**\n * Which dictionary entry names it. Nothing here means the design system does not\n * know this key, and it is printed as it was written.\n */\n word?: HotkeysWord\n}\n\n// @ssr\n/**\n * What a SERVER renders, and therefore what the browser's FIRST render must be as\n * well. It shares its words with Windows and Linux — Ctrl, Alt, Shift — so only a Mac\n * visitor pays a single frame of \"Ctrl\" before it is corrected to ⌘.\n */\nexport const DEFAULT_PLATFORM: HotkeysPlatform = 'other'\n\n// @ssr @fallback — the DS's ONLY `navigator` read, with a two-source ladder.\n/**\n * Works out which system the keyboard belongs to, from two sources in order. The\n * modern one is the more reliable; the older one is deprecated and frozen, but it is\n * still the only one Firefox and Safari provide.\n *\n * The modern one is missing from TypeScript's own definitions, so it is described by a\n * type declared LOCALLY rather than added to the global ones — the latter would leak\n * out into every consumer's compilation.\n */\nexport function detectPlatform(): HotkeysPlatform {\n if (typeof navigator === 'undefined') return DEFAULT_PLATFORM\n const nav = navigator as Navigator & { userAgentData?: { platform?: string } }\n const source = (nav.userAgentData?.platform || nav.platform || '').toLowerCase()\n /* iPadOS reports itself as a Mac, which is fine here: an attached keyboard carries\n the same modifier symbols either way. */\n if (/mac|iphone|ipad|ipod/.test(source)) return 'mac'\n if (source.includes('win')) return 'windows'\n /* ChromeOS spells itself two different ways depending on which of the two sources\n answered. Both have to be listed, or the branch is dead precisely where it\n matters. */\n if (/linux|android|cros|chrome os/.test(source)) return 'linux'\n return DEFAULT_PLATFORM\n}\n\n/* Every spelling accepted in the `keys` prop, and at the same time the table that\n normalizes what the browser reports. Serving both is what guarantees the two can\n never disagree.\n\n The `+` key is canonically named `plus`, since `+` is the separator and cannot name\n itself in the prop — but the browser does report it as `'+'`, hence its presence\n here. */\nconst ALIASES: Record<string, string> = {\n cmd: 'meta',\n command: 'meta',\n win: 'meta',\n windows: 'meta',\n super: 'meta',\n os: 'meta',\n cmdorctrl: 'mod',\n commandorcontrol: 'mod',\n control: 'ctrl',\n option: 'alt',\n opt: 'alt',\n return: 'enter',\n escape: 'esc',\n spacebar: 'space',\n ' ': 'space',\n del: 'delete',\n arrowup: 'up',\n arrowdown: 'down',\n arrowleft: 'left',\n arrowright: 'right',\n '+': 'plus',\n}\n\n/* The symbols engraved on an Apple keyboard, and on no other. Escape and the space bar\n are deliberately absent: the Mac key really does read \"esc\", and the space bar\n carries no symbol at all. */\nconst MAC_GLYPHS: Record<string, string> = {\n mod: '⌘',\n meta: '⌘',\n ctrl: '⌃',\n alt: '⌥',\n shift: '⇧',\n enter: '↵',\n backspace: '⌫',\n delete: '⌦',\n tab: '⇥',\n}\n\n/* Symbols that are the same everywhere: an arrow key is engraved with an arrow on\n every keyboard ever made. */\nconst GLYPHS: Record<string, string> = {\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n plus: '+',\n}\n\nconst WORDS: Record<string, HotkeysWord> = {\n ctrl: 'ctrl',\n alt: 'alt',\n shift: 'shift',\n enter: 'enter',\n esc: 'escape',\n space: 'space',\n backspace: 'backspace',\n delete: 'delete',\n tab: 'tab',\n up: 'up',\n down: 'down',\n left: 'left',\n right: 'right',\n}\n\nconst MODIFIERS = new Set(['mod', 'meta', 'ctrl', 'alt', 'shift'])\n\n/**\n * The kinds of field one cannot type prose into. A shortcut stays live over a\n * checkbox, a button or a colour picker: there is no sentence to interrupt there.\n */\nconst NON_TEXT_INPUT_TYPES = new Set([\n 'button',\n 'submit',\n 'reset',\n 'checkbox',\n 'radio',\n 'file',\n 'range',\n 'color',\n 'image',\n])\n\n/**\n * Reads a combination as it was written and returns its keys in canonical form:\n * `'mod+k'` and `' Mod + K '` both give the same two. Empty segments are dropped, so a\n * trailing separator is harmless — and the `+` KEY itself is written `plus`.\n */\nexport function parseHotkeys(keys: string): string[] {\n const tokens = keys\n .split('+')\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean)\n .map((token) => ALIASES[token] ?? token)\n if (isDev && tokens.length === 0) {\n console.warn(`[VHotkeys] \\`keys\\` is empty: \"${keys}\" declares no key.`)\n }\n return tokens\n}\n\n/** Whether this key is one that is held down rather than pressed. */\nfunction isModifier(token: string): boolean {\n return MODIFIERS.has(token)\n}\n\n/**\n * How a key nobody has a word or a symbol for is printed: as it was written, merely\n * capitalized — `k` becomes K, `f5` becomes F5, and a slash stays a slash.\n */\nexport function capLabel(token: string): string {\n return token.charAt(0).toUpperCase() + token.slice(1)\n}\n\nfunction wordOf(token: string, platform: HotkeysPlatform): HotkeysWord | undefined {\n /* The two keys whose name depends on the system. `mod` is the modifier a consumer\n writes when they mean \"the usual one here\" — Command on a Mac, Ctrl elsewhere —\n while `meta` names that physical key literally, and it is called something\n different on each system. */\n if (token === 'mod') return platform === 'mac' ? 'command' : 'ctrl'\n if (token === 'meta') {\n if (platform === 'mac') return 'command'\n return platform === 'windows' ? 'windows' : 'super'\n }\n return WORDS[token]\n}\n\n/**\n * Resolves each key of a combination for a given system, attaching the symbol engraved\n * on it and the dictionary entry naming it, where either exists.\n */\nexport function resolveKeys(tokens: string[], platform: HotkeysPlatform): ResolvedKey[] {\n return tokens.map((token) => ({\n token,\n glyph: (platform === 'mac' ? MAC_GLYPHS[token] : undefined) ?? GLYPHS[token],\n word: wordOf(token, platform),\n }))\n}\n\nfunction normalizeEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n return ALIASES[key] ?? key\n}\n\n/**\n * Whether a key press IS this combination.\n *\n * The modifiers are compared EXACTLY, and never as \"at least these ones\". Without\n * that, `mod+k` and `mod+shift+k` could not coexist in one application: the first\n * would swallow every press meant for the second.\n */\nexport function matchesEvent(\n event: KeyboardEvent,\n tokens: string[],\n platform: HotkeysPlatform,\n): boolean {\n const wantCtrl = tokens.includes('ctrl') || (platform !== 'mac' && tokens.includes('mod'))\n const wantMeta = tokens.includes('meta') || (platform === 'mac' && tokens.includes('mod'))\n if (event.ctrlKey !== wantCtrl) return false\n if (event.metaKey !== wantMeta) return false\n if (event.altKey !== tokens.includes('alt')) return false\n if (event.shiftKey !== tokens.includes('shift')) return false\n const main = tokens.find((token) => !isModifier(token))\n /* A combination made of modifiers alone never fires: there is no key to press. */\n if (main === undefined) return false\n /* Both sides go through the same normalization, which is also what makes a press\n reported as \"K\" — because Shift was held — match a shortcut written `k`. */\n return normalizeEventKey(event) === main\n}\n\n// @keyboard — what `allowInInput` is asked about: a shortcut must not fire in the\n// middle of someone typing a sentence.\nexport function isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false\n if (target.isContentEditable) return true\n const tag = target.tagName\n if (tag === 'TEXTAREA' || tag === 'SELECT') return true\n if (tag !== 'INPUT') return false\n return !NON_TEXT_INPUT_TYPES.has((target as HTMLInputElement).type)\n}\n"],"mappings":";AAuEA,IAAa,IAAoC;AAYjD,SAAgB,IAAkC;CAChD,IAAI,OAAO,YAAc,KAAa,OAAO;CAC7C,IAAM,IAAM,WACN,KAAU,EAAI,eAAe,YAAY,EAAI,YAAY,GAAA,CAAI,YAAY;CAS/E,OANI,uBAAuB,KAAK,CAAM,IAAU,QAC5C,EAAO,SAAS,KAAK,IAAU,YAI/B,+BAA+B,KAAK,CAAM,IAAU,UACjD;AACT;AASA,IAAM,IAAkC;CACtC,KAAK;CACL,SAAS;CACT,KAAK;CACL,SAAS;CACT,OAAO;CACP,IAAI;CACJ,WAAW;CACX,kBAAkB;CAClB,SAAS;CACT,QAAQ;CACR,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,KAAK;CACL,KAAK;CACL,SAAS;CACT,WAAW;CACX,WAAW;CACX,YAAY;CACZ,KAAK;AACP,GAKM,IAAqC;CACzC,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,WAAW;CACX,QAAQ;CACR,KAAK;AACP,GAIM,IAAiC;CACrC,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACR,GAEM,IAAqC;CACzC,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,KAAK;CACL,OAAO;CACP,WAAW;CACX,QAAQ;CACR,KAAK;CACL,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;AACT,GAEM,oBAAY,IAAI,IAAI;CAAC;CAAO;CAAQ;CAAQ;CAAO;AAAO,CAAC,GAM3D,oBAAuB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAOD,SAAgB,EAAa,GAAwB;CASnD,OARe,EACZ,MAAM,GAAG,CAAC,CACV,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO,CAAC,CACf,KAAK,MAAU,EAAQ,MAAU,CAI7B;AACT;AAGA,SAAS,EAAW,GAAwB;CAC1C,OAAO,EAAU,IAAI,CAAK;AAC5B;AAMA,SAAgB,EAAS,GAAuB;CAC9C,OAAO,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAM,MAAM,CAAC;AACtD;AAEA,SAAS,EAAO,GAAe,GAAoD;CAUjF,OALI,MAAU,QAAc,MAAa,QAAQ,YAAY,SACzD,MAAU,SACR,MAAa,QAAc,YACxB,MAAa,YAAY,YAAY,UAEvC,EAAM;AACf;AAMA,SAAgB,EAAY,GAAkB,GAA0C;CACtF,OAAO,EAAO,KAAK,OAAW;EAC5B;EACA,QAAQ,MAAa,QAAQ,EAAW,KAAS,KAAA,MAAc,EAAO;EACtE,MAAM,EAAO,GAAO,CAAQ;CAC9B,EAAE;AACJ;AAEA,SAAS,EAAkB,GAA8B;CACvD,IAAM,IAAM,EAAM,IAAI,YAAY;CAClC,OAAO,EAAQ,MAAQ;AACzB;AASA,SAAgB,EACd,GACA,GACA,GACS;CACT,IAAM,IAAW,EAAO,SAAS,MAAM,KAAM,MAAa,SAAS,EAAO,SAAS,KAAK,GAClF,IAAW,EAAO,SAAS,MAAM,KAAM,MAAa,SAAS,EAAO,SAAS,KAAK;CAIxF,IAHI,EAAM,YAAY,KAClB,EAAM,YAAY,KAClB,EAAM,WAAW,EAAO,SAAS,KAAK,KACtC,EAAM,aAAa,EAAO,SAAS,OAAO,GAAG,OAAO;CACxD,IAAM,IAAO,EAAO,MAAM,MAAU,CAAC,EAAW,CAAK,CAAC;CAKtD,OAHI,MAAS,KAAA,KAGN,EAAkB,CAAK,MAAM;AACtC;AAIA,SAAgB,EAAiB,GAAqC;CACpE,IAAI,EAAE,aAAkB,cAAc,OAAO;CAC7C,IAAI,EAAO,mBAAmB,OAAO;CACrC,IAAM,IAAM,EAAO;CAGnB,OAFI,MAAQ,cAAc,MAAQ,YAC9B,MAAQ,WACL,CAAC,EAAqB,IAAK,EAA4B,IAAI;AACpE"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-icon{--icon-size:var(--vectis-icon-size,1em);--icon-opsz:var(--vectis-icon-opsz,24);inline-size:var(--icon-size);block-size:var(--icon-size);font-size:var(--icon-size);flex:none;justify-content:center;align-items:center;display:inline-flex}.v-icon:has(>.v-icon-symbol){overflow:hidden}.v-icon-symbol{font-family:var(--vectis-font-family-icon);font-weight:var(--vectis-font-weight-regular);font-style:normal;line-height:var(--vectis-font-leading-none);letter-spacing:normal;text-transform:none;white-space:nowrap;font-variation-settings:"FILL" var(--icon-fill,0), "wght" 400, "GRAD" 0, "opsz" var(--icon-opsz);direction:ltr}.v-icon[data-filled] .v-icon-symbol{--icon-fill:1}.v-icon-img,.v-icon>svg{object-fit:contain;block-size:100%;inline-size:100%}.v-icon-glyph{font-style:normal;line-height:var(--vectis-font-leading-none);display:block}.v-icon-svg{fill:currentColor;display:block}}
2
+ @layer vectis.components{.v-icon{--icon-size:var(--vectis-icon-size,1em);--icon-opsz:var(--vectis-icon-opsz,24);inline-size:var(--icon-size);block-size:var(--icon-size);font-size:var(--icon-size);flex:none;justify-content:center;align-items:center;display:inline-flex}.v-icon:has(>.v-icon-symbol){overflow:hidden}.v-icon-symbol{font-family:var(--vectis-font-family-icon);font-weight:var(--vectis-font-weight-regular);font-style:normal;line-height:var(--vectis-font-leading-none);letter-spacing:normal;text-transform:none;white-space:nowrap;font-variation-settings:"FILL" var(--icon-fill,0), "wght" 400, "GRAD" 0, "opsz" var(--icon-opsz);direction:ltr}.v-icon[data-filled] .v-icon-symbol{--icon-fill:1}.v-icon[data-mirror]:dir(rtl){scale:-1 1}.v-icon-img,.v-icon>svg{object-fit:contain;block-size:100%;inline-size:100%}.v-icon-glyph{font-style:normal;line-height:var(--vectis-font-leading-none);display:block}.v-icon-svg{fill:currentColor;display:block}}
@@ -17,11 +17,12 @@ interface IconProps {
17
17
  /** The address of an image to use as the icon. It wins over `name`. */
18
18
  src?: string;
19
19
  /**
20
- * A size in pixels. Left out, the icon takes the size its context imposes — a
21
- * button sets one for the icons inside it — and failing that 1em, which makes it
22
- * follow the surrounding text.
20
+ * A size in pixels, as a number or a numeric string. Left out, or given something that
21
+ * is not a number, the icon takes the size its context imposes — a button sets one for
22
+ * the icons inside it — and failing that 1em, which makes it follow the surrounding
23
+ * text.
23
24
  */
24
- size?: number;
25
+ size?: number | string;
25
26
  /**
26
27
  * What the icon means, for screen readers. Leaving it out marks the icon as
27
28
  * decorative and hides it from them, which is the right thing whenever the
@@ -34,6 +35,13 @@ interface IconProps {
34
35
  * means nothing for an image or an inline SVG, whose shape is fixed.
35
36
  */
36
37
  filled?: boolean;
38
+ /**
39
+ * Flips the icon horizontally in a right-to-left context, for a glyph that points
40
+ * at a physical direction: a "previous" chevron points left in English and right in
41
+ * Arabic. Off by default, since most icons mean the same thing in both directions.
42
+ * The direction is the one the browser computed, so an ancestor's `dir` is enough.
43
+ */
44
+ mirrored?: boolean;
37
45
  }
38
46
  type __VLS_Slots = {
39
47
  /** An inline SVG, used when neither `src` nor `name` was given. */
@@ -41,11 +49,12 @@ type __VLS_Slots = {
41
49
  };
42
50
  declare const __VLS_base: import('vue').DefineComponent<IconProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IconProps> & Readonly<{}>, {
43
51
  label: string;
44
- size: number;
45
- name: string | BuiltinIcon;
46
52
  render: IconRender;
53
+ name: string | BuiltinIcon;
54
+ size: number | string;
47
55
  src: string;
48
56
  filled: boolean;
57
+ mirrored: boolean;
49
58
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
50
59
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
51
60
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"VIcon.js","names":[],"sources":["../../../src/components/VIcon/VIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * An icon, whatever the icons of the host application happen to be made of. The\n * component's real work is deciding WHERE the drawing comes from, and it asks in a\n * fixed order: an explicit render first, then an image address, then the name —\n * which is offered to the consumer's own resolver if one was installed, then to the\n * drawing the icon brought along with it, and finally to a ligature font. A raw SVG\n * can always be passed through the slot instead.\n *\n * That order IS the contract. The resolver is asked before the built-in drawing,\n * otherwise the design system's own icons would stay Material for a consumer who has\n * wired in their own library; and a resolver that answers `undefined` for a name\n * simply hands over to that drawing, which is what makes a PARTIAL mapping usable.\n *\n * It is what allows the design system to work with no icon font at all: the icons\n * the library draws by itself — crosses, chevrons, toast tones — are imported by the\n * components that render them and travel as a name AND its paths, so they depend on\n * nothing being installed, and a consumer downloads only the ones their components\n * actually draw. The ligature remains the fallback for every other name.\n *\n * Despite the `computed`, there is no behavioural JavaScript here: no event, no\n * lifecycle, no DOM. It is a pure choice of source, which the server and the browser\n * make identically.\n */\nimport { computed, type Component } from 'vue'\n\nimport { ICON_VIEW_BOX } from './icons/viewBox'\nimport { resolveIcon } from './resolver'\nimport type { BuiltinIcon, IconRender } from './types'\n\ninterface IconProps {\n /**\n * Which icon to draw. A plain string is a name: it is offered to the consumer's\n * resolver and then left to the icon font as a ligature. One of the design\n * system's own icons, imported from `vectis-ui/icons`, carries its drawing with\n * it — the resolver is still asked first, and the drawing is what answers when\n * nothing else does.\n */\n name?: string | BuiltinIcon\n /**\n * An explicit description of what to draw — an image, a component, a path, a class\n * — which wins over everything else. This is the route every `IconSource` prop of\n * the design system takes when it is given something other than a plain name.\n */\n render?: IconRender\n /** The address of an image to use as the icon. It wins over `name`. */\n src?: string\n /**\n * A size in pixels. Left out, the icon takes the size its context imposes — a\n * button sets one for the icons inside it — and failing that 1em, which makes it\n * follow the surrounding text.\n */\n size?: number\n /**\n * What the icon means, for screen readers. Leaving it out marks the icon as\n * decorative and hides it from them, which is the right thing whenever the\n * surrounding text already says what it says.\n */\n label?: string\n /**\n * Draws the filled version of the icon. The built-in icons honour it wherever\n * filling actually changes the drawing, and the ligature font always does. It\n * means nothing for an image or an inline SVG, whose shape is fixed.\n */\n filled?: boolean\n}\n\nconst props = withDefaults(defineProps<IconProps>(), {\n name: undefined,\n render: undefined,\n src: undefined,\n size: undefined,\n label: undefined,\n filled: false,\n})\n\ndefineSlots<{\n /** An inline SVG, used when neither `src` nor `name` was given. */\n default?(): unknown\n}>()\n\n/**\n * The chosen source, labelled with its kind. The public `IconRender` union carries\n * no such label — the consumer writes it by hand and has nothing to tag it with —\n * but the template needs one thing it can branch on reliably, and applying the tag\n * is also where the documented precedence between the shapes gets decided.\n */\ntype Resolved =\n | { kind: 'path'; path: string; viewBox: string }\n | { kind: 'component'; component: Component; props?: Record<string, unknown> }\n | { kind: 'src'; src: string }\n | { kind: 'text'; text: string; class?: string }\n | { kind: 'class'; class: string }\n\nfunction tag(render: IconRender): Resolved {\n if ('path' in render)\n return { kind: 'path', path: render.path, viewBox: render.viewBox ?? ICON_VIEW_BOX }\n if ('component' in render)\n return { kind: 'component', component: render.component, props: render.props }\n if ('src' in render) return { kind: 'src', src: render.src }\n if ('text' in render) return { kind: 'text', text: render.text, class: render.class }\n return { kind: 'class', class: render.class }\n}\n\n// @fallback — the ladder itself: every rung hands over to the next one, and the\n// ligature is the last resort, reached when neither the resolver nor the registry\n// recognized the name.\n/**\n * Works out what to draw: an explicit `render` if there is one, then the consumer's\n * resolver, then the icons built into the library. Answering `undefined` here is not\n * a failure — it means the template falls through to the image, the ligature or the\n * slot.\n */\n/**\n * The icon's identity: the name the resolver is asked for, and the one `data-icon`\n * records whatever the drawing turned out to come from.\n */\nconst iconName = computed(() => (typeof props.name === 'string' ? props.name : props.name?.name))\n\nconst resolved = computed<Resolved | undefined>(() => {\n if (props.render) return tag(props.render)\n if (props.src !== undefined || props.name === undefined) return undefined\n\n const custom = resolveIcon(iconName.value!, { filled: props.filled })\n if (custom) return tag(custom)\n\n // A bare name has no drawing of its own, so it falls through to the ligature; only\n // one of the library's own icons brings its paths along.\n if (typeof props.name === 'string') return undefined\n\n const { paths } = props.name\n // A second path is only stored when filling actually changes the drawing, so most\n // icons have one path and fall back to it (see icons.ts).\n const path = (props.filled ? paths[1] : undefined) ?? paths[0]\n return { kind: 'path', path, viewBox: ICON_VIEW_BOX }\n})\n</script>\n\n<template>\n <span\n class=\"v-icon\"\n :style=\"size !== undefined ? { '--vectis-icon-size': `${size}px` } : undefined\"\n :data-icon=\"iconName\"\n :data-filled=\"filled || undefined\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n >\n <template v-if=\"resolved\">\n <svg\n v-if=\"resolved.kind === 'path'\"\n class=\"v-icon-svg\"\n :viewBox=\"resolved.viewBox\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path :d=\"resolved.path\" />\n </svg>\n <component\n :is=\"resolved.component\"\n v-else-if=\"resolved.kind === 'component'\"\n v-bind=\"resolved.props\"\n />\n <img v-else-if=\"resolved.kind === 'src'\" class=\"v-icon-img\" :src=\"resolved.src\" alt=\"\" />\n <!-- The interpolation is written flush against the tags: a ligature is matched\n on the exact text, and any surrounding whitespace would break it -->\n <span v-else-if=\"resolved.kind === 'text'\" class=\"v-icon-symbol\" :class=\"resolved.class\">{{\n resolved.text\n }}</span>\n <span v-else class=\"v-icon-glyph\" :class=\"resolved.class\" />\n </template>\n <img v-else-if=\"src\" class=\"v-icon-img\" :src=\"src\" alt=\"\" />\n <span v-else-if=\"name\" class=\"v-icon-symbol\">{{ name }}</span>\n <slot v-else />\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n .v-icon {\n /*\n * How the size is settled, in order of priority:\n * 1. the `size` prop, written inline on the element as --vectis-icon-size — a\n * declaration made on the element itself beats both inheritance and the\n * layer, so it always wins;\n * 2. the variables inherited from an ancestor, which is the context API: a\n * VButton sets them from its own size, and the icons inside follow;\n * 3. 1em, which makes the icon follow the size of the text around it.\n */\n --icon-size: var(--vectis-icon-size, 1em);\n --icon-opsz: var(--vectis-icon-opsz, 24);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n inline-size: var(--icon-size);\n block-size: var(--icon-size);\n /* a ligature is text, so it is the font-size that sizes it */\n font-size: var(--icon-size);\n }\n\n /* When the icon font has not loaded, a ligature shows as its own name in plain\n text. Clipping keeps that text inside the square instead of letting it push the\n layout apart. The rule is scoped to the ONE branch it protects rather than to\n `.v-icon`: a third-party icon font may legitimately draw outside its 1em box,\n and clipping everything would cut those glyphs. */\n .v-icon:has(> .v-icon-symbol) {\n overflow: hidden;\n }\n\n .v-icon-symbol {\n font-family: var(--vectis-font-family-icon);\n font-weight: var(--vectis-font-weight-regular);\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n direction: ltr;\n /* The variable axes of the Material Symbols font. These numbers are the font's\n own technical contract and not design decisions, which is why they are written\n literally here rather than taken from tokens — the same tolerance as the\n opacities. */\n font-variation-settings:\n 'FILL' var(--icon-fill, 0),\n 'wght' 400,\n 'GRAD' 0,\n 'opsz' var(--icon-opsz);\n }\n\n .v-icon[data-filled] .v-icon-symbol {\n --icon-fill: 1;\n }\n\n .v-icon-img,\n .v-icon > svg {\n inline-size: 100%;\n block-size: 100%;\n object-fit: contain;\n }\n\n /* An icon coming from a class-based font, as Font Awesome and Phosphor ship them:\n the glyph is drawn by a `::before`, at the font-size `.v-icon` has set. Because\n the design system renders this element itself rather than accepting the usual\n `<i>`, one rule normalizes it for every such library — `font-style` undoes the\n italics those conventions carry, and `line-height` stops the inherited line box\n from pushing the glyph off centre. */\n .v-icon-glyph {\n display: block;\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n }\n\n /* An SVG drawn from the built-in icons. The fill is set on OUR class and never on\n `.v-icon > svg`, so that a multicoloured SVG handed in through the slot keeps\n its own colours instead of being flattened to the text colour. `display: block`\n removes the gap an inline element leaves under its baseline. */\n .v-icon-svg {\n display: block;\n fill: currentcolor;\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VIcon.js","names":[],"sources":["../../../src/components/VIcon/VIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * An icon, whatever the host application's icons are made of. The real work is deciding\n * WHERE the drawing comes from, asked in a fixed order: `render`, then `src`, then `name` —\n * offered to the consumer's resolver if one was installed, then to the drawing the icon\n * carries, and finally to a ligature font. A raw SVG can always come through the slot.\n *\n * That order IS the contract. The resolver comes before the built-in drawing, or the\n * library's own icons would stay Material for a consumer who wired in their own set; and a\n * resolver returning `undefined` hands over to that drawing, which is what makes a PARTIAL\n * mapping usable.\n *\n * It is what lets the library require no icon font: the icons it draws by default are\n * imported by the components that render them and travel as a name AND its paths, so a\n * consumer downloads only the ones their components actually draw.\n *\n * Despite the `computed`, there is no behavioural JS here — no event, no lifecycle, no DOM.\n * A pure choice of source, made identically on the server and in the browser.\n */\nimport { computed, type Component } from 'vue'\n\nimport { iconName as nameOf } from './iconProps'\nimport { ICON_VIEW_BOX } from './icons/viewBox'\nimport { resolveIcon } from './resolver'\nimport type { BuiltinIcon, IconRender } from './types'\n\nimport { px } from '../../utils/css'\n\ninterface IconProps {\n /**\n * Which icon to draw. A plain string is a name: it is offered to the consumer's\n * resolver and then left to the icon font as a ligature. One of the design\n * system's own icons, imported from `vectis-ui/icons`, carries its drawing with\n * it — the resolver is still asked first, and the drawing is what answers when\n * nothing else does.\n */\n name?: string | BuiltinIcon\n /**\n * An explicit description of what to draw — an image, a component, a path, a class\n * — which wins over everything else. This is the route every `IconSource` prop of\n * the design system takes when it is given something other than a plain name.\n */\n render?: IconRender\n /** The address of an image to use as the icon. It wins over `name`. */\n src?: string\n /**\n * A size in pixels, as a number or a numeric string. Left out, or given something that\n * is not a number, the icon takes the size its context imposes — a button sets one for\n * the icons inside it — and failing that 1em, which makes it follow the surrounding\n * text.\n */\n size?: number | string\n /**\n * What the icon means, for screen readers. Leaving it out marks the icon as\n * decorative and hides it from them, which is the right thing whenever the\n * surrounding text already says what it says.\n */\n label?: string\n /**\n * Draws the filled version of the icon. The built-in icons honour it wherever\n * filling actually changes the drawing, and the ligature font always does. It\n * means nothing for an image or an inline SVG, whose shape is fixed.\n */\n filled?: boolean\n /**\n * Flips the icon horizontally in a right-to-left context, for a glyph that points\n * at a physical direction: a \"previous\" chevron points left in English and right in\n * Arabic. Off by default, since most icons mean the same thing in both directions.\n * The direction is the one the browser computed, so an ancestor's `dir` is enough.\n */\n mirrored?: boolean\n}\n\nconst props = withDefaults(defineProps<IconProps>(), {\n name: undefined,\n render: undefined,\n src: undefined,\n size: undefined,\n label: undefined,\n filled: false,\n mirrored: false,\n})\n\ndefineSlots<{\n /** An inline SVG, used when neither `src` nor `name` was given. */\n default?(): unknown\n}>()\n\n/**\n * The chosen source, labelled with its kind. The public `IconRender` union carries\n * no such label — the consumer writes it by hand and has nothing to tag it with —\n * but the template needs one thing it can branch on reliably, and applying the tag\n * is also where the documented precedence between the shapes gets decided.\n */\ntype Resolved =\n | { kind: 'path'; path: string; viewBox: string }\n | { kind: 'component'; component: Component; props?: Record<string, unknown> }\n | { kind: 'src'; src: string }\n | { kind: 'text'; text: string; class?: string }\n | { kind: 'class'; class: string }\n\nfunction tag(render: IconRender): Resolved {\n if ('path' in render)\n return { kind: 'path', path: render.path, viewBox: render.viewBox ?? ICON_VIEW_BOX }\n if ('component' in render)\n return { kind: 'component', component: render.component, props: render.props }\n if ('src' in render) return { kind: 'src', src: render.src }\n if ('text' in render) return { kind: 'text', text: render.text, class: render.class }\n return { kind: 'class', class: render.class }\n}\n\n/**\n * The icon's identity: the name the resolver is asked for, and the one `data-icon`\n * records whatever the drawing turned out to come from.\n */\nconst iconName = computed(() => nameOf(props.name))\n\n// @fallback — the ladder itself: every rung hands over to the next one, and the\n// ligature is the last resort, reached when neither the resolver nor the registry\n// recognized the name.\n/**\n * Works out what to draw: an explicit `render` if there is one, then the consumer's\n * resolver, then the icons built into the library. Answering `undefined` here is not\n * a failure — it means the template falls through to the image, the ligature or the\n * slot.\n */\nconst resolved = computed<Resolved | undefined>(() => {\n if (props.render) return tag(props.render)\n // TRUTHINESS on `src`, the test the template renders the image with: an empty `src=\"\"`\n // renders no image, so it must not stop the name from being drawn either.\n if (props.src || props.name === undefined) return undefined\n\n const custom = resolveIcon(iconName.value!, { filled: props.filled })\n if (custom) return tag(custom)\n\n // A bare name has no drawing of its own, so it falls through to the ligature; only\n // one of the library's own icons brings its paths along.\n if (typeof props.name === 'string') return undefined\n\n const { paths } = props.name\n // A second path is only stored when filling actually changes the drawing, so most\n // icons have one path and fall back to it (see icons.ts).\n const path = (props.filled ? paths[1] : undefined) ?? paths[0]\n return { kind: 'path', path, viewBox: ICON_VIEW_BOX }\n})\n</script>\n\n<template>\n <span\n class=\"v-icon\"\n :style=\"px(size) !== undefined ? { '--vectis-icon-size': px(size) } : undefined\"\n :data-icon=\"iconName\"\n :data-filled=\"filled || undefined\"\n :data-mirror=\"mirrored || undefined\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n >\n <template v-if=\"resolved\">\n <svg\n v-if=\"resolved.kind === 'path'\"\n class=\"v-icon-svg\"\n :viewBox=\"resolved.viewBox\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path :d=\"resolved.path\" />\n </svg>\n <component\n :is=\"resolved.component\"\n v-else-if=\"resolved.kind === 'component'\"\n v-bind=\"resolved.props\"\n />\n <img v-else-if=\"resolved.kind === 'src'\" class=\"v-icon-img\" :src=\"resolved.src\" alt=\"\" />\n <!-- The interpolation is written flush against the tags: a ligature is matched\n on the exact text, and any surrounding whitespace would break it -->\n <span v-else-if=\"resolved.kind === 'text'\" class=\"v-icon-symbol\" :class=\"resolved.class\">{{\n resolved.text\n }}</span>\n <span v-else class=\"v-icon-glyph\" :class=\"resolved.class\" />\n </template>\n <img v-else-if=\"src\" class=\"v-icon-img\" :src=\"src\" alt=\"\" />\n <span v-else-if=\"name\" class=\"v-icon-symbol\">{{ iconName }}</span>\n <slot v-else />\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n .v-icon {\n /*\n * How the size is settled, in order of priority:\n * 1. the `size` prop, written inline on the element as --vectis-icon-size — a\n * declaration made on the element itself beats both inheritance and the\n * layer, so it always wins;\n * 2. the variables inherited from an ancestor, which is the context API: a\n * VButton sets them from its own size, and the icons inside follow;\n * 3. 1em, which makes the icon follow the size of the text around it.\n */\n --icon-size: var(--vectis-icon-size, 1em);\n --icon-opsz: var(--vectis-icon-opsz, 24);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n inline-size: var(--icon-size);\n block-size: var(--icon-size);\n /* a ligature is text, so it is the font-size that sizes it */\n font-size: var(--icon-size);\n }\n\n /* When the icon font has not loaded, a ligature shows as its own name in plain\n text. Clipping keeps that text inside the square instead of letting it push the\n layout apart. The rule is scoped to the ONE branch it protects rather than to\n `.v-icon`: a third-party icon font may legitimately draw outside its 1em box,\n and clipping everything would cut those glyphs. */\n .v-icon:has(> .v-icon-symbol) {\n overflow: hidden;\n }\n\n .v-icon-symbol {\n font-family: var(--vectis-font-family-icon);\n font-weight: var(--vectis-font-weight-regular);\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n direction: ltr;\n /* The variable axes of the Material Symbols font. These numbers are the font's\n own technical contract and not design decisions, which is why they are written\n literally here rather than taken from tokens — the same tolerance as the\n opacities. */\n font-variation-settings:\n 'FILL' var(--icon-fill, 0),\n 'wght' 400,\n 'GRAD' 0,\n 'opsz' var(--icon-opsz);\n }\n\n .v-icon[data-filled] .v-icon-symbol {\n --icon-fill: 1;\n }\n\n /* `:dir()` reads the direction the browser computed rather than an attribute spelled on\n an ancestor, and `scale` is the individual property, so it composes with a rotation\n a consumer applies (a disclosure chevron) instead of replacing its transform. */\n .v-icon[data-mirror]:dir(rtl) {\n scale: -1 1;\n }\n\n .v-icon-img,\n .v-icon > svg {\n inline-size: 100%;\n block-size: 100%;\n object-fit: contain;\n }\n\n /* An icon coming from a class-based font, as Font Awesome and Phosphor ship them:\n the glyph is drawn by a `::before`, at the font-size `.v-icon` has set. Because\n the design system renders this element itself rather than accepting the usual\n `<i>`, one rule normalizes it for every such library — `font-style` undoes the\n italics those conventions carry, and `line-height` stops the inherited line box\n from pushing the glyph off centre. */\n .v-icon-glyph {\n display: block;\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n }\n\n /* An SVG drawn from the built-in icons. The fill is set on OUR class and never on\n `.v-icon > svg`, so that a multicoloured SVG handed in through the slot keeps\n its own colours instead of being flattened to the text colour. `display: block`\n removes the gap an inline element leaves under its baseline. */\n .v-icon-svg {\n display: block;\n fill: currentcolor;\n }\n}\n</style>\n"],"mappings":""}
@@ -1,17 +1,20 @@
1
- import { ICON_VIEW_BOX as e } from "./icons/viewBox.js";
2
- import { resolveIcon as t } from "./resolver.js";
3
- import { Fragment as n, computed as r, createBlock as i, createElementBlock as a, createElementVNode as o, defineComponent as s, mergeProps as c, normalizeClass as l, normalizeProps as u, normalizeStyle as d, openBlock as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h } from "vue";
1
+ import { iconName as e } from "./iconProps.js";
2
+ import { ICON_VIEW_BOX as t } from "./icons/viewBox.js";
3
+ import { resolveIcon as n } from "./resolver.js";
4
+ import { px as r } from "../../utils/css.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeProps as f, normalizeStyle as p, openBlock as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v } from "vue";
4
6
  //#region src/components/VIcon/VIcon.vue?vue&type=script&setup=true&lang.ts
5
- var g = [
7
+ var y = [
6
8
  "data-icon",
7
9
  "data-filled",
10
+ "data-mirror",
8
11
  "role",
9
12
  "aria-label",
10
13
  "aria-hidden"
11
- ], _ = ["viewBox"], v = ["d"], y = ["src"], b = ["src"], x = {
14
+ ], b = ["viewBox"], x = ["d"], S = ["src"], C = ["src"], w = {
12
15
  key: 2,
13
16
  class: "v-icon-symbol"
14
- }, S = /*@__PURE__*/ s({
17
+ }, T = /*@__PURE__*/ l({
15
18
  __name: "VIcon",
16
19
  props: {
17
20
  name: { default: void 0 },
@@ -22,11 +25,15 @@ var g = [
22
25
  filled: {
23
26
  type: Boolean,
24
27
  default: !1
28
+ },
29
+ mirrored: {
30
+ type: Boolean,
31
+ default: !1
25
32
  }
26
33
  },
27
- setup(s) {
28
- let S = s;
29
- function C(e) {
34
+ setup(l) {
35
+ let T = l;
36
+ function E(e) {
30
37
  return "path" in e ? {
31
38
  kind: "path",
32
39
  path: e.path,
@@ -47,53 +54,54 @@ var g = [
47
54
  class: e.class
48
55
  };
49
56
  }
50
- let w = r(() => typeof S.name == "string" ? S.name : S.name?.name), T = r(() => {
51
- if (S.render) return C(S.render);
52
- if (S.src !== void 0 || S.name === void 0) return;
53
- let n = t(w.value, { filled: S.filled });
54
- if (n) return C(n);
55
- if (typeof S.name == "string") return;
56
- let { paths: r } = S.name;
57
+ let D = a(() => e(T.name)), O = a(() => {
58
+ if (T.render) return E(T.render);
59
+ if (T.src || T.name === void 0) return;
60
+ let e = n(D.value, { filled: T.filled });
61
+ if (e) return E(e);
62
+ if (typeof T.name == "string") return;
63
+ let { paths: r } = T.name;
57
64
  return {
58
65
  kind: "path",
59
- path: (S.filled ? r[1] : void 0) ?? r[0],
60
- viewBox: e
66
+ path: (T.filled ? r[1] : void 0) ?? r[0],
67
+ viewBox: t
61
68
  };
62
69
  });
63
- return (e, t) => (f(), a("span", {
70
+ return (e, t) => (m(), s("span", {
64
71
  class: "v-icon",
65
- style: d(s.size === void 0 ? void 0 : { "--vectis-icon-size": `${s.size}px` }),
66
- "data-icon": w.value,
67
- "data-filled": s.filled || void 0,
68
- role: s.label ? "img" : void 0,
69
- "aria-label": s.label,
70
- "aria-hidden": s.label ? void 0 : "true"
71
- }, [T.value ? (f(), a(n, { key: 0 }, [T.value.kind === "path" ? (f(), a("svg", {
72
+ style: p(v(r)(l.size) === void 0 ? void 0 : { "--vectis-icon-size": v(r)(l.size) }),
73
+ "data-icon": D.value,
74
+ "data-filled": l.filled || void 0,
75
+ "data-mirror": l.mirrored || void 0,
76
+ role: l.label ? "img" : void 0,
77
+ "aria-label": l.label,
78
+ "aria-hidden": l.label ? void 0 : "true"
79
+ }, [O.value ? (m(), s(i, { key: 0 }, [O.value.kind === "path" ? (m(), s("svg", {
72
80
  key: 0,
73
81
  class: "v-icon-svg",
74
- viewBox: T.value.viewBox,
82
+ viewBox: O.value.viewBox,
75
83
  "aria-hidden": "true",
76
84
  focusable: "false"
77
- }, [o("path", { d: T.value.path }, null, 8, v)], 8, _)) : T.value.kind === "component" ? (f(), i(m(T.value.component), u(c({ key: 1 }, T.value.props)), null, 16)) : T.value.kind === "src" ? (f(), a("img", {
85
+ }, [c("path", { d: O.value.path }, null, 8, x)], 8, b)) : O.value.kind === "component" ? (m(), o(g(O.value.component), f(u({ key: 1 }, O.value.props)), null, 16)) : O.value.kind === "src" ? (m(), s("img", {
78
86
  key: 2,
79
87
  class: "v-icon-img",
80
- src: T.value.src,
88
+ src: O.value.src,
81
89
  alt: ""
82
- }, null, 8, y)) : T.value.kind === "text" ? (f(), a("span", {
90
+ }, null, 8, S)) : O.value.kind === "text" ? (m(), s("span", {
83
91
  key: 3,
84
- class: l(["v-icon-symbol", T.value.class])
85
- }, h(T.value.text), 3)) : (f(), a("span", {
92
+ class: d(["v-icon-symbol", O.value.class])
93
+ }, _(O.value.text), 3)) : (m(), s("span", {
86
94
  key: 4,
87
- class: l(["v-icon-glyph", T.value.class])
88
- }, null, 2))], 64)) : s.src ? (f(), a("img", {
95
+ class: d(["v-icon-glyph", O.value.class])
96
+ }, null, 2))], 64)) : l.src ? (m(), s("img", {
89
97
  key: 1,
90
98
  class: "v-icon-img",
91
- src: s.src,
99
+ src: l.src,
92
100
  alt: ""
93
- }, null, 8, b)) : s.name ? (f(), a("span", x, h(s.name), 1)) : p(e.$slots, "default", {}, void 0, void 0, 3)], 12, g));
101
+ }, null, 8, C)) : l.name ? (m(), s("span", w, _(D.value), 1)) : h(e.$slots, "default", {}, void 0, void 0, 3)], 12, y));
94
102
  }
95
103
  });
96
104
  //#endregion
97
- export { S as default };
105
+ export { T as default };
98
106
 
99
107
  //# sourceMappingURL=VIcon.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VIcon.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VIcon/VIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * An icon, whatever the icons of the host application happen to be made of. The\n * component's real work is deciding WHERE the drawing comes from, and it asks in a\n * fixed order: an explicit render first, then an image address, then the name —\n * which is offered to the consumer's own resolver if one was installed, then to the\n * drawing the icon brought along with it, and finally to a ligature font. A raw SVG\n * can always be passed through the slot instead.\n *\n * That order IS the contract. The resolver is asked before the built-in drawing,\n * otherwise the design system's own icons would stay Material for a consumer who has\n * wired in their own library; and a resolver that answers `undefined` for a name\n * simply hands over to that drawing, which is what makes a PARTIAL mapping usable.\n *\n * It is what allows the design system to work with no icon font at all: the icons\n * the library draws by itself — crosses, chevrons, toast tones — are imported by the\n * components that render them and travel as a name AND its paths, so they depend on\n * nothing being installed, and a consumer downloads only the ones their components\n * actually draw. The ligature remains the fallback for every other name.\n *\n * Despite the `computed`, there is no behavioural JavaScript here: no event, no\n * lifecycle, no DOM. It is a pure choice of source, which the server and the browser\n * make identically.\n */\nimport { computed, type Component } from 'vue'\n\nimport { ICON_VIEW_BOX } from './icons/viewBox'\nimport { resolveIcon } from './resolver'\nimport type { BuiltinIcon, IconRender } from './types'\n\ninterface IconProps {\n /**\n * Which icon to draw. A plain string is a name: it is offered to the consumer's\n * resolver and then left to the icon font as a ligature. One of the design\n * system's own icons, imported from `vectis-ui/icons`, carries its drawing with\n * it — the resolver is still asked first, and the drawing is what answers when\n * nothing else does.\n */\n name?: string | BuiltinIcon\n /**\n * An explicit description of what to draw — an image, a component, a path, a class\n * — which wins over everything else. This is the route every `IconSource` prop of\n * the design system takes when it is given something other than a plain name.\n */\n render?: IconRender\n /** The address of an image to use as the icon. It wins over `name`. */\n src?: string\n /**\n * A size in pixels. Left out, the icon takes the size its context imposes — a\n * button sets one for the icons inside it — and failing that 1em, which makes it\n * follow the surrounding text.\n */\n size?: number\n /**\n * What the icon means, for screen readers. Leaving it out marks the icon as\n * decorative and hides it from them, which is the right thing whenever the\n * surrounding text already says what it says.\n */\n label?: string\n /**\n * Draws the filled version of the icon. The built-in icons honour it wherever\n * filling actually changes the drawing, and the ligature font always does. It\n * means nothing for an image or an inline SVG, whose shape is fixed.\n */\n filled?: boolean\n}\n\nconst props = withDefaults(defineProps<IconProps>(), {\n name: undefined,\n render: undefined,\n src: undefined,\n size: undefined,\n label: undefined,\n filled: false,\n})\n\ndefineSlots<{\n /** An inline SVG, used when neither `src` nor `name` was given. */\n default?(): unknown\n}>()\n\n/**\n * The chosen source, labelled with its kind. The public `IconRender` union carries\n * no such label — the consumer writes it by hand and has nothing to tag it with —\n * but the template needs one thing it can branch on reliably, and applying the tag\n * is also where the documented precedence between the shapes gets decided.\n */\ntype Resolved =\n | { kind: 'path'; path: string; viewBox: string }\n | { kind: 'component'; component: Component; props?: Record<string, unknown> }\n | { kind: 'src'; src: string }\n | { kind: 'text'; text: string; class?: string }\n | { kind: 'class'; class: string }\n\nfunction tag(render: IconRender): Resolved {\n if ('path' in render)\n return { kind: 'path', path: render.path, viewBox: render.viewBox ?? ICON_VIEW_BOX }\n if ('component' in render)\n return { kind: 'component', component: render.component, props: render.props }\n if ('src' in render) return { kind: 'src', src: render.src }\n if ('text' in render) return { kind: 'text', text: render.text, class: render.class }\n return { kind: 'class', class: render.class }\n}\n\n// @fallback — the ladder itself: every rung hands over to the next one, and the\n// ligature is the last resort, reached when neither the resolver nor the registry\n// recognized the name.\n/**\n * Works out what to draw: an explicit `render` if there is one, then the consumer's\n * resolver, then the icons built into the library. Answering `undefined` here is not\n * a failure — it means the template falls through to the image, the ligature or the\n * slot.\n */\n/**\n * The icon's identity: the name the resolver is asked for, and the one `data-icon`\n * records whatever the drawing turned out to come from.\n */\nconst iconName = computed(() => (typeof props.name === 'string' ? props.name : props.name?.name))\n\nconst resolved = computed<Resolved | undefined>(() => {\n if (props.render) return tag(props.render)\n if (props.src !== undefined || props.name === undefined) return undefined\n\n const custom = resolveIcon(iconName.value!, { filled: props.filled })\n if (custom) return tag(custom)\n\n // A bare name has no drawing of its own, so it falls through to the ligature; only\n // one of the library's own icons brings its paths along.\n if (typeof props.name === 'string') return undefined\n\n const { paths } = props.name\n // A second path is only stored when filling actually changes the drawing, so most\n // icons have one path and fall back to it (see icons.ts).\n const path = (props.filled ? paths[1] : undefined) ?? paths[0]\n return { kind: 'path', path, viewBox: ICON_VIEW_BOX }\n})\n</script>\n\n<template>\n <span\n class=\"v-icon\"\n :style=\"size !== undefined ? { '--vectis-icon-size': `${size}px` } : undefined\"\n :data-icon=\"iconName\"\n :data-filled=\"filled || undefined\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n >\n <template v-if=\"resolved\">\n <svg\n v-if=\"resolved.kind === 'path'\"\n class=\"v-icon-svg\"\n :viewBox=\"resolved.viewBox\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path :d=\"resolved.path\" />\n </svg>\n <component\n :is=\"resolved.component\"\n v-else-if=\"resolved.kind === 'component'\"\n v-bind=\"resolved.props\"\n />\n <img v-else-if=\"resolved.kind === 'src'\" class=\"v-icon-img\" :src=\"resolved.src\" alt=\"\" />\n <!-- The interpolation is written flush against the tags: a ligature is matched\n on the exact text, and any surrounding whitespace would break it -->\n <span v-else-if=\"resolved.kind === 'text'\" class=\"v-icon-symbol\" :class=\"resolved.class\">{{\n resolved.text\n }}</span>\n <span v-else class=\"v-icon-glyph\" :class=\"resolved.class\" />\n </template>\n <img v-else-if=\"src\" class=\"v-icon-img\" :src=\"src\" alt=\"\" />\n <span v-else-if=\"name\" class=\"v-icon-symbol\">{{ name }}</span>\n <slot v-else />\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n .v-icon {\n /*\n * How the size is settled, in order of priority:\n * 1. the `size` prop, written inline on the element as --vectis-icon-size — a\n * declaration made on the element itself beats both inheritance and the\n * layer, so it always wins;\n * 2. the variables inherited from an ancestor, which is the context API: a\n * VButton sets them from its own size, and the icons inside follow;\n * 3. 1em, which makes the icon follow the size of the text around it.\n */\n --icon-size: var(--vectis-icon-size, 1em);\n --icon-opsz: var(--vectis-icon-opsz, 24);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n inline-size: var(--icon-size);\n block-size: var(--icon-size);\n /* a ligature is text, so it is the font-size that sizes it */\n font-size: var(--icon-size);\n }\n\n /* When the icon font has not loaded, a ligature shows as its own name in plain\n text. Clipping keeps that text inside the square instead of letting it push the\n layout apart. The rule is scoped to the ONE branch it protects rather than to\n `.v-icon`: a third-party icon font may legitimately draw outside its 1em box,\n and clipping everything would cut those glyphs. */\n .v-icon:has(> .v-icon-symbol) {\n overflow: hidden;\n }\n\n .v-icon-symbol {\n font-family: var(--vectis-font-family-icon);\n font-weight: var(--vectis-font-weight-regular);\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n direction: ltr;\n /* The variable axes of the Material Symbols font. These numbers are the font's\n own technical contract and not design decisions, which is why they are written\n literally here rather than taken from tokens — the same tolerance as the\n opacities. */\n font-variation-settings:\n 'FILL' var(--icon-fill, 0),\n 'wght' 400,\n 'GRAD' 0,\n 'opsz' var(--icon-opsz);\n }\n\n .v-icon[data-filled] .v-icon-symbol {\n --icon-fill: 1;\n }\n\n .v-icon-img,\n .v-icon > svg {\n inline-size: 100%;\n block-size: 100%;\n object-fit: contain;\n }\n\n /* An icon coming from a class-based font, as Font Awesome and Phosphor ship them:\n the glyph is drawn by a `::before`, at the font-size `.v-icon` has set. Because\n the design system renders this element itself rather than accepting the usual\n `<i>`, one rule normalizes it for every such library — `font-style` undoes the\n italics those conventions carry, and `line-height` stops the inherited line box\n from pushing the glyph off centre. */\n .v-icon-glyph {\n display: block;\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n }\n\n /* An SVG drawn from the built-in icons. The fill is set on OUR class and never on\n `.v-icon > svg`, so that a multicoloured SVG handed in through the slot keeps\n its own colours instead of being flattened to the text colour. `display: block`\n removes the gap an inline element leaves under its baseline. */\n .v-icon-svg {\n display: block;\n fill: currentcolor;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEA,IAAM,IAAQ;EA2Bd,SAAS,EAAI,GAA8B;GAOzC,OANI,UAAU,IACL;IAAE,MAAM;IAAQ,MAAM,EAAO;IAAM,SAAS,EAAO,WAAA;GAAyB,IACjF,eAAe,IACV;IAAE,MAAM;IAAa,WAAW,EAAO;IAAW,OAAO,EAAO;GAAM,IAC3E,SAAS,IAAe;IAAE,MAAM;IAAO,KAAK,EAAO;GAAI,IACvD,UAAU,IAAe;IAAE,MAAM;IAAQ,MAAM,EAAO;IAAM,OAAO,EAAO;GAAM,IAC7E;IAAE,MAAM;IAAS,OAAO,EAAO;GAAM;EAC9C;EAeA,IAAM,IAAW,QAAgB,OAAO,EAAM,QAAS,WAAW,EAAM,OAAO,EAAM,MAAM,IAAK,GAE1F,IAAW,QAAqC;GACpD,IAAI,EAAM,QAAQ,OAAO,EAAI,EAAM,MAAM;GACzC,IAAI,EAAM,QAAQ,KAAA,KAAa,EAAM,SAAS,KAAA,GAAW;GAEzD,IAAM,IAAS,EAAY,EAAS,OAAQ,EAAE,QAAQ,EAAM,OAAO,CAAC;GACpE,IAAI,GAAQ,OAAO,EAAI,CAAM;GAI7B,IAAI,OAAO,EAAM,QAAS,UAAU;GAEpC,IAAM,EAAE,aAAU,EAAM;GAIxB,OAAO;IAAE,MAAM;IAAQ,OADT,EAAM,SAAS,EAAM,KAAK,KAAA,MAAc,EAAM;IAC/B,SAAS;GAAc;EACtD,CAAC;yBAIC,EAmCO,QAAA;GAlCL,OAAM;GACL,OAAK,EAAE,EAAA,SAAS,KAAA,IAAoD,KAAA,IAA3C,EAAA,sBAAA,GAA8B,EAAA,KAAI,IAAA,CAAkB;GAC7E,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA;GACvB,MAAM,EAAA,QAAK,QAAW,KAAA;GACtB,cAAY,EAAA;GACZ,eAAa,EAAA,QAAQ,KAAA,IAAS;MAEf,EAAA,SAAA,EAAA,GAAhB,EAsBW,GAAA,EAAA,KAAA,EAAA,GAAA,CApBD,EAAA,MAAS,SAAI,UAAA,EAAA,GADrB,EAQM,OAAA;;GANJ,OAAM;GACL,SAAS,EAAA,MAAS;GACnB,eAAY;GACZ,WAAU;MAEV,EAA2B,QAAA,EAApB,GAAG,EAAA,MAAS,KAAA,GAAA,MAAA,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA,KAIR,EAAA,MAAS,SAAI,eAAA,EAAA,GAF1B,EAIE,EAHK,EAAA,MAAS,SAAS,GAAA,EAAA,EAAA,EAAA,KAAA,EAAA,GAEf,EAAA,MAAS,KAAK,CAAA,GAAA,MAAA,EAAA,KAER,EAAA,MAAS,SAAI,SAAA,EAAA,GAA7B,EAAyF,OAAA;;GAAhD,OAAM;GAAc,KAAK,EAAA,MAAS;GAAK,KAAI;oBAGnE,EAAA,MAAS,SAAI,UAAA,EAAA,GAA9B,EAES,QAAA;;GAFkC,OAAK,EAAA,CAAC,iBAAwB,EAAA,MAAS,KAAK,CAAA;OACrF,EAAA,MAAS,IAAI,GAAA,CAAA,MAAA,EAAA,GAEf,EAA4D,QAAA;;GAA/C,OAAK,EAAA,CAAC,gBAAuB,EAAA,MAAS,KAAK,CAAA;wBAE1C,EAAA,OAAA,EAAA,GAAhB,EAA4D,OAAA;;GAAvC,OAAM;GAAc,KAAK,EAAA;GAAK,KAAI;oBACtC,EAAA,QAAA,EAAA,GAAjB,EAA8D,QAA9D,GAA8D,EAAd,EAAA,IAAI,GAAA,CAAA,KACpD,EAAe,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"VIcon.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VIcon/VIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * An icon, whatever the host application's icons are made of. The real work is deciding\n * WHERE the drawing comes from, asked in a fixed order: `render`, then `src`, then `name` —\n * offered to the consumer's resolver if one was installed, then to the drawing the icon\n * carries, and finally to a ligature font. A raw SVG can always come through the slot.\n *\n * That order IS the contract. The resolver comes before the built-in drawing, or the\n * library's own icons would stay Material for a consumer who wired in their own set; and a\n * resolver returning `undefined` hands over to that drawing, which is what makes a PARTIAL\n * mapping usable.\n *\n * It is what lets the library require no icon font: the icons it draws by default are\n * imported by the components that render them and travel as a name AND its paths, so a\n * consumer downloads only the ones their components actually draw.\n *\n * Despite the `computed`, there is no behavioural JS here — no event, no lifecycle, no DOM.\n * A pure choice of source, made identically on the server and in the browser.\n */\nimport { computed, type Component } from 'vue'\n\nimport { iconName as nameOf } from './iconProps'\nimport { ICON_VIEW_BOX } from './icons/viewBox'\nimport { resolveIcon } from './resolver'\nimport type { BuiltinIcon, IconRender } from './types'\n\nimport { px } from '../../utils/css'\n\ninterface IconProps {\n /**\n * Which icon to draw. A plain string is a name: it is offered to the consumer's\n * resolver and then left to the icon font as a ligature. One of the design\n * system's own icons, imported from `vectis-ui/icons`, carries its drawing with\n * it — the resolver is still asked first, and the drawing is what answers when\n * nothing else does.\n */\n name?: string | BuiltinIcon\n /**\n * An explicit description of what to draw — an image, a component, a path, a class\n * — which wins over everything else. This is the route every `IconSource` prop of\n * the design system takes when it is given something other than a plain name.\n */\n render?: IconRender\n /** The address of an image to use as the icon. It wins over `name`. */\n src?: string\n /**\n * A size in pixels, as a number or a numeric string. Left out, or given something that\n * is not a number, the icon takes the size its context imposes — a button sets one for\n * the icons inside it — and failing that 1em, which makes it follow the surrounding\n * text.\n */\n size?: number | string\n /**\n * What the icon means, for screen readers. Leaving it out marks the icon as\n * decorative and hides it from them, which is the right thing whenever the\n * surrounding text already says what it says.\n */\n label?: string\n /**\n * Draws the filled version of the icon. The built-in icons honour it wherever\n * filling actually changes the drawing, and the ligature font always does. It\n * means nothing for an image or an inline SVG, whose shape is fixed.\n */\n filled?: boolean\n /**\n * Flips the icon horizontally in a right-to-left context, for a glyph that points\n * at a physical direction: a \"previous\" chevron points left in English and right in\n * Arabic. Off by default, since most icons mean the same thing in both directions.\n * The direction is the one the browser computed, so an ancestor's `dir` is enough.\n */\n mirrored?: boolean\n}\n\nconst props = withDefaults(defineProps<IconProps>(), {\n name: undefined,\n render: undefined,\n src: undefined,\n size: undefined,\n label: undefined,\n filled: false,\n mirrored: false,\n})\n\ndefineSlots<{\n /** An inline SVG, used when neither `src` nor `name` was given. */\n default?(): unknown\n}>()\n\n/**\n * The chosen source, labelled with its kind. The public `IconRender` union carries\n * no such label — the consumer writes it by hand and has nothing to tag it with —\n * but the template needs one thing it can branch on reliably, and applying the tag\n * is also where the documented precedence between the shapes gets decided.\n */\ntype Resolved =\n | { kind: 'path'; path: string; viewBox: string }\n | { kind: 'component'; component: Component; props?: Record<string, unknown> }\n | { kind: 'src'; src: string }\n | { kind: 'text'; text: string; class?: string }\n | { kind: 'class'; class: string }\n\nfunction tag(render: IconRender): Resolved {\n if ('path' in render)\n return { kind: 'path', path: render.path, viewBox: render.viewBox ?? ICON_VIEW_BOX }\n if ('component' in render)\n return { kind: 'component', component: render.component, props: render.props }\n if ('src' in render) return { kind: 'src', src: render.src }\n if ('text' in render) return { kind: 'text', text: render.text, class: render.class }\n return { kind: 'class', class: render.class }\n}\n\n/**\n * The icon's identity: the name the resolver is asked for, and the one `data-icon`\n * records whatever the drawing turned out to come from.\n */\nconst iconName = computed(() => nameOf(props.name))\n\n// @fallback — the ladder itself: every rung hands over to the next one, and the\n// ligature is the last resort, reached when neither the resolver nor the registry\n// recognized the name.\n/**\n * Works out what to draw: an explicit `render` if there is one, then the consumer's\n * resolver, then the icons built into the library. Answering `undefined` here is not\n * a failure — it means the template falls through to the image, the ligature or the\n * slot.\n */\nconst resolved = computed<Resolved | undefined>(() => {\n if (props.render) return tag(props.render)\n // TRUTHINESS on `src`, the test the template renders the image with: an empty `src=\"\"`\n // renders no image, so it must not stop the name from being drawn either.\n if (props.src || props.name === undefined) return undefined\n\n const custom = resolveIcon(iconName.value!, { filled: props.filled })\n if (custom) return tag(custom)\n\n // A bare name has no drawing of its own, so it falls through to the ligature; only\n // one of the library's own icons brings its paths along.\n if (typeof props.name === 'string') return undefined\n\n const { paths } = props.name\n // A second path is only stored when filling actually changes the drawing, so most\n // icons have one path and fall back to it (see icons.ts).\n const path = (props.filled ? paths[1] : undefined) ?? paths[0]\n return { kind: 'path', path, viewBox: ICON_VIEW_BOX }\n})\n</script>\n\n<template>\n <span\n class=\"v-icon\"\n :style=\"px(size) !== undefined ? { '--vectis-icon-size': px(size) } : undefined\"\n :data-icon=\"iconName\"\n :data-filled=\"filled || undefined\"\n :data-mirror=\"mirrored || undefined\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n >\n <template v-if=\"resolved\">\n <svg\n v-if=\"resolved.kind === 'path'\"\n class=\"v-icon-svg\"\n :viewBox=\"resolved.viewBox\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path :d=\"resolved.path\" />\n </svg>\n <component\n :is=\"resolved.component\"\n v-else-if=\"resolved.kind === 'component'\"\n v-bind=\"resolved.props\"\n />\n <img v-else-if=\"resolved.kind === 'src'\" class=\"v-icon-img\" :src=\"resolved.src\" alt=\"\" />\n <!-- The interpolation is written flush against the tags: a ligature is matched\n on the exact text, and any surrounding whitespace would break it -->\n <span v-else-if=\"resolved.kind === 'text'\" class=\"v-icon-symbol\" :class=\"resolved.class\">{{\n resolved.text\n }}</span>\n <span v-else class=\"v-icon-glyph\" :class=\"resolved.class\" />\n </template>\n <img v-else-if=\"src\" class=\"v-icon-img\" :src=\"src\" alt=\"\" />\n <span v-else-if=\"name\" class=\"v-icon-symbol\">{{ iconName }}</span>\n <slot v-else />\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n .v-icon {\n /*\n * How the size is settled, in order of priority:\n * 1. the `size` prop, written inline on the element as --vectis-icon-size — a\n * declaration made on the element itself beats both inheritance and the\n * layer, so it always wins;\n * 2. the variables inherited from an ancestor, which is the context API: a\n * VButton sets them from its own size, and the icons inside follow;\n * 3. 1em, which makes the icon follow the size of the text around it.\n */\n --icon-size: var(--vectis-icon-size, 1em);\n --icon-opsz: var(--vectis-icon-opsz, 24);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n inline-size: var(--icon-size);\n block-size: var(--icon-size);\n /* a ligature is text, so it is the font-size that sizes it */\n font-size: var(--icon-size);\n }\n\n /* When the icon font has not loaded, a ligature shows as its own name in plain\n text. Clipping keeps that text inside the square instead of letting it push the\n layout apart. The rule is scoped to the ONE branch it protects rather than to\n `.v-icon`: a third-party icon font may legitimately draw outside its 1em box,\n and clipping everything would cut those glyphs. */\n .v-icon:has(> .v-icon-symbol) {\n overflow: hidden;\n }\n\n .v-icon-symbol {\n font-family: var(--vectis-font-family-icon);\n font-weight: var(--vectis-font-weight-regular);\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n direction: ltr;\n /* The variable axes of the Material Symbols font. These numbers are the font's\n own technical contract and not design decisions, which is why they are written\n literally here rather than taken from tokens — the same tolerance as the\n opacities. */\n font-variation-settings:\n 'FILL' var(--icon-fill, 0),\n 'wght' 400,\n 'GRAD' 0,\n 'opsz' var(--icon-opsz);\n }\n\n .v-icon[data-filled] .v-icon-symbol {\n --icon-fill: 1;\n }\n\n /* `:dir()` reads the direction the browser computed rather than an attribute spelled on\n an ancestor, and `scale` is the individual property, so it composes with a rotation\n a consumer applies (a disclosure chevron) instead of replacing its transform. */\n .v-icon[data-mirror]:dir(rtl) {\n scale: -1 1;\n }\n\n .v-icon-img,\n .v-icon > svg {\n inline-size: 100%;\n block-size: 100%;\n object-fit: contain;\n }\n\n /* An icon coming from a class-based font, as Font Awesome and Phosphor ship them:\n the glyph is drawn by a `::before`, at the font-size `.v-icon` has set. Because\n the design system renders this element itself rather than accepting the usual\n `<i>`, one rule normalizes it for every such library — `font-style` undoes the\n italics those conventions carry, and `line-height` stops the inherited line box\n from pushing the glyph off centre. */\n .v-icon-glyph {\n display: block;\n font-style: normal;\n line-height: var(--vectis-font-leading-none);\n }\n\n /* An SVG drawn from the built-in icons. The fill is set on OUR class and never on\n `.v-icon > svg`, so that a multicoloured SVG handed in through the slot keeps\n its own colours instead of being flattened to the text colour. `display: block`\n removes the gap an inline element leaves under its baseline. */\n .v-icon-svg {\n display: block;\n fill: currentcolor;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EA,IAAM,IAAQ;EA4Bd,SAAS,EAAI,GAA8B;GAOzC,OANI,UAAU,IACL;IAAE,MAAM;IAAQ,MAAM,EAAO;IAAM,SAAS,EAAO,WAAA;GAAyB,IACjF,eAAe,IACV;IAAE,MAAM;IAAa,WAAW,EAAO;IAAW,OAAO,EAAO;GAAM,IAC3E,SAAS,IAAe;IAAE,MAAM;IAAO,KAAK,EAAO;GAAI,IACvD,UAAU,IAAe;IAAE,MAAM;IAAQ,MAAM,EAAO;IAAM,OAAO,EAAO;GAAM,IAC7E;IAAE,MAAM;IAAS,OAAO,EAAO;GAAM;EAC9C;EAMA,IAAM,IAAW,QAAe,EAAO,EAAM,IAAI,CAAC,GAW5C,IAAW,QAAqC;GACpD,IAAI,EAAM,QAAQ,OAAO,EAAI,EAAM,MAAM;GAGzC,IAAI,EAAM,OAAO,EAAM,SAAS,KAAA,GAAW;GAE3C,IAAM,IAAS,EAAY,EAAS,OAAQ,EAAE,QAAQ,EAAM,OAAO,CAAC;GACpE,IAAI,GAAQ,OAAO,EAAI,CAAM;GAI7B,IAAI,OAAO,EAAM,QAAS,UAAU;GAEpC,IAAM,EAAE,aAAU,EAAM;GAIxB,OAAO;IAAE,MAAM;IAAQ,OADT,EAAM,SAAS,EAAM,KAAK,KAAA,MAAc,EAAM;IAC/B,SAAS;GAAc;EACtD,CAAC;yBAIC,EAoCO,QAAA;GAnCL,OAAM;GACL,OAAK,EAAE,EAAA,CAAA,CAAE,CAAC,EAAA,IAAI,MAAM,KAAA,IAAiD,KAAA,IAAxC,EAAA,sBAA2B,EAAA,CAAA,CAAE,CAAC,EAAA,IAAI,EAAA,CAAe;GAC9E,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA;GACvB,eAAa,EAAA,YAAY,KAAA;GACzB,MAAM,EAAA,QAAK,QAAW,KAAA;GACtB,cAAY,EAAA;GACZ,eAAa,EAAA,QAAQ,KAAA,IAAS;MAEf,EAAA,SAAA,EAAA,GAAhB,EAsBW,GAAA,EAAA,KAAA,EAAA,GAAA,CApBD,EAAA,MAAS,SAAI,UAAA,EAAA,GADrB,EAQM,OAAA;;GANJ,OAAM;GACL,SAAS,EAAA,MAAS;GACnB,eAAY;GACZ,WAAU;MAEV,EAA2B,QAAA,EAApB,GAAG,EAAA,MAAS,KAAA,GAAA,MAAA,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA,KAIR,EAAA,MAAS,SAAI,eAAA,EAAA,GAF1B,EAIE,EAHK,EAAA,MAAS,SAAS,GAAA,EAAA,EAAA,EAAA,KAAA,EAAA,GAEf,EAAA,MAAS,KAAK,CAAA,GAAA,MAAA,EAAA,KAER,EAAA,MAAS,SAAI,SAAA,EAAA,GAA7B,EAAyF,OAAA;;GAAhD,OAAM;GAAc,KAAK,EAAA,MAAS;GAAK,KAAI;oBAGnE,EAAA,MAAS,SAAI,UAAA,EAAA,GAA9B,EAES,QAAA;;GAFkC,OAAK,EAAA,CAAC,iBAAwB,EAAA,MAAS,KAAK,CAAA;OACrF,EAAA,MAAS,IAAI,GAAA,CAAA,MAAA,EAAA,GAEf,EAA4D,QAAA;;GAA/C,OAAK,EAAA,CAAC,gBAAuB,EAAA,MAAS,KAAK,CAAA;wBAE1C,EAAA,OAAA,EAAA,GAAhB,EAA4D,OAAA;;GAAvC,OAAM;GAAc,KAAK,EAAA;GAAK,KAAI;oBACtC,EAAA,QAAA,EAAA,GAAjB,EAAkE,QAAlE,GAAkE,EAAlB,EAAA,KAAQ,GAAA,CAAA,KACxD,EAAe,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"iconProps.js","names":[],"sources":["../../../src/components/VIcon/iconProps.ts"],"sourcesContent":["import type { BuiltinIcon, IconRender, IconSource } from './types'\n\n/**\n * Tells one of the library's own icons from something the consumer described by\n * hand. Only a `BuiltinIcon` carries `paths`, and the distinction matters: it is\n * what routes a built-in default to `name` — where the resolver still gets first\n * refusal — instead of to `render`, which wins outright and would silence it.\n */\nconst isBuiltinIcon = (icon: BuiltinIcon | IconRender): icon is BuiltinIcon => 'paths' in icon\n\n/**\n * Turns what a consumer wrote in an icon prop into the props VIcon expects. It is\n * what every component of the design system calls before rendering an icon it was\n * given.\n *\n * There is NO guesswork in the conversion: a plain string is ALWAYS a name, and an\n * image or a component is declared explicitly as an object, `{ src: '/logo.svg' }`.\n * That is what keeps the usual naming conventions — `mdi:close`, `fa6-solid:xmark` —\n * reaching the resolver intact rather than being mistaken for addresses.\n */\nexport const iconProps = (icon: IconSource) =>\n typeof icon === 'string' || isBuiltinIcon(icon) ? { name: icon } : { render: icon }\n\n/**\n * A readable name for an icon, used as a last-resort accessible label when the\n * consumer supplied none.\n *\n * It answers `undefined` as soon as the icon was DESCRIBED rather than named — an\n * image, a component, a class — because such a description has no name to give and\n * an `[object Object]` read out by a screen reader would be worse than silence.\n * `useIconClickHandlers` is what warns the integrator when that happens on a control\n * that needs a name. One of the library's own icons does carry its name, so it\n * answers here exactly as the bare string used to.\n */\nexport const iconName = (icon: IconSource | undefined) =>\n typeof icon === 'string' ? icon : icon && isBuiltinIcon(icon) ? icon.name : undefined\n"],"mappings":";AAQA,IAAM,KAAiB,MAAwD,WAAW,GAY7E,KAAa,MACxB,OAAO,KAAS,YAAY,EAAc,CAAI,IAAI,EAAE,MAAM,EAAK,IAAI,EAAE,QAAQ,EAAK,GAavE,KAAY,MACvB,OAAO,KAAS,WAAW,IAAO,KAAQ,EAAc,CAAI,IAAI,EAAK,OAAO,KAAA"}
1
+ {"version":3,"file":"iconProps.js","names":[],"sources":["../../../src/components/VIcon/iconProps.ts"],"sourcesContent":["/**\n * Tells one of the library's own icons from something the consumer described by\n * hand. Only a `BuiltinIcon` carries `paths`, and the distinction matters: it is\n * what routes a built-in default to `name` — where the resolver still gets first\n * refusal — instead of to `render`, which wins outright and would silence it.\n */\n\nimport type { BuiltinIcon, IconRender, IconSource } from './types'\n\nconst isBuiltinIcon = (icon: BuiltinIcon | IconRender): icon is BuiltinIcon => 'paths' in icon\n\n/**\n * Turns what a consumer wrote in an icon prop into the props VIcon expects. It is\n * what every component of the design system calls before rendering an icon it was\n * given.\n *\n * There is NO guesswork in the conversion: a plain string is ALWAYS a name, and an\n * image or a component is declared explicitly as an object, `{ src: '/logo.svg' }`.\n * That is what keeps the usual naming conventions — `mdi:close`, `fa6-solid:xmark` —\n * reaching the resolver intact rather than being mistaken for addresses.\n */\nexport const iconProps = (icon: IconSource) =>\n typeof icon === 'string' || isBuiltinIcon(icon) ? { name: icon } : { render: icon }\n\n/**\n * A readable name for an icon, used as a last-resort accessible label when the\n * consumer supplied none.\n *\n * It answers `undefined` as soon as the icon was DESCRIBED rather than named — an\n * image, a component, a class — because such a description has no name to give and\n * an `[object Object]` read out by a screen reader would be worse than silence.\n * `useIconClickHandlers` is what warns the integrator when that happens on a control\n * that needs a name. One of the library's own icons does carry its name, so it\n * answers here exactly as the bare string used to.\n */\nexport const iconName = (icon: IconSource | undefined) =>\n typeof icon === 'string' ? icon : icon && isBuiltinIcon(icon) ? icon.name : undefined\n"],"mappings":";AASA,IAAM,KAAiB,MAAwD,WAAW,GAY7E,KAAa,MACxB,OAAO,KAAS,YAAY,EAAc,CAAI,IAAI,EAAE,MAAM,EAAK,IAAI,EAAE,QAAQ,EAAK,GAavE,KAAY,MACvB,OAAO,KAAS,WAAW,IAAO,KAAQ,EAAc,CAAI,IAAI,EAAK,OAAO,KAAA"}
@@ -33,7 +33,7 @@ import { table_chart } from './table_chart.js';
33
33
  import { video_file } from './video_file.js';
34
34
  import { warning } from './warning.js';
35
35
  export { ICON_VIEW_BOX } from './viewBox.js';
36
- export { builtinIconNames, type VectisIconName } from './names.js';
36
+ export { builtinIconNames, type IconName } from './names.js';
37
37
  export { arrow_downward, arrow_downward_alt, arrow_drop_down, arrow_drop_up, arrow_left_alt, arrow_right_alt, arrow_upward, arrow_upward_alt, attach_file, audio_file, calendar_today, check, check_circle, chevron_left, chevron_right, close, cloud_upload, code, description, error, expand_less, expand_more, folder_zip, image, info, more_horiz, notifications, picture_as_pdf, schedule, search, swap_vert, table_chart, video_file, warning, };
38
38
  /**
39
39
  * Every icon at once, for the places that legitimately want the whole set: the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/VIcon/icons/index.ts"],"sourcesContent":["/*\n * GENERATED FILE — do not edit by hand.\n * Regenerate: pnpm icons · Source: scripts/build-icons.ts\n *\n * Material Symbols Rounded (wght 400 · GRAD 0 · opsz 24)\n * google/material-design-icons @ 528cb964c01fb2b09bc3b9208f82b6d8f8c1c1e2\n * Apache-2.0 licence © Google.\n */\nimport { arrow_downward } from './arrow_downward'\nimport { arrow_downward_alt } from './arrow_downward_alt'\nimport { arrow_drop_down } from './arrow_drop_down'\nimport { arrow_drop_up } from './arrow_drop_up'\nimport { arrow_left_alt } from './arrow_left_alt'\nimport { arrow_right_alt } from './arrow_right_alt'\nimport { arrow_upward } from './arrow_upward'\nimport { arrow_upward_alt } from './arrow_upward_alt'\nimport { attach_file } from './attach_file'\nimport { audio_file } from './audio_file'\nimport { calendar_today } from './calendar_today'\nimport { check } from './check'\nimport { check_circle } from './check_circle'\nimport { chevron_left } from './chevron_left'\nimport { chevron_right } from './chevron_right'\nimport { close } from './close'\nimport { cloud_upload } from './cloud_upload'\nimport { code } from './code'\nimport { description } from './description'\nimport { error } from './error'\nimport { expand_less } from './expand_less'\nimport { expand_more } from './expand_more'\nimport { folder_zip } from './folder_zip'\nimport { image } from './image'\nimport { info } from './info'\nimport { more_horiz } from './more_horiz'\nimport { notifications } from './notifications'\nimport { picture_as_pdf } from './picture_as_pdf'\nimport { schedule } from './schedule'\nimport { search } from './search'\nimport { swap_vert } from './swap_vert'\nimport { table_chart } from './table_chart'\nimport { video_file } from './video_file'\nimport { warning } from './warning'\n\nexport { ICON_VIEW_BOX } from './viewBox'\nexport { builtinIconNames, type VectisIconName } from './names'\nexport {\n arrow_downward,\n arrow_downward_alt,\n arrow_drop_down,\n arrow_drop_up,\n arrow_left_alt,\n arrow_right_alt,\n arrow_upward,\n arrow_upward_alt,\n attach_file,\n audio_file,\n calendar_today,\n check,\n check_circle,\n chevron_left,\n chevron_right,\n close,\n cloud_upload,\n code,\n description,\n error,\n expand_less,\n expand_more,\n folder_zip,\n image,\n info,\n more_horiz,\n notifications,\n picture_as_pdf,\n schedule,\n search,\n swap_vert,\n table_chart,\n video_file,\n warning,\n}\n\n/**\n * Every icon at once, for the places that legitimately want the whole set: the\n * gallery in the stories, the documentation site, the tests.\n *\n * NOTHING the library ships imports this barrel — a component imports the two or\n * three icon modules it draws, by name. Importing it from a component would pull all\n * 34 drawings back into every consumer's bundle and undo the split.\n */\nexport const builtinIcons = {\n arrow_downward,\n arrow_downward_alt,\n arrow_drop_down,\n arrow_drop_up,\n arrow_left_alt,\n arrow_right_alt,\n arrow_upward,\n arrow_upward_alt,\n attach_file,\n audio_file,\n calendar_today,\n check,\n check_circle,\n chevron_left,\n chevron_right,\n close,\n cloud_upload,\n code,\n description,\n error,\n expand_less,\n expand_more,\n folder_zip,\n image,\n info,\n more_horiz,\n notifications,\n picture_as_pdf,\n schedule,\n search,\n swap_vert,\n table_chart,\n video_file,\n warning,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,IAAa,IAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/VIcon/icons/index.ts"],"sourcesContent":["/*\n * GENERATED FILE — do not edit by hand.\n * Regenerate: pnpm icons · Source: scripts/build-icons.ts\n *\n * Material Symbols Rounded (wght 400 · GRAD 0 · opsz 24)\n * google/material-design-icons @ 528cb964c01fb2b09bc3b9208f82b6d8f8c1c1e2\n * Apache-2.0 licence © Google.\n */\nimport { arrow_downward } from './arrow_downward'\nimport { arrow_downward_alt } from './arrow_downward_alt'\nimport { arrow_drop_down } from './arrow_drop_down'\nimport { arrow_drop_up } from './arrow_drop_up'\nimport { arrow_left_alt } from './arrow_left_alt'\nimport { arrow_right_alt } from './arrow_right_alt'\nimport { arrow_upward } from './arrow_upward'\nimport { arrow_upward_alt } from './arrow_upward_alt'\nimport { attach_file } from './attach_file'\nimport { audio_file } from './audio_file'\nimport { calendar_today } from './calendar_today'\nimport { check } from './check'\nimport { check_circle } from './check_circle'\nimport { chevron_left } from './chevron_left'\nimport { chevron_right } from './chevron_right'\nimport { close } from './close'\nimport { cloud_upload } from './cloud_upload'\nimport { code } from './code'\nimport { description } from './description'\nimport { error } from './error'\nimport { expand_less } from './expand_less'\nimport { expand_more } from './expand_more'\nimport { folder_zip } from './folder_zip'\nimport { image } from './image'\nimport { info } from './info'\nimport { more_horiz } from './more_horiz'\nimport { notifications } from './notifications'\nimport { picture_as_pdf } from './picture_as_pdf'\nimport { schedule } from './schedule'\nimport { search } from './search'\nimport { swap_vert } from './swap_vert'\nimport { table_chart } from './table_chart'\nimport { video_file } from './video_file'\nimport { warning } from './warning'\n\nexport { ICON_VIEW_BOX } from './viewBox'\nexport { builtinIconNames, type IconName } from './names'\nexport {\n arrow_downward,\n arrow_downward_alt,\n arrow_drop_down,\n arrow_drop_up,\n arrow_left_alt,\n arrow_right_alt,\n arrow_upward,\n arrow_upward_alt,\n attach_file,\n audio_file,\n calendar_today,\n check,\n check_circle,\n chevron_left,\n chevron_right,\n close,\n cloud_upload,\n code,\n description,\n error,\n expand_less,\n expand_more,\n folder_zip,\n image,\n info,\n more_horiz,\n notifications,\n picture_as_pdf,\n schedule,\n search,\n swap_vert,\n table_chart,\n video_file,\n warning,\n}\n\n/**\n * Every icon at once, for the places that legitimately want the whole set: the\n * gallery in the stories, the documentation site, the tests.\n *\n * NOTHING the library ships imports this barrel — a component imports the two or\n * three icon modules it draws, by name. Importing it from a component would pull all\n * 34 drawings back into every consumer's bundle and undo the split.\n */\nexport const builtinIcons = {\n arrow_downward,\n arrow_downward_alt,\n arrow_drop_down,\n arrow_drop_up,\n arrow_left_alt,\n arrow_right_alt,\n arrow_upward,\n arrow_upward_alt,\n attach_file,\n audio_file,\n calendar_today,\n check,\n check_circle,\n chevron_left,\n chevron_right,\n close,\n cloud_upload,\n code,\n description,\n error,\n expand_less,\n expand_more,\n folder_zip,\n image,\n info,\n more_horiz,\n notifications,\n picture_as_pdf,\n schedule,\n search,\n swap_vert,\n table_chart,\n video_file,\n warning,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,IAAa,IAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -1,6 +1,6 @@
1
1
  declare const NAMES: readonly ["arrow_downward", "arrow_downward_alt", "arrow_drop_down", "arrow_drop_up", "arrow_left_alt", "arrow_right_alt", "arrow_upward", "arrow_upward_alt", "attach_file", "audio_file", "calendar_today", "check", "check_circle", "chevron_left", "chevron_right", "close", "cloud_upload", "code", "description", "error", "expand_less", "expand_more", "folder_zip", "image", "info", "more_horiz", "notifications", "picture_as_pdf", "schedule", "search", "swap_vert", "table_chart", "video_file", "warning"];
2
2
  /** The icon names the DS renders itself — the contract of a consumer resolver. */
3
- export type VectisIconName = (typeof NAMES)[number];
3
+ export type IconName = (typeof NAMES)[number];
4
4
  /**
5
5
  * The names alone, carrying no drawing at all. `classIconResolver` in `strict` mode
6
6
  * asks nothing more than "does the design system ship this name?", and a module of
@@ -1 +1 @@
1
- {"version":3,"file":"names.js","names":[],"sources":["../../../../src/components/VIcon/icons/names.ts"],"sourcesContent":["/*\n * GENERATED FILE — do not edit by hand.\n * Regenerate: pnpm icons · Source: scripts/build-icons.ts\n *\n * Material Symbols Rounded (wght 400 · GRAD 0 · opsz 24)\n * google/material-design-icons @ 528cb964c01fb2b09bc3b9208f82b6d8f8c1c1e2\n * Apache-2.0 licence © Google.\n */\n\nconst NAMES = [\n 'arrow_downward',\n 'arrow_downward_alt',\n 'arrow_drop_down',\n 'arrow_drop_up',\n 'arrow_left_alt',\n 'arrow_right_alt',\n 'arrow_upward',\n 'arrow_upward_alt',\n 'attach_file',\n 'audio_file',\n 'calendar_today',\n 'check',\n 'check_circle',\n 'chevron_left',\n 'chevron_right',\n 'close',\n 'cloud_upload',\n 'code',\n 'description',\n 'error',\n 'expand_less',\n 'expand_more',\n 'folder_zip',\n 'image',\n 'info',\n 'more_horiz',\n 'notifications',\n 'picture_as_pdf',\n 'schedule',\n 'search',\n 'swap_vert',\n 'table_chart',\n 'video_file',\n 'warning',\n] as const\n\n/** The icon names the DS renders itself — the contract of a consumer resolver. */\nexport type VectisIconName = (typeof NAMES)[number]\n\n/**\n * The names alone, carrying no drawing at all. `classIconResolver` in `strict` mode\n * asks nothing more than \"does the design system ship this name?\", and a module of\n * its own is what stops a consumer who wired in their OWN icon library from\n * downloading 34 Material paths to answer that one question.\n */\nexport const builtinIconNames: ReadonlySet<string> = /* @__PURE__ */ new Set(NAMES)\n"],"mappings":"AAuDA,IAAa,oBAAwD,IAAI,IAAI,gBA9C/D,qZA8C+D,CAAK"}
1
+ {"version":3,"file":"names.js","names":[],"sources":["../../../../src/components/VIcon/icons/names.ts"],"sourcesContent":["/*\n * GENERATED FILE — do not edit by hand.\n * Regenerate: pnpm icons · Source: scripts/build-icons.ts\n *\n * Material Symbols Rounded (wght 400 · GRAD 0 · opsz 24)\n * google/material-design-icons @ 528cb964c01fb2b09bc3b9208f82b6d8f8c1c1e2\n * Apache-2.0 licence © Google.\n */\n\nconst NAMES = [\n 'arrow_downward',\n 'arrow_downward_alt',\n 'arrow_drop_down',\n 'arrow_drop_up',\n 'arrow_left_alt',\n 'arrow_right_alt',\n 'arrow_upward',\n 'arrow_upward_alt',\n 'attach_file',\n 'audio_file',\n 'calendar_today',\n 'check',\n 'check_circle',\n 'chevron_left',\n 'chevron_right',\n 'close',\n 'cloud_upload',\n 'code',\n 'description',\n 'error',\n 'expand_less',\n 'expand_more',\n 'folder_zip',\n 'image',\n 'info',\n 'more_horiz',\n 'notifications',\n 'picture_as_pdf',\n 'schedule',\n 'search',\n 'swap_vert',\n 'table_chart',\n 'video_file',\n 'warning',\n] as const\n\n/** The icon names the DS renders itself — the contract of a consumer resolver. */\nexport type IconName = (typeof NAMES)[number]\n\n/**\n * The names alone, carrying no drawing at all. `classIconResolver` in `strict` mode\n * asks nothing more than \"does the design system ship this name?\", and a module of\n * its own is what stops a consumer who wired in their OWN icon library from\n * downloading 34 Material paths to answer that one question.\n */\nexport const builtinIconNames: ReadonlySet<string> = /* @__PURE__ */ new Set(NAMES)\n"],"mappings":"AAuDA,IAAa,oBAAwD,IAAI,IAAI,gBA9C/D,qZA8C+D,CAAK"}
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'vue';
2
- import { VectisIconName } from './icons/names.js';
2
+ import { IconName } from './icons/names.js';
3
3
  import { IconContext, IconRender } from './types.js';
4
4
  /**
5
5
  * Turns an icon name into a description of what to draw. Answering `undefined` means
@@ -14,7 +14,7 @@ export type IconResolver = (name: string, ctx: IconContext) => IconRender | unde
14
14
  * names the library ships with, and any other key is accepted too, so your
15
15
  * application's own icons can be aliased through the same table.
16
16
  */
17
- export type IconAliases = Partial<Record<VectisIconName, string>> & Record<string, string>;
17
+ export type IconAliases = Partial<Record<IconName, string>> & Record<string, string>;
18
18
  /**
19
19
  * Installs the resolver every VIcon will consult, or removes it when passed
20
20
  * `undefined`.
@@ -71,6 +71,6 @@ export declare function classIconResolver(options: {
71
71
  * because that is the element the stylesheet sizes.
72
72
  */
73
73
  export declare function componentIconResolver(options: {
74
- components: Partial<Record<VectisIconName, Component>> & Record<string, Component>;
74
+ components: Partial<Record<IconName, Component>> & Record<string, Component>;
75
75
  props?: (name: string, filled: boolean) => Record<string, unknown>;
76
76
  }): IconResolver;
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.js","names":[],"sources":["../../../src/components/VIcon/resolver.ts"],"sourcesContent":["// @ssr @core — module-level state, to be set at module level and never\n// client-only: a resolver installed after hydration is a mismatch.\n/**\n * The way to plug a third-party icon library into the design system. A resolver is a\n * function turning a name into something to draw, and it is consulted BEFORE the\n * icons built into the library — which is what lets a consumer move ALL of them onto\n * their own icon set rather than ending up with two styles side by side.\n *\n * The resolver is held in module-level state rather than provided through a Vue\n * plugin, because it is configuration: identical for every request a process\n * handles, and settable from any `.ts` file — a Nuxt plugin, `main.ts` — without a\n * component being involved.\n */\nimport { shallowRef, type Component } from 'vue'\n\nimport { builtinIconNames, type VectisIconName } from './icons/names'\nimport type { IconContext, IconRender } from './types'\n\n/**\n * Turns an icon name into a description of what to draw. Answering `undefined` means\n * \"I do not know this name\", and not \"draw nothing\": VIcon then falls back to the\n * built-in icons, and after that to the ligature font. That distinction is what\n * makes a PARTIAL mapping usable — map the five names you care about and let the\n * rest be.\n */\nexport type IconResolver = (name: string, ctx: IconContext) => IconRender | undefined\n\n/**\n * A table mapping the design system's icon names to your own. The IDE suggests the\n * names the library ships with, and any other key is accepted too, so your\n * application's own icons can be aliased through the same table.\n */\nexport type IconAliases = Partial<Record<VectisIconName, string>> & Record<string, string>\n\nconst resolver = shallowRef<IconResolver | undefined>(undefined)\n\n/**\n * Installs the resolver every VIcon will consult, or removes it when passed\n * `undefined`.\n *\n * Call it at MODULE level — from a Nuxt plugin or from `main.ts` — and never inside\n * a component's `setup()`. Two traps follow from where the state lives. On a server\n * it belongs to the process rather than to a request, which is right for\n * configuration and wrong for anything varying per visitor. And installing it on the\n * client only, from a `plugins/*.client.ts`, makes the browser draw different icons\n * from the ones the server sent, which is a hydration mismatch.\n */\nexport function setIconResolver(next: IconResolver | undefined): void {\n resolver.value = next\n}\n\n/** Asks the installed resolver, if there is one. Internal to VIcon, not public API. */\nexport function resolveIcon(name: string, ctx: IconContext): IconRender | undefined {\n return resolver.value?.(name, ctx)\n}\n\n/**\n * A resolver for a LIGATURE font — Material Symbols in any of its variants, or an\n * IcoMoon build made that way. It answers to every name, since the font itself\n * decides what it recognizes.\n *\n * Installing it is also how to have the design system's own icons drawn by the font\n * instead of by the SVGs shipped with the library, and therefore how to get the\n * optical size axis back: those SVGs are drawn at one optical size and cannot follow\n * `--vectis-icon-opsz`.\n */\nexport function ligatureIconResolver(options: { aliases?: IconAliases } = {}): IconResolver {\n const { aliases } = options\n return (name) => ({ text: aliases?.[name] ?? name })\n}\n\n/**\n * A resolver for a font driven by a CLASS and a pseudo-element: Font Awesome,\n * Phosphor, Bootstrap Icons and their kind.\n *\n * `strict`, which is the default, protects the design system's own icons. One of its\n * names that is NOT in your alias table would otherwise be turned into a class the\n * font does not define, and the icon would render as an empty square; refusing to\n * answer instead lets it fall back to the SVG shipped with the library. Names of\n * your own always pass, since they are already written in your vocabulary.\n */\nexport function classIconResolver(options: {\n aliases?: IconAliases\n /**\n * Builds the class list for one icon. `mapped` is the alias when the table has\n * one, and the original name otherwise.\n */\n className: (mapped: string, filled: boolean) => string\n strict?: boolean\n}): IconResolver {\n const { aliases, className, strict = true } = options\n return (name, ctx) => {\n const mapped = aliases?.[name]\n // The SET of names, never the icons themselves: this asks whether the design\n // system ships the name, and reaching for the drawings to answer it would make a\n // consumer who wired in their OWN icon library download all 34 Material paths.\n if (mapped === undefined && strict && builtinIconNames.has(name)) return undefined\n return { class: className(mapped ?? name, ctx.filled) }\n }\n}\n\n/**\n * A resolver for an icon set shipped as Vue COMPONENTS: Lucide, Untitled UI and\n * their kind. It is strict by construction, since a name absent from the table has\n * no component to return: it falls back to the built-in icons, and then to the\n * ligature.\n *\n * One contract to honour: each component must have a single `<svg>` as its root,\n * because that is the element the stylesheet sizes.\n */\nexport function componentIconResolver(options: {\n components: Partial<Record<VectisIconName, Component>> & Record<string, Component>\n props?: (name: string, filled: boolean) => Record<string, unknown>\n}): IconResolver {\n const { components, props } = options\n return (name, ctx) => {\n const component = components[name]\n return component ? { component, props: props?.(name, ctx.filled) } : undefined\n }\n}\n"],"mappings":";;;AAkCA,IAAM,IAAW,EAAqC,KAAA,CAAS;AAa/D,SAAgB,EAAgB,GAAsC;CACpE,EAAS,QAAQ;AACnB;AAGA,SAAgB,EAAY,GAAc,GAA0C;CAClF,OAAO,EAAS,QAAQ,GAAM,CAAG;AACnC;AAYA,SAAgB,EAAqB,IAAqC,CAAC,GAAiB;CAC1F,IAAM,EAAE,eAAY;CACpB,QAAQ,OAAU,EAAE,MAAM,IAAU,MAAS,EAAK;AACpD;AAYA,SAAgB,EAAkB,GAQjB;CACf,IAAM,EAAE,YAAS,cAAW,YAAS,OAAS;CAC9C,QAAQ,GAAM,MAAQ;EACpB,IAAM,IAAS,IAAU;EAIrB,YAAW,KAAA,KAAa,KAAU,EAAiB,IAAI,CAAI,IAC/D,OAAO,EAAE,OAAO,EAAU,KAAU,GAAM,EAAI,MAAM,EAAE;CACxD;AACF;AAWA,SAAgB,EAAsB,GAGrB;CACf,IAAM,EAAE,eAAY,aAAU;CAC9B,QAAQ,GAAM,MAAQ;EACpB,IAAM,IAAY,EAAW;EAC7B,OAAO,IAAY;GAAE;GAAW,OAAO,IAAQ,GAAM,EAAI,MAAM;EAAE,IAAI,KAAA;CACvE;AACF"}
1
+ {"version":3,"file":"resolver.js","names":[],"sources":["../../../src/components/VIcon/resolver.ts"],"sourcesContent":["// @ssr @core — module-level state, to be set at module level and never\n// client-only: a resolver installed after hydration is a mismatch.\n/**\n * The way to plug a third-party icon library into the design system. A resolver is a\n * function turning a name into something to draw, and it is consulted BEFORE the\n * icons built into the library — which is what lets a consumer move ALL of them onto\n * their own icon set rather than ending up with two styles side by side.\n *\n * The resolver is held in module-level state rather than provided through a Vue\n * plugin, because it is configuration: identical for every request a process\n * handles, and settable from any `.ts` file — a Nuxt plugin, `main.ts` — without a\n * component being involved.\n */\nimport { shallowRef, type Component } from 'vue'\n\nimport { builtinIconNames, type IconName } from './icons/names'\nimport type { IconContext, IconRender } from './types'\n\n/**\n * Turns an icon name into a description of what to draw. Answering `undefined` means\n * \"I do not know this name\", and not \"draw nothing\": VIcon then falls back to the\n * built-in icons, and after that to the ligature font. That distinction is what\n * makes a PARTIAL mapping usable — map the five names you care about and let the\n * rest be.\n */\nexport type IconResolver = (name: string, ctx: IconContext) => IconRender | undefined\n\n/**\n * A table mapping the design system's icon names to your own. The IDE suggests the\n * names the library ships with, and any other key is accepted too, so your\n * application's own icons can be aliased through the same table.\n */\nexport type IconAliases = Partial<Record<IconName, string>> & Record<string, string>\n\nconst resolver = shallowRef<IconResolver | undefined>(undefined)\n\n/**\n * Installs the resolver every VIcon will consult, or removes it when passed\n * `undefined`.\n *\n * Call it at MODULE level — from a Nuxt plugin or from `main.ts` — and never inside\n * a component's `setup()`. Two traps follow from where the state lives. On a server\n * it belongs to the process rather than to a request, which is right for\n * configuration and wrong for anything varying per visitor. And installing it on the\n * client only, from a `plugins/*.client.ts`, makes the browser draw different icons\n * from the ones the server sent, which is a hydration mismatch.\n */\nexport function setIconResolver(next: IconResolver | undefined): void {\n resolver.value = next\n}\n\n/** Asks the installed resolver, if there is one. Internal to VIcon, not public API. */\nexport function resolveIcon(name: string, ctx: IconContext): IconRender | undefined {\n return resolver.value?.(name, ctx)\n}\n\n/**\n * A resolver for a LIGATURE font — Material Symbols in any of its variants, or an\n * IcoMoon build made that way. It answers to every name, since the font itself\n * decides what it recognizes.\n *\n * Installing it is also how to have the design system's own icons drawn by the font\n * instead of by the SVGs shipped with the library, and therefore how to get the\n * optical size axis back: those SVGs are drawn at one optical size and cannot follow\n * `--vectis-icon-opsz`.\n */\nexport function ligatureIconResolver(options: { aliases?: IconAliases } = {}): IconResolver {\n const { aliases } = options\n return (name) => ({ text: aliases?.[name] ?? name })\n}\n\n/**\n * A resolver for a font driven by a CLASS and a pseudo-element: Font Awesome,\n * Phosphor, Bootstrap Icons and their kind.\n *\n * `strict`, which is the default, protects the design system's own icons. One of its\n * names that is NOT in your alias table would otherwise be turned into a class the\n * font does not define, and the icon would render as an empty square; refusing to\n * answer instead lets it fall back to the SVG shipped with the library. Names of\n * your own always pass, since they are already written in your vocabulary.\n */\nexport function classIconResolver(options: {\n aliases?: IconAliases\n /**\n * Builds the class list for one icon. `mapped` is the alias when the table has\n * one, and the original name otherwise.\n */\n className: (mapped: string, filled: boolean) => string\n strict?: boolean\n}): IconResolver {\n const { aliases, className, strict = true } = options\n return (name, ctx) => {\n const mapped = aliases?.[name]\n // The SET of names, never the icons themselves: this asks whether the design\n // system ships the name, and reaching for the drawings to answer it would make a\n // consumer who wired in their OWN icon library download all 34 Material paths.\n if (mapped === undefined && strict && builtinIconNames.has(name)) return undefined\n return { class: className(mapped ?? name, ctx.filled) }\n }\n}\n\n/**\n * A resolver for an icon set shipped as Vue COMPONENTS: Lucide, Untitled UI and\n * their kind. It is strict by construction, since a name absent from the table has\n * no component to return: it falls back to the built-in icons, and then to the\n * ligature.\n *\n * One contract to honour: each component must have a single `<svg>` as its root,\n * because that is the element the stylesheet sizes.\n */\nexport function componentIconResolver(options: {\n components: Partial<Record<IconName, Component>> & Record<string, Component>\n props?: (name: string, filled: boolean) => Record<string, unknown>\n}): IconResolver {\n const { components, props } = options\n return (name, ctx) => {\n const component = components[name]\n return component ? { component, props: props?.(name, ctx.filled) } : undefined\n }\n}\n"],"mappings":";;;AAkCA,IAAM,IAAW,EAAqC,KAAA,CAAS;AAa/D,SAAgB,EAAgB,GAAsC;CACpE,EAAS,QAAQ;AACnB;AAGA,SAAgB,EAAY,GAAc,GAA0C;CAClF,OAAO,EAAS,QAAQ,GAAM,CAAG;AACnC;AAYA,SAAgB,EAAqB,IAAqC,CAAC,GAAiB;CAC1F,IAAM,EAAE,eAAY;CACpB,QAAQ,OAAU,EAAE,MAAM,IAAU,MAAS,EAAK;AACpD;AAYA,SAAgB,EAAkB,GAQjB;CACf,IAAM,EAAE,YAAS,cAAW,YAAS,OAAS;CAC9C,QAAQ,GAAM,MAAQ;EACpB,IAAM,IAAS,IAAU;EAIrB,YAAW,KAAA,KAAa,KAAU,EAAiB,IAAI,CAAI,IAC/D,OAAO,EAAE,OAAO,EAAU,KAAU,GAAM,EAAI,MAAM,EAAE;CACxD;AACF;AAWA,SAAgB,EAAsB,GAGrB;CACf,IAAM,EAAE,eAAY,aAAU;CAC9B,QAAQ,GAAM,MAAQ;EACpB,IAAM,IAAY,EAAW;EAC7B,OAAO,IAAY;GAAE;GAAW,OAAO,IAAQ,GAAM,EAAI,MAAM;EAAE,IAAI,KAAA;CACvE;AACF"}
@@ -8,18 +8,6 @@ export interface IconContext {
8
8
  /** Whether the caller asked for the filled form — VIcon's prop, VButton's `iconFilled`. */
9
9
  filled: boolean;
10
10
  }
11
- /**
12
- * The five ways an icon can be described. Between them they cover every family of
13
- * icon source in use: raw SVG paths, icon sets shipped as components (Lucide,
14
- * Untitled UI), sprites and image files, ligature or codepoint fonts (Material,
15
- * IcoMoon), and fonts driven by a class and a pseudo-element (Font Awesome,
16
- * Phosphor, Bootstrap Icons).
17
- *
18
- * The union carries no discriminating field, because this is what a consumer writes
19
- * by hand and there would be nothing for them to tag it with. Which shape wins when
20
- * several are present is settled by VIcon instead, in the order path, component,
21
- * src, text, class.
22
- */
23
11
  /**
24
12
  * One of the icons the design system ships with: its canonical NAME together with the
25
13
  * drawing that goes with it, `[outline, filled?]` on the Material Symbols grid — the
@@ -38,6 +26,18 @@ export interface BuiltinIcon {
38
26
  name: string;
39
27
  paths: readonly [string] | readonly [string, string];
40
28
  }
29
+ /**
30
+ * The five ways an icon can be described. Between them they cover every family of
31
+ * icon source in use: raw SVG paths, icon sets shipped as components (Lucide,
32
+ * Untitled UI), sprites and image files, ligature or codepoint fonts (Material,
33
+ * IcoMoon), and fonts driven by a class and a pseudo-element (Font Awesome,
34
+ * Phosphor, Bootstrap Icons).
35
+ *
36
+ * The union carries no discriminating field, because this is what a consumer writes
37
+ * by hand and there would be nothing for them to tag it with. Which shape wins when
38
+ * several are present is settled by VIcon instead, in the order path, component,
39
+ * src, text, class.
40
+ */
41
41
  export type IconRender =
42
42
  /** SVG path data. Without a `viewBox` it is read on the Material Symbols grid. */
43
43
  {
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-icon-button[data-size]{width:var(--control-height);padding-inline:0}.v-icon-button[data-shape=circular]{border-radius:var(--vectis-radius-pill)}}
2
+ @layer vectis.components{.v-icon-button[data-shape=circular]{border-radius:var(--vectis-radius-pill)}}