import { TSize } from '../../index.ts'; import { ReactNode } from 'react'; type TNavMenuItemCommon = { /** * set true to show notification badge */ hasBadge?: boolean; /** * each item needs a unique ID */ id: string; /** * highlights the link to show it as the current active item */ isCurrent?: boolean; /** * stop the link being active and lowers its opacity */ isDisabled?: boolean; /** * the text or other content for the link / button */ label: string | ReactNode | JSX.Element; /** * optional icon to show before the label */ icon?: ReactNode | JSX.Element; /** * a trailing icon placed just after the label */ trailingIcon?: ReactNode; /** * optional className */ className?: string; }; type TNavMenuSubItemCommon = { /** * each item needs a unique ID */ id: string; /** * highlights the link to show it as the current active item */ isCurrent?: boolean; /** * stop the link being active and lowers its opacity */ isDisabled?: boolean; /** * the text or other content for the link / button */ label: string | ReactNode | JSX.Element; /** * optional icon to show before the label */ icon?: ReactNode | JSX.Element; /** * a trailing icon placed just after the label */ trailingIcon?: ReactNode; /** * optional className */ className?: string; }; export type TNavMenuSubItem = TNavMenuSubItemCommon & (TNavMenuSubItemButton | TNavMenuSubItemLink); type TNavMenuSubItemButton = { /** * variant of button */ variant: 'button'; /** * make the href optional when variant is button */ href?: string; /** * the function to run when the button is clicked */ onClick: (event: React.MouseEvent) => void; }; type TNavMenuSubItemLink = { /** * variant of link */ variant: 'link'; /** * the URL to link to */ href: string; /** * the target to open the link in */ target?: string; /** * the optional function to run when the button is clicked */ onClick?: (event: React.MouseEvent) => void; }; type TNavMenuButton = { /** * variant of button */ variant: 'button'; /** * make the href optional when variant is button */ href?: string; /** * the function to run when the button is clicked */ onClick: (event: React.MouseEvent) => void; }; type TNavMenuDropdown = { /** * variant of dropdown */ variant: 'dropdown'; /** * a list of sub items to show in the dropdown */ subItems: TNavMenuSubItem[]; /** * set true to hide the chevron icon on the dropdown * @default false */ hideChevron?: boolean; /** * the optional function to run when the button is clicked */ onClick?: (event: React.MouseEvent) => void; /** * set true to open the dropdown by default * @default false */ isOpenByDefault?: boolean; /** * make the href optional when variant is dropdown */ href?: string; }; type TNavMenuLink = { variant?: 'link'; /** * the URL to link to */ href: string; /** * the target to open the link in */ target?: string; /** * the optional function to run when the button is clicked */ onClick?: (event: React.MouseEvent) => void; }; export type TNavMenuItem = TNavMenuItemCommon & (TNavMenuButton | TNavMenuLink | TNavMenuDropdown); export interface INavMenuPropsCommon { /** * Array of content for each tab with unique ID * ``` * label?: string | ReactNode | JSX.Element * asButton?: boolean * hasBadge?: boolean * href?: string * icon?: ReactNode * id?: string * isCurrent?: boolean * isDisabled?: boolean * label?: string | ReactNode | JSX.Element * onClick?: () => void * ``` */ items: TNavMenuItem[]; /** * label text for tabs accessibility */ label?: string; /** * apply custom CSS */ style?: React.CSSProperties; /** * size of the tabs * @default 'md' */ size?: TSize; /** * optional className */ className?: string; /** * set true to enable CSS animations * @default false */ hasAnimation?: boolean; /** * set true to collapse the menu * @default false */ isCollapsed?: boolean; /** * if the menu has dropdowns, allow it to open multiple at once * @default true */ canOpenMultiple?: boolean; /** * offset the dropdown menu this many pixels along the X axis * @default 20 */ dropdownOffsetX?: number; /** * offset the dropdown menu this many pixels along the Y axis * @default 0 */ dropdownOffsetY?: number; /** * the placement of the dropdown menu * @default 'top-end' */ dropdownPlacement?: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'; /** * set true to transform the dropdown menu * @default false * * */ dropdownTransform?: boolean; /** * set true to collapse the menu * @default 'fixed' */ dropdownStrategy?: 'fixed' | 'absolute'; /** * set true to show the title in the dropdown * @default true */ showDropdownTitle?: boolean; } export interface INavMenuPropsCollapsed { /** * set true to collapse the menu * @default true */ isCollapsed: true; } export interface INavMenuPropsNotCollapsed { /** * set false to collapse the menu * @default false */ isCollapsed?: false; } export type INavMenuProps = INavMenuPropsCommon & (INavMenuPropsCollapsed | INavMenuPropsNotCollapsed); export {}; //# sourceMappingURL=types.d.ts.map