@birhaus/navigation
Version:
BIRHAUS Navigation Components - FourThreeOneNav implementing 4-3-1 cognitive rule
71 lines (68 loc) • 2.46 kB
text/typescript
import * as react from 'react';
import { ReactNode } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
interface NavigationItem {
id: string;
label: string;
labelEn?: string;
icon?: ReactNode;
href?: string;
onClick?: () => void;
active?: boolean;
disabled?: boolean;
badge?: string | number;
submenu?: NavigationItem[];
}
interface ContextualAction {
id: string;
label: string;
labelEn?: string;
icon?: ReactNode;
onClick: () => void;
variant?: 'default' | 'secondary' | 'destructive';
disabled?: boolean;
loading?: boolean;
}
interface PrimaryAction {
label: string;
labelEn?: string;
icon?: ReactNode;
onClick: () => void;
disabled?: boolean;
loading?: boolean;
}
interface FourThreeOneNavProps {
navigationItems: NavigationItem[];
contextualActions?: ContextualAction[];
primaryAction?: PrimaryAction;
logo?: ReactNode;
logoHref?: string;
onLogoClick?: () => void;
searchPlaceholder?: string;
onSearchClick?: () => void;
showSearch?: boolean;
showCommandPalette?: boolean;
onCommandPaletteToggle?: () => void;
commandPaletteShortcut?: string;
mobileBreakpoint?: 'sm' | 'md' | 'lg';
collapsible?: boolean;
menuLabel?: string;
closeMenuLabel?: string;
searchLabel?: string;
commandPaletteLabel?: string;
className?: string;
variant?: 'default' | 'minimal' | 'elevated';
overflowBehavior?: 'hide' | 'collapse' | 'scroll';
overflowLabel?: string;
}
declare function FourThreeOneNav({ navigationItems, contextualActions, primaryAction, logo, logoHref, onLogoClick, searchPlaceholder, // Used for aria-label and placeholder text
onSearchClick, showSearch, showCommandPalette, onCommandPaletteToggle, commandPaletteShortcut, mobileBreakpoint, collapsible, menuLabel, closeMenuLabel, searchLabel, commandPaletteLabel, className, variant, overflowBehavior, overflowLabel }: FourThreeOneNavProps): react_jsx_runtime.JSX.Element;
declare function useFourThreeOneNav(): {
activeItem: string | null;
isMobileMenuOpen: boolean;
activateItem: (itemId: string) => void;
toggleMobileMenu: () => void;
closeMobileMenu: () => void;
setActiveItem: react.Dispatch<react.SetStateAction<string | null>>;
};
export { type ContextualAction, FourThreeOneNav, type FourThreeOneNavProps, type NavigationItem, type PrimaryAction, useFourThreeOneNav };