@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
37 lines (35 loc) • 1.8 kB
TypeScript
import { ThemingProps } from "../theme/types.js";
import { SystemProps } from "../system/system.js";
import { IconProp } from "../icon/icon.types.js";
import { BoxProps } from "../box/box.types.js";
import { ReactNode } from "react";
//#region src/sidemenu/sidemenu.types.d.ts
type SidemenuOrientation = 'vertical' | 'horizontal';
type SidemenuProps = SystemProps & ThemingProps<'Sidemenu'> & {
/** Collection of menu items */items?: SidemenuItemProps[]; /** Whether the menu is expanded @default false */
isExpanded?: boolean;
isSticky?: boolean; /** External callback for navigation to the item path, could be a custom function or React Router hook: https://reactrouter.com/en/main/hooks/use-navigate */
onNavigate?: (to: string) => void; /** With of the container when the side menu is expanded @default 280 */
width?: number;
};
type SidemenuItemProps = BoxProps & {
/** Custom class name */className?: string; /** Children */
children?: ReactNode; /** Custom class name */
icon?: IconProp; /** Icon size @default md */
iconSize?: 'md' | 'sm'; /** Whether the item is active */
isActive?: boolean; /** Whether the item is expanded vertically */
isExpanded?: boolean; /** On click callback */
onClick?: () => void; /** On collapse callback @default true */
onCollapse?: () => void; /** On expand callback */
onExpand?: () => void; /** Router path */
path?: string; /** Title */
title: string;
};
type SidemenuTopProps = BoxProps & {
/** Custom class name */className?: string; /** Left slod (always visible) */
leftSlot?: ReactNode; /** Right slod (hiden if the sidemenu is collapsed) */
rightSlot?: ReactNode;
};
//#endregion
export { SidemenuItemProps, SidemenuOrientation, SidemenuProps, SidemenuTopProps };
//# sourceMappingURL=sidemenu.types.d.ts.map