vectis-ui 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +6 -21
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +2 -12
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +2 -2
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +1 -5
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.d.ts +13 -27
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +3 -9
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButton.d.ts +10 -17
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +6 -15
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/context.d.ts +1 -9
- package/dist/components/VButton/context.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +9 -24
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.d.ts +4 -13
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +1 -5
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/color.d.ts +1 -7
- package/dist/components/VCalendar/color.js.map +1 -1
- package/dist/components/VCalendar/edgeStep.d.ts +5 -15
- package/dist/components/VCalendar/edgeStep.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +12 -36
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/keyboard.d.ts +5 -42
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +38 -199
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +3 -25
- package/dist/components/VCalendar/timeGrid.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +6 -23
- package/dist/components/VCarousel/VCarousel.d.ts +25 -96
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +1 -6
- package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +1 -5
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.d.ts +2 -8
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +21 -59
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +117 -119
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/infiniteScroll.d.ts +4 -10
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +11 -36
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +23 -20
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +12 -21
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/mask.d.ts +14 -59
- package/dist/components/VDateInput/mask.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +6 -12
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +10 -42
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.d.ts +8 -22
- package/dist/components/VDatePicker/names.js.map +1 -1
- package/dist/components/VDialog/VDialog.d.ts +5 -10
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +51 -53
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.d.ts +2 -3
- package/dist/components/VDialog/VDialogAlert.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +11 -37
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/truncate.d.ts +3 -23
- package/dist/components/VFileInput/truncate.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +15 -65
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +6 -15
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +10 -49
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.d.ts +7 -19
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VIcon/iconProps.d.ts +5 -19
- package/dist/components/VIcon/iconProps.js.map +1 -1
- package/dist/components/VIcon/resolver.d.ts +15 -43
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +7 -34
- package/dist/components/VIconButton/VIconButton.d.ts +2 -3
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.d.ts +14 -29
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +34 -50
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/context.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +8 -16
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +55 -63
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.d.ts +1 -6
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.d.ts +0 -5
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +1 -6
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuSeparator.js.map +1 -1
- package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +3 -11
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.d.ts +9 -20
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VPopover/VPopover.d.ts +7 -18
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +23 -27
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -6
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +4 -15
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.d.ts +1 -5
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +2 -15
- package/dist/components/VSeparator/VSeparator.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +1 -5
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +1 -5
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +80 -75
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationSeparator.js.map +1 -1
- package/dist/components/VSideNavigation/context.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +6 -19
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSlider/VSlider.d.ts +5 -13
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +4 -17
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.d.ts +3 -5
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.d.ts +1 -5
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.d.ts +5 -17
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/context.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +13 -20
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +8 -21
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +3 -34
- package/dist/components/VTimeInput/search.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +9 -31
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +18 -45
- package/dist/components/VTimePicker/limits.js.map +1 -1
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +2 -7
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.d.ts +5 -9
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +1 -9
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/context.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +3 -16
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.d.ts +4 -8
- package/dist/components/VTypography/VTypography.js.map +1 -1
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +2 -8
- package/dist/composables/useClearable.js.map +1 -1
- package/dist/composables/useControlShape.js.map +1 -1
- package/dist/composables/useDetailsOpen.d.ts +2 -10
- package/dist/composables/useDetailsOpen.js.map +1 -1
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +4 -17
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -5
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useFocusoutDismiss.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +4 -19
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.d.ts +1 -1
- package/dist/composables/useInertLink.js.map +1 -1
- package/dist/composables/useLiveAnnouncer.js.map +1 -1
- package/dist/composables/useMaskedField.d.ts +12 -27
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +3 -11
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +0 -9
- package/dist/composables/useRootAttrs.js +11 -4
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useSlotNodes.d.ts +3 -14
- package/dist/composables/useSlotNodes.js.map +1 -1
- package/dist/composables/useTextLimit.d.ts +4 -16
- package/dist/composables/useTextLimit.js.map +1 -1
- package/dist/composables/useTimer.d.ts +2 -15
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +9 -38
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +19 -81
- package/dist/icons.d.ts +2 -12
- package/dist/styles.css +1 -1
- package/dist/tokens/css.d.ts +3 -16
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +5 -0
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/primitives.js.map +1 -1
- package/dist/tokens/semantic.d.ts +6 -23
- package/dist/tokens/semantic.js +5 -0
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens/types.d.ts +2 -12
- package/dist/tokens/types.js.map +1 -1
- package/dist/tokens.json +14 -0
- package/dist/types.d.ts +3 -21
- package/dist/utils/array.d.ts +2 -4
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/arrowNav.d.ts +2 -26
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +1 -8
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/clock.d.ts +16 -39
- package/dist/utils/clock.js.map +1 -1
- package/dist/utils/css.d.ts +5 -16
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +17 -60
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +2 -9
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +2 -15
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/file.d.ts +8 -46
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +1 -14
- package/dist/utils/focus.js +1 -6
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +3 -8
- package/dist/utils/hostWarns.js.map +1 -1
- package/dist/utils/ids.d.ts +2 -7
- package/dist/utils/ids.js.map +1 -1
- package/dist/utils/matcher.d.ts +1 -8
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +1 -11
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/number.d.ts +1 -7
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/text.d.ts +4 -23
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +4 -12
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +0 -10
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","names":[],"sources":["../../src/tokens/semantic.ts"],"sourcesContent":["/**\n * The tokens naming a ROLE rather than a value: the page background, ordinary text, the\n * accent an application is built around, the pause before a tooltip.\n *\n * These are the ONLY tokens a component mentions, and that is the whole point — a component\n * asks for the accent and never for a particular indigo, so an application can change what\n * the accent IS without any component knowing.\n *\n * Almost every entry ALIASES a palette step in braces rather than stating a value. What is\n * written here is the LIGHT theme; `themes/dark.ts` repoints the same roles.\n */\nimport { color, dimension, duration, fontFamily, fontWeight, type TokenGroup } from './types'\n\nexport const semantic = {\n color: {\n surface: color('{color.white}', 'The default page background'),\n 'surface-muted': color('{color.gray.100}', 'A muted background (secondary areas)'),\n 'surface-raised': color('{color.white}', 'Raised surfaces: cards'),\n 'surface-overlay': color('{color.white}', 'Floating surfaces: dialogs, popovers, menus'),\n 'surface-sunken': color('{color.gray.50}', 'Sunken surfaces: wells, code areas'),\n 'surface-inverse': color('{color.gray.900}', 'Inverted-contrast surfaces: tooltips'),\n 'surface-skeleton': color(\n '{color.gray.200}',\n \"The background of VSkeletonLoader's silhouettes, from which its highlight is derived\",\n ),\n\n 'text-on-inverse': color('{color.white}', 'Text set on an inverted surface'),\n\n text: color('{color.gray.900}', 'The running text of the interface'),\n 'text-muted': color(\n '{color.gray.600}',\n 'Secondary text: hints, captions, descriptions, start icons',\n ),\n 'text-subtle': color('{color.gray.500}', 'Placeholders, disabled text'),\n 'text-on-accent': color('{color.white}', 'Text set on an accent/danger/success background'),\n 'text-on-warning': color(\n '{color.gray.950}',\n 'Text set on a solid warning background (amber too light for white)',\n ),\n\n border: color('{color.gray.200}', 'Dividers, and the frames of cards, tables and panels'),\n 'border-strong': color('{color.gray.300}', 'The borders of form controls'),\n\n accent: color(\n '{color.indigo.600}',\n 'The brand color: solid buttons, checked controls, the selected item',\n ),\n 'accent-hover': color('{color.indigo.700}', 'The accent color under the pointer'),\n 'accent-active': color('{color.indigo.800}', 'The accent color while pressed'),\n 'accent-surface': color('{color.indigo.50}', 'A tinted accent background (badges, selections)'),\n 'accent-border': color(\n '{color.indigo.200}',\n 'The border of a tinted accent element, matching the accent surface',\n ),\n 'accent-text': color('{color.indigo.700}', 'Accent text on a neutral or tinted background'),\n\n danger: color('{color.red.600}', 'Destructive actions and errors: solid buttons, error states'),\n 'danger-hover': color('{color.red.700}', 'The danger color under the pointer'),\n 'danger-active': color('{color.red.800}', 'The danger color while pressed'),\n 'danger-surface': color(\n '{color.red.50}',\n 'A tinted danger background (soft buttons and chips, a destructive menu item)',\n ),\n 'danger-border': color(\n '{color.red.200}',\n 'The border of a tinted danger element, matching the danger surface',\n ),\n 'danger-text': color(\n '{color.red.700}',\n 'Danger text on a neutral or tinted background: error messages, a destructive menu item',\n ),\n\n /*\n * Green starts one step darker than the other colours. White text on a filled button\n * only becomes readable enough from green 700 onwards — green 600 falls well short of\n * the threshold. Darkening the colour rather than darkening the text is what keeps one\n * simple rule true: a filled control carries white text.\n *\n * The one exception is the warning colour, since no step of an amber is ever dark\n * enough for white, which is why it alone declares a text colour of its own.\n */\n success: color('{color.green.700}', 'A positive outcome: solid chips, badges, notifications'),\n 'success-hover': color('{color.green.800}', 'The success color under the pointer'),\n 'success-active': color('{color.green.900}', 'The success color while pressed'),\n 'success-surface': color(\n '{color.green.50}',\n 'A tinted success background (soft chips, badges, notifications)',\n ),\n 'success-border': color(\n '{color.green.200}',\n 'The border of a tinted success element, matching the success surface',\n ),\n 'success-text': color('{color.green.800}', 'Success text on a neutral or tinted background'),\n\n warning: color(\n '{color.amber.600}',\n 'A situation that calls for attention: solid chips, badges, notifications',\n ),\n 'warning-hover': color('{color.amber.700}', 'The warning color under the pointer'),\n 'warning-active': color('{color.amber.800}', 'The warning color while pressed'),\n 'warning-surface': color(\n '{color.amber.50}',\n 'A tinted warning background (soft chips, badges, notifications)',\n ),\n 'warning-border': color(\n '{color.amber.200}',\n 'The border of a tinted warning element, matching the warning surface',\n ),\n 'warning-text': color('{color.amber.900}', 'Warning text on a neutral or tinted background'),\n\n backdrop: color('oklch(0% 0 0 / 0.45)', 'The veil behind modal dialogs'),\n\n /*\n * The four colours of a calendar event that names none of its own.\n *\n * These are the one place in the design system where a colour is DATA rather than a\n * role: which hue an event takes is derived from its id (see `VCalendar/color.ts`),\n * and each card turns these colours to its own hue. That is why they are written out\n * rather than aliased to a palette — there is no palette to point at, only a wheel. The\n * hue written here, 265, is the one a card falls back to.\n *\n * WHAT MAKES THEM READABLE, and what must not be changed casually. Only the HUE\n * varies; the lightness and the chroma below are fixed, and in OKLCH lightness is\n * perceptual — so the distance between the text at L 0.40 and the card at L 0.95 is\n * the same perceived distance at every hue, which is what turns \"an arbitrary colour\"\n * into a contrast ratio that can be relied on. Moving either number moves the contrast\n * of every event in the calendar at once. The same pair is restated in `themes/dark.ts`\n * with the roles swapped end for end.\n *\n * TRAP — they are plain colours, with no `var()` in them. A custom property is resolved\n * where it is DECLARED, which for a token is `:root`: a hue read there is the fallback's,\n * and every card would be painted in it whatever hue it set. The card keeps the lightness\n * and the chroma and swaps the hue itself, with relative colour syntax, in\n * `VCalendarEvent.vue`.\n */\n 'event-surface': color(\n 'oklch(0.95 0.045 265)',\n 'The face of a calendar event that carries no color of its own',\n ),\n 'event-border': color(\n 'oklch(0.85 0.08 265)',\n 'The edge of that calendar event, and the bar marking its leading side',\n ),\n 'event-text': color('oklch(0.4 0.11 265)', 'The title of that calendar event'),\n },\n /**\n * The typography, described by role rather than by measurement: a heading, a subtitle,\n * a caption, a piece of code.\n *\n * Each role is a COMPLETE recipe — a size, a weight, the space between lines, and where\n * it matters the space between letters. Asking for a role therefore settles every one of\n * those at once, and two pieces of text in the same role cannot drift apart. It is what\n * the typography component renders, and what the components' own stylesheets ask for.\n */\n text: {\n family: fontFamily('{font.family.sans}', 'The running font of every component'),\n 'family-heading': fontFamily(\n '{font.family.display}',\n 'The font of the display and heading roles, the running font until it is overridden',\n ),\n 'family-code': fontFamily(\n '{font.family.mono}',\n 'The font of code content (the code role, VInputOTP)',\n ),\n display: {\n size: dimension('{font.size.5xl}'),\n weight: fontWeight('{font.weight.bold}'),\n leading: dimension('{font.leading.none}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-1': {\n size: dimension('{font.size.4xl}'),\n weight: fontWeight('{font.weight.bold}'),\n leading: dimension('{font.leading.tight}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-2': {\n size: dimension('{font.size.2xl}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.tight}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-3': {\n size: dimension('{font.size.lg}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.snug}'),\n },\n 'heading-4': {\n size: dimension('{font.size.md}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.snug}'),\n },\n subtitle: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n /**\n * The introduction that opens a page or a section, one step above the running text.\n *\n * It shares `body-lg`'s generous leading rather than taking a tighter one: a lead is read\n * as prose, not as a heading, and the two therefore sit in the same column without the\n * rhythm changing under the reader between the first paragraph and the second.\n */\n 'body-xl': {\n size: dimension('{font.size.lg}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.relaxed}'),\n },\n 'body-lg': {\n size: dimension('{font.size.md}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.relaxed}'),\n },\n 'body-md': {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n 'body-sm': {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n label: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.snug}'),\n },\n caption: {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.snug}'),\n },\n overline: {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.snug}'),\n tracking: dimension('{font.tracking.wide}'),\n },\n code: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n /*\n * A role of a different sort: the label of a control — a button, a chip, a badge. It\n * deliberately carries no SIZE, because a control's text size comes from the size it\n * was given, and this recipe only settles the weight and the space between lines.\n */\n control: {\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.none}'),\n },\n },\n radius: {\n interactive: dimension('{radius.md}', 'Buttons, inputs, controls'),\n surface: dimension('{radius.lg}', 'Cards, alerts'),\n overlay: dimension('{radius.xl}', 'Dialogs, popovers, menus'),\n pill: dimension('{radius.full}', 'Full rounding: switches, badges, pill-shaped chips'),\n chip: dimension(\n '{radius.interactive}',\n 'Chips with shape=\"chip\", which follow the interactive radius by default',\n ),\n },\n /**\n * How long a change takes, described by what it is: the immediate feedback of a control\n * under the pointer, the ordinary pace of the design system, a deliberately slower move.\n *\n * These three are what a `transition` reaches for. Motion does not vary from one theme to\n * the next, so unlike the colours they are stated once and never restated.\n */\n duration: {\n fast: duration('{duration.150}', 'Color and border changes on hover, focus and press'),\n base: duration('{duration.200}', 'The default: a panel opening, a value moving'),\n slow: duration('{duration.300}', 'Movements large enough to be followed by the eye'),\n },\n focus: {\n 'ring-color': color(\n '{color.indigo.500}',\n 'The keyboard focus ring, which has to stand out against the page',\n ),\n 'ring-width': dimension('2px', 'The thickness of the focus ring'),\n 'ring-offset': dimension('2px', 'The gap between a control and its focus ring'),\n },\n control: {\n 'height-xs': dimension(\n '1.5rem',\n 'The height of every control at size=\"xs\" (24px), 4px less when compact',\n ),\n 'height-sm': dimension(\n '2rem',\n 'The height of every control at size=\"sm\" (32px), 4px less when compact',\n ),\n 'height-md': dimension(\n '2.5rem',\n 'The height of every control at size=\"md\" (40px), 4px less when compact',\n ),\n 'height-lg': dimension(\n '3rem',\n 'The height of every control at size=\"lg\" (48px), 4px less when compact',\n ),\n 'height-xl': dimension(\n '3.5rem',\n 'The height of every control at size=\"xl\" (56px), 4px less when compact',\n ),\n 'border-width': dimension('2px', 'The border of checkable controls (VCheckbox, VRadio)'),\n 'size-check': dimension('1.25rem', 'The box of checkable controls (VCheckbox, VRadio)'),\n 'size-check-mark': dimension('0.875rem', \"The tick inside VCheckbox's box\"),\n 'size-check-dot': dimension('0.5rem', \"The dot inside VRadio's circle\"),\n 'size-switch-w': dimension('2.5rem', \"The width of VSwitch's track\"),\n 'size-switch-h': dimension('1.25rem', \"The height of VSwitch's track\"),\n 'size-switch-pad': dimension(\n '0.125rem',\n \"The gap between VSwitch's thumb and the edge of its track\",\n ),\n 'action-size-sm': dimension(\n '1.25rem',\n 'The inner buttons of sm input fields (clear, a clickable icon)',\n ),\n 'action-size-md': dimension(\n '1.5rem',\n 'The inner buttons of md input fields (clear, a clickable icon)',\n ),\n 'action-size-lg': dimension(\n '1.75rem',\n 'The inner buttons of lg input fields (clear, a clickable icon)',\n ),\n 'size-slider-track': dimension('0.375rem', \"The thickness of VSlider's track\"),\n 'size-slider-thumb': dimension('1.25rem', \"The diameter of VSlider's thumb\"),\n 'size-slider-length': dimension('10rem', 'The default length of a vertical VSlider'),\n 'size-slider-field': dimension('5rem', \"The width of VSlider's number fields\"),\n 'size-carousel-block': dimension(\n '24rem',\n \"The default block size of VCarousel's viewport, which a vertical carousel needs to lay its slides out\",\n ),\n 'size-carousel-indicator': dimension(\n '0.625rem',\n 'The diameter of a VCarousel indicator dot (its hit area comes from --vectis-control-height-xs)',\n ),\n 'size-carousel-indicator-active': dimension(\n '1.25rem',\n 'The length of the active VCarousel indicator, which stretches from a dot into a pill',\n ),\n 'size-combobox-list-max-block': dimension(\n '18rem',\n \"The maximum height of VCombobox's list panel (the scrolling area)\",\n ),\n 'size-menu-min': dimension('11rem', \"The minimum width of VMenu's panel\"),\n 'size-menu-max': dimension('20rem', \"The maximum width of VMenu's panel\"),\n 'size-progress-linear-thickness': dimension(\n '0.25rem',\n \"The default thickness of VProgressLinear's bar (4px)\",\n ),\n 'size-progress-linear-length': dimension(\n '10rem',\n 'The default length of a vertical VProgressLinear, which a height set on the bar replaces',\n ),\n 'size-progress-circular-diameter': dimension(\n '3rem',\n 'The default diameter of VProgressCircular',\n ),\n 'size-progress-circular-thickness': dimension(\n '0.25rem',\n 'The default stroke thickness of VProgressCircular (4px)',\n ),\n 'size-skeleton-surface': dimension(\n '6rem',\n 'The default height of a surface-shaped VSkeletonLoader: a card, an image (96px)',\n ),\n 'size-toast-width': dimension('22rem', 'The default width of a toast'),\n 'size-tooltip-max': dimension('18rem', 'The widest a tooltip grows before it wraps (288px)'),\n 'size-dialog-width': dimension(\n '25rem',\n 'The default width of VDialog and VDialogAlert (400px), when no `width` is given',\n ),\n 'size-snackbar-min': dimension('18rem', 'The minimum width of a snackbar (288px)'),\n 'size-snackbar-max': dimension('36rem', 'The maximum width of a snackbar (576px)'),\n 'size-badge-h': dimension('1.25rem', 'The height of a VBadge pill'),\n 'size-badge-dot': dimension('0.625rem', 'The diameter of VBadge in dot mode'),\n 'size-badge-ring': dimension('2px', 'The detaching ring of a bordered VBadge'),\n 'size-avatar-ring': dimension('2px', 'The ring separating stacked avatars (VAvatarGroup)'),\n 'size-date-picker-cell': dimension('2.5rem', 'The side of a VDatePicker day cell'),\n 'size-date-picker-day': dimension(\n '{control.height.md}',\n 'The diameter of the disc a VDatePicker day is drawn on; the cell grows to hold it',\n ),\n 'size-date-picker-dot': dimension('0.25rem', 'The diameter of a VDatePicker event dot'),\n 'size-date-picker-nav-min': dimension(\n '5.375rem',\n \"The minimum width of VDatePicker's month/year picker buttons (about 86px)\",\n ),\n 'size-tab-indicator': dimension(\n '2px',\n 'The thickness of the active tab indicator (VTabs, flat/outlined)',\n ),\n 'size-table-search': dimension('16rem', \"The width of VDataTable's search field\"),\n 'size-time-picker-dial': dimension('16rem', \"The diameter of VTimePicker's clock face\"),\n 'size-time-picker-number': dimension(\n '3rem',\n \"A numeral cell on VTimePicker's face, and the hand's dot on a marker\",\n ),\n 'size-time-picker-center': dimension('0.5rem', \"The center dot of VTimePicker's face\"),\n 'size-time-picker-hand': dimension('2px', \"The thickness of the hand on VTimePicker's face\"),\n 'size-time-picker-hand-minor': dimension(\n '1rem',\n \"The dot of VTimePicker's hand on a minute off the 5-minute markers\",\n ),\n 'size-file-picker-min-block': dimension(\n '10rem',\n \"The minimum height of VFilePicker's drop zone: icon, two lines, separator and button\",\n ),\n 'size-file-picker-icon': dimension(\n '2.5rem',\n \"The large icon at the top of VFilePicker's drop zone\",\n ),\n 'size-file-picker-thumb': dimension(\n '2.5rem',\n 'The thumbnail square of a VFilePicker preview row (an image, or its type icon)',\n ),\n /*\n * A card is exactly as tall as its event is long — there is deliberately no floor — so\n * this value alone decides how much room the shortest event gets. At 4rem an hour, a\n * quarter of one is 16px, which holds a line of the title once its leading is tightened;\n * VCalendarEvent does that by measuring the card rather than by counting minutes. Lower\n * it much and the shortest events stop being readable at all.\n */\n 'size-calendar-hour': dimension('4rem', \"The height of one hour in VCalendar's time grid\"),\n 'size-calendar-gutter': dimension(\n '4.5rem',\n \"The column of hour labels beside VCalendar's time grid, wide enough for a 12-hour clock's '12:00 AM' on one line\",\n ),\n 'size-calendar-tick': dimension(\n '0.375rem',\n \"How far an hour's rule runs back into VCalendar's gutter, tying the label to its line\",\n ),\n /*\n * TRAP — the twin of `EDGE_BAND` in `VCalendar/edgeStep.ts`, which is the same strip\n * measured in JavaScript. This value is what the reader SEES light up; that one is where\n * the calendar actually starts counting down to turn the page. Move one alone and the\n * calendar pages from somewhere other than where it said it would, with nothing to point\n * at it.\n */\n 'size-calendar-edge': dimension(\n '3rem',\n 'The strip at the side of VCalendar that pages the view when a dragged event rests on it',\n ),\n 'size-calendar-day-min': dimension(\n '5rem',\n 'The width a VCalendar day column may not go below, past which the grid scrolls',\n ),\n 'size-calendar-handle': dimension(\n '0.5rem',\n \"The strip along a VCalendar card's bottom edge that its end is dragged by\",\n ),\n 'size-calendar-allday-lane': dimension('1.5rem', \"One lane of VCalendar's all-day band\"),\n 'size-calendar-allday-max': dimension(\n '7rem',\n \"The height past which VCalendar's all-day band scrolls instead of growing\",\n ),\n 'size-calendar-now-dot': dimension('0.625rem', \"The dot on VCalendar's current-time line\"),\n 'size-calendar-event-edge': dimension(\n '3px',\n 'The width of the coloured leading edge of a VCalendar event',\n ),\n 'size-calendar-gap': dimension(\n '0.125rem',\n 'The gap VCalendar keeps between two events, side by side in a day or stacked in a month',\n ),\n 'size-calendar-grip': dimension(\n '1rem',\n \"The length of the grip drawn on a VCalendar card's resize strip\",\n ),\n 'size-calendar-grip-thickness': dimension(\n '2px',\n \"The thickness of that grip, which is also its distance from the card's bottom edge\",\n ),\n 'size-calendar-year-month': dimension(\n '13rem',\n \"The narrowest a mini-month of VCalendar's year view gets before the year reflows\",\n ),\n /*\n * Sized so the default `monthEventLimit` of three chips AND the \"+N more\" line beneath\n * them fit without being clipped: 136px, less the padding, the border and the 32px day\n * button, leaves 85px against 76px of chips and a 14px more-line. Shrinking it silently\n * costs the third chip, since the cell clips rather than scrolls.\n */\n 'size-calendar-month-cell': dimension(\n '8.5rem',\n \"The minimum height of a day in VCalendar's month view\",\n ),\n 'size-calendar-year-cell': dimension(\n '1.5rem',\n \"The side of a day square in the mini-months of VCalendar's year view\",\n ),\n },\n icon: {\n 'size-sm': dimension('1rem', 'The icon size of xs controls (16px)'),\n 'size-md': dimension('1.25rem', 'The icon size of sm and md controls (20px)'),\n 'size-lg': dimension('1.5rem', 'The icon size of lg and xl controls (24px)'),\n },\n} satisfies TokenGroup\n"],"mappings":";;AAaA,IAAa,IAAW;CACtB,OAAO;EACL,SAAS,EAAM,iBAAiB,6BAA6B;EAC7D,iBAAiB,EAAM,oBAAoB,sCAAsC;EACjF,kBAAkB,EAAM,iBAAiB,wBAAwB;EACjE,mBAAmB,EAAM,iBAAiB,6CAA6C;EACvF,kBAAkB,EAAM,mBAAmB,oCAAoC;EAC/E,mBAAmB,EAAM,oBAAoB,sCAAsC;EACnF,oBAAoB,EAClB,oBACA,sFACF;EAEA,mBAAmB,EAAM,iBAAiB,iCAAiC;EAE3E,MAAM,EAAM,oBAAoB,mCAAmC;EACnE,cAAc,EACZ,oBACA,4DACF;EACA,eAAe,EAAM,oBAAoB,6BAA6B;EACtE,kBAAkB,EAAM,iBAAiB,iDAAiD;EAC1F,mBAAmB,EACjB,oBACA,oEACF;EAEA,QAAQ,EAAM,oBAAoB,sDAAsD;EACxF,iBAAiB,EAAM,oBAAoB,8BAA8B;EAEzE,QAAQ,EACN,sBACA,qEACF;EACA,gBAAgB,EAAM,sBAAsB,oCAAoC;EAChF,iBAAiB,EAAM,sBAAsB,gCAAgC;EAC7E,kBAAkB,EAAM,qBAAqB,iDAAiD;EAC9F,iBAAiB,EACf,sBACA,oEACF;EACA,eAAe,EAAM,sBAAsB,+CAA+C;EAE1F,QAAQ,EAAM,mBAAmB,6DAA6D;EAC9F,gBAAgB,EAAM,mBAAmB,oCAAoC;EAC7E,iBAAiB,EAAM,mBAAmB,gCAAgC;EAC1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EACA,2BAA2B,EACzB,UACA,sEACF;CACF;CACA,MAAM;EACJ,WAAW,EAAU,QAAQ,qCAAqC;EAClE,WAAW,EAAU,WAAW,4CAA4C;EAC5E,WAAW,EAAU,UAAU,4CAA4C;CAC7E;AACF"}
|
|
1
|
+
{"version":3,"file":"semantic.js","names":[],"sources":["../../src/tokens/semantic.ts"],"sourcesContent":["/**\n * Semantic roles alias primitives; components depend on these roles so applications can theme\n * without rewriting component CSS.\n */\nimport { color, dimension, duration, fontFamily, fontWeight, type TokenGroup } from './types'\n\nexport const semantic = {\n color: {\n surface: color('{color.white}', 'The default page background'),\n 'surface-muted': color('{color.gray.100}', 'A muted background (secondary areas)'),\n 'surface-raised': color('{color.white}', 'Raised surfaces: cards'),\n 'surface-overlay': color('{color.white}', 'Floating surfaces: dialogs, popovers, menus'),\n 'surface-sunken': color('{color.gray.50}', 'Sunken surfaces: wells, code areas'),\n 'surface-inverse': color('{color.gray.900}', 'Inverted-contrast surfaces: tooltips'),\n 'surface-skeleton': color(\n '{color.gray.200}',\n \"The background of VSkeletonLoader's silhouettes, from which its highlight is derived\",\n ),\n\n 'text-on-inverse': color('{color.white}', 'Text set on an inverted surface'),\n\n text: color('{color.gray.900}', 'The running text of the interface'),\n 'text-muted': color(\n '{color.gray.600}',\n 'Secondary text: hints, captions, descriptions, start icons',\n ),\n 'text-subtle': color('{color.gray.500}', 'Placeholders, disabled text'),\n 'text-on-accent': color('{color.white}', 'Text set on an accent/danger/success background'),\n 'text-on-warning': color(\n '{color.gray.950}',\n 'Text set on a solid warning background (amber too light for white)',\n ),\n\n border: color('{color.gray.200}', 'Dividers, and the frames of cards, tables and panels'),\n 'border-strong': color('{color.gray.300}', 'The borders of form controls'),\n\n accent: color(\n '{color.indigo.600}',\n 'The brand color: solid buttons, checked controls, the selected item',\n ),\n 'accent-hover': color('{color.indigo.700}', 'The accent color under the pointer'),\n 'accent-active': color('{color.indigo.800}', 'The accent color while pressed'),\n 'accent-surface': color('{color.indigo.50}', 'A tinted accent background (badges, selections)'),\n 'accent-border': color(\n '{color.indigo.200}',\n 'The border of a tinted accent element, matching the accent surface',\n ),\n 'accent-text': color('{color.indigo.700}', 'Accent text on a neutral or tinted background'),\n\n danger: color('{color.red.600}', 'Destructive actions and errors: solid buttons, error states'),\n 'danger-hover': color('{color.red.700}', 'The danger color under the pointer'),\n 'danger-active': color('{color.red.800}', 'The danger color while pressed'),\n 'danger-surface': color(\n '{color.red.50}',\n 'A tinted danger background (soft buttons and chips, a destructive menu item)',\n ),\n 'danger-border': color(\n '{color.red.200}',\n 'The border of a tinted danger element, matching the danger surface',\n ),\n 'danger-text': color(\n '{color.red.700}',\n 'Danger text on a neutral or tinted background: error messages, a destructive menu item',\n ),\n\n /* Green filled surfaces need step 700 to contrast with white text. */\n success: color('{color.green.700}', 'A positive outcome: solid chips, badges, notifications'),\n 'success-hover': color('{color.green.800}', 'The success color under the pointer'),\n 'success-active': color('{color.green.900}', 'The success color while pressed'),\n 'success-surface': color(\n '{color.green.50}',\n 'A tinted success background (soft chips, badges, notifications)',\n ),\n 'success-border': color(\n '{color.green.200}',\n 'The border of a tinted success element, matching the success surface',\n ),\n 'success-text': color('{color.green.800}', 'Success text on a neutral or tinted background'),\n\n warning: color(\n '{color.amber.600}',\n 'A situation that calls for attention: solid chips, badges, notifications',\n ),\n 'warning-hover': color('{color.amber.700}', 'The warning color under the pointer'),\n 'warning-active': color('{color.amber.800}', 'The warning color while pressed'),\n 'warning-surface': color(\n '{color.amber.50}',\n 'A tinted warning background (soft chips, badges, notifications)',\n ),\n 'warning-border': color(\n '{color.amber.200}',\n 'The border of a tinted warning element, matching the warning surface',\n ),\n 'warning-text': color('{color.amber.900}', 'Warning text on a neutral or tinted background'),\n\n backdrop: color('oklch(0% 0 0 / 0.45)', 'The veil behind modal dialogs'),\n\n /*\n * Keep event colours literal: root-declared var aliases resolve their hue before cards can\n * supply per-event hues.\n */\n 'event-surface': color(\n 'oklch(0.95 0.045 265)',\n 'The face of a calendar event that carries no color of its own',\n ),\n 'event-border': color(\n 'oklch(0.85 0.08 265)',\n 'The edge of that calendar event, and the bar marking its leading side',\n ),\n 'event-text': color('oklch(0.4 0.11 265)', 'The title of that calendar event'),\n },\n text: {\n family: fontFamily('{font.family.sans}', 'The running font of every component'),\n 'family-heading': fontFamily(\n '{font.family.display}',\n 'The font of the display and heading roles, the running font until it is overridden',\n ),\n 'family-code': fontFamily(\n '{font.family.mono}',\n 'The font of code content (the code role, VInputOTP)',\n ),\n display: {\n size: dimension('{font.size.5xl}'),\n weight: fontWeight('{font.weight.bold}'),\n leading: dimension('{font.leading.none}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-1': {\n size: dimension('{font.size.4xl}'),\n weight: fontWeight('{font.weight.bold}'),\n leading: dimension('{font.leading.tight}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-2': {\n size: dimension('{font.size.2xl}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.tight}'),\n tracking: dimension('{font.tracking.tight}'),\n },\n 'heading-3': {\n size: dimension('{font.size.lg}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.snug}'),\n },\n 'heading-4': {\n size: dimension('{font.size.md}'),\n weight: fontWeight('{font.weight.semibold}'),\n leading: dimension('{font.leading.snug}'),\n },\n subtitle: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n 'body-xl': {\n size: dimension('{font.size.lg}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.relaxed}'),\n },\n 'body-lg': {\n size: dimension('{font.size.md}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.relaxed}'),\n },\n 'body-md': {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n 'body-sm': {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n label: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.snug}'),\n },\n /* Choice text uses label dimensions at regular weight to remain distinct from field labels. */\n choice: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.snug}'),\n },\n caption: {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.snug}'),\n },\n overline: {\n size: dimension('{font.size.xs}'),\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.snug}'),\n tracking: dimension('{font.tracking.wide}'),\n },\n code: {\n size: dimension('{font.size.sm}'),\n weight: fontWeight('{font.weight.regular}'),\n leading: dimension('{font.leading.normal}'),\n },\n /* Control size comes from --control-font-size; this recipe supplies weight and leading only. */\n control: {\n weight: fontWeight('{font.weight.medium}'),\n leading: dimension('{font.leading.none}'),\n },\n },\n radius: {\n interactive: dimension('{radius.md}', 'Buttons, inputs, controls'),\n surface: dimension('{radius.lg}', 'Cards, alerts'),\n overlay: dimension('{radius.xl}', 'Dialogs, popovers, menus'),\n pill: dimension('{radius.full}', 'Full rounding: switches, badges, pill-shaped chips'),\n chip: dimension(\n '{radius.interactive}',\n 'Chips with shape=\"chip\", which follow the interactive radius by default',\n ),\n },\n /** Semantic transition durations are theme-independent. */\n duration: {\n fast: duration('{duration.150}', 'Color and border changes on hover, focus and press'),\n base: duration('{duration.200}', 'The default: a panel opening, a value moving'),\n slow: duration('{duration.300}', 'Movements large enough to be followed by the eye'),\n },\n focus: {\n 'ring-color': color(\n '{color.indigo.500}',\n 'The keyboard focus ring, which has to stand out against the page',\n ),\n 'ring-width': dimension('2px', 'The thickness of the focus ring'),\n 'ring-offset': dimension('2px', 'The gap between a control and its focus ring'),\n },\n control: {\n 'height-xs': dimension(\n '1.5rem',\n 'The height of every control at size=\"xs\" (24px), 4px less when compact',\n ),\n 'height-sm': dimension(\n '2rem',\n 'The height of every control at size=\"sm\" (32px), 4px less when compact',\n ),\n 'height-md': dimension(\n '2.5rem',\n 'The height of every control at size=\"md\" (40px), 4px less when compact',\n ),\n 'height-lg': dimension(\n '3rem',\n 'The height of every control at size=\"lg\" (48px), 4px less when compact',\n ),\n 'height-xl': dimension(\n '3.5rem',\n 'The height of every control at size=\"xl\" (56px), 4px less when compact',\n ),\n 'border-width': dimension('2px', 'The border of checkable controls (VCheckbox, VRadio)'),\n 'size-check': dimension('1.25rem', 'The box of checkable controls (VCheckbox, VRadio)'),\n 'size-check-mark': dimension('0.875rem', \"The tick inside VCheckbox's box\"),\n 'size-check-dot': dimension('0.5rem', \"The dot inside VRadio's circle\"),\n 'size-switch-w': dimension('2.5rem', \"The width of VSwitch's track\"),\n 'size-switch-h': dimension('1.25rem', \"The height of VSwitch's track\"),\n 'size-switch-pad': dimension(\n '0.125rem',\n \"The gap between VSwitch's thumb and the edge of its track\",\n ),\n 'action-size-sm': dimension(\n '1.25rem',\n 'The inner buttons of sm input fields (clear, a clickable icon)',\n ),\n 'action-size-md': dimension(\n '1.5rem',\n 'The inner buttons of md input fields (clear, a clickable icon)',\n ),\n 'action-size-lg': dimension(\n '1.75rem',\n 'The inner buttons of lg input fields (clear, a clickable icon)',\n ),\n 'size-slider-track': dimension('0.375rem', \"The thickness of VSlider's track\"),\n 'size-slider-thumb': dimension('1.25rem', \"The diameter of VSlider's thumb\"),\n 'size-slider-length': dimension('10rem', 'The default length of a vertical VSlider'),\n 'size-slider-field': dimension('5rem', \"The width of VSlider's number fields\"),\n 'size-carousel-block': dimension(\n '24rem',\n \"The default block size of VCarousel's viewport, which a vertical carousel needs to lay its slides out\",\n ),\n 'size-carousel-indicator': dimension(\n '0.625rem',\n 'The diameter of a VCarousel indicator dot (its hit area comes from --vectis-control-height-xs)',\n ),\n 'size-carousel-indicator-active': dimension(\n '1.25rem',\n 'The length of the active VCarousel indicator, which stretches from a dot into a pill',\n ),\n 'size-combobox-list-max-block': dimension(\n '18rem',\n \"The maximum height of VCombobox's list panel (the scrolling area)\",\n ),\n 'size-menu-min': dimension('11rem', \"The minimum width of VMenu's panel\"),\n 'size-menu-max': dimension('20rem', \"The maximum width of VMenu's panel\"),\n 'size-progress-linear-thickness': dimension(\n '0.25rem',\n \"The default thickness of VProgressLinear's bar (4px)\",\n ),\n 'size-progress-linear-length': dimension(\n '10rem',\n 'The default length of a vertical VProgressLinear, which a height set on the bar replaces',\n ),\n 'size-progress-circular-diameter': dimension(\n '3rem',\n 'The default diameter of VProgressCircular',\n ),\n 'size-progress-circular-thickness': dimension(\n '0.25rem',\n 'The default stroke thickness of VProgressCircular (4px)',\n ),\n 'size-skeleton-surface': dimension(\n '6rem',\n 'The default height of a surface-shaped VSkeletonLoader: a card, an image (96px)',\n ),\n 'size-toast-width': dimension('22rem', 'The default width of a toast'),\n 'size-tooltip-max': dimension('18rem', 'The widest a tooltip grows before it wraps (288px)'),\n 'size-dialog-width': dimension(\n '25rem',\n 'The default width of VDialog and VDialogAlert (400px), when no `width` is given',\n ),\n 'size-snackbar-min': dimension('18rem', 'The minimum width of a snackbar (288px)'),\n 'size-snackbar-max': dimension('36rem', 'The maximum width of a snackbar (576px)'),\n 'size-badge-h': dimension('1.25rem', 'The height of a VBadge pill'),\n 'size-badge-dot': dimension('0.625rem', 'The diameter of VBadge in dot mode'),\n 'size-badge-ring': dimension('2px', 'The detaching ring of a bordered VBadge'),\n 'size-avatar-ring': dimension('2px', 'The ring separating stacked avatars (VAvatarGroup)'),\n 'size-date-picker-cell': dimension('2.5rem', 'The side of a VDatePicker day cell'),\n 'size-date-picker-day': dimension(\n '{control.height.md}',\n 'The diameter of the disc a VDatePicker day is drawn on; the cell grows to hold it',\n ),\n 'size-date-picker-dot': dimension('0.25rem', 'The diameter of a VDatePicker event dot'),\n 'size-date-picker-nav-min': dimension(\n '5.375rem',\n \"The minimum width of VDatePicker's month/year picker buttons (about 86px)\",\n ),\n 'size-tab-indicator': dimension(\n '2px',\n 'The thickness of the active tab indicator (VTabs, flat/outlined)',\n ),\n 'size-table-search': dimension('16rem', \"The width of VDataTable's search field\"),\n 'size-time-picker-dial': dimension('16rem', \"The diameter of VTimePicker's clock face\"),\n 'size-time-picker-number': dimension(\n '3rem',\n \"A numeral cell on VTimePicker's face, and the hand's dot on a marker\",\n ),\n 'size-time-picker-center': dimension('0.5rem', \"The center dot of VTimePicker's face\"),\n 'size-time-picker-hand': dimension('2px', \"The thickness of the hand on VTimePicker's face\"),\n 'size-time-picker-hand-minor': dimension(\n '1rem',\n \"The dot of VTimePicker's hand on a minute off the 5-minute markers\",\n ),\n 'size-file-picker-min-block': dimension(\n '10rem',\n \"The minimum height of VFilePicker's drop zone: icon, two lines, separator and button\",\n ),\n 'size-file-picker-icon': dimension(\n '2.5rem',\n \"The large icon at the top of VFilePicker's drop zone\",\n ),\n 'size-file-picker-thumb': dimension(\n '2.5rem',\n 'The thumbnail square of a VFilePicker preview row (an image, or its type icon)',\n ),\n /*\n * This hour height must leave room for a readable title in short events; cards have no\n * minimum height.\n */\n 'size-calendar-hour': dimension('4rem', \"The height of one hour in VCalendar's time grid\"),\n 'size-calendar-gutter': dimension(\n '4.5rem',\n \"The column of hour labels beside VCalendar's time grid, wide enough for a 12-hour clock's '12:00 AM' on one line\",\n ),\n 'size-calendar-tick': dimension(\n '0.375rem',\n \"How far an hour's rule runs back into VCalendar's gutter, tying the label to its line\",\n ),\n /*\n * Keep this visual edge-strip width aligned with EDGE_BAND in VCalendar/edgeStep.ts so\n * paging starts where the highlight appears.\n */\n 'size-calendar-edge': dimension(\n '3rem',\n 'The strip at the side of VCalendar that pages the view when a dragged event rests on it',\n ),\n 'size-calendar-day-min': dimension(\n '5rem',\n 'The width a VCalendar day column may not go below, past which the grid scrolls',\n ),\n 'size-calendar-handle': dimension(\n '0.5rem',\n \"The strip along a VCalendar card's bottom edge that its end is dragged by\",\n ),\n 'size-calendar-allday-lane': dimension('1.5rem', \"One lane of VCalendar's all-day band\"),\n 'size-calendar-allday-max': dimension(\n '7rem',\n \"The height past which VCalendar's all-day band scrolls instead of growing\",\n ),\n 'size-calendar-now-dot': dimension('0.625rem', \"The dot on VCalendar's current-time line\"),\n 'size-calendar-event-edge': dimension(\n '3px',\n 'The width of the coloured leading edge of a VCalendar event',\n ),\n 'size-calendar-gap': dimension(\n '0.125rem',\n 'The gap VCalendar keeps between two events, side by side in a day or stacked in a month',\n ),\n 'size-calendar-grip': dimension(\n '1rem',\n \"The length of the grip drawn on a VCalendar card's resize strip\",\n ),\n 'size-calendar-grip-thickness': dimension(\n '2px',\n \"The thickness of that grip, which is also its distance from the card's bottom edge\",\n ),\n 'size-calendar-year-month': dimension(\n '13rem',\n \"The narrowest a mini-month of VCalendar's year view gets before the year reflows\",\n ),\n /*\n * Keep enough cell height for monthEventLimit chips and the overflow line; clipped cells do\n * not scroll to reveal hidden rows.\n */\n 'size-calendar-month-cell': dimension(\n '8.5rem',\n \"The minimum height of a day in VCalendar's month view\",\n ),\n 'size-calendar-year-cell': dimension(\n '1.5rem',\n \"The side of a day square in the mini-months of VCalendar's year view\",\n ),\n },\n icon: {\n 'size-sm': dimension('1rem', 'The icon size of xs controls (16px)'),\n 'size-md': dimension('1.25rem', 'The icon size of sm and md controls (20px)'),\n 'size-lg': dimension('1.5rem', 'The icon size of lg and xl controls (24px)'),\n },\n} satisfies TokenGroup\n"],"mappings":";;AAMA,IAAa,IAAW;CACtB,OAAO;EACL,SAAS,EAAM,iBAAiB,6BAA6B;EAC7D,iBAAiB,EAAM,oBAAoB,sCAAsC;EACjF,kBAAkB,EAAM,iBAAiB,wBAAwB;EACjE,mBAAmB,EAAM,iBAAiB,6CAA6C;EACvF,kBAAkB,EAAM,mBAAmB,oCAAoC;EAC/E,mBAAmB,EAAM,oBAAoB,sCAAsC;EACnF,oBAAoB,EAClB,oBACA,sFACF;EAEA,mBAAmB,EAAM,iBAAiB,iCAAiC;EAE3E,MAAM,EAAM,oBAAoB,mCAAmC;EACnE,cAAc,EACZ,oBAC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O,iDAAiD;EAC3F,+BAA+B,EAC7B,QACA,oEACF;EACA,8BAA8B,EAC5B,SACA,sFACF;EACA,yBAAyB,EACvB,UACA,sDACF;EACA,0BAA0B,EACxB,UACA,gFACF;EAKA,sBAAsB,EAAU,QAAQ,iDAAiD;EACzF,wBAAwB,EACtB,UACA,kHACF;EACA,sBAAsB,EACpB,YACA,uFACF;EAKA,sBAAsB,EACpB,QACA,yFACF;EACA,yBAAyB,EACvB,QACA,gFACF;EACA,wBAAwB,EACtB,UACA,2EACF;EACA,6BAA6B,EAAU,UAAU,sCAAsC;EACvF,4BAA4B,EAC1B,QACA,2EACF;EACA,yBAAyB,EAAU,YAAY,0CAA0C;EACzF,4BAA4B,EAC1B,OACA,6DACF;EACA,qBAAqB,EACnB,YACA,yFACF;EACA,sBAAsB,EACpB,QACA,iEACF;EACA,gCAAgC,EAC9B,OACA,oFACF;EACA,4BAA4B,EAC1B,SACA,kFACF;EAKA,4BAA4B,EAC1B,UACA,uDACF;EACA,2BAA2B,EACzB,UACA,sEACF;CACF;CACA,MAAM;EACJ,WAAW,EAAU,QAAQ,qCAAqC;EAClE,WAAW,EAAU,WAAW,4CAA4C;EAC5E,WAAW,EAAU,UAAU,4CAA4C;CAC7E;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark.js","names":[],"sources":["../../../src/tokens/themes/dark.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"dark.js","names":[],"sources":["../../../src/tokens/themes/dark.ts"],"sourcesContent":["/** Dark mode repoints existing semantic roles while retaining the shared primitive palette. */\nimport { color, type TokenGroup } from '../types'\n\nexport const dark = {\n color: {\n surface: color('{color.gray.950}'),\n 'surface-muted': color('{color.gray.800}'),\n 'surface-raised': color('{color.gray.900}'),\n 'surface-overlay': color('{color.gray.900}'),\n 'surface-sunken': color('oklch(11% 0.006 260)'),\n 'surface-inverse': color('{color.gray.800}'),\n 'surface-skeleton': color('{color.gray.800}'),\n\n 'text-on-inverse': color('{color.gray.50}'),\n\n text: color('{color.gray.50}'),\n 'text-muted': color('{color.gray.300}'),\n 'text-subtle': color('{color.gray.400}'),\n 'text-on-accent': color('{color.white}'),\n\n border: color('{color.gray.800}'),\n 'border-strong': color('{color.gray.700}'),\n\n accent: color('{color.indigo.500}'),\n 'accent-hover': color('{color.indigo.400}'),\n 'accent-active': color('{color.indigo.300}'),\n 'accent-surface': color('{color.indigo.950}'),\n 'accent-border': color('{color.indigo.900}'),\n 'accent-text': color('{color.indigo.300}'),\n\n /*\n * Retain explicit red/green steps for white-text contrast. Their dark-theme hover steps\n * grow darker, unlike accent and warning.\n */\n danger: color('{color.red.600}'),\n 'danger-hover': color('{color.red.700}'),\n 'danger-active': color('{color.red.800}'),\n 'danger-surface': color('{color.red.950}'),\n 'danger-border': color('{color.red.900}'),\n 'danger-text': color('{color.red.300}'),\n\n success: color('{color.green.700}'),\n 'success-hover': color('{color.green.800}'),\n 'success-active': color('{color.green.900}'),\n 'success-surface': color('{color.green.950}'),\n 'success-border': color('{color.green.900}'),\n 'success-text': color('{color.green.300}'),\n\n warning: color('{color.amber.500}'),\n 'warning-hover': color('{color.amber.400}'),\n 'warning-active': color('{color.amber.300}'),\n 'warning-surface': color('{color.amber.950}'),\n 'warning-border': color('{color.amber.900}'),\n 'warning-text': color('{color.amber.300}'),\n\n backdrop: color('oklch(0% 0 0 / 0.6)'),\n\n /* Swap event surface and text lightness in dark mode; each card still supplies its own hue. */\n 'event-surface': color('oklch(0.3 0.05 265)'),\n 'event-border': color('oklch(0.42 0.08 265)'),\n 'event-text': color('oklch(0.9 0.06 265)'),\n },\n focus: {\n 'ring-color': color('{color.indigo.400}'),\n },\n} satisfies TokenGroup\n"],"mappings":";;AAGA,IAAa,IAAO;CAClB,OAAO;EACL,SAAS,EAAM,kBAAkB;EACjC,iBAAiB,EAAM,kBAAkB;EACzC,kBAAkB,EAAM,kBAAkB;EAC1C,mBAAmB,EAAM,kBAAkB;EAC3C,kBAAkB,EAAM,sBA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$value, $type, $description? }`, gathered in nested
|
|
3
|
-
* groups that give each one its full name. The DTCG format, which is what keeps these files
|
|
4
|
-
* legible to tools other than ours.
|
|
5
|
-
*
|
|
6
|
-
* A token may ALIAS another by naming it in braces instead of stating a value, which is what
|
|
7
|
-
* lets the accent be "indigo at step 600" rather than a colour repeated in twenty places.
|
|
8
|
-
*
|
|
9
|
-
* This is THE source of truth for every visual decision in the library: `tokens.css` is
|
|
10
|
-
* generated from it, and the theming app to come will read and rewrite it directly.
|
|
11
|
-
*/
|
|
1
|
+
/** Typed DTCG tokens: nested groups of $value, $type and optional $description. */
|
|
12
2
|
export type TokenType = 'color' | 'dimension' | 'fontFamily' | 'fontWeight' | 'number' | 'duration' | 'cubicBezier' | 'shadow';
|
|
13
3
|
export interface DesignToken {
|
|
14
4
|
$value: string;
|
|
@@ -18,7 +8,7 @@ export interface DesignToken {
|
|
|
18
8
|
export interface TokenGroup {
|
|
19
9
|
[key: string]: DesignToken | TokenGroup;
|
|
20
10
|
}
|
|
21
|
-
/** Tells a token apart from a group of them, which
|
|
11
|
+
/** Tells a token apart from a group of them, which walking the tree rests on. */
|
|
22
12
|
export declare function isToken(node: DesignToken | TokenGroup): node is DesignToken;
|
|
23
13
|
export declare const color: ($value: string, $description?: string) => DesignToken;
|
|
24
14
|
export declare const dimension: ($value: string, $description?: string) => DesignToken;
|
package/dist/tokens/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/tokens/types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/tokens/types.ts"],"sourcesContent":["/** Typed DTCG tokens: nested groups of $value, $type and optional $description. */\nexport type TokenType =\n | 'color'\n | 'dimension'\n | 'fontFamily'\n | 'fontWeight'\n | 'number'\n | 'duration'\n | 'cubicBezier'\n | 'shadow'\n\nexport interface DesignToken {\n $value: string\n $type: TokenType\n $description?: string\n}\n\nexport interface TokenGroup {\n [key: string]: DesignToken | TokenGroup\n}\n\n/** Tells a token apart from a group of them, which walking the tree rests on. */\nexport function isToken(node: DesignToken | TokenGroup): node is DesignToken {\n return typeof (node as DesignToken).$value === 'string'\n}\n\nconst make =\n ($type: TokenType) =>\n ($value: string, $description?: string): DesignToken =>\n $description === undefined ? { $type, $value } : { $type, $value, $description }\n\nexport const color = make('color')\nexport const dimension = make('dimension')\nexport const fontFamily = make('fontFamily')\nexport const fontWeight = make('fontWeight')\nexport const number = make('number')\nexport const duration = make('duration')\nexport const cubicBezier = make('cubicBezier')\nexport const shadow = make('shadow')\n"],"mappings":";AAsBA,SAAgB,EAAQ,GAAqD;CAC3E,OAAO,OAAQ,EAAqB,UAAW;AACjD;AAEA,IAAM,KACH,OACA,GAAgB,MACf,MAAiB,KAAA,IAAY;CAAE;CAAO;AAAO,IAAI;CAAE;CAAO;CAAQ;AAAa,GAEtE,IAAQ,EAAK,OAAO,GACpB,IAAY,EAAK,WAAW,GAC5B,IAAa,EAAK,YAAY,GAC9B,IAAa,EAAK,YAAY,GAE9B,IAAW,EAAK,UAAU,GAC1B,IAAc,EAAK,aAAa,GAChC,IAAS,EAAK,QAAQ"}
|
package/dist/tokens.json
CHANGED
|
@@ -934,6 +934,20 @@
|
|
|
934
934
|
"$value": "{font.leading.snug}"
|
|
935
935
|
}
|
|
936
936
|
},
|
|
937
|
+
"choice": {
|
|
938
|
+
"size": {
|
|
939
|
+
"$type": "dimension",
|
|
940
|
+
"$value": "{font.size.sm}"
|
|
941
|
+
},
|
|
942
|
+
"weight": {
|
|
943
|
+
"$type": "fontWeight",
|
|
944
|
+
"$value": "{font.weight.regular}"
|
|
945
|
+
},
|
|
946
|
+
"leading": {
|
|
947
|
+
"$type": "dimension",
|
|
948
|
+
"$value": "{font.leading.snug}"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
937
951
|
"caption": {
|
|
938
952
|
"size": {
|
|
939
953
|
"$type": "dimension",
|
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* A type is normally named after whatever owns it: `ButtonTone` for VButton,
|
|
5
|
-
* `DatePickerRange` for the component that defines its shape, `FileRejection` for the module
|
|
6
|
-
* that produces it. This file is for the case where nothing does: an item's value is shared
|
|
7
|
-
* by a tab, a toggle item, a radio button and a combobox option, and naming it after any one of the three
|
|
8
|
-
* would say something untrue about the other two.
|
|
9
|
-
*
|
|
10
|
-
* It stays small on purpose. A type reaching for it should first be asked whether a component
|
|
11
|
-
* or a module really does own it.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* What identifies one item among several: a tab, a toggle item, an option in a list.
|
|
15
|
-
*
|
|
16
|
-
* A number is admitted because that is what a row from a database is keyed by, and a
|
|
17
|
-
* consumer whose options come from an API should not have to convert on the way in and back
|
|
18
|
-
* on the way out. Where the value reaches the DOM the component converts it itself.
|
|
19
|
-
*
|
|
20
|
-
* VRadio takes it too, and needs no conversion for it: the `value` ATTRIBUTE of a native radio
|
|
21
|
-
* is text, but Vue's radio v-model reads back the value exactly as it was bound rather than
|
|
22
|
-
* the attribute, so a number put in is the number handed back.
|
|
2
|
+
* Types shared across unrelated components; component-owned contracts stay in their own
|
|
3
|
+
* modules.
|
|
23
4
|
*/
|
|
5
|
+
/** What identifies one item among several: a tab, a toggle item, an option in a list. */
|
|
24
6
|
export type ItemValue = string | number;
|
package/dist/utils/array.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* ALWAYS returns a new list rather than mutating the one it was given: it is the new
|
|
5
|
-
* reference, not a change made inside the old list, that wakes a consumer's v-model.
|
|
2
|
+
* Toggle membership without mutating the input; returning a new reference propagates selection
|
|
3
|
+
* changes through v-model.
|
|
6
4
|
*/
|
|
7
5
|
export declare function toggleValue<T>(list: readonly T[], value: T): T[];
|
package/dist/utils/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","names":[],"sources":["../../src/utils/array.ts"],"sourcesContent":["// @core\n/**\n *
|
|
1
|
+
{"version":3,"file":"array.js","names":[],"sources":["../../src/utils/array.ts"],"sourcesContent":["// @core\n/**\n * Toggle membership without mutating the input; returning a new reference propagates selection\n * changes through v-model.\n */\nexport function toggleValue<T>(list: readonly T[], value: T): T[] {\n return list.includes(value) ? list.filter((v) => v !== value) : [...list, value]\n}\n"],"mappings":";AAKA,SAAgB,EAAe,GAAoB,GAAe;CAChE,OAAO,EAAK,SAAS,CAAK,IAAI,EAAK,QAAQ,MAAM,MAAM,CAAK,IAAI,CAAC,GAAG,GAAM,CAAK;AACjF"}
|
package/dist/utils/arrowNav.d.ts
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The elements the arrows may land on, discovered from the DOM rather than a registry. The
|
|
3
|
-
* selector is the caller's, and it is what excludes anything disabled.
|
|
4
|
-
*
|
|
5
|
-
* `display: none` is filtered here because it has to be: VPagination hides its neighbours
|
|
6
|
-
* through container queries as the bar narrows, and a consumer may hide a tab outright.
|
|
7
|
-
* Focus must not land on an element nobody can see. The read costs a style recalculation
|
|
8
|
-
* per element, which is why `arrowNavigate` asks for the list only once it knows the key is
|
|
9
|
-
* one it handles.
|
|
10
|
-
*/
|
|
1
|
+
/** The elements the arrows may land on, discovered from the DOM rather than a registry. */
|
|
11
2
|
export declare function navigableItems(container: HTMLElement, selector: string): HTMLElement[];
|
|
12
|
-
/**
|
|
13
|
-
* Moves focus for the arrows and Home/End, and reports whether it took the key.
|
|
14
|
-
* `preventDefault` is applied only when it did, leaving the caller free otherwise.
|
|
15
|
-
*
|
|
16
|
-
* The ends wrap. With nothing in the list focused, any arrow starts at the beginning.
|
|
17
|
-
* Left and Right name a physical side, so RTL swaps them: Right must reach the NEXT item,
|
|
18
|
-
* which is then on the left. The block axis needs no such treatment, no language
|
|
19
|
-
* reversing it.
|
|
20
|
-
*
|
|
21
|
-
* A key held with Alt, Ctrl or Meta is never taken: those are the browser's and the system's
|
|
22
|
-
* shortcuts (Alt+Left goes back a page), and cancelling one to move a focus would break it.
|
|
23
|
-
*
|
|
24
|
-
* `items` is a FUNCTION, called only once the key is known to be one of the four. A keydown
|
|
25
|
-
* handler on a container sees every key typed inside it (Tab, Enter, letters), and collecting
|
|
26
|
-
* the list costs a query plus, for most callers, one style read per element.
|
|
27
|
-
*/
|
|
3
|
+
/** Moves focus for the arrows and Home/End, and reports whether it took the key. */
|
|
28
4
|
export declare function arrowNavigate(event: KeyboardEvent, container: HTMLElement, items: () => HTMLElement[], options?: {
|
|
29
5
|
vertical?: boolean;
|
|
30
6
|
}): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrowNav.js","names":[],"sources":["../../src/utils/arrowNav.ts"],"sourcesContent":["// @keyboard @a11y
|
|
1
|
+
{"version":3,"file":"arrowNav.js","names":[],"sources":["../../src/utils/arrowNav.ts"],"sourcesContent":["// @keyboard @a11y\n/**\n * Arrow-key navigation over a row or column of controls, in one place: VPagination, VTabs,\n * VToggle, VMenuPanel and VSideNavigation all use it.\n */\nimport { isRtl } from './direction'\n\n/** The elements the arrows may land on, discovered from the DOM rather than a registry. */\nexport function navigableItems(container: HTMLElement, selector: string): HTMLElement[] {\n return [...container.querySelectorAll<HTMLElement>(selector)].filter(\n (el) => getComputedStyle(el).display !== 'none',\n )\n}\n\n/** Moves focus for the arrows and Home/End, and reports whether it took the key. */\nexport function arrowNavigate(\n event: KeyboardEvent,\n container: HTMLElement,\n items: () => HTMLElement[],\n options: { vertical?: boolean } = {},\n): boolean {\n const vertical = options.vertical ?? false\n const keys = vertical\n ? ['ArrowDown', 'ArrowUp', 'Home', 'End']\n : ['ArrowRight', 'ArrowLeft', 'Home', 'End']\n if (event.altKey || event.ctrlKey || event.metaKey || !keys.includes(event.key)) return false\n const list = items()\n if (list.length === 0) return false\n event.preventDefault()\n\n // A function, not a value: only the arrow branch asks, so Home and End are spared the\n // style recalculation that reading the direction forces.\n const forward = () =>\n vertical ? event.key === 'ArrowDown' : (event.key === 'ArrowRight') !== isRtl(container)\n const current = list.indexOf(document.activeElement as HTMLElement)\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? list.length - 1\n : current === -1\n ? 0\n : (current + (forward() ? 1 : -1) + list.length) % list.length\n list[next]?.focus()\n return true\n}\n"],"mappings":";;AAQA,SAAgB,EAAe,GAAwB,GAAiC;CACtF,OAAO,CAAC,GAAG,EAAU,iBAA8B,CAAQ,CAAC,CAAC,CAAC,QAC3D,MAAO,iBAAiB,CAAE,CAAC,CAAC,YAAY,MAC3C;AACF;AAGA,SAAgB,EACd,GACA,GACA,GACA,IAAkC,CAAC,GAC1B;CACT,IAAM,IAAW,EAAQ,YAAY,IAC/B,IAAO,IACT;EAAC;EAAa;EAAW;EAAQ;CAAK,IACtC;EAAC;EAAc;EAAa;EAAQ;CAAK;CAC7C,IAAI,EAAM,UAAU,EAAM,WAAW,EAAM,WAAW,CAAC,EAAK,SAAS,EAAM,GAAG,GAAG,OAAO;CACxF,IAAM,IAAO,EAAM;CACnB,IAAI,EAAK,WAAW,GAAG,OAAO;CAC9B,EAAM,eAAe;CAIrB,IAAM,UACJ,IAAW,EAAM,QAAQ,cAAe,EAAM,QAAQ,iBAAkB,EAAM,CAAS,GACnF,IAAU,EAAK,QAAQ,SAAS,aAA4B;CAUlE,OADA,EAPE,EAAM,QAAQ,SACV,IACA,EAAM,QAAQ,QACZ,EAAK,SAAS,IACd,MAAY,KACV,KACC,KAAW,EAAQ,IAAI,IAAI,MAAM,EAAK,UAAU,EAAK,OACtD,EAAE,MAAM,GACX;AACT"}
|
package/dist/utils/chip.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { ChipSize } from '../components/VChip/VChip.js';
|
|
2
2
|
/**
|
|
3
3
|
* The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.
|
|
4
|
-
*
|
|
5
|
-
* A chip is one step below its field, so a row of them does not push the field taller. Below
|
|
6
|
-
* the lowest step of each pair there is no smaller size left, and `compact` makes up the
|
|
4
|
+
* Below the lowest step of each pair there is no smaller size left, and `compact` makes up the
|
|
7
5
|
* difference instead, which is why an `sm` field forces it and an `md` one, already having
|
|
8
6
|
* room, does not pass its own through.
|
|
9
|
-
*
|
|
10
|
-
* The HEIGHT is what earns the module its place. The field must force its `<input>` to the
|
|
11
|
-
* chips' height or it grows on focus, and that height is decided inside the VChip subtree,
|
|
12
|
-
* out of the field's reach. Deriving it from the same pair that picks the size makes the two
|
|
13
|
-
* incapable of drifting.
|
|
14
7
|
*/
|
|
15
8
|
export type ChipFieldSize = 'sm' | 'md' | 'lg';
|
|
16
9
|
export interface ChipScale {
|
package/dist/utils/chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","names":[],"sources":["../../src/utils/chip.ts"],"sourcesContent":["import type { ChipSize } from '../components/VChip/VChip.vue'\n\n// @core\n/**\n * The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.\n
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../../src/utils/chip.ts"],"sourcesContent":["import type { ChipSize } from '../components/VChip/VChip.vue'\n\n// @core\n/**\n * The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.\n * Below the lowest step of each pair there is no smaller size left, and `compact` makes up the\n * difference instead, which is why an `sm` field forces it and an `md` one, already having\n * room, does not pass its own through.\n */\nexport type ChipFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipScale {\n size: ChipSize\n compact: boolean\n /** The chips' height, ready to be set on the field so it can match its own text to it. */\n height: string\n}\n\nexport function chipScaleFor(size: ChipFieldSize, compact: boolean): ChipScale {\n const chipSize = size === 'lg' ? 'sm' : 'xs'\n const chipCompact = size === 'lg' ? compact : size === 'sm'\n const base = `var(--vectis-control-height-${chipSize})`\n return {\n size: chipSize,\n compact: chipCompact,\n height: chipCompact ? `calc(${base} - var(--vectis-space-1))` : base,\n }\n}\n"],"mappings":";AAkBA,SAAgB,EAAa,GAAqB,GAA6B;CAC7E,IAAM,IAAW,MAAS,OAAO,OAAO,MAClC,IAAc,MAAS,OAAO,IAAU,MAAS,MACjD,IAAO,+BAA+B,EAAS;CACrD,OAAO;EACL,MAAM;EACN,SAAS;EACT,QAAQ,IAAc,QAAQ,EAAK,6BAA6B;CAClE;AACF"}
|
package/dist/utils/clock.d.ts
CHANGED
|
@@ -23,40 +23,24 @@ export declare function hourWithMeridiem(hour24: number, meridiem: Meridiem): nu
|
|
|
23
23
|
* not a time at all: `'09:30'` with PM gives `'21:30'`.
|
|
24
24
|
*/
|
|
25
25
|
export declare function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null;
|
|
26
|
-
/**
|
|
27
|
-
* Snaps a minute to the nearest allowed step and wraps it back inside the hour.
|
|
28
|
-
*
|
|
29
|
-
* Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and
|
|
30
|
-
* stepping back from 0 with the keyboard passes through -1, which is 59.
|
|
31
|
-
*/
|
|
26
|
+
/** Snaps a minute to the nearest allowed step and wraps it back inside the hour. */
|
|
32
27
|
export declare function snapMinute(minute: number, step: number): number;
|
|
33
28
|
/**
|
|
34
|
-
* Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered
|
|
35
|
-
*
|
|
36
|
-
* coordinates grow DOWNWARD and the angle is measured from the top.
|
|
29
|
+
* Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered clockwise
|
|
30
|
+
* from twelve o'clock and the nearest wins.
|
|
37
31
|
*/
|
|
38
32
|
export declare function angleToIndex(dx: number, dy: number, segments: number): number;
|
|
39
33
|
/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */
|
|
40
34
|
export declare function distanceFraction(dx: number, dy: number, radius: number): number;
|
|
41
35
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts
|
|
46
|
-
* the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the
|
|
47
|
-
* radius. Change either token without changing this and the threshold no longer separates
|
|
48
|
-
* the two rings: a tap near the boundary quietly sets the wrong hour.
|
|
36
|
+
* The number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts the rings'
|
|
37
|
+
* centres at 104px and 56px from the middle, whose midpoint is 0.625 of the radius.
|
|
49
38
|
*/
|
|
50
39
|
export declare const DIAL_INNER_THRESHOLD = 0.625;
|
|
51
40
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* TRAP: derived from the same tokens as the threshold above: the inner ring's numerals
|
|
57
|
-
* start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the
|
|
58
|
-
* dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their
|
|
59
|
-
* inner half to it.
|
|
41
|
+
* Derived from the same tokens as the threshold above: the inner ring's numerals start 32px
|
|
42
|
+
* from the middle (56px less half a 48px numeral), 0.25 of the radius, so the dead zone stops
|
|
43
|
+
* short of them. Grow it past 0.25 and the inner small hours lose their inner half to it.
|
|
60
44
|
*/
|
|
61
45
|
export declare const DIAL_DEAD_ZONE = 0.2;
|
|
62
46
|
/**
|
|
@@ -64,25 +48,21 @@ export declare const DIAL_DEAD_ZONE = 0.2;
|
|
|
64
48
|
* carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.
|
|
65
49
|
*/
|
|
66
50
|
export declare function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number;
|
|
67
|
-
/** The way back, which
|
|
51
|
+
/** The way back, which tells the hand where to point. */
|
|
68
52
|
export declare function hour24ToDial(hour: number): {
|
|
69
53
|
index: number;
|
|
70
54
|
ring: 'outer' | 'inner';
|
|
71
55
|
};
|
|
72
56
|
export interface TimeOption {
|
|
73
|
-
/** The canonical time, which
|
|
57
|
+
/** The canonical time, which the component's value will be set to. */
|
|
74
58
|
value: string;
|
|
75
59
|
/** The same time written out for the reader: "07:30", or "7:30 AM". */
|
|
76
60
|
label: string;
|
|
77
61
|
}
|
|
78
62
|
/**
|
|
79
|
-
* Every time of the day at a given interval, midnight to the last one before the next.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* itself stays one table per step and locale.
|
|
83
|
-
*
|
|
84
|
-
* A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the
|
|
85
|
-
* list stays FINITE even when the component's warning about it was ignored.
|
|
63
|
+
* Every time of the day at a given interval, midnight to the last one before the next. A
|
|
64
|
+
* nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the list
|
|
65
|
+
* stays FINITE even when the component's warning about it was ignored.
|
|
86
66
|
*/
|
|
87
67
|
export declare function timeList(step: number, locale: string, format: HourFormat): TimeOption[];
|
|
88
68
|
/**
|
|
@@ -91,12 +71,9 @@ export declare function timeList(step: number, locale: string, format: HourForma
|
|
|
91
71
|
*/
|
|
92
72
|
export declare function formatTimeMask(digits: string): string;
|
|
93
73
|
/**
|
|
94
|
-
* Where the caret belongs to sit just after `n` digits.
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* `skipSeparator` means something was INSERTED, and the caret then steps over the colon
|
|
98
|
-
* into the minutes. On a DELETION it stays in front of it, or the next Backspace steps
|
|
99
|
-
* over the colon instead of erasing a digit and the key appears to do nothing.
|
|
74
|
+
* Where the caret belongs to sit just after `n` digits. On a DELETION it stays in front of it,
|
|
75
|
+
* or the next Backspace steps over the colon instead of erasing a digit and the key appears to
|
|
76
|
+
* do nothing.
|
|
100
77
|
*/
|
|
101
78
|
export declare function timeCaret(n: number, skipSeparator?: boolean): number;
|
|
102
79
|
/**
|
package/dist/utils/clock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.js","names":[],"sources":["../../src/utils/clock.ts"],"sourcesContent":["// @ssr @core — module-wide: every export below is @core unless tagged otherwise.\n/**\n * What the CLOCK and the FIELD need of the time domain: the AM/PM arithmetic, the dial's\n * geometry, the typing mask and the list of times. VTimePicker and VTimeInput are its only\n * consumers; `./time` holds what VCalendar reads as well, and this is kept apart so that\n * no calendar pays for a dial it never draws.\n *\n * The dial's geometry lives here rather than in the component for a practical reason: jsdom\n * lays nothing out and measures every element at zero, so a calculation kept inside the\n * component is untestable.\n */\nimport { digitsOf, pad2 } from './text'\nimport { formatTime, parseTime, formatTimeDisplay } from './time'\nimport type { HourFormat, Meridiem } from './time'\n\n/**\n * Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together\n * with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven\n * at night is 11 PM.\n */\nexport function to12h(hour24: number): { hour: number; meridiem: Meridiem } {\n const meridiem: Meridiem = hour24 >= 12 ? 'PM' : 'AM'\n const hour = hour24 % 12 === 0 ? 12 : hour24 % 12\n return { hour, meridiem }\n}\n\n/**\n * The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,\n * gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.\n */\nexport function to24h(hour12: number, meridiem: Meridiem): number {\n const base = hour12 % 12 // Twelve is the zero of the cycle, not its top.\n return meridiem === 'PM' ? base + 12 : base\n}\n\n/**\n * The same hour moved into the other half of the day, or left where it is: 9 with PM gives\n * 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.\n */\nexport function hourWithMeridiem(hour24: number, meridiem: Meridiem): number {\n return to24h(to12h(hour24).hour, meridiem)\n}\n\n/**\n * A canonical time moved into a half of the day, its minutes untouched, or `null` when it is\n * not a time at all: `'09:30'` with PM gives `'21:30'`.\n */\nexport function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null {\n const parts = parseTime(time)\n return parts ? formatTime(hourWithMeridiem(parts.hour, meridiem), parts.minute) : null\n}\n\n/**\n * Snaps a minute to the nearest allowed step and wraps it back inside the hour.\n *\n * Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and\n * stepping back from 0 with the keyboard passes through -1, which is 59.\n */\nexport function snapMinute(minute: number, step: number): number {\n // A step is whole minutes: 7.5 divides 60, and wrote `09:7.5` into the model.\n const size = Math.round(step)\n const snapped = size <= 1 ? Math.round(minute) : Math.round(minute / size) * size\n return ((snapped % 60) + 60) % 60\n}\n\n/**\n * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered\n * clockwise from twelve o'clock and the nearest wins. `dy` is negated because screen\n * coordinates grow DOWNWARD and the angle is measured from the top.\n */\nexport function angleToIndex(dx: number, dy: number, segments: number): number {\n // The angle from twelve o'clock, clockwise-positive, as a fraction of a full turn.\n const angle = Math.atan2(dx, -dy)\n const turn = (angle / (2 * Math.PI) + 1) % 1\n return Math.round(turn * segments) % segments\n}\n\n/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */\nexport function distanceFraction(dx: number, dy: number, radius: number): number {\n return radius > 0 ? Math.hypot(dx, dy) / radius : 0\n}\n\n/**\n * How close to the centre a pointer must land to be aiming at the INNER ring, the one\n * holding the small hours of a 24-hour dial: the halfway mark between the two rings.\n *\n * TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts\n * the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the\n * radius. Change either token without changing this and the threshold no longer separates\n * the two rings: a tap near the boundary quietly sets the wrong hour.\n */\nexport const DIAL_INNER_THRESHOLD = 0.625\n\n/**\n * How close to the centre a pointer lands on NOTHING. At the very centre there is no angle\n * at all (`atan2(0, 0)` answers half a turn, which would set six o'clock), and the centre dot\n * drawn there is not a numeral.\n *\n * TRAP: derived from the same tokens as the threshold above: the inner ring's numerals\n * start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the\n * dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their\n * inner half to it.\n */\nexport const DIAL_DEAD_ZONE = 0.2\n\n/**\n * Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner\n * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.\n */\nexport function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number {\n if (ring === 'outer') return index === 0 ? 12 : index\n return index === 0 ? 0 : index + 12\n}\n\n/** The way back, which is what tells the hand where to point. */\nexport function hour24ToDial(hour: number): { index: number; ring: 'outer' | 'inner' } {\n if (hour === 0) return { index: 0, ring: 'inner' }\n if (hour === 12) return { index: 0, ring: 'outer' }\n if (hour > 12) return { index: hour - 12, ring: 'inner' }\n return { index: hour, ring: 'outer' }\n}\n\nexport interface TimeOption {\n /** The canonical time, which is what the component's value will be set to. */\n value: string\n /** The same time written out for the reader: \"07:30\", or \"7:30 AM\". */\n label: string\n}\n\n/**\n * Every time of the day at a given interval, midnight to the last one before the next.\n *\n * It knows nothing of the restrictions: VTimeInput filters the rows it offers, so the list\n * itself stays one table per step and locale.\n *\n * A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the\n * list stays FINITE even when the component's warning about it was ignored.\n */\nexport function timeList(step: number, locale: string, format: HourFormat): TimeOption[] {\n const safe = Number.isInteger(step) && step >= 1 && step <= 60 ? step : 60\n const out: TimeOption[] = []\n for (let m = 0; m < 24 * 60; m += safe) {\n const value = formatTime(Math.floor(m / 60), m % 60)\n out.push({ value, label: formatTimeDisplay(value, locale, format) })\n }\n return out\n}\n\n/*\n * Unlike a date's separator this one is UNIVERSAL: every language writes a time with a\n * colon, and only the 12/24-hour cycle varies. It therefore stays out of the dictionary,\n * where the empty field's `hh:mm` placeholder does belong — that one is made of the\n * initials of words.\n */\nconst TIME_SEPARATOR = ':'\n\n/**\n * Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is\n * complete: typing \"09\" already gives \"09:\", exactly as a date's separators do.\n */\nexport function formatTimeMask(digits: string): string {\n const all = digitsOf(digits).slice(0, 4)\n return all.length >= 2 ? `${all.slice(0, 2)}${TIME_SEPARATOR}${all.slice(2)}` : all\n}\n\n/**\n * Where the caret belongs to sit just after `n` digits. A closed formula rather than\n * `date.ts`'s scan, the colon always being in the same place.\n *\n * `skipSeparator` means something was INSERTED, and the caret then steps over the colon\n * into the minutes. On a DELETION it stays in front of it, or the next Backspace steps\n * over the colon instead of erasing a digit and the key appears to do nothing.\n */\nexport function timeCaret(n: number, skipSeparator = false): number {\n if (n < 2) return n\n if (n === 2) return skipSeparator ? 3 : 2\n return Math.min(n + 1, 5)\n}\n\n/**\n * A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the\n * hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to\n * the text.\n */\nexport function timeToMask(time: string | null | undefined, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n const hour = format === '12h' ? to12h(parts.hour).hour : parts.hour\n return formatTimeMask(pad2(hour) + pad2(parts.minute))\n}\n\n/**\n * What was typed read back into a canonical time, or `null` when it is incomplete, too long\n * or not a real time. On a 12-hour clock this is the ONE place the typed digits and the\n * meridiem toggle meet.\n */\nexport function parseTimeMask(\n text: string,\n format: HourFormat,\n meridiem: Meridiem = 'AM',\n): string | null {\n const digits = digitsOf(text)\n if (digits.length !== 4) return null\n const hour = Number(digits.slice(0, 2))\n const minute = Number(digits.slice(2))\n if (minute > 59) return null\n if (format === '12h')\n return hour >= 1 && hour <= 12 ? formatTime(to24h(hour, meridiem), minute) : null\n return hour <= 23 ? formatTime(hour, minute) : null\n}\n"],"mappings":";;;AAoBA,SAAgB,EAAM,GAAsD;CAC1E,IAAM,IAAqB,KAAU,KAAK,OAAO;CAEjD,OAAO;EAAE,MADI,IAAS,MAAO,IAAI,KAAK,IAAS;EAChC;CAAS;AAC1B;AAMA,SAAgB,EAAM,GAAgB,GAA4B;CAChE,IAAM,IAAO,IAAS;CACtB,OAAO,MAAa,OAAO,IAAO,KAAK;AACzC;AAMA,SAAgB,EAAiB,GAAgB,GAA4B;CAC3E,OAAO,EAAM,EAAM,CAAM,CAAC,CAAC,MAAM,CAAQ;AAC3C;AAMA,SAAgB,EAAa,GAAiC,GAAmC;CAC/F,IAAM,IAAQ,EAAU,C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AQ,CAAM;EAAE,CAAC;CACrE;CACA,OAAO;AACT;AAQA,IAAM,IAAiB;AAMvB,SAAgB,EAAe,GAAwB;CACrD,IAAM,IAAM,EAAS,CAAM,CAAC,CAAC,MAAM,GAAG,CAAC;CACvC,OAAO,EAAI,UAAU,IAAI,GAAG,EAAI,MAAM,GAAG,CAAC,IAAI,IAAiB,EAAI,MAAM,CAAC,MAAM;AAClF;AAUA,SAAgB,EAAU,GAAW,IAAgB,IAAe;CAGlE,OAFI,IAAI,IAAU,IACd,MAAM,IAAU,IAAgB,IAAI,IACjC,KAAK,IAAI,IAAI,GAAG,CAAC;AAC1B;AAOA,SAAgB,EAAW,GAAiC,GAA4B;CACtF,IAAM,IAAQ,EAAU,CAAI;CAG5B,OAFK,IAEE,EAAe,EADT,MAAW,QAAQ,EAAM,EAAM,IAAI,CAAC,CAAC,OAAO,EAAM,IAChC,IAAI,EAAK,EAAM,MAAM,CAAC,IAFlC;AAGrB;AAOA,SAAgB,EACd,GACA,GACA,IAAqB,MACN;CACf,IAAM,IAAS,EAAS,CAAI;CAC5B,IAAI,EAAO,WAAW,GAAG,OAAO;CAChC,IAAM,IAAO,OAAO,EAAO,MAAM,GAAG,CAAC,CAAC,GAChC,IAAS,OAAO,EAAO,MAAM,CAAC,CAAC;CAIrC,OAHI,IAAS,KAAW,OACpB,MAAW,QACN,KAAQ,KAAK,KAAQ,KAAK,EAAW,EAAM,GAAM,CAAQ,GAAG,CAAM,IAAI,OACxE,KAAQ,KAAK,EAAW,GAAM,CAAM,IAAI;AACjD"}
|
|
1
|
+
{"version":3,"file":"clock.js","names":[],"sources":["../../src/utils/clock.ts"],"sourcesContent":["// @ssr @core\n/**\n * Clock- and input-specific time arithmetic stays outside the smaller time module imported by\n * calendar views.\n */\nimport { digitsOf, pad2 } from './text'\nimport { formatTime, parseTime, formatTimeDisplay } from './time'\nimport type { HourFormat, Meridiem } from './time'\n\n/**\n * Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together\n * with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven\n * at night is 11 PM.\n */\nexport function to12h(hour24: number): { hour: number; meridiem: Meridiem } {\n const meridiem: Meridiem = hour24 >= 12 ? 'PM' : 'AM'\n const hour = hour24 % 12 === 0 ? 12 : hour24 % 12\n return { hour, meridiem }\n}\n\n/**\n * The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,\n * gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.\n */\nexport function to24h(hour12: number, meridiem: Meridiem): number {\n const base = hour12 % 12 // Twelve is the zero of the cycle, not its top.\n return meridiem === 'PM' ? base + 12 : base\n}\n\n/**\n * The same hour moved into the other half of the day, or left where it is: 9 with PM gives\n * 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.\n */\nexport function hourWithMeridiem(hour24: number, meridiem: Meridiem): number {\n return to24h(to12h(hour24).hour, meridiem)\n}\n\n/**\n * A canonical time moved into a half of the day, its minutes untouched, or `null` when it is\n * not a time at all: `'09:30'` with PM gives `'21:30'`.\n */\nexport function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null {\n const parts = parseTime(time)\n return parts ? formatTime(hourWithMeridiem(parts.hour, meridiem), parts.minute) : null\n}\n\n/** Snaps a minute to the nearest allowed step and wraps it back inside the hour. */\nexport function snapMinute(minute: number, step: number): number {\n const size = Math.round(step)\n const snapped = size <= 1 ? Math.round(minute) : Math.round(minute / size) * size\n return ((snapped % 60) + 60) % 60\n}\n\n/**\n * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered clockwise\n * from twelve o'clock and the nearest wins.\n */\nexport function angleToIndex(dx: number, dy: number, segments: number): number {\n const angle = Math.atan2(dx, -dy)\n const turn = (angle / (2 * Math.PI) + 1) % 1\n return Math.round(turn * segments) % segments\n}\n\n/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */\nexport function distanceFraction(dx: number, dy: number, radius: number): number {\n return radius > 0 ? Math.hypot(dx, dy) / radius : 0\n}\n\n/**\n * The number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts the rings'\n * centres at 104px and 56px from the middle, whose midpoint is 0.625 of the radius.\n */\nexport const DIAL_INNER_THRESHOLD = 0.625\n\n/**\n * Derived from the same tokens as the threshold above: the inner ring's numerals start 32px\n * from the middle (56px less half a 48px numeral), 0.25 of the radius, so the dead zone stops\n * short of them. Grow it past 0.25 and the inner small hours lose their inner half to it.\n */\nexport const DIAL_DEAD_ZONE = 0.2\n\n/**\n * Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner\n * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.\n */\nexport function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number {\n if (ring === 'outer') return index === 0 ? 12 : index\n return index === 0 ? 0 : index + 12\n}\n\n/** The way back, which tells the hand where to point. */\nexport function hour24ToDial(hour: number): { index: number; ring: 'outer' | 'inner' } {\n if (hour === 0) return { index: 0, ring: 'inner' }\n if (hour === 12) return { index: 0, ring: 'outer' }\n if (hour > 12) return { index: hour - 12, ring: 'inner' }\n return { index: hour, ring: 'outer' }\n}\n\nexport interface TimeOption {\n /** The canonical time, which the component's value will be set to. */\n value: string\n /** The same time written out for the reader: \"07:30\", or \"7:30 AM\". */\n label: string\n}\n\n/**\n * Every time of the day at a given interval, midnight to the last one before the next. A\n * nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the list\n * stays FINITE even when the component's warning about it was ignored.\n */\nexport function timeList(step: number, locale: string, format: HourFormat): TimeOption[] {\n const safe = Number.isInteger(step) && step >= 1 && step <= 60 ? step : 60\n const out: TimeOption[] = []\n for (let m = 0; m < 24 * 60; m += safe) {\n const value = formatTime(Math.floor(m / 60), m % 60)\n out.push({ value, label: formatTimeDisplay(value, locale, format) })\n }\n return out\n}\n\n/*\n * Unlike a date's separator this one is UNIVERSAL: every language writes a time with a colon,\n * and only the 12/24-hour cycle varies. It therefore stays out of the dictionary, where the\n * empty field's `hh:mm` placeholder does belong; that one is made of the initials of words.\n */\nconst TIME_SEPARATOR = ':'\n\n/**\n * Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is\n * complete: typing \"09\" already gives \"09:\", exactly as a date's separators do.\n */\nexport function formatTimeMask(digits: string): string {\n const all = digitsOf(digits).slice(0, 4)\n return all.length >= 2 ? `${all.slice(0, 2)}${TIME_SEPARATOR}${all.slice(2)}` : all\n}\n\n/**\n * Where the caret belongs to sit just after `n` digits. On a DELETION it stays in front of it,\n * or the next Backspace steps over the colon instead of erasing a digit and the key appears to\n * do nothing.\n */\nexport function timeCaret(n: number, skipSeparator = false): number {\n if (n < 2) return n\n if (n === 2) return skipSeparator ? 3 : 2\n return Math.min(n + 1, 5)\n}\n\n/**\n * A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the\n * hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to\n * the text.\n */\nexport function timeToMask(time: string | null | undefined, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n const hour = format === '12h' ? to12h(parts.hour).hour : parts.hour\n return formatTimeMask(pad2(hour) + pad2(parts.minute))\n}\n\n/**\n * What was typed read back into a canonical time, or `null` when it is incomplete, too long\n * or not a real time. On a 12-hour clock this is the ONE place the typed digits and the\n * meridiem toggle meet.\n */\nexport function parseTimeMask(\n text: string,\n format: HourFormat,\n meridiem: Meridiem = 'AM',\n): string | null {\n const digits = digitsOf(text)\n if (digits.length !== 4) return null\n const hour = Number(digits.slice(0, 2))\n const minute = Number(digits.slice(2))\n if (minute > 59) return null\n if (format === '12h')\n return hour >= 1 && hour <= 12 ? formatTime(to24h(hour, meridiem), minute) : null\n return hour <= 23 ? formatTime(hour, minute) : null\n}\n"],"mappings":";;;AAcA,SAAgB,EAAM,GAAsD;CAC1E,IAAM,IAAqB,KAAU,KAAK,OAAO;CAEjD,OAAO;EAAE,MADI,IAAS,MAAO,IAAI,KAAK,IAAS;EAChC;CAAS;AAC1B;AAMA,SAAgB,EAAM,GAAgB,GAA4B;CAChE,IAAM,I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|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Anything non-numeric, or negative, yields `undefined` rather than a custom property CSS cannot read:
|
|
5
|
-
* an invalid value breaks the geometry outright, where nothing at all lets the component's
|
|
6
|
-
* own default apply.
|
|
7
|
-
*
|
|
8
|
-
* TRAP: `Number`, never `parseFloat`: the latter reads a numeric PREFIX, so `'12rem'`
|
|
9
|
-
* would come out as `12px`, a wrong size with nothing to say so. `Number('')` being 0, a
|
|
10
|
-
* blank string is refused before it gets there.
|
|
2
|
+
* Accept complete numeric strings; parseFloat would silently reinterpret 12rem as 12px. Reject
|
|
3
|
+
* blanks before Number converts them to zero.
|
|
11
4
|
*/
|
|
12
5
|
export declare function px(v: number | string | undefined): string | undefined;
|
|
13
6
|
/**
|
|
14
|
-
* A dimension in any unit: a bare number is read as pixels, a string passes through
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* Unlike `px` above, the string is deliberately not examined: CSS judges it, and one it
|
|
18
|
-
* cannot parse falls back to whatever the component declares for itself. A NUMBER is judged
|
|
19
|
-
* here, as `px` judges one: a width computed as `NaN` or below zero, and an empty string,
|
|
20
|
-
* give nothing rather than a declaration CSS drops, so the component's own default applies.
|
|
7
|
+
* A dimension in any unit: a bare number is read as pixels, a string passes through untouched:
|
|
8
|
+
* `50%`, `20vw`, `max-content`. Unlike `px` above, the string is deliberately not examined: CSS
|
|
9
|
+
* judges it, and one it cannot parse falls back to whatever the component declares for itself.
|
|
21
10
|
*/
|
|
22
11
|
export declare function cssSize(v: number | string | undefined): string | undefined;
|
|
23
12
|
/**
|
package/dist/utils/css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n *
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n * Accept complete numeric strings; parseFloat would silently reinterpret 12rem as 12px. Reject\n * blanks before Number converts them to zero.\n */\nexport function px(v: number | string | undefined): string | undefined {\n if (v === undefined) return undefined\n const n = typeof v === 'number' ? v : v.trim() === '' ? Number.NaN : Number(v)\n return Number.isFinite(n) && n >= 0 ? `${n}px` : undefined\n}\n\n// @core\n/**\n * A dimension in any unit: a bare number is read as pixels, a string passes through untouched:\n * `50%`, `20vw`, `max-content`. Unlike `px` above, the string is deliberately not examined: CSS\n * judges it, and one it cannot parse falls back to whatever the component declares for itself.\n */\nexport function cssSize(v: number | string | undefined): string | undefined {\n if (v === undefined || v === '') return undefined\n if (typeof v === 'string') return v\n return Number.isFinite(v) && v >= 0 ? `${v}px` : undefined\n}\n\n// @core\n/**\n * The inline style carrying a consumer's own colour to a component's sheet, which derives\n * every shade from `--custom-color`: VChip, VAvatar and VBadge.\n *\n * `undefined` when no colour was given, so a style array holding it binds nothing and the\n * tone the sheet already paints stays in force.\n */\nexport function customColorStyle(\n color: string | undefined,\n): { '--custom-color': string } | undefined {\n return color === undefined ? undefined : { '--custom-color': color }\n}\n"],"mappings":";AAKA,SAAgB,EAAG,GAAoD;CACrE,IAAI,MAAM,KAAA,GAAW;CACrB,IAAM,IAAI,OAAO,KAAM,WAAW,IAAI,EAAE,KAAK,MAAM,KAAK,MAAa,OAAO,CAAC;CAC7E,OAAO,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAQA,SAAgB,EAAQ,GAAoD;CACtE,YAAM,KAAA,KAAa,MAAM,KAE7B,OADI,OAAO,KAAM,WAAiB,IAC3B,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAUA,SAAgB,EACd,GAC0C;CAC1C,OAAO,MAAU,KAAA,IAAY,KAAA,IAAY,EAAE,kBAAkB,EAAM;AACrE"}
|