@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
|
@@ -3,6 +3,8 @@ import { type ButtonVariant, type ButtonColor } from '../../composables/useButto
|
|
|
3
3
|
import type { RouteLocationRaw } from 'vue-router';
|
|
4
4
|
export type Variant = ButtonVariant;
|
|
5
5
|
export type Color = ButtonColor;
|
|
6
|
+
declare const TEXT_STYLES: readonly ["action", "body"];
|
|
7
|
+
export type TextStyle = typeof TEXT_STYLES[number];
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
8
10
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -40,6 +42,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
40
42
|
type: (BooleanConstructor | StringConstructor)[];
|
|
41
43
|
default: undefined;
|
|
42
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* `body` sets the label in the regular body text style and its icons one step smaller, the look of a
|
|
47
|
+
* `UiDropdownTrigger` of variant `tertiary`, so a button reads as one more control beside such triggers.
|
|
48
|
+
*/
|
|
49
|
+
textStyle: {
|
|
50
|
+
type: () => TextStyle;
|
|
51
|
+
default: string;
|
|
52
|
+
validator: (value: TextStyle) => boolean;
|
|
53
|
+
};
|
|
43
54
|
loading: {
|
|
44
55
|
type: BooleanConstructor;
|
|
45
56
|
default: boolean;
|
|
@@ -64,11 +75,34 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
64
75
|
type: () => RouteLocationRaw;
|
|
65
76
|
default: undefined;
|
|
66
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Renders the label as a link that flows and wraps inside running text: no box, the surrounding font size,
|
|
80
|
+
* the tertiary colour. Without `to` or `href` it is a focusable `role="button"` span, since a `<button>`
|
|
81
|
+
* cannot break across lines.
|
|
82
|
+
*/
|
|
83
|
+
inline: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
67
87
|
}>, {
|
|
68
88
|
component: import("vue").ComputedRef<{
|
|
89
|
+
is: string;
|
|
90
|
+
props: {
|
|
91
|
+
role: string;
|
|
92
|
+
tabindex: number;
|
|
93
|
+
'aria-disabled': any;
|
|
94
|
+
to?: undefined;
|
|
95
|
+
href?: undefined;
|
|
96
|
+
type?: undefined;
|
|
97
|
+
disabled?: undefined;
|
|
98
|
+
};
|
|
99
|
+
} | {
|
|
69
100
|
is: string;
|
|
70
101
|
props: {
|
|
71
102
|
to: any;
|
|
103
|
+
role?: undefined;
|
|
104
|
+
tabindex?: undefined;
|
|
105
|
+
'aria-disabled'?: undefined;
|
|
72
106
|
href?: undefined;
|
|
73
107
|
type?: undefined;
|
|
74
108
|
disabled?: undefined;
|
|
@@ -77,6 +111,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
77
111
|
is: string;
|
|
78
112
|
props: {
|
|
79
113
|
href: any;
|
|
114
|
+
role?: undefined;
|
|
115
|
+
tabindex?: undefined;
|
|
116
|
+
'aria-disabled'?: undefined;
|
|
80
117
|
to?: undefined;
|
|
81
118
|
type?: undefined;
|
|
82
119
|
disabled?: undefined;
|
|
@@ -86,6 +123,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
86
123
|
props: {
|
|
87
124
|
type: any;
|
|
88
125
|
disabled: any;
|
|
126
|
+
role?: undefined;
|
|
127
|
+
tabindex?: undefined;
|
|
128
|
+
'aria-disabled'?: undefined;
|
|
89
129
|
to?: undefined;
|
|
90
130
|
href?: undefined;
|
|
91
131
|
};
|
|
@@ -98,61 +138,61 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
98
138
|
}>[] | undefined>;
|
|
99
139
|
hasLabel: import("vue").ComputedRef<boolean>;
|
|
100
140
|
isLink: import("vue").ComputedRef<boolean>;
|
|
101
|
-
iconSizeClasses: import("vue").ComputedRef<"size-3" | "size-4" | "size-5" | "size-6" | "size-7">;
|
|
141
|
+
iconSizeClasses: import("vue").ComputedRef<"size-3" | "size-4" | "size-5" | "size-6" | "size-7" | "size-2.5" | "size-3.5">;
|
|
142
|
+
trailingIconSizeClasses: import("vue").ComputedRef<"size-4" | "size-5" | "size-6" | "size-2.5" | "size-3.5">;
|
|
143
|
+
shape: import("vue").ComputedRef<{
|
|
144
|
+
height: string;
|
|
145
|
+
square: string;
|
|
146
|
+
radius: string;
|
|
147
|
+
}>;
|
|
102
148
|
buttonClasses: import("vue").ComputedRef<(string | {
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'h-10 text-action-button-md'?: undefined;
|
|
111
|
-
'h-12 text-action-button-lg'?: undefined;
|
|
149
|
+
'grid place-items-center': boolean;
|
|
150
|
+
'text-content-legends-medium-md'?: undefined;
|
|
151
|
+
'text-content-text-md-regular'?: undefined;
|
|
152
|
+
'text-content-text-lg-regular'?: undefined;
|
|
153
|
+
'text-action-button-sm'?: undefined;
|
|
154
|
+
'text-action-button-md'?: undefined;
|
|
155
|
+
'text-action-button-lg'?: undefined;
|
|
112
156
|
'inline-flex'?: undefined;
|
|
113
157
|
} | {
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'h-10 text-action-button-md'?: undefined;
|
|
122
|
-
'h-12 text-action-button-lg'?: undefined;
|
|
158
|
+
'text-content-legends-medium-md': boolean;
|
|
159
|
+
'text-content-text-md-regular': boolean;
|
|
160
|
+
'text-content-text-lg-regular': boolean;
|
|
161
|
+
'grid place-items-center'?: undefined;
|
|
162
|
+
'text-action-button-sm'?: undefined;
|
|
163
|
+
'text-action-button-md'?: undefined;
|
|
164
|
+
'text-action-button-lg'?: undefined;
|
|
123
165
|
'inline-flex'?: undefined;
|
|
124
166
|
} | {
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'h-12 text-action-button-lg': boolean;
|
|
129
|
-
'size-6'?: undefined;
|
|
130
|
-
'size-8'?: undefined;
|
|
131
|
-
'size-10'?: undefined;
|
|
132
|
-
'size-12'?: undefined;
|
|
167
|
+
'text-action-button-sm': boolean;
|
|
168
|
+
'text-action-button-md': boolean;
|
|
169
|
+
'text-action-button-lg': boolean;
|
|
133
170
|
'grid place-items-center'?: undefined;
|
|
171
|
+
'text-content-legends-medium-md'?: undefined;
|
|
172
|
+
'text-content-text-md-regular'?: undefined;
|
|
173
|
+
'text-content-text-lg-regular'?: undefined;
|
|
134
174
|
'inline-flex'?: undefined;
|
|
135
175
|
} | {
|
|
136
176
|
'inline-flex': boolean;
|
|
137
|
-
'size-6'?: undefined;
|
|
138
|
-
'size-8'?: undefined;
|
|
139
|
-
'size-10'?: undefined;
|
|
140
|
-
'size-12'?: undefined;
|
|
141
177
|
'grid place-items-center'?: undefined;
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
178
|
+
'text-content-legends-medium-md'?: undefined;
|
|
179
|
+
'text-content-text-md-regular'?: undefined;
|
|
180
|
+
'text-content-text-lg-regular'?: undefined;
|
|
181
|
+
'text-action-button-sm'?: undefined;
|
|
182
|
+
'text-action-button-md'?: undefined;
|
|
183
|
+
'text-action-button-lg'?: undefined;
|
|
146
184
|
})[]>;
|
|
147
185
|
bgClasses: import("vue").ComputedRef<string>;
|
|
148
186
|
focusRingClasses: string;
|
|
149
187
|
textClasses: import("vue").ComputedRef<string[]>;
|
|
150
188
|
borderClasses: import("vue").ComputedRef<string[]>;
|
|
189
|
+
decorationClass: import("vue").ComputedRef<"" | "[text-decoration-line:var(--control-link-decoration)] underline-offset-3">;
|
|
151
190
|
overlayClasses: import("vue").ComputedRef<string[]>;
|
|
152
191
|
isSquare: import("vue").ComputedRef<boolean>;
|
|
153
192
|
finalDisabled: import("vue").ComputedRef<any>;
|
|
154
193
|
labelFinal: import("vue").ComputedRef<any>;
|
|
155
194
|
onClick: (event: Event) => void;
|
|
195
|
+
onInlineKeydown: (event: KeyboardEvent) => void;
|
|
156
196
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "mouseenter" | "mouseleave")[], "click" | "mouseenter" | "mouseleave", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
157
197
|
variant: {
|
|
158
198
|
type: () => Variant;
|
|
@@ -188,6 +228,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
188
228
|
type: (BooleanConstructor | StringConstructor)[];
|
|
189
229
|
default: undefined;
|
|
190
230
|
};
|
|
231
|
+
/**
|
|
232
|
+
* `body` sets the label in the regular body text style and its icons one step smaller, the look of a
|
|
233
|
+
* `UiDropdownTrigger` of variant `tertiary`, so a button reads as one more control beside such triggers.
|
|
234
|
+
*/
|
|
235
|
+
textStyle: {
|
|
236
|
+
type: () => TextStyle;
|
|
237
|
+
default: string;
|
|
238
|
+
validator: (value: TextStyle) => boolean;
|
|
239
|
+
};
|
|
191
240
|
loading: {
|
|
192
241
|
type: BooleanConstructor;
|
|
193
242
|
default: boolean;
|
|
@@ -212,6 +261,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
212
261
|
type: () => RouteLocationRaw;
|
|
213
262
|
default: undefined;
|
|
214
263
|
};
|
|
264
|
+
/**
|
|
265
|
+
* Renders the label as a link that flows and wraps inside running text: no box, the surrounding font size,
|
|
266
|
+
* the tertiary colour. Without `to` or `href` it is a focusable `role="button"` span, since a `<button>`
|
|
267
|
+
* cannot break across lines.
|
|
268
|
+
*/
|
|
269
|
+
inline: {
|
|
270
|
+
type: BooleanConstructor;
|
|
271
|
+
default: boolean;
|
|
272
|
+
};
|
|
215
273
|
}>> & Readonly<{
|
|
216
274
|
onMouseenter?: ((...args: any[]) => any) | undefined;
|
|
217
275
|
onMouseleave?: ((...args: any[]) => any) | undefined;
|
|
@@ -228,9 +286,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
228
286
|
color: "primary" | "neutral" | "warning" | "success" | "error" | "neutral-invert";
|
|
229
287
|
showIconLeft: boolean;
|
|
230
288
|
iconRight: string | boolean;
|
|
289
|
+
textStyle: "body" | "action";
|
|
231
290
|
loading: boolean;
|
|
232
291
|
imageSource: string;
|
|
233
292
|
tooltip: string | Record<string, any>;
|
|
293
|
+
inline: boolean;
|
|
234
294
|
}, {}, {
|
|
235
295
|
RenderSlot: ({ vnodes }: {
|
|
236
296
|
vnodes: any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { ButtonGroupColor, ButtonGroupSize } from './types';
|
|
1
|
+
import type { ButtonGroupColor, ButtonGroupSize, ButtonGroupVariant } from './types';
|
|
2
2
|
interface UiButtonGroupProps {
|
|
3
3
|
modelValue?: string;
|
|
4
4
|
defaultValue?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
size?: ButtonGroupSize;
|
|
7
7
|
color?: ButtonGroupColor;
|
|
8
|
+
/** `strong` fills the selected item with the color; `light` raises it on the surface and writes its label in the color. */
|
|
9
|
+
variant?: ButtonGroupVariant;
|
|
8
10
|
name?: string;
|
|
9
11
|
orientation?: 'horizontal' | 'vertical';
|
|
10
12
|
/**
|
|
@@ -13,6 +15,8 @@ interface UiButtonGroupProps {
|
|
|
13
15
|
* Set to true to allow clearing the selection by clicking the active item.
|
|
14
16
|
*/
|
|
15
17
|
allowDeselect?: boolean;
|
|
18
|
+
/** When false, the group hugs its items instead of filling its container. */
|
|
19
|
+
fullWidth?: boolean;
|
|
16
20
|
}
|
|
17
21
|
declare var __VLS_11: {};
|
|
18
22
|
type __VLS_Slots = {} & {
|
|
@@ -26,11 +30,13 @@ declare const __VLS_base: import("vue").DefineComponent<UiButtonGroupProps, {},
|
|
|
26
30
|
orientation: "horizontal" | "vertical";
|
|
27
31
|
size: ButtonGroupSize;
|
|
28
32
|
disabled: boolean;
|
|
33
|
+
variant: ButtonGroupVariant;
|
|
29
34
|
color: ButtonGroupColor;
|
|
30
|
-
defaultValue: string;
|
|
31
35
|
name: string;
|
|
36
|
+
defaultValue: string;
|
|
32
37
|
modelValue: string;
|
|
33
38
|
allowDeselect: boolean;
|
|
39
|
+
fullWidth: boolean;
|
|
34
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
42
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
2
|
export type ButtonGroupSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
3
|
export type ButtonGroupColor = 'neutral' | 'neutral-invert' | 'primary' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type ButtonGroupVariant = 'strong' | 'light';
|
|
4
5
|
export interface ButtonGroupRegister {
|
|
5
6
|
register(value: string, el: HTMLElement): void;
|
|
6
7
|
unregister(value: string): void;
|
|
7
8
|
}
|
|
8
9
|
export declare const BUTTON_GROUP_SIZE_KEY: InjectionKey<ComputedRef<ButtonGroupSize>>;
|
|
9
10
|
export declare const BUTTON_GROUP_COLOR_KEY: InjectionKey<ComputedRef<ButtonGroupColor>>;
|
|
11
|
+
export declare const BUTTON_GROUP_VARIANT_KEY: InjectionKey<ComputedRef<ButtonGroupVariant>>;
|
|
10
12
|
export declare const BUTTON_GROUP_REGISTER_KEY: InjectionKey<ButtonGroupRegister>;
|
|
13
|
+
export declare const BUTTON_GROUP_RAIL_RADIUS: Record<ButtonGroupSize, string>;
|
|
14
|
+
export declare const BUTTON_GROUP_INNER_RADIUS: Record<ButtonGroupSize, string>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { RadioValue } from '../UiInputRadio/types';
|
|
2
|
+
import type { ChoiceControl, ChoiceValue, ControlPosition } from './types';
|
|
3
|
+
interface UiChoiceProps {
|
|
4
|
+
/**
|
|
5
|
+
* The control rendered in the row
|
|
6
|
+
*/
|
|
7
|
+
control: ChoiceControl;
|
|
8
|
+
/**
|
|
9
|
+
* The label text
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Supporting text under the label, announced with the control
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Info tooltip next to the label
|
|
18
|
+
*/
|
|
19
|
+
labelInfo?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The value this row selects. Required when `control` is `radio`; `null` is a valid value.
|
|
22
|
+
* A radio row goes inside a UiInputRadioGroup, which owns the selection.
|
|
23
|
+
*/
|
|
24
|
+
value?: RadioValue;
|
|
25
|
+
/**
|
|
26
|
+
* Switch and checkbox: whether the row is on. A radio reads its group instead.
|
|
27
|
+
*/
|
|
28
|
+
modelValue?: ChoiceValue;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the row is disabled
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the row uses the small height
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
compact?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Which side of the text the control sits on
|
|
41
|
+
* @default 'end'
|
|
42
|
+
*/
|
|
43
|
+
controlPosition?: ControlPosition;
|
|
44
|
+
}
|
|
45
|
+
type __VLS_Slots = {
|
|
46
|
+
/** Radio only: extra content under the text, such as a field the option configures */
|
|
47
|
+
content?(): unknown;
|
|
48
|
+
/** Radio only: an icon or a logo before the text */
|
|
49
|
+
icon?(): unknown;
|
|
50
|
+
};
|
|
51
|
+
declare const __VLS_base: import("vue").DefineComponent<UiChoiceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
52
|
+
"update:modelValue": (value: boolean) => any;
|
|
53
|
+
}, string, import("vue").PublicProps, Readonly<UiChoiceProps> & Readonly<{
|
|
54
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
value: RadioValue;
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
description: string;
|
|
59
|
+
modelValue: ChoiceValue;
|
|
60
|
+
labelInfo: string;
|
|
61
|
+
controlPosition: ControlPosition;
|
|
62
|
+
compact: boolean;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
65
|
+
declare const _default: typeof __VLS_export;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
export type ChoiceControl = 'radio' | 'switch' | 'checkbox';
|
|
3
|
+
export type ChoiceValue = boolean;
|
|
4
|
+
/** Which side of the text a radio, checkbox or switch sits on */
|
|
5
|
+
export type ControlPosition = 'start' | 'end';
|
|
6
|
+
/** Provided by UiChoice, which draws the option row around the control it wraps */
|
|
7
|
+
export declare const CHOICE_ROW_KEY: InjectionKey<boolean>;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<UiColorFieldProps, {},
|
|
|
11
11
|
label: string;
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
modelValue: string;
|
|
14
|
-
placeholder: string;
|
|
15
14
|
id: string;
|
|
15
|
+
placeholder: string;
|
|
16
16
|
defaultColor: string;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,14 +6,14 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<UiColorPickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
8
|
"update:modelValue": (value: string) => any;
|
|
9
|
+
change: (value: string) => any;
|
|
9
10
|
"update:color": (color: Color) => any;
|
|
10
11
|
"update:selectedPresetValue": (value: string) => any;
|
|
11
|
-
change: (value: string) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<UiColorPickerProps> & Readonly<{
|
|
13
13
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
14
|
+
onChange?: ((value: string) => any) | undefined;
|
|
14
15
|
"onUpdate:color"?: ((color: Color) => any) | undefined;
|
|
15
16
|
"onUpdate:selectedPresetValue"?: ((value: string) => any) | undefined;
|
|
16
|
-
onChange?: ((value: string) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
variant: import("./types").UiColorPickerVariant;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { FieldSize } from '../../composables/useControlShape';
|
|
2
|
+
export type UiComboboxSize = FieldSize;
|
|
3
|
+
export interface UiComboboxOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Shown instead of the description, typically why the option is disabled. */
|
|
9
|
+
hint?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UiComboboxGroup<T extends UiComboboxOption = UiComboboxOption> {
|
|
12
|
+
label: string;
|
|
13
|
+
options: T[];
|
|
14
|
+
}
|
|
15
|
+
/** A selectable row after the options, picked like an option but emitted as `action`. `icon` is a complete icon class such as `i-ph-user-plus`. */
|
|
16
|
+
export interface UiComboboxAction {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UiComboboxProps<T extends UiComboboxOption = UiComboboxOption> {
|
|
23
|
+
modelValue?: string;
|
|
24
|
+
items?: UiComboboxGroup<T>[];
|
|
25
|
+
/** Selectable rows after the options. */
|
|
26
|
+
actions?: UiComboboxAction[];
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
size?: UiComboboxSize;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
label?: string;
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
/** Translated result count, announced through a polite live region while the list is open. */
|
|
34
|
+
resultsLabel?: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
/** Rows shown before the list scrolls, with a peek of the next one. All rows show when unset. */
|
|
37
|
+
maxVisibleOptions?: number;
|
|
38
|
+
/** Options show a checkbox and the list stays open after a pick, so several can be picked in a row. */
|
|
39
|
+
multiple?: boolean;
|
|
40
|
+
/** Values of the options shown checked when `multiple` is set. Picking one of them emits `deselect`. */
|
|
41
|
+
selected?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* 'trigger' matches the list to the field. 'compact' caps it at 480px, so on a wide field part of the
|
|
44
|
+
* page behind stays visible, such as a list that updates while picking.
|
|
45
|
+
*/
|
|
46
|
+
width?: 'trigger' | 'compact';
|
|
47
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { UiComboboxAction, UiComboboxOption, UiComboboxProps } from './UiCombobox.types';
|
|
2
|
+
declare const __VLS_export: <T extends UiComboboxOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<UiComboboxProps<T> & {
|
|
4
|
+
onSelect?: ((option: T) => any) | undefined;
|
|
5
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
6
|
+
onAction?: ((id: string) => any) | undefined;
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
|
+
onDeselect?: ((option: T) => any) | undefined;
|
|
9
|
+
}> & (typeof globalThis extends {
|
|
10
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
11
|
+
} ? P : {});
|
|
12
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
13
|
+
/** Closes the list, for a pick that leads somewhere else, such as a dialog. */
|
|
14
|
+
close: () => void;
|
|
15
|
+
}>) => void;
|
|
16
|
+
attrs: any;
|
|
17
|
+
slots: {
|
|
18
|
+
item?: (props: {
|
|
19
|
+
option: T;
|
|
20
|
+
}) => unknown;
|
|
21
|
+
empty?: () => unknown;
|
|
22
|
+
action?: (props: {
|
|
23
|
+
action: UiComboboxAction;
|
|
24
|
+
}) => unknown;
|
|
25
|
+
/** Pinned under the options, outside their scroll: `close` closes the list. Hidden from assistive tech, so keep anything focusable out of the Tab order (`tabindex="-1"`) and redundant with Escape. */
|
|
26
|
+
footer?: (props: {
|
|
27
|
+
close: () => void;
|
|
28
|
+
}) => unknown;
|
|
29
|
+
};
|
|
30
|
+
emit: ((evt: "select", option: T) => void) & ((evt: "update:open", open: boolean) => void) & ((evt: "action", id: string) => void) & ((evt: "update:modelValue", value: string) => void) & ((evt: "deselect", option: T) => void);
|
|
31
|
+
}>) => import("vue").VNode & {
|
|
32
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
33
|
+
};
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} : {
|
|
39
|
+
[K in keyof T as K]: T[K];
|
|
40
|
+
}) & {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface UiDataTableColumn<TData> {
|
|
2
|
+
/**
|
|
3
|
+
* Unique column id. Also names the per-column slots:
|
|
4
|
+
* `#cell-<id>` and `#header-<id>`.
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/** Header label. An empty string renders an empty header cell. */
|
|
8
|
+
header: string;
|
|
9
|
+
/**
|
|
10
|
+
* Row property rendered by default. Omit for columns rendered
|
|
11
|
+
* entirely through their `#cell-<id>` slot.
|
|
12
|
+
*/
|
|
13
|
+
accessorKey?: keyof TData & string;
|
|
14
|
+
/**
|
|
15
|
+
* Shows the sort affordance on the header. Sorting logic stays in the
|
|
16
|
+
* consumer: bind `v-model:sorting` and sort/refetch the data yourself.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
sortable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Content alignment. Textual data stays left-aligned; reserve `right`
|
|
22
|
+
* for numeric data.
|
|
23
|
+
* @default 'left'
|
|
24
|
+
*/
|
|
25
|
+
align?: 'left' | 'right';
|
|
26
|
+
/** Fixed column width as a CSS value (e.g. '160px', '20%'). */
|
|
27
|
+
width?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Minimum column width as a CSS length (e.g. '160px'). The column never
|
|
30
|
+
* shrinks below it: when the columns do not fit, the table grows wider
|
|
31
|
+
* than its region, which scrolls horizontally.
|
|
32
|
+
*/
|
|
33
|
+
minWidth?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Keeps the header and the values of the column on one line: the column
|
|
36
|
+
* grows to fit them instead of wrapping, and the table grows wider than
|
|
37
|
+
* its region when needed, as with `minWidth`.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
nowrap?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface UiDataTableSort {
|
|
43
|
+
/** Column id being sorted. */
|
|
44
|
+
id: string;
|
|
45
|
+
direction: 'asc' | 'desc';
|
|
46
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
import type { UiTableSize } from '../UiTable/context';
|
|
3
|
+
import type { UiDataTableColumn, UiDataTableSort } from './UiDataTable.types';
|
|
4
|
+
export interface UiDataTableProps<TData> {
|
|
5
|
+
/** Column definitions. Each column can be customized via `#cell-<id>` and `#header-<id>` slots. */
|
|
6
|
+
columns: UiDataTableColumn<TData>[];
|
|
7
|
+
/** Rows, already sorted/filtered by the consumer. */
|
|
8
|
+
data: TData[];
|
|
9
|
+
/**
|
|
10
|
+
* Row heights: `md` = 40px header / 48px rows, `lg` = 48px header / 64px rows.
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: UiTableSize;
|
|
14
|
+
/**
|
|
15
|
+
* Alternating row backgrounds. Preferred over row dividers.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
zebra?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Renders skeleton rows instead of data.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Number of skeleton rows while loading.
|
|
26
|
+
* @default 5
|
|
27
|
+
*/
|
|
28
|
+
skeletonRows?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Current sort, controlled by the consumer (`v-model:sorting`). The table
|
|
31
|
+
* only renders the affordance and emits; sorting the data stays consumer-side.
|
|
32
|
+
* @default null
|
|
33
|
+
*/
|
|
34
|
+
sorting?: UiDataTableSort | null;
|
|
35
|
+
/**
|
|
36
|
+
* Makes rows interactive: hover feedback, keyboard focus and `row-click` emits.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
rowClickable?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Turns each row into a link to the returned location. The first cell holds
|
|
42
|
+
* a router link stretched over the row, so Cmd/Ctrl click, middle click and
|
|
43
|
+
* keyboard focus behave like any link. The first column's content sits
|
|
44
|
+
* inside the link, so it must hold no interactive content. Content of other
|
|
45
|
+
* cells that must stay interactive above the link (tooltips, buttons) needs
|
|
46
|
+
* `relative z-10`; the selection checkbox and `#actions` already sit above
|
|
47
|
+
* it. Takes precedence over `rowClickable`.
|
|
48
|
+
*/
|
|
49
|
+
rowLink?: (row: TData) => RouteLocationRaw;
|
|
50
|
+
/**
|
|
51
|
+
* Adds a leftmost checkbox column with a select-all header. Selection is
|
|
52
|
+
* controlled through `v-model:selectedRowIds`; pass `getRowId` so ids stay
|
|
53
|
+
* stable across data changes.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
selectable?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Selected row ids, controlled by the consumer (`v-model:selectedRowIds`).
|
|
59
|
+
* @default []
|
|
60
|
+
*/
|
|
61
|
+
selectedRowIds?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* How the `#actions` slot attaches to the row. `default` reveals it on
|
|
64
|
+
* hover, masking the cells behind bare action buttons; `floating` also
|
|
65
|
+
* reveals on hover but drops that backdrop for self-contained content
|
|
66
|
+
* like a UiActionBar; `menu` tucks it behind an always-visible trigger
|
|
67
|
+
* button that opens a popover on click.
|
|
68
|
+
* @default 'default'
|
|
69
|
+
*/
|
|
70
|
+
actionsVariant?: 'default' | 'floating' | 'menu';
|
|
71
|
+
/**
|
|
72
|
+
* Whether a row has trailing actions. Rows that return false get an empty
|
|
73
|
+
* actions cell, so nothing reveals over them on hover. All rows have
|
|
74
|
+
* actions when omitted.
|
|
75
|
+
*/
|
|
76
|
+
rowHasActions?: (row: TData) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Id of the row whose hover actions stay shown without hover or focus,
|
|
79
|
+
* e.g. while a menu opened from them is open. Matches `getRowId`.
|
|
80
|
+
* @default null
|
|
81
|
+
*/
|
|
82
|
+
revealedActionsRowId?: string | null;
|
|
83
|
+
/** Stable row identity; falls back to the row index. */
|
|
84
|
+
getRowId?: (row: TData, index: number) => string;
|
|
85
|
+
}
|
|
86
|
+
declare const __VLS_export: <TData extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
87
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<UiDataTableProps<TData> & {
|
|
88
|
+
"onUpdate:sorting"?: ((sort: UiDataTableSort | null) => any) | undefined;
|
|
89
|
+
"onUpdate:selectedRowIds"?: ((ids: string[]) => any) | undefined;
|
|
90
|
+
onRowClick?: ((row: TData) => any) | undefined;
|
|
91
|
+
}> & (typeof globalThis extends {
|
|
92
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
93
|
+
} ? P : {});
|
|
94
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
95
|
+
table: import("@tanstack/vue-table").VueTable<{
|
|
96
|
+
rowSortingFeature: import("@tanstack/vue-table").TableFeature;
|
|
97
|
+
rowSelectionFeature: import("@tanstack/vue-table").TableFeature;
|
|
98
|
+
}, TData>;
|
|
99
|
+
}>) => void;
|
|
100
|
+
attrs: any;
|
|
101
|
+
slots: {
|
|
102
|
+
/** Trailing row actions, revealed on row hover/focus. */
|
|
103
|
+
actions?: (props: {
|
|
104
|
+
row: TData;
|
|
105
|
+
}) => unknown;
|
|
106
|
+
/**
|
|
107
|
+
* Rows after the data rows, in a second body of the same table, e.g. a
|
|
108
|
+
* teaser for rows the plan hides. They share the column grid and the
|
|
109
|
+
* zebra of the data rows. Render a `UiTableCell` per column, after an
|
|
110
|
+
* empty one when `selectable`, and end each row with an empty
|
|
111
|
+
* `UiTableActionsCell` when `hasActions`. The body is positioned, so an
|
|
112
|
+
* overlay over these rows can sit in a `UiTableRow` with `zebra` off.
|
|
113
|
+
*/
|
|
114
|
+
'body-end'?: (props: {
|
|
115
|
+
columns: UiDataTableColumn<TData>[];
|
|
116
|
+
selectable: boolean;
|
|
117
|
+
hasActions: boolean;
|
|
118
|
+
actionsVariant: "default" | "floating" | "menu";
|
|
119
|
+
}) => unknown;
|
|
120
|
+
} & Partial<Record<`cell-${string}`, (props: {
|
|
121
|
+
row: TData;
|
|
122
|
+
value: unknown;
|
|
123
|
+
}) => unknown>> & Partial<Record<`header-${string}`, (props: {
|
|
124
|
+
column: UiDataTableColumn<TData>;
|
|
125
|
+
}) => unknown>>;
|
|
126
|
+
emit: ((evt: "update:sorting", sort: UiDataTableSort | null) => void) & ((evt: "update:selectedRowIds", ids: string[]) => void) & ((evt: "rowClick", row: TData) => void);
|
|
127
|
+
}>) => import("vue").VNode & {
|
|
128
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
129
|
+
};
|
|
130
|
+
declare const _default: typeof __VLS_export;
|
|
131
|
+
export default _default;
|
|
132
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
133
|
+
[K in keyof T]: T[K];
|
|
134
|
+
} : {
|
|
135
|
+
[K in keyof T as K]: T[K];
|
|
136
|
+
}) & {};
|