@livestorm/ui-vue 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -32
- package/components-vite.js +5 -5
- package/components.d.ts +3 -3
- package/dist/UiTimelineItem.vue_vue_type_style_index_0_lang-DOLFRKcb.mjs +5565 -0
- package/dist/a11y-DIdrv5Mn.mjs +66 -0
- package/dist/breakpoints.mjs +9 -0
- package/dist/bus.mjs +5 -0
- package/dist/components.mjs +213 -1550
- package/dist/index.mjs +84 -166
- package/dist/integrations.mjs +8 -0
- package/dist/layouts.mjs +236 -0
- package/dist/responsive.mjs +25 -0
- package/dist/slot.mjs +21 -0
- package/dist/toastDSV2-wMh-UMzW.mjs +74 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/src/components/Toast/LayoutToasts.vue.d.ts +3 -0
- package/dist/types/src/components/Toast/ToastMessage.vue.d.ts +21 -0
- package/dist/types/src/components/Toast/toastDSV2.d.ts +102 -0
- package/dist/types/src/components/UiActionBar/UiActionBar.vue.d.ts +44 -0
- package/dist/types/src/components/UiActionBar/UiActionBarItem.vue.d.ts +47 -0
- package/dist/types/src/components/UiActionBar/UiActionBarSeparator.vue.d.ts +3 -0
- package/dist/types/src/components/UiActionBar/index.d.ts +4 -0
- package/dist/types/src/components/UiActionBar/types.d.ts +14 -0
- package/dist/types/src/components/UiAnimatedLogo/UiAnimatedLogo.vue.d.ts +10 -0
- package/dist/types/src/components/UiAnimatedLogo/animations-links.d.ts +3 -0
- package/dist/types/src/components/UiAvatar/UiAvatar.vue.d.ts +55 -0
- package/dist/types/src/components/UiAvatar/index.d.ts +1 -0
- package/dist/types/src/components/UiAvatarList/UiAvatarList.vue.d.ts +28 -0
- package/dist/types/src/components/UiAvatarList/index.d.ts +1 -0
- package/dist/types/src/components/UiBadge/UiBadge.vue.d.ts +47 -0
- package/dist/types/src/components/UiBadge/index.d.ts +1 -0
- package/dist/types/src/components/UiBanner/UiBanner.vue.d.ts +96 -0
- package/dist/types/src/components/UiBanner/index.d.ts +2 -0
- package/dist/types/src/components/UiBreadcrumb/UiBreadcrumb.vue.d.ts +15 -0
- package/dist/types/src/components/UiBreadcrumb/index.d.ts +2 -0
- package/dist/types/src/components/UiButton/UiButton.vue.d.ts +249 -0
- package/dist/types/src/components/UiButtonGroup/UiButtonGroup.vue.d.ts +42 -0
- package/dist/types/src/components/UiButtonGroup/UiButtonGroupItem.vue.d.ts +21 -0
- package/dist/types/src/components/UiButtonGroup/index.d.ts +3 -0
- package/dist/types/src/components/UiButtonGroup/types.d.ts +10 -0
- package/dist/types/src/components/UiCard/UiCard.vue.d.ts +31 -0
- package/dist/types/src/components/UiCarousel/UiCarousel.vue.d.ts +63 -0
- package/dist/types/src/components/UiCarousel/index.d.ts +2 -0
- package/dist/types/src/components/UiColorField/UiColorField.vue.d.ts +19 -0
- package/dist/types/src/components/UiColorField/index.d.ts +2 -0
- package/dist/types/src/components/UiColorField/types.d.ts +29 -0
- package/dist/types/src/components/UiColorPicker/UiColorPicker.vue.d.ts +35 -0
- package/dist/types/src/components/UiColorPicker/index.d.ts +2 -0
- package/dist/types/src/components/UiColorPicker/types.d.ts +97 -0
- package/dist/types/src/components/UiDialog/MarketplaceHeaderExample.vue.d.ts +28 -0
- package/dist/types/src/components/UiDialog/UiDialog.vue.d.ts +18 -0
- package/dist/types/src/components/UiDialog/UiDialogClose.vue.d.ts +10 -0
- package/dist/types/src/components/UiDialog/UiDialogContent.vue.d.ts +54 -0
- package/dist/types/src/components/UiDialog/UiDialogFooter.vue.d.ts +13 -0
- package/dist/types/src/components/UiDialog/UiDialogTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiDialog/index.d.ts +7 -0
- package/dist/types/src/components/UiDropdown/UiDropdown.vue.d.ts +42 -0
- package/dist/types/src/components/UiDropdown/UiDropdownContent.vue.d.ts +32 -0
- package/dist/types/src/components/UiDropdown/UiDropdownItem.vue.d.ts +27 -0
- package/dist/types/src/components/UiDropdown/UiDropdownSeparator.vue.d.ts +3 -0
- package/dist/types/src/components/UiDropdown/UiDropdownTrigger.vue.d.ts +45 -0
- package/dist/types/src/components/UiDropdown/context.d.ts +7 -0
- package/dist/types/src/components/UiDropdown/index.d.ts +6 -0
- package/dist/types/src/components/UiEmptyState/UiEmptyState.vue.d.ts +29 -0
- package/dist/types/src/components/UiFieldWrapper/UiFieldWrapper.vue.d.ts +36 -0
- package/dist/types/src/components/UiFieldWrapper/index.d.ts +1 -0
- package/dist/types/src/components/UiForm/UiFormField.types.d.ts +22 -0
- package/dist/types/src/components/UiForm/UiFormField.vue.d.ts +34 -0
- package/dist/types/src/components/UiForm/index.d.ts +3 -0
- package/dist/types/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue.d.ts +6 -0
- package/dist/types/src/components/UiInputCheckbox/UiInputCheckbox.vue.d.ts +108 -0
- package/dist/types/src/components/UiInputCheckbox/index.d.ts +2 -0
- package/dist/types/src/components/UiInputCheckbox/types.d.ts +1 -0
- package/dist/types/src/components/UiInputSelect/UiInputSelect.vue.d.ts +66 -0
- package/dist/types/src/components/UiInputSelect/index.d.ts +2 -0
- package/dist/types/src/components/UiInputSelect/types.d.ts +1 -0
- package/dist/types/src/components/UiInputTextarea/UiInputTextarea.vue.d.ts +49 -0
- package/dist/types/src/components/UiInputTextarea/index.d.ts +2 -0
- package/dist/types/src/components/UiInputTextarea/types.d.ts +1 -0
- package/dist/types/src/components/UiLabel/UiLabel.vue.d.ts +17 -0
- package/dist/types/src/components/UiList/UiList.vue.d.ts +27 -0
- package/dist/types/src/components/UiListItem/UiListItem.vue.d.ts +35 -0
- package/dist/types/src/components/UiLoader/UiLoader.vue.d.ts +17 -0
- package/dist/types/src/components/UiLogo/UiLogo.vue.d.ts +20 -0
- package/dist/types/src/components/UiLogo/variants/PulseVariant.vue.d.ts +3 -0
- package/dist/types/src/components/UiLogo/variants/TornadoVariant.vue.d.ts +3 -0
- package/dist/types/src/components/UiMenu/UiMenu.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuContent.vue.d.ts +30 -0
- package/dist/types/src/components/UiMenu/UiMenuGroup.vue.d.ts +16 -0
- package/dist/types/src/components/UiMenu/UiMenuItem.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuLabel.vue.d.ts +13 -0
- package/dist/types/src/components/UiMenu/UiMenuSeparator.vue.d.ts +13 -0
- package/dist/types/src/components/UiMenu/UiMenuSub.vue.d.ts +18 -0
- package/dist/types/src/components/UiMenu/UiMenuSubContent.vue.d.ts +32 -0
- package/dist/types/src/components/UiMenu/UiMenuSubTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiMenu/UiMenuTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiMenu/index.d.ts +10 -0
- package/dist/types/src/components/UiPage/UiPage.vue.d.ts +37 -0
- package/dist/types/src/components/UiPageHeader/UiPageHeader.vue.d.ts +33 -0
- package/dist/types/src/components/UiPopover/UiPopover.vue.d.ts +18 -0
- package/dist/types/src/components/UiPopover/UiPopoverAnchor.vue.d.ts +14 -0
- package/dist/types/src/components/UiPopover/UiPopoverContent.vue.d.ts +28 -0
- package/dist/types/src/components/UiPopover/UiPopoverTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiProgress/UiProgress.vue.d.ts +15 -0
- package/dist/types/src/components/UiProgress/index.d.ts +2 -0
- package/dist/types/src/components/UiProgress/types.d.ts +4 -0
- package/dist/types/src/components/UiRoomButton/UiRoomButton.vue.d.ts +29 -0
- package/dist/types/src/components/UiShell/UiShell.vue.d.ts +24 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenu.vue.d.ts +64 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuBottom.vue.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuItem.vue.d.ts +53 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuItemContent.vue.d.ts +43 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenuTop.vue.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/injection.d.ts +7 -0
- package/dist/types/src/components/UiSideMenu/types.d.ts +39 -0
- package/dist/types/src/components/UiSideMenu/useLabelHidden.d.ts +2 -0
- package/dist/types/src/components/UiSideMenu/useSideMenuLayout.d.ts +7 -0
- package/dist/types/src/components/UiStepper/UiStepper.vue.d.ts +18 -0
- package/dist/types/src/components/UiStepper/UiStepperDescription.vue.d.ts +14 -0
- package/dist/types/src/components/UiStepper/UiStepperIndicator.vue.d.ts +20 -0
- package/dist/types/src/components/UiStepper/UiStepperItem.vue.d.ts +19 -0
- package/dist/types/src/components/UiStepper/UiStepperSeparator.vue.d.ts +10 -0
- package/dist/types/src/components/UiStepper/UiStepperTitle.vue.d.ts +14 -0
- package/dist/types/src/components/UiStepper/index.d.ts +7 -0
- package/dist/types/src/components/UiTable/UiTable.vue.d.ts +20 -0
- package/dist/types/src/components/UiTable/UiTableBody.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableCell.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableHeader.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableHeaderCell.vue.d.ts +13 -0
- package/dist/types/src/components/UiTable/UiTableRow.vue.d.ts +16 -0
- package/dist/types/src/components/UiTable/index.d.ts +6 -0
- package/dist/types/src/components/UiTabs/UiTabs.vue.d.ts +37 -0
- package/dist/types/src/components/UiTabs/index.d.ts +2 -0
- package/dist/types/src/components/UiTag/UiTag.vue.d.ts +43 -0
- package/dist/types/src/components/UiTag/index.d.ts +1 -0
- package/dist/types/src/components/UiTextField/UiTextField.vue.d.ts +65 -0
- package/dist/types/src/components/UiTextField/index.d.ts +2 -0
- package/dist/types/src/components/UiTextField/types.d.ts +2 -0
- package/dist/types/src/components/UiTimeline/UiTimeline.vue.d.ts +19 -0
- package/dist/types/src/components/UiTimeline/UiTimelineItem.vue.d.ts +28 -0
- package/dist/types/src/components/UiTimeline/index.d.ts +2 -0
- package/dist/types/src/components/UiTooltip/UiTooltip.vue.d.ts +18 -0
- package/dist/types/src/components/UiTooltip/UiTooltipContent.vue.d.ts +54 -0
- package/dist/types/src/components/UiTooltip/UiTooltipProvider.vue.d.ts +17 -0
- package/dist/types/src/components/UiTooltip/UiTooltipTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiTooltip/index.d.ts +4 -0
- package/dist/types/src/composables/useButtonStyles.d.ts +20 -0
- package/dist/types/src/composables/useMobileMenu.d.ts +11 -0
- package/dist/types/src/composables/useThemeAndModes.d.ts +34 -0
- package/dist/types/src/constants/index.d.ts +2 -0
- package/dist/types/src/constants/sizes.d.ts +2 -0
- package/dist/types/src/constants/themes.d.ts +22 -0
- package/dist/types/src/integrations/index.d.ts +1 -0
- package/dist/types/src/layouts/index.d.ts +2 -0
- package/dist/types/src/mixins/DynamicAction.d.ts +30 -0
- package/dist/types/src/primitives.d.ts +6 -0
- package/dist/types/src/theme.d.ts +1 -0
- package/dist/types/src/utils/a11y.d.ts +2 -0
- package/dist/types/src/utils/breakpoints.d.ts +9 -0
- package/dist/types/src/utils/bus.d.ts +2 -0
- package/dist/types/src/utils/clipboard.d.ts +4 -0
- package/dist/types/src/utils/devices.d.ts +19 -0
- package/dist/types/src/utils/elements.d.ts +1 -0
- package/dist/types/src/utils/index.d.ts +9 -0
- package/dist/types/src/utils/numbers.d.ts +30 -0
- package/dist/types/src/utils/responsive.d.ts +5 -0
- package/dist/types/src/utils/responsive.types.d.ts +12 -0
- package/dist/types/src/utils/router.d.ts +1 -0
- package/dist/types/src/utils/slot.d.ts +8 -0
- package/dist/types/src/utils/stack-view.d.ts +10 -0
- package/dist/types/src/utils/uid.d.ts +1 -0
- package/dist/types/style.d.ts +1 -0
- package/dist/ui-vue.css +1 -0
- package/dist/useThemeAndModes-DY5SDC0a.mjs +109 -0
- package/dist/utils.mjs +111 -0
- package/index.d.ts +88 -2
- package/index.js +169 -16
- package/integrations.d.ts +10 -0
- package/package.json +127 -58
- package/src/components/Toast/LayoutToasts.vue +63 -0
- package/src/components/Toast/ToastMessage.vue +208 -0
- package/src/components/Toast/toastDSV2.ts +151 -0
- package/src/components/UiActionBar/UiActionBar.vue +86 -0
- package/src/components/UiActionBar/UiActionBarItem.vue +179 -0
- package/src/components/UiActionBar/UiActionBarSeparator.vue +18 -0
- package/src/components/UiActionBar/index.ts +4 -0
- package/src/components/UiActionBar/types.ts +24 -0
- package/src/components/UiAnimatedLogo/UiAnimatedLogo.vue +47 -0
- package/src/components/UiAnimatedLogo/animations-links.ts +6 -0
- package/src/components/UiAvatar/UiAvatar.vue +186 -0
- package/src/components/UiAvatar/index.js +1 -0
- package/src/components/UiAvatarList/UiAvatarList.vue +109 -0
- package/src/components/UiAvatarList/index.js +1 -0
- package/src/components/UiBadge/UiBadge.vue +161 -0
- package/src/components/UiBadge/index.ts +2 -0
- package/src/components/UiBanner/UiBanner.vue +363 -0
- package/src/components/UiBanner/index.ts +2 -0
- package/src/components/UiBreadcrumb/UiBreadcrumb.vue +93 -0
- package/src/components/UiBreadcrumb/index.ts +2 -0
- package/src/components/UiButton/UiButton.vue +319 -0
- package/src/components/UiButtonGroup/UiButtonGroup.vue +198 -0
- package/src/components/UiButtonGroup/UiButtonGroupItem.vue +123 -0
- package/src/components/UiButtonGroup/index.ts +3 -0
- package/src/components/UiButtonGroup/types.ts +24 -0
- package/src/components/UiCard/UiCard.vue +112 -0
- package/src/components/UiCarousel/UiCarousel.vue +215 -0
- package/src/components/UiCarousel/index.ts +2 -0
- package/src/components/UiColorField/UiColorField.vue +158 -0
- package/src/components/UiColorField/index.ts +2 -0
- package/src/components/UiColorField/types.ts +30 -0
- package/src/components/UiColorPicker/UiColorPicker.vue +487 -0
- package/src/components/UiColorPicker/index.ts +2 -0
- package/src/components/UiColorPicker/types.ts +103 -0
- package/src/components/UiDialog/MarketplaceHeaderExample.vue +217 -0
- package/src/components/UiDialog/UiDialog.md +97 -0
- package/src/components/UiDialog/UiDialog.vue +16 -0
- package/src/components/UiDialog/UiDialogClose.vue +29 -0
- package/src/components/UiDialog/UiDialogContent.vue +238 -0
- package/src/components/UiDialog/UiDialogFooter.vue +9 -0
- package/src/components/UiDialog/UiDialogTrigger.vue +12 -0
- package/src/components/UiDialog/index.ts +18 -0
- package/src/components/UiDropdown/UiDropdown.vue +48 -0
- package/src/components/UiDropdown/UiDropdownContent.vue +72 -0
- package/src/components/UiDropdown/UiDropdownItem.vue +75 -0
- package/src/components/UiDropdown/UiDropdownSeparator.vue +7 -0
- package/src/components/UiDropdown/UiDropdownTrigger.vue +239 -0
- package/src/components/UiDropdown/context.ts +9 -0
- package/src/components/UiDropdown/index.ts +21 -0
- package/src/components/UiEmptyState/UiEmptyState.vue +80 -0
- package/src/components/UiFieldWrapper/UiFieldWrapper.vue +79 -0
- package/src/components/UiFieldWrapper/index.ts +1 -0
- package/src/components/UiForm/UiFormField.types.ts +24 -0
- package/src/components/UiForm/UiFormField.vue +66 -0
- package/src/components/UiForm/index.ts +3 -0
- package/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue +28 -0
- package/src/components/UiInputCheckbox/UiInputCheckbox.vue +477 -0
- package/src/components/UiInputCheckbox/index.ts +2 -0
- package/src/components/UiInputCheckbox/types.ts +1 -0
- package/src/components/UiInputSelect/UiInputSelect.vue +166 -0
- package/src/components/UiInputSelect/index.ts +2 -0
- package/src/components/UiInputSelect/types.ts +1 -0
- package/src/components/UiInputTextarea/UiInputTextarea.vue +219 -0
- package/src/components/UiInputTextarea/index.ts +2 -0
- package/src/components/UiInputTextarea/types.ts +1 -0
- package/src/components/UiLabel/UiLabel.vue +34 -0
- package/src/components/UiList/UiList.vue +45 -0
- package/src/components/UiListItem/UiListItem.vue +108 -0
- package/src/components/UiLoader/UiLoader.vue +45 -0
- package/src/components/UiLogo/UiLogo.vue +99 -0
- package/src/components/UiLogo/variants/PulseVariant.vue +51 -0
- package/src/components/UiLogo/variants/TornadoVariant.vue +147 -0
- package/src/components/UiMenu/UiMenu.vue +15 -0
- package/src/components/UiMenu/UiMenuContent.vue +25 -0
- package/src/components/UiMenu/UiMenuGroup.vue +19 -0
- package/src/components/UiMenu/UiMenuItem.vue +18 -0
- package/src/components/UiMenu/UiMenuLabel.vue +9 -0
- package/src/components/UiMenu/UiMenuSeparator.vue +9 -0
- package/src/components/UiMenu/UiMenuSub.vue +15 -0
- package/src/components/UiMenu/UiMenuSubContent.vue +23 -0
- package/src/components/UiMenu/UiMenuSubTrigger.vue +17 -0
- package/src/components/UiMenu/UiMenuTrigger.vue +13 -0
- package/src/components/UiMenu/index.ts +10 -0
- package/src/components/UiPage/UiPage.vue +201 -0
- package/src/components/UiPageHeader/UiPageHeader.vue +128 -0
- package/src/components/UiPopover/UiPopover.vue +16 -0
- package/src/components/UiPopover/UiPopoverAnchor.vue +12 -0
- package/src/components/UiPopover/UiPopoverContent.vue +26 -0
- package/src/components/UiPopover/UiPopoverTrigger.vue +19 -0
- package/src/components/UiProgress/UiProgress.vue +92 -0
- package/src/components/UiProgress/index.ts +2 -0
- package/src/components/UiProgress/types.ts +5 -0
- package/src/components/UiRoomButton/UiRoomButton.vue +240 -0
- package/src/components/UiShell/UiShell.vue +88 -0
- package/src/components/UiSideMenu/UiSideMenu.vue +513 -0
- package/src/components/UiSideMenu/UiSideMenuBottom.vue +27 -0
- package/src/components/UiSideMenu/UiSideMenuItem.vue +102 -0
- package/src/components/UiSideMenu/UiSideMenuItemContent.vue +172 -0
- package/src/components/UiSideMenu/UiSideMenuTop.vue +29 -0
- package/src/components/UiSideMenu/injection.ts +9 -0
- package/src/components/UiSideMenu/types.ts +41 -0
- package/src/components/UiSideMenu/useLabelHidden.ts +33 -0
- package/src/components/UiSideMenu/useSideMenuLayout.ts +12 -0
- package/src/components/UiStepper/UiStepper.vue +40 -0
- package/src/components/UiStepper/UiStepperDescription.vue +27 -0
- package/src/components/UiStepper/UiStepperIndicator.vue +93 -0
- package/src/components/UiStepper/UiStepperItem.vue +30 -0
- package/src/components/UiStepper/UiStepperSeparator.vue +49 -0
- package/src/components/UiStepper/UiStepperTitle.vue +24 -0
- package/src/components/UiStepper/index.ts +17 -0
- package/src/components/UiTable/UiTable.vue +24 -0
- package/src/components/UiTable/UiTableBody.vue +5 -0
- package/src/components/UiTable/UiTableCell.vue +26 -0
- package/src/components/UiTable/UiTableHeader.vue +17 -0
- package/src/components/UiTable/UiTableHeaderCell.vue +19 -0
- package/src/components/UiTable/UiTableRow.vue +27 -0
- package/src/components/UiTable/index.ts +6 -0
- package/src/components/UiTabs/UiTabs.vue +218 -0
- package/src/components/UiTabs/index.ts +5 -0
- package/src/components/UiTag/UiTag.vue +187 -0
- package/src/components/UiTag/index.js +1 -0
- package/src/components/UiTextField/UiTextField.vue +370 -0
- package/src/components/UiTextField/index.ts +2 -0
- package/src/components/UiTextField/types.ts +2 -0
- package/src/components/UiTimeline/README.md +169 -0
- package/src/components/UiTimeline/UiTimeline.vue +58 -0
- package/src/components/UiTimeline/UiTimelineItem.vue +141 -0
- package/src/components/UiTimeline/index.ts +2 -0
- package/src/components/UiTooltip/UiTooltip.vue +16 -0
- package/src/components/UiTooltip/UiTooltipContent.vue +86 -0
- package/src/components/UiTooltip/UiTooltipProvider.vue +15 -0
- package/src/components/UiTooltip/UiTooltipTrigger.vue +19 -0
- package/src/components/UiTooltip/index.js +4 -0
- package/src/composables/useButtonStyles.ts +242 -0
- package/src/composables/useMobileMenu.ts +57 -0
- package/src/composables/useThemeAndModes.ts +225 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/sizes.ts +2 -0
- package/src/constants/themes.ts +34 -0
- package/src/css/{body.postcss → body.css} +3 -2
- package/src/css/reka-animations.css +209 -0
- package/src/css/{transitions.postcss → transitions.css} +12 -5
- package/src/global.d.ts +181 -0
- package/src/integrations/index.js +1 -0
- package/src/layouts/index.js +5 -0
- package/src/mixins/DynamicAction.js +5 -3
- package/src/primitives.ts +6 -0
- package/src/theme.ts +1 -0
- package/src/utils/a11y.ts +8 -0
- package/src/utils/{breakpoints.js → breakpoints.ts} +1 -0
- package/src/utils/clipboard.js +2 -2
- package/src/utils/devices.js +0 -3
- package/src/utils/index.js +2 -1
- package/src/utils/numbers.ts +61 -0
- package/src/utils/responsive.types.ts +12 -0
- package/src/utils/{slot.js → slot.ts} +18 -1
- package/style.js +3 -12
- package/theme.d.ts +1 -0
- package/.env +0 -1
- package/.eslintignore +0 -4
- package/.eslintrc.js +0 -47
- package/.pkg +0 -11
- package/babel.config.js +0 -5
- package/build/Dockerfile +0 -31
- package/ci/ci.yml +0 -54
- package/components-webpack.js +0 -29
- package/dist/environment-e70e5768.mjs +0 -1664
- package/dist/style.css +0 -1
- package/plugins.js +0 -17
- package/postcss.config.js +0 -1
- package/src/components/BaseAutocomplete/BaseAutocomplete.spec.js +0 -506
- package/src/components/BaseAutocomplete/BaseAutocomplete.stories.js +0 -184
- package/src/components/BaseAutocomplete/BaseAutocomplete.vue +0 -431
- package/src/components/BaseBanner/BaseBanner.spec.js +0 -32
- package/src/components/BaseBanner/BaseBanner.stories.js +0 -133
- package/src/components/BaseBanner/BaseBanner.vue +0 -229
- package/src/components/BaseButton/BaseButton.spec.js +0 -98
- package/src/components/BaseButton/BaseButton.stories.js +0 -291
- package/src/components/BaseButton/BaseButton.vue +0 -193
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap +0 -37
- package/src/components/BaseButton/__snapshots__/BaseButton.spec.js.snap.old +0 -31
- package/src/components/BaseCheckbox/BaseCheckbox.stories.js +0 -82
- package/src/components/BaseCheckbox/BaseCheckbox.vue +0 -161
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.stories.js +0 -84
- package/src/components/BaseDropdownMenu/BaseDropdownMenu.vue +0 -251
- package/src/components/BaseDropdownMenu/BaseDropdownMenuButton.vue +0 -26
- package/src/components/BaseDropdownMenu/BaseDropdownMenuDivider.vue +0 -10
- package/src/components/BaseDropdownMenu/BaseDropdownMenuItem.vue +0 -206
- package/src/components/BaseDropdownMenu/BaseDropdownMenuSearch.vue +0 -49
- package/src/components/BaseDropdownMenu/BaseDropdownMenuTitle.vue +0 -26
- package/src/components/BaseModal/BaseModal.stories.js +0 -143
- package/src/components/BaseModal/BaseModal.vue +0 -187
- package/src/components/BaseModal/BaseModalContent.vue +0 -164
- package/src/components/BaseModal/BaseModalContentOld.vue +0 -242
- package/src/components/BaseRating/BaseRating.spec.js +0 -46
- package/src/components/BaseRating/BaseRating.stories.js +0 -46
- package/src/components/BaseRating/BaseRating.vue +0 -119
- package/src/components/BaseSelect/BaseSelect.stories.js +0 -177
- package/src/components/BaseSelect/BaseSelect.vue +0 -443
- package/src/components/BaseSelect/BaseSelectGroup.vue +0 -34
- package/src/components/BaseSelect/BaseSelectOption.vue +0 -219
- package/src/components/BaseSwitch/BaseSwitch.stories.js +0 -44
- package/src/components/BaseSwitch/BaseSwitch.vue +0 -114
- package/src/components/BaseTag/BaseTag.stories.js +0 -123
- package/src/components/BaseTag/BaseTag.vue +0 -244
- package/src/css/button.postcss +0 -354
- package/src/css/checkbox-radio.postcss +0 -152
- package/src/css/icon.postcss +0 -9
- package/src/css/loader.postcss +0 -120
- package/src/css/popper.postcss +0 -143
- package/src/css/tailwind-utilities.postcss +0 -1
- package/src/css/tailwind.postcss +0 -2
- package/style-postcss.d.ts +0 -3
- package/style-postcss.js +0 -2
- package/tailwind.config.base.cjs +0 -88
- package/tailwind.config.js +0 -9
- package/tsconfig.check.json +0 -13
- package/tsconfig.json +0 -66
- package/vite.config.js +0 -43
- package/vitest.setup.js +0 -26
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
/** Visual variant of the timeline item */
|
|
6
|
+
variant?: 'default' | 'primary' | 'success' | 'warning' | 'danger'
|
|
7
|
+
/** Whether to show the connecting line */
|
|
8
|
+
showConnector?: boolean
|
|
9
|
+
/** Size of the indicator dot */
|
|
10
|
+
indicatorSize?: 'sm' | 'md' | 'lg'
|
|
11
|
+
/** Custom icon class for the indicator (optional) */
|
|
12
|
+
indicatorIcon?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
variant: 'default',
|
|
17
|
+
showConnector: true,
|
|
18
|
+
indicatorSize: 'md',
|
|
19
|
+
indicatorIcon: undefined,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const indicatorClasses = computed(() => {
|
|
23
|
+
const baseClasses = [
|
|
24
|
+
'ui-timeline-item__indicator',
|
|
25
|
+
'flex',
|
|
26
|
+
'items-center',
|
|
27
|
+
'justify-center',
|
|
28
|
+
'rounded-full',
|
|
29
|
+
'shrink-0',
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
// Size classes
|
|
33
|
+
const sizeClasses = {
|
|
34
|
+
sm: props.indicatorIcon ? ['w-5', 'h-5'] : ['w-2', 'h-2'],
|
|
35
|
+
md: props.indicatorIcon ? ['w-6', 'h-6'] : ['w-3', 'h-3'],
|
|
36
|
+
lg: props.indicatorIcon ? ['w-8', 'h-8'] : ['w-4', 'h-4'],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Variant classes
|
|
40
|
+
const variantClasses = {
|
|
41
|
+
default: props.indicatorIcon
|
|
42
|
+
? ['bg-surface-neutral-alpha-200', 'text-text-neutral-base']
|
|
43
|
+
: ['bg-surface-neutral-alpha-300'],
|
|
44
|
+
primary: props.indicatorIcon
|
|
45
|
+
? ['bg-surface-primary-alpha-200', 'text-text-primary-base']
|
|
46
|
+
: ['bg-surface-primary-bg-alpha'],
|
|
47
|
+
success: props.indicatorIcon
|
|
48
|
+
? ['bg-surface-success-alpha-200', 'text-text-success-base']
|
|
49
|
+
: ['bg-surface-success-bg-alpha'],
|
|
50
|
+
warning: props.indicatorIcon
|
|
51
|
+
? ['bg-surface-warning-alpha-200', 'text-text-warning-base']
|
|
52
|
+
: ['bg-surface-warning-bg-alpha'],
|
|
53
|
+
danger: props.indicatorIcon
|
|
54
|
+
? ['bg-surface-danger-bg-alpha', 'text-text-neutral-invert-base']
|
|
55
|
+
: ['bg-surface-danger-bg-alpha'],
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return [
|
|
59
|
+
...baseClasses,
|
|
60
|
+
...sizeClasses[props.indicatorSize],
|
|
61
|
+
...variantClasses[props.variant],
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const connectorClasses = computed(() => {
|
|
66
|
+
const variantClasses = {
|
|
67
|
+
default: 'bg-surface-neutral-alpha-400',
|
|
68
|
+
primary: 'bg-surface-primary-alpha-300',
|
|
69
|
+
success: 'bg-surface-success-alpha-300',
|
|
70
|
+
warning: 'bg-surface-warning-alpha-300',
|
|
71
|
+
danger: 'bg-surface-danger-alpha-400',
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return ['ui-timeline-item__connector', variantClasses[props.variant]]
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const iconSize = computed(() => {
|
|
78
|
+
const sizes = {
|
|
79
|
+
sm: 'w-1 h-1',
|
|
80
|
+
md: 'w-2 h-2',
|
|
81
|
+
lg: 'w-3 h-3',
|
|
82
|
+
}
|
|
83
|
+
return sizes[props.indicatorSize]
|
|
84
|
+
})
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div class="ui-timeline-item">
|
|
89
|
+
<!-- Left side: Indicator and connector -->
|
|
90
|
+
<div class="ui-timeline-item__indicator-wrapper">
|
|
91
|
+
<!-- Indicator -->
|
|
92
|
+
<div :class="indicatorClasses">
|
|
93
|
+
<span
|
|
94
|
+
v-if="indicatorIcon"
|
|
95
|
+
:class="[indicatorIcon, iconSize]"
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<!-- Connector line -->
|
|
100
|
+
<div
|
|
101
|
+
v-if="showConnector"
|
|
102
|
+
:class="connectorClasses"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<!-- Right side: Content -->
|
|
107
|
+
<div class="ui-timeline-item__content">
|
|
108
|
+
<slot />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<style>
|
|
114
|
+
@reference '@livestorm/ui-tokens/output/supernova/index.css';
|
|
115
|
+
.ui-timeline-item {
|
|
116
|
+
@apply flex gap-4 relative;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ui-timeline-item__indicator-wrapper {
|
|
120
|
+
@apply flex flex-col items-center shrink-0 self-stretch;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ui-timeline-item__connector {
|
|
124
|
+
@apply w-px flex-1 mt-2 mb-2;
|
|
125
|
+
min-height: 2rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ui-timeline-item__content {
|
|
129
|
+
@apply flex-1 pb-4;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Remove bottom padding from last item */
|
|
133
|
+
.ui-timeline-item:last-child .ui-timeline-item__content {
|
|
134
|
+
@apply pb-0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Hide connector for last item */
|
|
138
|
+
.ui-timeline-item:last-child .ui-timeline-item__connector {
|
|
139
|
+
@apply hidden;
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- UiTooltip.vue -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui'
|
|
4
|
+
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TooltipRootProps>()
|
|
7
|
+
const emits = defineEmits<TooltipRootEmits>()
|
|
8
|
+
|
|
9
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<TooltipRoot v-bind="{ ...forwarded, ...$attrs }">
|
|
14
|
+
<slot />
|
|
15
|
+
</TooltipRoot>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import type { TooltipContentEmits, TooltipContentProps } from 'reka-ui'
|
|
4
|
+
import { TooltipContent, TooltipPortal, TooltipArrow, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
|
|
6
|
+
interface Props extends TooltipContentProps {
|
|
7
|
+
/**
|
|
8
|
+
* The color semantic mode for the tooltip
|
|
9
|
+
* @default 'light'
|
|
10
|
+
*/
|
|
11
|
+
colorsSemantic?: 'light' | 'dark'
|
|
12
|
+
/**
|
|
13
|
+
* The maximum width of the tooltip
|
|
14
|
+
* @default 'base'
|
|
15
|
+
*/
|
|
16
|
+
maxWidth?: 'xs' | 'sm' | 'md' | 'base' | 'lg' | 'xl'
|
|
17
|
+
/**
|
|
18
|
+
* Whether to show the arrow pointing to the trigger
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
showArrow?: boolean
|
|
22
|
+
/**
|
|
23
|
+
* Width of the arrow in pixels
|
|
24
|
+
* @default 10
|
|
25
|
+
*/
|
|
26
|
+
arrowWidth?: number
|
|
27
|
+
/**
|
|
28
|
+
* Height of the arrow in pixels
|
|
29
|
+
* @default 5
|
|
30
|
+
*/
|
|
31
|
+
arrowHeight?: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
35
|
+
sideOffset: 12,
|
|
36
|
+
colorsSemantic: 'light',
|
|
37
|
+
maxWidth: 'base',
|
|
38
|
+
showArrow: true,
|
|
39
|
+
arrowWidth: 10,
|
|
40
|
+
arrowHeight: 5,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const emits = defineEmits<TooltipContentEmits>()
|
|
44
|
+
|
|
45
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
46
|
+
|
|
47
|
+
const maxWidthClass = computed(() => {
|
|
48
|
+
const widthMap = {
|
|
49
|
+
xs: 'max-w-[150px]',
|
|
50
|
+
sm: 'max-w-[240px]',
|
|
51
|
+
md: 'max-w-md',
|
|
52
|
+
base: 'max-w-xs',
|
|
53
|
+
lg: 'max-w-lg',
|
|
54
|
+
xl: 'max-w-xl',
|
|
55
|
+
}
|
|
56
|
+
return widthMap[props.maxWidth]
|
|
57
|
+
})
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<TooltipPortal>
|
|
62
|
+
<TooltipContent
|
|
63
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
64
|
+
:data-colors-semantic="props.colorsSemantic"
|
|
65
|
+
:class="[
|
|
66
|
+
'ui-tooltip-content py-1.5 px-3 bg-surface-neutral-invert-bg-alpha text-text-neutral-invert-base text-content-text-md-regular rounded-md text-center z-50 shadow-shadows-drop-shadow-lg',
|
|
67
|
+
'data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95',
|
|
68
|
+
maxWidthClass
|
|
69
|
+
]"
|
|
70
|
+
>
|
|
71
|
+
<slot />
|
|
72
|
+
<TooltipArrow
|
|
73
|
+
v-if="props.showArrow"
|
|
74
|
+
:width="props.arrowWidth"
|
|
75
|
+
:height="props.arrowHeight"
|
|
76
|
+
class="fill-surface-neutral-invert-bg-alpha"
|
|
77
|
+
/>
|
|
78
|
+
</TooltipContent>
|
|
79
|
+
</TooltipPortal>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
.ui-tooltip-content {
|
|
84
|
+
transform-origin: var(--reka-tooltip-content-transform-origin, center);
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipProviderProps } from 'reka-ui'
|
|
3
|
+
import { TooltipProvider } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
withDefaults(defineProps<TooltipProviderProps>(), {
|
|
6
|
+
delayDuration: 700,
|
|
7
|
+
skipDelayDuration: 300,
|
|
8
|
+
})
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TooltipProvider v-bind="$props">
|
|
13
|
+
<slot />
|
|
14
|
+
</TooltipProvider>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipTriggerProps } from 'reka-ui'
|
|
3
|
+
import { TooltipTrigger, useForwardProps } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipTriggerProps>()
|
|
6
|
+
|
|
7
|
+
// Forward declared props (e.g. `asChild`) to reka — otherwise they'd be
|
|
8
|
+
// consumed here and never reach TooltipTrigger, so `as-child` would be ignored
|
|
9
|
+
// and reka would wrap the slot in its own <button>.
|
|
10
|
+
const forwarded = useForwardProps(props)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<TooltipTrigger
|
|
15
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</TooltipTrigger>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { computed, type MaybeRefOrGetter, toValue } from 'vue'
|
|
2
|
+
|
|
3
|
+
// Single source of truth for the action-button visual language (background,
|
|
4
|
+
// text, border, hover/active overlays) keyed by `variant` × `color`. Both
|
|
5
|
+
// `UiButton` and `UiDropdownTrigger` consume this so a trigger styled as a
|
|
6
|
+
// tertiary button stays pixel-identical to a real `UiButton` without copying
|
|
7
|
+
// token names around.
|
|
8
|
+
//
|
|
9
|
+
// NOTE: every class here must be a complete literal string — Tailwind's static
|
|
10
|
+
// extractor can't see interpolated class names (`bg-${token}`), so the overlay
|
|
11
|
+
// maps are split per pseudo-prefix (`group-hover:` for the layered button,
|
|
12
|
+
// `before:` for the single-element trigger) rather than built at runtime.
|
|
13
|
+
|
|
14
|
+
export const BUTTON_VARIANTS = ['cta', 'cta-alpha', 'secondary', 'tertiary'] as const
|
|
15
|
+
export type ButtonVariant = typeof BUTTON_VARIANTS[number]
|
|
16
|
+
|
|
17
|
+
export const BUTTON_COLORS = ['primary', 'neutral', 'success', 'warning', 'error', 'neutral-invert'] as const
|
|
18
|
+
export type ButtonColor = typeof BUTTON_COLORS[number]
|
|
19
|
+
|
|
20
|
+
// Resting background — only the filled variants paint one. `tertiary` is
|
|
21
|
+
// transparent at rest (just text + hover overlay).
|
|
22
|
+
const BG_MAP: Partial<Record<ButtonVariant, Record<ButtonColor, string>>> = {
|
|
23
|
+
'cta': {
|
|
24
|
+
'primary': 'bg-actions-primary-idle',
|
|
25
|
+
'neutral': 'bg-actions-neutral-idle',
|
|
26
|
+
'neutral-invert': 'bg-actions-neutral-invert-idle',
|
|
27
|
+
'success': 'bg-actions-success-idle',
|
|
28
|
+
'warning': 'bg-actions-warning-idle',
|
|
29
|
+
'error': 'bg-actions-danger-idle',
|
|
30
|
+
},
|
|
31
|
+
'cta-alpha': {
|
|
32
|
+
'primary': 'bg-actions-primary-idle-alpha-strong',
|
|
33
|
+
'neutral': 'bg-actions-neutral-idle-alpha-strong',
|
|
34
|
+
'neutral-invert': 'bg-actions-neutral-invert-idle-alpha-strong',
|
|
35
|
+
'success': 'bg-actions-success-idle-alpha-strong',
|
|
36
|
+
'warning': 'bg-actions-warning-idle-alpha-strong',
|
|
37
|
+
'error': 'bg-actions-danger-idle-alpha-strong',
|
|
38
|
+
},
|
|
39
|
+
'secondary': {
|
|
40
|
+
'primary': 'bg-actions-primary-idle-alpha-light',
|
|
41
|
+
'neutral': 'bg-actions-neutral-idle-alpha-light',
|
|
42
|
+
'neutral-invert': 'bg-actions-neutral-invert-idle-alpha-light',
|
|
43
|
+
'success': 'bg-actions-success-idle-alpha-light',
|
|
44
|
+
'warning': 'bg-actions-warning-idle-alpha-light',
|
|
45
|
+
'error': 'bg-actions-danger-idle-alpha-light',
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const TEXT_MAP: Record<ButtonVariant, Record<ButtonColor, string>> = {
|
|
50
|
+
'cta': {
|
|
51
|
+
'primary': 'text-actions-neutral-invert-idle',
|
|
52
|
+
'neutral': 'text-actions-neutral-invert-idle',
|
|
53
|
+
'neutral-invert': 'text-actions-neutral-idle',
|
|
54
|
+
'success': 'text-actions-neutral-invert-idle',
|
|
55
|
+
'warning': 'text-actions-neutral-invert-idle',
|
|
56
|
+
'error': 'text-actions-neutral-invert-idle',
|
|
57
|
+
},
|
|
58
|
+
'cta-alpha': {
|
|
59
|
+
'primary': 'text-actions-neutral-invert-idle',
|
|
60
|
+
'neutral': 'text-actions-neutral-invert-idle',
|
|
61
|
+
'neutral-invert': 'text-actions-neutral-idle',
|
|
62
|
+
'success': 'text-actions-neutral-invert-idle',
|
|
63
|
+
'warning': 'text-actions-neutral-invert-idle',
|
|
64
|
+
'error': 'text-actions-neutral-invert-idle',
|
|
65
|
+
},
|
|
66
|
+
'secondary': {
|
|
67
|
+
'primary': 'text-actions-primary-idle',
|
|
68
|
+
'neutral': 'text-actions-neutral-idle',
|
|
69
|
+
'neutral-invert': 'text-actions-neutral-invert-idle',
|
|
70
|
+
'success': 'text-actions-success-idle',
|
|
71
|
+
'warning': 'text-actions-warning-idle',
|
|
72
|
+
'error': 'text-actions-danger-idle',
|
|
73
|
+
},
|
|
74
|
+
'tertiary': {
|
|
75
|
+
'primary': 'text-actions-primary-idle',
|
|
76
|
+
'neutral': 'text-actions-neutral-idle',
|
|
77
|
+
'neutral-invert': 'text-actions-neutral-invert-idle',
|
|
78
|
+
'success': 'text-actions-success-idle',
|
|
79
|
+
'warning': 'text-actions-warning-idle',
|
|
80
|
+
'error': 'text-actions-danger-idle',
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Border — only `secondary` draws one.
|
|
85
|
+
const BORDER_MAP: Record<ButtonColor, string[]> = {
|
|
86
|
+
'primary': ['border', 'border-borders-primary-strong'],
|
|
87
|
+
'neutral': ['border', 'border-borders-neutral-strong'],
|
|
88
|
+
'neutral-invert': ['border', 'border-borders-neutral-invert-strong'],
|
|
89
|
+
'success': ['border', 'border-borders-success-strong'],
|
|
90
|
+
'warning': ['border', 'border-borders-warning-strong'],
|
|
91
|
+
'error': ['border', 'border-borders-danger-strong'],
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Hover overlay tints keyed by `variant-color`, in both the `group-hover:`
|
|
95
|
+
// flavor (layered button overlay element) and the `before:` flavor
|
|
96
|
+
// (single-element trigger pseudo). Kept as literals for Tailwind extraction.
|
|
97
|
+
const HOVER_OVERLAY_GROUP: Record<string, string> = {
|
|
98
|
+
'cta-primary': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
99
|
+
'cta-neutral': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
100
|
+
'cta-neutral-invert': 'group-hover:bg-actions-neutral-hover-overlay',
|
|
101
|
+
'cta-success': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
102
|
+
'cta-warning': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
103
|
+
'cta-error': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
104
|
+
|
|
105
|
+
'cta-alpha-primary': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
106
|
+
'cta-alpha-neutral': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
107
|
+
'cta-alpha-neutral-invert': 'group-hover:bg-actions-neutral-hover-overlay',
|
|
108
|
+
'cta-alpha-success': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
109
|
+
'cta-alpha-warning': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
110
|
+
'cta-alpha-error': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
111
|
+
|
|
112
|
+
'secondary-primary': 'group-hover:bg-actions-primary-hover-overlay',
|
|
113
|
+
'secondary-neutral': 'group-hover:bg-actions-neutral-hover-overlay',
|
|
114
|
+
'secondary-neutral-invert': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
115
|
+
'secondary-success': 'group-hover:bg-actions-success-hover-overlay',
|
|
116
|
+
'secondary-warning': 'group-hover:bg-actions-warning-hover-overlay',
|
|
117
|
+
'secondary-error': 'group-hover:bg-actions-danger-hover-overlay',
|
|
118
|
+
|
|
119
|
+
'tertiary-primary': 'group-hover:bg-actions-primary-hover-overlay',
|
|
120
|
+
'tertiary-neutral': 'group-hover:bg-actions-neutral-hover-overlay',
|
|
121
|
+
'tertiary-neutral-invert': 'group-hover:bg-actions-neutral-invert-hover-overlay',
|
|
122
|
+
'tertiary-success': 'group-hover:bg-actions-success-hover-overlay',
|
|
123
|
+
'tertiary-warning': 'group-hover:bg-actions-warning-hover-overlay',
|
|
124
|
+
'tertiary-error': 'group-hover:bg-actions-danger-hover-overlay',
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const ACTIVE_OVERLAY_GROUP: Record<string, string> = {
|
|
128
|
+
'cta-primary': 'group-active:bg-actions-primary-pressed-overlay',
|
|
129
|
+
'cta-neutral': 'group-active:bg-actions-neutral-invert-pressed-overlay',
|
|
130
|
+
'cta-neutral-invert': 'group-active:bg-actions-neutral-pressed-overlay',
|
|
131
|
+
'cta-success': 'group-active:bg-actions-success-pressed-overlay',
|
|
132
|
+
'cta-warning': 'group-active:bg-actions-warning-pressed-overlay',
|
|
133
|
+
'cta-error': 'group-active:bg-actions-danger-pressed-overlay',
|
|
134
|
+
|
|
135
|
+
'cta-alpha-primary': 'group-active:bg-actions-primary-pressed-overlay',
|
|
136
|
+
'cta-alpha-neutral': 'group-active:bg-actions-neutral-pressed-overlay',
|
|
137
|
+
'cta-alpha-neutral-invert': 'group-active:bg-actions-neutral-invert-pressed-overlay',
|
|
138
|
+
'cta-alpha-success': 'group-active:bg-actions-neutral-pressed-overlay',
|
|
139
|
+
'cta-alpha-warning': 'group-active:bg-actions-danger-pressed-overlay',
|
|
140
|
+
'cta-alpha-error': 'group-active:bg-actions-danger-pressed-overlay',
|
|
141
|
+
|
|
142
|
+
'secondary-primary': 'group-active:bg-actions-primary-pressed-overlay',
|
|
143
|
+
'secondary-neutral': 'group-active:bg-actions-neutral-idle-alpha-light',
|
|
144
|
+
'secondary-neutral-invert': 'group-active:bg-actions-neutral-invert-idle-alpha-light',
|
|
145
|
+
'secondary-success': 'group-active:bg-actions-success-pressed-overlay',
|
|
146
|
+
'secondary-warning': 'group-active:bg-actions-warning-pressed-overlay',
|
|
147
|
+
'secondary-error': 'group-active:bg-actions-danger-pressed-overlay',
|
|
148
|
+
|
|
149
|
+
'tertiary-primary': 'group-active:bg-actions-primary-pressed-overlay',
|
|
150
|
+
'tertiary-neutral': 'group-active:bg-actions-neutral-pressed-overlay',
|
|
151
|
+
'tertiary-neutral-invert': 'group-active:bg-actions-neutral-invert-pressed-overlay',
|
|
152
|
+
'tertiary-success': 'group-active:bg-actions-success-pressed-overlay',
|
|
153
|
+
'tertiary-warning': 'group-active:bg-actions-warning-pressed-overlay',
|
|
154
|
+
'tertiary-error': 'group-active:bg-actions-danger-pressed-overlay',
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// `before:`-prefixed hover overlay, for the single-element trigger that paints
|
|
158
|
+
// its overlay through a `::before` pseudo rather than a sibling div.
|
|
159
|
+
const HOVER_OVERLAY_BEFORE: Record<string, string> = {
|
|
160
|
+
'cta-primary': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
161
|
+
'cta-neutral': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
162
|
+
'cta-neutral-invert': 'before:bg-actions-neutral-hover-overlay',
|
|
163
|
+
'cta-success': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
164
|
+
'cta-warning': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
165
|
+
'cta-error': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
166
|
+
|
|
167
|
+
'cta-alpha-primary': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
168
|
+
'cta-alpha-neutral': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
169
|
+
'cta-alpha-neutral-invert': 'before:bg-actions-neutral-hover-overlay',
|
|
170
|
+
'cta-alpha-success': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
171
|
+
'cta-alpha-warning': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
172
|
+
'cta-alpha-error': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
173
|
+
|
|
174
|
+
'secondary-primary': 'before:bg-actions-primary-hover-overlay',
|
|
175
|
+
'secondary-neutral': 'before:bg-actions-neutral-hover-overlay',
|
|
176
|
+
'secondary-neutral-invert': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
177
|
+
'secondary-success': 'before:bg-actions-success-hover-overlay',
|
|
178
|
+
'secondary-warning': 'before:bg-actions-warning-hover-overlay',
|
|
179
|
+
'secondary-error': 'before:bg-actions-danger-hover-overlay',
|
|
180
|
+
|
|
181
|
+
'tertiary-primary': 'before:bg-actions-primary-hover-overlay',
|
|
182
|
+
'tertiary-neutral': 'before:bg-actions-neutral-hover-overlay',
|
|
183
|
+
'tertiary-neutral-invert': 'before:bg-actions-neutral-invert-hover-overlay',
|
|
184
|
+
'tertiary-success': 'before:bg-actions-success-hover-overlay',
|
|
185
|
+
'tertiary-warning': 'before:bg-actions-warning-hover-overlay',
|
|
186
|
+
'tertiary-error': 'before:bg-actions-danger-hover-overlay',
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface UseButtonStylesOptions {
|
|
190
|
+
variant: MaybeRefOrGetter<ButtonVariant>
|
|
191
|
+
color: MaybeRefOrGetter<ButtonColor>
|
|
192
|
+
/** When true, overlay classes resolve to empty (disabled/loading). */
|
|
193
|
+
disabled?: MaybeRefOrGetter<boolean>
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function useButtonStyles(options: UseButtonStylesOptions) {
|
|
197
|
+
const variant = computed(() => toValue(options.variant))
|
|
198
|
+
const color = computed(() => toValue(options.color))
|
|
199
|
+
const disabled = computed(() => toValue(options.disabled) ?? false)
|
|
200
|
+
const key = computed(() => `${variant.value}-${color.value}`)
|
|
201
|
+
|
|
202
|
+
/** Resting background class (filled variants only); `''` for tertiary. */
|
|
203
|
+
const bgClass = computed(() => BG_MAP[variant.value]?.[color.value] ?? '')
|
|
204
|
+
|
|
205
|
+
/** Text color class for the current variant × color. */
|
|
206
|
+
const textClass = computed(() => TEXT_MAP[variant.value][color.value])
|
|
207
|
+
|
|
208
|
+
/** Border classes — only `secondary` paints a border. */
|
|
209
|
+
const borderClasses = computed(() =>
|
|
210
|
+
variant.value === 'secondary' ? (BORDER_MAP[color.value] ?? []) : [],
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Overlay classes for the layered-button pattern: a sibling overlay element
|
|
215
|
+
* tinted on `group-hover` / `group-active`. Empty when disabled.
|
|
216
|
+
*/
|
|
217
|
+
const overlayClasses = computed(() => {
|
|
218
|
+
if (disabled.value) return []
|
|
219
|
+
return [
|
|
220
|
+
HOVER_OVERLAY_GROUP[key.value] ?? '',
|
|
221
|
+
ACTIVE_OVERLAY_GROUP[key.value] ?? '',
|
|
222
|
+
]
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Hover overlay class for the single-element pattern, applied through the
|
|
227
|
+
* element's own `::before` pseudo. Empty when disabled.
|
|
228
|
+
*/
|
|
229
|
+
const beforeHoverOverlayClass = computed(() =>
|
|
230
|
+
disabled.value ? '' : (HOVER_OVERLAY_BEFORE[key.value] ?? ''),
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
variant,
|
|
235
|
+
color,
|
|
236
|
+
bgClass,
|
|
237
|
+
textClass,
|
|
238
|
+
borderClasses,
|
|
239
|
+
overlayClasses,
|
|
240
|
+
beforeHoverOverlayClass,
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// packages/ui-vue/src/composables/useMobileMenu.ts
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
// Namespace for UI shell related state
|
|
5
|
+
const UiShellState = {
|
|
6
|
+
isMobileMenuOpen: ref(false),
|
|
7
|
+
// Number of mounted components (e.g. UiPageHeader) that render their own
|
|
8
|
+
// open-menu trigger. UiShell uses this to decide whether it must provide a
|
|
9
|
+
// fallback hamburger, so a headerless page still has a way to open the menu.
|
|
10
|
+
triggerCount: ref(0),
|
|
11
|
+
// Label shown next to UiShell's fallback menu topbar. Pages set this (via
|
|
12
|
+
// setMenuLabel) to give the headerless mobile topbar a meaningful title
|
|
13
|
+
// (e.g. "Home"); null falls back to UiShell's openMenuLabel prop default.
|
|
14
|
+
menuLabel: ref<string | null>(null),
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useMobileMenu () {
|
|
18
|
+
const toggle = () => {
|
|
19
|
+
UiShellState.isMobileMenuOpen.value = !UiShellState.isMobileMenuOpen.value
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const open = () => {
|
|
23
|
+
UiShellState.isMobileMenuOpen.value = true
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const close = () => {
|
|
27
|
+
UiShellState.isMobileMenuOpen.value = false
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Register/unregister an open-menu trigger. Call registerTrigger() on mount
|
|
31
|
+
// and unregisterTrigger() on unmount from any component that renders one.
|
|
32
|
+
const registerTrigger = () => {
|
|
33
|
+
UiShellState.triggerCount.value++
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const unregisterTrigger = () => {
|
|
37
|
+
UiShellState.triggerCount.value = Math.max(0, UiShellState.triggerCount.value - 1)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Set the fallback menu topbar label (e.g. from a page). Pass null to clear
|
|
41
|
+
// it — typically on unmount, so it doesn't leak to the next route.
|
|
42
|
+
const setMenuLabel = (label: string | null) => {
|
|
43
|
+
UiShellState.menuLabel.value = label
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
isOpen: UiShellState.isMobileMenuOpen,
|
|
48
|
+
hasTrigger: computed(() => UiShellState.triggerCount.value > 0),
|
|
49
|
+
menuLabel: UiShellState.menuLabel,
|
|
50
|
+
toggle,
|
|
51
|
+
open,
|
|
52
|
+
close,
|
|
53
|
+
registerTrigger,
|
|
54
|
+
unregisterTrigger,
|
|
55
|
+
setMenuLabel,
|
|
56
|
+
}
|
|
57
|
+
}
|