aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
141 lines • 3.41 kB
TypeScript
import React from "react";
export interface MenuItem {
id: string;
label: string;
icon?: React.ReactNode;
shortcut?: string;
disabled?: boolean;
children?: MenuItem[];
action?: () => void;
separator?: boolean;
checked?: boolean;
type?: "normal" | "checkbox" | "radio";
group?: string;
}
export interface GlassMenubarProps {
/**
* Menu items
*/
items?: MenuItem[];
/**
* Menubar orientation
*/
orientation?: "horizontal" | "vertical";
/**
* Size variant
*/
size?: "sm" | "md" | "lg";
/**
* Custom className
*/
className?: string;
/**
* Whether menubar is disabled
*/
disabled?: boolean;
/**
* Accessible label for the menubar
*/
"aria-label"?: string;
/**
* Test ID for testing
*/
"data-testid"?: string;
}
export interface GlassMenubarContentProps {
/**
* Menu content
*/
children: React.ReactNode;
/**
* Content position
*/
position?: {
x: number;
y: number;
};
/**
* Whether content is open
*/
isOpen: boolean;
/**
* Callback to close content
*/
onClose: () => void;
/**
* Custom className
*/
className?: string;
}
export interface GlassMenubarItemProps {
/**
* Menu item data
*/
item: MenuItem;
/**
* Whether item is hovered
*/
isHovered?: boolean;
/**
* Whether item has submenu open
*/
hasSubmenuOpen?: boolean;
/**
* Callback when item is clicked
*/
onClick: (item: MenuItem) => void;
/**
* Callback to open submenu
*/
onOpenSubmenu: (item: MenuItem) => void;
/**
* Callback to close submenu
*/
onCloseSubmenu: () => void;
/**
* Size variant
*/
size?: "sm" | "md" | "lg";
/**
* Custom className
*/
className?: string;
/**
* ARIA haspopup attribute
*/
"aria-haspopup"?: "menu" | undefined;
/**
* ARIA expanded attribute
*/
"aria-expanded"?: boolean | undefined;
}
/**
* GlassMenubar component
* A glassmorphism menubar with dropdown menus
*/
export declare const GlassMenubar: React.FC<GlassMenubarProps>;
/**
* GlassMenubarContent component
* Container for menubar dropdown content
*/
export declare const GlassMenubarContent: React.FC<GlassMenubarContentProps>;
/**
* GlassMenubarItem component
* Individual menubar item
*/
export declare const GlassMenubarItem: React.FC<GlassMenubarItemProps>;
/**
* Hook for creating menubar items
*/
export declare const useMenubar: () => {
createItem: (id: string, label: string, action?: () => void, options?: Partial<Omit<MenuItem, "id" | "label" | "action">>) => MenuItem;
createSeparator: () => MenuItem;
createCheckboxItem: (id: string, label: string, checked: boolean, onChange: (checked: boolean) => void, options?: Partial<Omit<MenuItem, "id" | "label" | "type" | "checked">>) => MenuItem;
createRadioItem: (id: string, label: string, checked: boolean, onChange: (checked: boolean) => void, options?: Partial<Omit<MenuItem, "id" | "label" | "type" | "checked">>) => MenuItem;
};
/**
* Preset menubar configurations
*/
export declare const createFileMenu: () => MenuItem[];
export declare const createEditMenu: () => MenuItem[];
//# sourceMappingURL=GlassMenubar.d.ts.map