@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
|
@@ -3,8 +3,18 @@ import type { SelectContentProps } from 'reka-ui'
|
|
|
3
3
|
import { SelectContent, SelectPortal, SelectScrollDownButton, SelectScrollUpButton, SelectViewport } from 'reka-ui'
|
|
4
4
|
import { useSlots } from 'vue'
|
|
5
5
|
|
|
6
|
+
const WIDTH_CLASSES = {
|
|
7
|
+
auto: '',
|
|
8
|
+
lg: 'w-75',
|
|
9
|
+
} as const
|
|
10
|
+
|
|
6
11
|
interface Props extends SelectContentProps {
|
|
7
12
|
showScrollButtons?: boolean
|
|
13
|
+
/**
|
|
14
|
+
* 'auto' sizes the content to the trigger and its items; 'lg' gives items with descriptions a fixed 300px
|
|
15
|
+
* @default 'auto'
|
|
16
|
+
*/
|
|
17
|
+
width?: keyof typeof WIDTH_CLASSES
|
|
8
18
|
/**
|
|
9
19
|
* The color semantic mode for the dropdown content
|
|
10
20
|
* @default 'light'
|
|
@@ -12,7 +22,8 @@ interface Props extends SelectContentProps {
|
|
|
12
22
|
colorsSemantic?: 'light' | 'dark'
|
|
13
23
|
}
|
|
14
24
|
|
|
15
|
-
withDefaults(defineProps<Props>(), {
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
26
|
+
width: 'auto',
|
|
16
27
|
position: 'popper',
|
|
17
28
|
side: 'bottom',
|
|
18
29
|
sideOffset: 8,
|
|
@@ -26,44 +37,44 @@ const slots = useSlots()
|
|
|
26
37
|
<template>
|
|
27
38
|
<SelectPortal>
|
|
28
39
|
<SelectContent
|
|
40
|
+
data-testid="ui-dropdown-content"
|
|
29
41
|
v-bind="$attrs"
|
|
30
42
|
:position="position"
|
|
31
43
|
:side-offset="sideOffset"
|
|
32
44
|
:align="align"
|
|
33
45
|
:side="side"
|
|
34
46
|
:data-colors-semantic="colorsSemantic"
|
|
35
|
-
class="
|
|
47
|
+
:class="WIDTH_CLASSES[props.width]"
|
|
48
|
+
class="ui-dropdown-content focus-indicator-none z-overlay relative p-1 rounded-container border border-container-border bg-surface-neutral-bg-main min-w-(--reka-select-trigger-width) max-w-(--reka-select-content-available-width) max-h-(--reka-select-content-available-height) shadow-shadows-drop-shadow-lg data-[state=open]:animate-[slideDownAndFade_0.2s_ease] data-[state=closed]:animate-[slideUpAndFade_0.15s_ease]"
|
|
36
49
|
>
|
|
37
50
|
<div
|
|
38
51
|
v-if="slots.header"
|
|
39
|
-
class="
|
|
52
|
+
class="pb-1"
|
|
40
53
|
>
|
|
41
54
|
<slot name="header" />
|
|
42
55
|
</div>
|
|
43
56
|
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</SelectScrollUpButton>
|
|
57
|
+
<SelectScrollUpButton
|
|
58
|
+
v-if="showScrollButtons"
|
|
59
|
+
class="flex items-center justify-center h-6 cursor-default text-text-neutral-base"
|
|
60
|
+
>
|
|
61
|
+
<div class="i-ph-caret-up size-4" />
|
|
62
|
+
</SelectScrollUpButton>
|
|
51
63
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
<SelectViewport class="flex flex-col gap-1 max-h-[300px] rounded-row">
|
|
65
|
+
<slot />
|
|
66
|
+
</SelectViewport>
|
|
55
67
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</div>
|
|
68
|
+
<SelectScrollDownButton
|
|
69
|
+
v-if="showScrollButtons"
|
|
70
|
+
class="flex items-center justify-center h-6 cursor-default text-text-neutral-base"
|
|
71
|
+
>
|
|
72
|
+
<div class="i-ph-caret-down size-4" />
|
|
73
|
+
</SelectScrollDownButton>
|
|
63
74
|
|
|
64
75
|
<div
|
|
65
76
|
v-if="slots.footer"
|
|
66
|
-
class="
|
|
77
|
+
class="pt-1"
|
|
67
78
|
>
|
|
68
79
|
<slot name="footer" />
|
|
69
80
|
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { SelectGroup, SelectLabel } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
/** Heading read before the options of the group; leave it out for an untitled group. */
|
|
6
|
+
label?: string
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<SelectGroup
|
|
12
|
+
v-bind="$attrs"
|
|
13
|
+
class="flex flex-col gap-1"
|
|
14
|
+
>
|
|
15
|
+
<SelectLabel
|
|
16
|
+
v-if="label"
|
|
17
|
+
class="px-4 pt-2 pb-1 text-content-legends-bold-md text-text-neutral-tertiary"
|
|
18
|
+
>
|
|
19
|
+
{{ label }}
|
|
20
|
+
</SelectLabel>
|
|
21
|
+
<slot />
|
|
22
|
+
</SelectGroup>
|
|
23
|
+
</template>
|
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { SelectItemProps } from 'reka-ui'
|
|
2
|
+
import type { SelectItemEmits, SelectItemProps } from 'reka-ui'
|
|
3
3
|
import { SelectItem, SelectItemText } from 'reka-ui'
|
|
4
|
-
import { inject } from 'vue'
|
|
4
|
+
import { computed, inject } from 'vue'
|
|
5
5
|
import { UI_DROPDOWN_MULTIPLE_KEY } from './context'
|
|
6
|
+
import DropdownItemCheckbox from './DropdownItemCheckbox.vue'
|
|
6
7
|
|
|
7
8
|
interface Props extends SelectItemProps {
|
|
8
9
|
title?: string
|
|
9
10
|
description?: string
|
|
10
11
|
icon?: string
|
|
12
|
+
/** `danger` marks an option that takes something away, such as removing access. */
|
|
13
|
+
variant?: 'default' | 'danger'
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
withDefaults(defineProps<Props>(), {
|
|
16
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
14
17
|
title: undefined,
|
|
15
18
|
description: undefined,
|
|
16
19
|
icon: undefined,
|
|
20
|
+
variant: 'default',
|
|
17
21
|
})
|
|
18
22
|
|
|
23
|
+
const isDanger = computed(() => props.variant === 'danger')
|
|
24
|
+
|
|
25
|
+
const stateBackgroundClass = computed(() => isDanger.value
|
|
26
|
+
? 'data-highlighted:bg-actions-danger-hover-overlay data-[state=checked]:bg-actions-danger-pressed-overlay'
|
|
27
|
+
: 'data-highlighted:bg-actions-neutral-hover-overlay data-[state=checked]:bg-actions-primary-active-overlay')
|
|
28
|
+
|
|
29
|
+
const titleColorClass = computed(() => isDanger.value
|
|
30
|
+
? 'text-text-danger-body'
|
|
31
|
+
: 'text-actions-neutral-idle group-data-highlighted/item:text-actions-neutral-idle group-data-[state=checked]/item:text-actions-primary-idle')
|
|
32
|
+
|
|
33
|
+
const descriptionColorClass = computed(() => isDanger.value
|
|
34
|
+
? 'text-text-neutral-secondary'
|
|
35
|
+
: 'text-text-neutral-secondary group-data-highlighted/item:text-text-neutral-secondary group-data-[state=checked]/item:text-text-primary-secondary')
|
|
36
|
+
|
|
19
37
|
// `UiDropdown` provides this when `multiple` is set so items render a
|
|
20
38
|
// leading checkbox automatically. Falls back to single-select behavior
|
|
21
39
|
// when the item is used outside a `UiDropdown` (defensive default).
|
|
22
40
|
const isMultiple = inject(UI_DROPDOWN_MULTIPLE_KEY, undefined)
|
|
41
|
+
|
|
42
|
+
// Reka picks on Enter keydown without cancelling it, so its keypress would activate whatever the pick focused.
|
|
43
|
+
function consumePickingKey (event: SelectItemEmits['select'][0]) {
|
|
44
|
+
const { originalEvent } = event.detail
|
|
45
|
+
if (originalEvent instanceof KeyboardEvent) originalEvent.preventDefault()
|
|
46
|
+
}
|
|
23
47
|
</script>
|
|
24
48
|
|
|
25
49
|
<template>
|
|
@@ -27,36 +51,39 @@ const isMultiple = inject(UI_DROPDOWN_MULTIPLE_KEY, undefined)
|
|
|
27
51
|
v-bind="$attrs"
|
|
28
52
|
:value="value"
|
|
29
53
|
:disabled="disabled"
|
|
30
|
-
class="focus-indicator-none group flex px-3 py-1 rounded-
|
|
54
|
+
class="focus-indicator-none group/item flex px-3 py-1 rounded-row cursor-pointer outline-hidden transition-all duration-150 ease-in-out data-disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:pointer-events-none"
|
|
55
|
+
:class="stateBackgroundClass"
|
|
56
|
+
@select="consumePickingKey"
|
|
31
57
|
>
|
|
32
58
|
<div class="flex flex-1 gap-2 items-center overflow-hidden">
|
|
33
|
-
|
|
34
|
-
size, border radius, primary fill, and `i-ls-checkbox-check`
|
|
35
|
-
icon) without dragging in the input's runtime/a11y plumbing.
|
|
36
|
-
Driven entirely by the parent `SelectItem`'s `data-[state=checked]`
|
|
37
|
-
attribute — no per-item state. -->
|
|
38
|
-
<div
|
|
39
|
-
v-if="isMultiple"
|
|
40
|
-
class="shrink-0 size-4 rounded-sm border border-borders-neutral-strong bg-surface-neutral-bg-main grid place-content-center transition-colors group-data-[state=checked]:bg-actions-primary-idle group-data-[state=checked]:border-borders-primary-default"
|
|
41
|
-
>
|
|
42
|
-
<div class="i-ls-checkbox-check size-3 text-actions-neutral-invert-idle opacity-0 group-data-[state=checked]:opacity-100" />
|
|
43
|
-
</div>
|
|
59
|
+
<DropdownItemCheckbox v-if="isMultiple" />
|
|
44
60
|
|
|
45
61
|
<div
|
|
46
62
|
v-if="icon"
|
|
47
63
|
:class="[icon, 'size-4']"
|
|
48
|
-
class="shrink-0 group-data-highlighted:text-actions-neutral-idle group-data-[state=checked]:text-actions-primary-idle"
|
|
64
|
+
class="shrink-0 group-data-highlighted/item:text-actions-neutral-idle group-data-[state=checked]/item:text-actions-primary-idle"
|
|
49
65
|
/>
|
|
50
66
|
|
|
67
|
+
<div
|
|
68
|
+
v-if="$slots.leading"
|
|
69
|
+
class="shrink-0"
|
|
70
|
+
>
|
|
71
|
+
<slot name="leading" />
|
|
72
|
+
</div>
|
|
73
|
+
|
|
51
74
|
<div class="flex flex-1 flex-col items-start justify-center min-w-0 py-1.5">
|
|
52
|
-
<SelectItemText
|
|
75
|
+
<SelectItemText
|
|
76
|
+
class="max-w-full truncate text-content-text-md-medium"
|
|
77
|
+
:class="titleColorClass"
|
|
78
|
+
>
|
|
53
79
|
<slot name="title">
|
|
54
80
|
{{ title }}
|
|
55
81
|
</slot>
|
|
56
82
|
</SelectItemText>
|
|
57
83
|
<div
|
|
58
84
|
v-if="description || $slots.description"
|
|
59
|
-
class="text-content-legends-medium-md
|
|
85
|
+
class="max-w-full truncate text-content-legends-medium-md"
|
|
86
|
+
:class="descriptionColorClass"
|
|
60
87
|
>
|
|
61
88
|
<slot name="description">
|
|
62
89
|
{{ description }}
|
|
@@ -3,6 +3,7 @@ import type { SelectTriggerProps } from 'reka-ui'
|
|
|
3
3
|
import { SelectIcon, SelectTrigger, SelectValue } from 'reka-ui'
|
|
4
4
|
import { computed, useSlots } from 'vue'
|
|
5
5
|
import { useButtonStyles } from '../../composables/useButtonStyles'
|
|
6
|
+
import { useControlShape } from '../../composables/useControlShape'
|
|
6
7
|
|
|
7
8
|
type TSize = 'sm' | 'md' | 'lg' | 'xl'
|
|
8
9
|
type TColor = 'neutral' | 'primary'
|
|
@@ -23,12 +24,21 @@ interface Props extends SelectTriggerProps {
|
|
|
23
24
|
color?: TColor
|
|
24
25
|
/**
|
|
25
26
|
* Visual variant, named to match `UiButton`. `secondary` (default) is the
|
|
26
|
-
* bordered field look. `tertiary` drops the border + background
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* bordered field look. `tertiary` drops the border + background: the trigger
|
|
28
|
+
* shows only its value, coloured like a `UiButton` tertiary and set in the
|
|
29
|
+
* regular body text style, with a hover overlay. It suits a value picked
|
|
30
|
+
* inside a row, such as a role beside a person.
|
|
29
31
|
*/
|
|
30
32
|
variant?: TVariant
|
|
31
33
|
error?: boolean
|
|
34
|
+
/**
|
|
35
|
+
* Shows the value as static text in the box of an editable trigger: same size, padding and
|
|
36
|
+
* border width, no fill, and an empty slot where the chevron would be, so its text ends where an
|
|
37
|
+
* editable trigger's value ends. It is not focusable and opens nothing; it renders as a `group`, so pass
|
|
38
|
+
* `aria-labelledby` (for example the row's name) to label it like the editable trigger.
|
|
39
|
+
* The value reads in the secondary text colour. Render it from the `value` slot.
|
|
40
|
+
*/
|
|
41
|
+
readonly?: boolean
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -39,61 +49,112 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
39
49
|
color: 'neutral',
|
|
40
50
|
variant: 'secondary',
|
|
41
51
|
error: false,
|
|
52
|
+
readonly: false,
|
|
42
53
|
})
|
|
43
54
|
|
|
44
55
|
const slots = useSlots()
|
|
45
56
|
|
|
46
|
-
// Shared button styling — both variants pull their background /
|
|
57
|
+
// Shared button styling — both variants pull their background / text /
|
|
47
58
|
// overlay tokens from the same source `UiButton` uses, so the trigger stays in
|
|
48
59
|
// lockstep with the button palette. `error` maps onto the button `error` color;
|
|
49
60
|
// otherwise the trigger's `primary`/`neutral` colors line up 1:1.
|
|
50
61
|
const buttonColor = computed(() => (props.error ? 'error' as const : props.color))
|
|
51
|
-
const { textClass, bgClass,
|
|
62
|
+
const { textClass, bgClass, beforeHoverOverlayClass } = useButtonStyles({
|
|
52
63
|
variant: () => props.variant,
|
|
53
64
|
color: buttonColor,
|
|
54
65
|
disabled: () => props.disabled,
|
|
55
66
|
})
|
|
56
67
|
|
|
68
|
+
const FIELD_BORDER: Record<'neutral' | 'primary' | 'error', string> = {
|
|
69
|
+
neutral: 'border-control-field-border',
|
|
70
|
+
primary: 'border-borders-primary-strong',
|
|
71
|
+
error: 'border-control-error-border',
|
|
72
|
+
}
|
|
73
|
+
const borderClass = computed(() => FIELD_BORDER[buttonColor.value])
|
|
74
|
+
|
|
75
|
+
const fieldBgClass = computed(() =>
|
|
76
|
+
buttonColor.value === 'neutral' ? 'bg-control-field-bg' : bgClass.value,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
// With a `leading` slot the start padding shrinks so the leading box (24px on
|
|
80
|
+
// sm and md, 32px on lg and xl, enforced on its wrapper) sits as far from the
|
|
81
|
+
// start edge as from the top and bottom: (field height - box) / 2 - 1px border.
|
|
57
82
|
const sizeClasses = computed(() => {
|
|
58
83
|
const sizes = {
|
|
59
84
|
sm: {
|
|
60
|
-
field: '
|
|
61
|
-
text: 'text-action-button-sm tracking-[0.05px]',
|
|
62
|
-
icon: 'size-3',
|
|
85
|
+
field: 'gap-1',
|
|
63
86
|
padding: 'px-2',
|
|
87
|
+
leadingPadding: 'pl-[3px] pr-2',
|
|
88
|
+
leadingBox: 'size-6',
|
|
89
|
+
text: 'text-action-button-sm tracking-[0.05px]',
|
|
90
|
+
tertiaryText: 'text-content-legends-medium-md',
|
|
64
91
|
},
|
|
65
92
|
md: {
|
|
66
|
-
field: '
|
|
67
|
-
text: 'text-action-button-md leading-[20px] tracking-[-0.04px]',
|
|
68
|
-
icon: 'size-4',
|
|
93
|
+
field: 'gap-1.5',
|
|
69
94
|
padding: 'px-3',
|
|
95
|
+
leadingPadding: 'pl-[5px] pr-3',
|
|
96
|
+
leadingBox: 'size-6',
|
|
97
|
+
text: 'text-action-button-md leading-[20px] tracking-[-0.04px]',
|
|
98
|
+
tertiaryText: 'text-content-text-md-regular',
|
|
70
99
|
},
|
|
71
100
|
lg: {
|
|
72
|
-
field: '
|
|
73
|
-
text: 'text-action-button-lg leading-[20px] tracking-[-0.04px]',
|
|
74
|
-
icon: 'size-4',
|
|
101
|
+
field: 'gap-2',
|
|
75
102
|
padding: 'px-4',
|
|
103
|
+
leadingPadding: 'pl-[7px] pr-4',
|
|
104
|
+
leadingBox: 'size-8',
|
|
105
|
+
text: 'text-action-button-lg leading-[20px] tracking-[-0.04px]',
|
|
106
|
+
tertiaryText: 'text-content-text-lg-regular',
|
|
76
107
|
},
|
|
77
108
|
xl: {
|
|
78
|
-
field: '
|
|
79
|
-
text: 'text-action-button-lg leading-[24px] tracking-[-0.04px]',
|
|
80
|
-
icon: 'size-6',
|
|
109
|
+
field: 'gap-2',
|
|
81
110
|
padding: 'px-4',
|
|
111
|
+
leadingPadding: 'pl-[15px] pr-4',
|
|
112
|
+
leadingBox: 'size-8',
|
|
113
|
+
text: 'text-action-button-lg leading-[24px] tracking-[-0.04px]',
|
|
114
|
+
tertiaryText: 'text-content-text-lg-regular',
|
|
82
115
|
},
|
|
83
116
|
}
|
|
84
117
|
|
|
85
118
|
return sizes[props.size]
|
|
86
119
|
})
|
|
87
120
|
|
|
121
|
+
const shape = useControlShape('field', () => props.size)
|
|
122
|
+
|
|
123
|
+
const boxClasses = computed(() => [
|
|
124
|
+
'flex',
|
|
125
|
+
'items-center',
|
|
126
|
+
'justify-between',
|
|
127
|
+
'w-full',
|
|
128
|
+
shape.value.radius,
|
|
129
|
+
shape.value.height,
|
|
130
|
+
'border',
|
|
131
|
+
'border-solid',
|
|
132
|
+
'border-transparent',
|
|
133
|
+
'bg-transparent',
|
|
134
|
+
sizeClasses.value.field,
|
|
135
|
+
])
|
|
136
|
+
|
|
137
|
+
const readonlyTextClasses = computed(() => [
|
|
138
|
+
'flex-1',
|
|
139
|
+
'overflow-hidden',
|
|
140
|
+
'text-ellipsis',
|
|
141
|
+
'whitespace-nowrap',
|
|
142
|
+
'min-w-0',
|
|
143
|
+
'text-left',
|
|
144
|
+
'text-text-neutral-secondary',
|
|
145
|
+
props.variant === 'tertiary' ? sizeClasses.value.tertiaryText : sizeClasses.value.text,
|
|
146
|
+
])
|
|
147
|
+
|
|
88
148
|
const fieldClasses = computed(() => {
|
|
89
149
|
const base = [
|
|
90
150
|
'focus-indicator-none',
|
|
91
|
-
'group',
|
|
151
|
+
'group/trigger',
|
|
92
152
|
'flex',
|
|
93
153
|
'items-center',
|
|
94
154
|
'justify-between',
|
|
95
155
|
'w-full',
|
|
96
|
-
|
|
156
|
+
shape.value.radius,
|
|
157
|
+
shape.value.height,
|
|
97
158
|
'border',
|
|
98
159
|
'border-solid',
|
|
99
160
|
'transition-all',
|
|
@@ -103,12 +164,11 @@ const fieldClasses = computed(() => {
|
|
|
103
164
|
'cursor-pointer',
|
|
104
165
|
'font-medium',
|
|
105
166
|
'focus:outline-hidden',
|
|
106
|
-
'focus-visible:ring
|
|
107
|
-
'focus-visible:ring-inset',
|
|
167
|
+
'focus-visible:focus-ring',
|
|
108
168
|
// Hover overlay via ::before
|
|
109
169
|
"before:content-['']",
|
|
110
170
|
'before:absolute',
|
|
111
|
-
'before
|
|
171
|
+
'before:-inset-px',
|
|
112
172
|
'before:rounded-[inherit]',
|
|
113
173
|
'before:opacity-0',
|
|
114
174
|
'before:transition-opacity',
|
|
@@ -129,33 +189,29 @@ const fieldClasses = computed(() => {
|
|
|
129
189
|
state.push('opacity-50', '!cursor-not-allowed')
|
|
130
190
|
}
|
|
131
191
|
|
|
132
|
-
// Background /
|
|
133
|
-
//
|
|
192
|
+
// Background / hover overlay come from `useButtonStyles`, keyed by
|
|
193
|
+
// `variant` × `buttonColor` — the exact tokens `UiButton` uses. Tertiary
|
|
134
194
|
// resolves to no border/bg (transparent), secondary to the bordered field.
|
|
135
195
|
if (props.variant === 'tertiary') {
|
|
136
196
|
state.push('border-transparent', 'bg-transparent')
|
|
137
197
|
}
|
|
138
198
|
else {
|
|
139
|
-
state.push(
|
|
199
|
+
state.push(fieldBgClass.value, borderClass.value)
|
|
140
200
|
}
|
|
141
201
|
if (beforeHoverOverlayClass.value) state.push(beforeHoverOverlayClass.value)
|
|
142
202
|
|
|
143
|
-
//
|
|
144
|
-
// open state). Error keeps its danger-colored focus ring; everything else
|
|
145
|
-
// uses the standard primary focus highlight.
|
|
203
|
+
// The open-state border is trigger-specific: a button has no open state.
|
|
146
204
|
if (props.error) {
|
|
147
|
-
state.push(
|
|
148
|
-
'focus-visible:border-borders-danger-strong',
|
|
149
|
-
'focus-visible:ring-borders-danger-strong',
|
|
150
|
-
'data-[state=open]:border-borders-danger-strong',
|
|
151
|
-
)
|
|
205
|
+
state.push('data-[state=open]:border-control-error-border')
|
|
152
206
|
}
|
|
153
207
|
else {
|
|
154
|
-
state.push('focus-visible:ring-focus-ring')
|
|
155
208
|
if (props.variant !== 'tertiary') {
|
|
209
|
+
state.push('data-[state=open]:border-control-field-border-focus')
|
|
210
|
+
}
|
|
211
|
+
if (props.variant !== 'tertiary' && buttonColor.value === 'neutral') {
|
|
156
212
|
state.push(
|
|
157
|
-
'focus-visible:
|
|
158
|
-
'data-[state=open]:
|
|
213
|
+
'focus-visible:bg-control-field-bg-focus',
|
|
214
|
+
'data-[state=open]:bg-control-field-bg-focus',
|
|
159
215
|
)
|
|
160
216
|
}
|
|
161
217
|
}
|
|
@@ -175,10 +231,12 @@ const textClasses = computed(() => {
|
|
|
175
231
|
: isPrimary.value ? 'text-actions-primary-idle' : 'text-text-neutral-base'
|
|
176
232
|
// Placeholder color: primary (incl. tertiary-primary) keeps the primary
|
|
177
233
|
// token so an empty filter chip still reads as actionable; everything else
|
|
178
|
-
// uses the muted placeholder token.
|
|
179
|
-
const placeholderClass =
|
|
180
|
-
? '
|
|
181
|
-
: '
|
|
234
|
+
// uses the muted placeholder token. A `value` slot renders a value, never the placeholder.
|
|
235
|
+
const placeholderClass = slots.value
|
|
236
|
+
? ''
|
|
237
|
+
: (isPrimary.value || (isTertiary.value && props.color === 'primary'))
|
|
238
|
+
? 'group-data-placeholder/trigger:text-actions-primary-idle'
|
|
239
|
+
: 'group-data-placeholder/trigger:text-control-placeholder'
|
|
182
240
|
return [
|
|
183
241
|
'flex-1',
|
|
184
242
|
'overflow-hidden',
|
|
@@ -188,7 +246,7 @@ const textClasses = computed(() => {
|
|
|
188
246
|
'text-left',
|
|
189
247
|
colorClass,
|
|
190
248
|
placeholderClass,
|
|
191
|
-
sizeClasses.value.text,
|
|
249
|
+
isTertiary.value ? sizeClasses.value.tertiaryText : sizeClasses.value.text,
|
|
192
250
|
].join(' ')
|
|
193
251
|
})
|
|
194
252
|
|
|
@@ -204,17 +262,53 @@ const iconContainerClasses = computed(() => {
|
|
|
204
262
|
isTertiary.value
|
|
205
263
|
? textClass.value
|
|
206
264
|
: isPrimary.value ? 'text-actions-primary-idle' : 'text-text-neutral-tertiary',
|
|
207
|
-
|
|
265
|
+
shape.value.chevron,
|
|
208
266
|
].join(' ')
|
|
209
267
|
})
|
|
210
268
|
</script>
|
|
211
269
|
|
|
212
270
|
<template>
|
|
271
|
+
<span
|
|
272
|
+
v-if="readonly"
|
|
273
|
+
data-testid="ui-dropdown-trigger-readonly"
|
|
274
|
+
role="group"
|
|
275
|
+
v-bind="$attrs"
|
|
276
|
+
:class="[boxClasses, slots.leading ? sizeClasses.leadingPadding : sizeClasses.padding]"
|
|
277
|
+
>
|
|
278
|
+
<span
|
|
279
|
+
v-if="slots.leading"
|
|
280
|
+
data-testid="ui-dropdown-trigger-leading"
|
|
281
|
+
class="flex items-center justify-center shrink-0"
|
|
282
|
+
:class="sizeClasses.leadingBox"
|
|
283
|
+
>
|
|
284
|
+
<slot name="leading" />
|
|
285
|
+
</span>
|
|
286
|
+
<div :class="readonlyTextClasses">
|
|
287
|
+
<slot name="value">
|
|
288
|
+
{{ placeholder }}
|
|
289
|
+
</slot>
|
|
290
|
+
</div>
|
|
291
|
+
<span
|
|
292
|
+
v-if="showIcon"
|
|
293
|
+
class="shrink-0"
|
|
294
|
+
:class="shape.chevron"
|
|
295
|
+
aria-hidden="true"
|
|
296
|
+
/>
|
|
297
|
+
</span>
|
|
213
298
|
<SelectTrigger
|
|
299
|
+
v-else
|
|
214
300
|
v-bind="$attrs"
|
|
215
|
-
:class="fieldClasses"
|
|
301
|
+
:class="[fieldClasses, slots.leading ? sizeClasses.leadingPadding : sizeClasses.padding]"
|
|
216
302
|
:disabled="disabled"
|
|
217
303
|
>
|
|
304
|
+
<span
|
|
305
|
+
v-if="slots.leading"
|
|
306
|
+
data-testid="ui-dropdown-trigger-leading"
|
|
307
|
+
class="flex items-center justify-center shrink-0"
|
|
308
|
+
:class="sizeClasses.leadingBox"
|
|
309
|
+
>
|
|
310
|
+
<slot name="leading" />
|
|
311
|
+
</span>
|
|
218
312
|
<div :class="textClasses">
|
|
219
313
|
<SelectValue
|
|
220
314
|
v-if="!slots.value"
|
|
@@ -231,8 +325,8 @@ const iconContainerClasses = computed(() => {
|
|
|
231
325
|
:class="iconContainerClasses"
|
|
232
326
|
>
|
|
233
327
|
<div
|
|
234
|
-
class="i-
|
|
235
|
-
:class="
|
|
328
|
+
class="i-ph-caret-down transition-transform duration-200 ease-in-out group-data-[state=open]/trigger:rotate-180"
|
|
329
|
+
:class="shape.chevron"
|
|
236
330
|
/>
|
|
237
331
|
</SelectIcon>
|
|
238
332
|
</SelectTrigger>
|
|
@@ -3,6 +3,7 @@ export { default as UiDropdown } from './UiDropdown.vue'
|
|
|
3
3
|
export { default as UiDropdownTrigger } from './UiDropdownTrigger.vue'
|
|
4
4
|
export { default as UiDropdownContent } from './UiDropdownContent.vue'
|
|
5
5
|
export { default as UiDropdownItem } from './UiDropdownItem.vue'
|
|
6
|
+
export { default as UiDropdownGroup } from './UiDropdownGroup.vue'
|
|
6
7
|
export { default as UiDropdownSeparator } from './UiDropdownSeparator.vue'
|
|
7
8
|
|
|
8
9
|
// Re-export useful Reka UI types and components for advanced usage
|