vectis-ui 0.8.0 → 0.9.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.
- package/README.md +68 -334
- package/dist/components/VAccordion/VAccordionItem.d.ts +4 -6
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +21 -19
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.d.ts +6 -1
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.css +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +5 -3
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +53 -39
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +12 -3
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -20
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +2 -2
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.css +1 -1
- package/dist/components/VBadge/VBadge.d.ts +8 -4
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +5 -4
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +8 -3
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButton.css +1 -1
- package/dist/components/VButton/VButton.d.ts +4 -1
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +15 -6
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +144 -126
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.css +1 -1
- package/dist/components/VCalendar/VCalendarEvent.d.ts +1 -1
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +1 -1
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +99 -90
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +256 -246
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.css +1 -1
- package/dist/components/VCalendar/VCalendarYear.d.ts +8 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +39 -32
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/color.d.ts +1 -1
- package/dist/components/VCalendar/color.js.map +1 -1
- package/dist/components/VCalendar/edgeStep.d.ts +3 -3
- package/dist/components/VCalendar/edgeStep.js +5 -0
- package/dist/components/VCalendar/edgeStep.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +10 -9
- package/dist/components/VCalendar/gesture.js +60 -45
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/keyboard.d.ts +22 -5
- package/dist/components/VCalendar/keyboard.js +17 -16
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +47 -37
- package/dist/components/VCalendar/layout.js +47 -37
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +4 -4
- package/dist/components/VCalendar/timeGrid.js +6 -6
- package/dist/components/VCalendar/timeGrid.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +5 -5
- package/dist/components/VCarousel/VCarousel.css +1 -1
- package/dist/components/VCarousel/VCarousel.d.ts +59 -38
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +161 -132
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +1 -1
- package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/context.d.ts +1 -1
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +2 -2
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +10 -8
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.css +1 -1
- package/dist/components/VChip/VChip.d.ts +7 -2
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +69 -55
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.css +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +50 -36
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +167 -161
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.css +1 -1
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/infiniteScroll.d.ts +12 -3
- package/dist/components/VCombobox/infiniteScroll.js +18 -12
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +55 -24
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +192 -155
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.css +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +15 -12
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +180 -160
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/mask.d.ts +95 -0
- package/dist/components/VDateInput/mask.js +118 -0
- package/dist/components/VDateInput/mask.js.map +1 -0
- package/dist/components/VDatePicker/VDatePicker.css +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +6 -5
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +204 -173
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +3 -3
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.d.ts +34 -0
- package/dist/components/VDatePicker/names.js +42 -0
- package/dist/components/VDatePicker/names.js.map +1 -0
- package/dist/components/VDialog/VDialog.css +1 -1
- package/dist/components/VDialog/VDialog.d.ts +2 -2
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +63 -41
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +38 -25
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +74 -71
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/truncate.d.ts +4 -4
- package/dist/components/VFileInput/truncate.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.css +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +54 -37
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +152 -135
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.d.ts +2 -2
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +10 -8
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +22 -20
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +9 -7
- package/dist/components/VHotkeys/platform.js +41 -30
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.css +1 -1
- package/dist/components/VIcon/VIcon.d.ts +6 -6
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VIcon/iconProps.d.ts +4 -4
- package/dist/components/VIcon/iconProps.js.map +1 -1
- package/dist/components/VIcon/icons/index.d.ts +1 -1
- package/dist/components/VIcon/icons/index.js.map +1 -1
- package/dist/components/VIcon/icons/names.d.ts +1 -1
- package/dist/components/VIcon/icons/names.js.map +1 -1
- package/dist/components/VIcon/resolver.d.ts +3 -3
- package/dist/components/VIcon/resolver.js +23 -20
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +4 -4
- package/dist/components/VIconButton/VIconButton.d.ts +4 -4
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.d.ts +16 -8
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +22 -16
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +1 -1
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +3 -3
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +152 -85
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.d.ts +4 -4
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.css +1 -1
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +18 -11
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.css +1 -1
- package/dist/components/VMenu/VMenuItem.d.ts +6 -6
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +83 -69
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.css +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +2 -2
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +22 -9
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VPopover/VPopover.css +1 -1
- package/dist/components/VPopover/VPopover.d.ts +1 -1
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +12 -7
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +15 -10
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.css +1 -1
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +1 -1
- package/dist/components/VSeparator/VSeparator.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +2 -2
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +12 -13
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +87 -68
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +10 -7
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSlider/VSlider.css +1 -1
- package/dist/components/VSlider/VSlider.d.ts +21 -7
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +159 -140
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.css +1 -1
- package/dist/components/VSnackbar/VSnackbar.d.ts +4 -4
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +85 -59
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +7 -7
- package/dist/components/VSnackbar/state.js +13 -11
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.css +1 -1
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.css +1 -1
- package/dist/components/VSwitch/VSwitch.d.ts +1 -1
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.css +1 -1
- package/dist/components/VTabs/VTab.d.ts +4 -0
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.css +1 -1
- package/dist/components/VTabs/VTabs.d.ts +17 -7
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +84 -77
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +8 -8
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +71 -69
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.css +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +21 -12
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +230 -206
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +17 -2
- package/dist/components/VTimeInput/search.js +19 -9
- package/dist/components/VTimeInput/search.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.css +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +8 -7
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +128 -106
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +11 -4
- package/dist/components/VTimePicker/limits.js +3 -2
- package/dist/components/VTimePicker/limits.js.map +1 -1
- package/dist/components/VToast/VToast.css +1 -1
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +33 -37
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +91 -61
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +8 -6
- package/dist/components/VToast/state.js +15 -13
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.css +1 -1
- package/dist/components/VToggle/VToggle.d.ts +9 -4
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +4 -0
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.css +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +17 -10
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +46 -26
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.css +1 -1
- package/dist/components/VTypography/VTypography.d.ts +6 -4
- package/dist/components/VTypography/VTypography.js.map +1 -1
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useAriaLabel.js +1 -1
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +2 -2
- package/dist/composables/useClearable.js.map +1 -1
- package/dist/composables/useDetailsOpen.d.ts +3 -3
- package/dist/composables/useDetailsOpen.js +14 -12
- package/dist/composables/useDetailsOpen.js.map +1 -1
- package/dist/composables/useFieldIds.d.ts +2 -1
- package/dist/composables/useFieldIds.js +6 -5
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +2 -2
- package/dist/composables/useFieldPanel.js +47 -37
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.js +3 -3
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -1
- package/dist/composables/useFileField.js +62 -41
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +3 -3
- package/dist/composables/useIconClickHandlers.js +14 -13
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.js +12 -10
- package/dist/composables/useInertLink.js.map +1 -1
- package/dist/composables/useLiveAnnouncer.d.ts +5 -0
- package/dist/composables/useLiveAnnouncer.js +23 -0
- package/dist/composables/useLiveAnnouncer.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +5 -5
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +3 -3
- package/dist/composables/usePopover.js +6 -4
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.js +11 -2
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +1 -1
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useSlotNodes.d.ts +18 -0
- package/dist/composables/useSlotNodes.js +13 -0
- package/dist/composables/useSlotNodes.js.map +1 -0
- package/dist/composables/useTextLimit.d.ts +2 -1
- package/dist/composables/useTextLimit.js +2 -2
- package/dist/composables/useTextLimit.js.map +1 -1
- package/dist/composables/useTimer.d.ts +5 -0
- package/dist/composables/useTimer.js +22 -11
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js +14 -14
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +7 -7
- package/dist/i18n/state.js +37 -28
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +12 -12
- package/dist/icons.d.ts +2 -2
- package/dist/index.d.ts +12 -11
- package/dist/styles.css +1 -1
- package/dist/tokens/css.d.ts +1 -1
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/semantic.d.ts +6 -0
- package/dist/tokens/semantic.js +66 -60
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js +3 -3
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens.json +130 -66
- package/dist/types.d.ts +1 -1
- package/dist/utils/arrowNav.d.ts +4 -1
- package/dist/utils/arrowNav.js +7 -7
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +1 -1
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/clock.d.ts +113 -0
- package/dist/utils/clock.js +84 -0
- package/dist/utils/clock.js.map +1 -0
- package/dist/utils/css.d.ts +6 -4
- package/dist/utils/css.js +2 -2
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +7 -102
- package/dist/utils/date.js +33 -160
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +1 -1
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +12 -3
- package/dist/utils/env.js +6 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/file.d.ts +3 -3
- package/dist/utils/file.js +1 -1
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +1 -1
- package/dist/utils/hostWarns.js.map +1 -1
- package/dist/utils/ids.d.ts +1 -1
- package/dist/utils/ids.js.map +1 -1
- package/dist/utils/matcher.d.ts +2 -2
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +1 -1
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/text.d.ts +3 -3
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +2 -101
- package/dist/utils/time.js +22 -98
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +5 -3
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,48 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://vectis-ui.com">
|
|
3
|
+
<img src="https://vectis-ui.com/favicon.svg" alt="Vectis UI logo" width="96" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<h1 align="center">Vectis UI</h1>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
A Vue 3 component library built for modern browsers.
|
|
11
|
+
</p>
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/vectis-ui"><img src="https://img.shields.io/npm/v/vectis-ui" alt="npm version" /></a>
|
|
15
|
+
<a href="https://github.com/Jypyx/vectis-ui/actions/workflows/ci.yml"><img src="https://github.com/Jypyx/vectis-ui/actions/workflows/ci.yml/badge.svg" alt="CI status" /></a>
|
|
16
|
+
<a href="https://github.com/Jypyx/vectis-ui/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vectis-ui" alt="MIT license" /></a>
|
|
17
|
+
</p>
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://vectis-ui.com">Documentation</a> ·
|
|
21
|
+
<a href="https://vectis-ui.com/docs/installation/">Installation</a> ·
|
|
22
|
+
<a href="https://github.com/Jypyx/vectis-ui/blob/main/CHANGELOG.md">Changelog</a> ·
|
|
23
|
+
<a href="https://github.com/Jypyx/vectis-ui">GitHub</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
## Introduction
|
|
27
|
+
|
|
28
|
+
Vectis UI is a set of Vue 3 components written in TypeScript.
|
|
29
|
+
The whole look is driven by CSS custom properties (`--vectis-*`), so you can retheme the library, or a single part of a page, without rebuilding anything. Styles live in cascade layers, which means your own CSS wins without fighting over specificity.
|
|
30
|
+
|
|
31
|
+
A few things you get out of the box:
|
|
32
|
+
|
|
33
|
+
- **No runtime dependency** other than Vue itself.
|
|
34
|
+
- **Pay for what you import.** Each component ships as its own module with its own stylesheet.
|
|
35
|
+
- **SSR-safe**, so it works with Nuxt 3 and 4 without a module or a plugin.
|
|
36
|
+
- **Accessible by default.** Keyboard support and ARIA semantics on every component, with axe checks run in CI against both the light and the dark theme.
|
|
37
|
+
- **Light and dark themes**, switchable on any DOM subtree with a `data-theme` attribute.
|
|
38
|
+
- **English and French** built in, and any other language can be added from your app.
|
|
39
|
+
- **No icon font required.** The icons the library draws are embedded SVGs, and you can plug in your own icon set.
|
|
40
|
+
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
Install the package:
|
|
13
44
|
|
|
14
45
|
```bash
|
|
15
|
-
|
|
46
|
+
npm install vectis-ui
|
|
47
|
+
# or
|
|
48
|
+
pnpm add vectis-ui
|
|
49
|
+
# or
|
|
50
|
+
yarn add vectis-ui
|
|
16
51
|
```
|
|
17
52
|
|
|
53
|
+
Import the global stylesheet once, in your app's entry point:
|
|
54
|
+
|
|
18
55
|
```ts
|
|
19
56
|
// main.ts
|
|
20
57
|
import 'vectis-ui/styles.css'
|
|
21
58
|
```
|
|
22
59
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Those figures are measured, not estimated: `pnpm --filter vectis-ui bench:size` prints them from the built artefact and holds them to a committed baseline, so they cannot drift out of step with the library again.
|
|
60
|
+
Then import the components you need:
|
|
26
61
|
|
|
27
62
|
```vue
|
|
28
63
|
<script setup lang="ts">
|
|
29
64
|
import { ref } from 'vue'
|
|
30
|
-
import { VButton, VInput
|
|
65
|
+
import { VButton, VInput } from 'vectis-ui'
|
|
31
66
|
|
|
32
67
|
const email = ref('')
|
|
33
68
|
</script>
|
|
34
69
|
|
|
35
70
|
<template>
|
|
36
|
-
<VInput v-model="email" type="email"
|
|
37
|
-
<VButton
|
|
38
|
-
Subscribe
|
|
39
|
-
</VButton>
|
|
71
|
+
<VInput v-model="email" type="email" label="Email" />
|
|
72
|
+
<VButton>Subscribe</VButton>
|
|
40
73
|
</template>
|
|
41
74
|
```
|
|
42
75
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
The library is pre-built as ESM and SSR-safe (no `window`/`document` access outside the client lifecycle). No module and no plugin needed:
|
|
76
|
+
Using Nuxt? Declare the stylesheet in `nuxt.config.ts` instead, so it's injected during server rendering:
|
|
46
77
|
|
|
47
78
|
```ts
|
|
48
79
|
// nuxt.config.ts
|
|
@@ -51,338 +82,41 @@ export default defineNuxtConfig({
|
|
|
51
82
|
})
|
|
52
83
|
```
|
|
53
84
|
|
|
54
|
-
|
|
55
|
-
<script setup lang="ts">
|
|
56
|
-
import { VButton, VBadge } from 'vectis-ui'
|
|
57
|
-
</script>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Named imports are tree-shaken by Vite/Nitro. No `build.transpile` required.
|
|
61
|
-
|
|
62
|
-
Component CSS travels with the component as a plain static `import`, which Vite, Nitro and webpack all turn into a render-blocking `<link>` — including for a lazily loaded route, whose stylesheet is awaited before the chunk runs. The one setup that would flash is a hand-rolled SSR server that injects its client CSS **through JavaScript** (`vite-plugin-css-injected-by-js`, webpack's `style-loader`): there, the first paint carries the core (tokens, layout, hidden popovers) but not the components' internal rules. Keep the client CSS extracted to a file and the question does not arise.
|
|
63
|
-
|
|
64
|
-
For the locale and the icons, put the configuration in a **universal** plugin — `plugins/vectis.ts`, never `plugins/vectis.client.ts`: a client-only configuration would make the server and client renders diverge, hence a hydration mismatch. See [Internationalization](#internationalization).
|
|
65
|
-
|
|
66
|
-
## Theming
|
|
67
|
-
|
|
68
|
-
### Token architecture
|
|
69
|
-
|
|
70
|
-
Two levels of custom properties, generated from a typed TypeScript source (a format inspired by the [W3C DTCG](https://design-tokens.github.io/community-group/format/)):
|
|
71
|
-
|
|
72
|
-
- **Primitives**: OKLCH palettes (`--vectis-color-indigo-500`), spacing scales (`--vectis-space-4`), type, radii, shadows, durations/easings.
|
|
73
|
-
- **Semantics** — the only ones components consume: `--vectis-color-surface`, `--vectis-color-text-muted`, `--vectis-color-accent`, `--vectis-radius-interactive`, `--vectis-focus-ring-color`…
|
|
74
|
-
|
|
75
|
-
### Dark mode
|
|
76
|
-
|
|
77
|
-
```html
|
|
78
|
-
<html data-theme="dark"></html>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
`data-theme` works on **any DOM subtree** (a dark panel inside a light page, or the reverse) and also drives `color-scheme` (scrollbars, native controls).
|
|
82
|
-
|
|
83
|
-
### Runtime overrides — no rebuild
|
|
84
|
-
|
|
85
|
-
Every customization is a redefinition of custom properties, in CSS:
|
|
86
|
-
|
|
87
|
-
```css
|
|
88
|
-
/* a "coral" theme: accent + pill radii */
|
|
89
|
-
:root {
|
|
90
|
-
--vectis-color-accent: oklch(58% 0.2 25);
|
|
91
|
-
--vectis-color-accent-hover: oklch(51% 0.19 25);
|
|
92
|
-
--vectis-radius-interactive: 9999px;
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
…or in JavaScript, on a subtree included:
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
panel.style.setProperty('--vectis-color-accent', 'oklch(58% 0.2 25)')
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The design system's CSS lives in layers (`vectis.reset < vectis.tokens < vectis.components < vectis.utilities`): **any non-layered consumer style wins automatically** — overriding a component never calls for a specificity war. Every sheet the library emits re-declares that order, so it holds whichever one your bundler happens to place first.
|
|
103
|
-
|
|
104
|
-
### Programmatic access to the tokens
|
|
105
|
-
|
|
106
|
-
```ts
|
|
107
|
-
import { tokens, flattenTokens } from 'vectis-ui/tokens'
|
|
108
|
-
|
|
109
|
-
// [{ path: ['color', 'surface'], cssName: '--vectis-color-surface', token: {...} }, …]
|
|
110
|
-
const semanticColors = flattenTokens(tokens.semantic.color, ['color'])
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`vectis-ui/tokens.json` exposes the same source as raw JSON (tooling, configuration export). It is the foundation of the theming app to come: modify the object, inject the variables, export the config.
|
|
114
|
-
|
|
115
|
-
## Icons
|
|
116
|
-
|
|
117
|
-
**No icon font is required.** The icons the library renders itself — `VDialog`'s cross, `VDatePicker`'s and `VMenu`'s chevrons, the toasts' tone icons, `VDataTable`'s sorting… — are **embedded SVGs**, exact replicas of Material Symbols Rounded (wght 400 · GRAD 0 · opsz 24, Apache-2.0 © Google). There are 34 of them and **each is a module of its own**, imported by the components that draw it: you pay for the icons your components actually render and for nothing else. A lone `VButton` ships none at all, which is most of why its JavaScript comes to 4.62 kB gzip with `VIcon`, `VSpinner` and the dictionary pulled in alongside it.
|
|
118
|
-
|
|
119
|
-
Reach for one directly through the `vectis-ui/icons` subpath, and pass it where a name would go:
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
import { close, search } from 'vectis-ui/icons'
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
The `VIcon` component resolves its source in this order: **an explicit `render` → `src` → `name` (the consumer resolver first, then the drawing the icon brought along, then the ligature) → the slot**.
|
|
126
|
-
|
|
127
|
-
```vue
|
|
128
|
-
<VIcon :name="close" />
|
|
129
|
-
<!-- one of the DS's own icons: SVG, no font needed -->
|
|
130
|
-
<VIcon name="favorite" />
|
|
131
|
-
<!-- a bare NAME: your resolver, then a ligature from YOUR icon font -->
|
|
132
|
-
<VIcon src="/logo.svg" label="Logo" />
|
|
133
|
-
<!-- an image -->
|
|
134
|
-
<VIcon><svg …/></VIcon>
|
|
135
|
-
<!-- an inline SVG (the slot) -->
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
A **bare string is always a NAME**, and it no longer reaches the library's own drawings: an icon is in your bundle because a module imported it, never because a string might one day ask for it.
|
|
139
|
-
|
|
140
|
-
- **Decorative by default** (`aria-hidden`); the `label` prop makes it informative (`role="img"` + `aria-label`).
|
|
141
|
-
- The **`data-icon`** attribute carries the requested name whatever the source — a stable hook for consumer CSS and for tests.
|
|
142
|
-
- Size: **1em by default** — the icon follows the surrounding text. Override freely in pixels through `:size="32"`. With no prop, any parent can drive the context by setting the **`--vectis-icon-size`** and **`--vectis-icon-opsz`** custom properties (which is what the shared `v-control` class does — VButton, VInput, VTextarea, VInputOTP, VChip… — according to the control's size); the numeric prop wins over the context. `VSpinner` follows the same principle (1em + `:size` in px), with no context API.
|
|
143
|
-
- **`--vectis-icon-opsz` only applies to the ligature**: it is a font variable axis, with no hold on a built-in SVG, an image or a third-party component. The size, by contrast, applies to every source.
|
|
144
|
-
|
|
145
|
-
### Every icon prop takes a name **or** an explicit rendering
|
|
146
|
-
|
|
147
|
-
```vue
|
|
148
|
-
<VButton icon-start="download">Export</VButton>
|
|
149
|
-
<VButton :icon-start="cloud_upload">Upload</VButton>
|
|
150
|
-
<VBreadcrumb :separator-icon="{ src: '/chevron.svg' }" :items="items" />
|
|
151
|
-
<VMenuItem label="Open" :icon-start="{ component: FolderIcon }" />
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
A string is **always** an icon name; one of the design system's own icons is imported from `vectis-ui/icons`; an image or a component is declared as an object (`{ src }`, `{ component }`, `{ path }`, `{ text }`, `{ class }`). That is what lets Iconify-style naming conventions (`mdi:close`, `fa6-solid:xmark`) work.
|
|
155
|
-
|
|
156
|
-
### Wiring your own icon library
|
|
157
|
-
|
|
158
|
-
`setIconResolver` is consulted **before** the icon's own drawing; returning `undefined` means "I do not know this name" and hands over to that drawing, then to the ligature. **Partial** mappings are therefore usable. The `IconName` type enumerates the names to cover.
|
|
159
|
-
|
|
160
|
-
An imported icon carries its **name** as well as its paths, which is what keeps a single `setIconResolver` call enough to move the design system's own internals onto your icon set — exactly as it was when those defaults were plain strings.
|
|
161
|
-
|
|
162
|
-
```ts
|
|
163
|
-
// main.ts / plugins/icons.ts — at MODULE level, never inside a setup()
|
|
164
|
-
import { setIconResolver, classIconResolver } from 'vectis-ui'
|
|
165
|
-
|
|
166
|
-
// Font Awesome, Phosphor, Bootstrap Icons… (class-based fonts + ::before)
|
|
167
|
-
// `fa-solid` unconditionally: the Free tier only draws a small fraction of the
|
|
168
|
-
// catalogue in Regular, so mapping `filled: false` onto it would render empty
|
|
169
|
-
// squares. FA's outline/filled pair requires the Pro tier.
|
|
170
|
-
setIconResolver(
|
|
171
|
-
classIconResolver({
|
|
172
|
-
aliases: { close: 'xmark', expand_more: 'angle-down', check_circle: 'circle-check' },
|
|
173
|
-
className: (name) => `fa-solid fa-${name}`,
|
|
174
|
-
}),
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
// Lucide, Untitled UI… (SVG sets as Vue components, a single <svg> root)
|
|
178
|
-
import { componentIconResolver } from 'vectis-ui'
|
|
179
|
-
import { X, Check, ChevronDown } from 'lucide-vue-next'
|
|
180
|
-
setIconResolver(
|
|
181
|
-
componentIconResolver({
|
|
182
|
-
components: { close: X, check: Check, expand_more: ChevronDown },
|
|
183
|
-
props: () => ({ strokeWidth: 1.75 }),
|
|
184
|
-
}),
|
|
185
|
-
)
|
|
186
|
-
|
|
187
|
-
// Material Symbols, ligature-based IcoMoon… — ALSO renders the design system's 20
|
|
188
|
-
// icons through the font, which restores the --vectis-icon-opsz optical axis
|
|
189
|
-
// (20 at xs/sm/md).
|
|
190
|
-
import { ligatureIconResolver } from 'vectis-ui'
|
|
191
|
-
setIconResolver(ligatureIconResolver())
|
|
192
|
-
```
|
|
85
|
+
The [installation guide](https://vectis-ui.com/docs/installation/) covers both setups in more detail.
|
|
193
86
|
|
|
194
|
-
|
|
87
|
+
## Documentation
|
|
195
88
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
> **SSR** — set the resolver at module level (a Nuxt plugin, `main.ts`), never inside a `setup()`: the state lives in the process, which is correct for configuration and wrong for per-request state. Above all, **do not install it client-only** (`plugins/*.client.ts`): the server would render the built-in SVG and the client your library — a hydration mismatch. Font Awesome in "SVG with JS" mode (which replaces elements in the DOM) is not supported: use its CSS mode.
|
|
199
|
-
|
|
200
|
-
**Loading an icon font stays useful** for your own names. An example with Material Symbols Rounded through Google Fonts:
|
|
201
|
-
|
|
202
|
-
```html
|
|
203
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
204
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
205
|
-
<link
|
|
206
|
-
rel="stylesheet"
|
|
207
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
|
|
208
|
-
/>
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
(or self-host the variable woff2, e.g. the `material-symbols` npm package). `display=block` avoids flashing the icon name in full. With no font loaded, the layout is preserved (the textual name stays inside the icon's box). Overriding the `--vectis-font-family-icon` token is enough to switch to another **ligature-based** font (Material Symbols Outlined/Sharp, an IcoMoon build) — with no resolver.
|
|
212
|
-
|
|
213
|
-
On `VButton`: the `icon-start` / `icon-end` props take an icon name or an explicit rendering (the `#start`/`#end` slots stay available for custom content and win over the props). `VButton` also accepts `href` (rendered as `<a>`; `disabled`/`loading` produce an inert link: `href` removed + `aria-disabled`) and `compact` (height reduced by 4px: 20/28/36/44/52px depending on the `xs`–`xl` size).
|
|
214
|
-
|
|
215
|
-
The `xs`–`xl` scale is not exposed by every component: those embedding a text input (`VInput`, `VTextarea`, `VInputOTP`, `VCombobox`, `VDateInput`, `VTimeInput`) restrict themselves to **`sm` / `md` / `lg`** (32/40/48px, default `md`), `compact` remaining available; `VChip` restricts itself to `xs`/`sm`.
|
|
216
|
-
|
|
217
|
-
## Internationalization
|
|
218
|
-
|
|
219
|
-
No user-facing text is hardcoded in the components: everything comes from a dictionary. The design system is **English by default** and ships French; any other language is added on the consumer side.
|
|
220
|
-
|
|
221
|
-
Two things are settled separately: the **words** come from the dictionary, the **formats** (month and day names, date field order, hour cycle, first day of the week) derive from `Intl` from the locale tag. Setting a locale with no matching dictionary therefore already gives correct dates, with labels left in English.
|
|
222
|
-
|
|
223
|
-
### Switching the design system to French
|
|
224
|
-
|
|
225
|
-
```ts
|
|
226
|
-
// main.ts
|
|
227
|
-
import { fr, registerMessages, setLocale } from 'vectis-ui'
|
|
228
|
-
|
|
229
|
-
registerMessages('fr', fr)
|
|
230
|
-
setLocale('fr-FR')
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
French is **opt-in**: it only enters your bundle if you import it.
|
|
234
|
-
|
|
235
|
-
Set a **complete** BCP 47 tag. `Intl` accepts `'en'`, but applies the language's default conventions to it — `'en'` means 12 h and a week starting on Sunday, which is not `'en-GB'`.
|
|
236
|
-
|
|
237
|
-
### Adjusting a few words
|
|
238
|
-
|
|
239
|
-
An override is **partial**: what you do not write stays unchanged, and successive calls on the same language accumulate.
|
|
240
|
-
|
|
241
|
-
```ts
|
|
242
|
-
import { registerMessages } from 'vectis-ui'
|
|
243
|
-
|
|
244
|
-
registerMessages('en', {
|
|
245
|
-
dataTable: { empty: 'Nothing to display' },
|
|
246
|
-
common: { close: 'Quit' },
|
|
247
|
-
})
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Adding a language the design system does not ship
|
|
251
|
-
|
|
252
|
-
The same gesture as enabling French — there are not two categories of dictionary. What you do not write falls back to English, never to an empty string: a partial dictionary is usable from its very first key.
|
|
253
|
-
|
|
254
|
-
```ts
|
|
255
|
-
import { registerMessages, setLocale, type MessagesInput } from 'vectis-ui'
|
|
256
|
-
|
|
257
|
-
const de: MessagesInput = {
|
|
258
|
-
common: { loading: 'Wird geladen…', close: 'Schließen' },
|
|
259
|
-
pagination: { previous: 'Vorherige Seite', next: 'Nächste Seite', page: (p) => `Seite ${p}` },
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
registerMessages('de', de)
|
|
263
|
-
setLocale('de-DE')
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
An entry depending on a value is a **TypeScript function**, not a placeholder string: no plural engine and no ICU syntax to learn. Type the constant as `MessagesInput` for key autocompletion, or as `Messages` to have the compiler require full coverage.
|
|
267
|
-
|
|
268
|
-
The key is the **language subtag** alone: `registerMessages('de', …)` covers `de-DE`, `de-AT` and `de-CH`.
|
|
269
|
-
|
|
270
|
-
### Precedence
|
|
271
|
-
|
|
272
|
-
A text prop set on a component stays **authoritative**: the global translation only changes the defaults. For containers' accessible names, the full chain is `aria-labelledby` › `aria-label` › the `label` prop › the dictionary › English.
|
|
273
|
-
|
|
274
|
-
`VDatePicker`, `VDateInput`, `VTimePicker` and `VTimeInput` keep their `locale` prop, which takes precedence; without it, they follow the global locale.
|
|
275
|
-
|
|
276
|
-
```vue
|
|
277
|
-
<VDateInput />
|
|
278
|
-
<!-- the global locale -->
|
|
279
|
-
<VDateInput locale="ja-JP" />
|
|
280
|
-
<!-- forced -->
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### Limit: one locale per process
|
|
284
|
-
|
|
285
|
-
The configuration lives at module level, like the icons': **a single locale per process**. A server-rendered site serving `/fr` and `/en` from the same Node process cannot rely on it to vary the language per request — it must pass the text props explicitly.
|
|
286
|
-
|
|
287
|
-
## Components
|
|
288
|
-
|
|
289
|
-
| Area | Components |
|
|
290
|
-
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
291
|
-
| Actions | `VButton`, `VIconButton`, `VChip` (selectable, dismissible) |
|
|
292
|
-
| Forms | `VInput`, `VTextarea`, `VCheckbox`, `VRadio`, `VSwitch`, `VSlider` (single/range), `VInputOTP`, `VCombobox` (search, multi) |
|
|
293
|
-
| Overlays | `VTooltip`, `VMenu` + `VMenuItem`/`VMenuGroup`/`VMenuSeparator` (recursive submenus) |
|
|
294
|
-
| Structure | `VAccordion` + `VAccordionItem`, `VDataTable` (sorting, responsive), `VBreadcrumb` (data-driven, truncation) |
|
|
295
|
-
| Feedback | `VToaster` + `toast()` (notifications), `VBadge`, `VAvatar`, `VSpinner`, `VSkeletonLoader` (loading silhouettes), `VProgressLinear`, `VProgressCircular`, `VIcon` (built-in SVGs, a font, an image or an inline SVG) |
|
|
296
|
-
|
|
297
|
-
Implementation notes worth knowing:
|
|
298
|
-
|
|
299
|
-
- **VSlider range** superimposes two native `<input type="range">` (each thumb stays a real keyboard/ARIA slider); the JS only prevents them crossing.
|
|
300
|
-
- **VDataTable responsive**: the `stack` mode is pure CSS (container queries) — under a 640px container, rows become cards and the headers are re-injected through `::before + data-label`.
|
|
301
|
-
- **VCombobox** follows the ARIA combobox/listbox pattern (`aria-activedescendant`, focus stays in the input); the panel is aligned on the control through `anchor-size(width)`.
|
|
302
|
-
- **VToast**: mount `<VToaster />` once (at the app root), then call `toast({ message, tone, ... })` from anywhere — a component, a store, an API response (client only, never during SSR). Placements as Popover API stacks (the top layer), auto-dismiss (5 s by default, `duration: 0` = persistent, paused on hover), `dismissToast(id?)` to close programmatically.
|
|
303
|
-
|
|
304
|
-
Cross-cutting conventions:
|
|
305
|
-
|
|
306
|
-
- Prop-driven variants → `data-variant` / `data-tone` / `data-size` attributes (targetable in CSS).
|
|
307
|
-
- `v-model` wherever state exists (`v-model:open` for VMenu).
|
|
308
|
-
- Floating elements take their trigger from a scoped slot: `<template #trigger="{ triggerProps }"><VButton v-bind="triggerProps">…</VButton></template>` — `popovertarget` and the ARIA attributes are set for you.
|
|
309
|
-
- Forms: the visual error state comes from native `:user-invalid` (zero validation JS); the `invalid` prop forces the state for server-side validation.
|
|
310
|
-
|
|
311
|
-
The living documentation (stories, tokens page, theme switch): `pnpm storybook`.
|
|
89
|
+
Everything lives on **[vectis-ui.com](https://vectis-ui.com)**, a page per component with live examples and API tables, plus guides on [theming](https://vectis-ui.com/docs/theming/), [iconography](https://vectis-ui.com/docs/iconography/), [internationalization](https://vectis-ui.com/docs/i18n/) and [accessibility](https://vectis-ui.com/docs/accessibility/).
|
|
312
90
|
|
|
313
91
|
## Browser support
|
|
314
92
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
- Baseline, no compromise: the Popover API, `<dialog>`, `<details name>`, `:user-invalid`, `:has()`, `color-mix()`, `@layer`, custom properties.
|
|
318
|
-
- **CSS Anchor Positioning** (VTooltip, VMenu and its submenus, VCombobox): shipped with no JS fallback, a deliberate choice — every engine above the floor implements it, Firefox from 147.
|
|
319
|
-
- Pure progressive enhancement (clean degradation when unsupported): `@starting-style`/`allow-discrete` animations, `field-sizing: content` (VTextarea `auto-grow`), `::details-content` + `interpolate-size` (the VAccordion animation), and the scroll shadows of `VDialog` (`container-type: scroll-state`, Chrome/Edge 133+ — elsewhere the hairlines simply stay invisible).
|
|
93
|
+
Vectis UI targets recent browsers only:
|
|
320
94
|
|
|
321
|
-
|
|
95
|
+
| Chrome / Edge | Safari | Firefox |
|
|
96
|
+
| ------------- | ------ | ------- |
|
|
97
|
+
| 134+ | 26+ | 147+ |
|
|
322
98
|
|
|
323
|
-
|
|
324
|
-
aimed at older browsers **rewrites** part of what they contain. One of those rewrites is not a
|
|
325
|
-
fallback but a change of meaning: **Lightning CSS** — the default CSS minifier of **Vite 8**, and
|
|
326
|
-
Parcel's — replaces `:dir(rtl)` with an `:is(:lang(ae), :lang(ar), …, :lang(yi))` approximation as
|
|
327
|
-
soon as its targets predate Chrome 120. That list matches on the document's **language** where the
|
|
328
|
-
library flips on its **direction**, so on an `<html dir="rtl" lang="en">` page the rule never
|
|
329
|
-
applies at all.
|
|
99
|
+
Two features set this floor: CSS anchor positioning, used without a JavaScript fallback, and the `closedby` attribute of `<dialog>` (Chrome 134), which keeps a modal open on Escape or on a click outside when it should be. Safari does not implement `closedby` yet, and a small script stands in for it there. Some effects, like entry animations, are progressive enhancements and simply don't play on engines that lack them.
|
|
330
100
|
|
|
331
|
-
|
|
332
|
-
VPagination, VTabs, VBreadcrumb, VMenu, VCalendar, VDatePicker and VCarousel, VBadge's overlay
|
|
333
|
-
corner, VProgressCircular's direction of travel, VProgressLinear's clipped text copy and
|
|
334
|
-
VSkeletonLoader's wave. Nothing errors, and a dev server shows none of it: only a production build
|
|
335
|
-
minifies.
|
|
336
|
-
|
|
337
|
-
Vite derives `build.cssTarget` from `build.target`, whose `'modules'` default stands for Chrome 87.
|
|
338
|
-
Pin it to the floor above, and the modern CSS goes through untouched:
|
|
101
|
+
If your bundler targets older browsers, it may rewrite part of the library's CSS during minification. Set `build.cssTarget` to the versions above in your Vite (or Nuxt) config to keep it intact:
|
|
339
102
|
|
|
340
103
|
```ts
|
|
341
104
|
// vite.config.ts
|
|
342
105
|
export default defineConfig({
|
|
343
|
-
build: { cssTarget: ['
|
|
344
|
-
})
|
|
345
|
-
|
|
346
|
-
// nuxt.config.ts — the same value, one level down
|
|
347
|
-
export default defineNuxtConfig({
|
|
348
|
-
vite: { build: { cssTarget: ['chrome125', 'edge125', 'safari26', 'firefox147'] } },
|
|
106
|
+
build: { cssTarget: ['chrome134', 'edge134', 'safari26', 'firefox147'] },
|
|
349
107
|
})
|
|
350
108
|
```
|
|
351
109
|
|
|
352
|
-
|
|
353
|
-
once as an sRGB hex fallback and once as `lab()`.
|
|
110
|
+
## Versioning
|
|
354
111
|
|
|
355
|
-
|
|
112
|
+
Vectis UI follows [Semantic Versioning](https://semver.org/). While the version is still 0.x, a minor release can include breaking changes, so read the [changelog](https://github.com/Jypyx/vectis-ui/blob/main/CHANGELOG.md) before upgrading.
|
|
356
113
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
## Security model
|
|
360
|
-
|
|
361
|
-
The package has **no runtime dependency** beyond Vue, makes **no network request**, and reads no
|
|
362
|
-
storage. It renders no consumer string as HTML: there is no `v-html` anywhere in the library.
|
|
114
|
+
## Contributing
|
|
363
115
|
|
|
364
|
-
|
|
365
|
-
not filter URL schemes.** `href` (`VButton`, `VChip`, `VAvatar`, `VMenuItem`, `VSideNavigationItem`,
|
|
366
|
-
`VBreadcrumb`) and `src` (`VIcon`, `VAvatar`) are passed through untouched, so a `javascript:` URL
|
|
367
|
-
coming from your data runs on click. Validate it where the data enters your application — with
|
|
368
|
-
particular care for `VBreadcrumb`, whose `items[].href` is typically built from a CMS or an API
|
|
369
|
-
rather than written by hand.
|
|
116
|
+
Bug reports and feature requests are welcome in the [issue tracker](https://github.com/Jypyx/vectis-ui/issues). To work on the library itself, see the [repository](https://github.com/Jypyx/vectis-ui).
|
|
370
117
|
|
|
371
|
-
|
|
372
|
-
custom properties through `style.setProperty`, so they cannot escape the `style` attribute — but a
|
|
373
|
-
hostile value can still be a valid `url(…)`, i.e. a tracking beacon. Treat them as data to validate
|
|
374
|
-
if they come from outside your application.
|
|
118
|
+
## License
|
|
375
119
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
```bash
|
|
379
|
-
corepack enable pnpm
|
|
380
|
-
pnpm install
|
|
381
|
-
pnpm storybook # development
|
|
382
|
-
pnpm lint && pnpm format && pnpm typecheck && pnpm test && pnpm build && pnpm build-storybook
|
|
383
|
-
```
|
|
120
|
+
Vectis UI is released under the [MIT license](https://github.com/Jypyx/vectis-ui/blob/main/LICENSE).
|
|
384
121
|
|
|
385
|
-
-
|
|
386
|
-
- **A new component**: a `src/components/VX/` folder with `VX.vue` (non-scoped styles in `@layer vectis.components`, semantic tokens only, variants through `data-*`), `VX.stories.ts` (default, variants, states, edge cases, play functions), `VX.test.ts` (logic only — browser behaviour is tested in the play functions), and the named export in `src/index.ts`. The Storybook `title` and the `.mdx` heading are written **without the `V`** — the only exception to the prefix.
|
|
387
|
-
- **Its CSS ships as `dist/components/VX/VX.css`, imported by `VX.js`.** No rule may depend on where another component's sheet lands: a declaration that would collide with another component's at equal specificity is qualified (`[data-size]`, a compound class, a descendant) or routed through the custom property the target reads. `pnpm build` checks the mechanism.
|
|
388
|
-
- Any behavioural JS must be justified by a comment: "can modern HTML/CSS do it?" comes first.
|
|
122
|
+
The built-in icons are drawn from [Material Symbols](https://github.com/google/material-design-icons) by Google, used under the Apache License 2.0. See [NOTICE](https://github.com/Jypyx/vectis-ui/blob/main/NOTICE) for details.
|
|
@@ -3,6 +3,9 @@ interface AccordionItemProps {
|
|
|
3
3
|
/**
|
|
4
4
|
* The heading of the section, the line that stays visible when it is closed. Use
|
|
5
5
|
* the `#title` slot instead when the heading needs markup rather than plain text.
|
|
6
|
+
*
|
|
7
|
+
* Note that this prop shadows the HTML attribute of the same name on the component,
|
|
8
|
+
* so no tooltip can be set through it.
|
|
6
9
|
*/
|
|
7
10
|
title?: string;
|
|
8
11
|
/**
|
|
@@ -47,12 +50,7 @@ type __VLS_ModelProps = {
|
|
|
47
50
|
/**
|
|
48
51
|
* Whether the section is open, when the consumer wants to drive or observe it. Left
|
|
49
52
|
* unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial
|
|
50
|
-
* value.
|
|
51
|
-
*
|
|
52
|
-
* TRAP — "not bound" is written as `null` and not `undefined`. A model typed as a plain
|
|
53
|
-
* boolean is declared as such at runtime, and Vue casts an ABSENT boolean prop to
|
|
54
|
-
* `false`, which would silently overwrite `defaultOpen`. The explicit default disarms
|
|
55
|
-
* that cast.
|
|
53
|
+
* value. `null` means unbound.
|
|
56
54
|
*/
|
|
57
55
|
'open'?: boolean | null;
|
|
58
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VAccordionItem.js","names":[],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One section of an accordion: a heading the reader can click, and the content it\n * reveals. It is a native `<details>`/`<summary>` pair, so the browser owns the\n * open and closed state, the keyboard and the accessibility semantics. The only JS\n * is the `v-model:open` bridge, fed by the element, and the click a disabled summary\n * has to cancel, both shared with VSideNavigationItem through `useDetailsOpen`.\n *\n * The opening is animated entirely in CSS, with `::details-content` and\n * `interpolate-size` (`styles/disclosure.css`). Both are recent additions to the\n * language: where they are missing the section simply appears at once, which is the\n * intended fallback.\n */\n\nimport { computed, inject } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use\n * the `#title` slot instead when the heading needs markup rather than plain text.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render\n * (`{ src }`, `{ component }`…). The `#icon` slot replaces it.\n *\n * It carries no side in its name because there is only one: the end of the row belongs\n * to the chevron, so there is nothing for a start to be told apart from. That is the\n * rule every single-icon component of the design system follows, and its slot is named\n * `#icon` for the same reason.\n */\n icon?: IconSource\n /**\n * Renders the section already open. Only its initial value is read: the browser\n * owns the state afterwards, so changing this prop later will not close a section\n * the reader has opened. Bind `v-model:open` to drive it instead.\n */\n defaultOpen?: boolean\n /**\n * Makes the section inert. It can no longer be opened, the keyboard skips over\n * it, and it is greyed out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n
|
|
1
|
+
{"version":3,"file":"VAccordionItem.js","names":[],"sources":["../../../src/components/VAccordion/VAccordionItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One section of an accordion: a heading the reader can click, and the content it\n * reveals. It is a native `<details>`/`<summary>` pair, so the browser owns the\n * open and closed state, the keyboard and the accessibility semantics. The only JS\n * is the `v-model:open` bridge, fed by the element, and the click a disabled summary\n * has to cancel, both shared with VSideNavigationItem through `useDetailsOpen`.\n *\n * The opening is animated entirely in CSS, with `::details-content` and\n * `interpolate-size` (`styles/disclosure.css`). Both are recent additions to the\n * language: where they are missing the section simply appears at once, which is the\n * intended fallback.\n */\n\nimport { computed, inject, provide } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { expand_more as expandMoreIcon } from '../VIcon/icons/expand_more'\nimport type { IconSource } from '../VIcon/types'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { accordionKey } from './context'\n\nimport { useDetailsOpen } from '../../composables/useDetailsOpen'\n\ninterface AccordionItemProps {\n /**\n * The heading of the section, the line that stays visible when it is closed. Use\n * the `#title` slot instead when the heading needs markup rather than plain text.\n *\n * Note that this prop shadows the HTML attribute of the same name on the component,\n * so no tooltip can be set through it.\n */\n title?: string\n /**\n * A secondary line under the title, for a short explanation or a status. The\n * `#subtitle` slot replaces it when markup is needed.\n */\n subtitle?: string\n /**\n * An icon placed before the title: an icon name, or an explicit render\n * (`{ src }`, `{ component }`…). The `#icon` slot replaces it.\n *\n * It carries no side in its name because there is only one: the end of the row belongs\n * to the chevron, so there is nothing for a start to be told apart from. That is the\n * rule every single-icon component of the design system follows, and its slot is named\n * `#icon` for the same reason.\n */\n icon?: IconSource\n /**\n * Renders the section already open. Only its initial value is read: the browser\n * owns the state afterwards, so changing this prop later will not close a section\n * the reader has opened. Bind `v-model:open` to drive it instead.\n */\n defaultOpen?: boolean\n /**\n * Makes the section inert. It can no longer be opened, the keyboard skips over\n * it, and it is greyed out through the colour tokens.\n */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<AccordionItemProps>(), {\n title: undefined,\n subtitle: undefined,\n icon: undefined,\n defaultOpen: false,\n disabled: false,\n})\n\n// TRAP — \"not bound\" is written as `null` and not `undefined`. A model typed as a plain\n// boolean is declared as such at runtime, and Vue casts an ABSENT boolean prop to `false`,\n// which would silently overwrite `defaultOpen`. The explicit default disarms that cast.\n/**\n * Whether the section is open, when the consumer wants to drive or observe it. Left\n * unbound, the browser keeps that state to itself, `defaultOpen` giving only the initial\n * value. `null` means unbound.\n */\nconst open = defineModel<boolean | null>('open', { default: null })\n\ndefineSlots<{\n /** The content revealed when the section is open. */\n default(): unknown\n /** A title made of markup, which replaces the `title` prop. */\n title?(): unknown\n /** A subtitle made of markup, which replaces the `subtitle` prop. */\n subtitle?(): unknown\n /** Free content before the title, which takes the place of `icon`. */\n icon?(): unknown\n}>()\n\nconst accordion = inject(accordionKey, null)\n// The group stops here: an item nested in this one's content without a VAccordion of its\n// own would otherwise share this group's name, and the browser closes every other member\n// of a name group when one opens, the section holding it included.\nprovide(accordionKey, null)\n\n/**\n * Both icons are chosen on the enclosing group. The chevron fallback is what keeps\n * an item rendering correctly when it is used outside a VAccordion.\n */\nconst expandIcon = computed(() => accordion?.expandIcon ?? expandMoreIcon)\nconst collapseIcon = computed(() => accordion?.collapseIcon)\n\nconst { openAttr, onToggle, onSummaryClick } = useDetailsOpen(open, {\n defaultOpen: () => props.defaultOpen,\n disabled: () => props.disabled,\n})\n</script>\n\n<template>\n <details\n class=\"v-accordion-item v-disclosure\"\n :name=\"accordion?.name\"\n :open=\"openAttr\"\n :data-swap=\"collapseIcon ? '' : undefined\"\n @toggle=\"onToggle\"\n >\n <summary\n class=\"v-accordion-summary\"\n :data-disabled=\"disabled ? '' : undefined\"\n :aria-disabled=\"disabled || undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click=\"onSummaryClick\"\n >\n <slot name=\"icon\">\n <VIcon v-if=\"icon\" class=\"v-accordion-icon\" v-bind=\"iconProps(icon)\" />\n </slot>\n <span class=\"v-accordion-heading\">\n <span class=\"v-accordion-title\"\n ><slot name=\"title\">{{ title }}</slot></span\n >\n <VTypography\n v-if=\"subtitle !== undefined || $slots.subtitle\"\n as=\"span\"\n variant=\"caption\"\n tone=\"muted\"\n class=\"v-accordion-subtitle\"\n ><slot name=\"subtitle\">{{ subtitle }}</slot></VTypography\n >\n </span>\n <VIcon class=\"v-accordion-chevron v-disclosure-chevron\" v-bind=\"iconProps(expandIcon)\" />\n <!-- Both icons are always in the DOM; [open] decides which one shows, in CSS alone -->\n <VIcon\n v-if=\"collapseIcon\"\n class=\"v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open\"\n v-bind=\"iconProps(collapseIcon)\"\n />\n </summary>\n <div class=\"v-accordion-content\">\n <slot />\n </div>\n </details>\n</template>\n\n<style>\n@layer vectis.components {\n .v-accordion-item + .v-accordion-item {\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n .v-accordion-summary {\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: flex;\n align-items: center;\n gap: var(--vectis-space-3);\n padding: var(--accordion-pad-block, var(--vectis-space-4))\n var(--accordion-pad-inline, var(--vectis-space-5));\n cursor: pointer;\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n color: var(--vectis-color-text);\n }\n\n .v-accordion-summary:hover:not([data-disabled]) {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-accordion-summary:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n .v-accordion-item:first-child > .v-accordion-summary {\n border-start-start-radius: var(--accordion-corner-radius, 0);\n border-start-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-item:last-child:not([open]) > .v-accordion-summary {\n border-end-start-radius: var(--accordion-corner-radius, 0);\n border-end-end-radius: var(--accordion-corner-radius, 0);\n }\n\n .v-accordion-heading {\n flex: 1;\n display: flex;\n flex-direction: column;\n line-height: var(--vectis-text-label-leading);\n }\n\n .v-accordion-icon {\n flex: none;\n color: var(--vectis-color-text-muted);\n }\n\n /* A disabled item greys out through the colour tokens and never through\n `opacity`, the rule every control in the DS follows. */\n .v-accordion-summary[data-disabled] {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n /* The icon and the subtitle default to text-muted, which is DARKER than the\n text-subtle a disabled title takes: left to themselves they would come out\n stronger than the label they belong to, so they inherit it instead. The chevron\n gets the same treatment from `styles/disclosure.css`. */\n .v-accordion-summary[data-disabled] .v-accordion-icon,\n .v-accordion-summary[data-disabled] .v-accordion-subtitle {\n color: inherit;\n }\n\n .v-accordion-content {\n padding: var(--accordion-content-pad-start, var(--vectis-space-2))\n var(--accordion-pad-inline, var(--vectis-space-5))\n var(--accordion-pad-block, var(--vectis-space-4));\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n color: var(--vectis-color-text-muted);\n }\n\n /* The disclosure animation, the chevron's rotation or swap and the WebKit marker come\n from `styles/disclosure.css`, reduced-motion block included. */\n}\n</style>\n"],"mappings":""}
|
|
@@ -4,17 +4,17 @@ import n from "../VTypography/VTypography.js";
|
|
|
4
4
|
import { expand_more as r } from "../VIcon/icons/expand_more.js";
|
|
5
5
|
import { accordionKey as i } from "./context.js";
|
|
6
6
|
import { useDetailsOpen as a } from "../../composables/useDetailsOpen.js";
|
|
7
|
-
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeModels as h, mergeProps as g, openBlock as _,
|
|
7
|
+
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeModels as h, mergeProps as g, openBlock as _, provide as v, renderSlot as y, toDisplayString as b, unref as x, useModel as S, withCtx as C } from "vue";
|
|
8
8
|
//#region src/components/VAccordion/VAccordionItem.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var w = [
|
|
10
10
|
"name",
|
|
11
11
|
"open",
|
|
12
12
|
"data-swap"
|
|
13
|
-
],
|
|
13
|
+
], T = [
|
|
14
14
|
"data-disabled",
|
|
15
15
|
"aria-disabled",
|
|
16
16
|
"tabindex"
|
|
17
|
-
],
|
|
17
|
+
], E = { class: "v-accordion-heading" }, D = { class: "v-accordion-title" }, O = { class: "v-accordion-content" }, k = /*@__PURE__*/ p({
|
|
18
18
|
__name: "VAccordionItem",
|
|
19
19
|
props: /*@__PURE__*/ h({
|
|
20
20
|
title: { default: void 0 },
|
|
@@ -37,46 +37,48 @@ var C = [
|
|
|
37
37
|
}),
|
|
38
38
|
emits: ["update:open"],
|
|
39
39
|
setup(p) {
|
|
40
|
-
let h = p,
|
|
40
|
+
let h = p, k = S(p, "open"), A = m(i, null);
|
|
41
|
+
v(i, null);
|
|
42
|
+
let j = o(() => A?.expandIcon ?? r), M = o(() => A?.collapseIcon), { openAttr: N, onToggle: P, onSummaryClick: F } = a(k, {
|
|
41
43
|
defaultOpen: () => h.defaultOpen,
|
|
42
44
|
disabled: () => h.disabled
|
|
43
45
|
});
|
|
44
46
|
return (r, i) => (_(), l("details", {
|
|
45
47
|
class: "v-accordion-item v-disclosure",
|
|
46
|
-
name:
|
|
47
|
-
open:
|
|
48
|
-
"data-swap":
|
|
49
|
-
onToggle: i[1] ||= (...e) =>
|
|
48
|
+
name: x(A)?.name,
|
|
49
|
+
open: x(N),
|
|
50
|
+
"data-swap": M.value ? "" : void 0,
|
|
51
|
+
onToggle: i[1] ||= (...e) => x(P) && x(P)(...e)
|
|
50
52
|
}, [u("summary", {
|
|
51
53
|
class: "v-accordion-summary",
|
|
52
54
|
"data-disabled": p.disabled ? "" : void 0,
|
|
53
55
|
"aria-disabled": p.disabled || void 0,
|
|
54
56
|
tabindex: p.disabled ? -1 : void 0,
|
|
55
|
-
onClick: i[0] ||= (...e) =>
|
|
57
|
+
onClick: i[0] ||= (...e) => x(F) && x(F)(...e)
|
|
56
58
|
}, [
|
|
57
|
-
|
|
59
|
+
y(r.$slots, "icon", {}, () => [p.icon ? (_(), s(t, g({
|
|
58
60
|
key: 0,
|
|
59
61
|
class: "v-accordion-icon"
|
|
60
|
-
},
|
|
61
|
-
u("span",
|
|
62
|
+
}, x(e)(p.icon)), null, 16)) : c("", !0)]),
|
|
63
|
+
u("span", E, [u("span", D, [y(r.$slots, "title", {}, () => [d(b(p.title), 1)])]), p.subtitle !== void 0 || r.$slots.subtitle ? (_(), s(n, {
|
|
62
64
|
key: 0,
|
|
63
65
|
as: "span",
|
|
64
66
|
variant: "caption",
|
|
65
67
|
tone: "muted",
|
|
66
68
|
class: "v-accordion-subtitle"
|
|
67
69
|
}, {
|
|
68
|
-
default:
|
|
70
|
+
default: C(() => [y(r.$slots, "subtitle", {}, () => [d(b(p.subtitle), 1)])]),
|
|
69
71
|
_: 3
|
|
70
72
|
})) : c("", !0)]),
|
|
71
|
-
f(t, g({ class: "v-accordion-chevron v-disclosure-chevron" },
|
|
72
|
-
|
|
73
|
+
f(t, g({ class: "v-accordion-chevron v-disclosure-chevron" }, x(e)(j.value)), null, 16),
|
|
74
|
+
M.value ? (_(), s(t, g({
|
|
73
75
|
key: 0,
|
|
74
76
|
class: "v-accordion-chevron v-accordion-chevron-open v-disclosure-chevron v-disclosure-chevron-open"
|
|
75
|
-
},
|
|
76
|
-
], 8,
|
|
77
|
+
}, x(e)(M.value)), null, 16)) : c("", !0)
|
|
78
|
+
], 8, T), u("div", O, [y(r.$slots, "default")])], 40, w));
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
81
|
//#endregion
|
|
80
|
-
export {
|
|
82
|
+
export { k as default };
|
|
81
83
|
|
|
82
84
|
//# sourceMappingURL=VAccordionItem.vue_vue_type_script_setup_true_lang.js.map
|