@vuetify/nightly 3.0.0-alpha.3 → 3.0.0-beta.2
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/CHANGELOG.md +41 -98
- package/dist/json/attributes.json +5378 -0
- package/dist/json/importMap.json +585 -0
- package/dist/json/tags.json +1933 -0
- package/dist/json/web-types.json +18314 -0
- package/dist/vuetify.css +12154 -8451
- package/dist/vuetify.d.ts +15974 -0
- package/dist/vuetify.esm.js +17658 -0
- package/dist/vuetify.esm.js.map +1 -0
- package/dist/vuetify.js +16972 -9378
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +6 -3
- package/dist/vuetify.min.js +1466 -5252
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.css +214 -0
- package/lib/components/VAlert/VAlert.mjs +157 -206
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.sass +106 -159
- package/lib/components/VAlert/VAlertTitle.mjs +4 -0
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -0
- package/lib/components/VAlert/_variables.scss +50 -14
- package/lib/components/VAlert/index.mjs +2 -3
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.css +29 -0
- package/lib/components/VApp/VApp.mjs +36 -22
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +1 -4
- package/lib/components/VApp/index.mjs +1 -1
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.css +10 -0
- package/lib/components/VAppBar/VAppBar.mjs +63 -227
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.sass +8 -54
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +24 -25
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +15 -62
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/_variables.scss +39 -4
- package/lib/components/VAppBar/index.mjs +3 -11
- package/lib/components/VAppBar/index.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +57 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +240 -357
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +69 -33
- package/lib/components/VAutocomplete/_variables.scss +7 -4
- package/lib/components/VAutocomplete/index.mjs +1 -3
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.css +43 -0
- package/lib/components/VAvatar/VAvatar.mjs +49 -27
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +9 -13
- package/lib/components/VAvatar/_mixins.scss +32 -0
- package/lib/components/VAvatar/_variables.scss +19 -8
- package/lib/components/VAvatar/index.mjs +1 -1
- package/lib/components/VAvatar/index.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.css +74 -0
- package/lib/components/VBadge/VBadge.mjs +51 -35
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.sass +5 -5
- package/lib/components/VBadge/_variables.scss +11 -3
- package/lib/components/VBadge/index.mjs +1 -1
- package/lib/components/VBadge/index.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.css +157 -0
- package/lib/components/VBanner/VBanner.mjs +75 -46
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.sass +80 -122
- package/lib/components/VBanner/VBannerActions.mjs +35 -0
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -0
- package/lib/components/VBanner/VBannerAvatar.mjs +20 -0
- package/lib/components/VBanner/VBannerAvatar.mjs.map +1 -0
- package/lib/components/VBanner/VBannerIcon.mjs +20 -0
- package/lib/components/VBanner/VBannerIcon.mjs.map +1 -0
- package/lib/components/VBanner/VBannerText.mjs +3 -0
- package/lib/components/VBanner/VBannerText.mjs.map +1 -0
- package/lib/components/VBanner/_variables.scss +37 -45
- package/lib/components/VBanner/index.mjs +5 -1
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +61 -0
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +104 -111
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.sass +48 -74
- package/lib/components/VBottomNavigation/_variables.scss +42 -6
- package/lib/components/VBottomNavigation/index.mjs +1 -3
- package/lib/components/VBottomNavigation/index.mjs.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.css +48 -0
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +81 -51
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +26 -30
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs +2 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +56 -35
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/_variables.scss +15 -7
- package/lib/components/VBreadcrumbs/index.mjs +3 -11
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/shared.mjs +2 -0
- package/lib/components/VBreadcrumbs/shared.mjs.map +1 -0
- package/lib/components/VBtn/VBtn.css +319 -0
- package/lib/components/VBtn/VBtn.mjs +103 -67
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +101 -34
- package/lib/components/VBtn/_mixins.scss +31 -7
- package/lib/components/VBtn/_variables.scss +66 -29
- package/lib/components/VBtn/index.mjs +1 -1
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.css +57 -0
- package/lib/components/VBtnGroup/VBtnGroup.mjs +67 -0
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -0
- package/lib/components/VBtnGroup/VBtnGroup.sass +52 -0
- package/lib/components/VBtnGroup/_variables.scss +25 -0
- package/lib/components/VBtnGroup/index.mjs +2 -0
- package/lib/components/VBtnGroup/index.mjs.map +1 -0
- package/lib/components/VBtnToggle/VBtnToggle.css +3 -0
- package/lib/components/VBtnToggle/VBtnToggle.mjs +45 -39
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.sass +5 -95
- package/lib/components/VBtnToggle/_variables.scss +3 -10
- package/lib/components/VBtnToggle/index.mjs +1 -3
- package/lib/components/VBtnToggle/index.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendar.mjs +15 -6
- package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.mjs +5 -4
- package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.sass +67 -0
- package/lib/components/VCalendar/VCalendarDaily.mjs +1 -1
- package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.mjs +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
- package/lib/components/VCalendar/_variables.scss +4 -0
- package/lib/components/VCalendar/mixins/calendar-base.mjs +5 -4
- package/lib/components/VCalendar/mixins/calendar-base.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs +40 -33
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.sass +7 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs +2 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.mjs +20 -1
- package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
- package/lib/components/VCalendar/modes/common.mjs +7 -3
- package/lib/components/VCalendar/modes/common.mjs.map +1 -1
- package/lib/components/VCalendar/modes/stack.mjs +2 -1
- package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
- package/lib/components/VCalendar/util/events.mjs +8 -3
- package/lib/components/VCalendar/util/events.mjs.map +1 -1
- package/lib/components/VCalendar/util/parser.mjs +1 -3
- package/lib/components/VCalendar/util/parser.mjs.map +1 -1
- package/lib/components/VCalendar/util/timestamp.mjs +24 -12
- package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
- package/lib/components/VCard/VCard.css +270 -0
- package/lib/components/VCard/VCard.mjs +163 -65
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +147 -119
- package/lib/components/VCard/VCardActions.mjs +29 -0
- package/lib/components/VCard/VCardActions.mjs.map +1 -0
- package/lib/components/VCard/VCardAvatar.mjs +3 -0
- package/lib/components/VCard/VCardAvatar.mjs.map +1 -0
- package/lib/components/VCard/VCardContent.mjs +3 -0
- package/lib/components/VCard/VCardContent.mjs.map +1 -0
- package/lib/components/VCard/VCardHeader.mjs +3 -0
- package/lib/components/VCard/VCardHeader.mjs.map +1 -0
- package/lib/components/VCard/VCardHeaderText.mjs +3 -0
- package/lib/components/VCard/VCardHeaderText.mjs.map +1 -0
- package/lib/components/VCard/VCardImg.mjs +3 -0
- package/lib/components/VCard/VCardImg.mjs.map +1 -0
- package/lib/components/VCard/VCardSubtitle.mjs +3 -0
- package/lib/components/VCard/VCardSubtitle.mjs.map +1 -0
- package/lib/components/VCard/VCardText.mjs +3 -0
- package/lib/components/VCard/VCardText.mjs.map +1 -0
- package/lib/components/VCard/VCardTitle.mjs +3 -0
- package/lib/components/VCard/VCardTitle.mjs.map +1 -0
- package/lib/components/VCard/_mixins.scss +13 -0
- package/lib/components/VCard/_variables.scss +106 -26
- package/lib/components/VCard/index.mjs +10 -16
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.css +63 -0
- package/lib/components/VCarousel/VCarousel.mjs +99 -185
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +7 -2
- package/lib/components/VCarousel/VCarouselItem.mjs +22 -42
- package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
- package/lib/components/VCarousel/_variables.scss +1 -3
- package/lib/components/VCarousel/index.mjs +2 -9
- package/lib/components/VCarousel/index.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.css +3 -0
- package/lib/components/VCheckbox/VCheckbox.mjs +56 -83
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.sass +8 -8
- package/lib/components/VCheckbox/_variables.scss +2 -4
- package/lib/components/VCheckbox/index.mjs +1 -9
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +276 -0
- package/lib/components/VChip/VChip.mjs +153 -143
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +41 -177
- package/lib/components/VChip/_mixins.scss +65 -0
- package/lib/components/VChip/_variables.scss +48 -49
- package/lib/components/VChip/index.mjs +1 -3
- package/lib/components/VChip/index.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.css +18 -0
- package/lib/components/VChipGroup/VChipGroup.mjs +66 -38
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.sass +11 -17
- package/lib/components/VChipGroup/_variables.scss +3 -5
- package/lib/components/VChipGroup/index.mjs +1 -3
- package/lib/components/VChipGroup/index.mjs.map +1 -1
- package/lib/components/VCode/VCode.css +7 -0
- package/lib/components/VCode/VCode.sass +9 -0
- package/lib/components/VCode/_variables.scss +5 -0
- package/lib/components/VCode/index.mjs +4 -0
- package/lib/components/VCode/index.mjs.map +1 -0
- package/lib/components/VColorPicker/VColorPicker.css +21 -0
- package/lib/components/VColorPicker/VColorPicker.mjs +103 -133
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +10 -17
- package/lib/components/VColorPicker/VColorPickerCanvas.css +21 -0
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +139 -121
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.sass +5 -3
- package/lib/components/VColorPicker/VColorPickerEdit.css +31 -0
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +74 -134
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.sass +9 -6
- package/lib/components/VColorPicker/VColorPickerPreview.css +67 -0
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +65 -83
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.sass +42 -39
- package/lib/components/VColorPicker/VColorPickerSwatches.css +35 -0
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +34 -54
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.sass +6 -4
- package/lib/components/VColorPicker/_variables.scss +5 -9
- package/lib/components/VColorPicker/index.mjs +1 -5
- package/lib/components/VColorPicker/index.mjs.map +1 -1
- package/lib/components/VColorPicker/util/index.mjs +141 -97
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +66 -0
- package/lib/components/VCombobox/VCombobox.mjs +336 -200
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +91 -0
- package/lib/components/VCombobox/_variables.scss +8 -0
- package/lib/components/VCombobox/index.mjs +1 -3
- package/lib/components/VCombobox/index.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.css +6 -0
- package/lib/components/VCounter/VCounter.mjs +36 -27
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.sass +5 -7
- package/lib/components/VCounter/_variables.scss +3 -2
- package/lib/components/VCounter/index.mjs +1 -3
- package/lib/components/VCounter/index.mjs.map +1 -1
- package/lib/components/VData/VData.mjs +8 -3
- package/lib/components/VData/VData.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.mjs +20 -8
- package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
- package/lib/components/VDataIterator/_variables.scss +2 -2
- package/lib/components/VDataTable/MobileRow.mjs +6 -5
- package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
- package/lib/components/VDataTable/Row.mjs +20 -12
- package/lib/components/VDataTable/Row.mjs.map +1 -1
- package/lib/components/VDataTable/RowGroup.mjs +5 -4
- package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.mjs +11 -6
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.sass +5 -0
- package/lib/components/VDataTable/VDataTableHeader.mjs +7 -6
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs +3 -3
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs +2 -2
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
- package/lib/components/VDataTable/VEditDialog.mjs +7 -6
- package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.mjs +2 -2
- package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
- package/lib/components/VDataTable/_variables.scss +2 -2
- package/lib/components/VDatePicker/VDatePicker.mjs +13 -13
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs +5 -5
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs +5 -5
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs +2 -2
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.mjs +2 -2
- package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +4 -4
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs +20 -9
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs.map +1 -1
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs +7 -5
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.mjs +1 -0
- package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
- package/lib/components/VDatePicker/util/monthChange.mjs +3 -3
- package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
- package/lib/components/VDatePicker/util/pad.mjs +4 -1
- package/lib/components/VDatePicker/util/pad.mjs.map +1 -1
- package/lib/components/VDatePicker/util/sanitizeDateString.mjs +1 -1
- package/lib/components/VDatePicker/util/sanitizeDateString.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs +38 -0
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -0
- package/lib/components/VDefaultsProvider/index.mjs +2 -0
- package/lib/components/VDefaultsProvider/index.mjs.map +1 -0
- package/lib/components/VDialog/VDialog.css +77 -0
- package/lib/components/VDialog/VDialog.mjs +91 -279
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +53 -81
- package/lib/components/VDialog/_variables.scss +12 -10
- package/lib/components/VDialog/index.mjs +1 -3
- package/lib/components/VDialog/index.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.css +30 -0
- package/lib/components/VDivider/VDivider.mjs +25 -17
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.sass +5 -9
- package/lib/components/VDivider/_variables.scss +9 -11
- package/lib/components/VDivider/index.mjs +1 -1
- package/lib/components/VDivider/index.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.css +190 -0
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +87 -83
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +91 -129
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs +42 -0
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -0
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +79 -0
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -0
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs +45 -59
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/_variables.scss +13 -7
- package/lib/components/VExpansionPanel/index.mjs +4 -13
- package/lib/components/VExpansionPanel/index.mjs.map +1 -1
- package/lib/components/VField/VField.css +410 -0
- package/lib/components/VField/VField.mjs +248 -0
- package/lib/components/VField/VField.mjs.map +1 -0
- package/lib/components/VField/VField.sass +392 -0
- package/lib/components/VField/VFieldLabel.mjs +27 -0
- package/lib/components/VField/VFieldLabel.mjs.map +1 -0
- package/lib/components/VField/_variables.scss +44 -0
- package/lib/components/VField/index.mjs +3 -0
- package/lib/components/VField/index.mjs.map +1 -0
- package/lib/components/VFileInput/VFileInput.css +8 -0
- package/lib/components/VFileInput/VFileInput.mjs +181 -224
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +3 -51
- package/lib/components/VFileInput/_variables.scss +2 -6
- package/lib/components/VFileInput/index.mjs +1 -3
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.css +20 -0
- package/lib/components/VFooter/VFooter.mjs +54 -31
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.sass +10 -7
- package/lib/components/VFooter/_variables.scss +13 -3
- package/lib/components/VFooter/index.mjs +1 -1
- package/lib/components/VFooter/index.mjs.map +1 -1
- package/lib/components/VForm/VForm.mjs +55 -122
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.mjs +1 -3
- package/lib/components/VForm/index.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +23 -18
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +10 -12
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VGrid.css +1002 -0
- package/lib/components/VGrid/VGrid.sass +9 -8
- package/lib/components/VGrid/VRow.mjs +22 -17
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/VSpacer.mjs +1 -1
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VGrid/_mixins.sass +26 -21
- package/lib/components/VGrid/index.mjs +4 -4
- package/lib/components/VGrid/index.mjs.map +1 -1
- package/lib/components/VHover/VHover.mjs +31 -61
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.mjs +1 -3
- package/lib/components/VHover/index.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.css +65 -0
- package/lib/components/VIcon/VIcon.mjs +36 -29
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.sass +31 -49
- package/lib/components/VIcon/_variables.scss +17 -20
- package/lib/components/VIcon/index.mjs +1 -1
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.css +34 -0
- package/lib/components/VImg/VImg.mjs +121 -71
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +14 -8
- package/lib/components/VImg/_variables.scss +1 -0
- package/lib/components/VImg/index.mjs +1 -1
- package/lib/components/VImg/index.mjs.map +1 -1
- package/lib/components/VInput/VInput.css +112 -0
- package/lib/components/VInput/VInput.mjs +102 -278
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/VInput.sass +77 -117
- package/lib/components/VInput/_variables.scss +21 -13
- package/lib/components/VInput/index.mjs +1 -3
- package/lib/components/VInput/index.mjs.map +1 -1
- package/lib/components/VItemGroup/VItem.mjs +33 -62
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.css +6 -0
- package/lib/components/VItemGroup/VItemGroup.mjs +45 -215
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.sass +3 -2
- package/lib/components/VItemGroup/_variables.scss +3 -2
- package/lib/components/VItemGroup/index.mjs +2 -9
- package/lib/components/VItemGroup/index.mjs.map +1 -1
- package/lib/components/VKbd/VKbd.css +9 -0
- package/lib/components/VKbd/VKbd.sass +13 -0
- package/lib/components/VKbd/_variables.scss +6 -0
- package/lib/components/VKbd/index.mjs +4 -0
- package/lib/components/VKbd/index.mjs.map +1 -0
- package/lib/components/VLabel/VLabel.css +12 -0
- package/lib/components/VLabel/VLabel.mjs +18 -56
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.sass +13 -11
- package/lib/components/VLabel/_variables.scss +7 -4
- package/lib/components/VLabel/index.mjs +1 -3
- package/lib/components/VLabel/index.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.css +11 -0
- package/lib/components/VLayout/VLayout.mjs +20 -15
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.sass +5 -3
- package/lib/components/VLayout/VLayoutItem.css +8 -0
- package/lib/components/VLayout/VLayoutItem.mjs +36 -17
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/VLayoutItem.sass +8 -0
- package/lib/components/VLayout/index.mjs +2 -2
- package/lib/components/VLayout/index.mjs.map +1 -1
- package/lib/components/VLazy/VLazy.mjs +41 -51
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VLazy/index.mjs +1 -3
- package/lib/components/VLazy/index.mjs.map +1 -1
- package/lib/components/VList/VList.css +107 -0
- package/lib/components/VList/VList.mjs +140 -73
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VList.sass +88 -94
- package/lib/components/VList/VListChildren.mjs +53 -0
- package/lib/components/VList/VListChildren.mjs.map +1 -0
- package/lib/components/VList/VListGroup.mjs +84 -164
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs +3 -0
- package/lib/components/VList/VListImg.mjs.map +1 -0
- package/lib/components/VList/VListItem.css +350 -0
- package/lib/components/VList/VListItem.mjs +184 -141
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +178 -228
- package/lib/components/VList/VListItemAction.mjs +23 -19
- package/lib/components/VList/VListItemAction.mjs.map +1 -1
- package/lib/components/VList/VListItemAvatar.mjs +16 -29
- package/lib/components/VList/VListItemAvatar.mjs.map +1 -1
- package/lib/components/VList/VListItemHeader.mjs +3 -0
- package/lib/components/VList/VListItemHeader.mjs.map +1 -0
- package/lib/components/VList/VListItemIcon.mjs +17 -15
- package/lib/components/VList/VListItemIcon.mjs.map +1 -1
- package/lib/components/VList/VListItemMedia.mjs +29 -0
- package/lib/components/VList/VListItemMedia.mjs.map +1 -0
- package/lib/components/VList/VListItemSubtitle.mjs +3 -0
- package/lib/components/VList/VListItemSubtitle.mjs.map +1 -0
- package/lib/components/VList/VListItemTitle.mjs +3 -0
- package/lib/components/VList/VListItemTitle.mjs.map +1 -0
- package/lib/components/VList/VListSubheader.mjs +47 -0
- package/lib/components/VList/VListSubheader.mjs.map +1 -0
- package/lib/components/VList/_variables.scss +154 -57
- package/lib/components/VList/index.mjs +12 -28
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VList/list.mjs +31 -0
- package/lib/components/VList/list.mjs.map +1 -0
- package/lib/components/VLocaleProvider/VLocaleProvider.css +3 -0
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +19 -10
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.sass +2 -0
- package/lib/components/VLocaleProvider/index.mjs +1 -1
- package/lib/components/VLocaleProvider/index.mjs.map +1 -1
- package/lib/components/VMain/VMain.css +18 -0
- package/lib/components/VMain/VMain.mjs +23 -19
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +2 -1
- package/lib/components/VMain/_variables.scss +3 -1
- package/lib/components/VMain/index.mjs +1 -1
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.css +14 -0
- package/lib/components/VMenu/VMenu.mjs +78 -447
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +17 -71
- package/lib/components/VMenu/_variables.scss +3 -2
- package/lib/components/VMenu/index.mjs +1 -3
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs +2 -0
- package/lib/components/VMenu/shared.mjs.map +1 -0
- package/lib/components/VMessages/VMessages.css +16 -0
- package/lib/components/VMessages/VMessages.mjs +42 -41
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.sass +5 -10
- package/lib/components/VMessages/_variables.scss +3 -2
- package/lib/components/VMessages/index.mjs +1 -3
- package/lib/components/VMessages/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +93 -0
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +124 -55
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +36 -23
- package/lib/components/VNavigationDrawer/_variables.scss +16 -9
- package/lib/components/VNavigationDrawer/index.mjs +1 -1
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/touch.mjs +139 -0
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -0
- package/lib/components/VNoSsr/VNoSsr.mjs +23 -0
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -0
- package/lib/components/VNoSsr/index.mjs +2 -0
- package/lib/components/VNoSsr/index.mjs.map +1 -0
- package/lib/components/VOtpInput/VOtpInput.mjs +345 -0
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -0
- package/lib/components/VOtpInput/VOtpInput.sass +37 -0
- package/lib/components/VOtpInput/_variables.scss +4 -0
- package/lib/components/VOtpInput/index.mjs +4 -0
- package/lib/components/VOtpInput/index.mjs.map +1 -0
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.css +63 -0
- package/lib/components/VOverlay/VOverlay.mjs +229 -67
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +39 -19
- package/lib/components/VOverlay/_variables.scss +4 -3
- package/lib/components/VOverlay/index.mjs +1 -3
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/positionStrategies.mjs +207 -0
- package/lib/components/VOverlay/positionStrategies.mjs.map +1 -0
- package/lib/components/VOverlay/requestNewFrame.mjs +28 -0
- package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -0
- package/lib/components/VOverlay/scrollStrategies.mjs +137 -0
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -0
- package/lib/components/VOverlay/useActivator.mjs +241 -0
- package/lib/components/VOverlay/useActivator.mjs.map +1 -0
- package/lib/components/VOverlay/util/anchor.mjs +52 -0
- package/lib/components/VOverlay/util/anchor.mjs.map +1 -0
- package/lib/components/VOverlay/util/point.mjs +56 -0
- package/lib/components/VOverlay/util/point.mjs.map +1 -0
- package/lib/components/VPagination/VPagination.css +9 -0
- package/lib/components/VPagination/VPagination.mjs +261 -176
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.sass +11 -77
- package/lib/components/VPagination/_variables.scss +1 -15
- package/lib/components/VPagination/index.mjs +1 -3
- package/lib/components/VPagination/index.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.css +7 -0
- package/lib/components/VParallax/VParallax.mjs +71 -77
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.sass +1 -32
- package/lib/components/VParallax/index.mjs +1 -3
- package/lib/components/VParallax/index.mjs.map +1 -1
- package/lib/components/VPicker/VPicker.mjs +5 -5
- package/lib/components/VPicker/VPicker.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.css +101 -0
- package/lib/components/VProgressCircular/VProgressCircular.mjs +110 -141
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.sass +57 -36
- package/lib/components/VProgressCircular/_variables.scss +12 -5
- package/lib/components/VProgressCircular/index.mjs +1 -3
- package/lib/components/VProgressCircular/index.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.css +212 -0
- package/lib/components/VProgressLinear/VProgressLinear.mjs +138 -226
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.sass +83 -157
- package/lib/components/VProgressLinear/_variables.scss +11 -3
- package/lib/components/VProgressLinear/index.mjs +1 -3
- package/lib/components/VProgressLinear/index.mjs.map +1 -1
- package/lib/components/VRadio/VRadio.mjs +33 -0
- package/lib/components/VRadio/VRadio.mjs.map +1 -0
- package/lib/components/VRadio/index.mjs +2 -0
- package/lib/components/VRadio/index.mjs.map +1 -0
- package/lib/components/VRadioGroup/VRadioGroup.css +10 -0
- package/lib/components/VRadioGroup/VRadioGroup.mjs +66 -69
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.sass +7 -37
- package/lib/components/VRadioGroup/_variables.scss +3 -3
- package/lib/components/VRadioGroup/index.mjs +1 -9
- package/lib/components/VRadioGroup/index.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +194 -206
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.mjs +1 -3
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.css +58 -0
- package/lib/components/VRating/VRating.mjs +202 -177
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/VRating.sass +51 -18
- package/lib/components/VRating/_variables.scss +9 -4
- package/lib/components/VRating/index.mjs +1 -3
- package/lib/components/VRating/index.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.css +23 -0
- package/lib/components/VResponsive/VResponsive.mjs +24 -19
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.sass +5 -7
- package/lib/components/VResponsive/index.mjs +1 -1
- package/lib/components/VResponsive/index.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.css +34 -0
- package/lib/components/VSelect/VSelect.mjs +170 -781
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +44 -153
- package/lib/components/VSelect/_variables.scss +7 -21
- package/lib/components/VSelect/index.mjs +1 -3
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.css +97 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs +210 -0
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -0
- package/lib/components/VSelectionControl/VSelectionControl.sass +96 -0
- package/lib/components/VSelectionControl/_variables.scss +9 -0
- package/lib/components/VSelectionControl/index.mjs +2 -0
- package/lib/components/VSelectionControl/index.mjs.map +1 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +3 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +64 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +9 -0
- package/lib/components/VSelectionControlGroup/_variables.scss +4 -0
- package/lib/components/VSelectionControlGroup/index.mjs +2 -0
- package/lib/components/VSelectionControlGroup/index.mjs.map +1 -0
- package/lib/components/VSheet/VSheet.css +23 -0
- package/lib/components/VSheet/VSheet.mjs +18 -18
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.sass +11 -7
- package/lib/components/VSheet/_variables.scss +15 -4
- package/lib/components/VSheet/index.mjs +1 -1
- package/lib/components/VSheet/index.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs +8 -8
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.css +42 -0
- package/lib/components/VSlideGroup/VSlideGroup.mjs +301 -361
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.sass +21 -25
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +29 -0
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -0
- package/lib/components/VSlideGroup/_variables.scss +4 -1
- package/lib/components/VSlideGroup/helpers.mjs +54 -0
- package/lib/components/VSlideGroup/helpers.mjs.map +1 -0
- package/lib/components/VSlideGroup/index.mjs +2 -9
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.css +53 -0
- package/lib/components/VSlider/VSlider.mjs +113 -538
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +38 -274
- package/lib/components/VSlider/VSliderThumb.css +142 -0
- package/lib/components/VSlider/VSliderThumb.mjs +165 -0
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -0
- package/lib/components/VSlider/VSliderThumb.sass +147 -0
- package/lib/components/VSlider/VSliderTrack.css +150 -0
- package/lib/components/VSlider/VSliderTrack.mjs +121 -0
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -0
- package/lib/components/VSlider/VSliderTrack.sass +159 -0
- package/lib/components/VSlider/_variables.scss +23 -14
- package/lib/components/VSlider/index.mjs +1 -3
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +300 -0
- package/lib/components/VSlider/slider.mjs.map +1 -0
- package/lib/components/VSnackbar/VSnackbar.css +137 -0
- package/lib/components/VSnackbar/VSnackbar.mjs +101 -168
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.sass +43 -79
- package/lib/components/VSnackbar/_variables.scss +20 -25
- package/lib/components/VSnackbar/index.mjs +1 -3
- package/lib/components/VSnackbar/index.mjs.map +1 -1
- package/lib/components/VSparkline/VSparkline.mjs +13 -13
- package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/path.mjs +7 -5
- package/lib/components/VSparkline/helpers/path.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.mjs +4 -4
- package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/components/VStepper/VStepper.mjs +2 -2
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepper.sass +5 -1
- package/lib/components/VStepper/VStepperStep.mjs +1 -1
- package/lib/components/VStepper/_variables.scss +6 -5
- package/lib/components/VSwitch/VSwitch.css +69 -0
- package/lib/components/VSwitch/VSwitch.mjs +99 -107
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +71 -129
- package/lib/components/VSwitch/_variables.scss +10 -23
- package/lib/components/VSwitch/index.mjs +1 -3
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +35 -0
- package/lib/components/VSystemBar/VSystemBar.mjs +52 -37
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.sass +14 -26
- package/lib/components/VSystemBar/_variables.scss +27 -17
- package/lib/components/VSystemBar/index.mjs +1 -1
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.css +143 -0
- package/lib/components/VTable/VTable.mjs +54 -0
- package/lib/components/VTable/VTable.mjs.map +1 -0
- package/lib/components/VTable/VTable.sass +156 -0
- package/lib/components/VTable/_mixins.scss +25 -0
- package/lib/components/VTable/_variables.scss +21 -0
- package/lib/components/VTable/index.mjs +2 -0
- package/lib/components/VTable/index.mjs.map +1 -0
- package/lib/components/VTabs/VTab.css +29 -0
- package/lib/components/VTabs/VTab.mjs +109 -69
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +30 -0
- package/lib/components/VTabs/VTabs.css +71 -0
- package/lib/components/VTabs/VTabs.mjs +86 -283
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +40 -202
- package/lib/components/VTabs/_variables.scss +10 -18
- package/lib/components/VTabs/index.mjs +2 -15
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs +2 -0
- package/lib/components/VTabs/shared.mjs.map +1 -0
- package/lib/components/VTextField/VTextField.css +70 -0
- package/lib/components/VTextField/VTextField.mjs +162 -483
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +56 -493
- package/lib/components/VTextField/_variables.scss +10 -50
- package/lib/components/VTextField/index.mjs +1 -3
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.css +37 -0
- package/lib/components/VTextarea/VTextarea.mjs +210 -74
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +35 -75
- package/lib/components/VTextarea/_variables.scss +2 -4
- package/lib/components/VTextarea/index.mjs +1 -3
- package/lib/components/VTextarea/index.mjs.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.css +4 -0
- package/lib/components/VThemeProvider/VThemeProvider.mjs +23 -18
- package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
- package/lib/components/VThemeProvider/index.mjs +1 -1
- package/lib/components/VThemeProvider/index.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.mjs +4 -4
- package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerClock.mjs +9 -9
- package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerTitle.mjs +2 -2
- package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.css +399 -0
- package/lib/components/VTimeline/VTimeline.mjs +89 -34
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +347 -115
- package/lib/components/VTimeline/VTimelineDivider.mjs +76 -0
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -0
- package/lib/components/VTimeline/VTimelineItem.mjs +68 -90
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_mixins.sass +21 -32
- package/lib/components/VTimeline/_variables.scss +28 -15
- package/lib/components/VTimeline/index.mjs +2 -9
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VTimeline/shared.mjs +2 -0
- package/lib/components/VTimeline/shared.mjs.map +1 -0
- package/lib/components/VToolbar/VToolbar.css +145 -0
- package/lib/components/VToolbar/VToolbar.mjs +135 -141
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +75 -123
- package/lib/components/VToolbar/VToolbarItems.mjs +32 -0
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -0
- package/lib/components/VToolbar/VToolbarTitle.mjs +34 -0
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -0
- package/lib/components/VToolbar/_variables.scss +65 -15
- package/lib/components/VToolbar/index.mjs +3 -14
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.css +22 -0
- package/lib/components/VTooltip/VTooltip.mjs +73 -199
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +8 -15
- package/lib/components/VTooltip/_variables.scss +6 -6
- package/lib/components/VTooltip/index.mjs +1 -3
- package/lib/components/VTooltip/index.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeview.mjs +18 -9
- package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.mjs +4 -2
- package/lib/components/VTreeview/VTreeviewNode.mjs.map +1 -1
- package/lib/components/VTreeview/_mixins.sass +3 -3
- package/lib/components/VValidation/VValidation.mjs +26 -0
- package/lib/components/VValidation/VValidation.mjs.map +1 -0
- package/lib/components/VValidation/index.mjs +2 -0
- package/lib/components/VValidation/index.mjs.map +1 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.css +70 -0
- package/lib/components/VWindow/VWindow.mjs +158 -233
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.sass +29 -51
- package/lib/components/VWindow/VWindowItem.mjs +72 -98
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/_variables.scss +2 -3
- package/lib/components/VWindow/index.mjs +2 -9
- package/lib/components/VWindow/index.mjs.map +1 -1
- package/lib/components/index.d.ts +15391 -0
- package/lib/components/index.mjs +75 -65
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs +61 -16
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +107 -0
- package/lib/components/transitions/dialog-transition.mjs.map +1 -0
- package/lib/components/transitions/expand-transition.mjs +6 -4
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/transitions/index.mjs +1 -1
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +9 -7
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs +2 -2
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +42 -0
- package/lib/composables/defaults.mjs.map +1 -0
- package/lib/composables/density.mjs +5 -4
- package/lib/composables/density.mjs.map +1 -1
- package/lib/composables/display.mjs +4 -3
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/elevation.mjs +4 -3
- package/lib/composables/elevation.mjs.map +1 -1
- package/lib/composables/filter.mjs +87 -0
- package/lib/composables/filter.mjs.map +1 -0
- package/lib/composables/focus.mjs +35 -0
- package/lib/composables/focus.mjs.map +1 -0
- package/lib/composables/form.mjs +116 -0
- package/lib/composables/form.mjs.map +1 -0
- package/lib/composables/forwardRef.mjs +46 -0
- package/lib/composables/forwardRef.mjs.map +1 -0
- package/lib/composables/group.mjs +135 -45
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs +12 -0
- package/lib/composables/hydration.mjs.map +1 -0
- package/lib/composables/icons.mjs +24 -30
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs +9 -0
- package/lib/composables/index.mjs.map +1 -0
- package/lib/composables/intersectionObserver.mjs +33 -0
- package/lib/composables/intersectionObserver.mjs.map +1 -0
- package/lib/composables/items.mjs +56 -0
- package/lib/composables/items.mjs.map +1 -0
- package/lib/composables/layout.mjs +157 -66
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs +23 -0
- package/lib/composables/lazy.mjs.map +1 -0
- package/lib/composables/loader.mjs +39 -0
- package/lib/composables/loader.mjs.map +1 -0
- package/lib/composables/locale.mjs +25 -13
- package/lib/composables/locale.mjs.map +1 -1
- package/lib/composables/mutationObserver.mjs +43 -0
- package/lib/composables/mutationObserver.mjs.map +1 -0
- package/lib/composables/nested/nested.mjs +207 -0
- package/lib/composables/nested/nested.mjs.map +1 -0
- package/lib/composables/nested/openStrategies.mjs +76 -0
- package/lib/composables/nested/openStrategies.mjs.map +1 -0
- package/lib/composables/nested/selectStrategies.mjs +198 -0
- package/lib/composables/nested/selectStrategies.mjs.map +1 -0
- package/lib/composables/overlay.mjs +34 -0
- package/lib/composables/overlay.mjs.map +1 -0
- package/lib/composables/position.mjs +6 -5
- package/lib/composables/position.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +13 -8
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/refs.mjs +16 -0
- package/lib/composables/refs.mjs.map +1 -0
- package/lib/composables/resizeObserver.mjs +35 -0
- package/lib/composables/resizeObserver.mjs.map +1 -0
- package/lib/composables/rounded.mjs +10 -8
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +82 -0
- package/lib/composables/router.mjs.map +1 -0
- package/lib/composables/rtl.mjs +5 -5
- package/lib/composables/rtl.mjs.map +1 -1
- package/lib/composables/scroll.mjs +3 -2
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/selectLink.mjs +19 -0
- package/lib/composables/selectLink.mjs.map +1 -0
- package/lib/composables/size.mjs +4 -3
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/stack.mjs +36 -0
- package/lib/composables/stack.mjs.map +1 -0
- package/lib/composables/teleport.mjs +30 -0
- package/lib/composables/teleport.mjs.map +1 -0
- package/lib/composables/theme.mjs +147 -96
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/touch.mjs +129 -0
- package/lib/composables/touch.mjs.map +1 -0
- package/lib/composables/transition.mjs +20 -0
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +119 -0
- package/lib/composables/validation.mjs.map +1 -0
- package/lib/composables/variant.mjs +50 -0
- package/lib/composables/variant.mjs.map +1 -0
- package/lib/directives/click-outside/index.mjs +23 -11
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/color/index.mjs +1 -1
- package/lib/directives/color/index.mjs.map +1 -1
- package/lib/directives/index.d.ts +58 -0
- package/lib/directives/index.mjs +2 -2
- package/lib/directives/index.mjs.map +1 -1
- package/lib/directives/intersect/index.mjs +26 -19
- package/lib/directives/intersect/index.mjs.map +1 -1
- package/lib/directives/mutate/index.mjs +33 -34
- package/lib/directives/mutate/index.mjs.map +1 -1
- package/lib/directives/resize/index.mjs +10 -7
- package/lib/directives/resize/index.mjs.map +1 -1
- package/lib/directives/ripple/VRipple.css +34 -0
- package/lib/directives/ripple/VRipple.sass +2 -1
- package/lib/directives/ripple/_variables.scss +4 -4
- package/lib/directives/ripple/index.mjs +35 -20
- package/lib/directives/ripple/index.mjs.map +1 -1
- package/lib/directives/scroll/index.mjs +9 -6
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs +17 -7
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +8 -6
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +55 -36
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa-svg.d.ts +54 -0
- package/lib/iconsets/fa.d.ts +54 -0
- package/lib/iconsets/fa.mjs +1 -0
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.d.ts +54 -0
- package/lib/iconsets/fa4.mjs +2 -1
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.d.ts +54 -0
- package/lib/iconsets/md.mjs +2 -1
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.d.ts +54 -0
- package/lib/iconsets/mdi-svg.mjs +1 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.d.ts +54 -0
- package/lib/iconsets/mdi.mjs +4 -3
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.ts +450 -0
- package/lib/locale/adapters/vue-i18n.mjs +64 -0
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -0
- package/lib/locale/adapters/vue-intl.mjs +67 -0
- package/lib/locale/adapters/vue-intl.mjs.map +1 -0
- package/lib/locale/af.mjs +5 -3
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs +5 -3
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs +5 -3
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs +5 -3
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs +12 -10
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs +5 -3
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs +6 -4
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs +72 -0
- package/lib/locale/da.mjs.map +1 -0
- package/lib/locale/de.mjs +5 -3
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs +5 -3
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs +5 -3
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs +6 -4
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs +5 -3
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs +5 -3
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs +5 -3
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs +7 -5
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs +5 -3
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs +5 -3
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs +5 -3
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs +5 -3
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.d.ts +3111 -0
- package/lib/locale/index.mjs +1 -0
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs +8 -6
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs +5 -3
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs +5 -3
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs +5 -3
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs +5 -3
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs +5 -3
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs +5 -3
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs +5 -3
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs +5 -3
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs +5 -3
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs +5 -3
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs +5 -3
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs +5 -3
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs +5 -3
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs +5 -3
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs +5 -3
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs +5 -3
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs +5 -3
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs +5 -3
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs +5 -3
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs +5 -3
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs +5 -3
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/presets/default/index.mjs +1 -1
- package/lib/presets/default/index.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs +0 -3
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs +17 -17
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs +2 -2
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/elements/_blockquote.sass +6 -4
- package/lib/styles/elements/_global.sass +12 -8
- package/lib/styles/elements/_index.sass +2 -6
- package/lib/styles/generic/_colors.scss +31 -11
- package/lib/styles/generic/_elevation.scss +3 -3
- package/lib/styles/generic/_index.scss +6 -6
- package/lib/styles/generic/_reset.scss +236 -226
- package/lib/styles/generic/_transitions.scss +20 -4
- package/lib/styles/main.css +18620 -0
- package/lib/styles/main.sass +4 -5
- package/lib/styles/settings/_colors.scss +431 -7
- package/lib/styles/settings/_elevations.scss +1 -1
- package/lib/styles/settings/_index.sass +4 -10
- package/lib/styles/settings/_utilities.scss +514 -463
- package/lib/styles/settings/_variables.scss +59 -64
- package/lib/styles/tools/_absolute.sass +8 -0
- package/lib/styles/tools/_border.sass +6 -1
- package/lib/styles/tools/_density.sass +5 -9
- package/lib/styles/tools/_display.sass +11 -0
- package/lib/styles/tools/_elevation.sass +4 -2
- package/lib/styles/tools/_functions.sass +32 -24
- package/lib/styles/tools/_index.sass +17 -22
- package/lib/styles/tools/_radius.sass +5 -2
- package/lib/styles/tools/_rtl.sass +2 -0
- package/lib/styles/tools/_sheet.sass +7 -4
- package/lib/styles/tools/_states.sass +18 -8
- package/lib/styles/tools/_theme.sass +3 -5
- package/lib/styles/tools/_typography.sass +6 -0
- package/lib/styles/tools/_utilities.sass +27 -24
- package/lib/styles/tools/_variant.sass +53 -0
- package/lib/styles/utilities/_display.sass +7 -6
- package/lib/styles/utilities/_index.sass +25 -22
- package/lib/styles/utilities/_text.sass +8 -7
- package/lib/styles.scss +4 -0
- package/lib/util/animation.mjs +43 -0
- package/lib/util/animation.mjs.map +1 -0
- package/lib/util/box.mjs +32 -0
- package/lib/util/box.mjs.map +1 -0
- package/lib/util/color/APCA.mjs +85 -0
- package/lib/util/color/APCA.mjs.map +1 -0
- package/lib/util/colorUtils.mjs +10 -7
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/console.mjs +8 -7
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs +18 -11
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs +3 -1
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +92 -0
- package/lib/util/defineComponent.mjs.map +1 -0
- package/lib/util/easing.mjs +5 -0
- package/lib/util/easing.mjs.map +1 -0
- package/lib/util/getCurrentInstance.mjs +19 -0
- package/lib/util/getCurrentInstance.mjs.map +1 -0
- package/lib/util/getScrollParent.mjs +24 -0
- package/lib/util/getScrollParent.mjs.map +1 -0
- package/lib/util/globals.mjs +1 -0
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +194 -41
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/index.mjs +6 -2
- package/lib/util/isFixedPosition.mjs +12 -0
- package/lib/util/isFixedPosition.mjs.map +1 -0
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs +4 -2
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +109 -42
- package/dist/vuetify.css.map +0 -1
- package/lib/components/VApp/_index.scss +0 -1
- package/lib/components/VAvatar/_index.scss +0 -2
- package/lib/components/VBadge/_index.scss +0 -2
- package/lib/components/VBanner/_index.scss +0 -2
- package/lib/components/VBtn/_index.scss +0 -3
- package/lib/components/VCheckbox/VSimpleCheckbox.mjs +0 -92
- package/lib/components/VCheckbox/VSimpleCheckbox.mjs.map +0 -1
- package/lib/components/VCheckbox/VSimpleCheckbox.sass +0 -16
- package/lib/components/VDataTable/VSimpleTable.mjs +0 -48
- package/lib/components/VDataTable/VSimpleTable.mjs.map +0 -1
- package/lib/components/VDataTable/VSimpleTable.sass +0 -179
- package/lib/components/VDivider/_index.scss +0 -2
- package/lib/components/VExpansionPanel/VExpansionPanelContent.mjs +0 -47
- package/lib/components/VExpansionPanel/VExpansionPanelContent.mjs.map +0 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.mjs +0 -112
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.mjs.map +0 -1
- package/lib/components/VFooter/_index.scss +0 -2
- package/lib/components/VGrid/_index.scss +0 -2
- package/lib/components/VIcon/_index.scss +0 -2
- package/lib/components/VImg/_index.scss +0 -2
- package/lib/components/VLayout/_index.scss +0 -1
- package/lib/components/VList/VListGroup.sass +0 -111
- package/lib/components/VList/VListItemGroup.mjs +0 -41
- package/lib/components/VList/VListItemGroup.mjs.map +0 -1
- package/lib/components/VList/VListItemGroup.sass +0 -5
- package/lib/components/VList/_mixins.sass +0 -18
- package/lib/components/VMain/_index.scss +0 -2
- package/lib/components/VNavigationDrawer/_index.scss +0 -2
- package/lib/components/VParallax/_variables.scss +0 -4
- package/lib/components/VRadioGroup/VRadio.mjs +0 -179
- package/lib/components/VRadioGroup/VRadio.mjs.map +0 -1
- package/lib/components/VRadioGroup/VRadio.sass +0 -25
- package/lib/components/VRangeSlider/VRangeSlider.sass +0 -19
- package/lib/components/VResponsive/_index.scss +0 -1
- package/lib/components/VSelect/VSelectList.mjs +0 -251
- package/lib/components/VSelect/VSelectList.mjs.map +0 -1
- package/lib/components/VSheet/_index.scss +0 -2
- package/lib/components/VSlideGroup/VSlideItem.mjs +0 -14
- package/lib/components/VSlideGroup/VSlideItem.mjs.map +0 -1
- package/lib/components/VSubheader/VSubheader.mjs +0 -31
- package/lib/components/VSubheader/VSubheader.mjs.map +0 -1
- package/lib/components/VSubheader/VSubheader.sass +0 -15
- package/lib/components/VSubheader/_variables.scss +0 -6
- package/lib/components/VSubheader/index.mjs +0 -4
- package/lib/components/VSubheader/index.mjs.map +0 -1
- package/lib/components/VSystemBar/_index.scss +0 -2
- package/lib/components/VTabs/VTabItem.mjs +0 -23
- package/lib/components/VTabs/VTabItem.mjs.map +0 -1
- package/lib/components/VTabs/VTabsBar.mjs +0 -86
- package/lib/components/VTabs/VTabsBar.mjs.map +0 -1
- package/lib/components/VTabs/VTabsItems.mjs +0 -37
- package/lib/components/VTabs/VTabsItems.mjs.map +0 -1
- package/lib/components/VTabs/VTabsSlider.mjs +0 -20
- package/lib/components/VTabs/VTabsSlider.mjs.map +0 -1
- package/lib/components/VTextField/_mixins.sass +0 -18
- package/lib/components/VToolbar/_index.scss +0 -2
- package/lib/entry.mjs +0 -4
- package/lib/entry.mjs.map +0 -1
- package/lib/globals.d.mjs +0 -2
- package/lib/globals.d.mjs.map +0 -1
- package/lib/mixins/activatable/index.mjs +0 -196
- package/lib/mixins/activatable/index.mjs.map +0 -1
- package/lib/mixins/applicationable/index.mjs +0 -72
- package/lib/mixins/applicationable/index.mjs.map +0 -1
- package/lib/mixins/binds-attrs/index.mjs +0 -42
- package/lib/mixins/binds-attrs/index.mjs.map +0 -1
- package/lib/mixins/bootable/index.mjs +0 -54
- package/lib/mixins/bootable/index.mjs.map +0 -1
- package/lib/mixins/button-group/index.mjs +0 -28
- package/lib/mixins/button-group/index.mjs.map +0 -1
- package/lib/mixins/colorable/index.mjs +0 -78
- package/lib/mixins/colorable/index.mjs.map +0 -1
- package/lib/mixins/comparable/index.mjs +0 -15
- package/lib/mixins/comparable/index.mjs.map +0 -1
- package/lib/mixins/dependent/index.mjs +0 -73
- package/lib/mixins/dependent/index.mjs.map +0 -1
- package/lib/mixins/detachable/index.mjs +0 -128
- package/lib/mixins/detachable/index.mjs.map +0 -1
- package/lib/mixins/elevatable/index.mjs +0 -26
- package/lib/mixins/elevatable/index.mjs.map +0 -1
- package/lib/mixins/filterable/index.mjs +0 -16
- package/lib/mixins/filterable/index.mjs.map +0 -1
- package/lib/mixins/intersectable/index.mjs +0 -53
- package/lib/mixins/intersectable/index.mjs.map +0 -1
- package/lib/mixins/loadable/index.mjs +0 -45
- package/lib/mixins/loadable/index.mjs.map +0 -1
- package/lib/mixins/localable/index.mjs +0 -17
- package/lib/mixins/localable/index.mjs.map +0 -1
- package/lib/mixins/menuable/index.mjs +0 -361
- package/lib/mixins/menuable/index.mjs.map +0 -1
- package/lib/mixins/mobile/index.mjs +0 -50
- package/lib/mixins/mobile/index.mjs.map +0 -1
- package/lib/mixins/overlayable/index.mjs +0 -201
- package/lib/mixins/overlayable/index.mjs.map +0 -1
- package/lib/mixins/picker/index.mjs +0 -75
- package/lib/mixins/picker/index.mjs.map +0 -1
- package/lib/mixins/picker-button/index.mjs +0 -35
- package/lib/mixins/picker-button/index.mjs.map +0 -1
- package/lib/mixins/proxyable/index.mjs +0 -50
- package/lib/mixins/proxyable/index.mjs.map +0 -1
- package/lib/mixins/returnable/index.mjs +0 -36
- package/lib/mixins/returnable/index.mjs.map +0 -1
- package/lib/mixins/rippleable/index.mjs +0 -35
- package/lib/mixins/rippleable/index.mjs.map +0 -1
- package/lib/mixins/roundable/index.mjs +0 -37
- package/lib/mixins/roundable/index.mjs.map +0 -1
- package/lib/mixins/routable/index.mjs +0 -146
- package/lib/mixins/routable/index.mjs.map +0 -1
- package/lib/mixins/selectable/index.mjs +0 -167
- package/lib/mixins/selectable/index.mjs.map +0 -1
- package/lib/mixins/stackable/index.mjs +0 -55
- package/lib/mixins/stackable/index.mjs.map +0 -1
- package/lib/mixins/themeable/index.mjs +0 -111
- package/lib/mixins/themeable/index.mjs.map +0 -1
- package/lib/mixins/toggleable/index.mjs +0 -40
- package/lib/mixins/toggleable/index.mjs.map +0 -1
- package/lib/mixins/transitionable/index.mjs +0 -13
- package/lib/mixins/transitionable/index.mjs.map +0 -1
- package/lib/mixins/translatable/index.mjs +0 -59
- package/lib/mixins/translatable/index.mjs.map +0 -1
- package/lib/mixins/validatable/index.mjs +0 -263
- package/lib/mixins/validatable/index.mjs.map +0 -1
- package/lib/services/application/index.mjs +0 -44
- package/lib/services/application/index.mjs.map +0 -1
- package/lib/services/breakpoint/index.mjs +0 -151
- package/lib/services/breakpoint/index.mjs.map +0 -1
- package/lib/services/index.mjs +0 -10
- package/lib/services/index.mjs.map +0 -1
- package/lib/services/lang/index.mjs +0 -69
- package/lib/services/lang/index.mjs.map +0 -1
- package/lib/services/service/index.mjs +0 -8
- package/lib/services/service/index.mjs.map +0 -1
- package/lib/styles/components/_index.sass +0 -1
- package/lib/styles/components/_selection-controls.sass +0 -119
- package/lib/styles/elements/_code.sass +0 -23
- package/lib/styles/elements/_headings.sass +0 -8
- package/lib/styles/elements/_lists.sass +0 -3
- package/lib/styles/elements/_typography.sass +0 -88
- package/lib/styles/settings/_dark.scss +0 -145
- package/lib/styles/settings/_light.scss +0 -126
- package/lib/styles/settings/_theme.scss +0 -1
- package/lib/styles/styles.sass +0 -2
- package/lib/util/makeProps.mjs +0 -52
- package/lib/util/makeProps.mjs.map +0 -1
- package/lib/util/useDirective.mjs +0 -7
- package/lib/util/useDirective.mjs.map +0 -1
- package/types/.npmignore +0 -2
- package/types/alacarte.d.ts +0 -49
- package/types/colors.d.ts +0 -107
- package/types/index.d.ts +0 -300
- package/types/lib.d.ts +0 -380
- package/types/services/application.d.ts +0 -27
- package/types/services/breakpoint.d.ts +0 -45
- package/types/services/goto.d.ts +0 -31
- package/types/services/icons.d.ts +0 -71
- package/types/services/index.d.ts +0 -16
- package/types/services/lang.d.ts +0 -19
- package/types/services/theme.d.ts +0 -83
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/composables/teleport.ts"],"names":["computed","warn","IN_BROWSER","useTeleport","target","teleportTarget","_target","value","undefined","targetElement","document","body","querySelector","cache","has","el","createElement","className","appendChild","set","get","WeakMap"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,IAAnB,QAA+B,KAA/B;SACSC,U,6BAET;;AAGA,OAAO,SAASC,WAAT,CAAsBC,MAAtB,EAA+D;AACpE,QAAMC,cAAc,GAAGL,QAAQ,CAAC,MAAM;AACpC,UAAMM,OAAO,GAAGF,MAAM,CAACG,KAAvB;AAEA,QAAID,OAAO,KAAK,IAAZ,IAAoB,CAACJ,UAAzB,EAAqC,OAAOM,SAAP;AAErC,UAAMC,aAAa,GACjBH,OAAO,KAAK,KAAZ,GAAoBI,QAAQ,CAACC,IAA7B,GACE,OAAOL,OAAP,KAAmB,QAAnB,GAA8BI,QAAQ,CAACE,aAAT,CAAuBN,OAAvB,CAA9B,GACAA,OAHJ;;AAKA,QAAIG,aAAa,IAAI,IAArB,EAA2B;AACzBR,MAAAA,IAAI,CAAE,2BAA0BK,OAAQ,EAApC,CAAJ;AACA,aAAOE,SAAP;AACD;;AAED,QAAI,CAACL,WAAW,CAACU,KAAZ,CAAkBC,GAAlB,CAAsBL,aAAtB,CAAL,EAA2C;AACzC,YAAMM,EAAE,GAAGL,QAAQ,CAACM,aAAT,CAAuB,KAAvB,CAAX;AACAD,MAAAA,EAAE,CAACE,SAAH,GAAe,qBAAf;AACAR,MAAAA,aAAa,CAACS,WAAd,CAA0BH,EAA1B;AACAZ,MAAAA,WAAW,CAACU,KAAZ,CAAkBM,GAAlB,CAAsBV,aAAtB,EAAqCM,EAArC;AACD;;AAED,WAAOZ,WAAW,CAACU,KAAZ,CAAkBO,GAAlB,CAAsBX,aAAtB,CAAP;AACD,GAvB8B,CAA/B;AAyBA,SAAO;AAAEJ,IAAAA;AAAF,GAAP;AACD;AACDF,WAAW,CAACU,KAAZ,GAAoB,IAAIQ,OAAJ,EAApB","sourcesContent":["// Utilities\nimport { computed, warn } from 'vue'\nimport { IN_BROWSER } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\n\nexport function useTeleport (target: Ref<boolean | string | Element>) {\n const teleportTarget = computed(() => {\n const _target = target.value\n\n if (_target === true || !IN_BROWSER) return undefined\n\n const targetElement =\n _target === false ? document.body\n : typeof _target === 'string' ? document.querySelector(_target)\n : _target\n\n if (targetElement == null) {\n warn(`Unable to locate target ${_target}`)\n return undefined\n }\n\n if (!useTeleport.cache.has(targetElement)) {\n const el = document.createElement('div')\n el.className = 'v-overlay-container'\n targetElement.appendChild(el)\n useTeleport.cache.set(targetElement, el)\n }\n\n return useTeleport.cache.get(targetElement)\n })\n\n return { teleportTarget }\n}\nuseTeleport.cache = new WeakMap<Element, Element>()\n"],"file":"teleport.mjs"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// Utilities
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { computed, inject, provide, ref, watch, watchEffect } from 'vue';
|
|
3
|
+
import { colorToInt, colorToRGB, createRange, darken, getCurrentInstance, getLuma, IN_BROWSER, intToHex, lighten, mergeDeep, propsFactory } from "../util/index.mjs";
|
|
4
|
+
import { APCAcontrast } from "../util/color/APCA.mjs"; // Types
|
|
4
5
|
|
|
5
|
-
export const
|
|
6
|
+
export const ThemeSymbol = Symbol.for('vuetify:theme');
|
|
7
|
+
export const makeThemeProps = propsFactory({
|
|
8
|
+
theme: String
|
|
9
|
+
}, 'theme');
|
|
6
10
|
const defaultThemeOptions = {
|
|
7
11
|
defaultTheme: 'light',
|
|
8
12
|
variations: {
|
|
@@ -16,6 +20,8 @@ const defaultThemeOptions = {
|
|
|
16
20
|
colors: {
|
|
17
21
|
background: '#FFFFFF',
|
|
18
22
|
surface: '#FFFFFF',
|
|
23
|
+
'surface-variant': '#424242',
|
|
24
|
+
'on-surface-variant': '#EEEEEE',
|
|
19
25
|
primary: '#6200EE',
|
|
20
26
|
'primary-darken-1': '#3700B3',
|
|
21
27
|
secondary: '#03DAC6',
|
|
@@ -26,17 +32,30 @@ const defaultThemeOptions = {
|
|
|
26
32
|
warning: '#FB8C00'
|
|
27
33
|
},
|
|
28
34
|
variables: {
|
|
29
|
-
'border-color': '
|
|
35
|
+
'border-color': '#000000',
|
|
30
36
|
'border-opacity': 0.12,
|
|
37
|
+
'high-emphasis-opacity': 0.87,
|
|
38
|
+
'medium-emphasis-opacity': 0.60,
|
|
31
39
|
'disabled-opacity': 0.38,
|
|
32
|
-
'
|
|
40
|
+
'idle-opacity': 0.04,
|
|
41
|
+
'hover-opacity': 0.04,
|
|
42
|
+
'focus-opacity': 0.12,
|
|
43
|
+
'selected-opacity': 0.08,
|
|
44
|
+
'activated-opacity': 0.12,
|
|
45
|
+
'pressed-opacity': 0.12,
|
|
46
|
+
'dragged-opacity': 0.08,
|
|
47
|
+
'kbd-background-color': '#212529',
|
|
48
|
+
'kbd-color': '#FFFFFF',
|
|
49
|
+
'code-background-color': '#C2C2C2'
|
|
33
50
|
}
|
|
34
51
|
},
|
|
35
52
|
dark: {
|
|
36
53
|
dark: true,
|
|
37
54
|
colors: {
|
|
38
55
|
background: '#121212',
|
|
39
|
-
surface: '#
|
|
56
|
+
surface: '#212121',
|
|
57
|
+
'surface-variant': '#BDBDBD',
|
|
58
|
+
'on-surface-variant': '#424242',
|
|
40
59
|
primary: '#BB86FC',
|
|
41
60
|
'primary-darken-1': '#3700B3',
|
|
42
61
|
secondary: '#03DAC5',
|
|
@@ -47,53 +66,88 @@ const defaultThemeOptions = {
|
|
|
47
66
|
warning: '#FB8C00'
|
|
48
67
|
},
|
|
49
68
|
variables: {
|
|
50
|
-
'border-color': '
|
|
69
|
+
'border-color': '#FFFFFF',
|
|
51
70
|
'border-opacity': 0.12,
|
|
71
|
+
'high-emphasis-opacity': 0.87,
|
|
72
|
+
'medium-emphasis-opacity': 0.60,
|
|
52
73
|
'disabled-opacity': 0.38,
|
|
53
|
-
'
|
|
74
|
+
'idle-opacity': 0.10,
|
|
75
|
+
'hover-opacity': 0.04,
|
|
76
|
+
'focus-opacity': 0.12,
|
|
77
|
+
'selected-opacity': 0.08,
|
|
78
|
+
'activated-opacity': 0.12,
|
|
79
|
+
'pressed-opacity': 0.16,
|
|
80
|
+
'dragged-opacity': 0.08,
|
|
81
|
+
'kbd-background-color': '#212529',
|
|
82
|
+
'kbd-color': '#FFFFFF',
|
|
83
|
+
'code-background-color': '#B7B7B7'
|
|
54
84
|
}
|
|
55
85
|
}
|
|
56
86
|
}
|
|
57
87
|
};
|
|
58
88
|
|
|
59
|
-
const parseThemeOptions = (
|
|
89
|
+
const parseThemeOptions = function () {
|
|
90
|
+
var _options$themes;
|
|
91
|
+
|
|
92
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultThemeOptions;
|
|
60
93
|
if (!options) return { ...defaultThemeOptions,
|
|
61
94
|
isDisabled: true
|
|
62
95
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
const themes = Object.entries((_options$themes = options.themes) != null ? _options$themes : {}).reduce((obj, _ref) => {
|
|
97
|
+
var _defaultThemeOptions$, _defaultThemeOptions$2;
|
|
98
|
+
|
|
99
|
+
let [key, theme] = _ref;
|
|
100
|
+
const defaultTheme = theme.dark ? (_defaultThemeOptions$ = defaultThemeOptions.themes) == null ? void 0 : _defaultThemeOptions$.dark : (_defaultThemeOptions$2 = defaultThemeOptions.themes) == null ? void 0 : _defaultThemeOptions$2.light;
|
|
101
|
+
obj[key] = mergeDeep(defaultTheme, theme);
|
|
102
|
+
return obj;
|
|
103
|
+
}, {});
|
|
104
|
+
return mergeDeep(defaultThemeOptions, { ...options,
|
|
105
|
+
themes
|
|
106
|
+
});
|
|
67
107
|
}; // Composables
|
|
68
108
|
|
|
69
109
|
|
|
70
|
-
export function createTheme(options) {
|
|
110
|
+
export function createTheme(app, options) {
|
|
111
|
+
const head = app._context.provides.usehead;
|
|
71
112
|
const parsedOptions = parseThemeOptions(options);
|
|
72
113
|
const styleEl = ref();
|
|
73
114
|
const current = ref(parsedOptions.defaultTheme);
|
|
74
115
|
const themes = ref(parsedOptions.themes);
|
|
75
116
|
const variations = ref(parsedOptions.variations);
|
|
76
117
|
const computedThemes = computed(() => {
|
|
77
|
-
return Object.
|
|
118
|
+
return Object.entries(themes.value).reduce((obj, _ref2) => {
|
|
78
119
|
var _parsedOptions$variat;
|
|
79
120
|
|
|
80
|
-
|
|
81
|
-
|
|
121
|
+
let [name, original] = _ref2;
|
|
122
|
+
const theme = { ...original,
|
|
123
|
+
colors: { ...original.colors,
|
|
82
124
|
...((_parsedOptions$variat = parsedOptions.variations.colors) != null ? _parsedOptions$variat : []).reduce((obj, color) => {
|
|
83
125
|
return { ...obj,
|
|
84
|
-
...genColorVariations(color,
|
|
126
|
+
...genColorVariations(color, original.colors[color])
|
|
85
127
|
};
|
|
86
128
|
}, {})
|
|
87
129
|
}
|
|
88
130
|
};
|
|
89
131
|
|
|
90
132
|
for (const color of Object.keys(theme.colors)) {
|
|
91
|
-
if (/on-[a-z]/.test(color) || theme.colors[
|
|
92
|
-
const onColor =
|
|
93
|
-
|
|
133
|
+
if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
134
|
+
const onColor = `on-${color}`;
|
|
135
|
+
const colorVal = colorToInt(theme.colors[color]);
|
|
136
|
+
const blackContrast = Math.abs(APCAcontrast(0, colorVal));
|
|
137
|
+
const whiteContrast = Math.abs(APCAcontrast(0xffffff, colorVal)); // TODO: warn about poor color selections
|
|
138
|
+
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
139
|
+
// const minContrast = Math.max(blackContrast, whiteContrast)
|
|
140
|
+
// if (minContrast < 60) {
|
|
141
|
+
// consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)
|
|
142
|
+
// } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {
|
|
143
|
+
// consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)
|
|
144
|
+
// }
|
|
145
|
+
// Prefer white text if both have an acceptable contrast ratio
|
|
146
|
+
|
|
147
|
+
theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
|
|
94
148
|
}
|
|
95
149
|
|
|
96
|
-
obj[
|
|
150
|
+
obj[name] = theme;
|
|
97
151
|
return obj;
|
|
98
152
|
}, {});
|
|
99
153
|
});
|
|
@@ -105,129 +159,126 @@ export function createTheme(options) {
|
|
|
105
159
|
const fn = variation === 'lighten' ? lighten : darken;
|
|
106
160
|
|
|
107
161
|
for (const amount of createRange(variations.value[variation], 1)) {
|
|
108
|
-
obj[
|
|
162
|
+
obj[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount));
|
|
109
163
|
}
|
|
110
164
|
}
|
|
111
165
|
|
|
112
166
|
return obj;
|
|
113
167
|
}
|
|
114
168
|
|
|
169
|
+
const styles = computed(() => {
|
|
170
|
+
const lines = [];
|
|
171
|
+
|
|
172
|
+
for (const themeName of Object.keys(computedThemes.value)) {
|
|
173
|
+
const variables = computedThemes.value[themeName].variables;
|
|
174
|
+
lines.push(...createCssClass(`.v-theme--${themeName}`, [...genCssVariables(themeName), ...Object.keys(variables).map(key => {
|
|
175
|
+
const value = variables[key];
|
|
176
|
+
const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined;
|
|
177
|
+
const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined;
|
|
178
|
+
return `--v-${key}: ${rgb != null ? rgb : value}`;
|
|
179
|
+
})]));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)));
|
|
183
|
+
|
|
184
|
+
for (const key of colors) {
|
|
185
|
+
if (/on-[a-z]/.test(key)) {
|
|
186
|
+
lines.push(...createCssClass(`.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]));
|
|
187
|
+
} else {
|
|
188
|
+
lines.push(...createCssClass(`.bg-${key}`, [`--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`, `background: rgb(var(--v-theme-${key})) !important`, `color: rgb(var(--v-theme-on-${key})) !important`]), ...createCssClass(`.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]), ...createCssClass(`.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('');
|
|
193
|
+
});
|
|
194
|
+
|
|
115
195
|
function genCssVariables(name) {
|
|
116
196
|
const theme = computedThemes.value[name];
|
|
117
|
-
if (!theme) throw new Error(
|
|
197
|
+
if (!theme) throw new Error(`Could not find theme ${name}`);
|
|
118
198
|
const lightOverlay = theme.dark ? 2 : 1;
|
|
119
199
|
const darkOverlay = theme.dark ? 1 : 2;
|
|
120
200
|
const variables = [];
|
|
121
201
|
|
|
122
202
|
for (const [key, value] of Object.entries(theme.colors)) {
|
|
123
203
|
const rgb = colorToRGB(value);
|
|
124
|
-
variables.push(
|
|
204
|
+
variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`);
|
|
125
205
|
|
|
126
206
|
if (!key.startsWith('on-')) {
|
|
127
|
-
variables.push(
|
|
207
|
+
variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`);
|
|
128
208
|
}
|
|
129
209
|
}
|
|
130
210
|
|
|
131
211
|
return variables;
|
|
132
212
|
}
|
|
133
213
|
|
|
134
|
-
function genStyleElement() {
|
|
135
|
-
if (typeof document === 'undefined' || styleEl.value) return;
|
|
136
|
-
const el = document.createElement('style');
|
|
137
|
-
el.type = 'text/css';
|
|
138
|
-
el.id = 'vuetify-theme-stylesheet';
|
|
139
|
-
styleEl.value = el;
|
|
140
|
-
document.head.appendChild(styleEl.value);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
214
|
function createCssClass(selector, content) {
|
|
144
|
-
return [
|
|
215
|
+
return [`${selector} {\n`, ...content.map(line => ` ${line};\n`), '}\n'];
|
|
145
216
|
}
|
|
146
217
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
218
|
+
if (head) {
|
|
219
|
+
head.addHeadObjs(computed(() => ({
|
|
220
|
+
style: [{
|
|
221
|
+
children: styles.value,
|
|
222
|
+
type: 'text/css',
|
|
223
|
+
id: 'vuetify-theme-stylesheet'
|
|
224
|
+
}]
|
|
225
|
+
})));
|
|
151
226
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const firstTheme = Object.keys(computedThemes.value)[0];
|
|
227
|
+
if (IN_BROWSER) {
|
|
228
|
+
watchEffect(() => head.updateDOM());
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
watch(themes, updateStyles, {
|
|
232
|
+
deep: true,
|
|
233
|
+
immediate: true
|
|
234
|
+
});
|
|
162
235
|
|
|
163
|
-
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
lines.push(...createCssClass(".bg-".concat(key), ["--v-theme-overlay-multiplier: var(--v-theme-".concat(key, "-overlay-multiplier)"), "background: rgb(var(--v-theme-".concat(key, "))"), "color: rgb(var(--v-theme-on-".concat(key, "))")]), ...createCssClass(".text-".concat(key), ["color: rgb(var(--v-theme-".concat(key, "))")]), ...createCssClass(".border-".concat(key), ["--v-border-color: var(--v-theme-".concat(key, ")")]));
|
|
168
|
-
}
|
|
236
|
+
function updateStyles() {
|
|
237
|
+
if (parsedOptions.isDisabled) return;
|
|
238
|
+
genStyleElement();
|
|
239
|
+
if (styleEl.value) styleEl.value.innerHTML = styles.value;
|
|
169
240
|
}
|
|
170
241
|
|
|
171
|
-
|
|
242
|
+
function genStyleElement() {
|
|
243
|
+
if (typeof document === 'undefined' || styleEl.value) return;
|
|
244
|
+
const el = document.createElement('style');
|
|
245
|
+
el.type = 'text/css';
|
|
246
|
+
el.id = 'vuetify-theme-stylesheet';
|
|
247
|
+
styleEl.value = el;
|
|
248
|
+
document.head.appendChild(styleEl.value);
|
|
249
|
+
}
|
|
172
250
|
}
|
|
173
251
|
|
|
174
|
-
watch(themes, updateStyles, {
|
|
175
|
-
deep: true,
|
|
176
|
-
immediate: true
|
|
177
|
-
});
|
|
178
252
|
return {
|
|
179
253
|
isDisabled: parsedOptions.isDisabled,
|
|
180
254
|
themes: computedThemes,
|
|
181
255
|
setTheme: (key, theme) => themes.value[key] = theme,
|
|
182
256
|
getTheme: key => computedThemes.value[key],
|
|
183
257
|
current,
|
|
184
|
-
themeClasses: computed(() => parsedOptions.isDisabled ?
|
|
185
|
-
|
|
258
|
+
themeClasses: computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${current.value}`),
|
|
259
|
+
styles
|
|
186
260
|
};
|
|
187
261
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
* A new theme instance will be created if either `theme` prop is provided,
|
|
193
|
-
* or if `newContext` prop is true
|
|
194
|
-
*/
|
|
195
|
-
|
|
196
|
-
export function provideTheme(props = {}, context) {
|
|
197
|
-
const theme = inject(VuetifyThemeSymbol, null);
|
|
262
|
+
export function provideTheme(props) {
|
|
263
|
+
getCurrentInstance('provideTheme');
|
|
264
|
+
const theme = inject(ThemeSymbol, null);
|
|
198
265
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
get: () => {
|
|
202
|
-
var _ref, _internal$value;
|
|
203
|
-
|
|
204
|
-
return (_ref = (_internal$value = internal.value) != null ? _internal$value : props.theme) != null ? _ref : theme == null ? void 0 : theme.current.value;
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
set(value) {
|
|
208
|
-
if (theme && !props.theme && !props.newContext) {
|
|
209
|
-
theme.current.value = value;
|
|
210
|
-
} else {
|
|
211
|
-
internal.value = value;
|
|
212
|
-
context.emit('update:theme', value);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
266
|
+
const current = computed(() => {
|
|
267
|
+
var _props$theme;
|
|
215
268
|
|
|
269
|
+
return (_props$theme = props.theme) != null ? _props$theme : theme == null ? void 0 : theme.current.value;
|
|
216
270
|
});
|
|
217
|
-
const themeClasses = computed(() => theme.isDisabled ?
|
|
271
|
+
const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${current.value}`);
|
|
218
272
|
const newTheme = { ...theme,
|
|
219
273
|
current,
|
|
220
274
|
themeClasses
|
|
221
275
|
};
|
|
222
|
-
provide(
|
|
276
|
+
provide(ThemeSymbol, newTheme);
|
|
223
277
|
return newTheme;
|
|
224
278
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Injects and returns closest available provided theme instance.
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
279
|
export function useTheme() {
|
|
230
|
-
|
|
280
|
+
getCurrentInstance('useTheme');
|
|
281
|
+
const theme = inject(ThemeSymbol, null);
|
|
231
282
|
if (!theme) throw new Error('Could not find Vuetify theme injection');
|
|
232
283
|
return theme;
|
|
233
284
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/composables/theme.ts"],"names":["colorToInt","colorToRGB","createRange","darken","getLuma","intToHex","lighten","computed","inject","provide","ref","watch","VuetifyThemeSymbol","Symbol","for","defaultThemeOptions","defaultTheme","variations","colors","themes","light","dark","background","surface","primary","secondary","error","info","success","warning","variables","parseThemeOptions","options","isDisabled","createTheme","parsedOptions","styleEl","current","computedThemes","Object","keys","value","reduce","obj","key","theme","color","genColorVariations","test","onColor","name","variation","fn","amount","genCssVariables","Error","lightOverlay","darkOverlay","entries","rgb","push","r","g","b","startsWith","genStyleElement","document","el","createElement","type","id","head","appendChild","createCssClass","selector","content","map","line","updateStyles","lines","themeName","firstTheme","innerHTML","str","i","join","deep","immediate","setTheme","getTheme","themeClasses","hasColor","provideTheme","props","context","internal","get","set","newContext","emit","newTheme","useTheme"],"mappings":"AAAA;SACSA,U,EAAYC,U,EAAYC,W,EAAaC,M,EAAQC,O,EAASC,Q,EAAUC,O;AACzE,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyCC,KAAzC,QAAsD,KAAtD,C,CAEA;;AA0EA,OAAO,MAAMC,kBAA+C,GAAGC,MAAM,CAACC,GAAP,CAAW,eAAX,CAAxD;AAEP,MAAMC,mBAAiC,GAAG;AACxCC,EAAAA,YAAY,EAAE,OAD0B;AAExCC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE,EAAV;AAAcZ,IAAAA,OAAO,EAAE,CAAvB;AAA0BH,IAAAA,MAAM,EAAE;AAAlC,GAF4B;AAGxCgB,EAAAA,MAAM,EAAE;AACNC,IAAAA,KAAK,EAAE;AACLC,MAAAA,IAAI,EAAE,KADD;AAELH,MAAAA,MAAM,EAAE;AACNI,QAAAA,UAAU,EAAE,SADN;AAENC,QAAAA,OAAO,EAAE,SAFH;AAGNC,QAAAA,OAAO,EAAE,SAHH;AAIN,4BAAoB,SAJd;AAKNC,QAAAA,SAAS,EAAE,SALL;AAMN,8BAAsB,SANhB;AAONC,QAAAA,KAAK,EAAE,SAPD;AAQNC,QAAAA,IAAI,EAAE,SARA;AASNC,QAAAA,OAAO,EAAE,SATH;AAUNC,QAAAA,OAAO,EAAE;AAVH,OAFH;AAcLC,MAAAA,SAAS,EAAE;AACT,wBAAgB,SADP;AAET,0BAAkB,IAFT;AAGT,4BAAoB,IAHX;AAIT,wBAAgB;AAJP;AAdN,KADD;AAsBNT,IAAAA,IAAI,EAAE;AACJA,MAAAA,IAAI,EAAE,IADF;AAEJH,MAAAA,MAAM,EAAE;AACNI,QAAAA,UAAU,EAAE,SADN;AAENC,QAAAA,OAAO,EAAE,SAFH;AAGNC,QAAAA,OAAO,EAAE,SAHH;AAIN,4BA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A,QAAQ,CAACtD,KAAT,GAAiBA,KAAjB;AACAqD,QAAAA,OAAO,CAACK,IAAR,CAAa,cAAb,EAA6B1D,KAA7B;AACD;AACF;;AAX8B,GAAT,CAAxB;AAcA,QAAMiD,YAAY,GAAGnF,QAAQ,CAAC,MAAMsC,KAAK,CAACZ,UAAN,GAAmB,EAAnB,sBAAoCI,OAAO,CAACI,KAA5C,CAAP,CAA7B;AACA,QAAM2D,QAAuB,GAAG,EAC9B,GAAGvD,KAD2B;AAE9BR,IAAAA,OAF8B;AAG9BqD,IAAAA;AAH8B,GAAhC;AAMAjF,EAAAA,OAAO,CAACG,kBAAD,EAAqBwF,QAArB,CAAP;AAEA,SAAOA,QAAP;AACD;AAED;AACA;AACA;;AACA,OAAO,SAASC,QAAT,GAAqB;AAC1B,QAAMxD,KAAK,GAAGrC,MAAM,CAACI,kBAAD,CAApB;AAEA,MAAI,CAACiC,KAAL,EAAY,MAAM,IAAIU,KAAJ,CAAU,wCAAV,CAAN;AAEZ,SAAOV,KAAP;AACD","sourcesContent":["// Utilities\nimport { colorToInt, colorToRGB, createRange, darken, getLuma, intToHex, lighten } from '@/util'\nimport { computed, inject, provide, ref, watch } from 'vue'\n\n// Types\nimport type { InjectionKey, Ref, SetupContext } from 'vue'\n\ninterface BaseColors {\n background: string\n surface: string\n primary: string\n secondary: string\n success: string\n warning: string\n error: string\n info: string\n}\n\ninterface OnColors {\n 'on-background': string\n 'on-surface': string\n 'on-primary': string\n 'on-secondary': string\n 'on-success': string\n 'on-warning': string\n 'on-error': string\n 'on-info': string\n}\n\ninterface Colors extends BaseColors, OnColors {\n [key: string]: string\n}\n\ninterface InternalThemeDefinition {\n dark: boolean\n colors: Colors\n variables: Record<string, string | number>\n}\n\ninterface ThemeDefinitionColors extends BaseColors, Partial<OnColors> {\n [key: string]: string | undefined\n}\n\nexport interface ThemeDefinition {\n dark: boolean\n colors: ThemeDefinitionColors\n variables: Record<string, string | number>\n}\n\ninterface VariationsOptions {\n colors: string[]\n lighten: number\n darken: number\n}\n\ninterface InternalThemeOptions {\n isDisabled: boolean\n defaultTheme: string\n variations: VariationsOptions\n themes: Record<string, ThemeDefinition>\n}\n\nexport type ThemeOptions = false | {\n defaultTheme?: string\n variations?: false | VariationsOptions\n themes?: Record<string, ThemeDefinition>\n}\n\nexport interface ThemeInstance {\n isDisabled: boolean\n themes: Ref<Record<string, InternalThemeDefinition>>\n current: Ref<string>\n themeClasses: Ref<string>\n setTheme: (key: string, theme: ThemeDefinition) => void\n getTheme: (key: string) => InternalThemeDefinition\n hasColor: (color: string) => boolean\n}\n\nexport const VuetifyThemeSymbol: InjectionKey<ThemeInstance> = Symbol.for('vuetify:theme')\n\nconst defaultThemeOptions: ThemeOptions = {\n defaultTheme: 'light',\n variations: { colors: [], lighten: 0, darken: 0 },\n themes: {\n light: {\n dark: false,\n colors: {\n background: '#FFFFFF',\n surface: '#FFFFFF',\n primary: '#6200EE',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC6',\n 'secondary-darken-1': '#018786',\n error: '#B00020',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '0, 0, 0',\n 'border-opacity': 0.12,\n 'disabled-opacity': 0.38,\n 'icon-opacity': 0.54,\n },\n },\n dark: {\n dark: true,\n colors: {\n background: '#121212',\n surface: '#121212',\n primary: '#BB86FC',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC5',\n 'secondary-darken-1': '#03DAC5',\n error: '#CF6679',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '255, 255, 255',\n 'border-opacity': 0.12,\n 'disabled-opacity': 0.38,\n 'icon-opacity': 0.70,\n },\n },\n },\n}\n\nconst parseThemeOptions = (options: ThemeOptions = defaultThemeOptions): InternalThemeOptions => {\n if (!options) return { ...defaultThemeOptions, isDisabled: true } as InternalThemeOptions\n\n return {\n ...defaultThemeOptions,\n ...options,\n variations: options?.variations == null || options?.variations === false ? defaultThemeOptions.variations : options.variations,\n } as InternalThemeOptions\n}\n\n// Composables\nexport function createTheme (options?: ThemeOptions): ThemeInstance {\n const parsedOptions = parseThemeOptions(options)\n const styleEl = ref<HTMLStyleElement>()\n const current = ref(parsedOptions.defaultTheme)\n const themes = ref(parsedOptions.themes)\n const variations = ref(parsedOptions.variations)\n\n const computedThemes = computed(() => {\n return Object.keys(themes.value).reduce((obj, key) => {\n const theme: ThemeDefinition = {\n ...themes.value[key],\n colors: {\n ...themes.value[key].colors,\n ...(parsedOptions.variations.colors ?? []).reduce((obj, color) => {\n return { ...obj, ...genColorVariations(color, themes.value[key].colors[color]!) }\n }, {}),\n },\n }\n\n for (const color of Object.keys(theme.colors)) {\n if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue\n\n const onColor = `on-${color}` as keyof OnColors\n theme.colors[onColor] = intToHex(getLuma(theme.colors[color]!) > 0.18 ? 0x0 : 0xffffff)\n }\n\n obj[key] = theme as InternalThemeDefinition\n\n return obj\n }, {} as Record<string, InternalThemeDefinition>)\n })\n\n function genColorVariations (name: string, color: string) {\n const obj: Record<string, string> = {}\n for (const variation of (['lighten', 'darken'] as const)) {\n const fn = variation === 'lighten' ? lighten : darken\n for (const amount of createRange(variations.value[variation], 1)) {\n obj[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount))\n }\n }\n\n return obj\n }\n\n function genCssVariables (name: string) {\n const theme = computedThemes.value[name]\n\n if (!theme) throw new Error(`Could not find theme ${name}`)\n\n const lightOverlay = theme.dark ? 2 : 1\n const darkOverlay = theme.dark ? 1 : 2\n\n const variables: string[] = []\n for (const [key, value] of Object.entries(theme.colors)) {\n const rgb = colorToRGB(value!)\n variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`)\n if (!key.startsWith('on-')) {\n variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`)\n }\n }\n\n return variables\n }\n\n function genStyleElement () {\n if (typeof document === 'undefined' || styleEl.value) return\n\n const el = document.createElement('style')\n el.type = 'text/css'\n el.id = 'vuetify-theme-stylesheet'\n\n styleEl.value = el\n document.head.appendChild(styleEl.value)\n }\n\n function createCssClass (selector: string, content: string[]) {\n return [\n `${selector} {\\n`,\n ...content.map(line => ` ${line};\\n`),\n '}\\n',\n ]\n }\n\n function updateStyles () {\n if (parsedOptions.isDisabled) return\n\n genStyleElement()\n\n const lines = []\n\n for (const themeName of Object.keys(computedThemes.value)) {\n const variables = computedThemes.value[themeName].variables\n\n lines.push(...createCssClass(`.v-theme--${themeName}`, [\n ...genCssVariables(themeName),\n ...Object.keys(variables).map(key => {\n return `--v-${key}: ${variables[key]}`\n }),\n ]))\n }\n\n // Assumption is that all theme objects have the same keys, so it doesn't matter which one\n // we use since the values are all css variables.\n const firstTheme = Object.keys(computedThemes.value)[0]\n for (const key of Object.keys(computedThemes.value[firstTheme].colors)) {\n if (/on-[a-z]/.test(key)) {\n lines.push(...createCssClass(`.${key}`, [`color: rgb(var(--v-theme-${key}))`]))\n } else {\n lines.push(\n ...createCssClass(`.bg-${key}`, [\n `--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`,\n `background: rgb(var(--v-theme-${key}))`,\n `color: rgb(var(--v-theme-on-${key}))`,\n ]),\n ...createCssClass(`.text-${key}`, [`color: rgb(var(--v-theme-${key}))`]),\n ...createCssClass(`.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]),\n )\n }\n }\n\n if (styleEl.value) styleEl.value.innerHTML = lines.map((str, i) => i === 0 ? str : ` ${str}`).join('')\n }\n\n watch(themes, updateStyles, { deep: true, immediate: true })\n\n return {\n isDisabled: parsedOptions.isDisabled,\n themes: computedThemes,\n setTheme: (key: string, theme: ThemeDefinition) => themes.value[key] = theme,\n getTheme: (key: string) => computedThemes.value[key],\n current,\n themeClasses: computed(() => parsedOptions.isDisabled ? '' : `v-theme--${current.value}`),\n hasColor: (color: string) => !!computedThemes.value[current.value].colors[color],\n }\n}\n\n/**\n * Used to either set up and provide a new theme instance, or to pass\n * along the closest available already provided instance.\n *\n * A new theme instance will be created if either `theme` prop is provided,\n * or if `newContext` prop is true\n */\nexport function provideTheme (props: { theme?: string, newContext?: boolean } = {}, context: SetupContext) {\n const theme = inject(VuetifyThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n const internal = ref<string | null>(null)\n const current = computed<string>({\n get: () => {\n return internal.value ?? props.theme ?? theme?.current.value\n },\n set (value: string) {\n if (theme && !props.theme && !props.newContext) {\n theme.current.value = value\n } else {\n internal.value = value\n context.emit('update:theme', value)\n }\n },\n })\n\n const themeClasses = computed(() => theme.isDisabled ? '' : `v-theme--${current.value}`)\n const newTheme: ThemeInstance = {\n ...theme,\n current,\n themeClasses,\n }\n\n provide(VuetifyThemeSymbol, newTheme)\n\n return newTheme\n}\n\n/**\n * Injects and returns closest available provided theme instance.\n */\nexport function useTheme () {\n const theme = inject(VuetifyThemeSymbol)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n return theme\n}\n"],"file":"theme.mjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/composables/theme.ts"],"names":["computed","inject","provide","ref","watch","watchEffect","colorToInt","colorToRGB","createRange","darken","getCurrentInstance","getLuma","IN_BROWSER","intToHex","lighten","mergeDeep","propsFactory","APCAcontrast","ThemeSymbol","Symbol","for","makeThemeProps","theme","String","defaultThemeOptions","defaultTheme","variations","colors","themes","light","dark","background","surface","primary","secondary","error","info","success","warning","variables","parseThemeOptions","options","isDisabled","Object","entries","reduce","obj","key","createTheme","app","head","_context","provides","usehead","parsedOptions","styleEl","current","computedThemes","value","name","original","color","genColorVariations","keys","test","onColor","colorVal","blackContrast","Math","abs","whiteContrast","min","variation","fn","amount","styles","lines","themeName","push","createCssClass","genCssVariables","map","startsWith","undefined","rgb","r","g","b","Set","values","flatMap","str","i","join","Error","lightOverlay","darkOverlay","selector","content","line","addHeadObjs","style","children","type","id","updateDOM","updateStyles","deep","immediate","genStyleElement","innerHTML","document","el","createElement","appendChild","setTheme","getTheme","themeClasses","provideTheme","props","newTheme","useTheme"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyCC,KAAzC,EAAgDC,WAAhD,QAAmE,KAAnE;SAEEC,U,EACAC,U,EACAC,W,EACAC,M,EACAC,kB,EACAC,O,EACAC,U,EACAC,Q,EACAC,O,EACAC,S,EACAC,Y;SAEOC,Y,kCAET;;AAqEA,OAAO,MAAMC,WAAwC,GAAGC,MAAM,CAACC,GAAP,CAAW,eAAX,CAAjD;AAEP,OAAO,MAAMC,cAAc,GAAGL,YAAY,CAAC;AACzCM,EAAAA,KAAK,EAAEC;AADkC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,MAAMC,mBAAiC,GAAG;AACxCC,EAAAA,YAAY,EAAE,OAD0B;AAExCC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,MAAM,EAAE,EAAV;AAAcb,IAAAA,OAAO,EAAE,CAAvB;AAA0BL,IAAAA,MAAM,EAAE;AAAlC,GAF4B;AAGxCmB,EAAAA,MAAM,EAAE;AACNC,IAAAA,KAAK,EAAE;AACLC,MAAAA,IAAI,EAAE,KADD;AAELH,MAAAA,MAAM,EAAE;AACNI,QAAAA,UAAU,EAAE,SADN;AAENC,QAAAA,OAAO,EAAE,SAFH;AAGN,2BAAmB,SAHb;AAIN,8BAAsB,SAJhB;AAKNC,QAAAA,OAAO,EAAE,SALH;AAMN,4BAAoB,SANd;AAONC,QAAAA,SAAS,EAAE,SAPL;AAQN,8BAAsB,SARhB;AASNC,QAAAA,KAAK,EAAE,SATD;AAUNC,QAAAA,IAAI,EAAE,SAVA;AAWNC,QAAAA,OAAO,EAAE,SAXH;AAYNC,QAAAA,OAAO,EAAE;AAZH,OAFH;AAgBLC,MAAAA,SAAS,EAAE;AACT,wBAAgB,SADP;AAET,0BAAkB,IAFT;AAGT,iCAAyB,IAHhB;AA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Ac,IAAd,CAApB;AAEA,MAAI,CAACI,KAAL,EAAY,MAAM,IAAIwE,KAAJ,CAAU,wCAAV,CAAN;AAEZ,SAAOxE,KAAP;AACD","sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, watch, watchEffect } from 'vue'\nimport {\n colorToInt,\n colorToRGB,\n createRange,\n darken,\n getCurrentInstance,\n getLuma,\n IN_BROWSER,\n intToHex,\n lighten,\n mergeDeep,\n propsFactory,\n} from '@/util'\nimport { APCAcontrast } from '@/util/color/APCA'\n\n// Types\nimport type { App, InjectionKey, Ref } from 'vue'\nimport type { HeadClient } from '@vueuse/head'\n\ntype DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T\n\ninterface BaseColors {\n background: string\n surface: string\n primary: string\n secondary: string\n success: string\n warning: string\n error: string\n info: string\n}\n\ninterface OnColors {\n 'on-background': string\n 'on-surface': string\n 'on-primary': string\n 'on-secondary': string\n 'on-success': string\n 'on-warning': string\n 'on-error': string\n 'on-info': string\n}\n\nexport interface Colors extends BaseColors, OnColors {\n [key: string]: string\n}\n\ninterface InternalThemeDefinition {\n dark: boolean\n colors: Colors\n variables: Record<string, string | number>\n}\n\ninterface VariationsOptions {\n colors: string[]\n lighten: number\n darken: number\n}\n\ninterface InternalThemeOptions {\n isDisabled: boolean\n defaultTheme: string\n variations: VariationsOptions\n themes: Record<string, InternalThemeDefinition>\n}\n\nexport type ThemeDefinition = DeepPartial<InternalThemeDefinition>\n\nexport type ThemeOptions = false | {\n defaultTheme?: string\n variations?: false | VariationsOptions\n themes?: Record<string, ThemeDefinition>\n}\n\nexport interface ThemeInstance {\n isDisabled: boolean\n themes: Ref<Record<string, InternalThemeDefinition>>\n current: Ref<string>\n themeClasses: Ref<string | undefined>\n setTheme: (key: string, theme: InternalThemeDefinition) => void\n getTheme: (key: string) => InternalThemeDefinition\n styles: Ref<string>\n}\n\nexport const ThemeSymbol: InjectionKey<ThemeInstance> = Symbol.for('vuetify:theme')\n\nexport const makeThemeProps = propsFactory({\n theme: String,\n}, 'theme')\n\nconst defaultThemeOptions: ThemeOptions = {\n defaultTheme: 'light',\n variations: { colors: [], lighten: 0, darken: 0 },\n themes: {\n light: {\n dark: false,\n colors: {\n background: '#FFFFFF',\n surface: '#FFFFFF',\n 'surface-variant': '#424242',\n 'on-surface-variant': '#EEEEEE',\n primary: '#6200EE',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC6',\n 'secondary-darken-1': '#018786',\n error: '#B00020',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#000000',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.04,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.12,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#C2C2C2',\n },\n },\n dark: {\n dark: true,\n colors: {\n background: '#121212',\n surface: '#212121',\n 'surface-variant': '#BDBDBD',\n 'on-surface-variant': '#424242',\n primary: '#BB86FC',\n 'primary-darken-1': '#3700B3',\n secondary: '#03DAC5',\n 'secondary-darken-1': '#03DAC5',\n error: '#CF6679',\n info: '#2196F3',\n success: '#4CAF50',\n warning: '#FB8C00',\n },\n variables: {\n 'border-color': '#FFFFFF',\n 'border-opacity': 0.12,\n 'high-emphasis-opacity': 0.87,\n 'medium-emphasis-opacity': 0.60,\n 'disabled-opacity': 0.38,\n 'idle-opacity': 0.10,\n 'hover-opacity': 0.04,\n 'focus-opacity': 0.12,\n 'selected-opacity': 0.08,\n 'activated-opacity': 0.12,\n 'pressed-opacity': 0.16,\n 'dragged-opacity': 0.08,\n 'kbd-background-color': '#212529',\n 'kbd-color': '#FFFFFF',\n 'code-background-color': '#B7B7B7',\n },\n },\n },\n}\n\nconst parseThemeOptions = (options: ThemeOptions = defaultThemeOptions): InternalThemeOptions => {\n if (!options) return { ...defaultThemeOptions, isDisabled: true } as InternalThemeOptions\n\n const themes = Object.entries(options.themes ?? {}).reduce((obj, [key, theme]) => {\n const defaultTheme = theme.dark ? defaultThemeOptions.themes?.dark : defaultThemeOptions.themes?.light\n obj[key] = mergeDeep(defaultTheme, theme)\n return obj\n }, {} as Record<string, ThemeDefinition>)\n\n return mergeDeep(\n defaultThemeOptions,\n { ...options, themes },\n ) as InternalThemeOptions\n}\n\n// Composables\nexport function createTheme (app: App, options?: ThemeOptions): ThemeInstance {\n const head = app._context.provides.usehead as HeadClient | undefined\n const parsedOptions = parseThemeOptions(options)\n const styleEl = ref<HTMLStyleElement>()\n const current = ref(parsedOptions.defaultTheme)\n const themes = ref(parsedOptions.themes)\n const variations = ref(parsedOptions.variations)\n\n const computedThemes = computed(() => {\n return Object.entries(themes.value).reduce((obj, [name, original]) => {\n const theme: InternalThemeDefinition = {\n ...original,\n colors: {\n ...original.colors,\n ...(parsedOptions.variations.colors ?? []).reduce((obj, color) => {\n return { ...obj, ...genColorVariations(color, original.colors[color]!) }\n }, {}),\n },\n }\n\n for (const color of Object.keys(theme.colors)) {\n if (/on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue\n\n const onColor = `on-${color}` as keyof OnColors\n const colorVal = colorToInt(theme.colors[color]!)\n\n const blackContrast = Math.abs(APCAcontrast(0, colorVal))\n const whiteContrast = Math.abs(APCAcontrast(0xffffff, colorVal))\n\n // TODO: warn about poor color selections\n // const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))\n // const minContrast = Math.max(blackContrast, whiteContrast)\n // if (minContrast < 60) {\n // consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)\n // } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {\n // consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)\n // }\n\n // Prefer white text if both have an acceptable contrast ratio\n theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000'\n }\n\n obj[name] = theme\n\n return obj\n }, {} as Record<string, InternalThemeDefinition>)\n })\n\n function genColorVariations (name: string, color: string) {\n const obj: Record<string, string> = {}\n for (const variation of (['lighten', 'darken'] as const)) {\n const fn = variation === 'lighten' ? lighten : darken\n for (const amount of createRange(variations.value[variation], 1)) {\n obj[`${name}-${variation}-${amount}`] = intToHex(fn(colorToInt(color), amount))\n }\n }\n\n return obj\n }\n\n const styles = computed(() => {\n const lines = []\n\n for (const themeName of Object.keys(computedThemes.value)) {\n const variables = computedThemes.value[themeName].variables\n\n lines.push(...createCssClass(`.v-theme--${themeName}`, [\n ...genCssVariables(themeName),\n ...Object.keys(variables).map(key => {\n const value = variables[key]\n const color = typeof value === 'string' && value.startsWith('#') ? colorToRGB(value) : undefined\n const rgb = color ? `${color.r}, ${color.g}, ${color.b}` : undefined\n\n return `--v-${key}: ${rgb ?? value}`\n }),\n ]))\n }\n\n const colors = new Set(Object.values(computedThemes.value).flatMap(theme => Object.keys(theme.colors)))\n for (const key of colors) {\n if (/on-[a-z]/.test(key)) {\n lines.push(...createCssClass(`.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]))\n } else {\n lines.push(\n ...createCssClass(`.bg-${key}`, [\n `--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`,\n `background: rgb(var(--v-theme-${key})) !important`,\n `color: rgb(var(--v-theme-on-${key})) !important`,\n ]),\n ...createCssClass(`.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]),\n ...createCssClass(`.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]),\n )\n }\n }\n\n return lines.map((str, i) => i === 0 ? str : ` ${str}`).join('')\n })\n\n function genCssVariables (name: string) {\n const theme = computedThemes.value[name]\n\n if (!theme) throw new Error(`Could not find theme ${name}`)\n\n const lightOverlay = theme.dark ? 2 : 1\n const darkOverlay = theme.dark ? 1 : 2\n\n const variables: string[] = []\n for (const [key, value] of Object.entries(theme.colors)) {\n const rgb = colorToRGB(value!)\n variables.push(`--v-theme-${key}: ${rgb.r},${rgb.g},${rgb.b}`)\n if (!key.startsWith('on-')) {\n variables.push(`--v-theme-${key}-overlay-multiplier: ${getLuma(value) > 0.18 ? lightOverlay : darkOverlay}`)\n }\n }\n\n return variables\n }\n\n function createCssClass (selector: string, content: string[]) {\n return [\n `${selector} {\\n`,\n ...content.map(line => ` ${line};\\n`),\n '}\\n',\n ]\n }\n\n if (head) {\n head.addHeadObjs(computed(() => ({\n style: [{\n children: styles.value,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n }],\n })))\n\n if (IN_BROWSER) {\n watchEffect(() => head.updateDOM())\n }\n } else {\n watch(themes, updateStyles, { deep: true, immediate: true })\n\n function updateStyles () {\n if (parsedOptions.isDisabled) return\n\n genStyleElement()\n\n if (styleEl.value) styleEl.value.innerHTML = styles.value\n }\n\n function genStyleElement () {\n if (typeof document === 'undefined' || styleEl.value) return\n\n const el = document.createElement('style')\n el.type = 'text/css'\n el.id = 'vuetify-theme-stylesheet'\n\n styleEl.value = el\n document.head.appendChild(styleEl.value)\n }\n }\n\n return {\n isDisabled: parsedOptions.isDisabled,\n themes: computedThemes,\n setTheme: (key: string, theme: InternalThemeDefinition) => themes.value[key] = theme,\n getTheme: (key: string) => computedThemes.value[key],\n current,\n themeClasses: computed(() => parsedOptions.isDisabled ? undefined : `v-theme--${current.value}`),\n styles,\n }\n}\n\nexport function provideTheme (props: { theme?: string }) {\n getCurrentInstance('provideTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n const current = computed<string>(() => {\n return props.theme ?? theme?.current.value\n })\n\n const themeClasses = computed(() => theme.isDisabled ? undefined : `v-theme--${current.value}`)\n\n const newTheme: ThemeInstance = {\n ...theme,\n current,\n themeClasses,\n }\n\n provide(ThemeSymbol, newTheme)\n\n return newTheme\n}\n\nexport function useTheme () {\n getCurrentInstance('useTheme')\n\n const theme = inject(ThemeSymbol, null)\n\n if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n return theme\n}\n"],"file":"theme.mjs"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { CircularBuffer } from "../util/index.mjs";
|
|
2
|
+
const HORIZON = 100; // ms
|
|
3
|
+
|
|
4
|
+
const HISTORY = 20; // number of samples to keep
|
|
5
|
+
|
|
6
|
+
/** @see https://android.googlesource.com/platform/frameworks/native/+/master/libs/input/VelocityTracker.cpp */
|
|
7
|
+
function kineticEnergyToVelocity(work) {
|
|
8
|
+
const sqrt2 = 1.41421356237;
|
|
9
|
+
return (work < 0 ? -1.0 : 1.0) * Math.sqrt(Math.abs(work)) * sqrt2;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns pointer velocity in px/s
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export function calculateImpulseVelocity(samples) {
|
|
17
|
+
// The input should be in reversed time order (most recent sample at index i=0)
|
|
18
|
+
if (samples.length < 2) {
|
|
19
|
+
// if 0 or 1 points, velocity is zero
|
|
20
|
+
return 0;
|
|
21
|
+
} // if (samples[1].t > samples[0].t) {
|
|
22
|
+
// // Algorithm will still work, but not perfectly
|
|
23
|
+
// consoleWarn('Samples provided to calculateImpulseVelocity in the wrong order')
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if (samples.length === 2) {
|
|
28
|
+
// if 2 points, basic linear calculation
|
|
29
|
+
if (samples[1].t === samples[0].t) {
|
|
30
|
+
// consoleWarn(`Events have identical time stamps t=${samples[0].t}, setting velocity = 0`)
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (samples[1].d - samples[0].d) / (samples[1].t - samples[0].t);
|
|
35
|
+
} // Guaranteed to have at least 3 points here
|
|
36
|
+
// start with the oldest sample and go forward in time
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
let work = 0;
|
|
40
|
+
|
|
41
|
+
for (let i = samples.length - 1; i > 0; i--) {
|
|
42
|
+
if (samples[i].t === samples[i - 1].t) {
|
|
43
|
+
// consoleWarn(`Events have identical time stamps t=${samples[i].t}, skipping sample`)
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const vprev = kineticEnergyToVelocity(work); // v[i-1]
|
|
48
|
+
|
|
49
|
+
const vcurr = (samples[i].d - samples[i - 1].d) / (samples[i].t - samples[i - 1].t); // v[i]
|
|
50
|
+
|
|
51
|
+
work += (vcurr - vprev) * Math.abs(vcurr);
|
|
52
|
+
|
|
53
|
+
if (i === samples.length - 1) {
|
|
54
|
+
work *= 0.5;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return kineticEnergyToVelocity(work) * 1000;
|
|
59
|
+
}
|
|
60
|
+
export function useVelocity() {
|
|
61
|
+
const touches = {};
|
|
62
|
+
|
|
63
|
+
function addMovement(e) {
|
|
64
|
+
Array.from(e.changedTouches).forEach(touch => {
|
|
65
|
+
var _touches$touch$identi;
|
|
66
|
+
|
|
67
|
+
const samples = (_touches$touch$identi = touches[touch.identifier]) != null ? _touches$touch$identi : touches[touch.identifier] = new CircularBuffer(HISTORY);
|
|
68
|
+
samples.push([e.timeStamp, touch]);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function endTouch(e) {
|
|
73
|
+
Array.from(e.changedTouches).forEach(touch => {
|
|
74
|
+
delete touches[touch.identifier];
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getVelocity(id) {
|
|
79
|
+
var _touches$id;
|
|
80
|
+
|
|
81
|
+
const samples = (_touches$id = touches[id]) == null ? void 0 : _touches$id.values().reverse();
|
|
82
|
+
|
|
83
|
+
if (!samples) {
|
|
84
|
+
throw new Error(`No samples for touch id ${id}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const newest = samples[0];
|
|
88
|
+
const x = [];
|
|
89
|
+
const y = [];
|
|
90
|
+
|
|
91
|
+
for (const val of samples) {
|
|
92
|
+
if (newest[0] - val[0] > HORIZON) break;
|
|
93
|
+
x.push({
|
|
94
|
+
t: val[0],
|
|
95
|
+
d: val[1].clientX
|
|
96
|
+
});
|
|
97
|
+
y.push({
|
|
98
|
+
t: val[0],
|
|
99
|
+
d: val[1].clientY
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
x: calculateImpulseVelocity(x),
|
|
105
|
+
y: calculateImpulseVelocity(y),
|
|
106
|
+
|
|
107
|
+
get direction() {
|
|
108
|
+
const {
|
|
109
|
+
x,
|
|
110
|
+
y
|
|
111
|
+
} = this;
|
|
112
|
+
const [absX, absY] = [Math.abs(x), Math.abs(y)];
|
|
113
|
+
return absX > absY && x >= 0 ? 'right' : absX > absY && x <= 0 ? 'left' : absY > absX && y >= 0 ? 'down' : absY > absX && y <= 0 ? 'up' : oops();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
addMovement,
|
|
121
|
+
endTouch,
|
|
122
|
+
getVelocity
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function oops() {
|
|
127
|
+
throw new Error();
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=touch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/composables/touch.ts"],"names":["CircularBuffer","HORIZON","HISTORY","kineticEnergyToVelocity","work","sqrt2","Math","sqrt","abs","calculateImpulseVelocity","samples","length","t","d","i","vprev","vcurr","useVelocity","touches","addMovement","e","Array","from","changedTouches","forEach","touch","identifier","push","timeStamp","endTouch","getVelocity","id","values","reverse","Error","newest","x","y","val","clientX","clientY","direction","absX","absY","oops"],"mappings":"SAASA,c;AAET,MAAMC,OAAO,G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IAAI,CAApB,GAAwB,OAAxB,GACHM,IAAI,GAAGC,IAAP,IAAeP,CAAC,IAAI,CAApB,GAAwB,MAAxB,GACAO,IAAI,GAAGD,IAAP,IAAeL,CAAC,IAAI,CAApB,GAAwB,MAAxB,GACAM,IAAI,GAAGD,IAAP,IAAeL,CAAC,IAAI,CAApB,GAAwB,IAAxB,GACAO,IAAI,EAJR;AAKD;;AAZI,KAAP;AAcD;;AAED,SAAO;AAAEzB,IAAAA,WAAF;AAAeU,IAAAA,QAAf;AAAyBC,IAAAA;AAAzB,GAAP;AACD;;AAED,SAASc,IAAT,GAAwB;AACtB,QAAM,IAAIV,KAAJ,EAAN;AACD","sourcesContent":["import { CircularBuffer } from '@/util'\n\nconst HORIZON = 100 // ms\nconst HISTORY = 20 // number of samples to keep\n\nexport interface Sample {\n t: number\n d: number\n}\n\n/** @see https://android.googlesource.com/platform/frameworks/native/+/master/libs/input/VelocityTracker.cpp */\nfunction kineticEnergyToVelocity (work: number) {\n const sqrt2 = 1.41421356237\n return (work < 0 ? -1.0 : 1.0) * Math.sqrt(Math.abs(work)) * sqrt2\n}\n\n/**\n * Returns pointer velocity in px/s\n */\nexport function calculateImpulseVelocity (samples: Sample[]) {\n // The input should be in reversed time order (most recent sample at index i=0)\n if (samples.length < 2) {\n // if 0 or 1 points, velocity is zero\n return 0\n }\n // if (samples[1].t > samples[0].t) {\n // // Algorithm will still work, but not perfectly\n // consoleWarn('Samples provided to calculateImpulseVelocity in the wrong order')\n // }\n if (samples.length === 2) {\n // if 2 points, basic linear calculation\n if (samples[1].t === samples[0].t) {\n // consoleWarn(`Events have identical time stamps t=${samples[0].t}, setting velocity = 0`)\n return 0\n }\n return (samples[1].d - samples[0].d) / (samples[1].t - samples[0].t)\n }\n // Guaranteed to have at least 3 points here\n // start with the oldest sample and go forward in time\n let work = 0\n for (let i = samples.length - 1; i > 0; i--) {\n if (samples[i].t === samples[i - 1].t) {\n // consoleWarn(`Events have identical time stamps t=${samples[i].t}, skipping sample`)\n continue\n }\n const vprev = kineticEnergyToVelocity(work) // v[i-1]\n const vcurr = (samples[i].d - samples[i - 1].d) / (samples[i].t - samples[i - 1].t) // v[i]\n work += (vcurr - vprev) * Math.abs(vcurr)\n if (i === samples.length - 1) {\n work *= 0.5\n }\n }\n return kineticEnergyToVelocity(work) * 1000\n}\n\nexport function useVelocity () {\n const touches: Record<number, CircularBuffer<[number, Touch]> | undefined> = {}\n\n function addMovement (e: TouchEvent) {\n Array.from(e.changedTouches).forEach(touch => {\n const samples = touches[touch.identifier] ?? (touches[touch.identifier] = new CircularBuffer(HISTORY))\n samples.push([e.timeStamp, touch])\n })\n }\n\n function endTouch (e: TouchEvent) {\n Array.from(e.changedTouches).forEach(touch => {\n delete touches[touch.identifier]\n })\n }\n\n function getVelocity (id: number) {\n const samples = touches[id]?.values().reverse()\n\n if (!samples) {\n throw new Error(`No samples for touch id ${id}`)\n }\n\n const newest = samples[0]\n const x: Sample[] = []\n const y: Sample[] = []\n for (const val of samples) {\n if (newest[0] - val[0] > HORIZON) break\n\n x.push({ t: val[0], d: val[1].clientX })\n y.push({ t: val[0], d: val[1].clientY })\n }\n\n return {\n x: calculateImpulseVelocity(x),\n y: calculateImpulseVelocity(y),\n get direction () {\n const { x, y } = this\n const [absX, absY] = [Math.abs(x), Math.abs(y)]\n\n return absX > absY && x >= 0 ? 'right'\n : absX > absY && x <= 0 ? 'left'\n : absY > absX && y >= 0 ? 'down'\n : absY > absX && y <= 0 ? 'up'\n : oops()\n },\n }\n }\n\n return { addMovement, endTouch, getVelocity }\n}\n\nfunction oops (): never {\n throw new Error()\n}\n"],"file":"touch.mjs"}
|