@papernote/ui
Version:
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive
41 lines • 1.46 kB
TypeScript
import React from 'react';
export interface Command {
/** Unique identifier */
id: string;
/** Display label */
label: string;
/** Optional description */
description?: string;
/** Icon element */
icon?: React.ReactNode;
/** Group name for categorization */
group?: string;
/** Keyboard shortcut display */
shortcut?: string;
/** Handler when command is executed */
onExecute: () => void;
/** Optional keywords for better search matching */
keywords?: string[];
}
export interface CommandPaletteProps {
/** List of available commands */
commands: Command[];
/** Open/close state */
open: boolean;
/** Callback when state changes */
onOpenChange: (open: boolean) => void;
/** Placeholder text */
placeholder?: string;
/** Show keyboard shortcut to open (e.g., "Ctrl+K") */
trigger?: string;
/** Recent commands to show first */
recentCommands?: string[];
/** Callback to update recent commands */
onRecentCommandsChange?: (commandIds: string[]) => void;
}
export default function CommandPalette({ commands, open, onOpenChange, placeholder, trigger, recentCommands, onRecentCommandsChange, }: CommandPaletteProps): React.ReactPortal | null;
export declare function useCommandPalette(defaultTrigger?: string): {
open: boolean;
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
};
//# sourceMappingURL=CommandPalette.d.ts.map