UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS

93 lines (89 loc) 3.93 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { DropdownMenuItem, DropdownMenuContentProps, Root, Sub, DropdownMenuSubContentProps, SubTrigger } from '@radix-ui/react-dropdown-menu'; import { AllHTMLAttributes, ComponentProps, ReactNode, CSSProperties, MouseEvent } from 'react'; import { I as InputRadioGroupProps, a as InputRadioProps } from './InputRadio.types-B6eiCPav.js'; import { E as Elevations } from './Paper.constants-Cpa8Sb1b.js'; type CombinedRefs = { container: HTMLDivElement | null; dropdown: HTMLDivElement | null; trigger: HTMLElement | null; }; type SubDropdownCombinedRefs = { content: HTMLDivElement | null; trigger: HTMLElement | null; }; interface DropdownProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'onClick'> { children: ReactNode; align?: DropdownMenuContentProps['align']; asSelect?: boolean; condensed?: boolean; defaultOpen?: boolean; disabled?: boolean; dropdown?: Partial<{ className?: string; style?: CSSProperties; } & Omit<DropdownMenuContentProps, 'align' | 'asChild' | 'onInteractOutside' | 'side'>>; elevation?: `${Elevations}`; fullWidth?: boolean; open?: boolean; side?: DropdownMenuContentProps['side']; toggleOnTriggerClick?: boolean; trigger?: ReactNode; triggerAsButton?: boolean; width?: number | string | 'auto' | 'fit' | 'full' | 'trigger'; withIndicator?: boolean; withScroll?: boolean; onClick?: (event: MouseEvent<HTMLButtonElement>) => void; onClose?: () => void; onInteractOutside?: DropdownMenuContentProps['onInteractOutside']; onMenuOpenChange?: ComponentProps<typeof Root>['onOpenChange']; onOpen?: () => void; } interface DropdownItemProps extends Omit<AllHTMLAttributes<HTMLAnchorElement> & ComponentProps<typeof DropdownMenuItem>, 'asChild' | 'onClick' | 'onSelect'> { active?: boolean; children?: ReactNode; condensed?: boolean; disabled?: boolean; href?: string; icon?: ReactNode; label?: string; target?: HTMLAnchorElement['target']; value?: string; onClick?: ComponentProps<typeof DropdownMenuItem>['onSelect']; onSelect?: ComponentProps<typeof DropdownMenuItem>['onSelect']; } interface DropdownItemGroupProps extends AllHTMLAttributes<HTMLDivElement> { children: ReactNode; label: string; condensed?: boolean; disabled?: boolean; } interface SubDropdownProps extends Omit<AllHTMLAttributes<HTMLDivElement> & ComponentProps<typeof Sub>, 'asChild' | 'content' | 'onClick'> { children: ReactNode; condensed?: boolean; condensedItems?: boolean; content?: Partial<{ className?: string; style?: CSSProperties; } & Omit<DropdownMenuSubContentProps, 'asChild' | 'onInteractOutside'>>; defaultOpen?: boolean; disabled?: boolean; icon?: ReactNode; open?: boolean; withIndicator?: boolean; withScroll?: boolean; onClick?: ComponentProps<typeof SubTrigger>['onSelect']; onClose?: () => void; onInteractOutside?: DropdownMenuSubContentProps['onInteractOutside']; onOpen?: () => void; onSubMenuOpenChange?: ComponentProps<typeof Sub>['onOpenChange']; } type DropdownRadioGroupProps = { condensed?: boolean; } & Omit<InputRadioGroupProps, 'fullWidth' | 'orientation' | 'variant'>; type DropdownRadioItemProps = { condensed?: boolean; } & Omit<InputRadioProps, 'fullWidth'>; type DropdownItemSeparatorProps = AllHTMLAttributes<HTMLDivElement>; declare function DropdownItemSeparator({ ...props }: DropdownItemSeparatorProps): react_jsx_runtime.JSX.Element; export { type CombinedRefs as C, DropdownItemSeparator as D, type SubDropdownProps as S, type DropdownItemGroupProps as a, type DropdownItemProps as b, type DropdownItemSeparatorProps as c, type DropdownProps as d, type DropdownRadioGroupProps as e, type DropdownRadioItemProps as f, type SubDropdownCombinedRefs as g };