vectis-ui 0.11.0 → 0.13.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/dist/components/VAccordion/VAccordion.css +1 -1
- package/dist/components/VAccordion/VAccordion.d.ts +6 -5
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- 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 +1 -1
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAlert/VAlert.css +2 -0
- package/dist/components/VAlert/VAlert.d.ts +73 -0
- package/dist/components/VAlert/VAlert.js +9 -0
- package/dist/components/VAlert/VAlert.js.map +1 -0
- package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAvatar/VAvatar.d.ts +2 -2
- package/dist/components/VAvatar/VAvatarGroup.d.ts +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VBadge/VBadge.d.ts +3 -3
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/VButton/VButton.d.ts +4 -4
- package/dist/components/VButton/VButtonGroup.css +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +2 -2
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +7 -1
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +20 -18
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +2 -2
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.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.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +1 -16
- package/dist/components/VCalendar/gesture.js +1 -1
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +2 -0
- package/dist/components/VCard/VCard.css +2 -0
- package/dist/components/VCard/VCard.d.ts +87 -0
- package/dist/components/VCard/VCard.js +9 -0
- package/dist/components/VCard/VCard.js.map +1 -0
- package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCarousel/VCarousel.d.ts +1 -1
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCheckbox/VCheckMark.css +2 -0
- package/dist/components/VCheckbox/VCheckMark.js +9 -0
- package/dist/components/VCheckbox/VCheckMark.js.map +1 -0
- package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +8 -3
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +54 -69
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.d.ts +6 -6
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VColorInput/VColorInput.css +2 -0
- package/dist/components/VColorInput/VColorInput.d.ts +113 -0
- package/dist/components/VColorInput/VColorInput.js +9 -0
- package/dist/components/VColorInput/VColorInput.js.map +1 -0
- package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VColorPicker/VColorPicker.css +2 -0
- package/dist/components/VColorPicker/VColorPicker.d.ts +67 -0
- package/dist/components/VColorPicker/VColorPicker.js +9 -0
- package/dist/components/VColorPicker/VColorPicker.js.map +1 -0
- package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +390 -0
- package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VColorPicker/color.d.ts +42 -0
- package/dist/components/VColorPicker/color.js +158 -0
- package/dist/components/VColorPicker/color.js.map +1 -0
- package/dist/components/VCombobox/VCombobox.css +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +46 -60
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +271 -372
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCommandPalette/VCommandPalette.css +2 -0
- package/dist/components/VCommandPalette/VCommandPalette.d.ts +163 -0
- package/dist/components/VCommandPalette/VCommandPalette.js +9 -0
- package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.css +2 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.d.ts +38 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.js +9 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VContextMenu/VContextMenu.css +2 -0
- package/dist/components/VContextMenu/VContextMenu.d.ts +66 -0
- package/dist/components/VContextMenu/VContextMenu.js +9 -0
- package/dist/components/VContextMenu/VContextMenu.js.map +1 -0
- package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +41 -23
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +291 -186
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +27 -7
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +170 -162
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +3 -3
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +228 -227
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +7 -7
- package/dist/components/VDatePicker/keyboard.js +8 -6
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.js +16 -20
- package/dist/components/VDatePicker/names.js.map +1 -1
- package/dist/components/VDialog/VDialog.d.ts +2 -4
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +46 -77
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDrawer/VDrawer.css +2 -0
- package/dist/components/VDrawer/VDrawer.d.ts +102 -0
- package/dist/components/VDrawer/VDrawer.js +9 -0
- package/dist/components/VDrawer/VDrawer.js.map +1 -0
- package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VEmptyState/VEmptyState.css +2 -0
- package/dist/components/VEmptyState/VEmptyState.d.ts +43 -0
- package/dist/components/VEmptyState/VEmptyState.js +9 -0
- package/dist/components/VEmptyState/VEmptyState.js.map +1 -0
- package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VField.css +2 -0
- package/dist/components/VField/VField.d.ts +84 -0
- package/dist/components/VField/VField.js +9 -0
- package/dist/components/VField/VField.js.map +1 -0
- package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VFieldAnnouncer.d.ts +7 -0
- package/dist/components/VField/VFieldAnnouncer.js +7 -0
- package/dist/components/VField/VFieldAnnouncer.js.map +1 -0
- package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VFieldMessage.d.ts +11 -0
- package/dist/components/VField/VFieldMessage.js +7 -0
- package/dist/components/VField/VFieldMessage.js.map +1 -0
- package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFieldset/VFieldset.css +2 -0
- package/dist/components/VFieldset/VFieldset.d.ts +52 -0
- package/dist/components/VFieldset/VFieldset.js +9 -0
- package/dist/components/VFieldset/VFieldset.js.map +1 -0
- package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFileInput/VFileInput.css +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +31 -7
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +168 -161
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +4 -4
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +27 -30
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +2 -0
- package/dist/components/VHotkeys/platform.js +24 -5
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VHoverCard/VHoverCard.css +2 -0
- package/dist/components/VHoverCard/VHoverCard.d.ts +62 -0
- package/dist/components/VHoverCard/VHoverCard.js +9 -0
- package/dist/components/VHoverCard/VHoverCard.js.map +1 -0
- package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VIcon/icons/add.d.ts +5 -0
- package/dist/components/VIcon/icons/add.js +9 -0
- package/dist/components/VIcon/icons/add.js.map +1 -0
- package/dist/components/VIcon/icons/colorize.d.ts +5 -0
- package/dist/components/VIcon/icons/colorize.js +9 -0
- package/dist/components/VIcon/icons/colorize.js.map +1 -0
- package/dist/components/VIcon/icons/inbox.d.ts +5 -0
- package/dist/components/VIcon/icons/inbox.js +9 -0
- package/dist/components/VIcon/icons/inbox.js.map +1 -0
- package/dist/components/VIcon/icons/index.d.ts +42 -2
- package/dist/components/VIcon/icons/index.js +88 -72
- package/dist/components/VIcon/icons/index.js.map +1 -1
- package/dist/components/VIcon/icons/names.d.ts +2 -2
- package/dist/components/VIcon/icons/names.js +1 -1
- package/dist/components/VIcon/icons/names.js.map +1 -1
- package/dist/components/VIcon/icons/open_in_new.d.ts +5 -0
- package/dist/components/VIcon/icons/open_in_new.js +9 -0
- package/dist/components/VIcon/icons/open_in_new.js.map +1 -0
- package/dist/components/VIcon/icons/priority_high.d.ts +5 -0
- package/dist/components/VIcon/icons/priority_high.js +9 -0
- package/dist/components/VIcon/icons/priority_high.js.map +1 -0
- package/dist/components/VIcon/icons/remove.d.ts +5 -0
- package/dist/components/VIcon/icons/remove.js +9 -0
- package/dist/components/VIcon/icons/remove.js.map +1 -0
- package/dist/components/VIcon/icons/search_off.d.ts +5 -0
- package/dist/components/VIcon/icons/search_off.js +9 -0
- package/dist/components/VIcon/icons/search_off.js.map +1 -0
- package/dist/components/VIcon/icons/star.d.ts +5 -0
- package/dist/components/VIcon/icons/star.js +9 -0
- package/dist/components/VIcon/icons/star.js.map +1 -0
- package/dist/components/VIconButton/VIconButton.d.ts +4 -4
- package/dist/components/VInput/VInput.css +1 -1
- package/dist/components/VInput/VInput.d.ts +51 -2
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +129 -106
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +1 -1
- package/dist/components/VInput/VInputGroup.d.ts +20 -0
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +50 -51
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +27 -4
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +131 -113
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VLink/VLink.css +2 -0
- package/dist/components/VLink/VLink.d.ts +53 -0
- package/dist/components/VLink/VLink.js +9 -0
- package/dist/components/VLink/VLink.js.map +1 -0
- package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxChevron.css +2 -0
- package/dist/components/VListbox/VListboxChevron.d.ts +12 -0
- package/dist/components/VListbox/VListboxChevron.js +9 -0
- package/dist/components/VListbox/VListboxChevron.js.map +1 -0
- package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxGroup.css +2 -0
- package/dist/components/VListbox/VListboxGroup.d.ts +27 -0
- package/dist/components/VListbox/VListboxGroup.js +9 -0
- package/dist/components/VListbox/VListboxGroup.js.map +1 -0
- package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxOption.css +2 -0
- package/dist/components/{VCombobox/VComboboxOption.d.ts → VListbox/VListboxOption.d.ts} +4 -4
- package/dist/components/VListbox/VListboxOption.js +9 -0
- package/dist/components/VListbox/VListboxOption.js.map +1 -0
- package/dist/components/{VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js} +6 -6
- package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxPanel.css +2 -0
- package/dist/components/VListbox/VListboxPanel.d.ts +59 -0
- package/dist/components/VListbox/VListboxPanel.js +9 -0
- package/dist/components/VListbox/VListboxPanel.js.map +1 -0
- package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxSeparator.css +2 -0
- package/dist/components/VListbox/VListboxSeparator.d.ts +3 -0
- package/dist/components/VListbox/VListboxSeparator.js +9 -0
- package/dist/components/VListbox/VListboxSeparator.js.map +1 -0
- package/dist/components/{VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js} +4 -4
- package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxValues.css +2 -0
- package/dist/components/VListbox/VListboxValues.d.ts +52 -0
- package/dist/components/VListbox/VListboxValues.js +9 -0
- package/dist/components/VListbox/VListboxValues.js.map +1 -0
- package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenu.d.ts +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/VMenu/VMenuItem.d.ts +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMeter/VMeter.css +2 -0
- package/dist/components/VMeter/VMeter.d.ts +77 -0
- package/dist/components/VMeter/VMeter.js +9 -0
- package/dist/components/VMeter/VMeter.js.map +1 -0
- package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VNumberInput/VNumberInput.css +2 -0
- package/dist/components/VNumberInput/VNumberInput.d.ts +114 -0
- package/dist/components/VNumberInput/VNumberInput.js +9 -0
- package/dist/components/VNumberInput/VNumberInput.js.map +1 -0
- package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VNumberInput/number.d.ts +30 -0
- package/dist/components/VNumberInput/number.js +38 -0
- package/dist/components/VNumberInput/number.js.map +1 -0
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +4 -12
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +89 -96
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -2
- package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +10 -7
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +52 -34
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.d.ts +8 -3
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +52 -46
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRating/VRating.css +2 -0
- package/dist/components/VRating/VRating.d.ts +92 -0
- package/dist/components/VRating/VRating.js +9 -0
- package/dist/components/VRating/VRating.js.map +1 -0
- package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js +158 -0
- package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/VResizable.css +2 -0
- package/dist/components/VResizable/VResizable.d.ts +50 -0
- package/dist/components/VResizable/VResizable.js +9 -0
- package/dist/components/VResizable/VResizable.js.map +1 -0
- package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/VResizablePanel.css +2 -0
- package/dist/components/VResizable/VResizablePanel.d.ts +60 -0
- package/dist/components/VResizable/VResizablePanel.js +9 -0
- package/dist/components/VResizable/VResizablePanel.js.map +1 -0
- package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/context.d.ts +24 -0
- package/dist/components/VResizable/context.js +6 -0
- package/dist/components/VResizable/context.js.map +1 -0
- package/dist/components/VResizable/layout.d.ts +28 -0
- package/dist/components/VResizable/layout.js +41 -0
- package/dist/components/VResizable/layout.js.map +1 -0
- package/dist/components/VSelect/VSelect.css +2 -0
- package/dist/components/VSelect/VSelect.d.ts +193 -0
- package/dist/components/VSelect/VSelect.js +9 -0
- package/dist/components/VSelect/VSelect.js.map +1 -0
- package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +424 -0
- package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- 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.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +2 -2
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +3 -3
- package/dist/components/VSlider/VSlider.css +1 -1
- package/dist/components/VSlider/VSlider.d.ts +34 -8
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +236 -215
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSplitButton/VSplitButton.css +2 -0
- package/dist/components/VSplitButton/VSplitButton.d.ts +114 -0
- package/dist/components/VSplitButton/VSplitButton.js +9 -0
- package/dist/components/VSplitButton/VSplitButton.js.map +1 -0
- package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VStepper/VStepper.css +2 -0
- package/dist/components/VStepper/VStepper.d.ts +73 -0
- package/dist/components/VStepper/VStepper.js +9 -0
- package/dist/components/VStepper/VStepper.js.map +1 -0
- package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSwitch/VSwitch.d.ts +8 -3
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +53 -47
- 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 +1 -1
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.css +1 -1
- package/dist/components/VTabs/VTabs.d.ts +13 -5
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.css +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +22 -2
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +108 -100
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +27 -7
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +187 -171
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +2 -2
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +15 -15
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeline/VTimeline.css +2 -0
- package/dist/components/VTimeline/VTimeline.d.ts +59 -0
- package/dist/components/VTimeline/VTimeline.js +9 -0
- package/dist/components/VTimeline/VTimeline.js.map +1 -0
- package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimeline/VTimelineItem.css +2 -0
- package/dist/components/VTimeline/VTimelineItem.d.ts +48 -0
- package/dist/components/VTimeline/VTimelineItem.js +9 -0
- package/dist/components/VTimeline/VTimelineItem.js.map +1 -0
- package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimeline/context.d.ts +11 -0
- package/dist/components/VTimeline/context.js +6 -0
- package/dist/components/VTimeline/context.js.map +1 -0
- package/dist/components/VTimeline/datetime.d.ts +8 -0
- package/dist/components/VTimeline/datetime.js +36 -0
- package/dist/components/VTimeline/datetime.js.map +1 -0
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/VToggle/VToggle.d.ts +4 -4
- package/dist/components/VToggle/VToggleItem.d.ts +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +8 -2
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +45 -43
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTreeView/VTreeView.css +2 -0
- package/dist/components/VTreeView/VTreeView.d.ts +112 -0
- package/dist/components/VTreeView/VTreeView.js +9 -0
- package/dist/components/VTreeView/VTreeView.js.map +1 -0
- package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTypography/VTypography.d.ts +1 -1
- package/dist/components/VVirtualList/VVirtualList.css +2 -0
- package/dist/components/VVirtualList/VVirtualList.d.ts +78 -0
- package/dist/components/VVirtualList/VVirtualList.js +9 -0
- package/dist/components/VVirtualList/VVirtualList.js.map +1 -0
- package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useChoice.d.ts +28 -0
- package/dist/composables/useChoice.js +28 -0
- package/dist/composables/useChoice.js.map +1 -0
- package/dist/composables/useDebouncedSearch.d.ts +17 -0
- package/dist/composables/useDebouncedSearch.js +18 -0
- package/dist/composables/useDebouncedSearch.js.map +1 -0
- package/dist/composables/useEscapeDismiss.d.ts +8 -0
- package/dist/composables/useEscapeDismiss.js +16 -0
- package/dist/composables/useEscapeDismiss.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +2 -1
- package/dist/composables/useFieldIds.js +7 -6
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +1 -0
- package/dist/composables/useFieldPanel.js +52 -42
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -3
- package/dist/composables/useFileField.js +48 -50
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useHotkeyListener.d.ts +17 -0
- package/dist/composables/useHotkeyListener.js +26 -0
- package/dist/composables/useHotkeyListener.js.map +1 -0
- package/dist/composables/useIconClickHandlers.d.ts +2 -10
- package/dist/composables/useIconClickHandlers.js +1 -1
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/{components/VCombobox/infiniteScroll.d.ts → composables/useInfiniteScroll.d.ts} +6 -0
- package/dist/{components/VCombobox/infiniteScroll.js → composables/useInfiniteScroll.js} +7 -7
- package/dist/composables/useInfiniteScroll.js.map +1 -0
- package/dist/composables/useListbox.d.ts +132 -0
- package/dist/composables/useListbox.js +227 -0
- package/dist/composables/useListbox.js.map +1 -0
- package/dist/composables/useModalDialog.d.ts +28 -0
- package/dist/composables/useModalDialog.js +60 -0
- package/dist/composables/useModalDialog.js.map +1 -0
- package/dist/composables/useRootAttrs.d.ts +2 -3
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useVirtualList.d.ts +46 -0
- package/dist/composables/useVirtualList.js +145 -0
- package/dist/composables/useVirtualList.js.map +1 -0
- package/dist/i18n/en.js +50 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js +50 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/types.d.ts +103 -2
- package/dist/icons.js +45 -37
- package/dist/index.d.ts +50 -4
- package/dist/index.js +80 -56
- package/dist/styles.css +1 -1
- package/dist/tokens/index.d.ts +43 -0
- package/dist/tokens/semantic.d.ts +42 -0
- package/dist/tokens/semantic.js +43 -1
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.d.ts +1 -0
- package/dist/tokens/themes/dark.js +1 -0
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens.json +215 -1
- package/dist/types.d.ts +57 -4
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/attrs.d.ts +9 -0
- package/dist/utils/attrs.js +14 -0
- package/dist/utils/attrs.js.map +1 -0
- package/dist/utils/date.d.ts +1 -0
- package/dist/utils/date.js +2 -2
- package/dist/utils/date.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/VCombobox/VComboboxGroup.css +0 -2
- package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -17
- package/dist/components/VCombobox/VComboboxGroup.js +0 -9
- package/dist/components/VCombobox/VComboboxGroup.js.map +0 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +0 -21
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/VComboboxOption.css +0 -2
- package/dist/components/VCombobox/VComboboxOption.js +0 -9
- package/dist/components/VCombobox/VComboboxOption.js.map +0 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/VComboboxSeparator.css +0 -2
- package/dist/components/VCombobox/VComboboxSeparator.js +0 -9
- package/dist/components/VCombobox/VComboboxSeparator.js.map +0 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/infiniteScroll.js.map +0 -1
- /package/dist/components/{VCombobox/VComboboxSeparator.d.ts → VCheckbox/VCheckMark.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VProgressLinear.js","names":[],"sources":["../../../src/components/VProgressLinear/VProgressLinear.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * CSS draws the fill. JavaScript normalizes values shared by geometry, slots and progressbar\n * ARIA attributes.\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 = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\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\n/** What the default slot receives. */\nexport interface ProgressLinearSlotProps {\n /** The value, brought back into the range. */\n value: number\n /** The bound, zero or more. */\n max: number\n /** How far along it is, as a percentage and unrounded. */\n percent: number\n}\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 /** It is what to use while waiting for a server that reports no percentage. */\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 by\n * default, and showing text inside a bar that thin needs an 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 /** What to write inside the bar instead of the percentage. */\n default?(props: ProgressLinearSlotProps): 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 consumer's style\n * 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 again on\n * every frame. Scaling it would be cheaper, but a scale is physical: it would have to be\n * undone for the vertical orientation and again for a right-to-left page, where a logical\n * length simply works.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /*\n * The two copies are COMPLEMENTARY and never superimposed: this one is cut OUT of the filled\n * part, the other cut TO it, so every letter is painted exactly once. Removing either clip\n * raises no error and stays invisible for as long as both copies resolve to the same colour,\n * which happens wherever the adaptive colour function is unsupported.\n */\n .v-progress-linear-text {\n /*\n * The two insets of the cut: one on the edge the fill grows FROM, one on the edge it grows\n * towards. They are named after those roles rather than after physical sides, so the three\n * geometry rules further down; horizontal, right-to-left, vertical; all read the same pair.\n */\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 /*\n * The large negative inset on the two sides that do not carry the cut is what stops text\n * taller or wider than the bar from being cropped by its own clip.\n */\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 /*\n * The per-tone fallback colour. The adaptive one cannot simply be written as a second\n * declaration after it: because that declaration contains a var(), a browser with no\n * support does not reject it at parse time; it would win the cascade and only then turn\n * invalid, which resets the colour to inherited and leaves the fallback never applied.\n */\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 /*\n * In a right-to-left page the fill grows from the right, so the two insets change physical\n * sides; the variables themselves keep their meaning.\n */\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 /*\n * Putting zero at the bottom is not done by reversing the direction, which would also apply\n * to the text of the two copies: bidirectional reordering would then display \"50 %\" as \"%\n * 50\". The fill is anchored to the far end of the axis instead.\n */\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 /*\n * A right-to-left page reverses the inline axis of a vertical writing mode too: `vertical-lr`\n * then runs from the bottom up, so the far end anchored above is the TOP. The fill goes back\n * to the start of the axis, which is now the bottom.\n */\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-fill {\n inset-inline-start: 0;\n inset-inline-end: auto;\n }\n\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 /*\n * The second selector is what neutralizes it, and it is written that way on purpose: it is\n * one step MORE specific than that rule, where the first selector alone would merely tie with\n * it and win by source order; a far more fragile arrangement.\n */\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 /*\n * At each extreme it is exactly flush with the edge without ever pulling away from it, which\n * makes the loop invisible and keeps the track from ever looking empty; no second bar is\n * needed. The easing carries the whole impression: a gradual entry, a quick crossing, a\n * damped exit.\n */\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 /*\n * The anchoring is put back at the start of the axis, vertical case included; where a\n * measurable progress anchors at the far end instead.\n */\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 /*\n * The same keyframes are simply read backwards, which changes nothing else BECAUSE the easing\n * curve is symmetric; an asymmetric one would need a second set of keyframes. A horizontal\n * right-to-left page needs nothing: the logical inset already follows the reading direction.\n */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n /* On a right-to-left page the vertical axis already runs upwards (see the trap above),\n so the keyframes are read forwards again. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate]:dir(rtl)\n .v-progress-linear-fill {\n animation-direction: normal;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n\n /* `forced-color-adjust` inherits, so both copies of the text are given their colour here too. */\n @media (forced-colors: active) {\n .v-progress-linear {\n forced-color-adjust: none;\n background: Canvas;\n box-shadow: inset 0 0 0 var(--vectis-control-border-width) CanvasText;\n }\n\n .v-progress-linear-fill {\n background: Highlight;\n }\n\n .v-progress-linear-text {\n color: CanvasText;\n }\n\n .v-progress-linear-text[data-on-fill] {\n color: HighlightText;\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/**\n * CSS draws the fill. JavaScript normalizes values shared by geometry, slots and progressbar\n * ARIA attributes.\n */\nimport { computed, useId } from 'vue'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\n/** What the progress means, in colour. */\nexport type ProgressLinearTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\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\n/** What the default slot receives. */\nexport interface ProgressLinearSlotProps {\n /** The value, brought back into the range. */\n value: number\n /** The bound, zero or more. */\n max: number\n /** How far along it is, as a percentage and unrounded. */\n percent: number\n}\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, shown above the bar and naming it for screen readers. Without it, the\n * bar is named from the design system dictionary; an `aria-label` or `aria-labelledby` of your\n * own takes precedence.\n */\n label?: string\n /** Hides the label visually. It still names the bar for screen readers. */\n hideLabel?: boolean\n /** What counts as finished. The other end is always zero. */\n max?: number\n /** Shows progress that cannot be measured, such as a server that reports no percentage. */\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 by\n * default, and showing text inside a bar that thin needs an 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 hideLabel: false,\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 /** What to write inside the bar instead of the percentage. */\n default?(props: ProgressLinearSlotProps): 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// The root is a layout box holding the label and the bar: `class` and `style` stay on it, with\n// the tone and the custom properties the bar inherits, and every other attribute goes to the bar.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// @a11y\n// A visible label names the bar by reference, unless the consumer named it themselves; without\n// one, the dictionary does. An indicator takes no name from the text inside it.\nconst labelId = useId()\nconst ariaLabel = useAriaLabel(() => (props.label ? undefined : m.value.progress.label))\nconst labelledBy = computed(() =>\n props.label && attrs['aria-label'] == null && attrs['aria-labelledby'] == null\n ? labelId\n : undefined,\n)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear-field v-tone\"\n :class=\"rootClass\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-orientation=\"orientation\"\n :style=\"[{ '--custom-color': color, '--progress-thickness': px(thickness) }, rootStyle]\"\n >\n <span\n v-if=\"label\"\n :id=\"labelId\"\n class=\"v-progress-linear-label\"\n :class=\"{ 'v-visually-hidden': hideLabel }\"\n >{{ label }}</span\n >\n <div\n class=\"v-progress-linear\"\n role=\"progressbar\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n v-bind=\"forwardedAttrs\"\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=\"{ '--fill-fraction': String(fraction) }\"\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 </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The root holds the label and the bar, and declares what the bar reads, so a consumer's style\n * on it (outside our layers) overrides the thickness and the colours. The bar takes the whole\n * length available: sizing it is the consumer's business, through the parent or a width of\n * their own on the root.\n */\n .v-progress-linear-field {\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 display: flex;\n flex-direction: column;\n gap: var(--vectis-space-1);\n }\n\n .v-progress-linear-label {\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n line-height: var(--vectis-text-label-leading);\n }\n\n /* The element IS the track. */\n .v-progress-linear {\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 again on\n * every frame. Scaling it would be cheaper, but a scale is physical: it would have to be\n * undone for the vertical orientation and again for a right-to-left page, where a logical\n * length simply works.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /*\n * The two copies are COMPLEMENTARY and never superimposed: this one is cut OUT of the filled\n * part, the other cut TO it, so every letter is painted exactly once. Removing either clip\n * raises no error and stays invisible for as long as both copies resolve to the same colour,\n * which happens wherever the adaptive colour function is unsupported.\n */\n .v-progress-linear-text {\n /*\n * The two insets of the cut: one on the edge the fill grows FROM, one on the edge it grows\n * towards. They are named after those roles rather than after physical sides, so the three\n * geometry rules further down; horizontal, right-to-left, vertical; all read the same pair.\n */\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 /*\n * The large negative inset on the two sides that do not carry the cut is what stops text\n * taller or wider than the bar from being cropped by its own clip.\n */\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 /*\n * The per-tone fallback colour. The adaptive one cannot simply be written as a second\n * declaration after it: because that declaration contains a var(), a browser with no\n * support does not reject it at parse time; it would win the cascade and only then turn\n * invalid, which resets the colour to inherited and leaves the fallback never applied.\n */\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 /*\n * In a right-to-left page the fill grows from the right, so the two insets change physical\n * sides; the variables themselves keep their meaning.\n */\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 /*\n * Putting zero at the bottom is not done by reversing the direction, which would also apply\n * to the text of the two copies: bidirectional reordering would then display \"50 %\" as \"%\n * 50\". The fill is anchored to the far end of the axis instead.\n */\n /*\n * Upright, the root carries the length, so a consumer's height on it sets the bar's: the bar\n * takes whatever the label leaves, its own inline size being the physical height.\n */\n .v-progress-linear-field[data-orientation='vertical'] {\n align-items: flex-start;\n block-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] {\n flex: 1 1 0;\n writing-mode: vertical-lr;\n inline-size: auto;\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 /*\n * A right-to-left page reverses the inline axis of a vertical writing mode too: `vertical-lr`\n * then runs from the bottom up, so the far end anchored above is the TOP. The fill goes back\n * to the start of the axis, which is now the bottom.\n */\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-fill {\n inset-inline-start: 0;\n inset-inline-end: auto;\n }\n\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 /*\n * The second selector is what neutralizes it, and it is written that way on purpose: it is\n * one step MORE specific than that rule, where the first selector alone would merely tie with\n * it and win by source order; a far more fragile arrangement.\n */\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 /*\n * At each extreme it is exactly flush with the edge without ever pulling away from it, which\n * makes the loop invisible and keeps the track from ever looking empty; no second bar is\n * needed. The easing carries the whole impression: a gradual entry, a quick crossing, a\n * damped exit.\n */\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 /*\n * The anchoring is put back at the start of the axis, vertical case included; where a\n * measurable progress anchors at the far end instead.\n */\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 /*\n * The same keyframes are simply read backwards, which changes nothing else BECAUSE the easing\n * curve is symmetric; an asymmetric one would need a second set of keyframes. A horizontal\n * right-to-left page needs nothing: the logical inset already follows the reading direction.\n */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n /* On a right-to-left page the vertical axis already runs upwards (see the trap above),\n so the keyframes are read forwards again. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate]:dir(rtl)\n .v-progress-linear-fill {\n animation-direction: normal;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n\n /* `forced-color-adjust` inherits, so both copies of the text are given their colour here too. */\n @media (forced-colors: active) {\n .v-progress-linear {\n forced-color-adjust: none;\n background: Canvas;\n box-shadow: inset 0 0 0 var(--vectis-control-border-width) CanvasText;\n }\n\n .v-progress-linear-fill {\n background: Highlight;\n }\n\n .v-progress-linear-text {\n color: CanvasText;\n }\n\n .v-progress-linear-text[data-on-fill] {\n color: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":""}
|
package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import { useMessages as e } from "../../i18n/state.js";
|
|
2
2
|
import { px as t } from "../../utils/css.js";
|
|
3
3
|
import { useAriaLabel as n } from "../../composables/useAriaLabel.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useRootAttrs as r } from "../../composables/useRootAttrs.js";
|
|
5
|
+
import { useProgressValue as i } from "../../composables/useProgressValue.js";
|
|
6
|
+
import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, normalizeStyle as m, openBlock as h, renderSlot as g, toDisplayString as _, unref as v, useId as y } from "vue";
|
|
6
7
|
//#region src/components/VProgressLinear/VProgressLinear.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
8
|
-
"aria-label",
|
|
8
|
+
var b = [
|
|
9
9
|
"data-tone",
|
|
10
10
|
"data-custom",
|
|
11
|
+
"data-orientation"
|
|
12
|
+
], x = ["id"], S = [
|
|
13
|
+
"aria-labelledby",
|
|
14
|
+
"aria-label",
|
|
11
15
|
"data-shape",
|
|
12
16
|
"data-orientation",
|
|
13
17
|
"data-value-position",
|
|
14
18
|
"data-indeterminate",
|
|
15
19
|
"aria-valuenow",
|
|
16
20
|
"aria-valuemax"
|
|
17
|
-
],
|
|
21
|
+
], C = { class: "v-progress-linear-text" }, w = {
|
|
18
22
|
class: "v-progress-linear-text",
|
|
19
23
|
"data-on-fill": "",
|
|
20
24
|
"aria-hidden": "true"
|
|
21
|
-
},
|
|
25
|
+
}, T = /*@__PURE__*/ d({
|
|
26
|
+
inheritAttrs: !1,
|
|
22
27
|
__name: "VProgressLinear",
|
|
23
28
|
props: {
|
|
24
29
|
value: { default: 0 },
|
|
25
30
|
label: { default: void 0 },
|
|
31
|
+
hideLabel: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
26
35
|
max: { default: 100 },
|
|
27
36
|
indeterminate: {
|
|
28
37
|
type: Boolean,
|
|
@@ -39,38 +48,47 @@ var h = [
|
|
|
39
48
|
valuePosition: { default: "center" },
|
|
40
49
|
orientation: { default: "horizontal" }
|
|
41
50
|
},
|
|
42
|
-
setup(
|
|
43
|
-
let
|
|
44
|
-
return (e, n) => (
|
|
45
|
-
class: "v-progress-linear v-tone",
|
|
51
|
+
setup(d) {
|
|
52
|
+
let T = d, E = e(), { max: D, clamped: O, fraction: k, percent: A, roundedPercent: j } = i(() => T.value, () => T.max), { attrs: M, rootClass: N, rootStyle: P, forwardedAttrs: F } = r(), I = y(), L = n(() => T.label ? void 0 : E.value.progress.label), R = o(() => T.label && M["aria-label"] == null && M["aria-labelledby"] == null ? I : void 0);
|
|
53
|
+
return (e, n) => (h(), c("div", {
|
|
54
|
+
class: p(["v-progress-linear-field v-tone", v(N)]),
|
|
55
|
+
"data-tone": d.tone,
|
|
56
|
+
"data-custom": d.color === void 0 ? void 0 : "",
|
|
57
|
+
"data-orientation": d.orientation,
|
|
58
|
+
style: m([{
|
|
59
|
+
"--custom-color": d.color,
|
|
60
|
+
"--progress-thickness": v(t)(d.thickness)
|
|
61
|
+
}, v(P)])
|
|
62
|
+
}, [d.label ? (h(), c("span", {
|
|
63
|
+
key: 0,
|
|
64
|
+
id: v(I),
|
|
65
|
+
class: p(["v-progress-linear-label", { "v-visually-hidden": d.hideLabel }])
|
|
66
|
+
}, _(d.label), 11, x)) : s("", !0), l("div", f({
|
|
67
|
+
class: "v-progress-linear",
|
|
46
68
|
role: "progressbar",
|
|
47
|
-
"aria-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
"data-shape":
|
|
51
|
-
"data-orientation":
|
|
52
|
-
"data-value-position":
|
|
53
|
-
"data-indeterminate":
|
|
54
|
-
"aria-valuenow":
|
|
69
|
+
"aria-labelledby": R.value,
|
|
70
|
+
"aria-label": v(L)
|
|
71
|
+
}, v(F), {
|
|
72
|
+
"data-shape": d.shape,
|
|
73
|
+
"data-orientation": d.orientation,
|
|
74
|
+
"data-value-position": d.valuePosition,
|
|
75
|
+
"data-indeterminate": d.indeterminate ? "" : void 0,
|
|
76
|
+
"aria-valuenow": d.indeterminate ? void 0 : v(O),
|
|
55
77
|
"aria-valuemin": "0",
|
|
56
|
-
"aria-valuemax":
|
|
57
|
-
style:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
value:
|
|
64
|
-
max:
|
|
65
|
-
percent:
|
|
66
|
-
}, () => [
|
|
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));
|
|
78
|
+
"aria-valuemax": v(D),
|
|
79
|
+
style: { "--fill-fraction": String(v(k)) }
|
|
80
|
+
}), [n[0] ||= l("span", { class: "v-progress-linear-fill" }, null, -1), !d.indeterminate && (d.showValue || e.$slots.default) ? (h(), c(a, { key: 0 }, [l("span", C, [g(e.$slots, "default", {
|
|
81
|
+
value: v(O),
|
|
82
|
+
max: v(D),
|
|
83
|
+
percent: v(A)
|
|
84
|
+
}, () => [u(_(v(E).progress.percent(v(j))), 1)])]), l("span", w, [g(e.$slots, "default", {
|
|
85
|
+
value: v(O),
|
|
86
|
+
max: v(D),
|
|
87
|
+
percent: v(A)
|
|
88
|
+
}, () => [u(_(v(E).progress.percent(v(j))), 1)])])], 64)) : s("", !0)], 16, S)], 14, b));
|
|
71
89
|
}
|
|
72
90
|
});
|
|
73
91
|
//#endregion
|
|
74
|
-
export {
|
|
92
|
+
export { T as default };
|
|
75
93
|
|
|
76
94
|
//# 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/**\n * CSS draws the fill. JavaScript normalizes values shared by geometry, slots and progressbar\n * ARIA attributes.\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 = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\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\n/** What the default slot receives. */\nexport interface ProgressLinearSlotProps {\n /** The value, brought back into the range. */\n value: number\n /** The bound, zero or more. */\n max: number\n /** How far along it is, as a percentage and unrounded. */\n percent: number\n}\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 /** It is what to use while waiting for a server that reports no percentage. */\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 by\n * default, and showing text inside a bar that thin needs an 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 /** What to write inside the bar instead of the percentage. */\n default?(props: ProgressLinearSlotProps): 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 consumer's style\n * 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 again on\n * every frame. Scaling it would be cheaper, but a scale is physical: it would have to be\n * undone for the vertical orientation and again for a right-to-left page, where a logical\n * length simply works.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /*\n * The two copies are COMPLEMENTARY and never superimposed: this one is cut OUT of the filled\n * part, the other cut TO it, so every letter is painted exactly once. Removing either clip\n * raises no error and stays invisible for as long as both copies resolve to the same colour,\n * which happens wherever the adaptive colour function is unsupported.\n */\n .v-progress-linear-text {\n /*\n * The two insets of the cut: one on the edge the fill grows FROM, one on the edge it grows\n * towards. They are named after those roles rather than after physical sides, so the three\n * geometry rules further down; horizontal, right-to-left, vertical; all read the same pair.\n */\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 /*\n * The large negative inset on the two sides that do not carry the cut is what stops text\n * taller or wider than the bar from being cropped by its own clip.\n */\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 /*\n * The per-tone fallback colour. The adaptive one cannot simply be written as a second\n * declaration after it: because that declaration contains a var(), a browser with no\n * support does not reject it at parse time; it would win the cascade and only then turn\n * invalid, which resets the colour to inherited and leaves the fallback never applied.\n */\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 /*\n * In a right-to-left page the fill grows from the right, so the two insets change physical\n * sides; the variables themselves keep their meaning.\n */\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 /*\n * Putting zero at the bottom is not done by reversing the direction, which would also apply\n * to the text of the two copies: bidirectional reordering would then display \"50 %\" as \"%\n * 50\". The fill is anchored to the far end of the axis instead.\n */\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 /*\n * A right-to-left page reverses the inline axis of a vertical writing mode too: `vertical-lr`\n * then runs from the bottom up, so the far end anchored above is the TOP. The fill goes back\n * to the start of the axis, which is now the bottom.\n */\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-fill {\n inset-inline-start: 0;\n inset-inline-end: auto;\n }\n\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 /*\n * The second selector is what neutralizes it, and it is written that way on purpose: it is\n * one step MORE specific than that rule, where the first selector alone would merely tie with\n * it and win by source order; a far more fragile arrangement.\n */\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 /*\n * At each extreme it is exactly flush with the edge without ever pulling away from it, which\n * makes the loop invisible and keeps the track from ever looking empty; no second bar is\n * needed. The easing carries the whole impression: a gradual entry, a quick crossing, a\n * damped exit.\n */\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 /*\n * The anchoring is put back at the start of the axis, vertical case included; where a\n * measurable progress anchors at the far end instead.\n */\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 /*\n * The same keyframes are simply read backwards, which changes nothing else BECAUSE the easing\n * curve is symmetric; an asymmetric one would need a second set of keyframes. A horizontal\n * right-to-left page needs nothing: the logical inset already follows the reading direction.\n */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n /* On a right-to-left page the vertical axis already runs upwards (see the trap above),\n so the keyframes are read forwards again. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate]:dir(rtl)\n .v-progress-linear-fill {\n animation-direction: normal;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n\n /* `forced-color-adjust` inherits, so both copies of the text are given their colour here too. */\n @media (forced-colors: active) {\n .v-progress-linear {\n forced-color-adjust: none;\n background: Canvas;\n box-shadow: inset 0 0 0 var(--vectis-control-border-width) CanvasText;\n }\n\n .v-progress-linear-fill {\n background: Highlight;\n }\n\n .v-progress-linear-text {\n color: CanvasText;\n }\n\n .v-progress-linear-text[data-on-fill] {\n color: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EA,IAAM,IAAQ,GAsBR,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
|
+
{"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/**\n * CSS draws the fill. JavaScript normalizes values shared by geometry, slots and progressbar\n * ARIA attributes.\n */\nimport { computed, useId } from 'vue'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useProgressValue } from '../../composables/useProgressValue'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { useMessages } from '../../i18n/state'\nimport { px } from '../../utils/css'\n\n/** What the progress means, in colour. */\nexport type ProgressLinearTone = 'neutral' | 'accent' | 'danger' | 'success' | 'warning'\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\n/** What the default slot receives. */\nexport interface ProgressLinearSlotProps {\n /** The value, brought back into the range. */\n value: number\n /** The bound, zero or more. */\n max: number\n /** How far along it is, as a percentage and unrounded. */\n percent: number\n}\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, shown above the bar and naming it for screen readers. Without it, the\n * bar is named from the design system dictionary; an `aria-label` or `aria-labelledby` of your\n * own takes precedence.\n */\n label?: string\n /** Hides the label visually. It still names the bar for screen readers. */\n hideLabel?: boolean\n /** What counts as finished. The other end is always zero. */\n max?: number\n /** Shows progress that cannot be measured, such as a server that reports no percentage. */\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 by\n * default, and showing text inside a bar that thin needs an 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 hideLabel: false,\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 /** What to write inside the bar instead of the percentage. */\n default?(props: ProgressLinearSlotProps): 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// The root is a layout box holding the label and the bar: `class` and `style` stay on it, with\n// the tone and the custom properties the bar inherits, and every other attribute goes to the bar.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// @a11y\n// A visible label names the bar by reference, unless the consumer named it themselves; without\n// one, the dictionary does. An indicator takes no name from the text inside it.\nconst labelId = useId()\nconst ariaLabel = useAriaLabel(() => (props.label ? undefined : m.value.progress.label))\nconst labelledBy = computed(() =>\n props.label && attrs['aria-label'] == null && attrs['aria-labelledby'] == null\n ? labelId\n : undefined,\n)\n</script>\n\n<template>\n <div\n class=\"v-progress-linear-field v-tone\"\n :class=\"rootClass\"\n :data-tone=\"tone\"\n :data-custom=\"color !== undefined ? '' : undefined\"\n :data-orientation=\"orientation\"\n :style=\"[{ '--custom-color': color, '--progress-thickness': px(thickness) }, rootStyle]\"\n >\n <span\n v-if=\"label\"\n :id=\"labelId\"\n class=\"v-progress-linear-label\"\n :class=\"{ 'v-visually-hidden': hideLabel }\"\n >{{ label }}</span\n >\n <div\n class=\"v-progress-linear\"\n role=\"progressbar\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n v-bind=\"forwardedAttrs\"\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=\"{ '--fill-fraction': String(fraction) }\"\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 </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The root holds the label and the bar, and declares what the bar reads, so a consumer's style\n * on it (outside our layers) overrides the thickness and the colours. The bar takes the whole\n * length available: sizing it is the consumer's business, through the parent or a width of\n * their own on the root.\n */\n .v-progress-linear-field {\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 display: flex;\n flex-direction: column;\n gap: var(--vectis-space-1);\n }\n\n .v-progress-linear-label {\n color: var(--vectis-color-text);\n font-family: var(--vectis-text-family);\n font-size: var(--vectis-text-label-size);\n font-weight: var(--vectis-text-label-weight);\n line-height: var(--vectis-text-label-leading);\n }\n\n /* The element IS the track. */\n .v-progress-linear {\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 again on\n * every frame. Scaling it would be cheaper, but a scale is physical: it would have to be\n * undone for the vertical orientation and again for a right-to-left page, where a logical\n * length simply works.\n */\n transition: inline-size var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n /*\n * The two copies are COMPLEMENTARY and never superimposed: this one is cut OUT of the filled\n * part, the other cut TO it, so every letter is painted exactly once. Removing either clip\n * raises no error and stays invisible for as long as both copies resolve to the same colour,\n * which happens wherever the adaptive colour function is unsupported.\n */\n .v-progress-linear-text {\n /*\n * The two insets of the cut: one on the edge the fill grows FROM, one on the edge it grows\n * towards. They are named after those roles rather than after physical sides, so the three\n * geometry rules further down; horizontal, right-to-left, vertical; all read the same pair.\n */\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 /*\n * The large negative inset on the two sides that do not carry the cut is what stops text\n * taller or wider than the bar from being cropped by its own clip.\n */\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 /*\n * The per-tone fallback colour. The adaptive one cannot simply be written as a second\n * declaration after it: because that declaration contains a var(), a browser with no\n * support does not reject it at parse time; it would win the cascade and only then turn\n * invalid, which resets the colour to inherited and leaves the fallback never applied.\n */\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 /*\n * In a right-to-left page the fill grows from the right, so the two insets change physical\n * sides; the variables themselves keep their meaning.\n */\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 /*\n * Putting zero at the bottom is not done by reversing the direction, which would also apply\n * to the text of the two copies: bidirectional reordering would then display \"50 %\" as \"%\n * 50\". The fill is anchored to the far end of the axis instead.\n */\n /*\n * Upright, the root carries the length, so a consumer's height on it sets the bar's: the bar\n * takes whatever the label leaves, its own inline size being the physical height.\n */\n .v-progress-linear-field[data-orientation='vertical'] {\n align-items: flex-start;\n block-size: var(--vectis-control-size-progress-linear-length);\n }\n\n .v-progress-linear[data-orientation='vertical'] {\n flex: 1 1 0;\n writing-mode: vertical-lr;\n inline-size: auto;\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 /*\n * A right-to-left page reverses the inline axis of a vertical writing mode too: `vertical-lr`\n * then runs from the bottom up, so the far end anchored above is the TOP. The fill goes back\n * to the start of the axis, which is now the bottom.\n */\n .v-progress-linear[data-orientation='vertical']:dir(rtl) .v-progress-linear-fill {\n inset-inline-start: 0;\n inset-inline-end: auto;\n }\n\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 /*\n * The second selector is what neutralizes it, and it is written that way on purpose: it is\n * one step MORE specific than that rule, where the first selector alone would merely tie with\n * it and win by source order; a far more fragile arrangement.\n */\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 /*\n * At each extreme it is exactly flush with the edge without ever pulling away from it, which\n * makes the loop invisible and keeps the track from ever looking empty; no second bar is\n * needed. The easing carries the whole impression: a gradual entry, a quick crossing, a\n * damped exit.\n */\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 /*\n * The anchoring is put back at the start of the axis, vertical case included; where a\n * measurable progress anchors at the far end instead.\n */\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 /*\n * The same keyframes are simply read backwards, which changes nothing else BECAUSE the easing\n * curve is symmetric; an asymmetric one would need a second set of keyframes. A horizontal\n * right-to-left page needs nothing: the logical inset already follows the reading direction.\n */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate] .v-progress-linear-fill {\n animation-direction: reverse;\n }\n\n /* On a right-to-left page the vertical axis already runs upwards (see the trap above),\n so the keyframes are read forwards again. */\n .v-progress-linear[data-orientation='vertical'][data-indeterminate]:dir(rtl)\n .v-progress-linear-fill {\n animation-direction: normal;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-progress-linear-fill,\n .v-progress-linear-text {\n transition: none;\n }\n\n .v-progress-linear[data-indeterminate] .v-progress-linear-fill {\n animation-duration: var(--vectis-duration-5000);\n }\n }\n\n /* `forced-color-adjust` inherits, so both copies of the text are given their colour here too. */\n @media (forced-colors: active) {\n .v-progress-linear {\n forced-color-adjust: none;\n background: Canvas;\n box-shadow: inset 0 0 0 var(--vectis-control-border-width) CanvasText;\n }\n\n .v-progress-linear-fill {\n background: Highlight;\n }\n\n .v-progress-linear-text {\n color: CanvasText;\n }\n\n .v-progress-linear-text[data-on-fill] {\n color: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+EA,IAAM,IAAQ,GAuBR,IAAI,EAAY,GAEhB,EACJ,KAAK,GACL,YACA,aACA,YACA,sBACE,QACI,EAAM,aACN,EAAM,GACd,GAKM,EAAE,UAAO,cAAW,cAAW,sBAAmB,EAAa,GAK/D,IAAU,EAAM,GAChB,IAAY,QAAoB,EAAM,QAAQ,KAAA,IAAY,EAAE,MAAM,SAAS,KAAM,GACjF,IAAa,QACjB,EAAM,SAAS,EAAM,iBAAiB,QAAQ,EAAM,sBAAsB,OACtE,IACA,KAAA,CACN;yBAIE,EAkDM,OAAA;GAjDJ,OAAK,EAAA,CAAC,kCACE,EAAA,CAAA,CAAS,CAAA;GAChB,aAAW,EAAA;GACX,eAAa,EAAA,UAAU,KAAA,IAAiB,KAAA,IAAR;GAChC,oBAAkB,EAAA;GAClB,OAAK,EAAA,CAAA;IAAA,kBAAuB,EAAA;IAAK,wBAA0B,EAAA,CAAA,CAAE,CAAC,EAAA,SAAS;GAAA,GAAK,EAAA,CAAA,CAAS,CAAA;MAG9E,EAAA,SAAA,EAAA,GADR,EAMC,QAAA;;GAJE,IAAI,EAAA,CAAA;GACL,OAAK,EAAA,CAAC,2BAAyB,EAAA,qBACA,EAAA,UAAS,CAAA,CAAA;OACpC,EAAA,KAAK,GAAA,IAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAEX,EAkCM,OAlCN,EAkCM;GAjCJ,OAAM;GACN,MAAK;GACJ,mBAAiB,EAAA;GACjB,cAAY,EAAA,CAAA;KACL,EAAA,CAAA,GAAc;GACrB,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,mBAAuB,OAAO,EAAA,CAAA,CAAQ,EAAA;gBAE5C,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,CAAA,GAAA,IAAA,CAAA"}
|
|
@@ -14,6 +14,12 @@ interface RadioProps {
|
|
|
14
14
|
* technology, so it is read out after the label rather than as part of it.
|
|
15
15
|
*/
|
|
16
16
|
hint?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A message saying what is wrong with the value, shown in place of the hint so that the field
|
|
19
|
+
* does not grow. It marks the field invalid, is read along with it, and is announced when it
|
|
20
|
+
* appears or changes.
|
|
21
|
+
*/
|
|
22
|
+
error?: string;
|
|
17
23
|
/** Which side of the dot the label sits on. */
|
|
18
24
|
labelPosition?: RadioLabelPosition;
|
|
19
25
|
/**
|
|
@@ -45,9 +51,7 @@ type __VLS_ModelProps = {
|
|
|
45
51
|
};
|
|
46
52
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
47
53
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
48
|
-
/** Moves the focus to the real radio button. */
|
|
49
54
|
focus: (options?: FocusOptions) => void | undefined;
|
|
50
|
-
/** The real `<input type="radio">`, for what `focus` does not cover. */
|
|
51
55
|
el: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
52
56
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
53
57
|
"update:modelValue": (value: ItemValue) => any;
|
|
@@ -55,11 +59,12 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
55
59
|
"onUpdate:modelValue"?: ((value: ItemValue) => any) | undefined;
|
|
56
60
|
}>, {
|
|
57
61
|
label: string;
|
|
62
|
+
error: string;
|
|
58
63
|
disabled: boolean;
|
|
59
64
|
invalid: boolean;
|
|
60
65
|
hint: string;
|
|
61
|
-
readonly: boolean;
|
|
62
66
|
labelPosition: RadioLabelPosition;
|
|
67
|
+
readonly: boolean;
|
|
63
68
|
spread: boolean;
|
|
64
69
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
65
70
|
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 * Retain the native radio for keyboard selection and forms. Its hint stays outside the label so\n * it does not become part of the accessible name.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"VRadio.js","names":[],"sources":["../../../src/components/VRadio/VRadio.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Retain the native radio for keyboard selection and forms. Its hint stays outside the label so\n * it does not become part of the accessible name.\n */\n\nimport VFieldAnnouncer from '../VField/VFieldAnnouncer.vue'\nimport VFieldMessage from '../VField/VFieldMessage.vue'\n\nimport { useChoice } from '../../composables/useChoice'\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 /**\n * A message saying what is wrong with the value, shown in place of the hint so that the field\n * does not grow. It marks the field invalid, is read along with it, and is announced when it\n * appears or changes.\n */\n error?: 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 /** Shows the selection without allowing it to be changed. */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n hint: undefined,\n error: undefined,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y\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` left\n// on it would reach nothing.\ndefineOptions({ inheritAttrs: false })\nconst {\n rootClass,\n rootStyle,\n forwardedAttrs,\n hintId,\n errorId,\n describedBy,\n inputEl,\n refuseWhenReadonly,\n exposed,\n} = useChoice(props)\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\ndefineExpose(exposed)\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 :aria-invalid=\"invalid || !!error || undefined\"\n v-bind=\"forwardedAttrs\"\n :value=\"value\"\n :disabled=\"disabled\"\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 <VFieldMessage :hint=\"hint\" :error=\"error\" :hint-id=\"hintId\" :error-id=\"errorId\" />\n <VFieldAnnouncer :text=\"error\" />\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 /*\n * The states below weigh (0,3,0), bar the read-only base at (0,2,0), so their ORDER\n * arbitrates them: checked, read-only, invalid, then disabled last. The two hovers sit at\n * (0,7,0) and therefore beat every one of them on specificity, order or no order; which is\n * why they have to EXCLUDE by hand each state they must not repaint.\n */\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled, :checked, :user-invalid, [aria-invalid='true'])\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, :user-invalid, [aria-invalid='true']):checked\n + .v-radio-dot {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /*\n * The inner disc takes the surface colour, which contrasts with that fill in both themes,\n * where white would vanish against the light grey of the dark theme. `:where()` keeps both\n * rules at the weight of the states they sit between.\n */\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 (forced-colors: active) {\n /*\n * The class is repeated to (0,8,0) so the row's own hover rules, which reach (0,7,0),\n * cannot repaint it: `forced-color-adjust: none` takes the forcing off this element, and a\n * hover left winning would then paint its real grey over the system colour.\n */\n .v-radio-input.v-radio-input.v-radio-input.v-radio-input.v-radio-input:checked:not(:disabled)\n + .v-radio-dot {\n forced-color-adjust: none;\n background: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-radio-dot,\n .v-radio-dot::before {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import e from "../VField/VFieldAnnouncer.js";
|
|
2
|
+
import t from "../VField/VFieldMessage.js";
|
|
3
|
+
import { useChoice as n } from "../../composables/useChoice.js";
|
|
4
|
+
import { createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, useModel as _, vModelRadio as v, withDirectives as y } from "vue";
|
|
4
5
|
//#region src/components/VRadio/VRadio.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var b = [
|
|
6
7
|
"data-label-position",
|
|
7
8
|
"data-spread",
|
|
8
9
|
"data-readonly"
|
|
9
|
-
],
|
|
10
|
+
], x = { class: "v-choice-row" }, S = [
|
|
10
11
|
"aria-invalid",
|
|
11
12
|
"value",
|
|
12
13
|
"disabled",
|
|
13
14
|
"aria-describedby"
|
|
14
|
-
],
|
|
15
|
+
], C = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "v-radio-label v-choice-label"
|
|
17
|
-
},
|
|
18
|
+
}, w = /*@__PURE__*/ c({
|
|
18
19
|
inheritAttrs: !1,
|
|
19
20
|
__name: "VRadio",
|
|
20
|
-
props: /*@__PURE__*/
|
|
21
|
+
props: /*@__PURE__*/ l({
|
|
21
22
|
value: {},
|
|
22
23
|
label: { default: void 0 },
|
|
23
24
|
hint: { default: void 0 },
|
|
25
|
+
error: { default: void 0 },
|
|
24
26
|
labelPosition: { default: "end" },
|
|
25
27
|
spread: {
|
|
26
28
|
type: Boolean,
|
|
@@ -43,44 +45,48 @@ var y = [
|
|
|
43
45
|
modelModifiers: {}
|
|
44
46
|
}),
|
|
45
47
|
emits: ["update:modelValue"],
|
|
46
|
-
setup(
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
setup(c, { expose: l }) {
|
|
49
|
+
let { rootClass: w, rootStyle: T, forwardedAttrs: E, hintId: D, errorId: O, describedBy: k, inputEl: A, refuseWhenReadonly: j, exposed: M } = n(c), N = _(c, "modelValue");
|
|
50
|
+
return l(M), (n, l) => (p(), i("span", {
|
|
51
|
+
class: d(["v-radio v-choice", g(w)]),
|
|
52
|
+
style: f(g(T)),
|
|
53
|
+
"data-label-position": c.labelPosition,
|
|
54
|
+
"data-spread": c.spread ? "" : void 0,
|
|
55
|
+
"data-readonly": c.readonly ? "" : void 0
|
|
56
|
+
}, [
|
|
57
|
+
a("label", x, [
|
|
58
|
+
y(a("input", u({
|
|
59
|
+
ref_key: "inputEl",
|
|
60
|
+
ref: A,
|
|
61
|
+
"onUpdate:modelValue": l[0] ||= (e) => N.value = e,
|
|
62
|
+
type: "radio",
|
|
63
|
+
class: "v-radio-input v-hidden-input",
|
|
64
|
+
"aria-invalid": c.invalid || !!c.error || void 0
|
|
65
|
+
}, g(E), {
|
|
66
|
+
value: c.value,
|
|
67
|
+
disabled: c.disabled,
|
|
68
|
+
"aria-describedby": g(k),
|
|
69
|
+
onClick: l[1] ||= (...e) => g(j) && g(j)(...e)
|
|
70
|
+
}), null, 16, S), [[v, N.value]]),
|
|
71
|
+
l[2] ||= a("span", {
|
|
72
|
+
class: "v-radio-dot",
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
}, null, -1),
|
|
75
|
+
n.$slots.default || c.label ? (p(), i("span", C, [m(n.$slots, "default", {}, () => [o(h(c.label), 1)])])) : r("", !0)
|
|
76
|
+
]),
|
|
77
|
+
s(t, {
|
|
78
|
+
hint: c.hint,
|
|
79
|
+
error: c.error,
|
|
80
|
+
"hint-id": g(D),
|
|
81
|
+
"error-id": g(O)
|
|
82
|
+
}, null, 8, [
|
|
83
|
+
"hint",
|
|
84
|
+
"error",
|
|
85
|
+
"hint-id",
|
|
86
|
+
"error-id"
|
|
87
|
+
]),
|
|
88
|
+
s(e, { text: c.error }, null, 8, ["text"])
|
|
89
|
+
], 14, b));
|
|
84
90
|
}
|
|
85
91
|
});
|
|
86
92
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
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 * Retain the native radio for keyboard selection and forms. Its hint stays outside the label so\n * it does not become part of the accessible name.\n */\n\nimport
|
|
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 * Retain the native radio for keyboard selection and forms. Its hint stays outside the label so\n * it does not become part of the accessible name.\n */\n\nimport VFieldAnnouncer from '../VField/VFieldAnnouncer.vue'\nimport VFieldMessage from '../VField/VFieldMessage.vue'\n\nimport { useChoice } from '../../composables/useChoice'\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 /**\n * A message saying what is wrong with the value, shown in place of the hint so that the field\n * does not grow. It marks the field invalid, is read along with it, and is announced when it\n * appears or changes.\n */\n error?: 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 /** Shows the selection without allowing it to be changed. */\n readonly?: boolean\n}\n\nconst props = withDefaults(defineProps<RadioProps>(), {\n label: undefined,\n hint: undefined,\n error: undefined,\n labelPosition: 'end',\n spread: false,\n invalid: false,\n disabled: false,\n readonly: false,\n})\n\n// @a11y\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` left\n// on it would reach nothing.\ndefineOptions({ inheritAttrs: false })\nconst {\n rootClass,\n rootStyle,\n forwardedAttrs,\n hintId,\n errorId,\n describedBy,\n inputEl,\n refuseWhenReadonly,\n exposed,\n} = useChoice(props)\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\ndefineExpose(exposed)\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 :aria-invalid=\"invalid || !!error || undefined\"\n v-bind=\"forwardedAttrs\"\n :value=\"value\"\n :disabled=\"disabled\"\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 <VFieldMessage :hint=\"hint\" :error=\"error\" :hint-id=\"hintId\" :error-id=\"errorId\" />\n <VFieldAnnouncer :text=\"error\" />\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 /*\n * The states below weigh (0,3,0), bar the read-only base at (0,2,0), so their ORDER\n * arbitrates them: checked, read-only, invalid, then disabled last. The two hovers sit at\n * (0,7,0) and therefore beat every one of them on specificity, order or no order; which is\n * why they have to EXCLUDE by hand each state they must not repaint.\n */\n .v-radio:not([data-readonly])\n .v-choice-row:hover\n .v-radio-input:not(:disabled, :checked, :user-invalid, [aria-invalid='true'])\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, :user-invalid, [aria-invalid='true']):checked\n + .v-radio-dot {\n background: var(--vectis-color-accent-hover);\n border-color: var(--vectis-color-accent-hover);\n }\n\n /*\n * The inner disc takes the surface colour, which contrasts with that fill in both themes,\n * where white would vanish against the light grey of the dark theme. `:where()` keeps both\n * rules at the weight of the states they sit between.\n */\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 (forced-colors: active) {\n /*\n * The class is repeated to (0,8,0) so the row's own hover rules, which reach (0,7,0),\n * cannot repaint it: `forced-color-adjust: none` takes the forcing off this element, and a\n * hover left winning would then paint its real grey over the system colour.\n */\n .v-radio-input.v-radio-input.v-radio-input.v-radio-input.v-radio-input:checked:not(:disabled)\n + .v-radio-dot {\n forced-color-adjust: none;\n background: Highlight;\n border-color: Highlight;\n color: HighlightText;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-radio-dot,\n .v-radio-dot::before {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEA,IAAM,EACJ,cACA,cACA,mBACA,WACA,YACA,gBACA,YACA,uBACA,eACE,EAAU,CAAK,GAMb,IAAQ,EAAsB,GAAA,YAAgB;SAOpD,EAAa,CAAO,mBAIlB,EA4BO,QAAA;GA3BL,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;;GAEhC,EAiBQ,SAjBR,GAiBQ;MAhBN,EAWE,SAXF,EAWE;cAVI;KAAJ,KAAI;8CACU,QAAA;KACd,MAAK;KACL,OAAM;KACL,gBAAc,EAAA,WAAO,CAAA,CAAM,EAAA,SAAS,KAAA;OAC7B,EAAA,CAAA,GAAc;KACrB,OAAO,EAAA;KACP,UAAU,EAAA;KACV,oBAAkB,EAAA,CAAA;KAClB,SAAK,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,GAAA,CAAA;2BARC,EAAA,KAAK,CAAA,CAAA;aAUhB,EAA+C,QAAA;KAAzC,OAAM;KAAc,eAAY;;IAC1BA,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;;GAGlB,EAAmF,GAAA;IAAnE,MAAM,EAAA;IAAO,OAAO,EAAA;IAAQ,WAAS,EAAA,CAAA;IAAS,YAAU,EAAA,CAAA;;;;;;;GACxE,EAAiC,GAAA,EAAf,MAAM,EAAA,MAAK,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
|
|
2
|
+
@layer vectis.components{.v-rating[data-size=sm]{--vectis-icon-size:var(--vectis-control-size-rating-sm)}.v-rating[data-size=md]{--vectis-icon-size:var(--vectis-control-size-rating-md)}.v-rating[data-size=lg]{--vectis-icon-size:var(--vectis-control-size-rating-lg)}.v-rating-items{border-radius:var(--vectis-radius-interactive);display:inline-flex;position:relative}.v-rating-item{--rating-shown:var(--rating-value);padding:calc(var(--vectis-space-1) / 2);display:inline-flex;position:relative}label.v-rating-item{cursor:pointer}:where(.v-rating:not(:disabled) .v-rating-items:has(label.v-rating-item:hover))>.v-rating-item{--rating-shown:0}:where(.v-rating:not(:disabled)) label.v-rating-item:is(:hover,:has(~.v-rating-item:hover)){--rating-shown:1}.v-rating-icon{border-radius:var(--vectis-radius-xs);display:inline-grid}.v-rating-icon>.v-icon{grid-area:1/1}.v-rating-empty{color:var(--vectis-color-border-strong)}.v-rating-filled{color:var(--tone-bg-solid);clip-path:inset(0 calc((1 - var(--rating-shown)) * 100%) 0 0)}.v-rating-filled:dir(rtl){clip-path:inset(0 0 0 calc((1 - var(--rating-shown)) * 100%))}.v-rating-item .v-hidden-input:focus-visible+.v-rating-icon,.v-rating-items:has(.v-rating-clear .v-hidden-input:focus-visible){outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-rating[data-invalid] .v-rating-empty{color:var(--vectis-color-danger)}.v-rating:disabled .v-rating-empty{color:var(--vectis-color-border)}.v-rating:disabled .v-rating-filled{color:var(--vectis-color-text-subtle)}.v-rating:disabled label.v-rating-item{cursor:not-allowed}@media (forced-colors:active){.v-rating-filled{color:highlight}.v-rating:disabled .v-rating-filled{color:graytext}}}
|