@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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
3
|
import UiFieldWrapper from '../UiFieldWrapper/UiFieldWrapper.vue'
|
|
4
|
+
import { useFieldFocusEvents } from '../../composables/useFieldFocusEvents'
|
|
4
5
|
import type { TextareaSize } from './types'
|
|
6
|
+
import { useControlShape } from '../../composables/useControlShape'
|
|
5
7
|
|
|
6
8
|
interface UiInputTextareaProps {
|
|
7
9
|
size?: TextareaSize
|
|
@@ -45,7 +47,8 @@ const emit = defineEmits<{
|
|
|
45
47
|
}>()
|
|
46
48
|
|
|
47
49
|
const textareaRef = ref<HTMLTextAreaElement | null>(null)
|
|
48
|
-
const
|
|
50
|
+
const shape = useControlShape('field', () => props.size)
|
|
51
|
+
const { isFocused, handleFocus, handleBlur, handleKeydown, handleKeyup } = useFieldFocusEvents(emit)
|
|
49
52
|
|
|
50
53
|
const minHeight = computed(() => {
|
|
51
54
|
const lineHeight = { sm: 1.25, md: 1.5, lg: 1.5, xl: 1.75 }
|
|
@@ -56,9 +59,10 @@ const minHeight = computed(() => {
|
|
|
56
59
|
const textareaClasses = computed(() => {
|
|
57
60
|
const baseClasses = [
|
|
58
61
|
'ui-textarea',
|
|
59
|
-
'block relative w-full
|
|
62
|
+
'block relative w-full transition-colors',
|
|
63
|
+
shape.value.radius,
|
|
60
64
|
'text-text-neutral-base',
|
|
61
|
-
'placeholder:text-
|
|
65
|
+
'placeholder:text-control-placeholder',
|
|
62
66
|
'focus:outline-hidden',
|
|
63
67
|
]
|
|
64
68
|
|
|
@@ -77,30 +81,27 @@ const textareaClasses = computed(() => {
|
|
|
77
81
|
baseClasses.push('resize-none')
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
const showsFocus = isFocused.value && !props.disabled && !props.loading
|
|
85
|
+
|
|
80
86
|
if (props.error) {
|
|
81
87
|
baseClasses.push(
|
|
82
88
|
'bg-actions-danger-idle-alpha-light',
|
|
83
|
-
'border', 'border-
|
|
89
|
+
'border', 'border-control-error-border',
|
|
84
90
|
)
|
|
91
|
+
} else if (showsFocus) {
|
|
92
|
+
baseClasses.push('bg-control-field-bg-focus', 'border', 'border-control-field-border')
|
|
85
93
|
} else {
|
|
86
|
-
baseClasses.push(
|
|
87
|
-
'bg-actions-neutral-idle-alpha-light',
|
|
88
|
-
'border', 'border-borders-neutral-strong',
|
|
89
|
-
)
|
|
94
|
+
baseClasses.push('bg-control-field-bg', 'border', 'border-control-field-border')
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
if (props.disabled) {
|
|
93
98
|
baseClasses.push('opacity-50 cursor-not-allowed')
|
|
94
|
-
} else if (!props.loading) {
|
|
95
|
-
baseClasses.push('hover:bg-actions-neutral-hover-overlay')
|
|
99
|
+
} else if (!props.loading && !showsFocus) {
|
|
100
|
+
baseClasses.push('hover:bg-[image:linear-gradient(var(--color-actions-neutral-hover-overlay),var(--color-actions-neutral-hover-overlay))]')
|
|
96
101
|
}
|
|
97
102
|
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
baseClasses.push('border-borders-danger-strong', 'ring-1', 'ring-inset', 'ring-borders-danger-strong')
|
|
101
|
-
} else {
|
|
102
|
-
baseClasses.push('border-actions-primary-idle-alpha-strong', 'ring-1', 'ring-inset', 'ring-focus-ring')
|
|
103
|
-
}
|
|
103
|
+
if (showsFocus) {
|
|
104
|
+
baseClasses.push('focus-ring')
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
return baseClasses
|
|
@@ -116,24 +117,6 @@ function handleInput (event: Event) {
|
|
|
116
117
|
emit('update:modelValue', target.value)
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
function handleFocus (event: FocusEvent) {
|
|
120
|
-
isFocused.value = true
|
|
121
|
-
emit('focus', event)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function handleBlur (event: FocusEvent) {
|
|
125
|
-
isFocused.value = false
|
|
126
|
-
emit('blur', event)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function handleKeydown (event: KeyboardEvent) {
|
|
130
|
-
emit('keydown', event)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function handleKeyup (event: KeyboardEvent) {
|
|
134
|
-
emit('keyup', event)
|
|
135
|
-
}
|
|
136
|
-
|
|
137
120
|
defineExpose({
|
|
138
121
|
focus: () => textareaRef.value?.focus(),
|
|
139
122
|
blur: () => textareaRef.value?.blur(),
|
|
@@ -200,6 +183,8 @@ defineExpose({
|
|
|
200
183
|
</template>
|
|
201
184
|
|
|
202
185
|
<style scoped>
|
|
186
|
+
@reference '@livestorm/ui-tokens/output/supernova/index.css';
|
|
187
|
+
|
|
203
188
|
.ui-textarea::-webkit-scrollbar {
|
|
204
189
|
width: 8px;
|
|
205
190
|
}
|
|
@@ -210,7 +195,7 @@ defineExpose({
|
|
|
210
195
|
|
|
211
196
|
.ui-textarea::-webkit-scrollbar-thumb {
|
|
212
197
|
background: var(--color-neutral-alpha-dark-400);
|
|
213
|
-
|
|
198
|
+
@apply rounded-full;
|
|
214
199
|
}
|
|
215
200
|
|
|
216
201
|
.ui-textarea::-webkit-scrollbar-thumb:hover {
|
|
@@ -21,7 +21,7 @@ withDefaults(defineProps<Props>(), {
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<div class="mb-1 flex items-center text-content-legends-bold-md text-text-neutral-
|
|
24
|
+
<div class="mb-1 flex items-center text-content-legends-bold-md text-text-neutral-secondary">
|
|
25
25
|
<UiTooltip :content="tooltip">
|
|
26
26
|
<label
|
|
27
27
|
:for="forId"
|
|
@@ -18,7 +18,7 @@ export type Variant = typeof VARIANTS[number]
|
|
|
18
18
|
const COLORS = ['primary', 'neutral', 'success', 'warning', 'error', 'neutral-invert'] as const
|
|
19
19
|
export type Color = typeof COLORS[number]
|
|
20
20
|
|
|
21
|
-
const props = defineProps<{
|
|
21
|
+
const props = withDefaults(defineProps<{
|
|
22
22
|
variant?: Variant
|
|
23
23
|
selected?: boolean
|
|
24
24
|
isActive?: boolean
|
|
@@ -28,18 +28,63 @@ const props = defineProps<{
|
|
|
28
28
|
additionalInfo?: string
|
|
29
29
|
to?: RouteLocationRaw
|
|
30
30
|
href?: string
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Aligns the content with the container edge; the hover and active fill bleeds past it without widening the row
|
|
33
|
+
*/
|
|
34
|
+
flush?: boolean
|
|
35
|
+
/**
|
|
36
|
+
* Aligns the content with the list's top and bottom edges: the row drops its vertical padding and minimum height,
|
|
37
|
+
* and the hover and active fill bleeds 0.25rem above and below. It is designed for rows spaced 0.5rem (8px) apart,
|
|
38
|
+
* where the fill reaches the middle of the gap and never covers the neighbour row
|
|
39
|
+
*/
|
|
40
|
+
flushVertical?: boolean
|
|
41
|
+
/**
|
|
42
|
+
* 'comfortable' adds vertical padding, for rows holding several lines beside an avatar
|
|
43
|
+
*/
|
|
44
|
+
density?: 'compact' | 'comfortable'
|
|
45
|
+
}>(), {
|
|
46
|
+
density: 'compact',
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
// Shadows are painted outside the box without adding scrollable overflow, so the fill can bleed
|
|
50
|
+
// out of a scroll container's content edge.
|
|
51
|
+
const FLUSH_HOVER_FILL = 'hover:shadow-[-0.75rem_0_var(--color-actions-primary-hover-overlay),0.75rem_0_var(--color-actions-primary-hover-overlay)]'
|
|
52
|
+
const FLUSH_ACTIVE_FILL = 'shadow-[-0.75rem_0_var(--color-actions-primary-active-overlay),0.75rem_0_var(--color-actions-primary-active-overlay)]'
|
|
53
|
+
|
|
54
|
+
// The vertical bleed is a layer behind the content that is never hit-tested, so it never covers a control above or
|
|
55
|
+
// below the row; it carries the horizontal bleed as its own shadows.
|
|
56
|
+
const BLEED_LAYER = "flush-vertical isolate before:content-[''] before:absolute before:inset-x-0 before:-inset-y-1 before:-z-1 before:rounded-row before:pointer-events-none"
|
|
57
|
+
const BLEED_HOVER_FILL = 'hover:before:bg-actions-primary-hover-overlay'
|
|
58
|
+
const BLEED_ACTIVE_FILL = 'before:bg-actions-primary-active-overlay'
|
|
59
|
+
const FLUSH_BLEED_HOVER_FILL = 'hover:before:shadow-[-0.75rem_0_var(--color-actions-primary-hover-overlay),0.75rem_0_var(--color-actions-primary-hover-overlay)]'
|
|
60
|
+
const FLUSH_BLEED_ACTIVE_FILL = 'before:shadow-[-0.75rem_0_var(--color-actions-primary-active-overlay),0.75rem_0_var(--color-actions-primary-active-overlay)]'
|
|
32
61
|
|
|
33
62
|
const slots = useSlots()
|
|
34
63
|
const hasAvatarSlot = computed(() => !!slots.avatar)
|
|
35
64
|
const hasAsideSlot = computed(() => !!slots.aside)
|
|
36
65
|
|
|
37
66
|
const cssClasses = computed(() => {
|
|
67
|
+
const isDefault = props.variant === 'default'
|
|
68
|
+
const bleeds = isDefault && props.flushVertical
|
|
69
|
+
const fillsBox = isDefault && !props.flushVertical
|
|
70
|
+
|
|
38
71
|
return {
|
|
39
|
-
'text-content-text-md-regular default
|
|
72
|
+
'text-content-text-md-regular default': isDefault,
|
|
73
|
+
'min-h-10': fillsBox,
|
|
40
74
|
'text-content-legends-bold-md title min-h-7': props.variant === 'title',
|
|
41
75
|
'spacer-xs h-8': props.variant === 'spacer-xs',
|
|
42
|
-
'is-active
|
|
76
|
+
'is-active': props.isActive && isDefault,
|
|
77
|
+
'px-3': !props.flush,
|
|
78
|
+
'py-2': props.density === 'comfortable' && !props.flushVertical,
|
|
79
|
+
'hover:bg-actions-primary-hover-overlay': fillsBox,
|
|
80
|
+
'bg-actions-primary-active-overlay': fillsBox && props.isActive,
|
|
81
|
+
[FLUSH_HOVER_FILL]: fillsBox && props.flush && !props.isActive,
|
|
82
|
+
[FLUSH_ACTIVE_FILL]: fillsBox && props.flush && props.isActive,
|
|
83
|
+
[BLEED_LAYER]: bleeds,
|
|
84
|
+
[BLEED_HOVER_FILL]: bleeds && !props.isActive,
|
|
85
|
+
[BLEED_ACTIVE_FILL]: bleeds && props.isActive,
|
|
86
|
+
[FLUSH_BLEED_HOVER_FILL]: bleeds && props.flush && !props.isActive,
|
|
87
|
+
[FLUSH_BLEED_ACTIVE_FILL]: bleeds && props.flush && props.isActive,
|
|
43
88
|
}
|
|
44
89
|
})
|
|
45
90
|
</script>
|
|
@@ -47,14 +92,14 @@ const cssClasses = computed(() => {
|
|
|
47
92
|
<template>
|
|
48
93
|
<div
|
|
49
94
|
:class="cssClasses"
|
|
50
|
-
class="flex items-center gap-2 relative rounded-xl
|
|
95
|
+
class="flex items-center gap-2 relative rounded-xl"
|
|
51
96
|
>
|
|
52
97
|
<slot
|
|
53
98
|
v-if="hasAvatarSlot"
|
|
54
99
|
name="avatar"
|
|
55
100
|
/>
|
|
56
101
|
|
|
57
|
-
<div>
|
|
102
|
+
<div class="min-w-0">
|
|
58
103
|
<template v-if="props.label">
|
|
59
104
|
{{ props.label }}
|
|
60
105
|
</template>
|
|
@@ -70,8 +115,6 @@ const cssClasses = computed(() => {
|
|
|
70
115
|
name="aside"
|
|
71
116
|
/>
|
|
72
117
|
|
|
73
|
-
<slot />
|
|
74
|
-
|
|
75
118
|
<router-link
|
|
76
119
|
v-if="to && !href"
|
|
77
120
|
:to="to"
|
|
@@ -102,7 +145,10 @@ const cssClasses = computed(() => {
|
|
|
102
145
|
}
|
|
103
146
|
|
|
104
147
|
.is-active {
|
|
105
|
-
background-color: var(--color-actions-primary-active-overlay);
|
|
106
148
|
color: var(--color-actions-primary-idle);
|
|
107
149
|
}
|
|
150
|
+
|
|
151
|
+
.is-active:not(.flush-vertical) {
|
|
152
|
+
background-color: var(--color-actions-primary-active-overlay);
|
|
153
|
+
}
|
|
108
154
|
</style>
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
3
|
+
<UiSpinnerIcon
|
|
4
4
|
:class="[
|
|
5
5
|
sizeClass,
|
|
6
|
-
'text-
|
|
6
|
+
'text-current animate-spin',
|
|
7
7
|
]"
|
|
8
|
-
|
|
9
|
-
fill="none"
|
|
10
|
-
viewBox="0 0 24 24"
|
|
11
|
-
>
|
|
12
|
-
<circle
|
|
13
|
-
class="opacity-20"
|
|
14
|
-
cx="12"
|
|
15
|
-
cy="12"
|
|
16
|
-
r="10"
|
|
17
|
-
stroke="currentColor"
|
|
18
|
-
stroke-width="4"
|
|
19
|
-
/>
|
|
20
|
-
<path
|
|
21
|
-
class="opacity-100"
|
|
22
|
-
fill="currentColor"
|
|
23
|
-
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"
|
|
24
|
-
/>
|
|
25
|
-
</svg>
|
|
8
|
+
/>
|
|
26
9
|
</div>
|
|
27
10
|
</template>
|
|
28
11
|
<script lang="ts" setup>
|
|
29
12
|
import { SIZES, type Size } from '../../constants'
|
|
30
13
|
import { useIconSize } from '../../composables/useIconSize'
|
|
14
|
+
import UiSpinnerIcon from './UiSpinnerIcon.vue'
|
|
31
15
|
|
|
32
16
|
const props = defineProps({
|
|
33
17
|
size: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
fill="none"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
>
|
|
7
|
+
<circle
|
|
8
|
+
class="opacity-20"
|
|
9
|
+
cx="12"
|
|
10
|
+
cy="12"
|
|
11
|
+
r="10"
|
|
12
|
+
stroke="currentColor"
|
|
13
|
+
stroke-width="4"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
class="opacity-100"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
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"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
</template>
|
|
@@ -1,22 +1,43 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { DropdownMenuContentEmits, DropdownMenuContentProps } from 'reka-ui'
|
|
3
3
|
import { DropdownMenuContent, DropdownMenuPortal, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
import { computed } from 'vue'
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
+
const WIDTH_CLASSES = {
|
|
7
|
+
auto: '',
|
|
8
|
+
sm: 'min-w-48',
|
|
9
|
+
md: 'min-w-56',
|
|
10
|
+
} as const
|
|
11
|
+
|
|
12
|
+
interface Props extends DropdownMenuContentProps {
|
|
13
|
+
/**
|
|
14
|
+
* 'auto' sizes the menu to its items; 'sm' and 'md' set a 192px and 224px minimum, and longer items still widen it
|
|
15
|
+
* @default 'auto'
|
|
16
|
+
*/
|
|
17
|
+
width?: keyof typeof WIDTH_CLASSES
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
21
|
+
width: 'auto',
|
|
6
22
|
sideOffset: 8,
|
|
7
23
|
align: 'start',
|
|
8
24
|
side: 'bottom',
|
|
9
25
|
})
|
|
10
26
|
|
|
11
27
|
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
12
|
-
const
|
|
28
|
+
const contentProps = computed(() => {
|
|
29
|
+
const { width: _width, ...rest } = props
|
|
30
|
+
return rest
|
|
31
|
+
})
|
|
32
|
+
const forwarded = useForwardPropsEmits(contentProps, emits)
|
|
13
33
|
</script>
|
|
14
34
|
|
|
15
35
|
<template>
|
|
16
36
|
<DropdownMenuPortal>
|
|
17
37
|
<DropdownMenuContent
|
|
18
38
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
19
|
-
class="
|
|
39
|
+
:class="WIDTH_CLASSES[props.width]"
|
|
40
|
+
class="max-w-(--reka-dropdown-menu-content-available-width) focus-indicator-none bg-surface-neutral-bg-main rounded-container border border-container-border shadow-shadows-drop-shadow-lg p-1 flex flex-col gap-1 z-overlay"
|
|
20
41
|
data-colors-semantic="light"
|
|
21
42
|
>
|
|
22
43
|
<slot />
|
|
@@ -10,7 +10,7 @@ defineProps<{
|
|
|
10
10
|
<DropdownMenuGroup v-bind="$attrs">
|
|
11
11
|
<DropdownMenuLabel
|
|
12
12
|
v-if="label"
|
|
13
|
-
class="text-content-legends-bold-md text-text-neutral-secondary px-3 pt-3 pb-1"
|
|
13
|
+
class="text-content-legends-bold-md text-text-neutral-secondary px-3.5 pt-3 pb-1"
|
|
14
14
|
>
|
|
15
15
|
{{ label }}
|
|
16
16
|
</DropdownMenuLabel>
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
2
3
|
import type { DropdownMenuItemEmits, DropdownMenuItemProps } from 'reka-ui'
|
|
3
4
|
import { DropdownMenuItem, useForwardPropsEmits } from 'reka-ui'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
export interface UiMenuItemProps extends DropdownMenuItemProps {
|
|
7
|
+
/** `danger` marks a destructive action such as Remove or Delete. */
|
|
8
|
+
variant?: 'default' | 'danger'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<UiMenuItemProps>(), {
|
|
12
|
+
variant: 'default',
|
|
13
|
+
})
|
|
6
14
|
const emits = defineEmits<DropdownMenuItemEmits>()
|
|
7
15
|
|
|
8
|
-
const forwarded = useForwardPropsEmits(props, emits)
|
|
16
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, 'variant'), emits)
|
|
9
17
|
</script>
|
|
10
18
|
|
|
11
19
|
<template>
|
|
12
20
|
<DropdownMenuItem
|
|
13
21
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
14
|
-
class="w-full flex items-center gap-2 min-h-10 px-3 py-1.5 rounded-
|
|
22
|
+
class="w-full flex items-center gap-2 min-h-10 px-3 py-1.5 rounded-row transition-colors text-left outline-none cursor-pointer text-content-text-md-regular"
|
|
23
|
+
:class="variant === 'danger'
|
|
24
|
+
? 'text-text-danger-body hover:bg-actions-danger-hover-overlay data-[highlighted]:bg-actions-danger-hover-overlay'
|
|
25
|
+
: 'text-text-neutral-base hover:bg-actions-neutral-hover-overlay data-[highlighted]:bg-actions-neutral-hover-overlay'"
|
|
15
26
|
>
|
|
16
27
|
<slot />
|
|
17
28
|
</DropdownMenuItem>
|
|
@@ -14,7 +14,7 @@ const forwarded = useForwardPropsEmits(props, emits)
|
|
|
14
14
|
<DropdownMenuPortal>
|
|
15
15
|
<DropdownMenuSubContent
|
|
16
16
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
17
|
-
class="bg-surface-neutral-bg-main rounded-
|
|
17
|
+
class="max-w-(--reka-dropdown-menu-content-available-width) focus-indicator-none bg-surface-neutral-bg-main rounded-container border border-container-border shadow-shadows-drop-shadow-lg p-1 flex flex-col gap-1 z-overlay"
|
|
18
18
|
data-colors-semantic="light"
|
|
19
19
|
>
|
|
20
20
|
<slot />
|
|
@@ -9,7 +9,7 @@ const forwarded = useForwardProps(props)
|
|
|
9
9
|
<template>
|
|
10
10
|
<DropdownMenuSubTrigger
|
|
11
11
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
12
|
-
class="w-full flex items-center justify-between gap-3 min-h-10 px-3 py-1.5 rounded-
|
|
12
|
+
class="w-full flex items-center justify-between gap-3 min-h-10 px-3 py-1.5 rounded-row hover:bg-actions-neutral-hover-overlay data-[highlighted]:bg-actions-neutral-hover-overlay data-[state=open]:bg-actions-neutral-hover-overlay transition-colors text-left outline-none cursor-pointer"
|
|
13
13
|
>
|
|
14
14
|
<slot />
|
|
15
15
|
<span class="i-ph-caret-right w-4 h-4 text-text-neutral-tertiary shrink-0" />
|