@livestorm/ui-vue 3.0.0 → 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 +3 -3
- 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 -231
- package/dist/i18n-B8QOMuFD.mjs +46 -0
- package/dist/index.mjs +4 -91
- 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 +19 -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/types.d.ts +2 -0
- 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 +95 -35
- package/dist/types/src/components/UiButtonGroup/UiButtonGroup.vue.d.ts +8 -2
- package/dist/types/src/components/UiButtonGroup/types.d.ts +4 -0
- 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 +8 -5
- 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/UiInputRadio/RadioGlyph.vue.d.ts +19 -0
- package/dist/types/src/components/UiInputRadio/UiInputRadio.vue.d.ts +21 -8
- package/dist/types/src/components/UiInputRadio/UiInputRadioGroup.vue.d.ts +6 -1
- package/dist/types/src/components/UiInputRadio/types.d.ts +1 -1
- 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/UiSpinnerIcon.vue.d.ts +3 -0
- 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 +79 -15
- 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/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 +10 -5
- 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 +3 -0
- 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 +7 -9
- 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 +2 -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/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 +18 -0
- package/index.js +36 -0
- package/package.json +26 -21
- package/src/components/Toast/LayoutToasts.vue +19 -11
- package/src/components/Toast/ToastMessage.vue +125 -68
- package/src/components/Toast/toastDSV2.ts +238 -67
- package/src/components/UiActionBar/UiActionBar.vue +4 -3
- package/src/components/UiActionBar/UiActionBarItem.vue +9 -6
- package/src/components/UiActionBar/types.ts +13 -0
- package/src/components/UiAvatar/UiAvatar.vue +8 -2
- package/src/components/UiAvatarList/UiAvatarList.vue +51 -20
- package/src/components/UiBadge/UiBadge.vue +1 -1
- package/src/components/UiBanner/UiBanner.vue +71 -21
- package/src/components/UiBreadcrumb/UiBreadcrumb.vue +1 -1
- package/src/components/UiButton/UiButton.vue +92 -25
- package/src/components/UiButtonGroup/UiButtonGroup.vue +21 -17
- package/src/components/UiButtonGroup/UiButtonGroupItem.vue +33 -15
- package/src/components/UiButtonGroup/types.ts +19 -0
- package/src/components/UiCard/UiCard.vue +20 -23
- 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 +11 -8
- 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/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 +38 -18
- package/src/components/UiDropdown/UiDropdownSeparator.vue +1 -1
- package/src/components/UiDropdown/UiDropdownTrigger.vue +138 -43
- 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 +9 -3
- 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 +18 -95
- package/src/components/UiInputRadio/RadioGlyph.vue +45 -0
- package/src/components/UiInputRadio/UiInputRadio.vue +177 -169
- package/src/components/UiInputRadio/UiInputRadioGroup.vue +15 -5
- package/src/components/UiInputRadio/types.ts +1 -2
- 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 +4 -20
- package/src/components/UiLoader/UiSpinnerIcon.vue +21 -0
- 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 +1 -1
- package/src/components/UiNestedOptions/UiNestedOptions.vue +6 -0
- package/src/components/UiPage/UiPage.vue +190 -32
- 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 +10 -41
- package/src/components/UiRoomCountdown/UiRoomCountdown.vue +376 -0
- package/src/components/UiShell/UiShell.vue +9 -3
- package/src/components/UiSideMenu/UiSideMenu.vue +155 -18
- package/src/components/UiSideMenu/UiSideMenuItemContent.vue +20 -16
- package/src/components/UiStepper/UiStepper.vue +3 -16
- package/src/components/UiStepper/UiStepperDescription.vue +1 -13
- package/src/components/UiStepper/UiStepperIndicator.vue +11 -48
- 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 +44 -28
- 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 +56 -61
- 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 +21 -36
- 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 +29 -16
- 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 +15 -0
- package/src/composables/usePullGesture.ts +142 -0
- package/src/composables/useThemeAndModes.ts +28 -1
- package/src/css/body.css +16 -1
- package/src/css/fonts.css +39 -5
- package/src/global.d.ts +36 -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-LpdvGf5X.mjs +0 -6093
- 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/UiInputEmoji/index.d.ts +0 -1
- package/dist/types/src/components/UiInputRadio/index.d.ts +0 -3
- 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/UiSwitch/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/UiInputEmoji/index.ts +0 -1
- package/src/components/UiInputRadio/index.ts +0 -3
- 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/UiSwitch/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestorm/ui-vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Livestorm UI components for Vue 3",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -34,54 +34,59 @@
|
|
|
34
34
|
"style.js"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@livestorm/ui-icons": "^4.0.0",
|
|
38
|
+
"@livestorm/ui-tokens": "^4.0.0",
|
|
37
39
|
"@lottiefiles/dotlottie-vue": "^0.11.16",
|
|
38
40
|
"@tanstack/vue-form": "^1.33.0",
|
|
41
|
+
"@tanstack/vue-table": "^9.1.2",
|
|
39
42
|
"@vueuse/core": "^14.3.0",
|
|
43
|
+
"culori": "^4.0.2",
|
|
40
44
|
"embla-carousel": "^8.6.0",
|
|
41
45
|
"embla-carousel-autoplay": "^8.6.0",
|
|
42
46
|
"embla-carousel-vue": "^8.6.0",
|
|
43
47
|
"i18next": "^26.3.4",
|
|
48
|
+
"inter-ui": "^4.1.1",
|
|
44
49
|
"mitt": "^3.0.1",
|
|
45
50
|
"reka-ui": "^2.9.10",
|
|
46
|
-
"vue
|
|
47
|
-
"
|
|
48
|
-
"@livestorm/ui-icons": "^3.0.0"
|
|
51
|
+
"vaul-vue": "^0.4.1",
|
|
52
|
+
"vue-frimousse": "^0.1.4"
|
|
49
53
|
},
|
|
50
54
|
"devDependencies": {
|
|
51
55
|
"@chromatic-com/storybook": "^5.2.1",
|
|
52
56
|
"@iconify-json/ph": "^1.2.2",
|
|
53
57
|
"@iconify/utils": "^3.1.4",
|
|
54
|
-
"@
|
|
58
|
+
"@livestorm/dev-utils": "1.0.0",
|
|
59
|
+
"@storybook/addon-a11y": "^10.6.0",
|
|
55
60
|
"@storybook/addon-coverage": "^3.0.2",
|
|
56
61
|
"@storybook/addon-designs": "^11.1.4",
|
|
57
|
-
"@storybook/addon-docs": "^10.
|
|
58
|
-
"@storybook/addon-links": "^10.
|
|
59
|
-
"@storybook/addon-themes": "^10.
|
|
60
|
-
"@storybook/addon-vitest": "^10.
|
|
61
|
-
"@storybook/vue3-vite": "^10.
|
|
62
|
+
"@storybook/addon-docs": "^10.6.0",
|
|
63
|
+
"@storybook/addon-links": "^10.6.0",
|
|
64
|
+
"@storybook/addon-themes": "^10.6.0",
|
|
65
|
+
"@storybook/addon-vitest": "^10.6.0",
|
|
66
|
+
"@storybook/vue3-vite": "^10.6.0",
|
|
62
67
|
"@tailwindcss/vite": "^4.3.2",
|
|
68
|
+
"@types/culori": "^4.0.1",
|
|
63
69
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
64
70
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
65
|
-
"@vitest/browser": "^
|
|
66
|
-
"@vitest/browser-playwright": "^
|
|
67
|
-
"@vitest/coverage-v8": "^
|
|
68
|
-
"@vitest/ui": "^
|
|
71
|
+
"@vitest/browser": "^5.0.1",
|
|
72
|
+
"@vitest/browser-playwright": "^5.0.1",
|
|
73
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
74
|
+
"@vitest/ui": "^5.0.1",
|
|
69
75
|
"@vue/test-utils": "^2.4.11",
|
|
70
|
-
"chromatic": "^18.
|
|
76
|
+
"chromatic": "^18.7.2",
|
|
71
77
|
"eslint": "^9.39.4",
|
|
72
78
|
"eslint-plugin-storybook": "^10.5.5",
|
|
73
79
|
"happy-dom": "^20.10.6",
|
|
74
80
|
"playwright": "^1.61.1",
|
|
75
|
-
"storybook": "^10.
|
|
81
|
+
"storybook": "^10.6.0",
|
|
76
82
|
"tailwindcss": "^4.3.2",
|
|
77
83
|
"typescript": "^6.0.3",
|
|
78
|
-
"vite": "^
|
|
79
|
-
"vitest": "^
|
|
80
|
-
"vitest-browser-vue": "^
|
|
84
|
+
"vite": "^8.3.0",
|
|
85
|
+
"vitest": "^5.0.1",
|
|
86
|
+
"vitest-browser-vue": "^3.1.0",
|
|
81
87
|
"vue": "^3.5.39",
|
|
82
88
|
"vue-router": "^5.1.0",
|
|
83
|
-
"vue-tsc": "^3.3.8"
|
|
84
|
-
"@livestorm/dev-utils": "1.0.0"
|
|
89
|
+
"vue-tsc": "^3.3.8"
|
|
85
90
|
},
|
|
86
91
|
"peerDependencies": {
|
|
87
92
|
"tailwindcss": "^4.0.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, getCurrentInstance } from 'vue'
|
|
3
3
|
import type { ResponsiveGlobalComponentProperty } from '../../utils/responsive.types'
|
|
4
4
|
import { useResponsive } from '../../utils/responsive'
|
|
5
|
-
import {
|
|
5
|
+
import { MAX_ITEMS_DISPLAYED, useToasts } from './toastDSV2'
|
|
6
6
|
import ToastMessage from './ToastMessage.vue'
|
|
7
7
|
|
|
8
8
|
const app = getCurrentInstance()
|
|
@@ -13,11 +13,13 @@ if (!app) {
|
|
|
13
13
|
// back to the shared singleton so no plugin registration is required.
|
|
14
14
|
const responsive = computed(() => (app.appContext.config.globalProperties.$responsive ?? useResponsive()) as ResponsiveGlobalComponentProperty)
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const { toasts, closeToast, cancelCloseTimer, restartToast } = useToasts()
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const visible = computed(() => toasts.value.slice(0, MAX_ITEMS_DISPLAYED))
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// Read off the visible window, not the queue: a locked toast waiting its turn
|
|
21
|
+
// would otherwise raise the blocking overlay with nothing on screen to act on.
|
|
22
|
+
const hasLockedToast = computed(() => visible.value.some(toast => toast.options.locked))
|
|
21
23
|
|
|
22
24
|
function onBeforeLeave (el: Element) {
|
|
23
25
|
const bounds = el.getBoundingClientRect()
|
|
@@ -37,27 +39,33 @@ function onBeforeLeave (el: Element) {
|
|
|
37
39
|
<div
|
|
38
40
|
v-if="hasLockedToast"
|
|
39
41
|
data-testid="layout-toasts-locked"
|
|
40
|
-
class="bg-alpha-black-300 fixed inset-0 z-
|
|
42
|
+
class="bg-alpha-black-300 fixed inset-0 z-blocking"
|
|
41
43
|
/>
|
|
42
44
|
</transition>
|
|
45
|
+
<!-- The live region is the container, not the toast: it has to be in the DOM
|
|
46
|
+
before a toast is inserted for the insertion to be announced. Atomic is
|
|
47
|
+
off so only the new toast is read out, not the whole stack again. -->
|
|
43
48
|
<TransitionGroup
|
|
44
49
|
name="list"
|
|
45
50
|
tag="div"
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
role="status"
|
|
52
|
+
aria-live="polite"
|
|
53
|
+
aria-atomic="false"
|
|
54
|
+
:class="!responsive?.mobile ? 'm-8 max-w-md w-full left-0 supports-[left:anchor(--a_right)]:left-[anchor(--ui-shell-side-menu_right,0px)]' : 'm-4 left-0 right-0'"
|
|
55
|
+
class="fixed bottom-0 flex flex-col gap-2 z-max [view-transition-name:layout-toasts]"
|
|
48
56
|
@before-leave="onBeforeLeave"
|
|
49
57
|
>
|
|
50
58
|
<div
|
|
51
|
-
v-for="item of
|
|
59
|
+
v-for="item of visible"
|
|
52
60
|
:key="item.id"
|
|
53
61
|
class="w-full sm:max-w-[400px]"
|
|
54
62
|
>
|
|
55
63
|
<ToastMessage
|
|
56
|
-
v-bind="item"
|
|
57
|
-
|
|
64
|
+
v-bind="item.options"
|
|
65
|
+
:timer-started-at="item.timerStartedAt"
|
|
58
66
|
@close="closeToast(item.id)"
|
|
59
67
|
@mouseenter="cancelCloseTimer(item.id)"
|
|
60
|
-
@mouseleave="
|
|
68
|
+
@mouseleave="restartToast(item.id)"
|
|
61
69
|
@confirm="item.confirmEventHook.trigger(undefined)"
|
|
62
70
|
@cancel="item.cancelEventHook.trigger(undefined)"
|
|
63
71
|
/>
|
|
@@ -1,20 +1,44 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// * We either have the frontend app working or the Storybook working.
|
|
6
|
-
// import UiButton from '../UiButton/UiButton.vue'
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import UiAvatar from '../UiAvatar/UiAvatar.vue'
|
|
4
|
+
import UiButton from '../UiButton/UiButton.vue'
|
|
7
5
|
|
|
8
|
-
import type {
|
|
9
|
-
import
|
|
6
|
+
import type { ToastBaseOptions } from './toastDSV2'
|
|
7
|
+
import type { ThemeColorType } from '../../theme'
|
|
8
|
+
import type { ButtonColor } from '../../composables/useButtonStyles'
|
|
10
9
|
|
|
11
|
-
type
|
|
10
|
+
// The alerting type tints the primary action and the progress fill alike.
|
|
11
|
+
const ACTION_COLOR: Record<ThemeColorType, ButtonColor> = {
|
|
12
|
+
info: 'primary',
|
|
13
|
+
alert: 'error',
|
|
14
|
+
warning: 'warning',
|
|
15
|
+
success: 'success',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tailwind's extractor can't see interpolated class names, so this holds
|
|
19
|
+
// complete literals rather than building `bg-actions-${x}-idle` at runtime.
|
|
20
|
+
const PROGRESS_BG: Record<ThemeColorType, string> = {
|
|
21
|
+
info: 'bg-actions-primary-idle',
|
|
22
|
+
alert: 'bg-actions-danger-idle',
|
|
23
|
+
warning: 'bg-actions-warning-idle',
|
|
24
|
+
success: 'bg-actions-success-idle',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type ToastMessageProps = Partial<ToastBaseOptions> & {
|
|
28
|
+
/**
|
|
29
|
+
* When the store started the current run of the close timer, so the bar can
|
|
30
|
+
* animate again. Not a caller-facing option — `LayoutToasts` passes it.
|
|
31
|
+
*/
|
|
32
|
+
timerStartedAt?: number
|
|
33
|
+
}
|
|
12
34
|
|
|
13
35
|
const props = withDefaults(defineProps<ToastMessageProps>(), {
|
|
14
36
|
type: 'info',
|
|
15
37
|
locked: false,
|
|
16
38
|
closable: true,
|
|
39
|
+
actionsSize: 'md',
|
|
17
40
|
confirmHrefTarget: '_blank',
|
|
41
|
+
timerStartedAt: undefined,
|
|
18
42
|
})
|
|
19
43
|
|
|
20
44
|
const emit = defineEmits([
|
|
@@ -43,127 +67,158 @@ const modalIcon = computed(() => {
|
|
|
43
67
|
}
|
|
44
68
|
})
|
|
45
69
|
|
|
70
|
+
const testId = computed(() => `toast-message-${String(props.id)}`)
|
|
71
|
+
|
|
72
|
+
// Only a plain href can be targeted: a `confirmTo` route resolves in the app.
|
|
73
|
+
const confirmTarget = computed(() => (props.confirmHref ? props.confirmHrefTarget : undefined))
|
|
74
|
+
|
|
75
|
+
const hasMessage = computed(() => Boolean(props.message || props.messageComponent))
|
|
76
|
+
// A component may render block content, so it gets a block wrapper. Text
|
|
77
|
+
// without a title is the headline, so it takes the title's tag and styling.
|
|
78
|
+
const messageTag = computed(() => (props.messageComponent ? 'div' : (props.title ? 'p' : 'span')))
|
|
79
|
+
const messageClass = computed(() => (props.title
|
|
80
|
+
? 'text-content-text-md-medium text-text-neutral-secondary'
|
|
81
|
+
: 'text-content-text-md-bold text-text-neutral-base'))
|
|
82
|
+
|
|
83
|
+
const confirmButtonColor = computed(() => ACTION_COLOR[props.confirmColor ?? props.type])
|
|
84
|
+
const progressBarColor = computed(() => PROGRESS_BG[props.type])
|
|
85
|
+
|
|
46
86
|
const startTimer = ref(false)
|
|
47
87
|
const hovered = ref(false)
|
|
48
88
|
|
|
49
|
-
const enableProgressBar = computed(() => props.
|
|
89
|
+
const enableProgressBar = computed(() => props.progressIndeterminate || Boolean(props.time))
|
|
50
90
|
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
emit('mouseleave')
|
|
91
|
+
function playProgressBar () {
|
|
92
|
+
if (!props.time) return
|
|
54
93
|
|
|
55
|
-
|
|
56
|
-
if (props.time) {
|
|
57
|
-
startTimer.value = false
|
|
94
|
+
startTimer.value = false
|
|
58
95
|
|
|
59
|
-
|
|
60
|
-
startTimer.value = true
|
|
61
|
-
}, 100)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (props.time) {
|
|
66
|
-
// The delay is used to trigger the CSS transition
|
|
96
|
+
// The delay is what lets the CSS transition start over from zero.
|
|
67
97
|
setTimeout(() => {
|
|
68
98
|
startTimer.value = true
|
|
69
99
|
}, 100)
|
|
70
100
|
}
|
|
71
101
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
// Every restart the store performs, including the one LayoutToasts asks for
|
|
103
|
+
// when the pointer leaves.
|
|
104
|
+
watch(() => props.timerStartedAt, playProgressBar)
|
|
105
|
+
|
|
106
|
+
function onMouseleave () {
|
|
107
|
+
hovered.value = false
|
|
108
|
+
emit('mouseleave')
|
|
109
|
+
|
|
110
|
+
// Rendered on its own there is no store to restart the bar for us.
|
|
111
|
+
if (props.timerStartedAt === undefined) playProgressBar()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
playProgressBar()
|
|
85
115
|
</script>
|
|
86
116
|
|
|
87
117
|
<template>
|
|
88
118
|
<div
|
|
89
|
-
class=" relative grid grid-flow-col grid-rows-[auto_auto_auto] sm:grid-rows-1 sm:grid-cols-[auto_1fr_auto] items-start p-4 bg-surface-neutral-bg-main shadow-shadows-drop-shadow-
|
|
90
|
-
:data-testid="
|
|
119
|
+
class=" relative grid grid-flow-col grid-rows-[auto_auto_auto] sm:grid-rows-1 sm:grid-cols-[auto_1fr_auto] items-start p-4 bg-surface-neutral-bg-main shadow-shadows-drop-shadow-2xl rounded-container gap-x-0 overflow-hidden"
|
|
120
|
+
:data-testid="testId"
|
|
91
121
|
data-colors-semantic="light"
|
|
92
122
|
data-name="ui-toast-message"
|
|
93
123
|
@mouseenter="hovered = true, emit('mouseenter')"
|
|
94
124
|
@mouseleave="onMouseleave"
|
|
95
125
|
>
|
|
126
|
+
<!-- Sits in the text column, not the icon one, so the actions below stay
|
|
127
|
+
aligned with the content instead of being pushed into the gap. -->
|
|
96
128
|
<div
|
|
97
129
|
v-if="props.component"
|
|
98
|
-
|
|
99
|
-
class="flex-1 min-w-0"
|
|
130
|
+
class="flex-1 min-w-0 sm:col-start-2"
|
|
100
131
|
>
|
|
101
132
|
<component
|
|
102
|
-
:is="
|
|
133
|
+
:is="props.component"
|
|
103
134
|
v-bind="props.componentProps"
|
|
104
135
|
/>
|
|
105
136
|
</div>
|
|
106
137
|
<template v-else>
|
|
107
|
-
<!-- TODO: handle DSV2 tokens -->
|
|
108
138
|
<template v-if="enableProgressBar">
|
|
109
139
|
<div
|
|
110
140
|
v-if="time"
|
|
111
|
-
|
|
112
|
-
class="absolute opacity-100 transition-opacity duration-300 h-1 bg-grey-100 top-0 left-0 w-full"
|
|
141
|
+
class="absolute opacity-100 transition-opacity duration-150 h-1 bg-actions-neutral-idle-alpha-light top-0 left-0 w-full"
|
|
113
142
|
:class="{
|
|
114
143
|
'opacity-0!': hovered
|
|
115
144
|
}"
|
|
116
145
|
>
|
|
117
146
|
<div
|
|
118
147
|
v-if="time"
|
|
148
|
+
data-testid="toast-progress"
|
|
119
149
|
class="h-full w-0 ease-linear duration-1000"
|
|
120
|
-
:class="[startTimer ? 'w-full transition-all': 'transition-none',
|
|
121
|
-
'bg-green-600': props.type === 'success',
|
|
122
|
-
'bg-livestorm-600': props.type === 'info'
|
|
123
|
-
}]"
|
|
150
|
+
:class="[startTimer ? 'w-full transition-all': 'transition-none', progressBarColor]"
|
|
124
151
|
:style="{
|
|
125
152
|
transitionDuration: `${(props.time as number)/1000}s`
|
|
126
153
|
}"
|
|
127
154
|
/>
|
|
128
155
|
</div>
|
|
129
156
|
<div
|
|
130
|
-
v-else-if="props.
|
|
131
|
-
class="absolute h-1 bg-
|
|
157
|
+
v-else-if="props.progressIndeterminate"
|
|
158
|
+
class="absolute h-1 bg-actions-neutral-idle-alpha-light top-0 left-0 w-full"
|
|
132
159
|
>
|
|
133
|
-
<div
|
|
160
|
+
<div
|
|
161
|
+
class="animate-progress-indeterminate w-full h-full origin-left-right"
|
|
162
|
+
:class="progressBarColor"
|
|
163
|
+
/>
|
|
134
164
|
</div>
|
|
135
165
|
</template>
|
|
136
166
|
|
|
137
|
-
|
|
167
|
+
<!-- The 2px inset mirrors the icon-container padding in Figma, which
|
|
168
|
+
optically centres the glyph against the title's cap height. The
|
|
169
|
+
avatar is its own 24px box in the design and sits flush instead. -->
|
|
170
|
+
<div
|
|
171
|
+
class="shrink-0"
|
|
172
|
+
:class="{ 'pl-0.5 pt-0.5': !props.avatar }"
|
|
173
|
+
>
|
|
174
|
+
<UiAvatar
|
|
175
|
+
v-if="props.avatar"
|
|
176
|
+
v-bind="props.avatar"
|
|
177
|
+
size="xs"
|
|
178
|
+
class="mr-3 mb-2 sm:mb-0"
|
|
179
|
+
/>
|
|
138
180
|
<div
|
|
139
|
-
v-if="modalIcon"
|
|
140
|
-
class="size-
|
|
181
|
+
v-else-if="modalIcon"
|
|
182
|
+
class="size-4 mr-3 shrink-0 mb-2 sm:mb-0"
|
|
141
183
|
:class="modalIcon"
|
|
142
184
|
/>
|
|
143
185
|
</div>
|
|
144
186
|
<div class="flex flex-col flex-1 sm:row-start-1 min-w-0 wrap-break-word">
|
|
145
187
|
<span
|
|
146
|
-
v-if="props.title
|
|
188
|
+
v-if="props.title"
|
|
147
189
|
class="text-content-text-md-bold text-text-neutral-base"
|
|
148
|
-
>{{ props.title
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
190
|
+
>{{ props.title }}</span>
|
|
191
|
+
<component
|
|
192
|
+
:is="messageTag"
|
|
193
|
+
v-if="hasMessage"
|
|
194
|
+
:class="messageClass"
|
|
152
195
|
>
|
|
153
|
-
|
|
154
|
-
|
|
196
|
+
<component
|
|
197
|
+
:is="props.messageComponent"
|
|
198
|
+
v-if="props.messageComponent"
|
|
199
|
+
v-bind="props.messageComponentProps"
|
|
200
|
+
/>
|
|
201
|
+
<template v-else>
|
|
202
|
+
{{ props.message }}
|
|
203
|
+
</template>
|
|
204
|
+
</component>
|
|
155
205
|
<p
|
|
156
206
|
v-if="props.info"
|
|
157
|
-
class="text-content-text-md-
|
|
207
|
+
class="text-content-text-md-medium text-text-neutral-secondary mt-1"
|
|
158
208
|
>
|
|
159
209
|
{{ props.info }}
|
|
160
210
|
</p>
|
|
161
211
|
</div>
|
|
162
212
|
</template>
|
|
163
213
|
|
|
164
|
-
|
|
214
|
+
<!-- The wrapper carries the condition, not the button: it is the grid's
|
|
215
|
+
third track, so leaving it behind would reserve its width for nothing
|
|
216
|
+
and squeeze the text column on a locked toast. -->
|
|
217
|
+
<div
|
|
218
|
+
v-if="!props.locked && props.closable"
|
|
219
|
+
class="row-start-1 sm:col-start-3 h-4 w-8 justify-self-end"
|
|
220
|
+
>
|
|
165
221
|
<UiButton
|
|
166
|
-
v-if="!props.locked && props.closable"
|
|
167
222
|
:data-testid="`toast-close-${String(props.id)}`"
|
|
168
223
|
color="neutral"
|
|
169
224
|
variant="tertiary"
|
|
@@ -184,9 +239,10 @@ onMounted(() => {
|
|
|
184
239
|
v-if="props.confirmLabel"
|
|
185
240
|
:href="props.confirmHref"
|
|
186
241
|
:to="props.confirmTo"
|
|
187
|
-
:target="
|
|
242
|
+
:target="confirmTarget"
|
|
188
243
|
:icon="props.confirmIcon"
|
|
189
|
-
color="
|
|
244
|
+
:color="confirmButtonColor"
|
|
245
|
+
:size="props.actionsSize"
|
|
190
246
|
variant="cta"
|
|
191
247
|
class="w-full sm:w-auto"
|
|
192
248
|
@click="$emit('confirm', $event)"
|
|
@@ -196,8 +252,9 @@ onMounted(() => {
|
|
|
196
252
|
|
|
197
253
|
<UiButton
|
|
198
254
|
v-if="props.cancelLabel"
|
|
199
|
-
color="neutral
|
|
200
|
-
variant="
|
|
255
|
+
color="neutral"
|
|
256
|
+
variant="secondary"
|
|
257
|
+
:size="props.actionsSize"
|
|
201
258
|
class="w-full sm:w-auto"
|
|
202
259
|
@click="$emit('cancel')"
|
|
203
260
|
>
|