UNPKG

@snowball-tech/fractal

Version:

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

122 lines (113 loc) 4.28 kB
import { E as Elevations } from '../../../Paper.constants-Cpa8Sb1b.js'; import * as react from 'react'; import { AllHTMLAttributes, ReactNode, CSSProperties, ComponentProps } from 'react'; import { P as Popover } from '../../../Popover-C469c5EO.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import '../../../Popover.types-BIaXWPBD.js'; import '@radix-ui/react-popover'; import '../../../Paper.types-N2GQYA5D.js'; import '../../constants.js'; declare enum Orientations { Horizontal = "horizontal", Vertical = "vertical" } declare const DEFAULT_ORIENTATION = Orientations.Vertical; declare const DEFAULT_ELEVATION = Elevations.Elevated; declare const DEFAULT_SUB_MENU_ELEVATION = Elevations.Bordered; type CombinedRefs = { container: HTMLDivElement | null; menu: HTMLDivElement | null; }; type SubMenuCombinedRefs = { content: HTMLDivElement | null; trigger: HTMLElement | null; }; interface MenuProps extends AllHTMLAttributes<HTMLDivElement> { children: ReactNode; condensed?: boolean; disabled?: boolean; elevation?: `${Elevations}`; embedded?: boolean; fullWidth?: boolean; menu?: { className?: string; style?: CSSProperties; }; orientation?: `${Orientations}`; rainbow?: boolean; } interface MenuItemProps extends AllHTMLAttributes<HTMLDivElement> { active?: boolean; children?: ReactNode; condensed?: boolean; disabled?: boolean; href?: string; icon?: ReactNode; label?: string; rainbow?: boolean; target?: HTMLAnchorElement['target']; onActivate?: () => void; } interface MenuItemGroupProps extends AllHTMLAttributes<HTMLDivElement> { children: ReactNode; label: string; condensed?: boolean; disabled?: boolean; rainbow?: boolean; } type MenuItemSeparatorProps = AllHTMLAttributes<HTMLDivElement>; interface SubMenuProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'content'> { children: ReactNode; active?: boolean; align?: ComponentProps<typeof Popover>['align']; condensed?: boolean; condensedItems?: boolean; defaultOpen?: boolean; disabled?: boolean; elevation?: `${Elevations}`; icon?: ReactNode; open?: boolean; popover?: boolean; popup?: { className?: string; content?: { className?: string; positionner?: { className?: string; style?: CSSProperties; }; style?: CSSProperties; wrapper?: { className?: string; style?: CSSProperties; }; }; style?: CSSProperties; trigger?: { className?: string; style?: CSSProperties; wrapper?: { className?: string; style?: CSSProperties; }; }; }; rainbow?: boolean; side?: ComponentProps<typeof Popover>['side']; triggerOnHover?: boolean; withIndicator?: boolean; withScroll?: boolean; onClose?: () => void; onInteractOutside?: ComponentProps<typeof Popover>['onInteractOutside']; onOpen?: () => void; onSubMenuOpenChange?: ComponentProps<typeof Popover>['onOpenChange']; } declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<CombinedRefs>>; declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLLinkElement | HTMLDivElement>>; declare function MenuItemGroup({ children, condensed, disabled, label, rainbow, ...props }: MenuItemGroupProps): react_jsx_runtime.JSX.Element; declare function MenuItemSeparator({ ...props }: MenuItemSeparatorProps): react_jsx_runtime.JSX.Element; declare namespace MenuItemSeparator { var displayName: string; } declare const SubMenu: react.ForwardRefExoticComponent<SubMenuProps & react.RefAttributes<SubMenuCombinedRefs>>; export { DEFAULT_ELEVATION as DEFAULT_MENU_ELEVATION, DEFAULT_ORIENTATION as DEFAULT_MENU_ORIENTATION, DEFAULT_SUB_MENU_ELEVATION as DEFAULT_MENU_SUB_MENU_ELEVATION, Menu, Elevations as MenuElevations, MenuItem, MenuItemGroup, type MenuItemGroupProps, type MenuItemProps, MenuItemSeparator, type MenuItemSeparatorProps, Orientations as MenuOrientations, type MenuProps, SubMenu };