@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,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
|
+
import { ACTION_BAR_CONTEXT_KEY } from './types'
|
|
4
|
+
|
|
5
|
+
const ctx = inject(ACTION_BAR_CONTEXT_KEY, null)
|
|
6
|
+
const isVertical = computed(() => ctx?.orientation.value === 'vertical')
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div
|
|
11
|
+
role="separator"
|
|
12
|
+
:aria-orientation="isVertical ? 'horizontal' : 'vertical'"
|
|
13
|
+
data-testid="ui-action-bar-separator"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
class="shrink-0 bg-borders-neutral-light"
|
|
16
|
+
:class="isVertical ? 'h-px w-full my-0.5' : 'w-px h-5 mx-0.5 self-center'"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as UiActionBar } from './UiActionBar.vue'
|
|
2
|
+
export { default as UiActionBarItem } from './UiActionBarItem.vue'
|
|
3
|
+
export { default as UiActionBarSeparator } from './UiActionBarSeparator.vue'
|
|
4
|
+
export type { ActionBarOrientation, ActionBarSize } from './types'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type ActionBarOrientation = 'horizontal' | 'vertical'
|
|
4
|
+
export type ActionBarSize = 'sm' | 'md'
|
|
5
|
+
export type ActionBarPosition =
|
|
6
|
+
| 'top-left'
|
|
7
|
+
| 'top-right'
|
|
8
|
+
| 'center-left'
|
|
9
|
+
| 'center-right'
|
|
10
|
+
| 'bottom-left'
|
|
11
|
+
| 'bottom-right'
|
|
12
|
+
|
|
13
|
+
export interface ActionBarContext {
|
|
14
|
+
orientation: ComputedRef<ActionBarOrientation>
|
|
15
|
+
size: ComputedRef<ActionBarSize>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Injected by UiActionBar so child items and separators can adapt their
|
|
20
|
+
* layout (icon size, hover-tooltip side, separator direction) without the
|
|
21
|
+
* consumer threading props down manually.
|
|
22
|
+
*/
|
|
23
|
+
export const ACTION_BAR_CONTEXT_KEY: InjectionKey<ActionBarContext> =
|
|
24
|
+
Symbol('ui-action-bar-context')
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { DotLottieVue } from "@lottiefiles/dotlottie-vue";
|
|
4
|
+
import {
|
|
5
|
+
LIVESTORM_ANIMATED_LOGO_TORNADO_URL,
|
|
6
|
+
LIVESTORM_ANIMATED_LOGO_STAIR_URL,
|
|
7
|
+
LIVESTORM_ANIMATED_LOGO_STREAMING_URL,
|
|
8
|
+
} from "./animations-links";
|
|
9
|
+
|
|
10
|
+
type AnimatedLogo = "tornado" | "stair" | "streaming";
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
animatedLogo: AnimatedLogo;
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
height: number;
|
|
16
|
+
width: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = defineProps<Props>();
|
|
20
|
+
|
|
21
|
+
const animatedLogoUrl = computed(() => {
|
|
22
|
+
switch (props.animatedLogo) {
|
|
23
|
+
case "tornado":
|
|
24
|
+
return LIVESTORM_ANIMATED_LOGO_TORNADO_URL;
|
|
25
|
+
case "stair":
|
|
26
|
+
return LIVESTORM_ANIMATED_LOGO_STAIR_URL;
|
|
27
|
+
case "streaming":
|
|
28
|
+
return LIVESTORM_ANIMATED_LOGO_STREAMING_URL;
|
|
29
|
+
default:
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="ui-logo-loader">
|
|
37
|
+
<DotLottieVue
|
|
38
|
+
:style="{
|
|
39
|
+
height: props.height + 'rem',
|
|
40
|
+
width: props.width + 'rem',
|
|
41
|
+
}"
|
|
42
|
+
autoplay
|
|
43
|
+
:loop="props.loop"
|
|
44
|
+
:src="animatedLogoUrl"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const LIVESTORM_ANIMATED_LOGO_TORNADO_URL =
|
|
2
|
+
"https://lottie.host/ba46e3f4-5e79-4762-9c20-405348ee3387/zHDFDAAD5F.lottie";
|
|
3
|
+
export const LIVESTORM_ANIMATED_LOGO_STAIR_URL =
|
|
4
|
+
"https://lottie.host/81c2307c-1cbd-4594-b978-fd5eaf342bf6/4XKfuEedla.lottie";
|
|
5
|
+
export const LIVESTORM_ANIMATED_LOGO_STREAMING_URL =
|
|
6
|
+
"https://lottie.host/d1427490-2228-4dc4-94e9-bf73a4851b3f/eAMtMNYScd.lottie";
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
:class="rootClasses"
|
|
4
|
+
:style="hasBadge ? undefined : customStyle"
|
|
5
|
+
:data-size="size"
|
|
6
|
+
:data-variant="variant"
|
|
7
|
+
>
|
|
8
|
+
<span
|
|
9
|
+
:class="surfaceClasses"
|
|
10
|
+
:style="hasBadge ? customStyle : undefined"
|
|
11
|
+
>
|
|
12
|
+
<img
|
|
13
|
+
v-if="src && !imageFailed"
|
|
14
|
+
:src="src"
|
|
15
|
+
:alt="alt ?? fullName"
|
|
16
|
+
class="w-full h-full object-cover"
|
|
17
|
+
@error="imageFailed = true"
|
|
18
|
+
>
|
|
19
|
+
<span
|
|
20
|
+
v-else-if="initials"
|
|
21
|
+
class="px-0.5 overflow-hidden text-ellipsis whitespace-nowrap"
|
|
22
|
+
data-recording-sensitive
|
|
23
|
+
>
|
|
24
|
+
{{ initials }}
|
|
25
|
+
</span>
|
|
26
|
+
<span
|
|
27
|
+
v-else
|
|
28
|
+
:class="[icon, iconSizeClass]"
|
|
29
|
+
/>
|
|
30
|
+
</span>
|
|
31
|
+
<slot
|
|
32
|
+
v-if="hasBadge"
|
|
33
|
+
name="badge"
|
|
34
|
+
/>
|
|
35
|
+
</span>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { computed, ref, useSlots, watch } from 'vue'
|
|
40
|
+
|
|
41
|
+
interface Props {
|
|
42
|
+
/** Image URL. Initials are shown when missing or when the image fails to load. */
|
|
43
|
+
src?: string | null
|
|
44
|
+
firstName?: string | null
|
|
45
|
+
lastName?: string | null
|
|
46
|
+
/** Custom text rendered instead of initials (e.g. `+4` for overflow chips). */
|
|
47
|
+
customText?: string | null
|
|
48
|
+
/**
|
|
49
|
+
* Avatar size. Maps to the `--spacing-component-*` tokens:
|
|
50
|
+
* `xs` 24, `sm` 32, `md` 40, `lg` 48, `xl` 64, `10xl` 128.
|
|
51
|
+
*/
|
|
52
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '10xl'
|
|
53
|
+
/**
|
|
54
|
+
* `default` is light-on-dark (used standalone or inside an avatar list);
|
|
55
|
+
* `more` is the light-grey `+N` chip used by `UiAvatarList` overflow.
|
|
56
|
+
*/
|
|
57
|
+
variant?: 'default' | 'more'
|
|
58
|
+
/** Optional `<img>` alt — falls back to the full name. */
|
|
59
|
+
alt?: string
|
|
60
|
+
/**
|
|
61
|
+
* Custom background color (hex or any CSS color). Used for initials
|
|
62
|
+
* avatars when the backend stores a per-user color (legacy
|
|
63
|
+
* `BaseUserAvatar` parity). Ignored when `src` resolves or when the
|
|
64
|
+
* `more` variant is used.
|
|
65
|
+
*/
|
|
66
|
+
color?: string | null
|
|
67
|
+
/**
|
|
68
|
+
* Icon class shown when there is no image and no name to derive
|
|
69
|
+
* initials from. Accepts any `i-ls-*` UnoCSS icon name.
|
|
70
|
+
*/
|
|
71
|
+
icon?: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
75
|
+
src: null,
|
|
76
|
+
firstName: null,
|
|
77
|
+
lastName: null,
|
|
78
|
+
customText: null,
|
|
79
|
+
size: 'md',
|
|
80
|
+
variant: 'default',
|
|
81
|
+
alt: undefined,
|
|
82
|
+
color: null,
|
|
83
|
+
icon: 'i-ls-user-fill',
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const customStyle = computed(() => {
|
|
87
|
+
// Custom color only applies to the initials/icon state. When an image
|
|
88
|
+
// resolves it covers the background, and the `more` variant uses its own
|
|
89
|
+
// light-grey background.
|
|
90
|
+
if (props.variant === 'more') return undefined
|
|
91
|
+
if (props.src && !imageFailed.value) return undefined
|
|
92
|
+
if (!props.color) return undefined
|
|
93
|
+
return { backgroundColor: props.color }
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const imageFailed = ref(false)
|
|
97
|
+
watch(() => props.src, () => { imageFailed.value = false })
|
|
98
|
+
|
|
99
|
+
const initials = computed(() => {
|
|
100
|
+
if (props.customText) return props.customText
|
|
101
|
+
const f = props.firstName?.trim()?.[0] ?? ''
|
|
102
|
+
const l = props.lastName?.trim()?.[0] ?? ''
|
|
103
|
+
return (f + l).toUpperCase() || null
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const fullName = computed(() => `${props.firstName ?? ''} ${props.lastName ?? ''}`.trim())
|
|
107
|
+
|
|
108
|
+
// Pixel sizes match the `--spacing-component-*` tokens; font sizes pick the
|
|
109
|
+
// closest typography token for each diameter so we stay aligned with the
|
|
110
|
+
// design system instead of using raw Tailwind text scales.
|
|
111
|
+
const sizeClasses = computed(() => {
|
|
112
|
+
switch (props.size) {
|
|
113
|
+
case 'sm':
|
|
114
|
+
return 'w-8 h-8 text-content-legends-bold-md'
|
|
115
|
+
case 'md':
|
|
116
|
+
return 'w-10 h-10 text-content-text-md-bold'
|
|
117
|
+
case 'lg':
|
|
118
|
+
return 'w-12 h-12 text-content-text-lg-bold'
|
|
119
|
+
case 'xl':
|
|
120
|
+
return 'w-16 h-16 text-title-md-bold'
|
|
121
|
+
case '10xl':
|
|
122
|
+
return 'w-32 h-32 text-title-lg-bold'
|
|
123
|
+
case 'xs':
|
|
124
|
+
default:
|
|
125
|
+
return 'w-6 h-6 text-content-badges-bold-md'
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
// Match the icon to the text size at each avatar size so the fallback glyph
|
|
130
|
+
// reads at the same optical weight as the initials it replaces.
|
|
131
|
+
// xs=10px, sm=12px, md=14px, lg=16px, xl=24px, 10xl=32px.
|
|
132
|
+
const iconSizeClass = computed(() => {
|
|
133
|
+
switch (props.size) {
|
|
134
|
+
case 'sm':
|
|
135
|
+
return 'w-3 h-3'
|
|
136
|
+
case 'md':
|
|
137
|
+
return 'w-3.5 h-3.5'
|
|
138
|
+
case 'lg':
|
|
139
|
+
return 'w-4 h-4'
|
|
140
|
+
case 'xl':
|
|
141
|
+
return 'w-6 h-6'
|
|
142
|
+
case '10xl':
|
|
143
|
+
return 'w-8 h-8'
|
|
144
|
+
case 'xs':
|
|
145
|
+
default:
|
|
146
|
+
return 'w-2.5 h-2.5'
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
const variantClasses = computed(() => {
|
|
151
|
+
switch (props.variant) {
|
|
152
|
+
case 'more':
|
|
153
|
+
return 'bg-surface-neutral-100 text-text-neutral-base'
|
|
154
|
+
case 'default':
|
|
155
|
+
default:
|
|
156
|
+
return 'bg-surface-neutral-invert-bg-main text-text-neutral-invert-base'
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
// A `badge` slot opts the avatar into a `relative` root (so the corner badge
|
|
161
|
+
// can overflow) and moves the circular clip + background to an inner surface.
|
|
162
|
+
const slots = useSlots()
|
|
163
|
+
const hasBadge = computed(() => !!slots.badge)
|
|
164
|
+
|
|
165
|
+
// Root element classes. Without a badge the root is the clipped circle itself
|
|
166
|
+
// (identical to the original markup, so `UiAvatarList` is unaffected). With a
|
|
167
|
+
// badge the root only positions; the clip lives on the surface below.
|
|
168
|
+
const rootClasses = computed(() =>
|
|
169
|
+
hasBadge.value
|
|
170
|
+
? ['ui-avatar relative inline-flex shrink-0', sizeClasses.value]
|
|
171
|
+
: [
|
|
172
|
+
'ui-avatar inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden text-center',
|
|
173
|
+
sizeClasses.value,
|
|
174
|
+
variantClasses.value,
|
|
175
|
+
],
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
// Inner surface. `contents` when there's no badge (the element vanishes from
|
|
179
|
+
// layout, leaving the root as the only box). When badged it becomes the
|
|
180
|
+
// clipped, background-painted circle filling the root.
|
|
181
|
+
const surfaceClasses = computed(() =>
|
|
182
|
+
hasBadge.value
|
|
183
|
+
? ['inline-flex items-center justify-center w-full h-full rounded-full overflow-hidden text-center', variantClasses.value]
|
|
184
|
+
: 'contents',
|
|
185
|
+
)
|
|
186
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './UiAvatar.vue'
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="['ui-avatar-list inline-flex items-center', containerPaddingClass]"
|
|
4
|
+
:data-size="size"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
v-for="(item, idx) in visibleItems"
|
|
8
|
+
:key="item.id ?? idx"
|
|
9
|
+
:class="['flex border border-actions-neutral-invert-idle-alpha-strong rounded-full overflow-hidden', overlapClass]"
|
|
10
|
+
>
|
|
11
|
+
<UiAvatar
|
|
12
|
+
:src="item.src"
|
|
13
|
+
:first-name="item.firstName"
|
|
14
|
+
:last-name="item.lastName"
|
|
15
|
+
:color="item.color"
|
|
16
|
+
:size="size"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div
|
|
20
|
+
v-if="overflowCount > 0"
|
|
21
|
+
:class="['flex border border-actions-neutral-invert-idle-alpha-strong rounded-full overflow-hidden', overlapClass]"
|
|
22
|
+
>
|
|
23
|
+
<UiAvatar
|
|
24
|
+
:custom-text="`+${overflowCount}`"
|
|
25
|
+
:size="size"
|
|
26
|
+
variant="more"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { computed } from 'vue'
|
|
34
|
+
import UiAvatar from '../UiAvatar/UiAvatar.vue'
|
|
35
|
+
|
|
36
|
+
export interface AvatarListItem {
|
|
37
|
+
id?: string | number
|
|
38
|
+
firstName?: string | null
|
|
39
|
+
lastName?: string | null
|
|
40
|
+
src?: string | null
|
|
41
|
+
/** Per-user background color (hex/CSS) used for the initials state. */
|
|
42
|
+
color?: string | null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface Props {
|
|
46
|
+
items: AvatarListItem[]
|
|
47
|
+
/**
|
|
48
|
+
* Total number of items represented by this list. Defaults to `items.length`.
|
|
49
|
+
* Set when `items` is already truncated server-side and you want the overflow
|
|
50
|
+
* count to reflect the true total.
|
|
51
|
+
*/
|
|
52
|
+
total?: number | null
|
|
53
|
+
/** Maximum visible avatars before showing the `+N` overflow chip. */
|
|
54
|
+
max?: number
|
|
55
|
+
/** Mirrors `UiAvatar`'s size scale. The overlap scales with the size. */
|
|
56
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '10xl'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
60
|
+
total: null,
|
|
61
|
+
max: 5,
|
|
62
|
+
size: 'md',
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const effectiveTotal = computed(() => props.total ?? props.items.length)
|
|
66
|
+
|
|
67
|
+
const visibleItems = computed(() => props.items.slice(0, props.max))
|
|
68
|
+
|
|
69
|
+
const overflowCount = computed(() => Math.max(0, effectiveTotal.value - props.max))
|
|
70
|
+
|
|
71
|
+
// Overlap scales with the avatar diameter so larger sizes don't look
|
|
72
|
+
// disproportionately stacked. The container reserves matching right padding so
|
|
73
|
+
// the rightmost avatar is fully visible.
|
|
74
|
+
const overlapClass = computed(() => {
|
|
75
|
+
switch (props.size) {
|
|
76
|
+
case 'sm':
|
|
77
|
+
return '-mr-2'
|
|
78
|
+
case 'md':
|
|
79
|
+
return '-mr-2.5'
|
|
80
|
+
case 'lg':
|
|
81
|
+
return '-mr-3'
|
|
82
|
+
case 'xl':
|
|
83
|
+
return '-mr-4'
|
|
84
|
+
case '10xl':
|
|
85
|
+
return '-mr-8'
|
|
86
|
+
case 'xs':
|
|
87
|
+
default:
|
|
88
|
+
return '-mr-1.5'
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const containerPaddingClass = computed(() => {
|
|
93
|
+
switch (props.size) {
|
|
94
|
+
case 'sm':
|
|
95
|
+
return 'pr-2'
|
|
96
|
+
case 'md':
|
|
97
|
+
return 'pr-2.5'
|
|
98
|
+
case 'lg':
|
|
99
|
+
return 'pr-3'
|
|
100
|
+
case 'xl':
|
|
101
|
+
return 'pr-4'
|
|
102
|
+
case '10xl':
|
|
103
|
+
return 'pr-8'
|
|
104
|
+
case 'xs':
|
|
105
|
+
default:
|
|
106
|
+
return 'pr-1.5'
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './UiAvatarList.vue'
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="badgeClasses"
|
|
4
|
+
:data-color="color"
|
|
5
|
+
:data-variant="variant"
|
|
6
|
+
>
|
|
7
|
+
<span
|
|
8
|
+
v-if="count !== undefined"
|
|
9
|
+
>
|
|
10
|
+
{{ displayCount }}
|
|
11
|
+
</span>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { computed } from 'vue'
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
/**
|
|
20
|
+
* Optional count to display (if provided, shows number; if not, shows dot indicator)
|
|
21
|
+
*/
|
|
22
|
+
count?: number | string
|
|
23
|
+
/**
|
|
24
|
+
* Color variant of the badge
|
|
25
|
+
*/
|
|
26
|
+
color?: 'primary' | 'neutral' | 'danger' | 'warning' | 'success'
|
|
27
|
+
/**
|
|
28
|
+
* Visual variant of the badge
|
|
29
|
+
*/
|
|
30
|
+
variant?: 'light' | 'strong'
|
|
31
|
+
/**
|
|
32
|
+
* Maximum count to display before showing "+"
|
|
33
|
+
*/
|
|
34
|
+
maxCount?: number
|
|
35
|
+
/**
|
|
36
|
+
* Badge size:
|
|
37
|
+
* - `md` (default): standard badge metrics + bold badge type.
|
|
38
|
+
* - `sm`: tighter 12px metrics with a smaller, regular-weight glyph — for
|
|
39
|
+
* single-character indicators (e.g. a role initial).
|
|
40
|
+
*/
|
|
41
|
+
size?: 'sm' | 'md'
|
|
42
|
+
/**
|
|
43
|
+
* Force equal width/height (a fixed circle) instead of a pill that grows
|
|
44
|
+
* with its content. Use for single-character indicators that shouldn't
|
|
45
|
+
* stretch. Independent of `size`.
|
|
46
|
+
*/
|
|
47
|
+
square?: boolean
|
|
48
|
+
/**
|
|
49
|
+
* Show the `help` cursor on hover. Set this when the consumer attaches a
|
|
50
|
+
* tooltip to the badge (the badge itself doesn't own the tooltip).
|
|
51
|
+
*/
|
|
52
|
+
hasTooltip?: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
56
|
+
count: undefined,
|
|
57
|
+
color: 'neutral',
|
|
58
|
+
variant: 'light',
|
|
59
|
+
maxCount: 99,
|
|
60
|
+
size: 'md',
|
|
61
|
+
square: false,
|
|
62
|
+
hasTooltip: false,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const hasCount = computed(() => props.count !== undefined)
|
|
66
|
+
|
|
67
|
+
const displayCount = computed(() => {
|
|
68
|
+
if (props.count === undefined) return ''
|
|
69
|
+
|
|
70
|
+
const numCount = typeof props.count === 'string' ? parseInt(props.count, 10) : props.count
|
|
71
|
+
|
|
72
|
+
if (isNaN(numCount)) return props.count
|
|
73
|
+
if (numCount > props.maxCount) return `${props.maxCount}+`
|
|
74
|
+
|
|
75
|
+
return String(numCount)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const badgeClasses = computed(() => {
|
|
79
|
+
const baseClasses = [
|
|
80
|
+
'inline-flex',
|
|
81
|
+
'items-center',
|
|
82
|
+
'justify-center',
|
|
83
|
+
'rounded-2xl',
|
|
84
|
+
'shrink-0',
|
|
85
|
+
// Only hint interactivity when a tooltip is attached by the consumer.
|
|
86
|
+
props.hasTooltip ? 'cursor-help' : 'cursor-default',
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
// Size classes (only matter when there's a count — the dot indicator is
|
|
90
|
+
// always a fixed 12px circle). `square` forces equal w/h (no growth);
|
|
91
|
+
// otherwise the badge is a pill that grows with its content. `sm` uses
|
|
92
|
+
// tighter 12px metrics, `md` the standard ones.
|
|
93
|
+
const dotClasses = ['w-3', 'h-3']
|
|
94
|
+
const squareCountClasses = props.size === 'sm' ? ['w-3', 'h-3'] : ['w-4', 'h-4']
|
|
95
|
+
const pillCountClasses = props.size === 'sm'
|
|
96
|
+
? ['min-w-3', 'min-h-3', 'px-1']
|
|
97
|
+
: ['min-w-4', 'min-h-4', 'px-1', 'py-0.5']
|
|
98
|
+
const sizeClasses = hasCount.value
|
|
99
|
+
? props.square ? squareCountClasses : pillCountClasses
|
|
100
|
+
: dotClasses
|
|
101
|
+
|
|
102
|
+
// Text classes (only for count badges). The `sm` size forces a smaller,
|
|
103
|
+
// regular-weight glyph; `md` keeps the default bold badge type.
|
|
104
|
+
const textClasses = hasCount.value
|
|
105
|
+
? props.size === 'sm'
|
|
106
|
+
? ['text-[8px]', 'font-normal', 'leading-none', 'text-center'] // @TODO: apply text style token
|
|
107
|
+
: ['text-content-badges-bold-md', 'text-center']
|
|
108
|
+
: []
|
|
109
|
+
|
|
110
|
+
// Color and variant classes
|
|
111
|
+
const colorVariantClasses = {
|
|
112
|
+
primary: {
|
|
113
|
+
light: hasCount.value
|
|
114
|
+
? ['bg-surface-primary-alpha-300', 'text-text-primary-base']
|
|
115
|
+
: ['bg-surface-primary-alpha-300'],
|
|
116
|
+
strong: hasCount.value
|
|
117
|
+
? ['bg-surface-primary-bg-alpha', 'text-text-neutral-invert-base']
|
|
118
|
+
: ['bg-surface-primary-bg-alpha'],
|
|
119
|
+
},
|
|
120
|
+
neutral: {
|
|
121
|
+
light: hasCount.value
|
|
122
|
+
? ['bg-surface-neutral-alpha-300', 'text-text-neutral-base']
|
|
123
|
+
: ['bg-surface-neutral-alpha-300'],
|
|
124
|
+
strong: hasCount.value
|
|
125
|
+
? ['bg-surface-neutral-invert-bg-alpha', 'text-text-neutral-invert-base']
|
|
126
|
+
: ['bg-surface-neutral-invert-bg-alpha'],
|
|
127
|
+
},
|
|
128
|
+
danger: {
|
|
129
|
+
light: hasCount.value
|
|
130
|
+
? ['bg-surface-danger-alpha-300', 'text-text-danger-base']
|
|
131
|
+
: ['bg-surface-danger-alpha-300'],
|
|
132
|
+
strong: hasCount.value
|
|
133
|
+
? ['bg-surface-danger-bg-alpha', 'text-text-neutral-invert-base']
|
|
134
|
+
: ['bg-surface-danger-bg-alpha'],
|
|
135
|
+
},
|
|
136
|
+
warning: {
|
|
137
|
+
light: hasCount.value
|
|
138
|
+
? ['bg-surface-warning-alpha-300', 'text-text-warning-base']
|
|
139
|
+
: ['bg-surface-warning-alpha-300'],
|
|
140
|
+
strong: hasCount.value
|
|
141
|
+
? ['bg-surface-warning-bg-alpha', 'text-text-neutral-invert-base']
|
|
142
|
+
: ['bg-surface-warning-bg-alpha'],
|
|
143
|
+
},
|
|
144
|
+
success: {
|
|
145
|
+
light: hasCount.value
|
|
146
|
+
? ['bg-surface-success-alpha-300', 'text-text-success-base']
|
|
147
|
+
: ['bg-surface-success-alpha-300'],
|
|
148
|
+
strong: hasCount.value
|
|
149
|
+
? ['bg-surface-success-bg-alpha', 'text-text-neutral-invert-base']
|
|
150
|
+
: ['bg-surface-success-bg-alpha'],
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return [
|
|
155
|
+
...baseClasses,
|
|
156
|
+
...sizeClasses,
|
|
157
|
+
...textClasses,
|
|
158
|
+
...colorVariantClasses[props.color][props.variant],
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
</script>
|