@livestorm/ui-vue 2.0.5 → 4.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 +9 -6
- package/components-vite.js +2 -2
- package/dist/UiButton-uyW8EHRJ.mjs +602 -0
- package/dist/UiTimelineItem-EiOEi1yF.mjs +7293 -0
- package/dist/UiTooltip-DZcPD6_N.mjs +158 -0
- package/dist/a11y-CaZxRWzo.mjs +6 -0
- package/dist/breakpoints.mjs +4 -9
- package/dist/bus.mjs +5 -5
- package/dist/components.mjs +236 -222
- package/dist/i18n-B8QOMuFD.mjs +46 -0
- package/dist/index.mjs +4 -87
- package/dist/integrations.mjs +3 -14
- package/dist/layouts.mjs +228 -236
- package/dist/responsive.mjs +31 -36
- package/dist/slot.mjs +11 -17
- package/dist/toastDSV2-D3xDZPe5.mjs +105 -0
- package/dist/types/index.d.ts +23 -1
- package/dist/types/src/components/Toast/ToastMessage.vue.d.ts +17 -7
- package/dist/types/src/components/Toast/toastDSV2.d.ts +89 -64
- package/dist/types/src/components/UiActionBar/UiActionBar.vue.d.ts +3 -1
- package/dist/types/src/components/UiActionBar/UiActionBarItem.vue.d.ts +18 -3
- package/dist/types/src/components/UiActionBar/types.d.ts +5 -1
- package/dist/types/src/components/UiAvatar/UiAvatar.vue.d.ts +4 -2
- package/dist/types/src/components/UiAvatarList/UiAvatarList.vue.d.ts +3 -2
- package/dist/types/src/components/UiBanner/UiBanner.vue.d.ts +13 -1
- package/dist/types/src/components/UiButton/UiButton.vue.d.ts +102 -38
- package/dist/types/src/components/UiButtonGroup/UiButtonGroup.vue.d.ts +8 -2
- package/dist/types/src/components/UiButtonGroup/UiButtonGroupItem.vue.d.ts +3 -0
- package/dist/types/src/components/UiButtonGroup/types.d.ts +5 -1
- package/dist/types/src/components/UiChoice/UiChoice.vue.d.ts +71 -0
- package/dist/types/src/components/UiChoice/index.d.ts +2 -0
- package/dist/types/src/components/UiChoice/types.d.ts +7 -0
- package/dist/types/src/components/UiColorField/UiColorField.vue.d.ts +1 -1
- package/dist/types/src/components/UiColorPicker/UiColorPicker.vue.d.ts +2 -2
- package/dist/types/src/components/UiCombobox/UiCombobox.types.d.ts +47 -0
- package/dist/types/src/components/UiCombobox/UiCombobox.vue.d.ts +40 -0
- package/dist/types/src/components/UiCombobox/index.d.ts +2 -0
- package/dist/types/src/components/UiDataTable/UiDataTable.types.d.ts +46 -0
- package/dist/types/src/components/UiDataTable/UiDataTable.vue.d.ts +136 -0
- package/dist/types/src/components/UiDataTable/index.d.ts +5 -0
- package/dist/types/src/components/UiDrawer/UiDrawer.vue.d.ts +28 -0
- package/dist/types/src/components/UiDrawer/UiDrawerContent.vue.d.ts +18 -0
- package/dist/types/src/components/UiDrawer/UiDrawerTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiDropdown/DropdownItemCheckbox.vue.d.ts +3 -0
- package/dist/types/src/components/UiDropdown/UiDropdownContent.vue.d.ts +10 -0
- package/dist/types/src/components/UiDropdown/UiDropdownGroup.vue.d.ts +17 -0
- package/dist/types/src/components/UiDropdown/UiDropdownItem.vue.d.ts +9 -4
- package/dist/types/src/components/UiDropdown/UiDropdownTrigger.vue.d.ts +21 -5
- package/dist/types/src/components/UiDropdown/index.d.ts +1 -0
- package/dist/types/src/components/UiEmojiPickerList/UiEmojiPickerList.vue.d.ts +22 -0
- package/dist/types/src/components/UiEmptyState/UiEmptyState.vue.d.ts +8 -3
- package/dist/types/src/components/UiFieldWrapper/UiFieldWrapper.vue.d.ts +2 -2
- package/dist/types/src/components/UiInputCheckbox/CheckboxGlyph.vue.d.ts +17 -0
- package/dist/types/src/components/UiInputCheckbox/UiInputCheckbox.vue.d.ts +35 -4
- package/dist/types/src/components/UiInputEmoji/UiInputEmoji.vue.d.ts +45 -0
- package/dist/types/src/components/UiInputRadio/RadioGlyph.vue.d.ts +19 -0
- package/dist/types/src/components/UiInputRadio/UiInputRadio.vue.d.ts +80 -0
- package/dist/types/src/components/UiInputRadio/UiInputRadioGroup.vue.d.ts +86 -0
- package/dist/types/src/components/UiInputRadio/types.d.ts +19 -0
- package/dist/types/src/components/UiInputSelect/UiInputSelect.vue.d.ts +5 -5
- package/dist/types/src/components/UiInputTextarea/UiInputTextarea.vue.d.ts +5 -5
- package/dist/types/src/components/UiListItem/UiListItem.vue.d.ts +18 -4
- package/dist/types/src/components/UiLoader/UiLoader.vue.d.ts +6 -5
- package/dist/types/src/components/UiLoader/UiSpinnerIcon.vue.d.ts +3 -0
- package/dist/types/src/components/UiLogo/UiLogo.vue.d.ts +9 -3
- package/dist/types/src/components/UiMenu/UiMenuContent.vue.d.ts +15 -2
- package/dist/types/src/components/UiMenu/UiMenuItem.vue.d.ts +9 -3
- package/dist/types/src/components/UiNestedOptions/UiNestedOptions.vue.d.ts +13 -0
- package/dist/types/src/components/UiPage/UiPage.vue.d.ts +106 -8
- package/dist/types/src/components/UiPagination/UiPagination.vue.d.ts +36 -0
- package/dist/types/src/components/UiPagination/index.d.ts +2 -0
- package/dist/types/src/components/UiPagination/types.d.ts +4 -0
- package/dist/types/src/components/UiPane/UiPane.vue.d.ts +22 -0
- package/dist/types/src/components/UiPane/UiPaneContent.vue.d.ts +75 -0
- package/dist/types/src/components/UiPane/UiPaneTrigger.vue.d.ts +14 -0
- package/dist/types/src/components/UiPane/index.d.ts +5 -0
- package/dist/types/src/components/UiProgress/UiProgress.vue.d.ts +1 -1
- package/dist/types/src/components/UiRating/UiRating.vue.d.ts +62 -0
- package/dist/types/src/components/UiRating/types.d.ts +1 -0
- package/dist/types/src/components/UiRoomButton/UiRoomButton.vue.d.ts +5 -3
- package/dist/types/src/components/UiRoomCountdown/UiRoomCountdown.vue.d.ts +32 -0
- package/dist/types/src/components/UiShell/UiShell.vue.d.ts +3 -0
- package/dist/types/src/components/UiSideMenu/UiSideMenu.vue.d.ts +22 -1
- package/dist/types/src/components/UiSideMenu/UiSideMenuItemContent.vue.d.ts +2 -2
- package/dist/types/src/components/UiSwitch/UiSwitch.vue.d.ts +114 -0
- package/dist/types/src/components/UiSwitch/types.d.ts +3 -0
- package/dist/types/src/components/UiTable/UiTable.vue.d.ts +13 -4
- package/dist/types/src/components/UiTable/UiTableActionsCell.vue.d.ts +49 -0
- package/dist/types/src/components/UiTable/UiTableActionsHeaderCell.vue.d.ts +3 -0
- package/dist/types/src/components/UiTable/UiTableBody.vue.d.ts +11 -1
- package/dist/types/src/components/UiTable/UiTableCell.vue.d.ts +16 -1
- package/dist/types/src/components/UiTable/UiTableHeaderCell.vue.d.ts +31 -2
- package/dist/types/src/components/UiTable/UiTableRow.vue.d.ts +32 -2
- package/dist/types/src/components/UiTable/context.d.ts +3 -0
- package/dist/types/src/components/UiTable/index.d.ts +4 -0
- package/dist/types/src/components/UiTabs/UiTabs.vue.d.ts +8 -2
- package/dist/types/src/components/UiTag/UiTag.types.d.ts +25 -0
- package/dist/types/src/components/UiTag/UiTag.vue.d.ts +5 -26
- package/dist/types/src/components/UiTag/index.d.ts +2 -1
- package/dist/types/src/components/UiTextField/UiTextField.vue.d.ts +10 -5
- package/dist/types/src/components/UiTooltip/UiTooltipProvider.vue.d.ts +1 -0
- package/dist/types/src/components/UiTooltip/UiTooltipTrigger.vue.d.ts +2 -2
- package/dist/types/src/composables/storedThemingApplies.d.ts +17 -0
- package/dist/types/src/composables/useButtonStyles.d.ts +1 -0
- package/dist/types/src/composables/useChoiceboxSurface.d.ts +11 -0
- package/dist/types/src/composables/useContentMode.d.ts +23 -0
- package/dist/types/src/composables/useControlModes.d.ts +7 -0
- package/dist/types/src/composables/useControlShape.d.ts +24 -0
- package/dist/types/src/composables/useFieldFocusEvents.d.ts +12 -0
- package/dist/types/src/composables/useIconSize.d.ts +13 -0
- package/dist/types/src/composables/usePullGesture.d.ts +42 -0
- package/dist/types/src/composables/useThemeAndModes.d.ts +4 -0
- package/dist/types/src/constants/sizes.d.ts +1 -1
- package/dist/types/src/theming/colorScale.d.ts +165 -0
- package/dist/types/src/theming/legacyColorScale.d.ts +27 -0
- package/dist/types/src/theming/presetColors.d.ts +11 -0
- package/dist/types/src/theming/primitiveTokens.d.ts +2 -0
- package/dist/types/src/utils/effectiveOpacity.d.ts +2 -0
- package/dist/types/src/utils/numbers.d.ts +1 -2
- package/dist/types/src/utils/tokenColor.d.ts +2 -0
- package/dist/ui-vue.css +2 -1
- package/dist/utils.mjs +165 -194
- package/index.d.ts +22 -0
- package/index.js +44 -0
- package/package.json +28 -20
- package/src/components/Toast/LayoutToasts.vue +19 -11
- package/src/components/Toast/ToastMessage.vue +130 -73
- package/src/components/Toast/toastDSV2.ts +238 -67
- package/src/components/UiActionBar/UiActionBar.vue +15 -5
- package/src/components/UiActionBar/UiActionBarItem.vue +65 -38
- package/src/components/UiActionBar/types.ts +16 -1
- package/src/components/UiAvatar/UiAvatar.vue +9 -3
- package/src/components/UiAvatarList/UiAvatarList.vue +51 -20
- package/src/components/UiBadge/UiBadge.vue +1 -1
- package/src/components/UiBanner/UiBanner.vue +77 -27
- package/src/components/UiBreadcrumb/UiBreadcrumb.vue +1 -1
- package/src/components/UiButton/UiButton.vue +96 -29
- package/src/components/UiButtonGroup/UiButtonGroup.vue +22 -16
- package/src/components/UiButtonGroup/UiButtonGroupItem.vue +44 -14
- package/src/components/UiButtonGroup/types.ts +20 -1
- package/src/components/UiCard/UiCard.vue +20 -23
- package/src/components/UiCarousel/UiCarousel.vue +2 -2
- package/src/components/UiChoice/UiChoice.vue +187 -0
- package/src/components/UiChoice/index.ts +2 -0
- package/src/components/UiChoice/types.ts +11 -0
- package/src/components/UiColorField/UiColorField.vue +2 -2
- package/src/components/UiColorPicker/UiColorPicker.vue +16 -13
- package/src/components/UiCombobox/UiCombobox.types.ts +52 -0
- package/src/components/UiCombobox/UiCombobox.vue +296 -0
- package/src/components/UiCombobox/index.ts +2 -0
- package/src/components/UiDataTable/UiDataTable.types.ts +47 -0
- package/src/components/UiDataTable/UiDataTable.vue +422 -0
- package/src/components/UiDataTable/index.ts +12 -0
- package/src/components/UiDialog/UiDialogClose.vue +1 -1
- package/src/components/UiDialog/UiDialogContent.vue +22 -7
- package/src/components/UiDrawer/UiDrawer.vue +16 -0
- package/src/components/UiDrawer/UiDrawerContent.vue +42 -0
- package/src/components/UiDrawer/UiDrawerTrigger.vue +17 -0
- package/src/components/UiDropdown/DropdownItemCheckbox.vue +10 -0
- package/src/components/UiDropdown/UiDropdownContent.vue +32 -21
- package/src/components/UiDropdown/UiDropdownGroup.vue +23 -0
- package/src/components/UiDropdown/UiDropdownItem.vue +45 -18
- package/src/components/UiDropdown/UiDropdownSeparator.vue +1 -1
- package/src/components/UiDropdown/UiDropdownTrigger.vue +139 -45
- package/src/components/UiDropdown/index.ts +1 -0
- package/src/components/UiEmojiPickerList/UiEmojiPickerList.vue +122 -0
- package/src/components/UiEmptyState/UiEmptyState.vue +16 -4
- package/src/components/UiFieldWrapper/UiFieldWrapper.vue +10 -4
- package/src/components/UiHorizontalSeparator/UiHorizontalSeparator.vue +2 -2
- package/src/components/UiInputCheckbox/CheckboxGlyph.vue +78 -0
- package/src/components/UiInputCheckbox/UiInputCheckbox.vue +213 -177
- package/src/components/UiInputEmoji/UiInputEmoji.vue +96 -0
- package/src/components/UiInputRadio/RadioGlyph.vue +45 -0
- package/src/components/UiInputRadio/UiInputRadio.vue +382 -0
- package/src/components/UiInputRadio/UiInputRadioGroup.vue +166 -0
- package/src/components/UiInputRadio/types.ts +24 -0
- package/src/components/UiInputSelect/UiInputSelect.vue +9 -7
- package/src/components/UiInputTextarea/UiInputTextarea.vue +20 -35
- package/src/components/UiLabel/UiLabel.vue +1 -1
- package/src/components/UiListItem/UiListItem.vue +55 -9
- package/src/components/UiLoader/UiLoader.vue +11 -29
- package/src/components/UiLoader/UiSpinnerIcon.vue +21 -0
- package/src/components/UiLogo/UiLogo.vue +41 -7
- package/src/components/UiMenu/UiMenuContent.vue +24 -3
- package/src/components/UiMenu/UiMenuGroup.vue +1 -1
- package/src/components/UiMenu/UiMenuItem.vue +14 -3
- package/src/components/UiMenu/UiMenuSubContent.vue +1 -1
- package/src/components/UiMenu/UiMenuSubTrigger.vue +2 -2
- package/src/components/UiNestedOptions/UiNestedOptions.vue +6 -0
- package/src/components/UiPage/UiPage.vue +273 -47
- package/src/components/UiPageHeader/UiPageHeader.vue +29 -9
- package/src/components/UiPagination/UiPagination.vue +99 -0
- package/src/components/UiPagination/index.ts +2 -0
- package/src/components/UiPagination/types.ts +28 -0
- package/src/components/UiPane/UiPane.vue +20 -0
- package/src/components/UiPane/UiPaneContent.vue +232 -0
- package/src/components/UiPane/UiPaneTrigger.vue +14 -0
- package/src/components/UiPane/index.ts +12 -0
- package/src/components/UiPopover/UiPopoverContent.vue +21 -1
- package/src/components/UiProgress/UiProgress.vue +2 -2
- package/src/components/UiRating/UiRating.vue +258 -0
- package/src/components/UiRating/types.ts +1 -0
- package/src/components/UiRoomButton/UiRoomButton.vue +14 -45
- package/src/components/UiRoomCountdown/UiRoomCountdown.vue +376 -0
- package/src/components/UiShell/UiShell.vue +10 -4
- package/src/components/UiSideMenu/UiSideMenu.vue +158 -18
- package/src/components/UiSideMenu/UiSideMenuItemContent.vue +22 -18
- package/src/components/UiStepper/UiStepper.vue +3 -16
- package/src/components/UiStepper/UiStepperDescription.vue +1 -13
- package/src/components/UiStepper/UiStepperIndicator.vue +17 -57
- package/src/components/UiStepper/UiStepperItem.vue +1 -8
- package/src/components/UiStepper/UiStepperSeparator.vue +5 -16
- package/src/components/UiStepper/UiStepperTitle.vue +1 -10
- package/src/components/UiSwitch/UiSwitch.vue +375 -0
- package/src/components/UiSwitch/types.ts +5 -0
- package/src/components/UiTable/UiTable.vue +98 -8
- package/src/components/UiTable/UiTableActionsCell.vue +135 -0
- package/src/components/UiTable/UiTableActionsHeaderCell.vue +19 -0
- package/src/components/UiTable/UiTableBody.vue +16 -1
- package/src/components/UiTable/UiTableCell.vue +33 -16
- package/src/components/UiTable/UiTableHeader.vue +6 -5
- package/src/components/UiTable/UiTableHeaderCell.vue +61 -9
- package/src/components/UiTable/UiTableRow.vue +46 -10
- package/src/components/UiTable/context.ts +5 -0
- package/src/components/UiTable/index.ts +4 -0
- package/src/components/UiTabs/UiTabs.vue +61 -63
- package/src/components/UiTag/UiTag.types.ts +28 -0
- package/src/components/UiTag/UiTag.vue +24 -42
- package/src/components/UiTag/index.ts +2 -0
- package/src/components/UiTextField/UiTextField.vue +27 -47
- package/src/components/UiTimeline/README.md +6 -6
- package/src/components/UiTimeline/UiTimelineItem.vue +3 -3
- package/src/components/UiTooltip/UiTooltipContent.vue +1 -1
- package/src/components/UiTooltip/UiTooltipProvider.vue +3 -0
- package/src/components/UiTooltip/UiTooltipTrigger.vue +16 -1
- package/src/composables/storedThemingApplies.ts +19 -0
- package/src/composables/useButtonStyles.ts +9 -13
- package/src/composables/useChoiceboxSurface.ts +36 -0
- package/src/composables/useContentMode.ts +66 -0
- package/src/composables/useControlModes.ts +11 -0
- package/src/composables/useControlShape.ts +34 -0
- package/src/composables/useFieldFocusEvents.ts +30 -0
- package/src/composables/useIconSize.ts +43 -0
- package/src/composables/usePullGesture.ts +142 -0
- package/src/composables/useThemeAndModes.ts +28 -1
- package/src/constants/sizes.ts +1 -1
- package/src/css/body.css +16 -1
- package/src/css/fonts.css +39 -5
- package/src/global.d.ts +44 -0
- package/src/theming/colorScale.ts +173 -0
- package/src/theming/legacyColorScale.ts +58 -0
- package/src/theming/presetColors.ts +33 -0
- package/src/theming/primitiveTokens.ts +71 -0
- package/src/utils/effectiveOpacity.ts +8 -0
- package/src/utils/i18n.ts +6 -0
- package/src/utils/numbers.ts +1 -1
- package/src/utils/responsive.d.ts +14 -0
- package/src/utils/tokenColor.ts +9 -0
- package/dist/UiTimelineItem.vue_vue_type_style_index_0_lang-DJFdCn2R.mjs +0 -5456
- package/dist/a11y-BhF_nl7L.mjs +0 -159
- package/dist/i18n-Cktw9hIu.mjs +0 -49
- package/dist/toastDSV2-wMh-UMzW.mjs +0 -74
- package/dist/types/src/components/UiAvatar/index.d.ts +0 -1
- package/dist/types/src/components/UiAvatarList/index.d.ts +0 -1
- package/dist/types/src/components/UiBadge/index.d.ts +0 -1
- package/dist/types/src/components/UiBanner/index.d.ts +0 -2
- package/dist/types/src/components/UiButtonGroup/index.d.ts +0 -3
- package/dist/types/src/components/UiCarousel/index.d.ts +0 -2
- package/dist/types/src/components/UiColorField/index.d.ts +0 -2
- package/dist/types/src/components/UiDialog/MarketplaceHeaderExample.vue.d.ts +0 -28
- package/dist/types/src/components/UiDialog/index.d.ts +0 -7
- package/dist/types/src/components/UiFieldWrapper/index.d.ts +0 -1
- package/dist/types/src/components/UiInputCheckbox/index.d.ts +0 -2
- package/dist/types/src/components/UiInputSelect/index.d.ts +0 -2
- package/dist/types/src/components/UiInputTextarea/index.d.ts +0 -2
- package/dist/types/src/components/UiMenu/index.d.ts +0 -10
- package/dist/types/src/components/UiProgress/index.d.ts +0 -2
- package/dist/types/src/components/UiTabs/index.d.ts +0 -2
- package/dist/types/src/components/UiTimeline/index.d.ts +0 -2
- package/dist/types/src/components/UiTooltip/index.d.ts +0 -4
- package/dist/types/src/mixins/DynamicAction.d.ts +0 -30
- package/dist/useThemeAndModes-BzYwSOEv.mjs +0 -108
- package/src/components/UiAvatar/index.js +0 -1
- package/src/components/UiAvatarList/index.js +0 -1
- package/src/components/UiBadge/index.ts +0 -2
- package/src/components/UiBanner/index.ts +0 -2
- package/src/components/UiButtonGroup/index.ts +0 -3
- package/src/components/UiCarousel/index.ts +0 -2
- package/src/components/UiColorField/index.ts +0 -2
- package/src/components/UiDialog/MarketplaceHeaderExample.vue +0 -217
- package/src/components/UiDialog/index.ts +0 -18
- package/src/components/UiFieldWrapper/index.ts +0 -1
- package/src/components/UiInputCheckbox/index.ts +0 -2
- package/src/components/UiInputSelect/index.ts +0 -2
- package/src/components/UiInputTextarea/index.ts +0 -2
- package/src/components/UiMenu/index.ts +0 -10
- package/src/components/UiProgress/index.ts +0 -2
- package/src/components/UiTabs/index.ts +0 -5
- package/src/components/UiTag/index.js +0 -1
- package/src/components/UiTimeline/index.ts +0 -2
- package/src/components/UiTooltip/index.js +0 -4
- package/src/mixins/DynamicAction.js +0 -61
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ A modern, strongly-typed Vue 3 component library for Livestorm’s design system
|
|
|
36
36
|
- the logo link of `UiPageHeader` when `showLogo` is enabled;
|
|
37
37
|
- the `@livestorm/ui-vue/utils` entry point: its `useRouteQueryModel` helper is built on the router, so importing this entry requires vue-router to be installed.
|
|
38
38
|
- **Tailwind CSS 4**, since components are styled with Tailwind utility classes.
|
|
39
|
-
- **The Inter font**, which components are designed for. The package never loads it for you:
|
|
39
|
+
- **The Inter font**, which components are designed for. The package never loads it for you: load it yourself, or import the optional self-hosted shortcut once (`import '@livestorm/ui-vue/fonts'`, Inter Variable served from the `inter-ui` dependency). Without Inter, components fall back to the system font stack.
|
|
40
40
|
|
|
41
41
|
Installing the package also pulls in `@livestorm/ui-tokens` (design tokens) and `@livestorm/ui-icons` (icon utilities).
|
|
42
42
|
|
|
@@ -48,17 +48,20 @@ pnpm add @livestorm/ui-vue
|
|
|
48
48
|
|
|
49
49
|
## Tailwind CSS setup
|
|
50
50
|
|
|
51
|
-
Components use Tailwind utility classes (including the `i-ls-*` icon classes), so your app needs to run Tailwind and scan the library. In your Tailwind entry CSS:
|
|
51
|
+
Components use Tailwind utility classes (including the `i-ls-*` / `i-ph-*` icon classes), so your app needs to run Tailwind and scan the library. In your Tailwind entry CSS:
|
|
52
52
|
|
|
53
53
|
```css
|
|
54
54
|
@import "tailwindcss";
|
|
55
55
|
@import "@livestorm/ui-tokens/output/supernova/index.css";
|
|
56
|
-
@
|
|
56
|
+
@plugin "@livestorm/ui-icons/tailwind";
|
|
57
|
+
@import "@livestorm/ui-icons/base.css";
|
|
57
58
|
|
|
58
59
|
/* Generate the utility classes used by ui-vue components */
|
|
59
60
|
@source "../node_modules/@livestorm/ui-vue/dist";
|
|
60
61
|
```
|
|
61
62
|
|
|
63
|
+
The icon plugin serves the custom Livestorm set (`i-ls-<name>`) and [Phosphor](https://phosphoricons.com) (`i-ph-<name>`, `regular` and `-fill` weights). Icon names must appear as complete literals in scanned sources — never compose them at runtime.
|
|
64
|
+
|
|
62
65
|
> [!WARNING]
|
|
63
66
|
> Components rely on the design-token utilities these two imports produce (`bg-actions-primary-idle`, `i-ls-*`, ...). Those class names live in the component code, not in the shipped stylesheet, so if your own theme resets the token namespace (for example `--color-*: initial` in an `@theme`), Tailwind silently stops generating them and components render unstyled — no error, no warning. Keep the Livestorm token imports alongside your palette instead of resetting all colors.
|
|
64
67
|
|
|
@@ -137,7 +140,7 @@ import { UiButton, UiTextField, UiInputSelect } from '@livestorm/ui-vue'
|
|
|
137
140
|
|
|
138
141
|
```vue
|
|
139
142
|
<template>
|
|
140
|
-
<UiButton variant="cta" color="primary" icon="i-
|
|
143
|
+
<UiButton variant="cta" color="primary" icon="i-ph-check">
|
|
141
144
|
Click me
|
|
142
145
|
</UiButton>
|
|
143
146
|
</template>
|
|
@@ -157,7 +160,7 @@ registerComponents(app, 'Ls') // <LsButton>, <LsTextField>, ...
|
|
|
157
160
|
| --- | --- |
|
|
158
161
|
| `@livestorm/ui-vue` | All components and utilities |
|
|
159
162
|
| `@livestorm/ui-vue/style` | Base stylesheet (import once) |
|
|
160
|
-
| `@livestorm/ui-vue/fonts` | Optional:
|
|
163
|
+
| `@livestorm/ui-vue/fonts` | Optional: declares Inter Variable from the bundled `inter-ui` package (skip it if you load Inter yourself) |
|
|
161
164
|
| `@livestorm/ui-vue/components-vite` | `registerComponents` for global registration |
|
|
162
165
|
| `@livestorm/ui-vue/integrations` | Toast helpers (`openToast`, ... — call client-side only: toast state is per-process on a server) and translation wiring (`setTranslator`, `UI_VUE_TRANSLATOR`) |
|
|
163
166
|
| `@livestorm/ui-vue/layouts` | Layout components such as the toast container |
|
|
@@ -168,4 +171,4 @@ The package ships prebuilt ES modules, so no special bundler configuration is ne
|
|
|
168
171
|
|
|
169
172
|
## Contributing
|
|
170
173
|
|
|
171
|
-
This package lives in Livestorm's [entropy](https://github.com/livestorm/entropy) monorepo, under `packages/ui-vue`. See that directory's `
|
|
174
|
+
This package lives in Livestorm's [entropy](https://github.com/livestorm/entropy) monorepo, under `packages/ui-vue`. See that directory's `AGENTS.md` for architecture, conventions and the release process.
|
package/components-vite.js
CHANGED
|
@@ -5,7 +5,7 @@ const NAME_REG = /Ui([a-z0-9]+)\./i
|
|
|
5
5
|
export function registerComponents (app, prefix = 'Ui') {
|
|
6
6
|
app.component('RenderSlot', RenderSlot)
|
|
7
7
|
|
|
8
|
-
const componentsLib = import.meta.glob('./src/components/**/Ui
|
|
8
|
+
const componentsLib = import.meta.glob(['./src/components/**/Ui*.{js,jsx,vue,ts}', '!./src/components/**/*.*.*'], { eager: true })
|
|
9
9
|
for (const key in componentsLib) {
|
|
10
10
|
const component = componentsLib[key]
|
|
11
11
|
const name = key.match(NAME_REG)[1]
|
|
@@ -18,7 +18,7 @@ export function getComponents (prefix = 'Ui') {
|
|
|
18
18
|
|
|
19
19
|
componentsMap.RenderSlot = RenderSlot
|
|
20
20
|
|
|
21
|
-
const componentsLib = import.meta.glob('./src/components/**/Ui
|
|
21
|
+
const componentsLib = import.meta.glob(['./src/components/**/Ui*.{js,jsx,vue,ts}', '!./src/components/**/*.*.*'], { eager: true })
|
|
22
22
|
for (const key in componentsLib) {
|
|
23
23
|
const component = componentsLib[key]
|
|
24
24
|
const name = key.match(NAME_REG)[1]
|
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import { l as e, t } from "./UiTooltip-DZcPD6_N.mjs";
|
|
2
|
+
import { RenderSlot as n, useSlotsAsComponents as r } from "./slot.mjs";
|
|
3
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, mergeProps as p, normalizeClass as m, normalizeStyle as h, openBlock as g, ref as _, renderSlot as v, resolveComponent as y, resolveDynamicComponent as b, toDisplayString as x, toValue as S, unref as C, useSlots as w, watch as T, withCtx as E } from "vue";
|
|
4
|
+
//#region src/composables/useIconSize.ts
|
|
5
|
+
var D = {
|
|
6
|
+
xs: "size-3",
|
|
7
|
+
sm: "size-4",
|
|
8
|
+
md: "size-5",
|
|
9
|
+
lg: "size-6",
|
|
10
|
+
xl: "size-7"
|
|
11
|
+
};
|
|
12
|
+
function O(e) {
|
|
13
|
+
return a(() => D[S(e)]);
|
|
14
|
+
}
|
|
15
|
+
var k = {
|
|
16
|
+
xs: "size-2.5",
|
|
17
|
+
sm: "size-3.5",
|
|
18
|
+
md: "size-4",
|
|
19
|
+
lg: "size-5",
|
|
20
|
+
xl: "size-6"
|
|
21
|
+
};
|
|
22
|
+
function ee(e) {
|
|
23
|
+
return a(() => k[S(e)]);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/UiAvatar/UiAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
27
|
+
var te = ["data-size", "data-variant"], ne = ["src", "alt"], A = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "px-0.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
30
|
+
"data-recording-sensitive": ""
|
|
31
|
+
}, j = /*@__PURE__*/ d({
|
|
32
|
+
__name: "UiAvatar",
|
|
33
|
+
props: {
|
|
34
|
+
src: { default: null },
|
|
35
|
+
firstName: { default: null },
|
|
36
|
+
lastName: { default: null },
|
|
37
|
+
customText: { default: null },
|
|
38
|
+
size: { default: "md" },
|
|
39
|
+
variant: { default: "default" },
|
|
40
|
+
alt: { default: void 0 },
|
|
41
|
+
color: { default: null },
|
|
42
|
+
icon: { default: "i-ph-user-fill" }
|
|
43
|
+
},
|
|
44
|
+
setup(e) {
|
|
45
|
+
let t = e, n = a(() => {
|
|
46
|
+
if (t.variant !== "more" && (!t.src || r.value) && t.color) return {
|
|
47
|
+
backgroundColor: t.color,
|
|
48
|
+
color: "white"
|
|
49
|
+
};
|
|
50
|
+
}), r = _(!1);
|
|
51
|
+
T(() => t.src, () => {
|
|
52
|
+
r.value = !1;
|
|
53
|
+
});
|
|
54
|
+
let i = a(() => t.customText ? t.customText : ((t.firstName?.trim()?.[0] ?? "") + (t.lastName?.trim()?.[0] ?? "")).toUpperCase() || null), o = a(() => `${t.firstName ?? ""} ${t.lastName ?? ""}`.trim()), u = a(() => {
|
|
55
|
+
switch (t.size) {
|
|
56
|
+
case "sm": return "w-8 h-8 text-content-legends-bold-md";
|
|
57
|
+
case "md": return "w-10 h-10 text-content-text-md-bold";
|
|
58
|
+
case "lg": return "w-12 h-12 text-content-text-lg-bold";
|
|
59
|
+
case "xl": return "w-16 h-16 text-title-md-bold";
|
|
60
|
+
case "10xl": return "w-32 h-32 text-title-lg-bold";
|
|
61
|
+
default: return "w-6 h-6 text-content-badges-bold-md";
|
|
62
|
+
}
|
|
63
|
+
}), d = a(() => {
|
|
64
|
+
switch (t.size) {
|
|
65
|
+
case "sm": return "w-3 h-3";
|
|
66
|
+
case "md": return "w-3.5 h-3.5";
|
|
67
|
+
case "lg": return "w-4 h-4";
|
|
68
|
+
case "xl": return "w-6 h-6";
|
|
69
|
+
case "10xl": return "w-8 h-8";
|
|
70
|
+
default: return "w-2.5 h-2.5";
|
|
71
|
+
}
|
|
72
|
+
}), f = a(() => {
|
|
73
|
+
switch (t.variant) {
|
|
74
|
+
case "more": return "bg-surface-neutral-100 text-text-neutral-base";
|
|
75
|
+
default: return "bg-surface-neutral-invert-bg-main text-text-neutral-invert-base";
|
|
76
|
+
}
|
|
77
|
+
}), p = w(), y = a(() => !!p.badge), b = a(() => y.value ? ["ui-avatar relative inline-flex shrink-0", u.value] : [
|
|
78
|
+
"ui-avatar inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden text-center",
|
|
79
|
+
u.value,
|
|
80
|
+
f.value
|
|
81
|
+
]), S = a(() => y.value ? ["inline-flex items-center justify-center w-full h-full rounded-full overflow-hidden text-center", f.value] : "contents");
|
|
82
|
+
return (t, a) => (g(), c("span", {
|
|
83
|
+
class: m(b.value),
|
|
84
|
+
style: h(y.value ? void 0 : n.value),
|
|
85
|
+
"data-size": e.size,
|
|
86
|
+
"data-variant": e.variant,
|
|
87
|
+
"data-testid": "ui-avatar"
|
|
88
|
+
}, [l("span", {
|
|
89
|
+
class: m(S.value),
|
|
90
|
+
style: h(y.value ? n.value : void 0)
|
|
91
|
+
}, [e.src && !r.value ? (g(), c("img", {
|
|
92
|
+
key: 0,
|
|
93
|
+
src: e.src,
|
|
94
|
+
alt: e.alt ?? o.value,
|
|
95
|
+
class: "w-full h-full object-cover",
|
|
96
|
+
onError: a[0] ||= (e) => r.value = !0
|
|
97
|
+
}, null, 40, ne)) : i.value ? (g(), c("span", A, x(i.value), 1)) : (g(), c("span", {
|
|
98
|
+
key: 2,
|
|
99
|
+
class: m([e.icon, d.value])
|
|
100
|
+
}, null, 2))], 6), y.value ? v(t.$slots, "badge", { key: 0 }) : s("", !0)], 14, te));
|
|
101
|
+
}
|
|
102
|
+
}), M = /* @__PURE__ */ e({ default: () => N }), N = j, P = (e, t) => {
|
|
103
|
+
let n = e.__vccOpts || e;
|
|
104
|
+
for (let [e, r] of t) n[e] = r;
|
|
105
|
+
return n;
|
|
106
|
+
}, F = [
|
|
107
|
+
"xs",
|
|
108
|
+
"sm",
|
|
109
|
+
"md",
|
|
110
|
+
"lg"
|
|
111
|
+
], I = [
|
|
112
|
+
"primary",
|
|
113
|
+
"neutral",
|
|
114
|
+
"success",
|
|
115
|
+
"warning",
|
|
116
|
+
"error",
|
|
117
|
+
"neutral-invert"
|
|
118
|
+
], L = {
|
|
119
|
+
cta: {
|
|
120
|
+
primary: "bg-actions-primary-idle",
|
|
121
|
+
neutral: "bg-actions-neutral-idle",
|
|
122
|
+
"neutral-invert": "bg-actions-neutral-invert-idle",
|
|
123
|
+
success: "bg-actions-success-idle",
|
|
124
|
+
warning: "bg-actions-warning-idle",
|
|
125
|
+
error: "bg-actions-danger-idle"
|
|
126
|
+
},
|
|
127
|
+
"cta-alpha": {
|
|
128
|
+
primary: "bg-actions-primary-idle-alpha-strong",
|
|
129
|
+
neutral: "bg-actions-neutral-idle-alpha-strong",
|
|
130
|
+
"neutral-invert": "bg-actions-neutral-invert-idle-alpha-strong",
|
|
131
|
+
success: "bg-actions-success-idle-alpha-strong",
|
|
132
|
+
warning: "bg-actions-warning-idle-alpha-strong",
|
|
133
|
+
error: "bg-actions-danger-idle-alpha-strong"
|
|
134
|
+
},
|
|
135
|
+
secondary: {
|
|
136
|
+
primary: "bg-actions-primary-idle-alpha-light",
|
|
137
|
+
neutral: "bg-actions-neutral-idle-alpha-light",
|
|
138
|
+
"neutral-invert": "bg-actions-neutral-invert-idle-alpha-light",
|
|
139
|
+
success: "bg-actions-success-idle-alpha-light",
|
|
140
|
+
warning: "bg-actions-warning-idle-alpha-light",
|
|
141
|
+
error: "bg-actions-danger-idle-alpha-light"
|
|
142
|
+
}
|
|
143
|
+
}, R = {
|
|
144
|
+
cta: {
|
|
145
|
+
primary: "text-actions-neutral-invert-idle",
|
|
146
|
+
neutral: "text-actions-neutral-invert-idle",
|
|
147
|
+
"neutral-invert": "text-actions-neutral-idle",
|
|
148
|
+
success: "text-actions-neutral-invert-idle",
|
|
149
|
+
warning: "text-actions-neutral-invert-idle",
|
|
150
|
+
error: "text-actions-neutral-invert-idle"
|
|
151
|
+
},
|
|
152
|
+
"cta-alpha": {
|
|
153
|
+
primary: "text-actions-neutral-invert-idle",
|
|
154
|
+
neutral: "text-actions-neutral-invert-idle",
|
|
155
|
+
"neutral-invert": "text-actions-neutral-idle",
|
|
156
|
+
success: "text-actions-neutral-invert-idle",
|
|
157
|
+
warning: "text-actions-neutral-invert-idle",
|
|
158
|
+
error: "text-actions-neutral-invert-idle"
|
|
159
|
+
},
|
|
160
|
+
secondary: {
|
|
161
|
+
primary: "text-actions-primary-idle",
|
|
162
|
+
neutral: "text-actions-neutral-idle",
|
|
163
|
+
"neutral-invert": "text-actions-neutral-invert-idle",
|
|
164
|
+
success: "text-actions-success-idle",
|
|
165
|
+
warning: "text-actions-warning-idle",
|
|
166
|
+
error: "text-actions-danger-idle"
|
|
167
|
+
},
|
|
168
|
+
tertiary: {
|
|
169
|
+
primary: "text-actions-primary-idle",
|
|
170
|
+
neutral: "text-actions-neutral-idle",
|
|
171
|
+
"neutral-invert": "text-actions-neutral-invert-idle",
|
|
172
|
+
success: "text-actions-success-idle",
|
|
173
|
+
warning: "text-actions-warning-idle",
|
|
174
|
+
error: "text-actions-danger-idle"
|
|
175
|
+
}
|
|
176
|
+
}, z = {
|
|
177
|
+
"cta-primary": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
178
|
+
"cta-neutral": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
179
|
+
"cta-neutral-invert": "group-hover:bg-actions-neutral-hover-overlay",
|
|
180
|
+
"cta-success": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
181
|
+
"cta-warning": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
182
|
+
"cta-error": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
183
|
+
"cta-alpha-primary": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
184
|
+
"cta-alpha-neutral": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
185
|
+
"cta-alpha-neutral-invert": "group-hover:bg-actions-neutral-hover-overlay",
|
|
186
|
+
"cta-alpha-success": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
187
|
+
"cta-alpha-warning": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
188
|
+
"cta-alpha-error": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
189
|
+
"secondary-primary": "group-hover:bg-actions-primary-hover-overlay",
|
|
190
|
+
"secondary-neutral": "group-hover:bg-actions-neutral-hover-overlay",
|
|
191
|
+
"secondary-neutral-invert": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
192
|
+
"secondary-success": "group-hover:bg-actions-success-hover-overlay",
|
|
193
|
+
"secondary-warning": "group-hover:bg-actions-warning-hover-overlay",
|
|
194
|
+
"secondary-error": "group-hover:bg-actions-danger-hover-overlay",
|
|
195
|
+
"tertiary-primary": "group-hover:bg-actions-primary-hover-overlay",
|
|
196
|
+
"tertiary-neutral": "group-hover:bg-actions-neutral-hover-overlay",
|
|
197
|
+
"tertiary-neutral-invert": "group-hover:bg-actions-neutral-invert-hover-overlay",
|
|
198
|
+
"tertiary-success": "group-hover:bg-actions-success-hover-overlay",
|
|
199
|
+
"tertiary-warning": "group-hover:bg-actions-warning-hover-overlay",
|
|
200
|
+
"tertiary-error": "group-hover:bg-actions-danger-hover-overlay"
|
|
201
|
+
}, B = {
|
|
202
|
+
"cta-primary": "group-active:bg-actions-primary-pressed-overlay",
|
|
203
|
+
"cta-neutral": "group-active:bg-actions-neutral-invert-pressed-overlay",
|
|
204
|
+
"cta-neutral-invert": "group-active:bg-actions-neutral-pressed-overlay",
|
|
205
|
+
"cta-success": "group-active:bg-actions-success-pressed-overlay",
|
|
206
|
+
"cta-warning": "group-active:bg-actions-warning-pressed-overlay",
|
|
207
|
+
"cta-error": "group-active:bg-actions-danger-pressed-overlay",
|
|
208
|
+
"cta-alpha-primary": "group-active:bg-actions-primary-pressed-overlay",
|
|
209
|
+
"cta-alpha-neutral": "group-active:bg-actions-neutral-pressed-overlay",
|
|
210
|
+
"cta-alpha-neutral-invert": "group-active:bg-actions-neutral-invert-pressed-overlay",
|
|
211
|
+
"cta-alpha-success": "group-active:bg-actions-neutral-pressed-overlay",
|
|
212
|
+
"cta-alpha-warning": "group-active:bg-actions-danger-pressed-overlay",
|
|
213
|
+
"cta-alpha-error": "group-active:bg-actions-danger-pressed-overlay",
|
|
214
|
+
"secondary-primary": "group-active:bg-actions-primary-pressed-overlay",
|
|
215
|
+
"secondary-neutral": "group-active:bg-actions-neutral-idle-alpha-light",
|
|
216
|
+
"secondary-neutral-invert": "group-active:bg-actions-neutral-invert-idle-alpha-light",
|
|
217
|
+
"secondary-success": "group-active:bg-actions-success-pressed-overlay",
|
|
218
|
+
"secondary-warning": "group-active:bg-actions-warning-pressed-overlay",
|
|
219
|
+
"secondary-error": "group-active:bg-actions-danger-pressed-overlay",
|
|
220
|
+
"tertiary-primary": "group-active:bg-actions-primary-pressed-overlay",
|
|
221
|
+
"tertiary-neutral": "group-active:bg-actions-neutral-pressed-overlay",
|
|
222
|
+
"tertiary-neutral-invert": "group-active:bg-actions-neutral-invert-pressed-overlay",
|
|
223
|
+
"tertiary-success": "group-active:bg-actions-success-pressed-overlay",
|
|
224
|
+
"tertiary-warning": "group-active:bg-actions-warning-pressed-overlay",
|
|
225
|
+
"tertiary-error": "group-active:bg-actions-danger-pressed-overlay"
|
|
226
|
+
}, V = {
|
|
227
|
+
"cta-primary": "before:bg-actions-neutral-invert-hover-overlay",
|
|
228
|
+
"cta-neutral": "before:bg-actions-neutral-invert-hover-overlay",
|
|
229
|
+
"cta-neutral-invert": "before:bg-actions-neutral-hover-overlay",
|
|
230
|
+
"cta-success": "before:bg-actions-neutral-invert-hover-overlay",
|
|
231
|
+
"cta-warning": "before:bg-actions-neutral-invert-hover-overlay",
|
|
232
|
+
"cta-error": "before:bg-actions-neutral-invert-hover-overlay",
|
|
233
|
+
"cta-alpha-primary": "before:bg-actions-neutral-invert-hover-overlay",
|
|
234
|
+
"cta-alpha-neutral": "before:bg-actions-neutral-invert-hover-overlay",
|
|
235
|
+
"cta-alpha-neutral-invert": "before:bg-actions-neutral-hover-overlay",
|
|
236
|
+
"cta-alpha-success": "before:bg-actions-neutral-invert-hover-overlay",
|
|
237
|
+
"cta-alpha-warning": "before:bg-actions-neutral-invert-hover-overlay",
|
|
238
|
+
"cta-alpha-error": "before:bg-actions-neutral-invert-hover-overlay",
|
|
239
|
+
"secondary-primary": "before:bg-actions-primary-hover-overlay",
|
|
240
|
+
"secondary-neutral": "before:bg-actions-neutral-hover-overlay",
|
|
241
|
+
"secondary-neutral-invert": "before:bg-actions-neutral-invert-hover-overlay",
|
|
242
|
+
"secondary-success": "before:bg-actions-success-hover-overlay",
|
|
243
|
+
"secondary-warning": "before:bg-actions-warning-hover-overlay",
|
|
244
|
+
"secondary-error": "before:bg-actions-danger-hover-overlay",
|
|
245
|
+
"tertiary-primary": "before:bg-actions-primary-hover-overlay",
|
|
246
|
+
"tertiary-neutral": "before:bg-actions-neutral-hover-overlay",
|
|
247
|
+
"tertiary-neutral-invert": "before:bg-actions-neutral-invert-hover-overlay",
|
|
248
|
+
"tertiary-success": "before:bg-actions-success-hover-overlay",
|
|
249
|
+
"tertiary-warning": "before:bg-actions-warning-hover-overlay",
|
|
250
|
+
"tertiary-error": "before:bg-actions-danger-hover-overlay"
|
|
251
|
+
};
|
|
252
|
+
function H(e) {
|
|
253
|
+
let t = a(() => S(e.variant)), n = a(() => S(e.color)), r = a(() => S(e.disabled) ?? !1), i = a(() => `${t.value}-${n.value}`);
|
|
254
|
+
return {
|
|
255
|
+
variant: t,
|
|
256
|
+
color: n,
|
|
257
|
+
bgClass: a(() => L[t.value]?.[n.value] ?? ""),
|
|
258
|
+
textClass: a(() => R[t.value][n.value]),
|
|
259
|
+
borderClasses: a(() => t.value === "secondary" ? ["border", "border-control-soft-border"] : []),
|
|
260
|
+
decorationClass: a(() => t.value === "tertiary" ? "[text-decoration-line:var(--control-link-decoration)] underline-offset-3" : ""),
|
|
261
|
+
overlayClasses: a(() => r.value ? [] : [z[i.value] ?? "", B[i.value] ?? ""]),
|
|
262
|
+
beforeHoverOverlayClass: a(() => r.value ? "" : V[i.value] ?? "")
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/composables/useControlShape.ts
|
|
267
|
+
var U = {
|
|
268
|
+
sm: {
|
|
269
|
+
height: "h-field-sm",
|
|
270
|
+
radius: "rounded-field-sm",
|
|
271
|
+
chevron: "size-3.5"
|
|
272
|
+
},
|
|
273
|
+
md: {
|
|
274
|
+
height: "h-field-md",
|
|
275
|
+
radius: "rounded-field-md",
|
|
276
|
+
chevron: "size-4"
|
|
277
|
+
},
|
|
278
|
+
lg: {
|
|
279
|
+
height: "h-field-lg",
|
|
280
|
+
radius: "rounded-field-lg",
|
|
281
|
+
chevron: "size-5"
|
|
282
|
+
},
|
|
283
|
+
xl: {
|
|
284
|
+
height: "h-field-xl",
|
|
285
|
+
radius: "rounded-field-xl",
|
|
286
|
+
chevron: "size-6"
|
|
287
|
+
}
|
|
288
|
+
}, W = {
|
|
289
|
+
xs: {
|
|
290
|
+
height: "h-button-xs",
|
|
291
|
+
square: "size-button-xs",
|
|
292
|
+
radius: "rounded-button-xs"
|
|
293
|
+
},
|
|
294
|
+
sm: {
|
|
295
|
+
height: "h-button-sm",
|
|
296
|
+
square: "size-button-sm",
|
|
297
|
+
radius: "rounded-button-sm"
|
|
298
|
+
},
|
|
299
|
+
md: {
|
|
300
|
+
height: "h-button-md",
|
|
301
|
+
square: "size-button-md",
|
|
302
|
+
radius: "rounded-button-md"
|
|
303
|
+
},
|
|
304
|
+
lg: {
|
|
305
|
+
height: "h-button-lg",
|
|
306
|
+
square: "size-button-lg",
|
|
307
|
+
radius: "rounded-button-lg"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
function G(e, t) {
|
|
311
|
+
return a(() => e === "field" ? U[S(t)] : W[S(t)]);
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/components/UiLoader/UiSpinnerIcon.vue
|
|
315
|
+
var K = /* @__PURE__ */ e({ default: () => X }), q = {}, J = {
|
|
316
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
317
|
+
fill: "none",
|
|
318
|
+
viewBox: "0 0 24 24"
|
|
319
|
+
};
|
|
320
|
+
function Y(e, t) {
|
|
321
|
+
return g(), c("svg", J, [...t[0] ||= [l("circle", {
|
|
322
|
+
class: "opacity-20",
|
|
323
|
+
cx: "12",
|
|
324
|
+
cy: "12",
|
|
325
|
+
r: "10",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
"stroke-width": "4"
|
|
328
|
+
}, null, -1), l("path", {
|
|
329
|
+
class: "opacity-100",
|
|
330
|
+
fill: "currentColor",
|
|
331
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
332
|
+
}, null, -1)]]);
|
|
333
|
+
}
|
|
334
|
+
var X = /*#__PURE__*/ P(q, [["render", Y]]), re = /*@__PURE__*/ d({
|
|
335
|
+
__name: "UiLoader",
|
|
336
|
+
props: { size: {
|
|
337
|
+
type: String,
|
|
338
|
+
default: "md",
|
|
339
|
+
validator: (e) => F.includes(e)
|
|
340
|
+
} },
|
|
341
|
+
setup(e) {
|
|
342
|
+
let t = e, n = O(() => t.size);
|
|
343
|
+
return (e, t) => (g(), c("div", null, [u(X, { class: m([C(n), "text-current animate-spin"]) }, null, 8, ["class"])]));
|
|
344
|
+
}
|
|
345
|
+
}), ie = /* @__PURE__ */ e({ default: () => Z }), Z = re, ae = I, oe = ["action", "body"], se = {
|
|
346
|
+
components: {
|
|
347
|
+
RenderSlot: n,
|
|
348
|
+
UiLoader: Z,
|
|
349
|
+
UiTooltip: t
|
|
350
|
+
},
|
|
351
|
+
props: {
|
|
352
|
+
variant: {
|
|
353
|
+
type: String,
|
|
354
|
+
default: "cta"
|
|
355
|
+
},
|
|
356
|
+
size: {
|
|
357
|
+
type: String,
|
|
358
|
+
default: "md",
|
|
359
|
+
validator: (e) => F.includes(e)
|
|
360
|
+
},
|
|
361
|
+
color: {
|
|
362
|
+
type: String,
|
|
363
|
+
default: "primary",
|
|
364
|
+
validator: (e) => ae.includes(e)
|
|
365
|
+
},
|
|
366
|
+
disabled: {
|
|
367
|
+
type: Boolean,
|
|
368
|
+
default: !1
|
|
369
|
+
},
|
|
370
|
+
showIconLeft: {
|
|
371
|
+
type: Boolean,
|
|
372
|
+
default: !0
|
|
373
|
+
},
|
|
374
|
+
icon: {
|
|
375
|
+
type: [String, Boolean],
|
|
376
|
+
default: void 0
|
|
377
|
+
},
|
|
378
|
+
label: {
|
|
379
|
+
type: String,
|
|
380
|
+
default: void 0
|
|
381
|
+
},
|
|
382
|
+
iconRight: {
|
|
383
|
+
type: [String, Boolean],
|
|
384
|
+
default: void 0
|
|
385
|
+
},
|
|
386
|
+
textStyle: {
|
|
387
|
+
type: String,
|
|
388
|
+
default: "action",
|
|
389
|
+
validator: (e) => oe.includes(e)
|
|
390
|
+
},
|
|
391
|
+
loading: {
|
|
392
|
+
type: Boolean,
|
|
393
|
+
default: !1
|
|
394
|
+
},
|
|
395
|
+
imageSource: {
|
|
396
|
+
type: String,
|
|
397
|
+
default: void 0
|
|
398
|
+
},
|
|
399
|
+
tooltip: {
|
|
400
|
+
type: [String, Object],
|
|
401
|
+
default: void 0
|
|
402
|
+
},
|
|
403
|
+
type: {
|
|
404
|
+
type: String,
|
|
405
|
+
default: "button"
|
|
406
|
+
},
|
|
407
|
+
href: {
|
|
408
|
+
type: String,
|
|
409
|
+
default: void 0
|
|
410
|
+
},
|
|
411
|
+
to: {
|
|
412
|
+
type: Object,
|
|
413
|
+
default: void 0
|
|
414
|
+
},
|
|
415
|
+
inline: {
|
|
416
|
+
type: Boolean,
|
|
417
|
+
default: !1
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
emits: [
|
|
421
|
+
"click",
|
|
422
|
+
"mouseenter",
|
|
423
|
+
"mouseleave"
|
|
424
|
+
],
|
|
425
|
+
setup(e) {
|
|
426
|
+
let t = r(), n = a(() => t.default && t.default()), i = a(() => t.icon && t.icon()), o = a(() => !!n.value), s = a(() => !o.value && !n.value && (!!e.icon || !!e.iconRight)), c = a(() => e.disabled || e.loading), l = a(() => {
|
|
427
|
+
let t = c.value;
|
|
428
|
+
return e.inline && (t || !e.to && !e.href) ? {
|
|
429
|
+
is: "span",
|
|
430
|
+
props: {
|
|
431
|
+
role: "button",
|
|
432
|
+
tabindex: t ? -1 : 0,
|
|
433
|
+
"aria-disabled": t || void 0
|
|
434
|
+
}
|
|
435
|
+
} : t && (e.to || e.href) ? {
|
|
436
|
+
is: "button",
|
|
437
|
+
props: {
|
|
438
|
+
type: "button",
|
|
439
|
+
disabled: !0
|
|
440
|
+
}
|
|
441
|
+
} : e.to ? {
|
|
442
|
+
is: "router-link",
|
|
443
|
+
props: { to: e.to }
|
|
444
|
+
} : e.href ? {
|
|
445
|
+
is: "a",
|
|
446
|
+
props: { href: e.href }
|
|
447
|
+
} : {
|
|
448
|
+
is: "button",
|
|
449
|
+
props: {
|
|
450
|
+
type: e.type,
|
|
451
|
+
disabled: t
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}), u = a(() => !c.value && (!!e.href || !!e.to)), d = ee(() => e.size), p = O(() => e.size), m = a(() => e.textStyle === "body" ? d.value : p.value), h = G("button", () => e.size), g = a(() => {
|
|
455
|
+
let t = (n.value && typeof n.value[0].children == "string" && n.value[0].children || e.label)?.trim();
|
|
456
|
+
if (t) return t;
|
|
457
|
+
if (s.value && e.icon && typeof e.icon == "string") {
|
|
458
|
+
let t = e.icon.replace(/^i-[a-z0-9]+-/, "").replace(/-/g, " ");
|
|
459
|
+
return t ? `${t} icon` : "icon";
|
|
460
|
+
}
|
|
461
|
+
}), _ = f();
|
|
462
|
+
function v(e) {
|
|
463
|
+
c.value ? e.preventDefault() : _?.emit("click", e);
|
|
464
|
+
}
|
|
465
|
+
let y = a(() => [
|
|
466
|
+
s.value ? h.value.square : h.value.height,
|
|
467
|
+
{ "grid place-items-center": s.value },
|
|
468
|
+
e.textStyle === "body" ? {
|
|
469
|
+
"text-content-legends-medium-md": e.size === "xs" || e.size === "sm",
|
|
470
|
+
"text-content-text-md-regular": e.size === "md",
|
|
471
|
+
"text-content-text-lg-regular": e.size === "lg"
|
|
472
|
+
} : {
|
|
473
|
+
"text-action-button-sm": e.size === "xs" || e.size === "sm",
|
|
474
|
+
"text-action-button-md": e.size === "md",
|
|
475
|
+
"text-action-button-lg": e.size === "lg"
|
|
476
|
+
},
|
|
477
|
+
e.size === "xs" ? "px-2" : e.size === "sm" ? "px-2.5" : e.size === "lg" ? "px-4" : "px-3",
|
|
478
|
+
{ "inline-flex": u.value }
|
|
479
|
+
]), { bgClass: b, textClass: x, borderClasses: S, decorationClass: C, overlayClasses: w } = H({
|
|
480
|
+
variant: () => e.inline ? "tertiary" : e.variant,
|
|
481
|
+
color: () => e.color,
|
|
482
|
+
disabled: c
|
|
483
|
+
}), E = b, D = a(() => x.value ? [x.value] : []);
|
|
484
|
+
function k(e) {
|
|
485
|
+
l.value.is !== "span" || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.currentTarget.click());
|
|
486
|
+
}
|
|
487
|
+
return T(() => !e.label && !e.icon && !e.iconRight && !n.value, (e) => {
|
|
488
|
+
e && console.warn("UiButton: You must provide a label or an icon to the button");
|
|
489
|
+
}, { immediate: !0 }), {
|
|
490
|
+
component: l,
|
|
491
|
+
defaultSlot: n,
|
|
492
|
+
iconSlot: i,
|
|
493
|
+
hasLabel: o,
|
|
494
|
+
isLink: u,
|
|
495
|
+
iconSizeClasses: m,
|
|
496
|
+
trailingIconSizeClasses: d,
|
|
497
|
+
shape: h,
|
|
498
|
+
buttonClasses: y,
|
|
499
|
+
bgClasses: E,
|
|
500
|
+
focusRingClasses: "group-focus-visible:focus-ring",
|
|
501
|
+
textClasses: D,
|
|
502
|
+
borderClasses: S,
|
|
503
|
+
decorationClass: C,
|
|
504
|
+
overlayClasses: w,
|
|
505
|
+
isSquare: s,
|
|
506
|
+
finalDisabled: c,
|
|
507
|
+
labelFinal: g,
|
|
508
|
+
onClick: v,
|
|
509
|
+
onInlineKeydown: k
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
}, ce = /* @__PURE__ */ e({ default: () => $ }), le = { class: "button-wrapper flex items-center whitespace-nowrap h-full relative z-20" }, ue = ["src", "alt"];
|
|
513
|
+
function Q(e, t, n, r, a, d) {
|
|
514
|
+
let f = y("RenderSlot"), h = y("UiLoader"), _ = y("UiTooltip");
|
|
515
|
+
return n.inline ? (g(), o(b(r.component.is), p({ key: 0 }, r.component.props, {
|
|
516
|
+
class: ["ui-button inline -mx-0.5 px-0.5 py-0.5 box-decoration-clone text-left font-semibold underline-offset-3 focus-indicator-none focus-visible:focus-ring", [
|
|
517
|
+
r.textClasses,
|
|
518
|
+
r.decorationClass,
|
|
519
|
+
r.finalDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:underline"
|
|
520
|
+
]],
|
|
521
|
+
"data-testid": "ui-button",
|
|
522
|
+
onClick: r.onClick,
|
|
523
|
+
onKeydown: r.onInlineKeydown,
|
|
524
|
+
onMouseenter: t[0] ||= (t) => e.$emit("mouseenter"),
|
|
525
|
+
onMouseleave: t[1] ||= (t) => e.$emit("mouseleave")
|
|
526
|
+
}), {
|
|
527
|
+
default: E(() => [u(f, { vnodes: r.defaultSlot }, null, 8, ["vnodes"])]),
|
|
528
|
+
_: 1
|
|
529
|
+
}, 16, [
|
|
530
|
+
"class",
|
|
531
|
+
"onClick",
|
|
532
|
+
"onKeydown"
|
|
533
|
+
])) : (g(), o(b(r.component.is), p({ key: 1 }, r.component.props, {
|
|
534
|
+
"aria-label": !r.isLink || r.isSquare ? r.labelFinal : void 0,
|
|
535
|
+
class: ["ui-button group align-center flex justify-center relative transition-all duration-150 focus-indicator-none", [
|
|
536
|
+
r.shape.radius,
|
|
537
|
+
r.buttonClasses,
|
|
538
|
+
r.textClasses,
|
|
539
|
+
{ "cursor-pointer": !r.finalDisabled },
|
|
540
|
+
{ "cursor-not-allowed": r.finalDisabled },
|
|
541
|
+
{ "opacity-50": n.disabled }
|
|
542
|
+
]],
|
|
543
|
+
"data-testid": "ui-button",
|
|
544
|
+
onClick: r.onClick,
|
|
545
|
+
onMouseenter: t[2] ||= (t) => e.$emit("mouseenter"),
|
|
546
|
+
onMouseleave: t[3] ||= (t) => e.$emit("mouseleave")
|
|
547
|
+
}), {
|
|
548
|
+
default: E(() => [
|
|
549
|
+
l("div", { class: m(["absolute h-full top-0 left-0 z-0 rounded-[inherit] w-full", [
|
|
550
|
+
r.bgClasses,
|
|
551
|
+
r.borderClasses,
|
|
552
|
+
r.focusRingClasses
|
|
553
|
+
]]) }, null, 2),
|
|
554
|
+
l("div", { class: m(["button-overlay absolute h-full top-0 left-0 z-10 rounded-[inherit] w-full", r.overlayClasses]) }, null, 2),
|
|
555
|
+
u(_, { content: typeof n.tooltip == "string" ? n.tooltip : n.tooltip?.content }, {
|
|
556
|
+
default: E(() => [l("div", le, [
|
|
557
|
+
n.loading ? (g(), o(h, {
|
|
558
|
+
key: 0,
|
|
559
|
+
size: n.size,
|
|
560
|
+
class: m({ "mr-2": r.hasLabel })
|
|
561
|
+
}, null, 8, ["size", "class"])) : n.showIconLeft ? (g(), c(i, { key: 1 }, [r.iconSlot ? (g(), c("div", {
|
|
562
|
+
key: 0,
|
|
563
|
+
class: m([[r.iconSizeClasses, { "mr-2": r.hasLabel }], "shrink-0"])
|
|
564
|
+
}, [u(f, { vnodes: r.iconSlot }, null, 8, ["vnodes"])], 2)) : n.imageSource ? (g(), c("div", {
|
|
565
|
+
key: 1,
|
|
566
|
+
class: m([[r.iconSizeClasses, { "mr-2": r.hasLabel }], "shrink-0"])
|
|
567
|
+
}, [l("img", {
|
|
568
|
+
src: n.imageSource,
|
|
569
|
+
alt: `${r.labelFinal} button image`
|
|
570
|
+
}, null, 8, ue)], 2)) : n.icon ? (g(), c("div", {
|
|
571
|
+
key: 2,
|
|
572
|
+
class: m([[
|
|
573
|
+
n.icon,
|
|
574
|
+
r.iconSizeClasses,
|
|
575
|
+
{ "mr-2": r.hasLabel }
|
|
576
|
+
], "shrink-0"]),
|
|
577
|
+
"data-testid": "ui-button-icon"
|
|
578
|
+
}, null, 2)) : s("", !0)], 64)) : s("", !0),
|
|
579
|
+
l("span", { class: m(["content w-full", r.decorationClass]) }, [u(f, { vnodes: r.defaultSlot }, null, 8, ["vnodes"])], 2),
|
|
580
|
+
n.iconRight ? (g(), c("div", {
|
|
581
|
+
key: 2,
|
|
582
|
+
class: m([[
|
|
583
|
+
n.iconRight,
|
|
584
|
+
r.trailingIconSizeClasses,
|
|
585
|
+
{ "ml-2": r.hasLabel }
|
|
586
|
+
], "shrink-0"]),
|
|
587
|
+
"data-testid": "ui-button-icon-right"
|
|
588
|
+
}, null, 2)) : s("", !0)
|
|
589
|
+
])]),
|
|
590
|
+
_: 1
|
|
591
|
+
}, 8, ["content"])
|
|
592
|
+
]),
|
|
593
|
+
_: 1
|
|
594
|
+
}, 16, [
|
|
595
|
+
"aria-label",
|
|
596
|
+
"class",
|
|
597
|
+
"onClick"
|
|
598
|
+
]));
|
|
599
|
+
}
|
|
600
|
+
var $ = /*#__PURE__*/ P(se, [["render", Q]]);
|
|
601
|
+
//#endregion
|
|
602
|
+
export { X as a, H as c, M as d, O as f, ie as i, P as l, ce as n, K as o, Z as r, G as s, $ as t, N as u };
|