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.
- package/README.md +40 -6
- package/dist/components/VAccordion/VAccordion.css +1 -1
- package/dist/components/VAccordion/VAccordion.d.ts +9 -16
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.css +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.d.ts +1 -8
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.css +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +44 -29
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +6 -10
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.css +1 -1
- package/dist/components/VBadge/VBadge.d.ts +31 -10
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
- 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 +30 -10
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.css +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +76 -13
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/context.d.ts +30 -0
- package/dist/components/VButton/context.js +6 -0
- package/dist/components/VButton/context.js.map +1 -0
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +50 -36
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
- 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 +5 -11
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -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 +10 -13
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
- 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 +15 -20
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
- 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.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +158 -0
- package/dist/components/VCalendar/gesture.js +170 -0
- package/dist/components/VCalendar/gesture.js.map +1 -0
- package/dist/components/VCalendar/keyboard.d.ts +9 -3
- package/dist/components/VCalendar/keyboard.js +2 -6
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +67 -54
- package/dist/components/VCalendar/layout.js +77 -69
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +55 -0
- package/dist/components/VCalendar/timeGrid.js +71 -0
- package/dist/components/VCalendar/timeGrid.js.map +1 -0
- package/dist/components/VCalendar/types.d.ts +41 -16
- package/dist/components/VCarousel/VCarousel.css +1 -1
- package/dist/components/VCarousel/VCarousel.d.ts +21 -41
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
- 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 +0 -12
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
- 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 +36 -26
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
- 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 +127 -31
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
- 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.d.ts +0 -9
- 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/VComboboxOption.css +1 -1
- package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +50 -28
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
- 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 +90 -42
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.css +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialog.css +1 -1
- package/dist/components/VDialog/VDialog.d.ts +45 -33
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
- package/dist/components/VDialog/VDialogAlert.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.css +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +78 -26
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.css +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.d.ts +2 -27
- package/dist/components/VFilePicker/fileKind.js +9 -8
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.css +1 -1
- package/dist/components/VIcon/VIcon.d.ts +15 -6
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- 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.map +1 -1
- package/dist/components/VIcon/types.d.ts +12 -12
- package/dist/components/VIconButton/VIconButton.css +1 -1
- package/dist/components/VIconButton/VIconButton.d.ts +28 -11
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.css +1 -1
- package/dist/components/VInput/VInput.d.ts +26 -7
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +2 -0
- package/dist/components/VInput/VInputGroup.d.ts +47 -0
- package/dist/components/VInput/VInputGroup.js +9 -0
- package/dist/components/VInput/VInputGroup.js.map +1 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VInput/context.d.ts +11 -0
- package/dist/components/VInput/context.js +6 -0
- package/dist/components/VInput/context.js.map +1 -0
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.d.ts +23 -30
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
- 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.d.ts +12 -8
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -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 +11 -19
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +2 -6
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +60 -22
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
- 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 +26 -7
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
- 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 +15 -4
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
- 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 +23 -8
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
- 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.d.ts +36 -18
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +4 -2
- 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.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
- 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.d.ts +9 -17
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- 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 +22 -30
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/context.d.ts +0 -14
- package/dist/components/VSideNavigation/context.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- 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 +52 -27
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
- 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 +0 -23
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +0 -27
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.css +1 -1
- package/dist/components/VSpinner/VSpinner.d.ts +6 -6
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
- 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 +35 -13
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
- 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 +12 -12
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.d.ts +2 -10
- package/dist/components/VTabs/VTabPanel.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VTabs/VTabPanel.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 +27 -18
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/context.d.ts +9 -19
- package/dist/components/VTabs/context.js +1 -1
- package/dist/components/VTabs/context.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.css +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +34 -6
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
- 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 +123 -33
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +24 -0
- package/dist/components/VTimeInput/search.js +22 -0
- package/dist/components/VTimeInput/search.js.map +1 -0
- package/dist/components/VTimePicker/VTimePicker.css +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +88 -0
- package/dist/components/VTimePicker/limits.js +70 -0
- package/dist/components/VTimePicker/limits.js.map +1 -0
- package/dist/components/VToast/VToast.css +1 -1
- package/dist/components/VToast/VToast.d.ts +0 -10
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.css +1 -1
- package/dist/components/VToast/VToaster.d.ts +0 -17
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +10 -19
- package/dist/components/VToast/state.js +1 -1
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.css +1 -1
- package/dist/components/VToggle/VToggle.d.ts +56 -11
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +16 -2
- package/dist/components/VToggle/VToggleItem.js +0 -2
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/context.d.ts +4 -24
- package/dist/components/VToggle/context.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.css +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +9 -33
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- 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.d.ts +0 -17
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +42 -0
- package/dist/composables/useClearable.js +19 -0
- package/dist/composables/useClearable.js.map +1 -0
- package/dist/composables/useControlShape.d.ts +22 -0
- package/dist/composables/useControlShape.js +13 -0
- package/dist/composables/useControlShape.js.map +1 -0
- package/dist/composables/useDetailsOpen.d.ts +22 -0
- package/dist/composables/useDetailsOpen.js +21 -0
- package/dist/composables/useDetailsOpen.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +0 -15
- package/dist/composables/useFieldIds.js +8 -7
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +21 -18
- package/dist/composables/useFieldPanel.js +43 -23
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.d.ts +0 -22
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +45 -17
- package/dist/composables/useFileField.js +40 -20
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useFocusoutDismiss.d.ts +0 -15
- package/dist/composables/useFocusoutDismiss.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +29 -14
- package/dist/composables/useIconClickHandlers.js +15 -5
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.d.ts +20 -0
- package/dist/composables/useInertLink.js +23 -0
- package/dist/composables/useInertLink.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +33 -10
- package/dist/composables/useMaskedField.js +45 -1
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +15 -1
- package/dist/composables/usePopover.js +23 -8
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.d.ts +5 -8
- package/dist/composables/useProgressValue.js +6 -3
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +12 -19
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useTimer.d.ts +8 -10
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.d.ts +2 -10
- package/dist/i18n/en.js +18 -19
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +2 -18
- package/dist/i18n/fr.js +18 -19
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +44 -47
- package/dist/i18n/state.js +20 -17
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +53 -44
- package/dist/icons.d.ts +3 -3
- package/dist/index.d.ts +43 -17
- package/dist/index.js +45 -44
- package/dist/styles.css +1 -1
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +5 -1
- package/dist/tokens/primitives.js.map +1 -1
- package/dist/tokens/semantic.d.ts +5 -1
- package/dist/tokens/semantic.js +6 -2
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens/types.d.ts +7 -15
- package/dist/tokens/types.js.map +1 -1
- package/dist/tokens.json +25 -5
- package/dist/types.d.ts +24 -0
- package/dist/utils/array.d.ts +3 -6
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/arrowNav.d.ts +17 -17
- package/dist/utils/arrowNav.js +5 -3
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +11 -15
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/css.d.ts +22 -11
- package/dist/utils/css.js +5 -2
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +42 -19
- package/dist/utils/date.js +97 -98
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +6 -12
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +5 -6
- package/dist/utils/file.d.ts +46 -58
- package/dist/utils/file.js +43 -36
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +8 -17
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +12 -0
- package/dist/utils/hostWarns.js +6 -0
- package/dist/utils/hostWarns.js.map +1 -0
- package/dist/utils/ids.d.ts +10 -0
- package/dist/utils/ids.js +8 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/matcher.d.ts +5 -9
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +12 -0
- package/dist/utils/memo.js +9 -0
- package/dist/utils/memo.js.map +1 -0
- package/dist/utils/number.d.ts +3 -4
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/text.d.ts +20 -9
- package/dist/utils/text.js +17 -3
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +53 -61
- package/dist/utils/time.js +49 -45
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +8 -15
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/VToggle/VToggleItem.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VProgressLinear.js","names":[],"sources":["../../../src/components/VProgressLinear/VProgressLinear.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core — no behavioural JS at all: value normalization and the display string.\n/**\n * A bar filling up as something progresses. The element rendered IS the track, and the\n * whole geometry follows from a single number set on it — the fraction filled, with no\n * unit. Everything is written in logical properties, so turning the bar vertical needs\n * nothing but a change of writing direction.\n *\n * There is no behavioural JavaScript: the value is clamped and a percentage is\n * formatted, and that is all.\n *\n * On naming: pass an `aria-label` saying what is progressing. The text shown inside the\n * bar cannot serve as that name — the role a progress bar carries makes its content\n * presentational, so screen readers do not announce it.\n */\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\ninterface ProgressLinearProps {\n /** How far along it is. Anything outside the range is brought back into it. */\n value?: number\n /** What counts as finished. The other end is always zero. */\n max?: number\n /**\n * Says that the progress cannot be measured: the bar animates continuously and the\n * value is ignored. It is what to use while waiting for a server that reports no\n * percentage.\n */\n indeterminate?: boolean\n /** What the progress means, expressed as a colour. */\n tone?: 'accent' | 'success' | 'warning' | 'danger' | 'neutral'\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which replaces the tone. The\n * track's own shade is derived from it against the theme, so it follows the light and\n * the dark one.\n */\n color?: string\n /**\n * How thick the bar is, always IN PIXELS: `12` and `'12'` both give 12px. It is 4px\n * by default — bear in mind that showing text inside a bar that thin needs an\n * explicit thickness.\n */\n thickness?: number | string\n /** Whether the ends of the bar are rounded or square. */\n shape?: 'rounded' | 'square'\n /**\n * Writes the percentage inside the bar. It is ignored while the progress is\n * unmeasurable, there being no figure to write.\n */\n showValue?: boolean\n /**\n * Where that text sits along the bar. On a vertical bar the start is the zero end,\n * hence the bottom.\n */\n valuePosition?: 'start' | 'center' | 'end'\n /** Turns the bar upright, filling from the bottom up. */\n orientation?: 'horizontal' | 'vertical'\n}\n\nconst props = withDefaults(defineProps<ProgressLinearProps>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n tone: 'accent',\n color: undefined,\n thickness: undefined,\n shape: 'rounded',\n showValue: false,\n valuePosition: 'center',\n orientation: 'horizontal',\n})\n\ndefineSlots<{\n /**\n * What to write inside the bar instead of the percentage.\n *\n * TRAP — it is rendered TWICE, once over the empty track and once over the filled\n * part in a colour that contrasts with it, each copy cut at the fill's edge. So\n * whatever it renders must be pure: anything with a side effect would happen twice.\n */\n default?(props: { value: number; max: number; percent: number }): unknown\n}>()\n\n/* The percent sign, and the non-breaking space French puts before it where English puts\n nothing, are a convention of the language: they belong in the dictionary rather than\n in this file. Any other format goes through the slot above. */\nconst m = useMessages()\n\nconst { clamped, fraction } = useProgressValue(\n () => props.value,\n () => props.max,\n)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear\"\n role=\"progressbar\"\n :aria-label=\"m.progress.label\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-orientation=\"orientation === 'vertical' ? 'vertical' : undefined\"\n :data-value-position=\"valuePosition\"\n :data-indeterminate=\"indeterminate ? '' : undefined\"\n :aria-valuenow=\"indeterminate ? undefined : clamped\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"{\n '--fill-fraction': String(fraction),\n '--custom-color': color,\n '--progress-thickness': px(thickness),\n }\"\n >\n <span class=\"v-progress-linear-fill\" />\n <!--\n The same text twice, each copy cut at the fill's edge so that the two complete\n each other exactly: the first in the ordinary text colour over the empty track,\n the second over the filled part, coloured to contrast with it. The second is\n hidden from screen readers, being a duplicate of text already there.\n -->\n <template v-if=\"!indeterminate && (showValue || $slots.default)\">\n <span class=\"v-progress-linear-text\">\n <slot :value=\"clamped\" :max=\"max\" :percent=\"fraction * 100\">\n {{ m.progress.percent(Math.round(fraction * 100)) }}\n </slot>\n </span>\n <span class=\"v-progress-linear-text\" data-on-fill aria-hidden=\"true\">\n <slot :value=\"clamped\" :max=\"max\" :percent=\"fraction * 100\">\n {{ m.progress.percent(Math.round(fraction * 100)) }}\n </slot>\n </span>\n </template>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The element IS the track, and it takes the whole length available. Sizing it is the\n * consumer's business, through the parent or through a width of their own — a\n * consumer's style sits outside our layers and always wins.\n */\n .v-progress-linear {\n --progress-thickness: var(--vectis-control-size-progress-linear-thickness);\n position: relative;\n display: block;\n inline-size: 100%;\n block-size: var(--progress-thickness);\n border-radius: var(--vectis-radius-pill);\n background: var(--progress-track);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-progress-linear[data-shape='square'] {\n border-radius: 0;\n }\n\n .v-progress-linear-fill {\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n inline-size: calc(100% * var(--fill-fraction));\n border-radius: inherit;\n background: var(--progress-fill);\n /*\n * The fill is animated by changing its LENGTH, which the browser has to lay out\n * again on every frame. Scaling it would be cheaper, but a scale is physical: it\n * would have to be undone for the vertical orientation and again for a\n * right-to-left page, where a logical length simply works.\n *\n * The duration and easing are repeated by the clip of the text over the fill, or the\n * colour boundary would drift away from the fill's own edge for the length of the\n * transition.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n .v-progress-linear[data-tone='accent'] {\n --progress-fill: var(--vectis-color-accent);\n --progress-track: var(--vectis-color-accent-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='success'] {\n --progress-fill: var(--vectis-color-success);\n --progress-track: var(--vectis-color-success-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='danger'] {\n --progress-fill: var(--vectis-color-danger);\n --progress-track: var(--vectis-color-danger-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='warning'] {\n --progress-fill: var(--vectis-color-warning);\n --progress-track: var(--vectis-color-warning-surface);\n /* White does not reach the required contrast on amber, so this tone has a text\n colour of its own. */\n --tone-text-fallback: var(--vectis-color-text-on-warning);\n }\n\n /* The neutral tone inverts text and surface rather than using a mid grey, which would\n be unreadable in one theme or the other. */\n .v-progress-linear[data-tone='neutral'] {\n --progress-fill: var(--vectis-color-text);\n --progress-track: var(--vectis-color-surface-muted);\n --tone-text-fallback: var(--vectis-color-surface);\n }\n\n /* Placed after the tones on purpose: the specificity is the same, so it is the order\n that lets a custom colour override the tone it replaces. */\n .v-progress-linear[data-custom] {\n --progress-fill: var(--custom-color);\n --progress-track: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n /* The text inside the bar, in two copies laid over the same box — the track's own,\n which is why a cut expressed as a fraction of it lands exactly on the fill's edge.\n Bear in mind that the default 4px thickness cannot hold text at all: showing any\n implies asking for a thicker bar.\n\n TRAP — the two copies are COMPLEMENTARY and never superimposed: this one is cut OUT\n of the filled part, the other cut TO it, so every letter is painted exactly once.\n Removing either clip raises no error and stays invisible for as long as both copies\n resolve to the SAME colour, which is what happens wherever the adaptive colour\n function is unsupported. Where it IS supported and the two disagree — black over an\n accent fill against white text in the dark theme — the copy underneath shows its\n antialiased edges all around the letters of the one on top, and the label reads as\n a halo. */\n .v-progress-linear-text {\n /* The two insets of the cut: one on the edge the fill grows FROM, one on the edge it\n grows towards. They are named after those roles rather than after physical sides,\n so the three geometry rules further down — horizontal, right-to-left, vertical —\n all read the same pair. This copy cuts on the start side; the one over the fill\n swaps them. */\n --progress-clip-start: calc(100% * var(--fill-fraction));\n --progress-clip-end: -100vmax;\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--vectis-space-2);\n color: var(--vectis-color-text);\n /* The large negative inset on the two sides that do NOT carry the cut is what stops\n text taller or wider than the bar from being cropped by its own clip. */\n clip-path: inset(-100vmax var(--progress-clip-end) -100vmax var(--progress-clip-start));\n /* The same duration and easing as the fill's own length, or the colour boundary\n would drift away from the fill's edge for the length of the transition. */\n transition: clip-path var(--vectis-duration-base) var(--vectis-ease-default);\n /* The bar itself is turned on its side in vertical mode; the text is put back\n upright here, since a label read sideways is not the point. */\n writing-mode: horizontal-tb;\n white-space: nowrap;\n pointer-events: none;\n }\n\n .v-progress-linear[data-value-position='start'] .v-progress-linear-text {\n justify-content: start;\n }\n\n .v-progress-linear[data-value-position='end'] .v-progress-linear-text {\n justify-content: end;\n }\n\n .v-progress-linear-text[data-on-fill] {\n /* The exact complement of the copy above: the cut moves to the other end of the\n axis, so the two together cover the whole bar and overlap nowhere. */\n --progress-clip-start: -100vmax;\n --progress-clip-end: calc(100% * (1 - var(--fill-fraction)));\n /* The per-tone fallback colour. The adaptive one cannot simply be written as a\n second declaration after it: because that declaration contains a var(), a browser\n with no support does not reject it at parse time — it would win the cascade and\n only then turn invalid, which resets the colour to inherited and leaves the\n fallback never applied. The block below is the way round it, being evaluated\n before any var() substitution. */\n color: var(--tone-text-fallback);\n }\n\n /* Where the adaptive colour function exists, the text picks black or white against\n whatever colour the fill ended up with. */\n @supports (color: contrast-color(red)) {\n .v-progress-linear-text[data-on-fill] {\n color: contrast-color(var(--progress-fill));\n }\n }\n\n /* In a right-to-left page the fill grows from the right, so the two insets change\n physical sides — the variables themselves keep their meaning. */\n .v-progress-linear:dir(rtl) .v-progress-linear-text {\n clip-path: inset(-100vmax var(--progress-clip-start) -100vmax var(--progress-clip-end));\n }\n\n /* Upright, the bar fills from the bottom.\n\n Changing the writing direction on the element is enough to turn everything: the\n axis the fill grows along becomes vertical, so the length and the thickness swap\n places, and both the fill and the animation follow with no rule written twice.\n\n TRAP — putting zero at the bottom is NOT done by reversing the direction, which\n would also apply to the text of the two copies: bidirectional reordering would then\n display \"50 %\" as \"% 50\". The fill is anchored to the far end of the axis instead.\n\n The length comes from a token because there is nothing to inherit it from: in a\n parent of automatic height the bar would collapse to nothing. A consumer's own\n height overrides it, sitting outside our layers. */\n .v-progress-linear[data-orientation='vertical'] {\n writing-mode: vertical-lr;\n inline-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-fill {\n inset-inline-start: auto;\n inset-inline-end: 0;\n }\n\n /* The text now stacks along the vertical axis, whose start is the zero end — the\n bottom of the bar. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text {\n flex-direction: column-reverse;\n padding-inline: 0;\n padding-block: var(--vectis-space-2);\n }\n\n /* The cut moves to the vertical axis: the fill rises from the bottom, which is that\n axis' start. It is therefore the same in both reading directions, which means the\n right-to-left rule further up has to be neutralized.\n\n TRAP — the second selector is what neutralizes it, and it is written that way on\n purpose: it is one step MORE specific than that rule, where the first selector alone\n would merely tie with it and win by source order — a far more fragile arrangement. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text,\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-text {\n clip-path: inset(var(--progress-clip-end) -100vmax var(--progress-clip-start) -100vmax);\n }\n\n /* When the progress cannot be measured, a bar of fixed size crosses the track from\n just outside one end to just outside the other. At each extreme it is exactly flush\n with the edge without ever pulling away from it, which is what makes the loop\n invisible and keeps the track from ever looking empty — no second bar is needed.\n\n The easing carries the whole impression: a gradual entry, a quick crossing, a damped\n exit. A linear run, or an asymmetric curve, immediately reads as mechanical.\n\n The movement is expressed in LOGICAL properties — a position and a size as\n percentages of the track — rather than as a transform. One definition then serves\n the horizontal, the vertical and the right-to-left cases, where a transform, being\n physical, would need its own keyframes per axis and a flip per direction. */\n .v-progress-linear[data-indeterminate] {\n overflow: hidden;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n /* The starting position is derived from this size, and the two must stay tied: that\n is what has the bar begin exactly off the track rather than half on it. */\n --progress-bar: 40%;\n /* The anchoring is put back at the start of the axis, vertical case included — where\n a measurable progress anchors at the far end instead. */\n inset-inline-start: 0;\n inset-inline-end: auto;\n inline-size: var(--progress-bar);\n /* The transition of a measurable progress has no place here: switching to this mode\n would otherwise be animated as the bar growing to its new size. */\n transition: none;\n animation: v-progress-linear-indeterminate var(--vectis-duration-1500) var(--vectis-ease-in-out)\n infinite;\n }\n\n @keyframes v-progress-linear-indeterminate {\n from {\n inset-inline-start: calc(-1 * var(--progress-bar));\n }\n\n to {\n inset-inline-start: 100%;\n }\n }\n\n /* Turned upright, the axis runs downwards, so the bar would travel from the top down —\n the opposite of a measurable fill, which rises from the bottom. The same keyframes\n are simply read backwards, which changes nothing else BECAUSE the easing curve is\n symmetric; an asymmetric one would need a second set of keyframes.\n\n Nothing is needed for a right-to-left page: the logical inset already follows the\n reading direction. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n /* Slowed down and not stopped: a motionless loader no longer says that anything is\n happening, which is the one thing it exists to say. */\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"VProgressLinear.js","names":[],"sources":["../../../src/components/VProgressLinear/VProgressLinear.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core — no behavioural JS at all: value normalization and the display string.\n/**\n * A bar filling up as something progresses. The element rendered IS the track, and the\n * whole geometry follows from a single number set on it — the fraction filled, with no\n * unit. Everything is written in logical properties, so turning the bar vertical needs\n * nothing but a change of writing direction.\n *\n * There is no behavioural JavaScript: the value is clamped and a percentage is\n * formatted, and that is all.\n *\n * On naming: pass a `label` saying what is progressing. The text shown inside the\n * bar cannot serve as that name — the role a progress bar carries makes its content\n * presentational, so screen readers do not announce it.\n */\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\n/** What the progress means, in colour. */\nexport type ProgressLinearTone = 'accent' | 'success' | 'warning' | 'danger' | 'neutral'\n\n/** How the track and the fill end. */\nexport type ProgressLinearShape = 'rounded' | 'square'\n\n/** Where the value sits along the bar. */\nexport type ProgressLinearValuePosition = 'start' | 'center' | 'end'\n\n/** Which way the bar fills. */\nexport type ProgressLinearOrientation = 'horizontal' | 'vertical'\n\ninterface ProgressLinearProps {\n /** How far along it is. Anything outside the range is brought back into it. */\n value?: number\n /**\n * What is progressing, in words, for screen readers. It draws nothing on screen, and falls\n * back to the design system dictionary; an `aria-label` or `aria-labelledby` of your own\n * takes precedence over it.\n */\n label?: string\n /** What counts as finished. The other end is always zero. */\n max?: number\n /**\n * Says that the progress cannot be measured: the bar animates continuously and the\n * value is ignored. It is what to use while waiting for a server that reports no\n * percentage.\n */\n indeterminate?: boolean\n /** What the progress means, expressed as a colour. */\n tone?: ProgressLinearTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which replaces the tone. The\n * track's own shade is derived from it against the theme, so it follows the light and\n * the dark one.\n */\n color?: string\n /**\n * How thick the bar is, always IN PIXELS: `12` and `'12'` both give 12px. It is 4px\n * by default — bear in mind that showing text inside a bar that thin needs an\n * explicit thickness.\n */\n thickness?: number | string\n /** Whether the ends of the bar are rounded or square. */\n shape?: ProgressLinearShape\n /**\n * Writes the percentage inside the bar. It is ignored while the progress is\n * unmeasurable, there being no figure to write.\n */\n showValue?: boolean\n /**\n * Where that text sits along the bar. On a vertical bar the start is the zero end,\n * hence the bottom.\n */\n valuePosition?: ProgressLinearValuePosition\n /** Turns the bar upright, filling from the bottom up. */\n orientation?: ProgressLinearOrientation\n}\n\nconst props = withDefaults(defineProps<ProgressLinearProps>(), {\n value: 0,\n label: undefined,\n max: 100,\n indeterminate: false,\n tone: 'accent',\n color: undefined,\n thickness: undefined,\n shape: 'rounded',\n showValue: false,\n valuePosition: 'center',\n orientation: 'horizontal',\n})\n\ndefineSlots<{\n /**\n * What to write inside the bar instead of the percentage.\n *\n * TRAP — it is rendered TWICE, once over the empty track and once over the filled\n * part in a colour that contrasts with it, each copy cut at the fill's edge. So\n * whatever it renders must be pure: anything with a side effect would happen twice.\n */\n default?(props: { value: number; max: number; percent: number }): unknown\n}>()\n\n/* The percent sign, and the non-breaking space French puts before it where English puts\n nothing, are a convention of the language: they belong in the dictionary rather than\n in this file. Any other format goes through the slot above. */\nconst m = useMessages()\n\nconst {\n max: normalizedMax,\n clamped,\n fraction,\n percent,\n roundedPercent,\n} = useProgressValue(\n () => props.value,\n () => props.max,\n)\n\n// @a11y\n// The canonical cascade: a consumer's `aria-labelledby`, then their `aria-label`, then the\n// `label` prop, then the dictionary. An indicator takes no name from the text inside it, so\n// without the last step it would have none at all.\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.progress.label)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear v-tone\"\n role=\"progressbar\"\n :aria-label=\"ariaLabel\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-orientation=\"orientation\"\n :data-value-position=\"valuePosition\"\n :data-indeterminate=\"indeterminate ? '' : undefined\"\n :aria-valuenow=\"indeterminate ? undefined : clamped\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"normalizedMax\"\n :style=\"{\n '--fill-fraction': String(fraction),\n '--custom-color': color,\n '--progress-thickness': px(thickness),\n }\"\n >\n <span class=\"v-progress-linear-fill\" />\n <!--\n The same text twice, each copy cut at the fill's edge so that the two complete\n each other exactly: the first in the ordinary text colour over the empty track,\n the second over the filled part, coloured to contrast with it. The second is\n hidden from screen readers, being a duplicate of text already there.\n -->\n <template v-if=\"!indeterminate && (showValue || $slots.default)\">\n <span class=\"v-progress-linear-text\">\n <slot :value=\"clamped\" :max=\"normalizedMax\" :percent=\"percent\">\n {{ m.progress.percent(roundedPercent) }}\n </slot>\n </span>\n <span class=\"v-progress-linear-text\" data-on-fill aria-hidden=\"true\">\n <slot :value=\"clamped\" :max=\"normalizedMax\" :percent=\"percent\">\n {{ m.progress.percent(roundedPercent) }}\n </slot>\n </span>\n </template>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The element IS the track, and it takes the whole length available. Sizing it is the\n * consumer's business, through the parent or through a width of their own — a\n * consumer's style sits outside our layers and always wins.\n */\n .v-progress-linear {\n --progress-thickness: var(--vectis-control-size-progress-linear-thickness);\n /* Fill, track and the text over the fill are the tone's solid, soft and on-solid\n colours, read from the shared table (`.v-tone`, set in the template). */\n --progress-fill: var(--tone-bg-solid);\n --progress-track: var(--tone-bg-soft);\n --progress-text-fallback: var(--tone-text-solid);\n position: relative;\n display: block;\n inline-size: 100%;\n block-size: var(--progress-thickness);\n border-radius: var(--vectis-radius-pill);\n background: var(--progress-track);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-progress-linear[data-shape='square'] {\n border-radius: 0;\n }\n\n .v-progress-linear-fill {\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n inline-size: calc(100% * var(--fill-fraction));\n border-radius: inherit;\n background: var(--progress-fill);\n /*\n * The fill is animated by changing its LENGTH, which the browser has to lay out\n * again on every frame. Scaling it would be cheaper, but a scale is physical: it\n * would have to be undone for the vertical orientation and again for a\n * right-to-left page, where a logical length simply works.\n *\n * The duration and easing are repeated by the clip of the text over the fill, or the\n * colour boundary would drift away from the fill's own edge for the length of the\n * transition.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /* A custom colour replaces the tone: at (0,2,0) it beats the base rule's mapping\n whatever the order the two are written in. */\n .v-progress-linear[data-custom] {\n --progress-fill: var(--custom-color);\n --progress-track: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --progress-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n /* The text inside the bar, in two copies laid over the same box — the track's own,\n which is why a cut expressed as a fraction of it lands exactly on the fill's edge.\n Bear in mind that the default 4px thickness cannot hold text at all: showing any\n implies asking for a thicker bar.\n\n TRAP — the two copies are COMPLEMENTARY and never superimposed: this one is cut OUT\n of the filled part, the other cut TO it, so every letter is painted exactly once.\n Removing either clip raises no error and stays invisible for as long as both copies\n resolve to the SAME colour, which is what happens wherever the adaptive colour\n function is unsupported. Where it IS supported and the two disagree — black over an\n accent fill against white text in the dark theme — the copy underneath shows its\n antialiased edges all around the letters of the one on top, and the label reads as\n a halo. */\n .v-progress-linear-text {\n /* The two insets of the cut: one on the edge the fill grows FROM, one on the edge it\n grows towards. They are named after those roles rather than after physical sides,\n so the three geometry rules further down — horizontal, right-to-left, vertical —\n all read the same pair. This copy cuts on the start side; the one over the fill\n swaps them. */\n --progress-clip-start: calc(100% * var(--fill-fraction));\n --progress-clip-end: -100vmax;\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--vectis-space-2);\n color: var(--vectis-color-text);\n /* The large negative inset on the two sides that do NOT carry the cut is what stops\n text taller or wider than the bar from being cropped by its own clip. */\n clip-path: inset(-100vmax var(--progress-clip-end) -100vmax var(--progress-clip-start));\n /* The same duration and easing as the fill's own length, or the colour boundary\n would drift away from the fill's edge for the length of the transition. */\n transition: clip-path var(--vectis-duration-base) var(--vectis-ease-default);\n /* The bar itself is turned on its side in vertical mode; the text is put back\n upright here, since a label read sideways is not the point. */\n writing-mode: horizontal-tb;\n white-space: nowrap;\n pointer-events: none;\n }\n\n .v-progress-linear[data-value-position='start'] .v-progress-linear-text {\n justify-content: start;\n }\n\n .v-progress-linear[data-value-position='end'] .v-progress-linear-text {\n justify-content: end;\n }\n\n .v-progress-linear-text[data-on-fill] {\n /* The exact complement of the copy above: the cut moves to the other end of the\n axis, so the two together cover the whole bar and overlap nowhere. */\n --progress-clip-start: -100vmax;\n --progress-clip-end: calc(100% * (1 - var(--fill-fraction)));\n /* The per-tone fallback colour. The adaptive one cannot simply be written as a\n second declaration after it: because that declaration contains a var(), a browser\n with no support does not reject it at parse time — it would win the cascade and\n only then turn invalid, which resets the colour to inherited and leaves the\n fallback never applied. The block below is the way round it, being evaluated\n before any var() substitution. */\n color: var(--progress-text-fallback);\n }\n\n /* Where the adaptive colour function exists, the text picks black or white against\n whatever colour the fill ended up with. */\n @supports (color: contrast-color(red)) {\n .v-progress-linear-text[data-on-fill] {\n color: contrast-color(var(--progress-fill));\n }\n }\n\n /* In a right-to-left page the fill grows from the right, so the two insets change\n physical sides — the variables themselves keep their meaning. */\n .v-progress-linear:dir(rtl) .v-progress-linear-text {\n clip-path: inset(-100vmax var(--progress-clip-start) -100vmax var(--progress-clip-end));\n }\n\n /* Upright, the bar fills from the bottom.\n\n Changing the writing direction on the element is enough to turn everything: the\n axis the fill grows along becomes vertical, so the length and the thickness swap\n places, and both the fill and the animation follow with no rule written twice.\n\n TRAP — putting zero at the bottom is NOT done by reversing the direction, which\n would also apply to the text of the two copies: bidirectional reordering would then\n display \"50 %\" as \"% 50\". The fill is anchored to the far end of the axis instead.\n\n The length comes from a token because there is nothing to inherit it from: in a\n parent of automatic height the bar would collapse to nothing. A consumer's own\n height overrides it, sitting outside our layers. */\n .v-progress-linear[data-orientation='vertical'] {\n writing-mode: vertical-lr;\n inline-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-fill {\n inset-inline-start: auto;\n inset-inline-end: 0;\n }\n\n /* The text now stacks along the vertical axis, whose start is the zero end — the\n bottom of the bar. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text {\n flex-direction: column-reverse;\n padding-inline: 0;\n padding-block: var(--vectis-space-2);\n }\n\n /* The cut moves to the vertical axis: the fill rises from the bottom, which is that\n axis' start. It is therefore the same in both reading directions, which means the\n right-to-left rule further up has to be neutralized.\n\n TRAP — the second selector is what neutralizes it, and it is written that way on\n purpose: it is one step MORE specific than that rule, where the first selector alone\n would merely tie with it and win by source order — a far more fragile arrangement. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text,\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-text {\n clip-path: inset(var(--progress-clip-end) -100vmax var(--progress-clip-start) -100vmax);\n }\n\n /* When the progress cannot be measured, a bar of fixed size crosses the track from\n just outside one end to just outside the other. At each extreme it is exactly flush\n with the edge without ever pulling away from it, which is what makes the loop\n invisible and keeps the track from ever looking empty — no second bar is needed.\n\n The easing carries the whole impression: a gradual entry, a quick crossing, a damped\n exit. A linear run, or an asymmetric curve, immediately reads as mechanical.\n\n The movement is expressed in LOGICAL properties — a position and a size as\n percentages of the track — rather than as a transform. One definition then serves\n the horizontal, the vertical and the right-to-left cases, where a transform, being\n physical, would need its own keyframes per axis and a flip per direction. */\n .v-progress-linear[data-indeterminate] {\n overflow: hidden;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n /* The starting position is derived from this size, and the two must stay tied: that\n is what has the bar begin exactly off the track rather than half on it. */\n --progress-bar: 40%;\n /* The anchoring is put back at the start of the axis, vertical case included — where\n a measurable progress anchors at the far end instead. */\n inset-inline-start: 0;\n inset-inline-end: auto;\n inline-size: var(--progress-bar);\n /* The transition of a measurable progress has no place here: switching to this mode\n would otherwise be animated as the bar growing to its new size. */\n transition: none;\n animation: v-progress-linear-indeterminate var(--vectis-duration-1500) var(--vectis-ease-in-out)\n infinite;\n }\n\n @keyframes v-progress-linear-indeterminate {\n from {\n inset-inline-start: calc(-1 * var(--progress-bar));\n }\n\n to {\n inset-inline-start: 100%;\n }\n }\n\n /* Turned upright, the axis runs downwards, so the bar would travel from the top down —\n the opposite of a measurable fill, which rises from the bottom. The same keyframes\n are simply read backwards, which changes nothing else BECAUSE the easing curve is\n symmetric; an asymmetric one would need a second set of keyframes.\n\n Nothing is needed for a right-to-left page: the logical inset already follows the\n reading direction. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n /* Slowed down and not stopped: a motionless loader no longer says that anything is\n happening, which is the one thing it exists to say. */\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n}\n</style>\n"],"mappings":""}
|
package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useMessages as e } from "../../i18n/state.js";
|
|
2
2
|
import { px as t } from "../../utils/css.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useAriaLabel as n } from "../../composables/useAriaLabel.js";
|
|
4
|
+
import { useProgressValue as r } from "../../composables/useProgressValue.js";
|
|
5
|
+
import { Fragment as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, normalizeStyle as u, openBlock as d, renderSlot as f, toDisplayString as p, unref as m } from "vue";
|
|
5
6
|
//#region src/components/VProgressLinear/VProgressLinear.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var h = [
|
|
7
8
|
"aria-label",
|
|
8
9
|
"data-tone",
|
|
9
10
|
"data-custom",
|
|
@@ -13,14 +14,15 @@ var m = [
|
|
|
13
14
|
"data-indeterminate",
|
|
14
15
|
"aria-valuenow",
|
|
15
16
|
"aria-valuemax"
|
|
16
|
-
],
|
|
17
|
+
], g = { class: "v-progress-linear-text" }, _ = {
|
|
17
18
|
class: "v-progress-linear-text",
|
|
18
19
|
"data-on-fill": "",
|
|
19
20
|
"aria-hidden": "true"
|
|
20
|
-
},
|
|
21
|
+
}, v = /*@__PURE__*/ l({
|
|
21
22
|
__name: "VProgressLinear",
|
|
22
23
|
props: {
|
|
23
24
|
value: { default: 0 },
|
|
25
|
+
label: { default: void 0 },
|
|
24
26
|
max: { default: 100 },
|
|
25
27
|
indeterminate: {
|
|
26
28
|
type: Boolean,
|
|
@@ -37,38 +39,38 @@ var m = [
|
|
|
37
39
|
valuePosition: { default: "center" },
|
|
38
40
|
orientation: { default: "horizontal" }
|
|
39
41
|
},
|
|
40
|
-
setup(
|
|
41
|
-
let
|
|
42
|
-
return (e, n) => (
|
|
43
|
-
class: "v-progress-linear",
|
|
42
|
+
setup(l) {
|
|
43
|
+
let v = l, y = e(), { max: b, clamped: x, fraction: S, percent: C, roundedPercent: w } = r(() => v.value, () => v.max), T = n(() => v.label ?? y.value.progress.label);
|
|
44
|
+
return (e, n) => (d(), o("div", {
|
|
45
|
+
class: "v-progress-linear v-tone",
|
|
44
46
|
role: "progressbar",
|
|
45
|
-
"aria-label":
|
|
46
|
-
"data-tone":
|
|
47
|
-
"data-custom":
|
|
48
|
-
"data-shape":
|
|
49
|
-
"data-orientation":
|
|
50
|
-
"data-value-position":
|
|
51
|
-
"data-indeterminate":
|
|
52
|
-
"aria-valuenow":
|
|
47
|
+
"aria-label": m(T),
|
|
48
|
+
"data-tone": l.tone,
|
|
49
|
+
"data-custom": l.color === void 0 ? void 0 : "",
|
|
50
|
+
"data-shape": l.shape,
|
|
51
|
+
"data-orientation": l.orientation,
|
|
52
|
+
"data-value-position": l.valuePosition,
|
|
53
|
+
"data-indeterminate": l.indeterminate ? "" : void 0,
|
|
54
|
+
"aria-valuenow": l.indeterminate ? void 0 : m(x),
|
|
53
55
|
"aria-valuemin": "0",
|
|
54
|
-
"aria-valuemax":
|
|
55
|
-
style:
|
|
56
|
-
"--fill-fraction": String(
|
|
57
|
-
"--custom-color":
|
|
58
|
-
"--progress-thickness":
|
|
56
|
+
"aria-valuemax": m(b),
|
|
57
|
+
style: u({
|
|
58
|
+
"--fill-fraction": String(m(S)),
|
|
59
|
+
"--custom-color": l.color,
|
|
60
|
+
"--progress-thickness": m(t)(l.thickness)
|
|
59
61
|
})
|
|
60
|
-
}, [n[0] ||=
|
|
61
|
-
value:
|
|
62
|
-
max:
|
|
63
|
-
percent:
|
|
64
|
-
}, () => [
|
|
65
|
-
value:
|
|
66
|
-
max:
|
|
67
|
-
percent:
|
|
68
|
-
}, () => [
|
|
62
|
+
}, [n[0] ||= s("span", { class: "v-progress-linear-fill" }, null, -1), !l.indeterminate && (l.showValue || e.$slots.default) ? (d(), o(i, { key: 0 }, [s("span", g, [f(e.$slots, "default", {
|
|
63
|
+
value: m(x),
|
|
64
|
+
max: m(b),
|
|
65
|
+
percent: m(C)
|
|
66
|
+
}, () => [c(p(m(y).progress.percent(m(w))), 1)])]), s("span", _, [f(e.$slots, "default", {
|
|
67
|
+
value: m(x),
|
|
68
|
+
max: m(b),
|
|
69
|
+
percent: m(C)
|
|
70
|
+
}, () => [c(p(m(y).progress.percent(m(w))), 1)])])], 64)) : a("", !0)], 12, h));
|
|
69
71
|
}
|
|
70
72
|
});
|
|
71
73
|
//#endregion
|
|
72
|
-
export {
|
|
74
|
+
export { v as default };
|
|
73
75
|
|
|
74
76
|
//# sourceMappingURL=VProgressLinear.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VProgressLinear.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VProgressLinear/VProgressLinear.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core — no behavioural JS at all: value normalization and the display string.\n/**\n * A bar filling up as something progresses. The element rendered IS the track, and the\n * whole geometry follows from a single number set on it — the fraction filled, with no\n * unit. Everything is written in logical properties, so turning the bar vertical needs\n * nothing but a change of writing direction.\n *\n * There is no behavioural JavaScript: the value is clamped and a percentage is\n * formatted, and that is all.\n *\n * On naming: pass an `aria-label` saying what is progressing. The text shown inside the\n * bar cannot serve as that name — the role a progress bar carries makes its content\n * presentational, so screen readers do not announce it.\n */\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\ninterface ProgressLinearProps {\n /** How far along it is. Anything outside the range is brought back into it. */\n value?: number\n /** What counts as finished. The other end is always zero. */\n max?: number\n /**\n * Says that the progress cannot be measured: the bar animates continuously and the\n * value is ignored. It is what to use while waiting for a server that reports no\n * percentage.\n */\n indeterminate?: boolean\n /** What the progress means, expressed as a colour. */\n tone?: 'accent' | 'success' | 'warning' | 'danger' | 'neutral'\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which replaces the tone. The\n * track's own shade is derived from it against the theme, so it follows the light and\n * the dark one.\n */\n color?: string\n /**\n * How thick the bar is, always IN PIXELS: `12` and `'12'` both give 12px. It is 4px\n * by default — bear in mind that showing text inside a bar that thin needs an\n * explicit thickness.\n */\n thickness?: number | string\n /** Whether the ends of the bar are rounded or square. */\n shape?: 'rounded' | 'square'\n /**\n * Writes the percentage inside the bar. It is ignored while the progress is\n * unmeasurable, there being no figure to write.\n */\n showValue?: boolean\n /**\n * Where that text sits along the bar. On a vertical bar the start is the zero end,\n * hence the bottom.\n */\n valuePosition?: 'start' | 'center' | 'end'\n /** Turns the bar upright, filling from the bottom up. */\n orientation?: 'horizontal' | 'vertical'\n}\n\nconst props = withDefaults(defineProps<ProgressLinearProps>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n tone: 'accent',\n color: undefined,\n thickness: undefined,\n shape: 'rounded',\n showValue: false,\n valuePosition: 'center',\n orientation: 'horizontal',\n})\n\ndefineSlots<{\n /**\n * What to write inside the bar instead of the percentage.\n *\n * TRAP — it is rendered TWICE, once over the empty track and once over the filled\n * part in a colour that contrasts with it, each copy cut at the fill's edge. So\n * whatever it renders must be pure: anything with a side effect would happen twice.\n */\n default?(props: { value: number; max: number; percent: number }): unknown\n}>()\n\n/* The percent sign, and the non-breaking space French puts before it where English puts\n nothing, are a convention of the language: they belong in the dictionary rather than\n in this file. Any other format goes through the slot above. */\nconst m = useMessages()\n\nconst { clamped, fraction } = useProgressValue(\n () => props.value,\n () => props.max,\n)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear\"\n role=\"progressbar\"\n :aria-label=\"m.progress.label\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-orientation=\"orientation === 'vertical' ? 'vertical' : undefined\"\n :data-value-position=\"valuePosition\"\n :data-indeterminate=\"indeterminate ? '' : undefined\"\n :aria-valuenow=\"indeterminate ? undefined : clamped\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :style=\"{\n '--fill-fraction': String(fraction),\n '--custom-color': color,\n '--progress-thickness': px(thickness),\n }\"\n >\n <span class=\"v-progress-linear-fill\" />\n <!--\n The same text twice, each copy cut at the fill's edge so that the two complete\n each other exactly: the first in the ordinary text colour over the empty track,\n the second over the filled part, coloured to contrast with it. The second is\n hidden from screen readers, being a duplicate of text already there.\n -->\n <template v-if=\"!indeterminate && (showValue || $slots.default)\">\n <span class=\"v-progress-linear-text\">\n <slot :value=\"clamped\" :max=\"max\" :percent=\"fraction * 100\">\n {{ m.progress.percent(Math.round(fraction * 100)) }}\n </slot>\n </span>\n <span class=\"v-progress-linear-text\" data-on-fill aria-hidden=\"true\">\n <slot :value=\"clamped\" :max=\"max\" :percent=\"fraction * 100\">\n {{ m.progress.percent(Math.round(fraction * 100)) }}\n </slot>\n </span>\n </template>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The element IS the track, and it takes the whole length available. Sizing it is the\n * consumer's business, through the parent or through a width of their own — a\n * consumer's style sits outside our layers and always wins.\n */\n .v-progress-linear {\n --progress-thickness: var(--vectis-control-size-progress-linear-thickness);\n position: relative;\n display: block;\n inline-size: 100%;\n block-size: var(--progress-thickness);\n border-radius: var(--vectis-radius-pill);\n background: var(--progress-track);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-progress-linear[data-shape='square'] {\n border-radius: 0;\n }\n\n .v-progress-linear-fill {\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n inline-size: calc(100% * var(--fill-fraction));\n border-radius: inherit;\n background: var(--progress-fill);\n /*\n * The fill is animated by changing its LENGTH, which the browser has to lay out\n * again on every frame. Scaling it would be cheaper, but a scale is physical: it\n * would have to be undone for the vertical orientation and again for a\n * right-to-left page, where a logical length simply works.\n *\n * The duration and easing are repeated by the clip of the text over the fill, or the\n * colour boundary would drift away from the fill's own edge for the length of the\n * transition.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n .v-progress-linear[data-tone='accent'] {\n --progress-fill: var(--vectis-color-accent);\n --progress-track: var(--vectis-color-accent-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='success'] {\n --progress-fill: var(--vectis-color-success);\n --progress-track: var(--vectis-color-success-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='danger'] {\n --progress-fill: var(--vectis-color-danger);\n --progress-track: var(--vectis-color-danger-surface);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n .v-progress-linear[data-tone='warning'] {\n --progress-fill: var(--vectis-color-warning);\n --progress-track: var(--vectis-color-warning-surface);\n /* White does not reach the required contrast on amber, so this tone has a text\n colour of its own. */\n --tone-text-fallback: var(--vectis-color-text-on-warning);\n }\n\n /* The neutral tone inverts text and surface rather than using a mid grey, which would\n be unreadable in one theme or the other. */\n .v-progress-linear[data-tone='neutral'] {\n --progress-fill: var(--vectis-color-text);\n --progress-track: var(--vectis-color-surface-muted);\n --tone-text-fallback: var(--vectis-color-surface);\n }\n\n /* Placed after the tones on purpose: the specificity is the same, so it is the order\n that lets a custom colour override the tone it replaces. */\n .v-progress-linear[data-custom] {\n --progress-fill: var(--custom-color);\n --progress-track: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --tone-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n /* The text inside the bar, in two copies laid over the same box — the track's own,\n which is why a cut expressed as a fraction of it lands exactly on the fill's edge.\n Bear in mind that the default 4px thickness cannot hold text at all: showing any\n implies asking for a thicker bar.\n\n TRAP — the two copies are COMPLEMENTARY and never superimposed: this one is cut OUT\n of the filled part, the other cut TO it, so every letter is painted exactly once.\n Removing either clip raises no error and stays invisible for as long as both copies\n resolve to the SAME colour, which is what happens wherever the adaptive colour\n function is unsupported. Where it IS supported and the two disagree — black over an\n accent fill against white text in the dark theme — the copy underneath shows its\n antialiased edges all around the letters of the one on top, and the label reads as\n a halo. */\n .v-progress-linear-text {\n /* The two insets of the cut: one on the edge the fill grows FROM, one on the edge it\n grows towards. They are named after those roles rather than after physical sides,\n so the three geometry rules further down — horizontal, right-to-left, vertical —\n all read the same pair. This copy cuts on the start side; the one over the fill\n swaps them. */\n --progress-clip-start: calc(100% * var(--fill-fraction));\n --progress-clip-end: -100vmax;\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--vectis-space-2);\n color: var(--vectis-color-text);\n /* The large negative inset on the two sides that do NOT carry the cut is what stops\n text taller or wider than the bar from being cropped by its own clip. */\n clip-path: inset(-100vmax var(--progress-clip-end) -100vmax var(--progress-clip-start));\n /* The same duration and easing as the fill's own length, or the colour boundary\n would drift away from the fill's edge for the length of the transition. */\n transition: clip-path var(--vectis-duration-base) var(--vectis-ease-default);\n /* The bar itself is turned on its side in vertical mode; the text is put back\n upright here, since a label read sideways is not the point. */\n writing-mode: horizontal-tb;\n white-space: nowrap;\n pointer-events: none;\n }\n\n .v-progress-linear[data-value-position='start'] .v-progress-linear-text {\n justify-content: start;\n }\n\n .v-progress-linear[data-value-position='end'] .v-progress-linear-text {\n justify-content: end;\n }\n\n .v-progress-linear-text[data-on-fill] {\n /* The exact complement of the copy above: the cut moves to the other end of the\n axis, so the two together cover the whole bar and overlap nowhere. */\n --progress-clip-start: -100vmax;\n --progress-clip-end: calc(100% * (1 - var(--fill-fraction)));\n /* The per-tone fallback colour. The adaptive one cannot simply be written as a\n second declaration after it: because that declaration contains a var(), a browser\n with no support does not reject it at parse time — it would win the cascade and\n only then turn invalid, which resets the colour to inherited and leaves the\n fallback never applied. The block below is the way round it, being evaluated\n before any var() substitution. */\n color: var(--tone-text-fallback);\n }\n\n /* Where the adaptive colour function exists, the text picks black or white against\n whatever colour the fill ended up with. */\n @supports (color: contrast-color(red)) {\n .v-progress-linear-text[data-on-fill] {\n color: contrast-color(var(--progress-fill));\n }\n }\n\n /* In a right-to-left page the fill grows from the right, so the two insets change\n physical sides — the variables themselves keep their meaning. */\n .v-progress-linear:dir(rtl) .v-progress-linear-text {\n clip-path: inset(-100vmax var(--progress-clip-start) -100vmax var(--progress-clip-end));\n }\n\n /* Upright, the bar fills from the bottom.\n\n Changing the writing direction on the element is enough to turn everything: the\n axis the fill grows along becomes vertical, so the length and the thickness swap\n places, and both the fill and the animation follow with no rule written twice.\n\n TRAP — putting zero at the bottom is NOT done by reversing the direction, which\n would also apply to the text of the two copies: bidirectional reordering would then\n display \"50 %\" as \"% 50\". The fill is anchored to the far end of the axis instead.\n\n The length comes from a token because there is nothing to inherit it from: in a\n parent of automatic height the bar would collapse to nothing. A consumer's own\n height overrides it, sitting outside our layers. */\n .v-progress-linear[data-orientation='vertical'] {\n writing-mode: vertical-lr;\n inline-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-fill {\n inset-inline-start: auto;\n inset-inline-end: 0;\n }\n\n /* The text now stacks along the vertical axis, whose start is the zero end — the\n bottom of the bar. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text {\n flex-direction: column-reverse;\n padding-inline: 0;\n padding-block: var(--vectis-space-2);\n }\n\n /* The cut moves to the vertical axis: the fill rises from the bottom, which is that\n axis' start. It is therefore the same in both reading directions, which means the\n right-to-left rule further up has to be neutralized.\n\n TRAP — the second selector is what neutralizes it, and it is written that way on\n purpose: it is one step MORE specific than that rule, where the first selector alone\n would merely tie with it and win by source order — a far more fragile arrangement. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text,\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-text {\n clip-path: inset(var(--progress-clip-end) -100vmax var(--progress-clip-start) -100vmax);\n }\n\n /* When the progress cannot be measured, a bar of fixed size crosses the track from\n just outside one end to just outside the other. At each extreme it is exactly flush\n with the edge without ever pulling away from it, which is what makes the loop\n invisible and keeps the track from ever looking empty — no second bar is needed.\n\n The easing carries the whole impression: a gradual entry, a quick crossing, a damped\n exit. A linear run, or an asymmetric curve, immediately reads as mechanical.\n\n The movement is expressed in LOGICAL properties — a position and a size as\n percentages of the track — rather than as a transform. One definition then serves\n the horizontal, the vertical and the right-to-left cases, where a transform, being\n physical, would need its own keyframes per axis and a flip per direction. */\n .v-progress-linear[data-indeterminate] {\n overflow: hidden;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n /* The starting position is derived from this size, and the two must stay tied: that\n is what has the bar begin exactly off the track rather than half on it. */\n --progress-bar: 40%;\n /* The anchoring is put back at the start of the axis, vertical case included — where\n a measurable progress anchors at the far end instead. */\n inset-inline-start: 0;\n inset-inline-end: auto;\n inline-size: var(--progress-bar);\n /* The transition of a measurable progress has no place here: switching to this mode\n would otherwise be animated as the bar growing to its new size. */\n transition: none;\n animation: v-progress-linear-indeterminate var(--vectis-duration-1500) var(--vectis-ease-in-out)\n infinite;\n }\n\n @keyframes v-progress-linear-indeterminate {\n from {\n inset-inline-start: calc(-1 * var(--progress-bar));\n }\n\n to {\n inset-inline-start: 100%;\n }\n }\n\n /* Turned upright, the axis runs downwards, so the bar would travel from the top down —\n the opposite of a measurable fill, which rises from the bottom. The same keyframes\n are simply read backwards, which changes nothing else BECAUSE the easing curve is\n symmetric; an asymmetric one would need a second set of keyframes.\n\n Nothing is needed for a right-to-left page: the logical inset already follows the\n reading direction. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n /* Slowed down and not stopped: a motionless loader no longer says that anything is\n happening, which is the one thing it exists to say. */\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,IAAM,IAAQ,GA2BR,IAAI,EAAY,GAEhB,EAAE,YAAS,gBAAa,QACtB,EAAM,aACN,EAAM,GACd;yBAIE,EAsCM,OAAA;GArCJ,OAAM;GACN,MAAK;GACJ,cAAY,EAAA,CAAA,CAAC,CAAC,SAAS;GACvB,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,cAAY,EAAA;GACZ,oBAAkB,EAAA,gBAAW,aAAA,aAA+B,KAAA;GAC5D,uBAAqB,EAAA;GACrB,sBAAoB,EAAA,gBAAa,KAAQ,KAAA;GACzC,iBAAe,EAAA,gBAAgB,KAAA,IAAY,EAAA,CAAA;GAC5C,iBAAc;GACb,iBAAe,EAAA;GACf,OAAK,EAAA;uBAA6B,OAAO,EAAA,CAAA,CAAQ;sBAA2B,EAAA;4BAAqC,EAAA,CAAA,CAAE,CAAC,EAAA,SAAS;;eAM9H,EAAuC,QAAA,EAAjC,OAAM,yBAAwB,GAAA,MAAA,EAAA,GAAA,CAOnB,EAAA,kBAAkB,EAAA,aAAaA,EAAAA,OAAO,YAAA,EAAA,GAAvD,EAWW,GAAA,EAAA,KAAA,EAAA,GAAA,CAVT,EAIO,QAJP,GAIO,CAHL,EAEO,EAAA,QAAA,WAAA;GAFA,OAAO,EAAA,CAAA;GAAU,KAAK,EAAA;GAAM,SAAS,EAAA,CAAA,IAAQ;WAE7C,CAAA,EAAA,EADF,EAAA,CAAA,CAAC,CAAC,SAAS,QAAQ,KAAK,MAAM,EAAA,CAAA,IAAQ,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAG7C,EAIO,QAJP,GAIO,CAHL,EAEO,EAAA,QAAA,WAAA;GAFA,OAAO,EAAA,CAAA;GAAU,KAAK,EAAA;GAAM,SAAS,EAAA,CAAA,IAAQ;WAE7C,CAAA,EAAA,EADF,EAAA,CAAA,CAAC,CAAC,SAAS,QAAQ,KAAK,MAAM,EAAA,CAAA,IAAQ,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"VProgressLinear.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VProgressLinear/VProgressLinear.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core — no behavioural JS at all: value normalization and the display string.\n/**\n * A bar filling up as something progresses. The element rendered IS the track, and the\n * whole geometry follows from a single number set on it — the fraction filled, with no\n * unit. Everything is written in logical properties, so turning the bar vertical needs\n * nothing but a change of writing direction.\n *\n * There is no behavioural JavaScript: the value is clamped and a percentage is\n * formatted, and that is all.\n *\n * On naming: pass a `label` saying what is progressing. The text shown inside the\n * bar cannot serve as that name — the role a progress bar carries makes its content\n * presentational, so screen readers do not announce it.\n */\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\n/** What the progress means, in colour. */\nexport type ProgressLinearTone = 'accent' | 'success' | 'warning' | 'danger' | 'neutral'\n\n/** How the track and the fill end. */\nexport type ProgressLinearShape = 'rounded' | 'square'\n\n/** Where the value sits along the bar. */\nexport type ProgressLinearValuePosition = 'start' | 'center' | 'end'\n\n/** Which way the bar fills. */\nexport type ProgressLinearOrientation = 'horizontal' | 'vertical'\n\ninterface ProgressLinearProps {\n /** How far along it is. Anything outside the range is brought back into it. */\n value?: number\n /**\n * What is progressing, in words, for screen readers. It draws nothing on screen, and falls\n * back to the design system dictionary; an `aria-label` or `aria-labelledby` of your own\n * takes precedence over it.\n */\n label?: string\n /** What counts as finished. The other end is always zero. */\n max?: number\n /**\n * Says that the progress cannot be measured: the bar animates continuously and the\n * value is ignored. It is what to use while waiting for a server that reports no\n * percentage.\n */\n indeterminate?: boolean\n /** What the progress means, expressed as a colour. */\n tone?: ProgressLinearTone\n /**\n * A colour of your own (hex, CSS name or `oklch()`), which replaces the tone. The\n * track's own shade is derived from it against the theme, so it follows the light and\n * the dark one.\n */\n color?: string\n /**\n * How thick the bar is, always IN PIXELS: `12` and `'12'` both give 12px. It is 4px\n * by default — bear in mind that showing text inside a bar that thin needs an\n * explicit thickness.\n */\n thickness?: number | string\n /** Whether the ends of the bar are rounded or square. */\n shape?: ProgressLinearShape\n /**\n * Writes the percentage inside the bar. It is ignored while the progress is\n * unmeasurable, there being no figure to write.\n */\n showValue?: boolean\n /**\n * Where that text sits along the bar. On a vertical bar the start is the zero end,\n * hence the bottom.\n */\n valuePosition?: ProgressLinearValuePosition\n /** Turns the bar upright, filling from the bottom up. */\n orientation?: ProgressLinearOrientation\n}\n\nconst props = withDefaults(defineProps<ProgressLinearProps>(), {\n value: 0,\n label: undefined,\n max: 100,\n indeterminate: false,\n tone: 'accent',\n color: undefined,\n thickness: undefined,\n shape: 'rounded',\n showValue: false,\n valuePosition: 'center',\n orientation: 'horizontal',\n})\n\ndefineSlots<{\n /**\n * What to write inside the bar instead of the percentage.\n *\n * TRAP — it is rendered TWICE, once over the empty track and once over the filled\n * part in a colour that contrasts with it, each copy cut at the fill's edge. So\n * whatever it renders must be pure: anything with a side effect would happen twice.\n */\n default?(props: { value: number; max: number; percent: number }): unknown\n}>()\n\n/* The percent sign, and the non-breaking space French puts before it where English puts\n nothing, are a convention of the language: they belong in the dictionary rather than\n in this file. Any other format goes through the slot above. */\nconst m = useMessages()\n\nconst {\n max: normalizedMax,\n clamped,\n fraction,\n percent,\n roundedPercent,\n} = useProgressValue(\n () => props.value,\n () => props.max,\n)\n\n// @a11y\n// The canonical cascade: a consumer's `aria-labelledby`, then their `aria-label`, then the\n// `label` prop, then the dictionary. An indicator takes no name from the text inside it, so\n// without the last step it would have none at all.\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.progress.label)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear v-tone\"\n role=\"progressbar\"\n :aria-label=\"ariaLabel\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-shape=\"shape\"\n :data-orientation=\"orientation\"\n :data-value-position=\"valuePosition\"\n :data-indeterminate=\"indeterminate ? '' : undefined\"\n :aria-valuenow=\"indeterminate ? undefined : clamped\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"normalizedMax\"\n :style=\"{\n '--fill-fraction': String(fraction),\n '--custom-color': color,\n '--progress-thickness': px(thickness),\n }\"\n >\n <span class=\"v-progress-linear-fill\" />\n <!--\n The same text twice, each copy cut at the fill's edge so that the two complete\n each other exactly: the first in the ordinary text colour over the empty track,\n the second over the filled part, coloured to contrast with it. The second is\n hidden from screen readers, being a duplicate of text already there.\n -->\n <template v-if=\"!indeterminate && (showValue || $slots.default)\">\n <span class=\"v-progress-linear-text\">\n <slot :value=\"clamped\" :max=\"normalizedMax\" :percent=\"percent\">\n {{ m.progress.percent(roundedPercent) }}\n </slot>\n </span>\n <span class=\"v-progress-linear-text\" data-on-fill aria-hidden=\"true\">\n <slot :value=\"clamped\" :max=\"normalizedMax\" :percent=\"percent\">\n {{ m.progress.percent(roundedPercent) }}\n </slot>\n </span>\n </template>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The element IS the track, and it takes the whole length available. Sizing it is the\n * consumer's business, through the parent or through a width of their own — a\n * consumer's style sits outside our layers and always wins.\n */\n .v-progress-linear {\n --progress-thickness: var(--vectis-control-size-progress-linear-thickness);\n /* Fill, track and the text over the fill are the tone's solid, soft and on-solid\n colours, read from the shared table (`.v-tone`, set in the template). */\n --progress-fill: var(--tone-bg-solid);\n --progress-track: var(--tone-bg-soft);\n --progress-text-fallback: var(--tone-text-solid);\n position: relative;\n display: block;\n inline-size: 100%;\n block-size: var(--progress-thickness);\n border-radius: var(--vectis-radius-pill);\n background: var(--progress-track);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-caption-size);\n font-weight: var(--vectis-text-control-weight);\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-progress-linear[data-shape='square'] {\n border-radius: 0;\n }\n\n .v-progress-linear-fill {\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n inline-size: calc(100% * var(--fill-fraction));\n border-radius: inherit;\n background: var(--progress-fill);\n /*\n * The fill is animated by changing its LENGTH, which the browser has to lay out\n * again on every frame. Scaling it would be cheaper, but a scale is physical: it\n * would have to be undone for the vertical orientation and again for a\n * right-to-left page, where a logical length simply works.\n *\n * The duration and easing are repeated by the clip of the text over the fill, or the\n * colour boundary would drift away from the fill's own edge for the length of the\n * transition.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /* A custom colour replaces the tone: at (0,2,0) it beats the base rule's mapping\n whatever the order the two are written in. */\n .v-progress-linear[data-custom] {\n --progress-fill: var(--custom-color);\n --progress-track: color-mix(in oklab, var(--custom-color), var(--vectis-color-surface) 85%);\n --progress-text-fallback: var(--vectis-color-text-on-accent);\n }\n\n /* The text inside the bar, in two copies laid over the same box — the track's own,\n which is why a cut expressed as a fraction of it lands exactly on the fill's edge.\n Bear in mind that the default 4px thickness cannot hold text at all: showing any\n implies asking for a thicker bar.\n\n TRAP — the two copies are COMPLEMENTARY and never superimposed: this one is cut OUT\n of the filled part, the other cut TO it, so every letter is painted exactly once.\n Removing either clip raises no error and stays invisible for as long as both copies\n resolve to the SAME colour, which is what happens wherever the adaptive colour\n function is unsupported. Where it IS supported and the two disagree — black over an\n accent fill against white text in the dark theme — the copy underneath shows its\n antialiased edges all around the letters of the one on top, and the label reads as\n a halo. */\n .v-progress-linear-text {\n /* The two insets of the cut: one on the edge the fill grows FROM, one on the edge it\n grows towards. They are named after those roles rather than after physical sides,\n so the three geometry rules further down — horizontal, right-to-left, vertical —\n all read the same pair. This copy cuts on the start side; the one over the fill\n swaps them. */\n --progress-clip-start: calc(100% * var(--fill-fraction));\n --progress-clip-end: -100vmax;\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--vectis-space-2);\n color: var(--vectis-color-text);\n /* The large negative inset on the two sides that do NOT carry the cut is what stops\n text taller or wider than the bar from being cropped by its own clip. */\n clip-path: inset(-100vmax var(--progress-clip-end) -100vmax var(--progress-clip-start));\n /* The same duration and easing as the fill's own length, or the colour boundary\n would drift away from the fill's edge for the length of the transition. */\n transition: clip-path var(--vectis-duration-base) var(--vectis-ease-default);\n /* The bar itself is turned on its side in vertical mode; the text is put back\n upright here, since a label read sideways is not the point. */\n writing-mode: horizontal-tb;\n white-space: nowrap;\n pointer-events: none;\n }\n\n .v-progress-linear[data-value-position='start'] .v-progress-linear-text {\n justify-content: start;\n }\n\n .v-progress-linear[data-value-position='end'] .v-progress-linear-text {\n justify-content: end;\n }\n\n .v-progress-linear-text[data-on-fill] {\n /* The exact complement of the copy above: the cut moves to the other end of the\n axis, so the two together cover the whole bar and overlap nowhere. */\n --progress-clip-start: -100vmax;\n --progress-clip-end: calc(100% * (1 - var(--fill-fraction)));\n /* The per-tone fallback colour. The adaptive one cannot simply be written as a\n second declaration after it: because that declaration contains a var(), a browser\n with no support does not reject it at parse time — it would win the cascade and\n only then turn invalid, which resets the colour to inherited and leaves the\n fallback never applied. The block below is the way round it, being evaluated\n before any var() substitution. */\n color: var(--progress-text-fallback);\n }\n\n /* Where the adaptive colour function exists, the text picks black or white against\n whatever colour the fill ended up with. */\n @supports (color: contrast-color(red)) {\n .v-progress-linear-text[data-on-fill] {\n color: contrast-color(var(--progress-fill));\n }\n }\n\n /* In a right-to-left page the fill grows from the right, so the two insets change\n physical sides — the variables themselves keep their meaning. */\n .v-progress-linear:dir(rtl) .v-progress-linear-text {\n clip-path: inset(-100vmax var(--progress-clip-start) -100vmax var(--progress-clip-end));\n }\n\n /* Upright, the bar fills from the bottom.\n\n Changing the writing direction on the element is enough to turn everything: the\n axis the fill grows along becomes vertical, so the length and the thickness swap\n places, and both the fill and the animation follow with no rule written twice.\n\n TRAP — putting zero at the bottom is NOT done by reversing the direction, which\n would also apply to the text of the two copies: bidirectional reordering would then\n display \"50 %\" as \"% 50\". The fill is anchored to the far end of the axis instead.\n\n The length comes from a token because there is nothing to inherit it from: in a\n parent of automatic height the bar would collapse to nothing. A consumer's own\n height overrides it, sitting outside our layers. */\n .v-progress-linear[data-orientation='vertical'] {\n writing-mode: vertical-lr;\n inline-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-fill {\n inset-inline-start: auto;\n inset-inline-end: 0;\n }\n\n /* The text now stacks along the vertical axis, whose start is the zero end — the\n bottom of the bar. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text {\n flex-direction: column-reverse;\n padding-inline: 0;\n padding-block: var(--vectis-space-2);\n }\n\n /* The cut moves to the vertical axis: the fill rises from the bottom, which is that\n axis' start. It is therefore the same in both reading directions, which means the\n right-to-left rule further up has to be neutralized.\n\n TRAP — the second selector is what neutralizes it, and it is written that way on\n purpose: it is one step MORE specific than that rule, where the first selector alone\n would merely tie with it and win by source order — a far more fragile arrangement. */\n .v-progress-linear[data-orientation='vertical'] .v-progress-linear-text,\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-text {\n clip-path: inset(var(--progress-clip-end) -100vmax var(--progress-clip-start) -100vmax);\n }\n\n /* When the progress cannot be measured, a bar of fixed size crosses the track from\n just outside one end to just outside the other. At each extreme it is exactly flush\n with the edge without ever pulling away from it, which is what makes the loop\n invisible and keeps the track from ever looking empty — no second bar is needed.\n\n The easing carries the whole impression: a gradual entry, a quick crossing, a damped\n exit. A linear run, or an asymmetric curve, immediately reads as mechanical.\n\n The movement is expressed in LOGICAL properties — a position and a size as\n percentages of the track — rather than as a transform. One definition then serves\n the horizontal, the vertical and the right-to-left cases, where a transform, being\n physical, would need its own keyframes per axis and a flip per direction. */\n .v-progress-linear[data-indeterminate] {\n overflow: hidden;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n /* The starting position is derived from this size, and the two must stay tied: that\n is what has the bar begin exactly off the track rather than half on it. */\n --progress-bar: 40%;\n /* The anchoring is put back at the start of the axis, vertical case included — where\n a measurable progress anchors at the far end instead. */\n inset-inline-start: 0;\n inset-inline-end: auto;\n inline-size: var(--progress-bar);\n /* The transition of a measurable progress has no place here: switching to this mode\n would otherwise be animated as the bar growing to its new size. */\n transition: none;\n animation: v-progress-linear-indeterminate var(--vectis-duration-1500) var(--vectis-ease-in-out)\n infinite;\n }\n\n @keyframes v-progress-linear-indeterminate {\n from {\n inset-inline-start: calc(-1 * var(--progress-bar));\n }\n\n to {\n inset-inline-start: 100%;\n }\n }\n\n /* Turned upright, the axis runs downwards, so the bar would travel from the top down —\n the opposite of a measurable fill, which rises from the bottom. The same keyframes\n are simply read backwards, which changes nothing else BECAUSE the easing curve is\n symmetric; an asymmetric one would need a second set of keyframes.\n\n Nothing is needed for a right-to-left page: the logical inset already follows the\n reading direction. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n /* Slowed down and not stopped: a motionless loader no longer says that anything is\n happening, which is the one thing it exists to say. */\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EA,IAAM,IAAQ,GA4BR,IAAI,EAAY,GAEhB,EACJ,KAAK,GACL,YACA,aACA,YACA,sBACE,QACI,EAAM,aACN,EAAM,GACd,GAMM,IAAY,QAAmB,EAAM,SAAS,EAAE,MAAM,SAAS,KAAK;yBAIxE,EAsCM,OAAA;GArCJ,OAAM;GACN,MAAK;GACJ,cAAY,EAAA,CAAA;GACZ,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,cAAY,EAAA;GACZ,oBAAkB,EAAA;GAClB,uBAAqB,EAAA;GACrB,sBAAoB,EAAA,gBAAa,KAAQ,KAAA;GACzC,iBAAe,EAAA,gBAAgB,KAAA,IAAY,EAAA,CAAA;GAC5C,iBAAc;GACb,iBAAe,EAAA,CAAA;GACf,OAAK,EAAA;uBAA6B,OAAO,EAAA,CAAA,CAAQ;sBAA2B,EAAA;4BAAqC,EAAA,CAAA,CAAE,CAAC,EAAA,SAAS;;eAM9H,EAAuC,QAAA,EAAjC,OAAM,yBAAwB,GAAA,MAAA,EAAA,GAAA,CAOnB,EAAA,kBAAkB,EAAA,aAAaA,EAAAA,OAAO,YAAA,EAAA,GAAvD,EAWW,GAAA,EAAA,KAAA,EAAA,GAAA,CAVT,EAIO,QAJP,GAIO,CAHL,EAEO,EAAA,QAAA,WAAA;GAFA,OAAO,EAAA,CAAA;GAAU,KAAK,EAAA,CAAA;GAAgB,SAAS,EAAA,CAAA;WAE/C,CAAA,EAAA,EADF,EAAA,CAAA,CAAC,CAAC,SAAS,QAAQ,EAAA,CAAA,CAAc,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAGxC,EAIO,QAJP,GAIO,CAHL,EAEO,EAAA,QAAA,WAAA;GAFA,OAAO,EAAA,CAAA;GAAU,KAAK,EAAA,CAAA;GAAgB,SAAS,EAAA,CAAA;WAE/C,CAAA,EAAA,EADF,EAAA,CAAA,CAAC,CAAC,SAAS,QAAQ,EAAA,CAAA,CAAc,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
|
|
2
|
-
@layer vectis.components{.v-radio
|
|
2
|
+
@layer vectis.components{.v-radio-dot{width:var(--vectis-control-size-check);height:var(--vectis-control-size-check);border:var(--vectis-control-border-width) solid var(--vectis-color-border-strong);border-radius:var(--vectis-radius-pill);color:var(--vectis-color-text-on-accent);transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default), border-color var(--vectis-duration-fast) var(--vectis-ease-default);background:0 0;place-items:center;display:inline-grid}.v-radio-dot:before{content:"";width:var(--vectis-control-size-check-dot);height:var(--vectis-control-size-check-dot);border-radius:var(--vectis-radius-pill);opacity:0;transition:opacity var(--vectis-duration-fast) var(--vectis-ease-default);background:currentColor}.v-radio-input:checked+.v-radio-dot:before{opacity:1}.v-radio:not([data-readonly]) .v-choice-row:hover .v-radio-input:not(:disabled,:checked)+.v-radio-dot{border-color:color-mix(in oklab, var(--vectis-color-border-strong), var(--vectis-color-text) 15%)}.v-radio-input:checked+.v-radio-dot{background:var(--vectis-color-accent);border-color:var(--vectis-color-accent)}.v-radio:not([data-readonly]) .v-choice-row:hover .v-radio-input:not(:disabled):checked+.v-radio-dot{background:var(--vectis-color-accent-hover);border-color:var(--vectis-color-accent-hover)}:where(.v-radio[data-readonly]) .v-radio-input+.v-radio-dot{background:var(--vectis-color-surface-sunken);border-color:var(--vectis-color-border)}:where(.v-radio[data-readonly]) .v-radio-input:checked+.v-radio-dot{background:var(--vectis-color-text-muted);border-color:var(--vectis-color-text-muted);color:var(--vectis-color-surface)}:is(.v-radio-input:user-invalid+.v-radio-dot,.v-radio-input[aria-invalid=true]+.v-radio-dot){border-color:var(--vectis-color-danger)}.v-radio-input:disabled+.v-radio-dot{background:var(--vectis-color-surface-muted);border-color:var(--vectis-color-border);color:var(--vectis-color-text-subtle)}@media (prefers-reduced-motion:reduce){.v-radio-dot,.v-radio-dot:before{transition:none}}}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* is hidden.
|
|
5
|
-
*
|
|
6
|
-
* The group is native as well. Several VRadio sharing the same `name` and the same
|
|
7
|
-
* v-model form one choice, and it is the browser that then makes the arrow keys move
|
|
8
|
-
* between them, that lets only one be selected, and that gives the group a single
|
|
9
|
-
* stop in the tab order. There is no JavaScript here for any of it.
|
|
10
|
-
*/
|
|
1
|
+
import { ItemValue } from '../../types.js';
|
|
2
|
+
/** Which side of the dot the label sits on. */
|
|
3
|
+
export type RadioLabelPosition = 'start' | 'end';
|
|
11
4
|
interface RadioProps {
|
|
12
5
|
/**
|
|
13
6
|
* What choosing this button means. The group's v-model holds the value of the
|
|
14
7
|
* selected button, so this is what it becomes when this one is picked.
|
|
15
8
|
*/
|
|
16
|
-
value:
|
|
9
|
+
value: ItemValue;
|
|
10
|
+
/** The text beside the dot, which names it. The default slot replaces it. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* A line of help under the label. It is tied to the radio button for assistive
|
|
14
|
+
* technology, so it is read out after the label rather than as part of it.
|
|
15
|
+
*/
|
|
16
|
+
hint?: string;
|
|
17
17
|
/** Which side of the dot the label sits on. */
|
|
18
|
-
labelPosition?:
|
|
18
|
+
labelPosition?: RadioLabelPosition;
|
|
19
19
|
/**
|
|
20
20
|
* Pushes the label and the dot to opposite ends of the line, the row taking the
|
|
21
21
|
* full width available.
|
|
@@ -28,24 +28,42 @@ interface RadioProps {
|
|
|
28
28
|
invalid?: boolean;
|
|
29
29
|
/** Makes this choice unusable, greyed out through the colour tokens. */
|
|
30
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Shows the selection without allowing it to be changed. The button can still be
|
|
33
|
+
* focused and is still submitted with its form; a click or an arrow key simply selects
|
|
34
|
+
* nothing. Set it on every button of the group.
|
|
35
|
+
*/
|
|
36
|
+
readonly?: boolean;
|
|
31
37
|
}
|
|
32
38
|
type __VLS_Props = RadioProps;
|
|
33
39
|
type __VLS_Slots = {
|
|
34
|
-
/** The label
|
|
40
|
+
/** The label, when it needs more than the `label` prop's text. It is clickable. */
|
|
35
41
|
default?(): unknown;
|
|
36
42
|
};
|
|
37
43
|
type __VLS_ModelProps = {
|
|
38
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The value selected in the group, shared by every radio carrying the same `name`. It is
|
|
46
|
+
* empty until one is chosen, and a radio is selected when it matches its own `value`.
|
|
47
|
+
*/
|
|
48
|
+
modelValue?: ItemValue;
|
|
39
49
|
};
|
|
40
50
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
41
|
-
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
42
|
-
|
|
51
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
52
|
+
/** Moves the focus to the real radio button. */
|
|
53
|
+
focus: (options?: FocusOptions) => void | undefined;
|
|
54
|
+
/** The real `<input type="radio">`, for what `focus` does not cover. */
|
|
55
|
+
el: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
56
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
57
|
+
"update:modelValue": (value: ItemValue) => any;
|
|
43
58
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
|
-
"onUpdate:modelValue"?: ((value:
|
|
59
|
+
"onUpdate:modelValue"?: ((value: ItemValue) => any) | undefined;
|
|
45
60
|
}>, {
|
|
61
|
+
label: string;
|
|
46
62
|
disabled: boolean;
|
|
47
63
|
invalid: boolean;
|
|
48
|
-
|
|
64
|
+
hint: string;
|
|
65
|
+
readonly: boolean;
|
|
66
|
+
labelPosition: RadioLabelPosition;
|
|
49
67
|
spread: boolean;
|
|
50
68
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
51
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VRadio.js","names":[],"sources":["../../../src/components/VRadio/VRadio.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A radio button whose dot is drawn by the design system, on the same principle as\n * VCheckbox: the real `<input type=\"radio\">` stays in place and only its own drawing\n * is hidden.\n *\n * The group is native as well. Several VRadio sharing the same `name` and the same\n * v-model form one choice, and it is the browser that then makes the arrow keys move\n * between them, that lets only one be selected, and that gives the group a single\n * stop in the tab order. There is no JavaScript here for any of it.\n */\ninterface RadioProps {\n /**\n * What choosing this button means. The group's v-model holds the value of the\n * selected button, so this is what it becomes when this one is picked.\n */\n value: string\n /** Which side of the dot the label sits on. */\n labelPosition?:
|
|
1
|
+
{"version":3,"file":"VRadio.js","names":[],"sources":["../../../src/components/VRadio/VRadio.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A radio button whose dot is drawn by the design system, on the same principle as\n * VCheckbox: the real `<input type=\"radio\">` stays in place and only its own drawing\n * is hidden.\n *\n * The group is native as well. Several VRadio sharing the same `name` and the same\n * v-model form one choice, and it is the browser that then makes the arrow keys move\n * between them, that lets only one be selected, and that gives the group a single\n * stop in the tab order. There is no JavaScript here for any of it; the only piece this\n * component writes is the refusal `readonly` asks for, which a radio has no native form of.\n */\n\nimport { ref } from 'vue'\n\nimport { useFieldIds } from '../../composables/useFieldIds'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport type { ItemValue } from '../../types'\n\n/** Which side of the dot the label sits on. */\nexport type RadioLabelPosition = 'start' | 'end'\n\ninterface RadioProps {\n /**\n * What choosing this button means. The group's v-model holds the value of the\n * selected button, so this is what it becomes when this one is picked.\n */\n value: ItemValue\n /** The text beside the dot, which names it. The default slot replaces it. */\n label?: string\n /**\n * A line of help under the label. It is tied to the radio button for assistive\n * technology, so it is read out after the label rather than as part of it.\n */\n hint?: string\n /** Which side of the dot the label sits on. */\n labelPosition?: RadioLabelPosition\n /**\n * Pushes the label and the dot to opposite ends of the line, the row taking the\n * full width available.\n */\n spread?: boolean\n /**\n * Marks the field as invalid, which colours the dot and tells assistive technology\n * so. It is for a rule the browser cannot check by itself.\n */\n invalid?: boolean\n /** Makes this choice unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the selection without allowing it to be changed. The button can still be\n * focused and is still submitted with its form; a click or an arrow key simply selects\n * nothing. Set it on every button of the group.\n */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n hint: undefined,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y — the redirection buys the whole keyboard. Moving between the buttons of a group is\n// the browser's job, but it only groups inputs that share a `name` — so redirecting the\n// attributes is what makes the arrow keys work at all. The root being a layout box, `name`\n// left on it would reach nothing.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\nconst { hintId, describedBy } = useFieldIds(attrs, () => !!props.hint)\n\n/**\n * The value selected in the group, shared by every radio carrying the same `name`. It is\n * empty until one is chosen, and a radio is selected when it matches its own `value`.\n */\nconst model = defineModel<ItemValue>({ default: '' })\n\ndefineSlots<{\n /** The label, when it needs more than the `label` prop's text. It is clickable. */\n default?(): unknown\n}>()\n\nconst inputEl = ref<HTMLInputElement | null>(null)\n\n// @core\n// The native `readonly` attribute does nothing on a radio button. Cancelling the click is\n// what refuses the selection: the browser puts the group's previous selection back and fires\n// no `change`. It covers the arrow keys too, which select the next button of the group\n// through a click the browser dispatches on it — so the focus still moves, the selection\n// does not.\n//\n// No `aria-readonly` goes with it, unlike VCheckbox and VSwitch: ARIA allows it on a\n// `radiogroup` and not on a `radio`, and axe fails the page for it.\nfunction refuseWhenReadonly(event: MouseEvent) {\n if (props.readonly) event.preventDefault()\n}\n\n// The root is a wrapper, so a template ref on the component reaches the layout box and not\n// the control: these two are the way to the real radio button.\ndefineExpose({\n /** Moves the focus to the real radio button. */\n focus: (options?: FocusOptions) => inputEl.value?.focus(options),\n /** The real `<input type=\"radio\">`, for what `focus` does not cover. */\n el: inputEl,\n})\n</script>\n\n<template>\n <span\n class=\"v-radio v-choice\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-label-position=\"labelPosition\"\n :data-spread=\"spread ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n >\n <label class=\"v-choice-row\">\n <input\n ref=\"inputEl\"\n v-model=\"model\"\n type=\"radio\"\n class=\"v-radio-input v-hidden-input\"\n v-bind=\"forwardedAttrs\"\n :value=\"value\"\n :disabled=\"disabled\"\n :aria-invalid=\"invalid || undefined\"\n :aria-describedby=\"describedBy\"\n @click=\"refuseWhenReadonly\"\n />\n <span class=\"v-radio-dot\" aria-hidden=\"true\" />\n <span v-if=\"$slots.default || label\" class=\"v-radio-label v-choice-label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n <span v-if=\"hint\" :id=\"hintId\" class=\"v-radio-hint v-choice-hint\">{{ hint }}</span>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The dot works exactly like VCheckbox's box, the accent filling it once the input is\n checked, with the small inner disc drawn as a pseudo-element in currentcolor so it\n follows whatever colour the state gives the ring's content. */\n .v-radio-dot {\n display: inline-grid;\n place-items: center;\n width: var(--vectis-control-size-check);\n height: var(--vectis-control-size-check);\n background: transparent;\n border: var(--vectis-control-border-width) solid var(--vectis-color-border-strong);\n border-radius: var(--vectis-radius-pill);\n color: var(--vectis-color-text-on-accent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio-dot::before {\n content: '';\n width: var(--vectis-control-size-check-dot);\n height: var(--vectis-control-size-check-dot);\n border-radius: var(--vectis-radius-pill);\n background: currentcolor;\n opacity: 0;\n transition: opacity var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio-input:checked + .v-radio-dot::before {\n opacity: 1;\n }\n\n /* The state painting, rule for rule the same as VCheckbox's with its own classes: keep the\n two ALIGNED. Every state below but the hovers weighs (0,3,0), so their ORDER arbitrates\n them: checked, read-only, invalid, then disabled last. The two hovers exclude every state\n they must not repaint, so no order argument reaches them. */\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled, :checked)\n + .v-radio-dot {\n border-color: color-mix(\n in oklab,\n var(--vectis-color-border-strong),\n var(--vectis-color-text) 15%\n );\n }\n\n .v-radio-input:checked + .v-radio-dot {\n background: var(--vectis-color-accent);\n border-color: var(--vectis-color-accent);\n }\n\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled):is(:checked)\n + .v-radio-dot {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /* Read-only sinks like a read-only field, and a selected control trades the accent for the\n muted text colour: still plainly on, no longer inviting a click. The mark takes the\n surface colour, which contrasts with that fill in both themes, where white would vanish\n against the light grey of the dark theme. `:where()` keeps both rules at the weight of\n the states they sit between. */\n :where(.v-radio[data-readonly]) .v-radio-input + .v-radio-dot {\n background: var(--vectis-color-surface-sunken);\n border-color: var(--vectis-color-border);\n }\n\n :where(.v-radio[data-readonly]) .v-radio-input:checked + .v-radio-dot {\n background: var(--vectis-color-text-muted);\n border-color: var(--vectis-color-text-muted);\n color: var(--vectis-color-surface);\n }\n\n .v-radio-input:user-invalid + .v-radio-dot,\n .v-radio-input[aria-invalid='true'] + .v-radio-dot {\n border-color: var(--vectis-color-danger);\n }\n\n .v-radio-input:disabled + .v-radio-dot {\n background: var(--vectis-color-surface-muted);\n border-color: var(--vectis-color-border);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-radio-dot,\n .v-radio-dot::before {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRootAttrs as e } from "../../composables/useRootAttrs.js";
|
|
2
|
+
import { useFieldIds as t } from "../../composables/useFieldIds.js";
|
|
3
|
+
import { createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, normalizeClass as l, normalizeStyle as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useModel as g, vModelRadio as _, withDirectives as v } from "vue";
|
|
2
4
|
//#region src/components/VRadio/VRadio.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
5
|
+
var y = [
|
|
6
|
+
"data-label-position",
|
|
7
|
+
"data-spread",
|
|
8
|
+
"data-readonly"
|
|
9
|
+
], b = { class: "v-choice-row" }, x = [
|
|
4
10
|
"value",
|
|
5
11
|
"disabled",
|
|
6
|
-
"aria-invalid"
|
|
7
|
-
|
|
12
|
+
"aria-invalid",
|
|
13
|
+
"aria-describedby"
|
|
14
|
+
], S = {
|
|
8
15
|
key: 0,
|
|
9
|
-
class: "v-radio-label"
|
|
10
|
-
},
|
|
16
|
+
class: "v-radio-label v-choice-label"
|
|
17
|
+
}, C = ["id"], w = /*@__PURE__*/ o({
|
|
11
18
|
inheritAttrs: !1,
|
|
12
19
|
__name: "VRadio",
|
|
13
|
-
props: /*@__PURE__*/
|
|
20
|
+
props: /*@__PURE__*/ s({
|
|
14
21
|
value: {},
|
|
22
|
+
label: { default: void 0 },
|
|
23
|
+
hint: { default: void 0 },
|
|
15
24
|
labelPosition: { default: "end" },
|
|
16
25
|
spread: {
|
|
17
26
|
type: Boolean,
|
|
@@ -24,37 +33,57 @@ var d = ["data-label-position", "data-spread"], f = [
|
|
|
24
33
|
disabled: {
|
|
25
34
|
type: Boolean,
|
|
26
35
|
default: !1
|
|
36
|
+
},
|
|
37
|
+
readonly: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
27
40
|
}
|
|
28
41
|
}, {
|
|
29
42
|
modelValue: { default: "" },
|
|
30
43
|
modelModifiers: {}
|
|
31
44
|
}),
|
|
32
45
|
emits: ["update:modelValue"],
|
|
33
|
-
setup(
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
setup(o, { expose: s }) {
|
|
47
|
+
let w = o, { attrs: T, rootClass: E, rootStyle: D, forwardedAttrs: O } = e(), { hintId: k, describedBy: A } = t(T, () => !!w.hint), j = g(o, "modelValue"), M = f(null);
|
|
48
|
+
function N(e) {
|
|
49
|
+
w.readonly && e.preventDefault();
|
|
50
|
+
}
|
|
51
|
+
return s({
|
|
52
|
+
focus: (e) => M.value?.focus(e),
|
|
53
|
+
el: M
|
|
54
|
+
}), (e, t) => (d(), r("span", {
|
|
55
|
+
class: l(["v-radio v-choice", h(E)]),
|
|
56
|
+
style: u(h(D)),
|
|
57
|
+
"data-label-position": o.labelPosition,
|
|
58
|
+
"data-spread": o.spread ? "" : void 0,
|
|
59
|
+
"data-readonly": o.readonly ? "" : void 0
|
|
60
|
+
}, [i("label", b, [
|
|
61
|
+
v(i("input", c({
|
|
62
|
+
ref_key: "inputEl",
|
|
63
|
+
ref: M,
|
|
64
|
+
"onUpdate:modelValue": t[0] ||= (e) => j.value = e,
|
|
42
65
|
type: "radio",
|
|
43
|
-
class: "v-radio-input"
|
|
44
|
-
},
|
|
45
|
-
value:
|
|
46
|
-
disabled:
|
|
47
|
-
"aria-invalid":
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
class: "v-radio-input v-hidden-input"
|
|
67
|
+
}, h(O), {
|
|
68
|
+
value: o.value,
|
|
69
|
+
disabled: o.disabled,
|
|
70
|
+
"aria-invalid": o.invalid || void 0,
|
|
71
|
+
"aria-describedby": h(A),
|
|
72
|
+
onClick: N
|
|
73
|
+
}), null, 16, x), [[_, j.value]]),
|
|
74
|
+
t[1] ||= i("span", {
|
|
50
75
|
class: "v-radio-dot",
|
|
51
76
|
"aria-hidden": "true"
|
|
52
77
|
}, null, -1),
|
|
53
|
-
|
|
54
|
-
],
|
|
78
|
+
e.$slots.default || o.label ? (d(), r("span", S, [p(e.$slots, "default", {}, () => [a(m(o.label), 1)])])) : n("", !0)
|
|
79
|
+
]), o.hint ? (d(), r("span", {
|
|
80
|
+
key: 0,
|
|
81
|
+
id: h(k),
|
|
82
|
+
class: "v-radio-hint v-choice-hint"
|
|
83
|
+
}, m(o.hint), 9, C)) : n("", !0)], 14, y));
|
|
55
84
|
}
|
|
56
85
|
});
|
|
57
86
|
//#endregion
|
|
58
|
-
export {
|
|
87
|
+
export { w as default };
|
|
59
88
|
|
|
60
89
|
//# sourceMappingURL=VRadio.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VRadio.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots"],"sources":["../../../src/components/VRadio/VRadio.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A radio button whose dot is drawn by the design system, on the same principle as\n * VCheckbox: the real `<input type=\"radio\">` stays in place and only its own drawing\n * is hidden.\n *\n * The group is native as well. Several VRadio sharing the same `name` and the same\n * v-model form one choice, and it is the browser that then makes the arrow keys move\n * between them, that lets only one be selected, and that gives the group a single\n * stop in the tab order. There is no JavaScript here for any of it.\n */\ninterface RadioProps {\n /**\n * What choosing this button means. The group's v-model holds the value of the\n * selected button, so this is what it becomes when this one is picked.\n */\n value: string\n /** Which side of the dot the label sits on. */\n labelPosition?: 'start' | 'end'\n /**\n * Pushes the label and the dot to opposite ends of the line, the row taking the\n * full width available.\n */\n spread?: boolean\n /**\n * Marks the field as invalid, which colours the dot and tells assistive technology\n * so. It is for a rule the browser cannot check by itself.\n */\n invalid?: boolean\n /** Makes this choice unusable, greyed out through the colour tokens. */\n disabled?: boolean\n}\n\nwithDefaults(defineProps<RadioProps>(), {\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n})\n\n// @a11y — the component's ONLY behavioural decision, and it buys the whole keyboard.\n// Moving between the buttons of a group is the browser's job, but it only groups\n// inputs that share a `name` — so redirecting the attributes is what makes the arrow\n// keys work at all. The root being the <label>, `name` left on it would reach\n// nothing.\ndefineOptions({ inheritAttrs: false })\n\nconst model = defineModel<string>({ default: '' })\n\ndefineSlots<{\n /** The label. It is clickable, the whole component being wrapped in a `<label>`. */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <label class=\"v-radio\" :data-label-position=\"labelPosition\" :data-spread=\"spread || undefined\">\n <input\n v-model=\"model\"\n type=\"radio\"\n class=\"v-radio-input\"\n v-bind=\"$attrs\"\n :value=\"value\"\n :disabled=\"disabled\"\n :aria-invalid=\"invalid || undefined\"\n />\n <span class=\"v-radio-dot\" aria-hidden=\"true\" />\n <span v-if=\"$slots.default\" class=\"v-radio-label\"><slot /></span>\n </label>\n</template>\n\n<style>\n@layer vectis.components {\n .v-radio {\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-2);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-label-size);\n color: var(--vectis-color-text);\n cursor: pointer;\n }\n\n /* The input is taken out of the flow by its absolute position, so reversing the\n row only ever swaps the dot and the label. */\n .v-radio[data-label-position='start'] {\n flex-direction: row-reverse;\n }\n\n .v-radio[data-spread] {\n display: flex;\n justify-content: space-between;\n }\n\n /* Hidden with `opacity` and never with `display: none`, which would take the input\n out of the tab order, out of the form and out of its own group. */\n .v-radio-input {\n position: absolute;\n opacity: 0;\n width: 1px;\n height: 1px;\n margin: 0;\n pointer-events: none;\n }\n\n /* The dot works exactly like VCheckbox's box — the accent colour fills it once the\n input is checked — with the small inner disc drawn as a pseudo-element in\n currentcolor, so it follows whatever colour the ring takes. */\n .v-radio-dot {\n display: inline-grid;\n place-items: center;\n width: var(--vectis-control-size-check);\n height: var(--vectis-control-size-check);\n flex: none;\n background: var(--vectis-color-surface);\n border: var(--vectis-control-border-width) solid var(--vectis-color-border-strong);\n border-radius: var(--vectis-radius-full);\n color: var(--vectis-color-text-on-accent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio-dot::before {\n content: '';\n width: var(--vectis-control-size-check-dot);\n height: var(--vectis-control-size-check-dot);\n border-radius: var(--vectis-radius-full);\n background: currentcolor;\n opacity: 0;\n transition: opacity var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio:hover .v-radio-input:not(:disabled, :checked) + .v-radio-dot {\n border-color: color-mix(\n in oklab,\n var(--vectis-color-border-strong),\n var(--vectis-color-text) 15%\n );\n }\n\n .v-radio-input:checked + .v-radio-dot {\n background: var(--vectis-color-accent);\n border-color: var(--vectis-color-accent);\n }\n\n .v-radio-input:checked + .v-radio-dot::before {\n opacity: 1;\n }\n\n .v-radio:hover .v-radio-input:not(:disabled):checked + .v-radio-dot {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n .v-radio-input:focus-visible + .v-radio-dot {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-radio-input:user-invalid + .v-radio-dot,\n .v-radio-input[aria-invalid='true'] + .v-radio-dot {\n border-color: var(--vectis-color-danger);\n }\n\n /* A disabled radio greys out through the colour tokens, the same ones VButton\n uses, and never through opacity. */\n .v-radio:has(.v-radio-input:disabled) {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n .v-radio-input:disabled + .v-radio-dot {\n background: var(--vectis-color-surface-muted);\n border-color: var(--vectis-color-border);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-radio-dot,\n .v-radio-dot::before {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CA,IAAM,IAAQ,EAAmB,GAAA,YAAgB;yBAS/C,EAYQ,SAAA;GAZD,OAAM;GAAW,uBAAqB,EAAA;GAAgB,eAAa,EAAA,UAAU,KAAA;;KAClF,EAQE,SARF,EAQE;6CAPc,QAAA;IACd,MAAK;IACL,OAAM;MACEA,EAAAA,QAAM;IACb,OAAO,EAAA;IACP,UAAU,EAAA;IACV,gBAAc,EAAA,WAAW,KAAA;0BANjB,EAAA,KAAK,CAAA,CAAA;YAQhB,EAA+C,QAAA;IAAzC,OAAM;IAAc,eAAY;;GAC1BC,EAAAA,OAAO,WAAA,EAAA,GAAnB,EAAiE,QAAjE,GAAiE,CAAf,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"VRadio.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VRadio/VRadio.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A radio button whose dot is drawn by the design system, on the same principle as\n * VCheckbox: the real `<input type=\"radio\">` stays in place and only its own drawing\n * is hidden.\n *\n * The group is native as well. Several VRadio sharing the same `name` and the same\n * v-model form one choice, and it is the browser that then makes the arrow keys move\n * between them, that lets only one be selected, and that gives the group a single\n * stop in the tab order. There is no JavaScript here for any of it; the only piece this\n * component writes is the refusal `readonly` asks for, which a radio has no native form of.\n */\n\nimport { ref } from 'vue'\n\nimport { useFieldIds } from '../../composables/useFieldIds'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport type { ItemValue } from '../../types'\n\n/** Which side of the dot the label sits on. */\nexport type RadioLabelPosition = 'start' | 'end'\n\ninterface RadioProps {\n /**\n * What choosing this button means. The group's v-model holds the value of the\n * selected button, so this is what it becomes when this one is picked.\n */\n value: ItemValue\n /** The text beside the dot, which names it. The default slot replaces it. */\n label?: string\n /**\n * A line of help under the label. It is tied to the radio button for assistive\n * technology, so it is read out after the label rather than as part of it.\n */\n hint?: string\n /** Which side of the dot the label sits on. */\n labelPosition?: RadioLabelPosition\n /**\n * Pushes the label and the dot to opposite ends of the line, the row taking the\n * full width available.\n */\n spread?: boolean\n /**\n * Marks the field as invalid, which colours the dot and tells assistive technology\n * so. It is for a rule the browser cannot check by itself.\n */\n invalid?: boolean\n /** Makes this choice unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the selection without allowing it to be changed. The button can still be\n * focused and is still submitted with its form; a click or an arrow key simply selects\n * nothing. Set it on every button of the group.\n */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n hint: undefined,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y — the redirection buys the whole keyboard. Moving between the buttons of a group is\n// the browser's job, but it only groups inputs that share a `name` — so redirecting the\n// attributes is what makes the arrow keys work at all. The root being a layout box, `name`\n// left on it would reach nothing.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\nconst { hintId, describedBy } = useFieldIds(attrs, () => !!props.hint)\n\n/**\n * The value selected in the group, shared by every radio carrying the same `name`. It is\n * empty until one is chosen, and a radio is selected when it matches its own `value`.\n */\nconst model = defineModel<ItemValue>({ default: '' })\n\ndefineSlots<{\n /** The label, when it needs more than the `label` prop's text. It is clickable. */\n default?(): unknown\n}>()\n\nconst inputEl = ref<HTMLInputElement | null>(null)\n\n// @core\n// The native `readonly` attribute does nothing on a radio button. Cancelling the click is\n// what refuses the selection: the browser puts the group's previous selection back and fires\n// no `change`. It covers the arrow keys too, which select the next button of the group\n// through a click the browser dispatches on it — so the focus still moves, the selection\n// does not.\n//\n// No `aria-readonly` goes with it, unlike VCheckbox and VSwitch: ARIA allows it on a\n// `radiogroup` and not on a `radio`, and axe fails the page for it.\nfunction refuseWhenReadonly(event: MouseEvent) {\n if (props.readonly) event.preventDefault()\n}\n\n// The root is a wrapper, so a template ref on the component reaches the layout box and not\n// the control: these two are the way to the real radio button.\ndefineExpose({\n /** Moves the focus to the real radio button. */\n focus: (options?: FocusOptions) => inputEl.value?.focus(options),\n /** The real `<input type=\"radio\">`, for what `focus` does not cover. */\n el: inputEl,\n})\n</script>\n\n<template>\n <span\n class=\"v-radio v-choice\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-label-position=\"labelPosition\"\n :data-spread=\"spread ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n >\n <label class=\"v-choice-row\">\n <input\n ref=\"inputEl\"\n v-model=\"model\"\n type=\"radio\"\n class=\"v-radio-input v-hidden-input\"\n v-bind=\"forwardedAttrs\"\n :value=\"value\"\n :disabled=\"disabled\"\n :aria-invalid=\"invalid || undefined\"\n :aria-describedby=\"describedBy\"\n @click=\"refuseWhenReadonly\"\n />\n <span class=\"v-radio-dot\" aria-hidden=\"true\" />\n <span v-if=\"$slots.default || label\" class=\"v-radio-label v-choice-label\">\n <slot>{{ label }}</slot>\n </span>\n </label>\n <span v-if=\"hint\" :id=\"hintId\" class=\"v-radio-hint v-choice-hint\">{{ hint }}</span>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /* The dot works exactly like VCheckbox's box, the accent filling it once the input is\n checked, with the small inner disc drawn as a pseudo-element in currentcolor so it\n follows whatever colour the state gives the ring's content. */\n .v-radio-dot {\n display: inline-grid;\n place-items: center;\n width: var(--vectis-control-size-check);\n height: var(--vectis-control-size-check);\n background: transparent;\n border: var(--vectis-control-border-width) solid var(--vectis-color-border-strong);\n border-radius: var(--vectis-radius-pill);\n color: var(--vectis-color-text-on-accent);\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n border-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio-dot::before {\n content: '';\n width: var(--vectis-control-size-check-dot);\n height: var(--vectis-control-size-check-dot);\n border-radius: var(--vectis-radius-pill);\n background: currentcolor;\n opacity: 0;\n transition: opacity var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n .v-radio-input:checked + .v-radio-dot::before {\n opacity: 1;\n }\n\n /* The state painting, rule for rule the same as VCheckbox's with its own classes: keep the\n two ALIGNED. Every state below but the hovers weighs (0,3,0), so their ORDER arbitrates\n them: checked, read-only, invalid, then disabled last. The two hovers exclude every state\n they must not repaint, so no order argument reaches them. */\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled, :checked)\n + .v-radio-dot {\n border-color: color-mix(\n in oklab,\n var(--vectis-color-border-strong),\n var(--vectis-color-text) 15%\n );\n }\n\n .v-radio-input:checked + .v-radio-dot {\n background: var(--vectis-color-accent);\n border-color: var(--vectis-color-accent);\n }\n\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled):is(:checked)\n + .v-radio-dot {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /* Read-only sinks like a read-only field, and a selected control trades the accent for the\n muted text colour: still plainly on, no longer inviting a click. The mark takes the\n surface colour, which contrasts with that fill in both themes, where white would vanish\n against the light grey of the dark theme. `:where()` keeps both rules at the weight of\n the states they sit between. */\n :where(.v-radio[data-readonly]) .v-radio-input + .v-radio-dot {\n background: var(--vectis-color-surface-sunken);\n border-color: var(--vectis-color-border);\n }\n\n :where(.v-radio[data-readonly]) .v-radio-input:checked + .v-radio-dot {\n background: var(--vectis-color-text-muted);\n border-color: var(--vectis-color-text-muted);\n color: var(--vectis-color-surface);\n }\n\n .v-radio-input:user-invalid + .v-radio-dot,\n .v-radio-input[aria-invalid='true'] + .v-radio-dot {\n border-color: var(--vectis-color-danger);\n }\n\n .v-radio-input:disabled + .v-radio-dot {\n background: var(--vectis-color-surface-muted);\n border-color: var(--vectis-color-border);\n color: var(--vectis-color-text-subtle);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-radio-dot,\n .v-radio-dot::before {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDA,IAAM,IAAQ,GAeR,EAAE,UAAO,cAAW,cAAW,sBAAmB,EAAa,GAC/D,EAAE,WAAQ,mBAAgB,EAAY,SAAa,CAAC,CAAC,EAAM,IAAI,GAM/D,IAAQ,EAAsB,GAAA,YAAgB,GAO9C,IAAU,EAA6B,IAAI;EAWjD,SAAS,EAAmB,GAAmB;GAC7C,AAAI,EAAM,YAAU,EAAM,eAAe;EAC3C;SAIA,EAAa;GAEX,QAAQ,MAA2B,EAAQ,OAAO,MAAM,CAAO;GAE/D,IAAI;EACN,CAAC,mBAIC,EA2BO,QAAA;GA1BL,OAAK,EAAA,CAAC,oBACE,EAAA,CAAA,CAAS,CAAA;GAChB,OAAK,EAAE,EAAA,CAAA,CAAS;GAChB,uBAAqB,EAAA;GACrB,eAAa,EAAA,SAAM,KAAQ,KAAA;GAC3B,iBAAe,EAAA,WAAQ,KAAQ,KAAA;MAEhC,EAiBQ,SAjBR,GAiBQ;KAhBN,EAWE,SAXF,EAWE;aAVI;IAAJ,KAAI;6CACU,QAAA;IACd,MAAK;IACL,OAAM;MACE,EAAA,CAAA,GAAc;IACrB,OAAO,EAAA;IACP,UAAU,EAAA;IACV,gBAAc,EAAA,WAAW,KAAA;IACzB,oBAAkB,EAAA,CAAA;IAClB,SAAO;0BARC,EAAA,KAAK,CAAA,CAAA;YAUhB,EAA+C,QAAA;IAAzC,OAAM;IAAc,eAAY;;GAC1BA,EAAAA,OAAO,WAAW,EAAA,SAAA,EAAA,GAA9B,EAEO,QAFP,GAEO,CADL,EAAwB,EAAA,QAAA,WAAA,CAAA,SAAA,CAAA,EAAA,EAAf,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;MAGN,EAAA,QAAA,EAAA,GAAZ,EAAmF,QAAA;;GAAhE,IAAI,EAAA,CAAA;GAAQ,OAAM;OAAgC,EAAA,IAAI,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
|