vuetify 3.0.0-beta.9 → 3.0.1
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/_settings.scss +2 -0
- package/_styles.scss +1 -0
- package/_tools.scss +1 -0
- package/dist/json/attributes.json +3767 -2527
- package/dist/json/importMap.json +14 -18
- package/dist/json/tags.json +475 -56
- package/dist/json/web-types.json +14481 -10795
- package/dist/vuetify.css +1565 -2316
- package/dist/vuetify.d.ts +17610 -6982
- package/dist/vuetify.esm.js +5675 -6283
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +5664 -6273
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +3 -3
- package/dist/vuetify.min.js +1266 -1272
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +163 -0
- package/lib/blueprints/index.mjs.map +1 -1
- package/lib/blueprints/md1.d.ts +159 -0
- package/lib/blueprints/md1.mjs +3 -1
- package/lib/blueprints/md1.mjs.map +1 -1
- package/lib/blueprints/md2.d.ts +159 -0
- package/lib/blueprints/md2.mjs +3 -1
- package/lib/blueprints/md2.mjs.map +1 -1
- package/lib/blueprints/md3.d.ts +159 -0
- package/lib/blueprints/md3.mjs +2 -2
- package/lib/blueprints/md3.mjs.map +1 -1
- package/lib/components/VAlert/VAlert.css +2 -3
- package/lib/components/VAlert/VAlert.mjs +10 -23
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
- package/lib/components/VAlert/index.d.ts +187 -0
- package/lib/components/VAlert/index.mjs.map +1 -1
- package/lib/components/VApp/VApp.css +0 -11
- package/lib/components/VApp/VApp.mjs +5 -7
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VApp/VApp.sass +0 -9
- package/lib/components/VApp/index.d.ts +85 -0
- package/lib/components/VApp/index.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.css +4 -1
- package/lib/components/VAppBar/VAppBar.mjs +7 -11
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBar.sass +3 -0
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +0 -4
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +2 -4
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.ts +160 -0
- package/lib/components/VAppBar/index.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.css +19 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +61 -50
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.sass +11 -1
- package/lib/components/VAutocomplete/_variables.scss +1 -0
- package/lib/components/VAutocomplete/index.d.ts +1754 -0
- package/lib/components/VAutocomplete/index.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.css +45 -2
- package/lib/components/VAvatar/VAvatar.mjs +19 -19
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/VAvatar.sass +6 -1
- package/lib/components/VAvatar/_variables.scss +9 -4
- package/lib/components/VAvatar/index.d.ts +82 -0
- package/lib/components/VAvatar/index.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.mjs +3 -9
- package/lib/components/VBadge/VBadge.mjs.map +1 -1
- package/lib/components/VBadge/index.d.ts +123 -0
- package/lib/components/VBadge/index.mjs.map +1 -1
- package/lib/components/VBanner/VBanner.css +1 -1
- package/lib/components/VBanner/VBanner.mjs +5 -7
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/VBannerActions.mjs +0 -4
- package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
- package/lib/components/VBanner/VBannerText.mjs.map +1 -1
- package/lib/components/VBanner/index.d.ts +126 -0
- package/lib/components/VBanner/index.mjs.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.css +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +3 -6
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.ts +145 -0
- package/lib/components/VBottomNavigation/index.mjs.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.mjs +5 -5
- package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/components/VBottomSheet/index.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +8 -12
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +4 -9
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/index.d.ts +313 -0
- package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.css +14 -10
- package/lib/components/VBtn/VBtn.mjs +22 -20
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/index.d.ts +213 -0
- package/lib/components/VBtn/index.mjs.map +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.css +1 -1
- package/lib/components/VBtnGroup/VBtnGroup.mjs +2 -4
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/index.d.ts +68 -0
- package/lib/components/VBtnGroup/index.mjs.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.mjs +3 -10
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.ts +170 -0
- package/lib/components/VBtnToggle/index.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendar.mjs +6 -67
- package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarCategory.mjs +7 -18
- package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.mjs +3 -34
- package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarMonthly.mjs +3 -7
- package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.mjs +3 -32
- package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
- package/lib/components/VCalendar/index.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-base.mjs +1 -19
- package/lib/components/VCalendar/mixins/calendar-base.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs +16 -84
- package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs +0 -30
- package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.mjs +7 -17
- package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
- package/lib/components/VCalendar/mixins/times.mjs +1 -9
- package/lib/components/VCalendar/mixins/times.mjs.map +1 -1
- package/lib/components/VCalendar/modes/column.mjs +0 -3
- package/lib/components/VCalendar/modes/column.mjs.map +1 -1
- package/lib/components/VCalendar/modes/common.mjs +0 -14
- package/lib/components/VCalendar/modes/common.mjs.map +1 -1
- package/lib/components/VCalendar/modes/index.mjs +0 -1
- package/lib/components/VCalendar/modes/index.mjs.map +1 -1
- package/lib/components/VCalendar/modes/stack.mjs +3 -45
- package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
- package/lib/components/VCalendar/util/events.mjs +0 -1
- package/lib/components/VCalendar/util/events.mjs.map +1 -1
- package/lib/components/VCalendar/util/parser.mjs +3 -4
- package/lib/components/VCalendar/util/parser.mjs.map +1 -1
- package/lib/components/VCalendar/util/props.mjs +0 -13
- package/lib/components/VCalendar/util/props.mjs.map +1 -1
- package/lib/components/VCalendar/util/timestamp.mjs +2 -64
- package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
- package/lib/components/VCard/VCard.css +13 -9
- package/lib/components/VCard/VCard.mjs +6 -11
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCardActions.mjs +0 -4
- package/lib/components/VCard/VCardActions.mjs.map +1 -1
- package/lib/components/VCard/VCardItem.mjs +5 -10
- package/lib/components/VCard/VCardItem.mjs.map +1 -1
- package/lib/components/VCard/VCardSubtitle.mjs.map +1 -1
- package/lib/components/VCard/VCardText.mjs.map +1 -1
- package/lib/components/VCard/VCardTitle.mjs.map +1 -1
- package/lib/components/VCard/index.d.ts +238 -0
- package/lib/components/VCard/index.mjs.map +1 -1
- package/lib/components/VCarousel/VCarousel.mjs +8 -12
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/VCarouselItem.mjs +0 -3
- package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
- package/lib/components/VCarousel/index.d.ts +81 -0
- package/lib/components/VCarousel/index.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.mjs +22 -9
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +7 -15
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +302 -0
- package/lib/components/VCheckbox/index.mjs.map +1 -1
- package/lib/components/VChip/VChip.css +27 -3
- package/lib/components/VChip/VChip.mjs +5 -14
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/VChip.sass +1 -0
- package/lib/components/VChip/index.d.ts +196 -0
- package/lib/components/VChip/index.mjs.map +1 -1
- package/lib/components/VChipGroup/VChipGroup.mjs +5 -6
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.ts +89 -0
- package/lib/components/VChipGroup/index.mjs.map +1 -1
- package/lib/components/VCode/VCode.css +5 -3
- package/lib/components/VCode/VCode.sass +3 -1
- package/lib/components/VCode/_variables.scss +5 -3
- package/lib/components/VCode/index.d.ts +20 -0
- package/lib/components/VCode/index.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.css +3 -3
- package/lib/components/VColorPicker/VColorPicker.mjs +54 -61
- package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +10 -25
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.mjs +6 -10
- package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +14 -24
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs +2 -6
- package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
- package/lib/components/VColorPicker/index.d.ts +116 -0
- package/lib/components/VColorPicker/index.mjs.map +1 -1
- package/lib/components/VColorPicker/util/index.mjs +25 -29
- package/lib/components/VColorPicker/util/index.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.css +14 -1
- package/lib/components/VCombobox/VCombobox.mjs +67 -65
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.sass +5 -0
- package/lib/components/VCombobox/_variables.scss +1 -0
- package/lib/components/VCombobox/index.d.ts +1775 -0
- package/lib/components/VCombobox/index.mjs.map +1 -1
- package/lib/components/VCounter/VCounter.mjs +2 -5
- package/lib/components/VCounter/VCounter.mjs.map +1 -1
- package/lib/components/VCounter/index.d.ts +224 -0
- package/lib/components/VCounter/index.mjs.map +1 -1
- package/lib/components/VData/VData.mjs +9 -67
- package/lib/components/VData/VData.mjs.map +1 -1
- package/lib/components/VData/index.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataFooter.mjs +6 -25
- package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
- package/lib/components/VDataIterator/VDataIterator.mjs +12 -51
- package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
- package/lib/components/VDataIterator/index.mjs.map +1 -1
- package/lib/components/VDataTable/MobileRow.mjs +3 -8
- package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
- package/lib/components/VDataTable/Row.mjs +1 -8
- package/lib/components/VDataTable/Row.mjs.map +1 -1
- package/lib/components/VDataTable/RowGroup.mjs +1 -7
- package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTable.mjs +53 -105
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.mjs +6 -10
- package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs +0 -18
- package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs +0 -9
- package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
- package/lib/components/VDataTable/VEditDialog.mjs +3 -17
- package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
- package/lib/components/VDataTable/VVirtualTable.mjs +3 -28
- package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
- package/lib/components/VDataTable/index.mjs +0 -1
- package/lib/components/VDataTable/index.mjs.map +1 -1
- package/lib/components/VDataTable/mixins/header.mjs +1 -8
- package/lib/components/VDataTable/mixins/header.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.mjs +2 -69
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs +1 -29
- package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.mjs +4 -17
- package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs +1 -12
- package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.mjs +4 -15
- package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +4 -18
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.mjs.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs +6 -33
- package/lib/components/VDatePicker/mixins/date-picker-table.mjs.map +1 -1
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs +0 -5
- package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.mjs +2 -3
- package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
- package/lib/components/VDatePicker/util/index.mjs +0 -1
- package/lib/components/VDatePicker/util/index.mjs.map +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs +1 -1
- package/lib/components/VDatePicker/util/isDateAllowed.mjs.map +1 -1
- package/lib/components/VDatePicker/util/monthChange.mjs +0 -3
- package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
- package/lib/components/VDatePicker/util/pad.mjs +1 -6
- package/lib/components/VDatePicker/util/pad.mjs.map +1 -1
- package/lib/components/VDatePicker/util/sanitizeDateString.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs +2 -4
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/index.d.ts +27 -0
- package/lib/components/VDefaultsProvider/index.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.css +4 -1
- package/lib/components/VDialog/VDialog.mjs +49 -59
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +3 -0
- package/lib/components/VDialog/index.d.ts +1795 -0
- package/lib/components/VDialog/index.mjs.map +1 -1
- package/lib/components/VDivider/VDivider.mjs +2 -8
- package/lib/components/VDivider/VDivider.mjs.map +1 -1
- package/lib/components/VDivider/index.d.ts +23 -0
- package/lib/components/VDivider/index.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.css +11 -6
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs +0 -5
- package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanel.sass +2 -2
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs +2 -6
- package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +3 -8
- package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs +2 -5
- package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
- package/lib/components/VExpansionPanel/index.d.ts +206 -0
- package/lib/components/VExpansionPanel/index.mjs.map +1 -1
- package/lib/components/VField/VField.css +29 -26
- package/lib/components/VField/VField.mjs +36 -35
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/VField.sass +23 -22
- package/lib/components/VField/VFieldLabel.mjs +0 -3
- package/lib/components/VField/VFieldLabel.mjs.map +1 -1
- package/lib/components/VField/index.d.ts +306 -0
- package/lib/components/VField/index.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.css +16 -0
- package/lib/components/VFileInput/VFileInput.mjs +41 -60
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/VFileInput.sass +10 -0
- package/lib/components/VFileInput/_variables.scss +2 -0
- package/lib/components/VFileInput/index.d.ts +477 -0
- package/lib/components/VFileInput/index.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.css +8 -1
- package/lib/components/VFooter/VFooter.mjs +2 -4
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/VFooter.sass +1 -1
- package/lib/components/VFooter/_variables.scss +11 -0
- package/lib/components/VFooter/index.d.ts +77 -0
- package/lib/components/VFooter/index.mjs.map +1 -1
- package/lib/components/VForm/VForm.mjs +2 -13
- package/lib/components/VForm/VForm.mjs.map +1 -1
- package/lib/components/VForm/index.d.ts +81 -0
- package/lib/components/VForm/index.mjs.map +1 -1
- package/lib/components/VGrid/VCol.mjs +8 -23
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VContainer.mjs +2 -4
- package/lib/components/VGrid/VContainer.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +6 -24
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/VSpacer.mjs.map +1 -1
- package/lib/components/VGrid/index.d.ts +156 -0
- package/lib/components/VGrid/index.mjs.map +1 -1
- package/lib/components/VHover/VHover.mjs +0 -4
- package/lib/components/VHover/VHover.mjs.map +1 -1
- package/lib/components/VHover/index.d.ts +31 -0
- package/lib/components/VHover/index.mjs.map +1 -1
- package/lib/components/VIcon/VIcon.mjs +4 -9
- package/lib/components/VIcon/VIcon.mjs.map +1 -1
- package/lib/components/VIcon/index.d.ts +125 -0
- package/lib/components/VIcon/index.mjs.map +1 -1
- package/lib/components/VImg/VImg.mjs +36 -60
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +93 -0
- package/lib/components/VImg/index.mjs.map +1 -1
- package/lib/components/VInput/InputIcon.mjs +31 -0
- package/lib/components/VInput/InputIcon.mjs.map +1 -0
- package/lib/components/VInput/VInput.mjs +20 -20
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.ts +320 -0
- package/lib/components/VInput/index.mjs.map +1 -1
- package/lib/components/VItemGroup/VItem.mjs +0 -5
- package/lib/components/VItemGroup/VItem.mjs.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs +4 -6
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.ts +204 -0
- package/lib/components/VItemGroup/index.mjs.map +1 -1
- package/lib/components/VKbd/VKbd.css +3 -3
- package/lib/components/VKbd/VKbd.sass +2 -2
- package/lib/components/VKbd/index.d.ts +20 -0
- package/lib/components/VKbd/index.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.css +4 -1
- package/lib/components/VLabel/VLabel.mjs +6 -6
- package/lib/components/VLabel/VLabel.mjs.map +1 -1
- package/lib/components/VLabel/VLabel.sass +3 -1
- package/lib/components/VLabel/index.d.ts +16 -0
- package/lib/components/VLabel/index.mjs.map +1 -1
- package/lib/components/VLayout/VLayout.mjs +2 -5
- package/lib/components/VLayout/VLayout.mjs.map +1 -1
- package/lib/components/VLayout/VLayoutItem.mjs +2 -6
- package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
- package/lib/components/VLayout/index.d.ts +78 -0
- package/lib/components/VLayout/index.mjs.map +1 -1
- package/lib/components/VLazy/VLazy.mjs +0 -8
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VLazy/index.d.ts +86 -0
- package/lib/components/VLazy/index.mjs.map +1 -1
- package/lib/components/VList/VList.css +1 -1
- package/lib/components/VList/VList.mjs +76 -24
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListChildren.mjs +22 -31
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +11 -17
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/VListImg.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +12 -8
- package/lib/components/VList/VListItem.mjs +45 -43
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +2 -2
- package/lib/components/VList/VListItemAction.mjs +0 -3
- package/lib/components/VList/VListItemAction.mjs.map +1 -1
- package/lib/components/VList/VListItemMedia.mjs +0 -3
- package/lib/components/VList/VListItemMedia.mjs.map +1 -1
- package/lib/components/VList/VListItemSubtitle.mjs.map +1 -1
- package/lib/components/VList/VListItemTitle.mjs.map +1 -1
- package/lib/components/VList/VListSubheader.mjs +2 -6
- package/lib/components/VList/VListSubheader.mjs.map +1 -1
- package/lib/components/VList/index.d.ts +1253 -0
- package/lib/components/VList/index.mjs.map +1 -1
- package/lib/components/VList/list.mjs +5 -2
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs +4 -9
- package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
- package/lib/components/VLocaleProvider/index.d.ts +24 -0
- package/lib/components/VLocaleProvider/index.mjs.map +1 -1
- package/lib/components/VMain/VMain.css +0 -7
- package/lib/components/VMain/VMain.mjs +2 -5
- package/lib/components/VMain/VMain.mjs.map +1 -1
- package/lib/components/VMain/VMain.sass +0 -8
- package/lib/components/VMain/index.d.ts +27 -0
- package/lib/components/VMain/index.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.css +1 -1
- package/lib/components/VMenu/VMenu.mjs +45 -43
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.ts +1823 -0
- package/lib/components/VMenu/index.mjs.map +1 -1
- package/lib/components/VMenu/shared.mjs.map +1 -1
- package/lib/components/VMessages/VMessages.mjs +2 -6
- package/lib/components/VMessages/VMessages.mjs.map +1 -1
- package/lib/components/VMessages/index.d.ts +235 -0
- package/lib/components/VMessages/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +2 -2
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +6 -11
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +1 -1
- package/lib/components/VNavigationDrawer/_variables.scss +1 -0
- package/lib/components/VNavigationDrawer/index.d.ts +148 -0
- package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/sticky.mjs +1 -7
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/touch.mjs +2 -15
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VNoSsr/VNoSsr.mjs +1 -7
- package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
- package/lib/components/VNoSsr/index.d.ts +8 -0
- package/lib/components/VNoSsr/index.mjs.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.mjs +7 -58
- package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
- package/lib/components/VOtpInput/index.mjs.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs +7 -19
- package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
- package/lib/components/VOverflowBtn/index.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.mjs +50 -54
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.ts +551 -0
- package/lib/components/VOverlay/index.mjs.map +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs +39 -65
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/requestNewFrame.mjs +1 -2
- package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +10 -29
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +29 -29
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VOverlay/util/point.mjs +3 -4
- package/lib/components/VOverlay/util/point.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +20 -30
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/index.d.ts +249 -0
- package/lib/components/VPagination/index.mjs.map +1 -1
- package/lib/components/VParallax/VParallax.mjs +32 -24
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/index.d.ts +18 -0
- package/lib/components/VParallax/index.mjs.map +1 -1
- package/lib/components/VPicker/VPicker.mjs +3 -12
- package/lib/components/VPicker/VPicker.mjs.map +1 -1
- package/lib/components/VPicker/index.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.mjs +2 -5
- package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
- package/lib/components/VProgressCircular/index.d.ts +69 -0
- package/lib/components/VProgressCircular/index.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -8
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VProgressLinear/index.d.ts +102 -0
- package/lib/components/VProgressLinear/index.mjs.map +1 -1
- package/lib/components/VRadio/VRadio.mjs +2 -4
- package/lib/components/VRadio/VRadio.mjs.map +1 -1
- package/lib/components/VRadio/index.d.ts +105 -0
- package/lib/components/VRadio/index.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.css +2 -3
- package/lib/components/VRadioGroup/VRadioGroup.mjs +17 -21
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.sass +2 -2
- package/lib/components/VRadioGroup/_variables.scss +0 -1
- package/lib/components/VRadioGroup/index.d.ts +179 -0
- package/lib/components/VRadioGroup/index.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +24 -27
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.ts +246 -0
- package/lib/components/VRangeSlider/index.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +6 -30
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/index.d.ts +348 -0
- package/lib/components/VRating/index.mjs.map +1 -1
- package/lib/components/VResponsive/VResponsive.mjs +2 -5
- package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
- package/lib/components/VResponsive/index.d.ts +24 -0
- package/lib/components/VResponsive/index.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.css +21 -2
- package/lib/components/VSelect/VSelect.mjs +66 -43
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.sass +16 -1
- package/lib/components/VSelect/_variables.scss +1 -0
- package/lib/components/VSelect/index.d.ts +1718 -0
- package/lib/components/VSelect/index.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs +17 -62
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +259 -0
- package/lib/components/VSelectionControl/index.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +6 -0
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +59 -29
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +6 -0
- package/lib/components/VSelectionControlGroup/index.d.ts +96 -0
- package/lib/components/VSelectionControlGroup/index.mjs.map +1 -1
- package/lib/components/VSheet/VSheet.css +1 -1
- package/lib/components/VSheet/VSheet.mjs +2 -4
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/index.d.ts +69 -0
- package/lib/components/VSheet/index.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs +19 -32
- package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/components/VSkeletonLoader/index.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.mjs +56 -78
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs +5 -9
- package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
- package/lib/components/VSlideGroup/helpers.mjs +4 -17
- package/lib/components/VSlideGroup/helpers.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.ts +434 -0
- package/lib/components/VSlideGroup/index.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.css +7 -2
- package/lib/components/VSlider/VSlider.mjs +19 -12
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSlider.sass +6 -2
- package/lib/components/VSlider/VSliderThumb.css +10 -6
- package/lib/components/VSlider/VSliderThumb.mjs +7 -18
- package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.sass +11 -8
- package/lib/components/VSlider/VSliderTrack.css +20 -20
- package/lib/components/VSlider/VSliderTrack.mjs +16 -14
- package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
- package/lib/components/VSlider/VSliderTrack.sass +14 -14
- package/lib/components/VSlider/_variables.scss +2 -2
- package/lib/components/VSlider/index.d.ts +243 -0
- package/lib/components/VSlider/index.mjs.map +1 -1
- package/lib/components/VSlider/slider.mjs +15 -46
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.css +2 -3
- package/lib/components/VSnackbar/VSnackbar.mjs +51 -60
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.ts +1696 -0
- package/lib/components/VSnackbar/index.mjs.map +1 -1
- package/lib/components/VSparkline/VSparkline.mjs +5 -40
- package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/core.mjs +1 -1
- package/lib/components/VSparkline/helpers/core.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/math.mjs +2 -3
- package/lib/components/VSparkline/helpers/math.mjs.map +1 -1
- package/lib/components/VSparkline/helpers/path.mjs +0 -4
- package/lib/components/VSparkline/helpers/path.mjs.map +1 -1
- package/lib/components/VSparkline/index.mjs.map +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.mjs +3 -12
- package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/components/VSpeedDial/index.mjs.map +1 -1
- package/lib/components/VStepper/VStepper.mjs +5 -24
- package/lib/components/VStepper/VStepper.mjs.map +1 -1
- package/lib/components/VStepper/VStepperContent.mjs +4 -25
- package/lib/components/VStepper/VStepperContent.mjs.map +1 -1
- package/lib/components/VStepper/VStepperStep.mjs +0 -24
- package/lib/components/VStepper/VStepperStep.mjs.map +1 -1
- package/lib/components/VStepper/index.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.css +2 -2
- package/lib/components/VSwitch/VSwitch.mjs +26 -17
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.ts +186 -0
- package/lib/components/VSwitch/index.mjs.map +1 -1
- package/lib/components/VSystemBar/VSystemBar.css +1 -1
- package/lib/components/VSystemBar/VSystemBar.mjs +3 -9
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/index.d.ts +62 -0
- package/lib/components/VSystemBar/index.mjs.map +1 -1
- package/lib/components/VTable/VTable.css +12 -12
- package/lib/components/VTable/VTable.mjs +5 -6
- package/lib/components/VTable/VTable.mjs.map +1 -1
- package/lib/components/VTable/VTable.sass +29 -18
- package/lib/components/VTable/index.d.ts +44 -0
- package/lib/components/VTable/index.mjs.map +1 -1
- package/lib/components/VTabs/VTab.css +3 -1
- package/lib/components/VTabs/VTab.mjs +5 -12
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +3 -1
- package/lib/components/VTabs/VTabs.css +7 -7
- package/lib/components/VTabs/VTabs.mjs +18 -21
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/VTabs.sass +5 -5
- package/lib/components/VTabs/_variables.scss +1 -1
- package/lib/components/VTabs/index.d.ts +187 -0
- package/lib/components/VTabs/index.mjs.map +1 -1
- package/lib/components/VTabs/shared.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.css +2 -3
- package/lib/components/VTextField/VTextField.mjs +54 -56
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +2 -4
- package/lib/components/VTextField/index.d.ts +1807 -0
- package/lib/components/VTextField/index.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.css +5 -3
- package/lib/components/VTextarea/VTextarea.mjs +26 -33
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.sass +5 -4
- package/lib/components/VTextarea/index.d.ts +461 -0
- package/lib/components/VTextarea/index.mjs.map +1 -1
- package/lib/components/VThemeProvider/VThemeProvider.mjs +2 -5
- package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
- package/lib/components/VThemeProvider/index.d.ts +25 -0
- package/lib/components/VThemeProvider/index.mjs.map +1 -1
- package/lib/components/VTimePicker/SelectingTimes.mjs +0 -3
- package/lib/components/VTimePicker/SelectingTimes.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.mjs +3 -53
- package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerClock.mjs +6 -42
- package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
- package/lib/components/VTimePicker/VTimePickerTitle.mjs +4 -13
- package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
- package/lib/components/VTimePicker/index.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.css +77 -41
- package/lib/components/VTimeline/VTimeline.mjs +8 -10
- package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
- package/lib/components/VTimeline/VTimeline.sass +95 -64
- package/lib/components/VTimeline/VTimelineDivider.mjs +2 -7
- package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
- package/lib/components/VTimeline/VTimelineItem.mjs +2 -8
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/_mixins.sass +10 -0
- package/lib/components/VTimeline/_variables.scss +4 -3
- package/lib/components/VTimeline/index.d.ts +158 -0
- package/lib/components/VTimeline/index.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.css +3 -4
- package/lib/components/VToolbar/VToolbar.mjs +3 -11
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbar.sass +0 -1
- package/lib/components/VToolbar/VToolbarItems.mjs +0 -4
- package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
- package/lib/components/VToolbar/VToolbarTitle.mjs +0 -5
- package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
- package/lib/components/VToolbar/_variables.scss +1 -1
- package/lib/components/VToolbar/index.d.ts +377 -0
- package/lib/components/VToolbar/index.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.mjs +46 -57
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/index.d.ts +1789 -0
- package/lib/components/VTooltip/index.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeview.mjs +18 -75
- package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.mjs +2 -32
- package/lib/components/VTreeview/VTreeviewNode.mjs.map +1 -1
- package/lib/components/VTreeview/index.mjs.map +1 -1
- package/lib/components/VTreeview/util/filterTreeItems.mjs +0 -6
- package/lib/components/VTreeview/util/filterTreeItems.mjs.map +1 -1
- package/lib/components/VValidation/VValidation.mjs +2 -5
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.ts +67 -0
- package/lib/components/VValidation/index.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +3 -18
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.mjs.map +1 -1
- package/lib/components/VWindow/VWindow.mjs +6 -22
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindowItem.mjs +8 -21
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/index.d.ts +378 -0
- package/lib/components/VWindow/index.mjs.map +1 -1
- package/lib/components/index.d.ts +15918 -5527
- package/lib/components/index.mjs +0 -11
- package/lib/components/index.mjs.map +1 -1
- package/lib/components/transitions/createTransition.mjs +0 -10
- package/lib/components/transitions/createTransition.mjs.map +1 -1
- package/lib/components/transitions/dialog-transition.mjs +8 -23
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/expand-transition.mjs +2 -11
- package/lib/components/transitions/expand-transition.mjs.map +1 -1
- package/lib/components/transitions/index.d.ts +470 -0
- package/lib/components/transitions/index.mjs +5 -4
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/border.mjs +0 -3
- package/lib/composables/border.mjs.map +1 -1
- package/lib/composables/color.mjs +0 -4
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +1 -6
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/delay.mjs +1 -6
- package/lib/composables/delay.mjs.map +1 -1
- package/lib/composables/density.mjs +4 -1
- package/lib/composables/density.mjs.map +1 -1
- package/lib/composables/dimensions.mjs +0 -1
- package/lib/composables/dimensions.mjs.map +1 -1
- package/lib/composables/display.mjs +8 -21
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/elevation.mjs +2 -4
- package/lib/composables/elevation.mjs.map +1 -1
- package/lib/composables/filter.mjs +11 -20
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/focus.mjs +0 -5
- package/lib/composables/focus.mjs.map +1 -1
- package/lib/composables/form.mjs +8 -16
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/forwardRefs.mjs +9 -16
- package/lib/composables/forwardRefs.mjs.map +1 -1
- package/lib/composables/group.mjs +11 -38
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/hydration.mjs +8 -5
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/icons.mjs +11 -21
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/composables/index.mjs +1 -2
- package/lib/composables/index.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs +0 -3
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/items.mjs +5 -17
- package/lib/composables/items.mjs.map +1 -1
- package/lib/composables/layout.mjs +31 -37
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs +2 -3
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/loader.mjs +0 -3
- package/lib/composables/loader.mjs.map +1 -1
- package/lib/composables/locale.mjs +48 -127
- package/lib/composables/locale.mjs.map +1 -1
- package/lib/composables/location.mjs +1 -8
- package/lib/composables/location.mjs.map +1 -1
- package/lib/composables/mutationObserver.mjs +7 -7
- package/lib/composables/mutationObserver.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +21 -38
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/nested/openStrategies.mjs +0 -9
- package/lib/composables/nested/openStrategies.mjs.map +1 -1
- package/lib/composables/nested/selectStrategies.mjs +6 -21
- package/lib/composables/nested/selectStrategies.mjs.map +1 -1
- package/lib/composables/position.mjs +1 -4
- package/lib/composables/position.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +28 -16
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/refs.mjs +0 -2
- package/lib/composables/refs.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs +0 -3
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/rounded.mjs +0 -3
- package/lib/composables/rounded.mjs.map +1 -1
- package/lib/composables/router.mjs +14 -14
- package/lib/composables/router.mjs.map +1 -1
- package/lib/composables/scopeId.mjs.map +1 -1
- package/lib/composables/scroll.mjs +4 -12
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/selectLink.mjs +7 -6
- package/lib/composables/selectLink.mjs.map +1 -1
- package/lib/composables/size.mjs +0 -3
- package/lib/composables/size.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +2 -1
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +0 -6
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/tag.mjs +0 -1
- package/lib/composables/tag.mjs.map +1 -1
- package/lib/composables/teleport.mjs +0 -4
- package/lib/composables/teleport.mjs.map +1 -1
- package/lib/composables/theme.mjs +65 -81
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +0 -1
- package/lib/composables/toggleScope.mjs.map +1 -1
- package/lib/composables/touch.mjs +6 -31
- package/lib/composables/touch.mjs.map +1 -1
- package/lib/composables/transition.mjs +0 -4
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +29 -27
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/variant.mjs +0 -2
- package/lib/composables/variant.mjs.map +1 -1
- package/lib/directives/click-outside/index.mjs +10 -22
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/color/index.mjs +0 -11
- package/lib/directives/color/index.mjs.map +1 -1
- package/lib/directives/index.d.ts +104 -13
- package/lib/directives/index.mjs +0 -1
- package/lib/directives/index.mjs.map +1 -1
- package/lib/directives/intersect/index.mjs +3 -10
- package/lib/directives/intersect/index.mjs.map +1 -1
- package/lib/directives/mutate/index.mjs +5 -11
- package/lib/directives/mutate/index.mjs.map +1 -1
- package/lib/directives/resize/index.mjs +0 -5
- package/lib/directives/resize/index.mjs.map +1 -1
- package/lib/directives/ripple/index.mjs +12 -66
- package/lib/directives/ripple/index.mjs.map +1 -1
- package/lib/directives/scroll/index.mjs +1 -7
- package/lib/directives/scroll/index.mjs.map +1 -1
- package/lib/directives/touch/index.mjs +3 -18
- package/lib/directives/touch/index.mjs.map +1 -1
- package/lib/entry-bundler.mjs +2 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +66 -61
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa-svg.mjs +0 -1
- package/lib/iconsets/fa-svg.mjs.map +1 -1
- package/lib/iconsets/fa.mjs +0 -1
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.mjs +4 -3
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.mjs +4 -3
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.mjs +1 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.mjs +4 -3
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.ts +106 -107
- package/lib/locale/adapters/vue-i18n.d.ts +29 -0
- package/lib/locale/adapters/vue-i18n.mjs +59 -54
- package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
- package/lib/locale/adapters/vuetify.d.ts +24 -0
- package/lib/locale/adapters/vuetify.mjs +97 -0
- package/lib/locale/adapters/vuetify.mjs.map +1 -0
- package/lib/locale/af.mjs +5 -0
- package/lib/locale/af.mjs.map +1 -1
- package/lib/locale/ar.mjs +5 -0
- package/lib/locale/ar.mjs.map +1 -1
- package/lib/locale/az.mjs +5 -0
- package/lib/locale/az.mjs.map +1 -1
- package/lib/locale/bg.mjs +5 -0
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/ca.mjs +5 -0
- package/lib/locale/ca.mjs.map +1 -1
- package/lib/locale/ckb.mjs +5 -0
- package/lib/locale/ckb.mjs.map +1 -1
- package/lib/locale/cs.mjs +5 -0
- package/lib/locale/cs.mjs.map +1 -1
- package/lib/locale/da.mjs +5 -0
- package/lib/locale/da.mjs.map +1 -1
- package/lib/locale/de.mjs +5 -0
- package/lib/locale/de.mjs.map +1 -1
- package/lib/locale/el.mjs +5 -0
- package/lib/locale/el.mjs.map +1 -1
- package/lib/locale/en.mjs +5 -0
- package/lib/locale/en.mjs.map +1 -1
- package/lib/locale/es.mjs +5 -0
- package/lib/locale/es.mjs.map +1 -1
- package/lib/locale/et.mjs +5 -0
- package/lib/locale/et.mjs.map +1 -1
- package/lib/locale/fa.mjs +5 -0
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/locale/fi.mjs +5 -0
- package/lib/locale/fi.mjs.map +1 -1
- package/lib/locale/fr.mjs +5 -0
- package/lib/locale/fr.mjs.map +1 -1
- package/lib/locale/he.mjs +5 -0
- package/lib/locale/he.mjs.map +1 -1
- package/lib/locale/hr.mjs +5 -0
- package/lib/locale/hr.mjs.map +1 -1
- package/lib/locale/hu.mjs +5 -0
- package/lib/locale/hu.mjs.map +1 -1
- package/lib/locale/id.mjs +5 -0
- package/lib/locale/id.mjs.map +1 -1
- package/lib/locale/index.d.ts +212 -2
- package/lib/locale/index.mjs +1 -1
- package/lib/locale/index.mjs.map +1 -1
- package/lib/locale/it.mjs +5 -0
- package/lib/locale/it.mjs.map +1 -1
- package/lib/locale/ja.mjs +5 -0
- package/lib/locale/ja.mjs.map +1 -1
- package/lib/locale/ko.mjs +5 -0
- package/lib/locale/ko.mjs.map +1 -1
- package/lib/locale/lt.mjs +5 -0
- package/lib/locale/lt.mjs.map +1 -1
- package/lib/locale/lv.mjs +5 -0
- package/lib/locale/lv.mjs.map +1 -1
- package/lib/locale/nl.mjs +5 -0
- package/lib/locale/nl.mjs.map +1 -1
- package/lib/locale/no.mjs +5 -0
- package/lib/locale/no.mjs.map +1 -1
- package/lib/locale/pl.mjs +9 -4
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/locale/pt.mjs +5 -0
- package/lib/locale/pt.mjs.map +1 -1
- package/lib/locale/ro.mjs +5 -0
- package/lib/locale/ro.mjs.map +1 -1
- package/lib/locale/ru.mjs +5 -0
- package/lib/locale/ru.mjs.map +1 -1
- package/lib/locale/sk.mjs +5 -0
- package/lib/locale/sk.mjs.map +1 -1
- package/lib/locale/sl.mjs +5 -0
- package/lib/locale/sl.mjs.map +1 -1
- package/lib/locale/sr-Cyrl.mjs +5 -0
- package/lib/locale/sr-Cyrl.mjs.map +1 -1
- package/lib/locale/sr-Latn.mjs +5 -0
- package/lib/locale/sr-Latn.mjs.map +1 -1
- package/lib/locale/sv.mjs +5 -0
- package/lib/locale/sv.mjs.map +1 -1
- package/lib/locale/th.mjs +5 -0
- package/lib/locale/th.mjs.map +1 -1
- package/lib/locale/tr.mjs +5 -0
- package/lib/locale/tr.mjs.map +1 -1
- package/lib/locale/uk.mjs +5 -0
- package/lib/locale/uk.mjs.map +1 -1
- package/lib/locale/vi.mjs +5 -0
- package/lib/locale/vi.mjs.map +1 -1
- package/lib/locale/zh-Hans.mjs +5 -0
- package/lib/locale/zh-Hans.mjs.map +1 -1
- package/lib/locale/zh-Hant.mjs +5 -0
- package/lib/locale/zh-Hant.mjs.map +1 -1
- package/lib/services/goto/easing-patterns.mjs +24 -24
- package/lib/services/goto/easing-patterns.mjs.map +1 -1
- package/lib/services/goto/index.mjs +11 -15
- package/lib/services/goto/index.mjs.map +1 -1
- package/lib/services/goto/util.mjs +1 -8
- package/lib/services/goto/util.mjs.map +1 -1
- package/lib/styles/main.css +105 -101
- package/lib/styles/settings/_colors.scss +84 -84
- package/lib/styles/settings/_elevations.scss +3 -3
- package/lib/styles/settings/_utilities.scss +11 -4
- package/lib/styles/tools/_states.sass +8 -3
- package/lib/styles/tools/_variant.sass +0 -1
- package/lib/util/anchor.mjs +0 -3
- package/lib/util/anchor.mjs.map +1 -1
- package/lib/util/animation.mjs +14 -4
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/box.mjs +0 -5
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/color/APCA.mjs +23 -21
- package/lib/util/color/APCA.mjs.map +1 -1
- package/lib/util/color/transformCIELAB.mjs +0 -2
- package/lib/util/color/transformCIELAB.mjs.map +1 -1
- package/lib/util/color/transformSRGB.mjs +14 -12
- package/lib/util/color/transformSRGB.mjs.map +1 -1
- package/lib/util/colorUtils.mjs +8 -25
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/colors.mjs.map +1 -1
- package/lib/util/console.mjs +5 -14
- package/lib/util/console.mjs.map +1 -1
- package/lib/util/createSimpleFunctional.mjs +1 -4
- package/lib/util/createSimpleFunctional.mjs.map +1 -1
- package/lib/util/dateTimeUtils.mjs +0 -10
- package/lib/util/dateTimeUtils.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +13 -37
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/dom.mjs +4 -4
- package/lib/util/dom.mjs.map +1 -1
- package/lib/util/easing.mjs +0 -1
- package/lib/util/easing.mjs.map +1 -1
- package/lib/util/getCurrentInstance.mjs +3 -10
- package/lib/util/getCurrentInstance.mjs.map +1 -1
- package/lib/util/getScrollParent.mjs +3 -4
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/lib/util/globals.mjs +1 -1
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +55 -86
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +0 -1
- package/lib/util/injectSelf.mjs.map +1 -1
- package/lib/util/isFixedPosition.mjs +0 -2
- package/lib/util/isFixedPosition.mjs.map +1 -1
- package/lib/util/propsFactory.mjs +4 -5
- package/lib/util/propsFactory.mjs.map +1 -1
- package/lib/util/useRender.mjs +0 -1
- package/lib/util/useRender.mjs.map +1 -1
- package/package.json +17 -19
- package/lib/composables/rtl.mjs +0 -44
- package/lib/composables/rtl.mjs.map +0 -1
- package/lib/locale/adapters/vue-intl.mjs +0 -67
- package/lib/locale/adapters/vue-intl.mjs.map +0 -1
- package/lib/styles.scss +0 -4
package/lib/util/box.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.mjs","names":["Box","constructor","x","y","width","height","top","bottom","left","right","getOverflow","a","b","before","Math","max","after"],"sources":["../../src/util/box.ts"],"sourcesContent":["export class Box {\n x: number\n y: number\n width: number\n height: number\n\n constructor ({ x, y, width, height }: {\n x: number\n y: number\n width: number\n height: number\n }) {\n this.x = x\n this.y = y\n this.width = width\n this.height = height\n }\n\n get top () { return this.y }\n get bottom () { return this.y + this.height }\n get left () { return this.x }\n get right () { return this.x + this.width }\n}\n\nexport function getOverflow (a: Box, b: Box) {\n return {\n x: {\n before: Math.max(0, b.left - a.left),\n after: Math.max(0, a.right - b.right),\n },\n y: {\n before: Math.max(0, b.top - a.top),\n after: Math.max(0, a.bottom - b.bottom),\n },\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,
|
|
1
|
+
{"version":3,"file":"box.mjs","names":["Box","constructor","x","y","width","height","top","bottom","left","right","getOverflow","a","b","before","Math","max","after"],"sources":["../../src/util/box.ts"],"sourcesContent":["export class Box {\n x: number\n y: number\n width: number\n height: number\n\n constructor ({ x, y, width, height }: {\n x: number\n y: number\n width: number\n height: number\n }) {\n this.x = x\n this.y = y\n this.width = width\n this.height = height\n }\n\n get top () { return this.y }\n get bottom () { return this.y + this.height }\n get left () { return this.x }\n get right () { return this.x + this.width }\n}\n\nexport function getOverflow (a: Box, b: Box) {\n return {\n x: {\n before: Math.max(0, b.left - a.left),\n after: Math.max(0, a.right - b.right),\n },\n y: {\n before: Math.max(0, b.top - a.top),\n after: Math.max(0, a.bottom - b.bottom),\n },\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,GAAG,CAAC;EAMfC,WAAW,OAKR;IAAA,IALU;MAAEC,CAAC;MAAEC,CAAC;MAAEC,KAAK;MAAEC;IAK5B,CAAC;IACC,IAAI,CAACH,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACtB;EAEA,IAAIC,GAAG,GAAI;IAAE,OAAO,IAAI,CAACH,CAAC;EAAC;EAC3B,IAAII,MAAM,GAAI;IAAE,OAAO,IAAI,CAACJ,CAAC,GAAG,IAAI,CAACE,MAAM;EAAC;EAC5C,IAAIG,IAAI,GAAI;IAAE,OAAO,IAAI,CAACN,CAAC;EAAC;EAC5B,IAAIO,KAAK,GAAI;IAAE,OAAO,IAAI,CAACP,CAAC,GAAG,IAAI,CAACE,KAAK;EAAC;AAC5C;AAEA,OAAO,SAASM,WAAW,CAAEC,CAAM,EAAEC,CAAM,EAAE;EAC3C,OAAO;IACLV,CAAC,EAAE;MACDW,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,CAAC,CAACJ,IAAI,GAAGG,CAAC,CAACH,IAAI,CAAC;MACpCQ,KAAK,EAAEF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEJ,CAAC,CAACF,KAAK,GAAGG,CAAC,CAACH,KAAK;IACtC,CAAC;IACDN,CAAC,EAAE;MACDU,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,CAAC,CAACN,GAAG,GAAGK,CAAC,CAACL,GAAG,CAAC;MAClCU,KAAK,EAAEF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEJ,CAAC,CAACJ,MAAM,GAAGK,CAAC,CAACL,MAAM;IACxC;EACF,CAAC;AACH"}
|
package/lib/util/color/APCA.mjs
CHANGED
|
@@ -3,44 +3,40 @@
|
|
|
3
3
|
* @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
|
4
4
|
* @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup
|
|
5
5
|
*/
|
|
6
|
+
|
|
6
7
|
// MAGICAL NUMBERS
|
|
8
|
+
|
|
7
9
|
// sRGB Conversion to Relative Luminance (Y)
|
|
10
|
+
|
|
8
11
|
// Transfer Curve (aka "Gamma") for sRGB linearization
|
|
9
12
|
// Simple power curve vs piecewise described in docs
|
|
10
13
|
// Essentially, 2.4 best models actual display
|
|
11
14
|
// characteristics in combination with the total method
|
|
12
15
|
const mainTRC = 2.4;
|
|
13
16
|
const Rco = 0.2126729; // sRGB Red Coefficient (from matrix)
|
|
14
|
-
|
|
15
17
|
const Gco = 0.7151522; // sRGB Green Coefficient (from matrix)
|
|
16
|
-
|
|
17
18
|
const Bco = 0.0721750; // sRGB Blue Coefficient (from matrix)
|
|
19
|
+
|
|
18
20
|
// For Finding Raw SAPC Contrast from Relative Luminance (Y)
|
|
21
|
+
|
|
19
22
|
// Constants for SAPC Power Curve Exponents
|
|
20
23
|
// One pair for normal text, and one for reverse
|
|
21
24
|
// These are the "beating heart" of SAPC
|
|
22
|
-
|
|
23
25
|
const normBG = 0.55;
|
|
24
26
|
const normTXT = 0.58;
|
|
25
27
|
const revTXT = 0.57;
|
|
26
|
-
const revBG = 0.62;
|
|
28
|
+
const revBG = 0.62;
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
// For Clamping and Scaling Values
|
|
29
31
|
|
|
32
|
+
const blkThrs = 0.03; // Level that triggers the soft black clamp
|
|
30
33
|
const blkClmp = 1.45; // Exponent for the soft black clamp curve
|
|
31
|
-
|
|
32
34
|
const deltaYmin = 0.0005; // Lint trap
|
|
33
|
-
|
|
34
35
|
const scaleBoW = 1.25; // Scaling for dark text on light
|
|
35
|
-
|
|
36
36
|
const scaleWoB = 1.25; // Scaling for light text on dark
|
|
37
|
-
|
|
38
37
|
const loConThresh = 0.078; // Threshold for new simple offset scale
|
|
39
|
-
|
|
40
38
|
const loConFactor = 12.82051282051282; // = 1/0.078,
|
|
41
|
-
|
|
42
39
|
const loConOffset = 0.06; // The simple offset
|
|
43
|
-
|
|
44
40
|
const loClip = 0.001; // Output clip (lint trap #2)
|
|
45
41
|
|
|
46
42
|
export function APCAcontrast(text, background) {
|
|
@@ -50,36 +46,42 @@ export function APCAcontrast(text, background) {
|
|
|
50
46
|
const Btxt = ((text >> 0 & 0xff) / 255) ** mainTRC;
|
|
51
47
|
const Rbg = ((background >> 16 & 0xff) / 255) ** mainTRC;
|
|
52
48
|
const Gbg = ((background >> 8 & 0xff) / 255) ** mainTRC;
|
|
53
|
-
const Bbg = ((background >> 0 & 0xff) / 255) ** mainTRC;
|
|
49
|
+
const Bbg = ((background >> 0 & 0xff) / 255) ** mainTRC;
|
|
54
50
|
|
|
51
|
+
// Apply the standard coefficients and sum to Y
|
|
55
52
|
let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
|
|
56
|
-
let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
|
|
57
|
-
// Now clamping all colors to prevent crossover errors
|
|
53
|
+
let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
|
|
58
54
|
|
|
55
|
+
// Soft clamp Y when near black.
|
|
56
|
+
// Now clamping all colors to prevent crossover errors
|
|
59
57
|
if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
|
|
60
|
-
if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
|
|
58
|
+
if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
|
|
61
59
|
|
|
62
|
-
|
|
60
|
+
// Return 0 Early for extremely low ∆Y (lint trap #1)
|
|
61
|
+
if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0;
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
// SAPC CONTRAST
|
|
65
64
|
|
|
65
|
+
let outputContrast; // For weighted final values
|
|
66
66
|
if (Ybg > Ytxt) {
|
|
67
67
|
// For normal polarity, black text on white
|
|
68
68
|
// Calculate the SAPC contrast value and scale
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
|
|
71
|
+
|
|
72
|
+
// NEW! SAPC SmoothScale™
|
|
70
73
|
// Low Contrast Smooth Scale Rollout to prevent polarity reversal
|
|
71
74
|
// and also a low clip for very low contrasts (lint trap #2)
|
|
72
75
|
// much of this is for very low contrasts, less than 10
|
|
73
76
|
// therefore for most reversing needs, only loConOffset is important
|
|
74
|
-
|
|
75
77
|
outputContrast = SAPC < loClip ? 0.0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
|
|
76
78
|
} else {
|
|
77
79
|
// For reverse polarity, light text on dark
|
|
78
80
|
// WoB should always return negative value.
|
|
81
|
+
|
|
79
82
|
const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
|
|
80
83
|
outputContrast = SAPC > -loClip ? 0.0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
|
|
81
84
|
}
|
|
82
|
-
|
|
83
85
|
return outputContrast * 100;
|
|
84
86
|
}
|
|
85
87
|
//# sourceMappingURL=APCA.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APCA.mjs","names":["mainTRC","Rco","Gco","Bco","normBG","normTXT","revTXT","revBG","blkThrs","blkClmp","deltaYmin","scaleBoW","scaleWoB","loConThresh","loConFactor","loConOffset","loClip","APCAcontrast","text","background","Rtxt","Gtxt","Btxt","Rbg","Gbg","Bbg","Ytxt","Ybg","Math","abs","outputContrast","SAPC"],"sources":["../../../src/util/color/APCA.ts"],"sourcesContent":["/**\n * WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA\n * @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n * @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup\n */\n\n// MAGICAL NUMBERS\n\n// sRGB Conversion to Relative Luminance (Y)\n\n// Transfer Curve (aka \"Gamma\") for sRGB linearization\n// Simple power curve vs piecewise described in docs\n// Essentially, 2.4 best models actual display\n// characteristics in combination with the total method\nconst mainTRC = 2.4\n\nconst Rco = 0.2126729 // sRGB Red Coefficient (from matrix)\nconst Gco = 0.7151522 // sRGB Green Coefficient (from matrix)\nconst Bco = 0.0721750 // sRGB Blue Coefficient (from matrix)\n\n// For Finding Raw SAPC Contrast from Relative Luminance (Y)\n\n// Constants for SAPC Power Curve Exponents\n// One pair for normal text, and one for reverse\n// These are the \"beating heart\" of SAPC\nconst normBG = 0.55\nconst normTXT = 0.58\nconst revTXT = 0.57\nconst revBG = 0.62\n\n// For Clamping and Scaling Values\n\nconst blkThrs = 0.03 // Level that triggers the soft black clamp\nconst blkClmp = 1.45 // Exponent for the soft black clamp curve\nconst deltaYmin = 0.0005 // Lint trap\nconst scaleBoW = 1.25 // Scaling for dark text on light\nconst scaleWoB = 1.25 // Scaling for light text on dark\nconst loConThresh = 0.078 // Threshold for new simple offset scale\nconst loConFactor = 12.82051282051282 // = 1/0.078,\nconst loConOffset = 0.06 // The simple offset\nconst loClip = 0.001 // Output clip (lint trap #2)\n\nexport function APCAcontrast (text: number, background: number) {\n // Linearize sRGB\n const Rtxt = ((text >> 16 & 0xff) / 255) ** mainTRC\n const Gtxt = ((text >> 8 & 0xff) / 255) ** mainTRC\n const Btxt = ((text >> 0 & 0xff) / 255) ** mainTRC\n\n const Rbg = ((background >> 16 & 0xff) / 255) ** mainTRC\n const Gbg = ((background >> 8 & 0xff) / 255) ** mainTRC\n const Bbg = ((background >> 0 & 0xff) / 255) ** mainTRC\n\n // Apply the standard coefficients and sum to Y\n let Ytxt = (Rtxt * Rco) + (Gtxt * Gco) + (Btxt * Bco)\n let Ybg = (Rbg * Rco) + (Gbg * Gco) + (Bbg * Bco)\n\n // Soft clamp Y when near black.\n // Now clamping all colors to prevent crossover errors\n if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp\n if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp\n\n // Return 0 Early for extremely low ∆Y (lint trap #1)\n if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0\n\n // SAPC CONTRAST\n\n let outputContrast: number // For weighted final values\n if (Ybg > Ytxt) {\n // For normal polarity, black text on white\n // Calculate the SAPC contrast value and scale\n\n const SAPC = ((Ybg ** normBG) - (Ytxt ** normTXT)) * scaleBoW\n\n // NEW! SAPC SmoothScale™\n // Low Contrast Smooth Scale Rollout to prevent polarity reversal\n // and also a low clip for very low contrasts (lint trap #2)\n // much of this is for very low contrasts, less than 10\n // therefore for most reversing needs, only loConOffset is important\n outputContrast =\n (SAPC < loClip) ? 0.0\n : (SAPC < loConThresh) ? SAPC - SAPC * loConFactor * loConOffset\n : SAPC - loConOffset\n } else {\n // For reverse polarity, light text on dark\n // WoB should always return negative value.\n\n const SAPC = ((Ybg ** revBG) - (Ytxt ** revTXT)) * scaleWoB\n\n outputContrast =\n (SAPC > -loClip) ? 0.0\n : (SAPC > -loConThresh) ? SAPC - SAPC * loConFactor * loConOffset\n : SAPC + loConOffset\n }\n\n return outputContrast * 100\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"APCA.mjs","names":["mainTRC","Rco","Gco","Bco","normBG","normTXT","revTXT","revBG","blkThrs","blkClmp","deltaYmin","scaleBoW","scaleWoB","loConThresh","loConFactor","loConOffset","loClip","APCAcontrast","text","background","Rtxt","Gtxt","Btxt","Rbg","Gbg","Bbg","Ytxt","Ybg","Math","abs","outputContrast","SAPC"],"sources":["../../../src/util/color/APCA.ts"],"sourcesContent":["/**\n * WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA\n * @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n * @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup\n */\n\n// MAGICAL NUMBERS\n\n// sRGB Conversion to Relative Luminance (Y)\n\n// Transfer Curve (aka \"Gamma\") for sRGB linearization\n// Simple power curve vs piecewise described in docs\n// Essentially, 2.4 best models actual display\n// characteristics in combination with the total method\nconst mainTRC = 2.4\n\nconst Rco = 0.2126729 // sRGB Red Coefficient (from matrix)\nconst Gco = 0.7151522 // sRGB Green Coefficient (from matrix)\nconst Bco = 0.0721750 // sRGB Blue Coefficient (from matrix)\n\n// For Finding Raw SAPC Contrast from Relative Luminance (Y)\n\n// Constants for SAPC Power Curve Exponents\n// One pair for normal text, and one for reverse\n// These are the \"beating heart\" of SAPC\nconst normBG = 0.55\nconst normTXT = 0.58\nconst revTXT = 0.57\nconst revBG = 0.62\n\n// For Clamping and Scaling Values\n\nconst blkThrs = 0.03 // Level that triggers the soft black clamp\nconst blkClmp = 1.45 // Exponent for the soft black clamp curve\nconst deltaYmin = 0.0005 // Lint trap\nconst scaleBoW = 1.25 // Scaling for dark text on light\nconst scaleWoB = 1.25 // Scaling for light text on dark\nconst loConThresh = 0.078 // Threshold for new simple offset scale\nconst loConFactor = 12.82051282051282 // = 1/0.078,\nconst loConOffset = 0.06 // The simple offset\nconst loClip = 0.001 // Output clip (lint trap #2)\n\nexport function APCAcontrast (text: number, background: number) {\n // Linearize sRGB\n const Rtxt = ((text >> 16 & 0xff) / 255) ** mainTRC\n const Gtxt = ((text >> 8 & 0xff) / 255) ** mainTRC\n const Btxt = ((text >> 0 & 0xff) / 255) ** mainTRC\n\n const Rbg = ((background >> 16 & 0xff) / 255) ** mainTRC\n const Gbg = ((background >> 8 & 0xff) / 255) ** mainTRC\n const Bbg = ((background >> 0 & 0xff) / 255) ** mainTRC\n\n // Apply the standard coefficients and sum to Y\n let Ytxt = (Rtxt * Rco) + (Gtxt * Gco) + (Btxt * Bco)\n let Ybg = (Rbg * Rco) + (Gbg * Gco) + (Bbg * Bco)\n\n // Soft clamp Y when near black.\n // Now clamping all colors to prevent crossover errors\n if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp\n if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp\n\n // Return 0 Early for extremely low ∆Y (lint trap #1)\n if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0\n\n // SAPC CONTRAST\n\n let outputContrast: number // For weighted final values\n if (Ybg > Ytxt) {\n // For normal polarity, black text on white\n // Calculate the SAPC contrast value and scale\n\n const SAPC = ((Ybg ** normBG) - (Ytxt ** normTXT)) * scaleBoW\n\n // NEW! SAPC SmoothScale™\n // Low Contrast Smooth Scale Rollout to prevent polarity reversal\n // and also a low clip for very low contrasts (lint trap #2)\n // much of this is for very low contrasts, less than 10\n // therefore for most reversing needs, only loConOffset is important\n outputContrast =\n (SAPC < loClip) ? 0.0\n : (SAPC < loConThresh) ? SAPC - SAPC * loConFactor * loConOffset\n : SAPC - loConOffset\n } else {\n // For reverse polarity, light text on dark\n // WoB should always return negative value.\n\n const SAPC = ((Ybg ** revBG) - (Ytxt ** revTXT)) * scaleWoB\n\n outputContrast =\n (SAPC > -loClip) ? 0.0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AAQ;IAE3DkB,cAAc,GACXC,IAAI,GAAG,CAACf,MAAM,GAAI,GAAG,GACnBe,IAAI,GAAG,CAAClB,WAAW,GAAIkB,IAAI,GAAGA,IAAI,GAAGjB,WAAW,GAAGC,WAAW,GAC/DgB,IAAI,GAAGhB,WAAW;EACxB;EAEA,OAAOe,cAAc,GAAG,GAAG;AAC7B"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
const delta = 0.20689655172413793; // 6÷29
|
|
2
2
|
|
|
3
3
|
const cielabForwardTransform = t => t > delta ** 3 ? Math.cbrt(t) : t / (3 * delta ** 2) + 4 / 29;
|
|
4
|
-
|
|
5
4
|
const cielabReverseTransform = t => t > delta ? t ** 3 : 3 * delta ** 2 * (t - 4 / 29);
|
|
6
|
-
|
|
7
5
|
export function fromXYZ(xyz) {
|
|
8
6
|
const transform = cielabForwardTransform;
|
|
9
7
|
const transformedY = transform(xyz[1]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformCIELAB.mjs","names":["delta","cielabForwardTransform","t","Math","cbrt","cielabReverseTransform","fromXYZ","xyz","transform","transformedY","toXYZ","lab","Ln"],"sources":["../../../src/util/color/transformCIELAB.ts"],"sourcesContent":["import type { LAB, XYZ } from '../colorUtils'\n\nconst delta = 0.20689655172413793 // 6÷29\n\nconst cielabForwardTransform = (t: number): number => (\n t > delta ** 3\n ? Math.cbrt(t)\n : (t / (3 * delta ** 2)) + 4 / 29\n)\n\nconst cielabReverseTransform = (t: number): number => (\n t > delta\n ? t ** 3\n : (3 * delta ** 2) * (t - 4 / 29)\n)\n\nexport function fromXYZ (xyz: XYZ): LAB {\n const transform = cielabForwardTransform\n const transformedY = transform(xyz[1])\n\n return [\n 116 * transformedY - 16,\n 500 * (transform(xyz[0] / 0.95047) - transformedY),\n 200 * (transformedY - transform(xyz[2] / 1.08883)),\n ]\n}\n\nexport function toXYZ (lab: LAB): XYZ {\n const transform = cielabReverseTransform\n const Ln = (lab[0] + 16) / 116\n return [\n transform(Ln + lab[1] / 500) * 0.95047,\n transform(Ln),\n transform(Ln - lab[2] / 200) * 1.08883,\n ]\n}\n"],"mappings":"AAEA,MAAMA,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"transformCIELAB.mjs","names":["delta","cielabForwardTransform","t","Math","cbrt","cielabReverseTransform","fromXYZ","xyz","transform","transformedY","toXYZ","lab","Ln"],"sources":["../../../src/util/color/transformCIELAB.ts"],"sourcesContent":["import type { LAB, XYZ } from '../colorUtils'\n\nconst delta = 0.20689655172413793 // 6÷29\n\nconst cielabForwardTransform = (t: number): number => (\n t > delta ** 3\n ? Math.cbrt(t)\n : (t / (3 * delta ** 2)) + 4 / 29\n)\n\nconst cielabReverseTransform = (t: number): number => (\n t > delta\n ? t ** 3\n : (3 * delta ** 2) * (t - 4 / 29)\n)\n\nexport function fromXYZ (xyz: XYZ): LAB {\n const transform = cielabForwardTransform\n const transformedY = transform(xyz[1])\n\n return [\n 116 * transformedY - 16,\n 500 * (transform(xyz[0] / 0.95047) - transformedY),\n 200 * (transformedY - transform(xyz[2] / 1.08883)),\n ]\n}\n\nexport function toXYZ (lab: LAB): XYZ {\n const transform = cielabReverseTransform\n const Ln = (lab[0] + 16) / 116\n return [\n transform(Ln + lab[1] / 500) * 0.95047,\n transform(Ln),\n transform(Ln - lab[2] / 200) * 1.08883,\n ]\n}\n"],"mappings":"AAEA,MAAMA,KAAK,GAAG,mBAAmB,EAAC;;AAElC,MAAMC,sBAAsB,GAAIC,CAAS,IACvCA,CAAC,GAAGF,KAAK,IAAI,CAAC,GACVG,IAAI,CAACC,IAAI,CAACF,CAAC,CAAC,GACXA,CAAC,IAAI,CAAC,GAAGF,KAAK,IAAI,CAAC,CAAC,GAAI,CAAC,GAAG,EAClC;AAED,MAAMK,sBAAsB,GAAIH,CAAS,IACvCA,CAAC,GAAGF,KAAK,GACLE,CAAC,IAAI,CAAC,GACL,CAAC,GAAGF,KAAK,IAAI,CAAC,IAAKE,CAAC,GAAG,CAAC,GAAG,EAAE,CACnC;AAED,OAAO,SAASI,OAAO,CAAEC,GAAQ,EAAO;EACtC,MAAMC,SAAS,GAAGP,sBAAsB;EACxC,MAAMQ,YAAY,GAAGD,SAAS,CAACD,GAAG,CAAC,CAAC,CAAC,CAAC;EAEtC,OAAO,CACL,GAAG,GAAGE,YAAY,GAAG,EAAE,EACvB,GAAG,IAAID,SAAS,CAACD,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAGE,YAAY,CAAC,EAClD,GAAG,IAAIA,YAAY,GAAGD,SAAS,CAACD,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CACnD;AACH;AAEA,OAAO,SAASG,KAAK,CAAEC,GAAQ,EAAO;EACpC,MAAMH,SAAS,GAAGH,sBAAsB;EACxC,MAAMO,EAAE,GAAG,CAACD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,GAAG;EAC9B,OAAO,CACLH,SAAS,CAACI,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO,EACtCH,SAAS,CAACI,EAAE,CAAC,EACbJ,SAAS,CAACI,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,OAAO,CACvC;AACH"}
|
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import { clamp } from "../../util/helpers.mjs"; // For converting XYZ to sRGB
|
|
2
|
+
const srgbForwardMatrix = [[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]];
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
// Forward gamma adjust
|
|
5
|
+
const srgbForwardTransform = C => C <= 0.0031308 ? C * 12.92 : 1.055 * C ** (1 / 2.4) - 0.055;
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const srgbReverseMatrix = [[0.4124, 0.3576, 0.1805], [0.2126, 0.7152, 0.0722], [0.0193, 0.1192, 0.9505]]; // Reverse gamma adjust
|
|
7
|
+
// For converting sRGB to XYZ
|
|
8
|
+
const srgbReverseMatrix = [[0.4124, 0.3576, 0.1805], [0.2126, 0.7152, 0.0722], [0.0193, 0.1192, 0.9505]];
|
|
9
9
|
|
|
10
|
+
// Reverse gamma adjust
|
|
10
11
|
const srgbReverseTransform = C => C <= 0.04045 ? C / 12.92 : ((C + 0.055) / 1.055) ** 2.4;
|
|
11
|
-
|
|
12
12
|
export function fromXYZ(xyz) {
|
|
13
13
|
const rgb = Array(3);
|
|
14
14
|
const transform = srgbForwardTransform;
|
|
15
|
-
const matrix = srgbForwardMatrix;
|
|
15
|
+
const matrix = srgbForwardMatrix;
|
|
16
16
|
|
|
17
|
+
// Matrix transform, then gamma adjustment
|
|
17
18
|
for (let i = 0; i < 3; ++i) {
|
|
18
19
|
rgb[i] = Math.round(clamp(transform(matrix[i][0] * xyz[0] + matrix[i][1] * xyz[1] + matrix[i][2] * xyz[2])) * 255);
|
|
19
|
-
}
|
|
20
|
-
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
+
// Rescale back to [0, 255]
|
|
22
23
|
return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0);
|
|
23
24
|
}
|
|
24
25
|
export function toXYZ(rgb) {
|
|
25
26
|
const xyz = [0, 0, 0];
|
|
26
27
|
const transform = srgbReverseTransform;
|
|
27
|
-
const matrix = srgbReverseMatrix;
|
|
28
|
+
const matrix = srgbReverseMatrix;
|
|
28
29
|
|
|
30
|
+
// Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB
|
|
29
31
|
const r = transform((rgb >> 16 & 0xff) / 255);
|
|
30
32
|
const g = transform((rgb >> 8 & 0xff) / 255);
|
|
31
|
-
const b = transform((rgb >> 0 & 0xff) / 255);
|
|
33
|
+
const b = transform((rgb >> 0 & 0xff) / 255);
|
|
32
34
|
|
|
35
|
+
// Matrix color space transform
|
|
33
36
|
for (let i = 0; i < 3; ++i) {
|
|
34
37
|
xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b;
|
|
35
38
|
}
|
|
36
|
-
|
|
37
39
|
return xyz;
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=transformSRGB.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformSRGB.mjs","names":["clamp","srgbForwardMatrix","srgbForwardTransform","C","srgbReverseMatrix","srgbReverseTransform","fromXYZ","xyz","rgb","Array","transform","matrix","i","Math","round","toXYZ","r","g","b"],"sources":["../../../src/util/color/transformSRGB.ts"],"sourcesContent":["import type { ColorInt, XYZ } from '../colorUtils'\nimport { clamp } from '../../util/helpers'\n\n// For converting XYZ to sRGB\nconst srgbForwardMatrix = [\n [3.2406, -1.5372, -0.4986],\n [-0.9689, 1.8758, 0.0415],\n [0.0557, -0.2040, 1.0570],\n]\n\n// Forward gamma adjust\nconst srgbForwardTransform = (C: number): number => (\n C <= 0.0031308\n ? C * 12.92\n : 1.055 * C ** (1 / 2.4) - 0.055\n)\n\n// For converting sRGB to XYZ\nconst srgbReverseMatrix = [\n [0.4124, 0.3576, 0.1805],\n [0.2126, 0.7152, 0.0722],\n [0.0193, 0.1192, 0.9505],\n]\n\n// Reverse gamma adjust\nconst srgbReverseTransform = (C: number): number => (\n C <= 0.04045\n ? C / 12.92\n : ((C + 0.055) / 1.055) ** 2.4\n)\n\nexport function fromXYZ (xyz: XYZ): ColorInt {\n const rgb = Array(3)\n const transform = srgbForwardTransform\n const matrix = srgbForwardMatrix\n\n // Matrix transform, then gamma adjustment\n for (let i = 0; i < 3; ++i) {\n rgb[i] = Math.round(clamp(transform(\n matrix[i][0] * xyz[0] +\n matrix[i][1] * xyz[1] +\n matrix[i][2] * xyz[2]\n )) * 255)\n }\n\n // Rescale back to [0, 255]\n return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0)\n}\n\nexport function toXYZ (rgb: ColorInt): XYZ {\n const xyz: XYZ = [0, 0, 0]\n const transform = srgbReverseTransform\n const matrix = srgbReverseMatrix\n\n // Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB\n const r = transform((rgb >> 16 & 0xff) / 255)\n const g = transform((rgb >> 8 & 0xff) / 255)\n const b = transform((rgb >> 0 & 0xff) / 255)\n\n // Matrix color space transform\n for (let i = 0; i < 3; ++i) {\n xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b\n }\n\n return xyz\n}\n"],"mappings":"SACSA,
|
|
1
|
+
{"version":3,"file":"transformSRGB.mjs","names":["clamp","srgbForwardMatrix","srgbForwardTransform","C","srgbReverseMatrix","srgbReverseTransform","fromXYZ","xyz","rgb","Array","transform","matrix","i","Math","round","toXYZ","r","g","b"],"sources":["../../../src/util/color/transformSRGB.ts"],"sourcesContent":["import type { ColorInt, XYZ } from '../colorUtils'\nimport { clamp } from '../../util/helpers'\n\n// For converting XYZ to sRGB\nconst srgbForwardMatrix = [\n [3.2406, -1.5372, -0.4986],\n [-0.9689, 1.8758, 0.0415],\n [0.0557, -0.2040, 1.0570],\n]\n\n// Forward gamma adjust\nconst srgbForwardTransform = (C: number): number => (\n C <= 0.0031308\n ? C * 12.92\n : 1.055 * C ** (1 / 2.4) - 0.055\n)\n\n// For converting sRGB to XYZ\nconst srgbReverseMatrix = [\n [0.4124, 0.3576, 0.1805],\n [0.2126, 0.7152, 0.0722],\n [0.0193, 0.1192, 0.9505],\n]\n\n// Reverse gamma adjust\nconst srgbReverseTransform = (C: number): number => (\n C <= 0.04045\n ? C / 12.92\n : ((C + 0.055) / 1.055) ** 2.4\n)\n\nexport function fromXYZ (xyz: XYZ): ColorInt {\n const rgb = Array(3)\n const transform = srgbForwardTransform\n const matrix = srgbForwardMatrix\n\n // Matrix transform, then gamma adjustment\n for (let i = 0; i < 3; ++i) {\n rgb[i] = Math.round(clamp(transform(\n matrix[i][0] * xyz[0] +\n matrix[i][1] * xyz[1] +\n matrix[i][2] * xyz[2]\n )) * 255)\n }\n\n // Rescale back to [0, 255]\n return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0)\n}\n\nexport function toXYZ (rgb: ColorInt): XYZ {\n const xyz: XYZ = [0, 0, 0]\n const transform = srgbReverseTransform\n const matrix = srgbReverseMatrix\n\n // Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB\n const r = transform((rgb >> 16 & 0xff) / 255)\n const g = transform((rgb >> 8 & 0xff) / 255)\n const b = transform((rgb >> 0 & 0xff) / 255)\n\n // Matrix color space transform\n for (let i = 0; i < 3; ++i) {\n xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b\n }\n\n return xyz\n}\n"],"mappings":"SACSA,KAAK,kCAEd;AACA,MAAMC,iBAAiB,GAAG,CACxB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAC1B,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACzB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAC1B;;AAED;AACA,MAAMC,oBAAoB,GAAIC,CAAS,IACrCA,CAAC,IAAI,SAAS,GACVA,CAAC,GAAG,KAAK,GACT,KAAK,GAAGA,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,KAC9B;;AAED;AACA,MAAMC,iBAAiB,GAAG,CACxB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CACzB;;AAED;AACA,MAAMC,oBAAoB,GAAIF,CAAS,IACrCA,CAAC,IAAI,OAAO,GACRA,CAAC,GAAG,KAAK,GACT,CAAC,CAACA,CAAC,GAAG,KAAK,IAAI,KAAK,KAAK,GAC9B;AAED,OAAO,SAASG,OAAO,CAAEC,GAAQ,EAAY;EAC3C,MAAMC,GAAG,GAAGC,KAAK,CAAC,CAAC,CAAC;EACpB,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EA,CAAC,EAAE;IAC1BL,GAAG,CAACK,CAAC,CAAC,GAAGD,MAAM,CAACC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGI,CAAC,GAAGL,MAAM,CAACC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGK,CAAC,GAAGN,MAAM,CAACC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGM,CAAC;EACjE;EAEA,OAAOX,GAAG;AACZ"}
|
package/lib/util/colorUtils.mjs
CHANGED
|
@@ -3,31 +3,25 @@ import { consoleWarn } from "./console.mjs";
|
|
|
3
3
|
import { chunk, padEnd } from "./helpers.mjs";
|
|
4
4
|
import * as sRGB from "./color/transformSRGB.mjs";
|
|
5
5
|
import * as CIELAB from "./color/transformCIELAB.mjs"; // Types
|
|
6
|
-
|
|
7
6
|
export function isCssColor(color) {
|
|
8
7
|
return !!color && /^(#|var\(--|(rgb|hsl)a?\()/.test(color);
|
|
9
8
|
}
|
|
10
9
|
export function colorToInt(color) {
|
|
11
10
|
let rgb;
|
|
12
|
-
|
|
13
11
|
if (typeof color === 'number') {
|
|
14
12
|
rgb = color;
|
|
15
13
|
} else if (typeof color === 'string') {
|
|
16
14
|
let c = color.startsWith('#') ? color.substring(1) : color;
|
|
17
|
-
|
|
18
15
|
if (c.length === 3) {
|
|
19
16
|
c = c.split('').map(char => char + char).join('');
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
if (c.length !== 6 && c.length !== 8) {
|
|
23
19
|
consoleWarn(`'${color}' is not a valid rgb color`);
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
rgb = parseInt(c, 16);
|
|
27
22
|
} else {
|
|
28
23
|
throw new TypeError(`Colors can only be numbers or strings, recieved ${color == null ? color : color.constructor.name} instead`);
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
if (rgb < 0) {
|
|
32
26
|
consoleWarn(`Colors cannot be negative: '${color}'`);
|
|
33
27
|
rgb = 0;
|
|
@@ -35,13 +29,11 @@ export function colorToInt(color) {
|
|
|
35
29
|
consoleWarn(`'${color}' is not a valid rgb color`);
|
|
36
30
|
rgb = 0xffffff;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
return rgb;
|
|
40
33
|
}
|
|
41
34
|
export function classToHex(color, colors, currentTheme) {
|
|
42
35
|
const [colorName, colorModifier] = color.toString().trim().replace('-', '').split(' ', 2);
|
|
43
36
|
let hexColor = '';
|
|
44
|
-
|
|
45
37
|
if (colorName && colorName in colors) {
|
|
46
38
|
if (colorModifier && colorModifier in colors[colorName]) {
|
|
47
39
|
hexColor = colors[colorName][colorModifier];
|
|
@@ -51,7 +43,6 @@ export function classToHex(color, colors, currentTheme) {
|
|
|
51
43
|
} else if (colorName && colorName in currentTheme) {
|
|
52
44
|
hexColor = currentTheme[colorName];
|
|
53
45
|
}
|
|
54
|
-
|
|
55
46
|
return hexColor;
|
|
56
47
|
}
|
|
57
48
|
export function intToHex(color) {
|
|
@@ -62,12 +53,12 @@ export function intToHex(color) {
|
|
|
62
53
|
export function colorToHex(color) {
|
|
63
54
|
return intToHex(colorToInt(color));
|
|
64
55
|
}
|
|
56
|
+
|
|
65
57
|
/**
|
|
66
58
|
* Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
67
59
|
*
|
|
68
60
|
* @param color HSVA color as an array [0-360, 0-1, 0-1, 0-1]
|
|
69
61
|
*/
|
|
70
|
-
|
|
71
62
|
export function HSVAtoRGBA(hsva) {
|
|
72
63
|
const {
|
|
73
64
|
h,
|
|
@@ -75,12 +66,10 @@ export function HSVAtoRGBA(hsva) {
|
|
|
75
66
|
v,
|
|
76
67
|
a
|
|
77
68
|
} = hsva;
|
|
78
|
-
|
|
79
69
|
const f = n => {
|
|
80
70
|
const k = (n + h / 60) % 6;
|
|
81
71
|
return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
82
72
|
};
|
|
83
|
-
|
|
84
73
|
const rgb = [f(5), f(3), f(1)].map(v => Math.round(v * 255));
|
|
85
74
|
return {
|
|
86
75
|
r: rgb[0],
|
|
@@ -89,12 +78,12 @@ export function HSVAtoRGBA(hsva) {
|
|
|
89
78
|
a
|
|
90
79
|
};
|
|
91
80
|
}
|
|
81
|
+
|
|
92
82
|
/**
|
|
93
83
|
* Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
94
84
|
*
|
|
95
85
|
* @param color RGBA color as an array [0-255, 0-255, 0-255, 0-1]
|
|
96
86
|
*/
|
|
97
|
-
|
|
98
87
|
export function RGBAtoHSVA(rgba) {
|
|
99
88
|
if (!rgba) return {
|
|
100
89
|
h: 0,
|
|
@@ -108,7 +97,6 @@ export function RGBAtoHSVA(rgba) {
|
|
|
108
97
|
const max = Math.max(r, g, b);
|
|
109
98
|
const min = Math.min(r, g, b);
|
|
110
99
|
let h = 0;
|
|
111
|
-
|
|
112
100
|
if (max !== min) {
|
|
113
101
|
if (max === r) {
|
|
114
102
|
h = 60 * (0 + (g - b) / (max - min));
|
|
@@ -118,7 +106,6 @@ export function RGBAtoHSVA(rgba) {
|
|
|
118
106
|
h = 60 * (4 + (r - g) / (max - min));
|
|
119
107
|
}
|
|
120
108
|
}
|
|
121
|
-
|
|
122
109
|
if (h < 0) h = h + 360;
|
|
123
110
|
const s = max === 0 ? 0 : (max - min) / max;
|
|
124
111
|
const hsv = [h, s, max];
|
|
@@ -168,7 +155,8 @@ export function HSVAtoCSS(hsva) {
|
|
|
168
155
|
return RGBAtoCSS(HSVAtoRGBA(hsva));
|
|
169
156
|
}
|
|
170
157
|
export function RGBtoCSS(rgba) {
|
|
171
|
-
return RGBAtoCSS({
|
|
158
|
+
return RGBAtoCSS({
|
|
159
|
+
...rgba,
|
|
172
160
|
a: 1
|
|
173
161
|
});
|
|
174
162
|
}
|
|
@@ -177,7 +165,6 @@ export function RGBAtoHex(rgba) {
|
|
|
177
165
|
const h = Math.round(v).toString(16);
|
|
178
166
|
return ('00'.substr(0, 2 - h.length) + h).toUpperCase();
|
|
179
167
|
};
|
|
180
|
-
|
|
181
168
|
return `#${[toHex(rgba.r), toHex(rgba.g), toHex(rgba.b), toHex(Math.round(rgba.a * 255))].join('')}`;
|
|
182
169
|
}
|
|
183
170
|
export function HexToRGBA(hex) {
|
|
@@ -200,19 +187,15 @@ export function parseHex(hex) {
|
|
|
200
187
|
if (hex.startsWith('#')) {
|
|
201
188
|
hex = hex.slice(1);
|
|
202
189
|
}
|
|
203
|
-
|
|
204
190
|
hex = hex.replace(/([^0-9a-f])/gi, 'F');
|
|
205
|
-
|
|
206
191
|
if (hex.length === 3 || hex.length === 4) {
|
|
207
192
|
hex = hex.split('').map(x => x + x).join('');
|
|
208
193
|
}
|
|
209
|
-
|
|
210
194
|
if (hex.length === 6) {
|
|
211
195
|
hex = padEnd(hex, 8, 'F');
|
|
212
196
|
} else {
|
|
213
197
|
hex = padEnd(padEnd(hex, 6), 8, 'F');
|
|
214
198
|
}
|
|
215
|
-
|
|
216
199
|
return `#${hex}`.toUpperCase().substr(0, 9);
|
|
217
200
|
}
|
|
218
201
|
export function parseGradient(gradient, colors, currentTheme) {
|
|
@@ -234,9 +217,9 @@ export function colorToRGB(color) {
|
|
|
234
217
|
};
|
|
235
218
|
}
|
|
236
219
|
export function lighten(value, amount) {
|
|
237
|
-
const lab = CIELAB.fromXYZ(sRGB.toXYZ(value));
|
|
220
|
+
const lab = CIELAB.fromXYZ(sRGB.toXYZ(value));
|
|
221
|
+
// TODO: why this false positive?
|
|
238
222
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
239
|
-
|
|
240
223
|
lab[0] = lab[0] + amount * 10;
|
|
241
224
|
return sRGB.fromXYZ(CIELAB.toXYZ(lab));
|
|
242
225
|
}
|
|
@@ -245,20 +228,20 @@ export function darken(value, amount) {
|
|
|
245
228
|
lab[0] = lab[0] - amount * 10;
|
|
246
229
|
return sRGB.fromXYZ(CIELAB.toXYZ(lab));
|
|
247
230
|
}
|
|
231
|
+
|
|
248
232
|
/**
|
|
249
233
|
* Calculate the relative luminance of a given color
|
|
250
234
|
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
251
235
|
*/
|
|
252
|
-
|
|
253
236
|
export function getLuma(color) {
|
|
254
237
|
const rgb = colorToInt(color);
|
|
255
238
|
return sRGB.toXYZ(rgb)[1];
|
|
256
239
|
}
|
|
240
|
+
|
|
257
241
|
/**
|
|
258
242
|
* Returns the contrast ratio (1-21) between two colors.
|
|
259
243
|
* @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
260
244
|
*/
|
|
261
|
-
|
|
262
245
|
export function getContrast(first, second) {
|
|
263
246
|
const l1 = getLuma(first);
|
|
264
247
|
const l2 = getLuma(second);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorUtils.mjs","names":["consoleWarn","chunk","padEnd","sRGB","CIELAB","isCssColor","color","test","colorToInt","rgb","c","startsWith","substring","length","split","map","char","join","parseInt","TypeError","constructor","name","isNaN","classToHex","colors","currentTheme","colorName","colorModifier","toString","trim","replace","hexColor","base","intToHex","repeat","colorToHex","HSVAtoRGBA","hsva","h","s","v","a","f","n","k","Math","max","min","round","r","g","b","RGBAtoHSVA","rgba","hsv","HSVAtoHSLA","l","sprime","HSLAtoHSVA","hsl","RGBAtoCSS","HSVAtoCSS","RGBtoCSS","RGBAtoHex","toHex","substr","toUpperCase","HexToRGBA","hex","slice","HexToHSVA","HSVAtoHex","parseHex","x","parseGradient","gradient","Object","values","RGBtoInt","colorToRGB","int","lighten","value","amount","lab","fromXYZ","toXYZ","darken","getLuma","getContrast","first","second","l1","l2","light","dark"],"sources":["../../src/util/colorUtils.ts"],"sourcesContent":["// Utilities\nimport { consoleWarn } from './console'\nimport { chunk, padEnd } from './helpers'\nimport * as sRGB from '@/util/color/transformSRGB'\nimport * as CIELAB from '@/util/color/transformCIELAB'\n\n// Types\nimport type { Colors } from '@/composables/theme'\n\nexport type ColorInt = number\nexport type XYZ = [number, number, number]\nexport type LAB = [number, number, number]\nexport type HSV = { h: number, s: number, v: number }\nexport type HSVA = HSV & { a: number }\nexport type RGB = { r: number, g: number, b: number }\nexport type RGBA = RGB & { a: number }\nexport type HSL = { h: number, s: number, l: number }\nexport type HSLA = HSL & { a: number }\nexport type Hex = string\nexport type Hexa = string\nexport type Color = string | number | {}\n\nexport function isCssColor (color?: string | null | false): boolean {\n return !!color && /^(#|var\\(--|(rgb|hsl)a?\\()/.test(color)\n}\n\nexport function colorToInt (color: Color): ColorInt {\n let rgb\n\n if (typeof color === 'number') {\n rgb = color\n } else if (typeof color === 'string') {\n let c = color.startsWith('#') ? color.substring(1) : color\n if (c.length === 3) {\n c = c.split('').map(char => char + char).join('')\n }\n if (c.length !== 6 && c.length !== 8) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n }\n rgb = parseInt(c, 16)\n } else {\n throw new TypeError(`Colors can only be numbers or strings, recieved ${color == null ? color : color.constructor.name} instead`)\n }\n\n if (rgb < 0) {\n consoleWarn(`Colors cannot be negative: '${color}'`)\n rgb = 0\n } else if (rgb > 0xffffffff || isNaN(rgb)) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n rgb = 0xffffff\n }\n\n return rgb\n}\n\nexport function classToHex (\n color: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<Colors>,\n): string {\n const [colorName, colorModifier] = color\n .toString().trim().replace('-', '').split(' ', 2) as (string | undefined)[]\n\n let hexColor = ''\n if (colorName && colorName in colors) {\n if (colorModifier && colorModifier in colors[colorName]) {\n hexColor = colors[colorName][colorModifier]\n } else if ('base' in colors[colorName]) {\n hexColor = colors[colorName].base\n }\n } else if (colorName && colorName in currentTheme) {\n hexColor = currentTheme[colorName] as string\n }\n\n return hexColor\n}\n\nexport function intToHex (color: ColorInt): string {\n let hexColor: string = color.toString(16)\n\n if (hexColor.length < 6) hexColor = '0'.repeat(6 - hexColor.length) + hexColor\n\n return '#' + hexColor\n}\n\nexport function colorToHex (color: Color): string {\n return intToHex(colorToInt(color))\n}\n\n/**\n * Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color HSVA color as an array [0-360, 0-1, 0-1, 0-1]\n */\nexport function HSVAtoRGBA (hsva: HSVA): RGBA {\n const { h, s, v, a } = hsva\n const f = (n: number) => {\n const k = (n + (h / 60)) % 6\n return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0)\n }\n\n const rgb = [f(5), f(3), f(1)].map(v => Math.round(v * 255))\n\n return { r: rgb[0], g: rgb[1], b: rgb[2], a }\n}\n\n/**\n * Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color RGBA color as an array [0-255, 0-255, 0-255, 0-1]\n */\nexport function RGBAtoHSVA (rgba: RGBA): HSVA {\n if (!rgba) return { h: 0, s: 1, v: 1, a: 1 }\n\n const r = rgba.r / 255\n const g = rgba.g / 255\n const b = rgba.b / 255\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n\n let h = 0\n\n if (max !== min) {\n if (max === r) {\n h = 60 * (0 + ((g - b) / (max - min)))\n } else if (max === g) {\n h = 60 * (2 + ((b - r) / (max - min)))\n } else if (max === b) {\n h = 60 * (4 + ((r - g) / (max - min)))\n }\n }\n\n if (h < 0) h = h + 360\n\n const s = max === 0 ? 0 : (max - min) / max\n const hsv = [h, s, max]\n\n return { h: hsv[0], s: hsv[1], v: hsv[2], a: rgba.a }\n}\n\nexport function HSVAtoHSLA (hsva: HSVA): HSLA {\n const { h, s, v, a } = hsva\n\n const l = v - (v * s / 2)\n\n const sprime = l === 1 || l === 0 ? 0 : (v - l) / Math.min(l, 1 - l)\n\n return { h, s: sprime, l, a }\n}\n\nexport function HSLAtoHSVA (hsl: HSLA): HSVA {\n const { h, s, l, a } = hsl\n\n const v = l + s * Math.min(l, 1 - l)\n\n const sprime = v === 0 ? 0 : 2 - (2 * l / v)\n\n return { h, s: sprime, v, a }\n}\n\nexport function RGBAtoCSS (rgba: RGBA): string {\n return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`\n}\n\nexport function HSVAtoCSS (hsva: HSVA): string {\n return RGBAtoCSS(HSVAtoRGBA(hsva))\n}\n\nexport function RGBtoCSS (rgba: RGBA): string {\n return RGBAtoCSS({ ...rgba, a: 1 })\n}\n\nexport function RGBAtoHex (rgba: RGBA): Hex {\n const toHex = (v: number) => {\n const h = Math.round(v).toString(16)\n return ('00'.substr(0, 2 - h.length) + h).toUpperCase()\n }\n\n return `#${[\n toHex(rgba.r),\n toHex(rgba.g),\n toHex(rgba.b),\n toHex(Math.round(rgba.a * 255)),\n ].join('')}`\n}\n\nexport function HexToRGBA (hex: Hex): RGBA {\n const rgba = chunk(hex.slice(1), 2).map((c: string) => parseInt(c, 16))\n\n return {\n r: rgba[0],\n g: rgba[1],\n b: rgba[2],\n a: Math.round((rgba[3] / 255) * 100) / 100,\n }\n}\n\nexport function HexToHSVA (hex: Hex): HSVA {\n const rgb = HexToRGBA(hex)\n return RGBAtoHSVA(rgb)\n}\n\nexport function HSVAtoHex (hsva: HSVA): Hex {\n return RGBAtoHex(HSVAtoRGBA(hsva))\n}\n\nexport function parseHex (hex: string): Hex {\n if (hex.startsWith('#')) {\n hex = hex.slice(1)\n }\n\n hex = hex.replace(/([^0-9a-f])/gi, 'F')\n\n if (hex.length === 3 || hex.length === 4) {\n hex = hex.split('').map(x => x + x).join('')\n }\n\n if (hex.length === 6) {\n hex = padEnd(hex, 8, 'F')\n } else {\n hex = padEnd(padEnd(hex, 6), 8, 'F')\n }\n\n return `#${hex}`.toUpperCase().substr(0, 9)\n}\n\nexport function parseGradient (\n gradient: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<Colors>,\n) {\n return gradient.replace(/([a-z]+(\\s[a-z]+-[1-5])?)(?=$|,)/gi, x => {\n return classToHex(x, colors, currentTheme) || x\n }).replace(/(rgba\\()#[0-9a-f]+(?=,)/gi, x => {\n return 'rgba(' + Object.values(HexToRGBA(parseHex(x.replace(/rgba\\(/, '')))).slice(0, 3).join(',')\n })\n}\n\nexport function RGBtoInt (rgba: RGBA): ColorInt {\n return (rgba.r << 16) + (rgba.g << 8) + rgba.b\n}\n\nexport function colorToRGB (color: string) {\n const int = colorToInt(color)\n\n return {\n r: (int & 0xFF0000) >> 16,\n g: (int & 0xFF00) >> 8,\n b: (int & 0xFF),\n }\n}\n\nexport function lighten (value: ColorInt, amount: number): ColorInt {\n const lab = CIELAB.fromXYZ(sRGB.toXYZ(value))\n // TODO: why this false positive?\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n lab[0] = lab[0] + amount * 10\n\n return sRGB.fromXYZ(CIELAB.toXYZ(lab))\n}\n\nexport function darken (value: ColorInt, amount: number): ColorInt {\n const lab = CIELAB.fromXYZ(sRGB.toXYZ(value))\n lab[0] = lab[0] - amount * 10\n\n return sRGB.fromXYZ(CIELAB.toXYZ(lab))\n}\n\n/**\n * Calculate the relative luminance of a given color\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\nexport function getLuma (color: Color) {\n const rgb = colorToInt(color)\n\n return sRGB.toXYZ(rgb)[1]\n}\n\n/**\n * Returns the contrast ratio (1-21) between two colors.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function getContrast (first: Color, second: Color) {\n const l1 = getLuma(first)\n const l2 = getLuma(second)\n\n const light = Math.max(l1, l2)\n const dark = Math.min(l1, l2)\n\n return (light + 0.05) / (dark + 0.05)\n}\n"],"mappings":"AAAA;SACSA,W;SACAC,K,EAAOC,M;OACT,KAAKC,I;OACL,KAAKC,M,qCAEZ;;AAgBA,OAAO,SAASC,UAAT,CAAqBC,KAArB,EAA6D;EAClE,OAAO,CAAC,CAACA,KAAF,IAAW,6BAA6BC,IAA7B,CAAkCD,KAAlC,CAAlB;AACD;AAED,OAAO,SAASE,UAAT,CAAqBF,KAArB,EAA6C;EAClD,IAAIG,GAAJ;;EAEA,IAAI,OAAOH,KAAP,KAAiB,QAArB,EAA+B;I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U,CAACF,KAAD,CAAtB;EAEA,OAAOH,IAAI,CAACmF,KAAL,CAAW7E,GAAX,EAAgB,CAAhB,CAAP;AACD;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASgF,WAAT,CAAsBC,KAAtB,EAAoCC,MAApC,EAAmD;EACxD,MAAMC,EAAE,GAAGJ,OAAO,CAACE,KAAD,CAAlB;EACA,MAAMG,EAAE,GAAGL,OAAO,CAACG,MAAD,CAAlB;EAEA,MAAMG,KAAK,GAAGjD,IAAI,CAACC,GAAL,CAAS8C,EAAT,EAAaC,EAAb,CAAd;EACA,MAAME,IAAI,GAAGlD,IAAI,CAACE,GAAL,CAAS6C,EAAT,EAAaC,EAAb,CAAb;EAEA,OAAO,CAACC,KAAK,GAAG,IAAT,KAAkBC,IAAI,GAAG,IAAzB,CAAP;AACD"}
|
|
1
|
+
{"version":3,"file":"colorUtils.mjs","names":["consoleWarn","chunk","padEnd","sRGB","CIELAB","isCssColor","color","test","colorToInt","rgb","c","startsWith","substring","length","split","map","char","join","parseInt","TypeError","constructor","name","isNaN","classToHex","colors","currentTheme","colorName","colorModifier","toString","trim","replace","hexColor","base","intToHex","repeat","colorToHex","HSVAtoRGBA","hsva","h","s","v","a","f","n","k","Math","max","min","round","r","g","b","RGBAtoHSVA","rgba","hsv","HSVAtoHSLA","l","sprime","HSLAtoHSVA","hsl","RGBAtoCSS","HSVAtoCSS","RGBtoCSS","RGBAtoHex","toHex","substr","toUpperCase","HexToRGBA","hex","slice","HexToHSVA","HSVAtoHex","parseHex","x","parseGradient","gradient","Object","values","RGBtoInt","colorToRGB","int","lighten","value","amount","lab","fromXYZ","toXYZ","darken","getLuma","getContrast","first","second","l1","l2","light","dark"],"sources":["../../src/util/colorUtils.ts"],"sourcesContent":["// Utilities\nimport { consoleWarn } from './console'\nimport { chunk, padEnd } from './helpers'\nimport * as sRGB from '@/util/color/transformSRGB'\nimport * as CIELAB from '@/util/color/transformCIELAB'\n\n// Types\nimport type { Colors } from '@/composables/theme'\n\nexport type ColorInt = number\nexport type XYZ = [number, number, number]\nexport type LAB = [number, number, number]\nexport type HSV = { h: number, s: number, v: number }\nexport type HSVA = HSV & { a: number }\nexport type RGB = { r: number, g: number, b: number }\nexport type RGBA = RGB & { a: number }\nexport type HSL = { h: number, s: number, l: number }\nexport type HSLA = HSL & { a: number }\nexport type Hex = string\nexport type Hexa = string\nexport type Color = string | number | {}\n\nexport function isCssColor (color?: string | null | false): boolean {\n return !!color && /^(#|var\\(--|(rgb|hsl)a?\\()/.test(color)\n}\n\nexport function colorToInt (color: Color): ColorInt {\n let rgb\n\n if (typeof color === 'number') {\n rgb = color\n } else if (typeof color === 'string') {\n let c = color.startsWith('#') ? color.substring(1) : color\n if (c.length === 3) {\n c = c.split('').map(char => char + char).join('')\n }\n if (c.length !== 6 && c.length !== 8) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n }\n rgb = parseInt(c, 16)\n } else {\n throw new TypeError(`Colors can only be numbers or strings, recieved ${color == null ? color : color.constructor.name} instead`)\n }\n\n if (rgb < 0) {\n consoleWarn(`Colors cannot be negative: '${color}'`)\n rgb = 0\n } else if (rgb > 0xffffffff || isNaN(rgb)) {\n consoleWarn(`'${color}' is not a valid rgb color`)\n rgb = 0xffffff\n }\n\n return rgb\n}\n\nexport function classToHex (\n color: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<Colors>,\n): string {\n const [colorName, colorModifier] = color\n .toString().trim().replace('-', '').split(' ', 2) as (string | undefined)[]\n\n let hexColor = ''\n if (colorName && colorName in colors) {\n if (colorModifier && colorModifier in colors[colorName]) {\n hexColor = colors[colorName][colorModifier]\n } else if ('base' in colors[colorName]) {\n hexColor = colors[colorName].base\n }\n } else if (colorName && colorName in currentTheme) {\n hexColor = currentTheme[colorName] as string\n }\n\n return hexColor\n}\n\nexport function intToHex (color: ColorInt): string {\n let hexColor: string = color.toString(16)\n\n if (hexColor.length < 6) hexColor = '0'.repeat(6 - hexColor.length) + hexColor\n\n return '#' + hexColor\n}\n\nexport function colorToHex (color: Color): string {\n return intToHex(colorToInt(color))\n}\n\n/**\n * Converts HSVA to RGBA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color HSVA color as an array [0-360, 0-1, 0-1, 0-1]\n */\nexport function HSVAtoRGBA (hsva: HSVA): RGBA {\n const { h, s, v, a } = hsva\n const f = (n: number) => {\n const k = (n + (h / 60)) % 6\n return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0)\n }\n\n const rgb = [f(5), f(3), f(1)].map(v => Math.round(v * 255))\n\n return { r: rgb[0], g: rgb[1], b: rgb[2], a }\n}\n\n/**\n * Converts RGBA to HSVA. Based on formula from https://en.wikipedia.org/wiki/HSL_and_HSV\n *\n * @param color RGBA color as an array [0-255, 0-255, 0-255, 0-1]\n */\nexport function RGBAtoHSVA (rgba: RGBA): HSVA {\n if (!rgba) return { h: 0, s: 1, v: 1, a: 1 }\n\n const r = rgba.r / 255\n const g = rgba.g / 255\n const b = rgba.b / 255\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n\n let h = 0\n\n if (max !== min) {\n if (max === r) {\n h = 60 * (0 + ((g - b) / (max - min)))\n } else if (max === g) {\n h = 60 * (2 + ((b - r) / (max - min)))\n } else if (max === b) {\n h = 60 * (4 + ((r - g) / (max - min)))\n }\n }\n\n if (h < 0) h = h + 360\n\n const s = max === 0 ? 0 : (max - min) / max\n const hsv = [h, s, max]\n\n return { h: hsv[0], s: hsv[1], v: hsv[2], a: rgba.a }\n}\n\nexport function HSVAtoHSLA (hsva: HSVA): HSLA {\n const { h, s, v, a } = hsva\n\n const l = v - (v * s / 2)\n\n const sprime = l === 1 || l === 0 ? 0 : (v - l) / Math.min(l, 1 - l)\n\n return { h, s: sprime, l, a }\n}\n\nexport function HSLAtoHSVA (hsl: HSLA): HSVA {\n const { h, s, l, a } = hsl\n\n const v = l + s * Math.min(l, 1 - l)\n\n const sprime = v === 0 ? 0 : 2 - (2 * l / v)\n\n return { h, s: sprime, v, a }\n}\n\nexport function RGBAtoCSS (rgba: RGBA): string {\n return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`\n}\n\nexport function HSVAtoCSS (hsva: HSVA): string {\n return RGBAtoCSS(HSVAtoRGBA(hsva))\n}\n\nexport function RGBtoCSS (rgba: RGBA): string {\n return RGBAtoCSS({ ...rgba, a: 1 })\n}\n\nexport function RGBAtoHex (rgba: RGBA): Hex {\n const toHex = (v: number) => {\n const h = Math.round(v).toString(16)\n return ('00'.substr(0, 2 - h.length) + h).toUpperCase()\n }\n\n return `#${[\n toHex(rgba.r),\n toHex(rgba.g),\n toHex(rgba.b),\n toHex(Math.round(rgba.a * 255)),\n ].join('')}`\n}\n\nexport function HexToRGBA (hex: Hex): RGBA {\n const rgba = chunk(hex.slice(1), 2).map((c: string) => parseInt(c, 16))\n\n return {\n r: rgba[0],\n g: rgba[1],\n b: rgba[2],\n a: Math.round((rgba[3] / 255) * 100) / 100,\n }\n}\n\nexport function HexToHSVA (hex: Hex): HSVA {\n const rgb = HexToRGBA(hex)\n return RGBAtoHSVA(rgb)\n}\n\nexport function HSVAtoHex (hsva: HSVA): Hex {\n return RGBAtoHex(HSVAtoRGBA(hsva))\n}\n\nexport function parseHex (hex: string): Hex {\n if (hex.startsWith('#')) {\n hex = hex.slice(1)\n }\n\n hex = hex.replace(/([^0-9a-f])/gi, 'F')\n\n if (hex.length === 3 || hex.length === 4) {\n hex = hex.split('').map(x => x + x).join('')\n }\n\n if (hex.length === 6) {\n hex = padEnd(hex, 8, 'F')\n } else {\n hex = padEnd(padEnd(hex, 6), 8, 'F')\n }\n\n return `#${hex}`.toUpperCase().substr(0, 9)\n}\n\nexport function parseGradient (\n gradient: string,\n colors: Record<string, Record<string, string>>,\n currentTheme: Partial<Colors>,\n) {\n return gradient.replace(/([a-z]+(\\s[a-z]+-[1-5])?)(?=$|,)/gi, x => {\n return classToHex(x, colors, currentTheme) || x\n }).replace(/(rgba\\()#[0-9a-f]+(?=,)/gi, x => {\n return 'rgba(' + Object.values(HexToRGBA(parseHex(x.replace(/rgba\\(/, '')))).slice(0, 3).join(',')\n })\n}\n\nexport function RGBtoInt (rgba: RGBA): ColorInt {\n return (rgba.r << 16) + (rgba.g << 8) + rgba.b\n}\n\nexport function colorToRGB (color: string) {\n const int = colorToInt(color)\n\n return {\n r: (int & 0xFF0000) >> 16,\n g: (int & 0xFF00) >> 8,\n b: (int & 0xFF),\n }\n}\n\nexport function lighten (value: ColorInt, amount: number): ColorInt {\n const lab = CIELAB.fromXYZ(sRGB.toXYZ(value))\n // TODO: why this false positive?\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n lab[0] = lab[0] + amount * 10\n\n return sRGB.fromXYZ(CIELAB.toXYZ(lab))\n}\n\nexport function darken (value: ColorInt, amount: number): ColorInt {\n const lab = CIELAB.fromXYZ(sRGB.toXYZ(value))\n lab[0] = lab[0] - amount * 10\n\n return sRGB.fromXYZ(CIELAB.toXYZ(lab))\n}\n\n/**\n * Calculate the relative luminance of a given color\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\nexport function getLuma (color: Color) {\n const rgb = colorToInt(color)\n\n return sRGB.toXYZ(rgb)[1]\n}\n\n/**\n * Returns the contrast ratio (1-21) between two colors.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function getContrast (first: Color, second: Color) {\n const l1 = getLuma(first)\n const l2 = getLuma(second)\n\n const light = Math.max(l1, l2)\n const dark = Math.min(l1, l2)\n\n return (light + 0.05) / (dark + 0.05)\n}\n"],"mappings":"AAAA;AAAA,SACSA,WAAW;AAAA,SACXC,KAAK,EAAEC,MAAM;AAAA,OACf,KAAKC,IAAI;AAAA,OACT,KAAKC,MAAM,qCAElB;AAgBA,OAAO,SAASC,UAAU,CAAEC,KAA6B,EAAW;EAClE,OAAO,CAAC,CAACA,KAAK,IAAI,4BAA4B,CAACC,IAAI,CAACD,KAAK,CAAC;AAC5D;AAEA,OAAO,SAASE,UAAU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