import React, { ReactNode } from "react"; import { PaddingProps, MarginProps } from "styled-system"; import { TagProps } from "../../../__internal__/utils/helpers/tags"; import { IconType } from "../../icon"; type AriaCurrent = Pick, "aria-current">["aria-current"]; export type VerticalMenuItemClickEvent = React.MouseEvent | React.KeyboardEvent; export interface VerticalMenuItemProps extends PaddingProps, MarginProps, TagProps { /** Children of the menu item - another level of VerticalMenuItems */ children?: React.ReactNode; /** Custom icon to be displayed. Takes precedence over `iconType` if both are specified. */ customIcon?: ReactNode; /** Default open state of the component */ defaultOpen?: boolean; /** Title of the menu item */ title: string; /** Adornment of the menu item meant to be rendered on the right side */ adornment?: React.ReactNode | ((isOpen: boolean) => React.ReactNode); /** The Carbon icon to be displayed. Defers to `customIcon` if both are defined. */ iconType?: IconType; /** Whether the menu item is active or not */ active?: boolean | ((isOpen: boolean) => boolean); /** Height of the menu item */ height?: string; /** Href, when passed the menu item will be rendered as an anchor tag */ href?: string; /** A custom click handler to run when the menu item is clicked */ onClick?: (event: VerticalMenuItemClickEvent) => void; /** Optional component to render instead of the default div, useful for rendering router link components */ component?: T; /** Marks the element as the current item within a navigation context. */ ariaCurrent?: AriaCurrent; } type InferredComponentProps = Omit, keyof VerticalMenuItemProps>; export declare const VerticalMenuItem: ({ defaultOpen, title, iconType, adornment, children, customIcon, component, active, height, href, onClick, ariaCurrent, ...rest }: T extends React.ElementType ? InferredComponentProps & VerticalMenuItemProps : VerticalMenuItemProps) => React.JSX.Element; export default VerticalMenuItem;