ropav 0.0.9 → 0.0.11
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 +6 -0
- package/dist/accordion.css +115 -111
- package/dist/accordion.js +60 -16
- package/dist/alert.css +110 -108
- package/dist/alert.js +48 -26
- package/dist/aspect-ratio.css +17 -15
- package/dist/aspect-ratio.js +20 -6
- package/dist/avatar.css +98 -96
- package/dist/avatar.js +27 -16
- package/dist/badge.css +95 -93
- package/dist/badge.js +29 -16
- package/dist/base.css +672 -671
- package/dist/button-group.css +39 -37
- package/dist/button-group.js +23 -12
- package/dist/button-link.css +160 -158
- package/dist/button-link.js +43 -24
- package/dist/button.css +160 -158
- package/dist/button.js +37 -19
- package/dist/card.css +109 -107
- package/dist/card.js +42 -17
- package/dist/checkbox.css +139 -137
- package/dist/checkbox.js +79 -28
- package/dist/collapse.css +29 -27
- package/dist/collapse.js +44 -10
- package/dist/color-input.css +137 -107
- package/dist/color-input.js +91 -17
- package/dist/color-picker.css +309 -303
- package/dist/color-picker.js +250 -77
- package/dist/color-picker2.js +9 -1
- package/dist/color-swatch.css +48 -46
- package/dist/color-swatch.js +15 -11
- package/dist/color-swatch2.js +4 -0
- package/dist/components/accordion/accordion-item.d.ts +16 -4
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/index.d.ts +5 -4
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/accordion/types.d.ts +10 -5
- package/dist/components/accordion/useAccordion.d.ts +1 -1
- package/dist/components/alert/alert.d.ts +3 -3
- package/dist/components/alert/index.d.ts +3 -3
- package/dist/components/alert/index.js +2 -2
- package/dist/components/alert/types.d.ts +5 -2
- package/dist/components/alert/useAlertColor.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +1 -1
- package/dist/components/aspect-ratio/index.d.ts +3 -2
- package/dist/components/aspect-ratio/index.js +2 -2
- package/dist/components/aspect-ratio/types.d.ts +4 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/index.d.ts +3 -3
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/types.d.ts +5 -2
- package/dist/components/avatar/useAvatarColor.d.ts +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge/index.js +2 -2
- package/dist/components/badge/types.d.ts +5 -2
- package/dist/components/badge/useBadgeColor.d.ts +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/types.d.ts +5 -2
- package/dist/components/button/useButtonColor.d.ts +1 -1
- package/dist/components/button-group/button-group.d.ts +1 -1
- package/dist/components/button-group/index.d.ts +3 -2
- package/dist/components/button-group/index.js +2 -2
- package/dist/components/button-group/types.d.ts +4 -1
- package/dist/components/button-link/button-link.d.ts +1 -1
- package/dist/components/button-link/index.d.ts +3 -2
- package/dist/components/button-link/index.js +2 -2
- package/dist/components/button-link/types.d.ts +5 -2
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/index.d.ts +3 -2
- package/dist/components/card/index.js +2 -2
- package/dist/components/card/types.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts +5 -2
- package/dist/components/checkbox/index.d.ts +3 -2
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/checkbox/types.d.ts +7 -2
- package/dist/components/checkbox/useCheckbox.d.ts +4 -2
- package/dist/components/collapse/collapse.d.ts +2 -2
- package/dist/components/collapse/index.d.ts +4 -3
- package/dist/components/collapse/index.js +2 -2
- package/dist/components/collapse/types.d.ts +9 -2
- package/dist/components/collapse/useCollapse.d.ts +1 -1
- package/dist/components/color-input/color-input.d.ts +1 -1
- package/dist/components/color-input/index.d.ts +3 -2
- package/dist/components/color-input/index.js +2 -2
- package/dist/components/color-input/types.d.ts +8 -4
- package/dist/components/color-input/useColorInput.d.ts +5 -5
- package/dist/components/color-input/useColorInputEyeDropper.d.ts +1 -1
- package/dist/components/color-input/useColorInputPopover.d.ts +2 -2
- package/dist/components/color-input/useColorInputValue.d.ts +1 -1
- package/dist/components/color-picker/color-picker-saturation.d.ts +1 -1
- package/dist/components/color-picker/color-picker-slider.d.ts +1 -1
- package/dist/components/color-picker/color-picker-utils.d.ts +1 -1
- package/dist/components/color-picker/color-picker.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts +3 -3
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/types.d.ts +13 -1
- package/dist/components/color-picker/useColorPickerDrag.d.ts +7 -2
- package/dist/components/color-picker/useColorPickerSwatches.d.ts +1 -1
- package/dist/components/color-picker/useColorPickerValue.d.ts +2 -2
- package/dist/components/color-swatch/color-swatch.d.ts +1 -1
- package/dist/components/color-swatch/index.d.ts +3 -2
- package/dist/components/color-swatch/index.js +2 -1
- package/dist/components/color-swatch/types.d.ts +4 -1
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +15 -6
- package/dist/components/dropdown-menu/dropdown-menu-primitives.d.ts +724 -0
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components/dropdown-menu/index.d.ts +55 -3
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/dropdown-menu/types.d.ts +142 -6
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +21 -12
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +6 -4
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +4 -3
- package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +5 -5
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +19 -0
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +25 -5
- package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +3 -3
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/index.d.ts +3 -2
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/types.d.ts +4 -1
- package/dist/components/field/useField.d.ts +1 -1
- package/dist/components/floating/index.d.ts +1 -0
- package/dist/components/floating/index.js +0 -0
- package/dist/components/floating/types.d.ts +31 -0
- package/dist/components/floating/useFloatingPosition.d.ts +38 -0
- package/dist/components/focus-trap/focus-trap.d.ts +31 -0
- package/dist/components/focus-trap/index.d.ts +4 -0
- package/dist/components/focus-trap/index.js +3 -0
- package/dist/components/focus-trap/types.d.ts +41 -0
- package/dist/components/focus-trap/useFocusTrap.d.ts +2 -0
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/index.d.ts +3 -2
- package/dist/components/icon-button/index.js +2 -1
- package/dist/components/icon-button/types.d.ts +5 -2
- package/dist/components/input/index.d.ts +3 -2
- package/dist/components/input/index.js +2 -1
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/types.d.ts +4 -1
- package/dist/components/input/useInput.d.ts +2 -2
- package/dist/components/modal/index.d.ts +3 -2
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/types.d.ts +9 -2
- package/dist/components/modal/useModal.d.ts +1 -1
- package/dist/components/number-input/index.d.ts +3 -2
- package/dist/components/number-input/index.js +2 -2
- package/dist/components/number-input/number-input.d.ts +1 -1
- package/dist/components/number-input/types.d.ts +5 -2
- package/dist/components/number-input/useNumberInput.d.ts +2 -2
- package/dist/components/overlay/index.d.ts +3 -2
- package/dist/components/overlay/index.js +2 -1
- package/dist/components/overlay/overlay.d.ts +1 -1
- package/dist/components/overlay/types.d.ts +4 -1
- package/dist/components/overlay/useOverlay.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/index.js +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/types.d.ts +21 -11
- package/dist/components/popover/usePopover.d.ts +11 -2
- package/dist/components/progress/index.d.ts +3 -3
- package/dist/components/progress/index.js +2 -2
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/progress/types.d.ts +5 -2
- package/dist/components/progress/useProgress.d.ts +2 -2
- package/dist/components/radio/index.d.ts +4 -3
- package/dist/components/radio/index.js +2 -2
- package/dist/components/radio/radio-group.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +9 -4
- package/dist/components/radio/types.d.ts +21 -4
- package/dist/components/radio/useRadio.d.ts +10 -5
- package/dist/components/select/index.d.ts +3 -2
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/types.d.ts +4 -1
- package/dist/components/select/useSelect.d.ts +4 -3
- package/dist/components/slider/index.d.ts +4 -4
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/range-slider-tooltip.d.ts +37 -0
- package/dist/components/slider/range-slider.d.ts +8 -13
- package/dist/components/slider/slider.d.ts +5 -2
- package/dist/components/slider/sliderCore.d.ts +35 -0
- package/dist/components/slider/types.d.ts +14 -7
- package/dist/components/slider/useRangeSlider.d.ts +5 -7
- package/dist/components/slider/useRangeSliderPointer.d.ts +19 -0
- package/dist/components/slider/useRangeSliderTooltipCollision.d.ts +31 -2
- package/dist/components/slider/useRangeSliderTooltipState.d.ts +23 -0
- package/dist/components/slider/useSlider.d.ts +11 -15
- package/dist/components/switch/index.d.ts +3 -2
- package/dist/components/switch/index.js +2 -2
- package/dist/components/switch/switch.d.ts +5 -2
- package/dist/components/switch/types.d.ts +7 -2
- package/dist/components/switch/useSwitch.d.ts +4 -2
- package/dist/components/tabs/index.d.ts +7 -6
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tabs/tabs-content.d.ts +2 -2
- package/dist/components/tabs/tabs-list.d.ts +4 -4
- package/dist/components/tabs/tabs-trigger.d.ts +5 -5
- package/dist/components/tabs/tabs.d.ts +5 -5
- package/dist/components/tabs/types.d.ts +13 -4
- package/dist/components/tabs/useTabs.d.ts +1 -1
- package/dist/components/teleport-provider/index.d.ts +2 -0
- package/dist/components/teleport-provider/index.js +2 -0
- package/dist/components/teleport-provider/teleport-provider.d.ts +21 -0
- package/dist/components/teleport-provider/types.d.ts +4 -0
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +5 -0
- package/dist/components/textarea/index.d.ts +3 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/textarea/textarea.d.ts +5 -2
- package/dist/components/textarea/types.d.ts +6 -1
- package/dist/components/textarea/useTextarea.d.ts +3 -2
- package/dist/components/toast/defaults.d.ts +7 -0
- package/dist/components/toast/index.d.ts +7 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast-provider.d.ts +21 -0
- package/dist/components/toast/toast-viewport.d.ts +34 -0
- package/dist/components/toast/toast.d.ts +31 -0
- package/dist/components/toast/types.d.ts +110 -0
- package/dist/components/toast/useToast.d.ts +4 -0
- package/dist/components/toast/useToastColor.d.ts +3 -0
- package/dist/components/toast/useToastState.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +3 -2
- package/dist/components/tooltip/index.js +2 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/types.d.ts +14 -13
- package/dist/components/tooltip/useTooltip.d.ts +15 -3
- package/dist/dropdown-menu.css +191 -107
- package/dist/dropdown-menu.js +1729 -107
- package/dist/field.css +41 -39
- package/dist/field.js +40 -16
- package/dist/focus-trap.js +80 -0
- package/dist/icon-button.css +193 -189
- package/dist/icon-button.js +23 -18
- package/dist/icon-button2.js +8 -0
- package/dist/index.d.ts +35 -30
- package/dist/index.js +36 -31
- package/dist/input.css +122 -120
- package/dist/input.js +47 -34
- package/dist/input2.js +9 -0
- package/dist/legacy-unlayered.css +5461 -0
- package/dist/modal.css +129 -127
- package/dist/modal.js +160 -200
- package/dist/number-input.css +87 -85
- package/dist/number-input.js +61 -17
- package/dist/overlay.css +26 -24
- package/dist/overlay.js +17 -9
- package/dist/overlay2.js +4 -0
- package/dist/popover.css +140 -107
- package/dist/popover.js +295 -189
- package/dist/popover2.js +6 -1
- package/dist/progress.css +101 -99
- package/dist/progress.js +50 -28
- package/dist/radio.css +114 -105
- package/dist/radio.js +154 -56
- package/dist/select.css +244 -242
- package/dist/select.js +92 -47
- package/dist/slider.css +1109 -904
- package/dist/slider.js +1118 -923
- package/dist/styles-api.d.ts +22 -0
- package/dist/styles-api.js +49 -0
- package/dist/switch.css +120 -108
- package/dist/switch.js +89 -33
- package/dist/tabs.css +286 -278
- package/dist/tabs.js +60 -21
- package/dist/teleport-provider.js +15 -0
- package/dist/textarea.css +132 -130
- package/dist/textarea.js +77 -29
- package/dist/toast.css +236 -0
- package/dist/toast.js +739 -0
- package/dist/tooltip.css +137 -107
- package/dist/tooltip.js +182 -223
- package/dist/tooltip2.js +8 -0
- package/dist/useClickOutside.js +1 -1
- package/dist/useFloatingPosition.js +1284 -0
- package/dist/useFocusTrap.js +130 -0
- package/dist/useTeleportTarget.js +29 -0
- package/dist/utils/componentColors.d.ts +60 -0
- package/docs/public-styles-api.md +133 -0
- package/docs/public-tokens.md +545 -0
- package/package.json +44 -12
- package/src/styles/_tokens.scss +33 -28
- package/src/styles/_utilities.scss +11 -9
- package/src/styles/styles-manifest.json +4125 -0
- package/dist/components/slider/useRangeSliderTooltipTransition.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuItemPath, DropdownMenuOpenOptions, DropdownMenuPlacement } from './types';
|
|
1
|
+
import { DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuItemPath, DropdownMenuOpenOptions, DropdownMenuPlacement } from './types.js';
|
|
2
2
|
export declare const DEFAULT_PLACEMENT: DropdownMenuPlacement;
|
|
3
3
|
export declare const DEFAULT_FOCUS_TARGET: DropdownMenuFocusTarget;
|
|
4
4
|
export type ItemPath = DropdownMenuItemPath;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DropdownMenuItem, DropdownMenuItemSlotProps, DropdownMenuProps, DropdownMenuSlotProps } from './types';
|
|
1
|
+
import { DropdownMenuItem, DropdownMenuItemSlotProps, DropdownMenuProps, DropdownMenuSelectEvent, DropdownMenuSlotProps } from './types.js';
|
|
2
2
|
declare const __VLS_export: (__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
3
|
props: import('vue').PublicProps & __VLS_PrettifyLocal<DropdownMenuProps & {
|
|
4
4
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
5
|
-
onSelect?: ((item: DropdownMenuItem) => any) | undefined;
|
|
5
|
+
onSelect?: ((item: DropdownMenuItem, event: DropdownMenuSelectEvent) => any) | undefined;
|
|
6
6
|
}> & (typeof globalThis extends {
|
|
7
7
|
__VLS_PROPS_FALLBACK: infer P;
|
|
8
8
|
} ? P : {});
|
|
@@ -13,7 +13,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
13
13
|
item?(props: DropdownMenuItemSlotProps): unknown;
|
|
14
14
|
empty?(): unknown;
|
|
15
15
|
};
|
|
16
|
-
emit: ((evt: "update:open", value: boolean) => void) & ((evt: "select", item: DropdownMenuItem) => void);
|
|
16
|
+
emit: ((evt: "update:open", value: boolean) => void) & ((evt: "select", item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void);
|
|
17
17
|
}>) => import('vue').VNode & {
|
|
18
18
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
19
19
|
};
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
import { DropdownMenuItem as DropdownMenuDataItem } from './types.js';
|
|
2
|
+
export { default as DropdownMenu } from './dropdown-menu.js';
|
|
3
|
+
export { dropdownMenuParts } from './types.js';
|
|
4
|
+
export { DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuContextTrigger, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from './dropdown-menu-primitives.js';
|
|
5
|
+
export declare const DropdownMenuItem: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
id: StringConstructor;
|
|
7
|
+
as: {
|
|
8
|
+
type: import('vue').PropType<import('./types.js').DropdownMenuAs>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
value: import('vue').PropType<import('./types.js').DropdownMenuItemValue>;
|
|
12
|
+
disabled: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
destructive: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
closeOnSelect: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "select"[], "select", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
27
|
+
id: StringConstructor;
|
|
28
|
+
as: {
|
|
29
|
+
type: import('vue').PropType<import('./types.js').DropdownMenuAs>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
value: import('vue').PropType<import('./types.js').DropdownMenuItemValue>;
|
|
33
|
+
disabled: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
destructive: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
closeOnSelect: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{
|
|
46
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
}>, {
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
as: import('./types.js').DropdownMenuAs;
|
|
50
|
+
closeOnSelect: boolean;
|
|
51
|
+
destructive: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
53
|
+
export type DropdownMenuItem = DropdownMenuDataItem;
|
|
54
|
+
export { useDropdownMenu } from './useDropdownMenu.js';
|
|
55
|
+
export type { DropdownMenuAs, DropdownMenuCheckedState, DropdownMenuCollisionPadding, DropdownMenuCheckboxItemPrimitiveProps, DropdownMenuCloseOptions, DropdownMenuContentPrimitiveProps, DropdownMenuContentProps, DropdownMenuContextTriggerPrimitiveProps, DropdownMenuFocusTarget, DropdownMenuInteractOutsideDetail, DropdownMenuInteractOutsideEvent, DropdownMenuItemIndicatorPrimitiveProps, DropdownMenuItemPath, DropdownMenuItemPrimitiveProps, DropdownMenuItemPrimitiveSlotProps, DropdownMenuItemProps, DropdownMenuItemSlotProps, DropdownMenuItemValue, DropdownMenuLabelPrimitiveProps, DropdownMenuOffset, DropdownMenuOffsetOptions, DropdownMenuOpenOptions, DropdownMenuPart, DropdownMenuPlacement, DropdownMenuPoint, DropdownMenuPortalPrimitiveProps, DropdownMenuProps, DropdownMenuRadioGroupPrimitiveProps, DropdownMenuRadioItemPrimitiveProps, DropdownMenuRenderedItem, DropdownMenuRootPrimitiveProps, DropdownMenuRootSlotProps, DropdownMenuSelectDetail, DropdownMenuSelectEvent, DropdownMenuSeparatorPrimitiveProps, DropdownMenuSlotProps, DropdownMenuSubContentPrimitiveProps, DropdownMenuSubPrimitiveProps, DropdownMenuSubmenuProps, DropdownMenuSubTriggerPrimitiveProps, DropdownMenuStrategy, DropdownMenuTarget, DropdownMenuTriggerPrimitiveProps, DropdownMenuTriggerProps, DropdownMenuVirtualAnchor, } from './types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { dropdown_menu_default as DropdownMenu, useDropdownMenu };
|
|
1
|
+
import { _ as DropdownMenuSubTrigger, a as DropdownMenuCheckboxItem, c as DropdownMenuItemIndicator, d as DropdownMenuRadioGroup, f as DropdownMenuRadioItem, g as DropdownMenuSubContent, h as DropdownMenuSub, i as useDropdownMenu, l as DropdownMenuLabel, m as DropdownMenuSeparator, n as dropdownMenuParts, o as DropdownMenuContent, p as DropdownMenuRoot, r as dropdown_menu_default, s as DropdownMenuContextTrigger, t as DropdownMenuItem, u as DropdownMenuPortal, v as DropdownMenuTrigger } from "../../dropdown-menu.js";
|
|
2
|
+
export { dropdown_menu_default as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuContextTrigger, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownMenuParts, useDropdownMenu };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { Component, HTMLAttributes } from 'vue';
|
|
2
|
+
import { StylesApiProps } from '../../styles-api.js';
|
|
3
|
+
import { FloatingCollisionPadding, FloatingOffset, FloatingOffsetOptions, FloatingPositionProps, FloatingStrategy, FloatingTarget, FloatingVirtualElement, TeleportProps } from '../floating/types.js';
|
|
4
|
+
export declare const dropdownMenuParts: readonly ["root", "trigger", "content", "item", "label", "shortcut", "submenu", "submenuIndicator", "empty"];
|
|
5
|
+
export type DropdownMenuPart = (typeof dropdownMenuParts)[number];
|
|
6
|
+
export type DropdownMenuPlacement = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end';
|
|
7
|
+
export type DropdownMenuTarget = FloatingTarget;
|
|
8
|
+
export type DropdownMenuStrategy = FloatingStrategy;
|
|
9
|
+
export type DropdownMenuCollisionPadding = FloatingCollisionPadding;
|
|
2
10
|
export type DropdownMenuItemValue = string | number;
|
|
3
11
|
export type DropdownMenuFocusTarget = 'first' | 'last';
|
|
4
12
|
export type DropdownMenuItemPath = number[];
|
|
@@ -21,6 +29,10 @@ export interface DropdownMenuTriggerProps {
|
|
|
21
29
|
'aria-expanded'?: boolean;
|
|
22
30
|
'aria-haspopup': 'menu';
|
|
23
31
|
disabled?: boolean;
|
|
32
|
+
class?: HTMLAttributes['class'];
|
|
33
|
+
style?: HTMLAttributes['style'];
|
|
34
|
+
'data-state'?: 'open' | 'closed';
|
|
35
|
+
'data-disabled'?: '';
|
|
24
36
|
onClick: (event: MouseEvent) => void;
|
|
25
37
|
onKeydown: (event: KeyboardEvent) => void;
|
|
26
38
|
}
|
|
@@ -65,9 +77,9 @@ export interface DropdownMenuItemProps {
|
|
|
65
77
|
'aria-expanded'?: boolean;
|
|
66
78
|
'aria-haspopup'?: 'menu';
|
|
67
79
|
'aria-disabled'?: true;
|
|
68
|
-
'data-disabled'?:
|
|
69
|
-
'data-
|
|
70
|
-
'data-submenu'?:
|
|
80
|
+
'data-disabled'?: '';
|
|
81
|
+
'data-highlighted'?: '';
|
|
82
|
+
'data-submenu'?: '';
|
|
71
83
|
onClick: (event: MouseEvent) => void;
|
|
72
84
|
onMouseenter: (event: MouseEvent) => void;
|
|
73
85
|
}
|
|
@@ -93,12 +105,136 @@ export interface DropdownMenuRenderedItem {
|
|
|
93
105
|
slotProps: DropdownMenuItemSlotProps;
|
|
94
106
|
children: DropdownMenuRenderedItem[];
|
|
95
107
|
}
|
|
96
|
-
export interface DropdownMenuProps {
|
|
108
|
+
export interface DropdownMenuProps extends FloatingPositionProps<DropdownMenuPlacement>, StylesApiProps<DropdownMenuPart> {
|
|
97
109
|
id?: string;
|
|
98
110
|
items?: DropdownMenuItem[];
|
|
99
|
-
placement?: DropdownMenuPlacement;
|
|
100
111
|
open?: boolean;
|
|
101
112
|
disabled?: boolean;
|
|
102
113
|
closeOnSelect?: boolean;
|
|
103
114
|
ariaLabel?: string;
|
|
115
|
+
modal?: boolean;
|
|
116
|
+
/** @deprecated Use `teleport` instead. */
|
|
117
|
+
portal?: boolean;
|
|
118
|
+
/** @deprecated Use `teleportTo` instead. */
|
|
119
|
+
portalTo?: string | HTMLElement;
|
|
120
|
+
}
|
|
121
|
+
export type DropdownMenuAs = string | Component;
|
|
122
|
+
export type DropdownMenuCheckedState = boolean | 'indeterminate';
|
|
123
|
+
export interface DropdownMenuPoint {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
}
|
|
127
|
+
export type DropdownMenuVirtualAnchor = FloatingVirtualElement;
|
|
128
|
+
export interface DropdownMenuSelectDetail {
|
|
129
|
+
originalEvent: Event;
|
|
130
|
+
value?: DropdownMenuItemValue;
|
|
131
|
+
}
|
|
132
|
+
export type DropdownMenuSelectEvent = CustomEvent<DropdownMenuSelectDetail>;
|
|
133
|
+
export interface DropdownMenuInteractOutsideDetail {
|
|
134
|
+
originalEvent: Event;
|
|
135
|
+
}
|
|
136
|
+
export type DropdownMenuInteractOutsideEvent = CustomEvent<DropdownMenuInteractOutsideDetail>;
|
|
137
|
+
export type DropdownMenuOffsetOptions = FloatingOffsetOptions;
|
|
138
|
+
export type DropdownMenuOffset = FloatingOffset;
|
|
139
|
+
export interface DropdownMenuRootPrimitiveProps {
|
|
140
|
+
id?: string;
|
|
141
|
+
open?: boolean;
|
|
142
|
+
defaultOpen?: boolean;
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
modal?: boolean;
|
|
145
|
+
target?: FloatingTarget | null;
|
|
146
|
+
virtualAnchor?: DropdownMenuVirtualAnchor | null;
|
|
147
|
+
}
|
|
148
|
+
export interface DropdownMenuRootSlotProps {
|
|
149
|
+
isOpen: boolean;
|
|
150
|
+
open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
|
|
151
|
+
close: (options?: DropdownMenuCloseOptions) => void;
|
|
152
|
+
toggle: () => void;
|
|
153
|
+
openAt: (point: DropdownMenuPoint, options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
|
|
154
|
+
}
|
|
155
|
+
export interface DropdownMenuTriggerPrimitiveProps {
|
|
156
|
+
id?: string;
|
|
157
|
+
as?: DropdownMenuAs;
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface DropdownMenuContextTriggerPrimitiveProps {
|
|
161
|
+
id?: string;
|
|
162
|
+
as?: DropdownMenuAs;
|
|
163
|
+
disabled?: boolean;
|
|
164
|
+
longPressDelay?: number;
|
|
165
|
+
longPressTolerance?: number;
|
|
166
|
+
}
|
|
167
|
+
export interface DropdownMenuPortalPrimitiveProps extends TeleportProps {
|
|
168
|
+
to?: string | HTMLElement;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
}
|
|
171
|
+
export interface DropdownMenuContentPrimitiveProps {
|
|
172
|
+
id?: string;
|
|
173
|
+
as?: DropdownMenuAs;
|
|
174
|
+
placement?: DropdownMenuPlacement;
|
|
175
|
+
offset?: DropdownMenuOffset;
|
|
176
|
+
strategy?: FloatingStrategy;
|
|
177
|
+
flip?: boolean;
|
|
178
|
+
shift?: boolean;
|
|
179
|
+
collisionPadding?: FloatingCollisionPadding;
|
|
180
|
+
arrow?: boolean;
|
|
181
|
+
/** @deprecated Use `flip` and `shift` instead. */
|
|
182
|
+
avoidCollisions?: boolean;
|
|
183
|
+
forceMount?: boolean;
|
|
184
|
+
ariaLabel?: string;
|
|
185
|
+
ariaLabelledby?: string;
|
|
186
|
+
ariaDescribedby?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface DropdownMenuItemPrimitiveProps {
|
|
189
|
+
id?: string;
|
|
190
|
+
as?: DropdownMenuAs;
|
|
191
|
+
value?: DropdownMenuItemValue;
|
|
192
|
+
disabled?: boolean;
|
|
193
|
+
destructive?: boolean;
|
|
194
|
+
closeOnSelect?: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface DropdownMenuItemPrimitiveSlotProps {
|
|
197
|
+
focused: boolean;
|
|
198
|
+
disabled: boolean;
|
|
199
|
+
select: () => void;
|
|
200
|
+
}
|
|
201
|
+
export interface DropdownMenuSeparatorPrimitiveProps {
|
|
202
|
+
id?: string;
|
|
203
|
+
as?: DropdownMenuAs;
|
|
204
|
+
orientation?: 'horizontal' | 'vertical';
|
|
205
|
+
}
|
|
206
|
+
export interface DropdownMenuLabelPrimitiveProps {
|
|
207
|
+
id?: string;
|
|
208
|
+
as?: DropdownMenuAs;
|
|
209
|
+
}
|
|
210
|
+
export interface DropdownMenuCheckboxItemPrimitiveProps extends Omit<DropdownMenuItemPrimitiveProps, 'value'> {
|
|
211
|
+
modelValue?: DropdownMenuCheckedState;
|
|
212
|
+
defaultValue?: DropdownMenuCheckedState;
|
|
213
|
+
}
|
|
214
|
+
export interface DropdownMenuRadioGroupPrimitiveProps {
|
|
215
|
+
id?: string;
|
|
216
|
+
as?: DropdownMenuAs;
|
|
217
|
+
modelValue?: DropdownMenuItemValue | null;
|
|
218
|
+
defaultValue?: DropdownMenuItemValue | null;
|
|
219
|
+
ariaLabel?: string;
|
|
220
|
+
ariaLabelledby?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface DropdownMenuRadioItemPrimitiveProps extends Omit<DropdownMenuItemPrimitiveProps, 'value'> {
|
|
223
|
+
value: DropdownMenuItemValue;
|
|
224
|
+
}
|
|
225
|
+
export interface DropdownMenuItemIndicatorPrimitiveProps {
|
|
226
|
+
as?: DropdownMenuAs;
|
|
227
|
+
forceMount?: boolean;
|
|
228
|
+
}
|
|
229
|
+
export interface DropdownMenuSubPrimitiveProps {
|
|
230
|
+
open?: boolean;
|
|
231
|
+
defaultOpen?: boolean;
|
|
232
|
+
}
|
|
233
|
+
export interface DropdownMenuSubTriggerPrimitiveProps {
|
|
234
|
+
id?: string;
|
|
235
|
+
as?: DropdownMenuAs;
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
}
|
|
238
|
+
export interface DropdownMenuSubContentPrimitiveProps extends Omit<DropdownMenuContentPrimitiveProps, 'arrow' | 'placement'> {
|
|
239
|
+
placement?: DropdownMenuPlacement;
|
|
104
240
|
}
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { DropdownMenuContentProps, DropdownMenuItem, DropdownMenuProps, DropdownMenuSlotProps, DropdownMenuTriggerProps } from './types';
|
|
1
|
+
import { DropdownMenuContentProps, DropdownMenuItem, DropdownMenuProps, DropdownMenuSelectEvent, DropdownMenuSlotProps, DropdownMenuTriggerProps } from './types.js';
|
|
2
2
|
export declare function useDropdownMenu(props: Readonly<DropdownMenuProps>, emit?: {
|
|
3
3
|
openChange?: (open: boolean) => void;
|
|
4
|
-
select?: (item: DropdownMenuItem) => void;
|
|
4
|
+
select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
|
|
5
5
|
}): {
|
|
6
6
|
rootRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
7
7
|
menuRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
8
|
+
arrowRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
8
9
|
menuId: import('vue').ComputedRef<string>;
|
|
9
10
|
isVisible: import('vue').ComputedRef<boolean>;
|
|
10
11
|
isEmpty: import('vue').ComputedRef<boolean>;
|
|
11
12
|
visibleItems: import('vue').ComputedRef<DropdownMenuItem[]>;
|
|
12
|
-
renderedItems: import('vue').ComputedRef<import('./types').DropdownMenuRenderedItem[]>;
|
|
13
|
+
renderedItems: import('vue').ComputedRef<import('./types.js').DropdownMenuRenderedItem[]>;
|
|
14
|
+
renderContext: import('./useDropdownMenuRenderItems.js').DropdownMenuRenderContext;
|
|
13
15
|
focusedIndex: import('vue').ComputedRef<number>;
|
|
14
|
-
focusedPath: import('vue').Ref<number[], number[] | import('./types').DropdownMenuItemPath>;
|
|
16
|
+
focusedPath: import('vue').Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
|
|
15
17
|
activeDescendantId: import('vue').ComputedRef<string | undefined>;
|
|
16
18
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
17
19
|
contentClass: import('vue').ComputedRef<string[]>;
|
|
20
|
+
contentStyle: import('vue').Ref<import('vue').CSSProperties, import('vue').CSSProperties>;
|
|
21
|
+
arrowStyle: import('vue').Ref<import('vue').CSSProperties | undefined, import('vue').CSSProperties | undefined>;
|
|
22
|
+
actualPlacement: import('vue').Ref<import('./types.js').DropdownMenuPlacement, import('./types.js').DropdownMenuPlacement>;
|
|
23
|
+
placementSide: import('vue').ComputedRef<string>;
|
|
24
|
+
isTargetMode: import('vue').ComputedRef<boolean>;
|
|
25
|
+
teleportTo: import('vue').ComputedRef<import('../floating/index.js').TeleportTargetValue>;
|
|
26
|
+
shouldTeleport: import('vue').ComputedRef<boolean>;
|
|
18
27
|
triggerProps: import('vue').ComputedRef<DropdownMenuTriggerProps>;
|
|
19
28
|
contentProps: import('vue').ComputedRef<DropdownMenuContentProps>;
|
|
20
29
|
slotProps: import('vue').ComputedRef<DropdownMenuSlotProps>;
|
|
21
|
-
open: (options?: import('./types').DropdownMenuOpenOptions | import('./types').DropdownMenuFocusTarget) => void;
|
|
22
|
-
close: (options?: import('./types').DropdownMenuCloseOptions) => void;
|
|
30
|
+
open: (options?: import('./types.js').DropdownMenuOpenOptions | import('./types.js').DropdownMenuFocusTarget) => void;
|
|
31
|
+
close: (options?: import('./types.js').DropdownMenuCloseOptions) => void;
|
|
23
32
|
toggle: () => void;
|
|
24
|
-
selectItem: (item: DropdownMenuItem) => void;
|
|
25
|
-
openSubmenu: (path: import('./dropdown-menu-utils').ItemPath, focus?: import('./dropdown-menu-utils').SubmenuFocusTarget, point?: import('./dropdown-menu-utils').PointerPoint) => boolean;
|
|
26
|
-
closeSubmenu: (path: import('./dropdown-menu-utils').ItemPath) => boolean;
|
|
27
|
-
onItemMouseenter: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils').ItemPath, event?: MouseEvent) => void;
|
|
33
|
+
selectItem: (item: DropdownMenuItem, originalEvent?: Event) => void;
|
|
34
|
+
openSubmenu: (path: import('./dropdown-menu-utils.js').ItemPath, focus?: import('./dropdown-menu-utils.js').SubmenuFocusTarget, point?: import('./dropdown-menu-utils.js').PointerPoint) => boolean;
|
|
35
|
+
closeSubmenu: (path: import('./dropdown-menu-utils.js').ItemPath) => boolean;
|
|
36
|
+
onItemMouseenter: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, event?: MouseEvent) => void;
|
|
28
37
|
onTriggerKeydown: (event: KeyboardEvent) => void;
|
|
29
38
|
onMenuKeydown: (event: KeyboardEvent) => void;
|
|
30
|
-
getItemProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils').ItemPath, focused?: boolean, disabled?: boolean) => import('./types').DropdownMenuItemProps;
|
|
31
|
-
getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils').ItemPath, focused?: boolean, disabled?: boolean) => import('./types').DropdownMenuItemSlotProps;
|
|
39
|
+
getItemProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemProps;
|
|
40
|
+
getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemSlotProps;
|
|
32
41
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps } from './types';
|
|
3
|
-
import { ItemPath } from './dropdown-menu-utils';
|
|
2
|
+
import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
|
|
3
|
+
import { ItemPath } from './dropdown-menu-utils.js';
|
|
4
4
|
type BooleanSource = Readonly<Ref<boolean>>;
|
|
5
5
|
type UseDropdownMenuDisclosureOptions = {
|
|
6
6
|
props: Readonly<DropdownMenuProps>;
|
|
7
7
|
emit: {
|
|
8
8
|
openChange?: (open: boolean) => void;
|
|
9
|
-
select?: (item: DropdownMenuItem) => void;
|
|
9
|
+
select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
|
|
10
10
|
};
|
|
11
11
|
rootRef: Ref<HTMLElement | null>;
|
|
12
|
+
menuRef: Ref<HTMLElement | null>;
|
|
13
|
+
targetRef: Readonly<Ref<Element | null>>;
|
|
12
14
|
uncontrolledOpen: Ref<boolean>;
|
|
13
15
|
isDisabled: BooleanSource;
|
|
14
16
|
isOpen: BooleanSource;
|
|
@@ -21,7 +23,7 @@ type UseDropdownMenuDisclosureOptions = {
|
|
|
21
23
|
focusMenu: () => void;
|
|
22
24
|
focusTrigger: () => void;
|
|
23
25
|
};
|
|
24
|
-
export declare function useDropdownMenuDisclosure({ props, emit, rootRef, uncontrolledOpen, isDisabled, isOpen, isVisible, focusedPath, resetFocus, resetSubmenus, resetHoverIntent, focusItem, focusMenu, focusTrigger, }: UseDropdownMenuDisclosureOptions): {
|
|
26
|
+
export declare function useDropdownMenuDisclosure({ props, emit, rootRef, menuRef, targetRef, uncontrolledOpen, isDisabled, isOpen, isVisible, focusedPath, resetFocus, resetSubmenus, resetHoverIntent, focusItem, focusMenu, focusTrigger, }: UseDropdownMenuDisclosureOptions): {
|
|
25
27
|
open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
|
|
26
28
|
close: (options?: DropdownMenuCloseOptions) => void;
|
|
27
29
|
toggle: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { DropdownMenuPlacement } from './types';
|
|
3
|
-
import { ItemPath } from './dropdown-menu-utils';
|
|
2
|
+
import { DropdownMenuPlacement } from './types.js';
|
|
3
|
+
import { ItemPath } from './dropdown-menu-utils.js';
|
|
4
4
|
type StringSource = {
|
|
5
5
|
readonly value: string;
|
|
6
6
|
};
|
|
@@ -11,10 +11,11 @@ type UseDropdownMenuDomOptions = {
|
|
|
11
11
|
menuId: StringSource;
|
|
12
12
|
rootRef: Ref<HTMLElement | null>;
|
|
13
13
|
menuRef: Ref<HTMLElement | null>;
|
|
14
|
+
targetRef: Readonly<Ref<Element | null>>;
|
|
14
15
|
placement: PlacementSource;
|
|
15
16
|
focusedPath: Ref<ItemPath>;
|
|
16
17
|
};
|
|
17
|
-
export declare function useDropdownMenuDom({ menuId, rootRef, menuRef, placement, focusedPath, }: UseDropdownMenuDomOptions): {
|
|
18
|
+
export declare function useDropdownMenuDom({ menuId, rootRef, menuRef, targetRef, placement, focusedPath, }: UseDropdownMenuDomOptions): {
|
|
18
19
|
activeDescendantId: import('vue').ComputedRef<string | undefined>;
|
|
19
20
|
focusMenu: () => void;
|
|
20
21
|
focusTrigger: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { DropdownMenuItem } from './types';
|
|
3
|
-
import { ItemPath, PointerPoint } from './dropdown-menu-utils';
|
|
2
|
+
import { DropdownMenuItem } from './types.js';
|
|
3
|
+
import { ItemPath, PointerPoint } from './dropdown-menu-utils.js';
|
|
4
4
|
export type SafeTriangle = [PointerPoint, PointerPoint, PointerPoint];
|
|
5
5
|
type GetSafeTriangleOptions = {
|
|
6
6
|
itemRect: DOMRect | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps } from './types';
|
|
3
|
-
import { ItemPath, PointerPoint, SubmenuFocusTarget } from './dropdown-menu-utils';
|
|
2
|
+
import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuOpenOptions, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
|
|
3
|
+
import { ItemPath, PointerPoint, SubmenuFocusTarget } from './dropdown-menu-utils.js';
|
|
4
4
|
type BooleanSource = Readonly<Ref<boolean>>;
|
|
5
5
|
type DisclosureControls = {
|
|
6
6
|
open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
|
|
@@ -23,7 +23,7 @@ type HoverIntentControls = {
|
|
|
23
23
|
type UseDropdownMenuInteractionsOptions = {
|
|
24
24
|
props: Readonly<DropdownMenuProps>;
|
|
25
25
|
emit: {
|
|
26
|
-
select?: (item: DropdownMenuItem) => void;
|
|
26
|
+
select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
|
|
27
27
|
};
|
|
28
28
|
isDisabled: BooleanSource;
|
|
29
29
|
focusedPath: Ref<ItemPath>;
|
|
@@ -37,8 +37,8 @@ type UseDropdownMenuInteractionsOptions = {
|
|
|
37
37
|
isSubmenuOpeningLeft: (path: ItemPath) => boolean;
|
|
38
38
|
};
|
|
39
39
|
export declare function useDropdownMenuInteractions({ props, emit, isDisabled, focusedPath, openSubmenuPath, getItemAtPath, focusItem, moveFocus, submenus, hoverIntent, disclosure, isSubmenuOpeningLeft, }: UseDropdownMenuInteractionsOptions): {
|
|
40
|
-
activateItem: (item: DropdownMenuItem, path: ItemPath, event?: MouseEvent) => void;
|
|
41
|
-
selectItem: (item: DropdownMenuItem) => void;
|
|
40
|
+
activateItem: (item: DropdownMenuItem, path: ItemPath, event?: MouseEvent | KeyboardEvent) => void;
|
|
41
|
+
selectItem: (item: DropdownMenuItem, originalEvent?: Event) => void;
|
|
42
42
|
openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget, point?: PointerPoint) => boolean;
|
|
43
43
|
closeSubmenu: (path: ItemPath) => boolean;
|
|
44
44
|
focusHoveredItem: (item: DropdownMenuItem, indexOrPath: number | ItemPath, event?: MouseEvent) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DropdownMenuFocusTarget, DropdownMenuItem } from './types';
|
|
2
|
-
import { ItemPath } from './dropdown-menu-utils';
|
|
1
|
+
import { DropdownMenuFocusTarget, DropdownMenuItem } from './types.js';
|
|
2
|
+
import { ItemPath } from './dropdown-menu-utils.js';
|
|
3
3
|
type DropdownMenuItemsSource = {
|
|
4
4
|
readonly value: DropdownMenuItem[];
|
|
5
5
|
};
|
|
6
6
|
export declare function useDropdownMenuNavigation(items: DropdownMenuItemsSource): {
|
|
7
|
-
focusedPath: import('vue').Ref<number[], number[] | import('./types').DropdownMenuItemPath>;
|
|
7
|
+
focusedPath: import('vue').Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
|
|
8
8
|
focusedIndex: import('vue').ComputedRef<number>;
|
|
9
9
|
getItemsAtPath: (path: ItemPath) => DropdownMenuItem[];
|
|
10
10
|
getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { FloatingReference } from '../floating/types.js';
|
|
3
|
+
import { DropdownMenuPlacement, DropdownMenuProps } from './types.js';
|
|
4
|
+
type BooleanSource = Readonly<Ref<boolean>>;
|
|
5
|
+
type PlacementSource = Readonly<Ref<DropdownMenuPlacement>>;
|
|
6
|
+
export declare function useDropdownMenuPortalPosition(options: {
|
|
7
|
+
props: Readonly<DropdownMenuProps>;
|
|
8
|
+
reference: Readonly<Ref<FloatingReference | null>>;
|
|
9
|
+
menuRef: Ref<HTMLElement | null>;
|
|
10
|
+
arrowRef: Ref<HTMLElement | null>;
|
|
11
|
+
isVisible: BooleanSource;
|
|
12
|
+
placement: PlacementSource;
|
|
13
|
+
restartKey: () => unknown;
|
|
14
|
+
}): {
|
|
15
|
+
actualPlacement: Ref<DropdownMenuPlacement, DropdownMenuPlacement>;
|
|
16
|
+
arrowStyle: Ref<import('vue').CSSProperties | undefined, import('vue').CSSProperties | undefined>;
|
|
17
|
+
contentStyle: Ref<import('vue').CSSProperties, import('vue').CSSProperties>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { StylesApiPartOptions } from '../../styles-api.js';
|
|
3
|
+
import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuItemSlotProps, DropdownMenuRenderedItem, DropdownMenuPlacement, DropdownMenuPart, DropdownMenuProps, DropdownMenuSubmenuProps } from './types.js';
|
|
4
|
+
import { ItemPath } from './dropdown-menu-utils.js';
|
|
3
5
|
type DropdownMenuItemsSource = {
|
|
4
6
|
readonly value: DropdownMenuItem[];
|
|
5
7
|
};
|
|
6
8
|
type UseDropdownMenuRenderItemsOptions = {
|
|
9
|
+
props: Readonly<DropdownMenuProps>;
|
|
10
|
+
actualPlacement: Readonly<Ref<DropdownMenuPlacement>>;
|
|
7
11
|
items: DropdownMenuItemsSource;
|
|
8
12
|
getItemId: (path: ItemPath) => string;
|
|
9
13
|
getSubmenuId: (path: ItemPath) => string;
|
|
10
14
|
getMenuActiveDescendant: (path: ItemPath) => string | undefined;
|
|
15
|
+
getItemElement: (path: ItemPath) => HTMLElement | null;
|
|
11
16
|
isItemFocused: (indexOrPath: number | ItemPath) => boolean;
|
|
12
17
|
isSubmenuOpen: (path: ItemPath) => boolean;
|
|
13
18
|
activateItem: (item: DropdownMenuItem, path: ItemPath, event?: MouseEvent) => void;
|
|
@@ -17,9 +22,24 @@ type UseDropdownMenuRenderItemsOptions = {
|
|
|
17
22
|
closeSubmenu: (path: ItemPath) => void;
|
|
18
23
|
close: (options?: DropdownMenuCloseOptions) => void;
|
|
19
24
|
};
|
|
20
|
-
export
|
|
25
|
+
export interface DropdownMenuRenderContext {
|
|
26
|
+
getPublicPartAttrs?: (part: DropdownMenuPart, options?: StylesApiPartOptions) => object;
|
|
27
|
+
isItemFocused: (indexOrPath: number | ItemPath) => boolean;
|
|
28
|
+
isSubmenuOpen: (path: ItemPath) => boolean;
|
|
29
|
+
getItemProps: (item: DropdownMenuItem, indexOrPath: number | ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => DropdownMenuItemProps;
|
|
30
|
+
getSubmenuProps: (item: DropdownMenuItem, path: ItemPath, submenuOpen?: boolean) => DropdownMenuSubmenuProps;
|
|
31
|
+
getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => DropdownMenuItemSlotProps;
|
|
32
|
+
getItemElement: (path: ItemPath) => HTMLElement | null;
|
|
33
|
+
getSubmenuPlacement: () => DropdownMenuPlacement;
|
|
34
|
+
getStrategy: () => NonNullable<DropdownMenuProps['strategy']>;
|
|
35
|
+
getFlip: () => boolean;
|
|
36
|
+
getShift: () => boolean;
|
|
37
|
+
getCollisionPadding: () => NonNullable<DropdownMenuProps['collisionPadding']>;
|
|
38
|
+
}
|
|
39
|
+
export declare function useDropdownMenuRenderItems({ props, actualPlacement, items, getItemId, getSubmenuId, getMenuActiveDescendant, getItemElement, isItemFocused, isSubmenuOpen, activateItem, focusHoveredItem, selectItem, openSubmenu, closeSubmenu, close, }: UseDropdownMenuRenderItemsOptions): {
|
|
21
40
|
renderedItems: import('vue').ComputedRef<DropdownMenuRenderedItem[]>;
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
renderContext: DropdownMenuRenderContext;
|
|
42
|
+
getItemProps: (item: DropdownMenuItem, indexOrPath: number | ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => DropdownMenuItemProps;
|
|
43
|
+
getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => DropdownMenuItemSlotProps;
|
|
24
44
|
};
|
|
25
45
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { DropdownMenuItem } from './types';
|
|
3
|
-
import { ItemPath, SubmenuFocusTarget } from './dropdown-menu-utils';
|
|
2
|
+
import { DropdownMenuItem } from './types.js';
|
|
3
|
+
import { ItemPath, SubmenuFocusTarget } from './dropdown-menu-utils.js';
|
|
4
4
|
type UseDropdownSubmenusOptions = {
|
|
5
5
|
focusedPath: Ref<ItemPath>;
|
|
6
6
|
getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;
|
|
7
7
|
focusItem: (target: Exclude<SubmenuFocusTarget, false>, menuPath?: ItemPath) => boolean;
|
|
8
8
|
};
|
|
9
9
|
export declare function useDropdownSubmenus({ focusedPath, getItemAtPath, focusItem, }: UseDropdownSubmenusOptions): {
|
|
10
|
-
openSubmenuPath: Ref<number[], number[] | import('./types').DropdownMenuItemPath>;
|
|
10
|
+
openSubmenuPath: Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
|
|
11
11
|
resetSubmenus: () => void;
|
|
12
12
|
isSubmenuOpen: (path: ItemPath) => boolean;
|
|
13
13
|
closeSubmenusAfter: (menuPath: ItemPath) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldProps } from './types';
|
|
1
|
+
import { FieldProps } from './types.js';
|
|
2
2
|
declare const __VLS_export: (__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
3
|
props: import('vue').PublicProps & __VLS_PrettifyLocal<FieldProps> & (typeof globalThis extends {
|
|
4
4
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -15,7 +15,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
15
15
|
invalid: true | undefined;
|
|
16
16
|
labelledby: string | undefined;
|
|
17
17
|
describedby: string | undefined;
|
|
18
|
-
controlProps: import('./types').FieldControlProps;
|
|
18
|
+
controlProps: import('./types.js').FieldControlProps;
|
|
19
19
|
}) => any;
|
|
20
20
|
} & {
|
|
21
21
|
description?: (props: {}) => any;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default as Field } from './field';
|
|
2
|
-
export
|
|
1
|
+
export { default as Field } from './field.js';
|
|
2
|
+
export { fieldParts } from './types.js';
|
|
3
|
+
export type { FieldControlProps, FieldPart, FieldProps, FieldSlotProps } from './types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { field_default as Field };
|
|
1
|
+
import { n as field_default, t as fieldParts } from "../../field.js";
|
|
2
|
+
export { field_default as Field, fieldParts };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StylesApiProps } from '../../styles-api.js';
|
|
1
2
|
export interface FieldControlProps {
|
|
2
3
|
id: string;
|
|
3
4
|
disabled?: boolean;
|
|
@@ -9,7 +10,7 @@ export interface FieldControlProps {
|
|
|
9
10
|
export interface FieldSlotProps extends FieldControlProps {
|
|
10
11
|
controlProps: FieldControlProps;
|
|
11
12
|
}
|
|
12
|
-
export interface FieldProps {
|
|
13
|
+
export interface FieldProps extends StylesApiProps<FieldPart> {
|
|
13
14
|
id?: string;
|
|
14
15
|
label?: string;
|
|
15
16
|
description?: string;
|
|
@@ -17,3 +18,5 @@ export interface FieldProps {
|
|
|
17
18
|
required?: boolean;
|
|
18
19
|
invalid?: boolean;
|
|
19
20
|
}
|
|
21
|
+
export declare const fieldParts: readonly ["root", "label", "required", "control", "description"];
|
|
22
|
+
export type FieldPart = (typeof fieldParts)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldControlProps, FieldProps } from './types';
|
|
1
|
+
import { FieldControlProps, FieldProps } from './types.js';
|
|
2
2
|
export declare function useField(props: Readonly<FieldProps>): {
|
|
3
3
|
controlId: import('vue').ComputedRef<string>;
|
|
4
4
|
labelId: import('vue').ComputedRef<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FloatingAlignment, FloatingCollisionPadding, FloatingOffset, FloatingOffsetOptions, FloatingPlacement, FloatingPositionProps, FloatingReference, FloatingSide, FloatingStrategy, FloatingTarget, FloatingVirtualElement, TeleportProps, TeleportTarget, TeleportTargetValue, } from './types.js';
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { VirtualElement } from '@floating-ui/dom';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export type FloatingSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
export type FloatingAlignment = 'start' | 'end';
|
|
5
|
+
export type FloatingPlacement = FloatingSide | `${FloatingSide}-${FloatingAlignment}`;
|
|
6
|
+
export type FloatingStrategy = 'absolute' | 'fixed';
|
|
7
|
+
export interface FloatingOffsetOptions {
|
|
8
|
+
mainAxis?: number;
|
|
9
|
+
crossAxis?: number;
|
|
10
|
+
}
|
|
11
|
+
export type FloatingOffset = number | FloatingOffsetOptions;
|
|
12
|
+
export type FloatingCollisionPadding = number | Partial<Record<FloatingSide, number>>;
|
|
13
|
+
export type FloatingReference = Element | VirtualElement;
|
|
14
|
+
export type FloatingTarget = string | FloatingReference | Ref<FloatingReference | null | undefined>;
|
|
15
|
+
export interface FloatingPositionProps<TPlacement extends FloatingPlacement = FloatingPlacement> extends TeleportProps {
|
|
16
|
+
target?: FloatingTarget | null;
|
|
17
|
+
placement?: TPlacement;
|
|
18
|
+
strategy?: FloatingStrategy;
|
|
19
|
+
offset?: FloatingOffset;
|
|
20
|
+
flip?: boolean;
|
|
21
|
+
shift?: boolean;
|
|
22
|
+
collisionPadding?: FloatingCollisionPadding;
|
|
23
|
+
arrow?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type TeleportTargetValue = string | Element;
|
|
26
|
+
export type TeleportTarget = TeleportTargetValue | Ref<TeleportTargetValue | null | undefined>;
|
|
27
|
+
export interface TeleportProps {
|
|
28
|
+
teleport?: boolean;
|
|
29
|
+
teleportTo?: TeleportTarget | null;
|
|
30
|
+
}
|
|
31
|
+
export type FloatingVirtualElement = VirtualElement;
|