108 lines
7.5 KiB
TypeScript
108 lines
7.5 KiB
TypeScript
import * as React from 'react';
|
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
import * as MenuPrimitive from '@radix-ui/react-menu';
|
|
|
|
type Scope<C = any> = {
|
|
[scopeName: string]: React.Context<C>[];
|
|
} | undefined;
|
|
type ScopeHook = (scope: Scope) => {
|
|
[__scopeProp: string]: Scope;
|
|
};
|
|
interface CreateScope {
|
|
scopeName: string;
|
|
(): ScopeHook;
|
|
}
|
|
|
|
type Direction = 'ltr' | 'rtl';
|
|
declare const createDropdownMenuScope: CreateScope;
|
|
interface DropdownMenuProps {
|
|
children?: React.ReactNode;
|
|
dir?: Direction;
|
|
open?: boolean;
|
|
defaultOpen?: boolean;
|
|
onOpenChange?(open: boolean): void;
|
|
modal?: boolean;
|
|
}
|
|
declare const DropdownMenu: React.FC<DropdownMenuProps>;
|
|
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
interface DropdownMenuTriggerProps extends PrimitiveButtonProps {
|
|
}
|
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
type MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;
|
|
interface DropdownMenuPortalProps extends MenuPortalProps {
|
|
}
|
|
declare const DropdownMenuPortal: React.FC<DropdownMenuPortalProps>;
|
|
type MenuContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;
|
|
interface DropdownMenuContentProps extends Omit<MenuContentProps, 'onEntryFocus'> {
|
|
}
|
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;
|
|
interface DropdownMenuGroupProps extends MenuGroupProps {
|
|
}
|
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuLabelProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;
|
|
interface DropdownMenuLabelProps extends MenuLabelProps {
|
|
}
|
|
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;
|
|
interface DropdownMenuItemProps extends MenuItemProps {
|
|
}
|
|
declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;
|
|
interface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {
|
|
}
|
|
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;
|
|
interface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {
|
|
}
|
|
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuRadioItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;
|
|
interface DropdownMenuRadioItemProps extends MenuRadioItemProps {
|
|
}
|
|
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuItemIndicatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;
|
|
interface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {
|
|
}
|
|
declare const DropdownMenuItemIndicator: React.ForwardRefExoticComponent<DropdownMenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
type MenuSeparatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;
|
|
interface DropdownMenuSeparatorProps extends MenuSeparatorProps {
|
|
}
|
|
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuArrowProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;
|
|
interface DropdownMenuArrowProps extends MenuArrowProps {
|
|
}
|
|
declare const DropdownMenuArrow: React.ForwardRefExoticComponent<DropdownMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
interface DropdownMenuSubProps {
|
|
children?: React.ReactNode;
|
|
open?: boolean;
|
|
defaultOpen?: boolean;
|
|
onOpenChange?(open: boolean): void;
|
|
}
|
|
declare const DropdownMenuSub: React.FC<DropdownMenuSubProps>;
|
|
type MenuSubTriggerProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;
|
|
interface DropdownMenuSubTriggerProps extends MenuSubTriggerProps {
|
|
}
|
|
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
type MenuSubContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;
|
|
interface DropdownMenuSubContentProps extends MenuSubContentProps {
|
|
}
|
|
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const Root: React.FC<DropdownMenuProps>;
|
|
declare const Trigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
declare const Portal: React.FC<DropdownMenuPortalProps>;
|
|
declare const Content: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const Group: React.ForwardRefExoticComponent<DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const Label: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const Item: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const CheckboxItem: React.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const RadioGroup: React.ForwardRefExoticComponent<DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const RadioItem: React.ForwardRefExoticComponent<DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const ItemIndicator: React.ForwardRefExoticComponent<DropdownMenuItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
declare const Separator: React.ForwardRefExoticComponent<DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const Arrow: React.ForwardRefExoticComponent<DropdownMenuArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
declare const Sub: React.FC<DropdownMenuSubProps>;
|
|
declare const SubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
declare const SubContent: React.ForwardRefExoticComponent<DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
|
|
export { Arrow, CheckboxItem, Content, DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemIndicator, type DropdownMenuItemIndicatorProps, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger, createDropdownMenuScope };
|