carbon-react
Version:
A library of reusable React components for easily building user interfaces.
41 lines (40 loc) • 1.55 kB
TypeScript
import React, { Dispatch, ReactNode, RefObject, SetStateAction } from "react";
import { IconType } from "../../icon/icon-type";
export interface ResponsiveVerticalMenuButtonItem {
children?: ReactNode;
customIcon?: ReactNode;
divider?: boolean;
href?: string;
icon?: IconType;
id: string;
label?: React.ReactNode;
}
export interface MenuContextType {
active: boolean;
activeMenuItem: ResponsiveVerticalMenuButtonItem | null;
buttonRef: RefObject<HTMLButtonElement>;
containerRef: RefObject<HTMLDivElement>;
menuRef: RefObject<HTMLUListElement>;
reducedMotion?: boolean;
responsiveMode?: boolean;
left: string;
top: string;
width?: string;
height?: string;
setActive: Dispatch<SetStateAction<boolean>>;
setActiveMenuItem: (item: ResponsiveVerticalMenuButtonItem | null) => void;
setReducedMotion?: (reducedMotion: boolean) => void;
setResponsiveMode?: (responsiveMode: boolean) => void;
setLeft: (left: string) => void;
setTop: (top: string) => void;
}
export declare const ResponsiveVerticalMenuContext: React.Context<MenuContextType | null>;
export declare const useResponsiveVerticalMenu: () => MenuContextType;
export interface ResponsiveVerticalMenuProviderProps {
children: ReactNode;
/** @private @internal @ignore */
width?: string;
/** @private @internal @ignore */
height?: string;
}
export declare const ResponsiveVerticalMenuProvider: ({ children, width, height, }: ResponsiveVerticalMenuProviderProps) => React.JSX.Element;