UNPKG

aura-glass

Version:

A comprehensive glassmorphism design system for React applications with 142+ production-ready components

138 lines 3.27 kB
import React from "react"; export interface CommandItem { id: string; label: string; description?: string; icon?: React.ReactNode; keywords?: string[]; action: () => void; group?: string; disabled?: boolean; } export interface GlassCommandProps { /** * Command items to display */ items?: CommandItem[]; /** * Placeholder text for search input */ placeholder?: string; /** * Empty state message */ emptyMessage?: string; /** * Loading state */ loading?: boolean; /** * Maximum height of the command list */ maxHeight?: string; /** * Custom filter function */ filterItems?: (items: CommandItem[], query: string) => CommandItem[]; /** * Group items by category */ groupBy?: (item: CommandItem) => string; /** * Custom render function for items */ renderItem?: (item: CommandItem, isSelected: boolean) => React.ReactNode; /** * Custom render function for empty state */ renderEmpty?: () => React.ReactNode; /** * Callback when command is selected */ onSelect?: (item: CommandItem) => void; /** * Callback when search query changes */ onSearchChange?: (query: string) => void; /** * Custom className */ className?: string; /** * Accessible label for the command palette */ "aria-label"?: string; /** * Custom data-testid */ "data-testid"?: string; } export interface GlassCommandDialogProps extends GlassCommandProps { /** * Whether dialog is open */ open: boolean; /** * Callback when dialog closes */ onOpenChange: (open: boolean) => void; /** * Dialog title */ title?: string; /** * Dialog description */ description?: string; } export interface GlassCommandInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> { /** * Custom className */ className?: string; } export interface GlassCommandListProps { /** * Command items to display */ children: React.ReactNode; /** * Maximum height */ maxHeight?: string; /** * Custom className */ className?: string; } /** * GlassCommand component * A glassmorphism command palette with search functionality */ export declare const GlassCommand: React.FC<GlassCommandProps>; /** * GlassCommandDialog component * A modal dialog containing the command palette */ export declare const GlassCommandDialog: React.FC<GlassCommandDialogProps>; /** * GlassCommandInput component * Search input for the command palette */ export declare const GlassCommandInput: React.FC<GlassCommandInputProps>; /** * GlassCommandList component * Scrollable list container for command items */ export declare const GlassCommandList: React.FC<GlassCommandListProps>; /** * Hook for using command palette globally */ export declare const useCommandPalette: () => { isOpen: boolean; items: CommandItem[]; openPalette: (commands: CommandItem[]) => void; closePalette: () => void; setIsOpen: React.Dispatch<React.SetStateAction<boolean>>; }; //# sourceMappingURL=GlassCommand.d.ts.map