/** * @file UI Slice * @description UI state management with atomic updates and DevTools integration * * This slice manages all UI-related state including sidebar, modals, loading states, * and toasts. Uses Immer for immutable updates and automatic action naming for DevTools. */ /** * Toast notification */ export interface Toast { id: string; type: 'success' | 'error' | 'warning' | 'info'; message: string; title?: string; duration?: number; dismissible?: boolean; } /** * Modal stack entry for nested modals */ export interface ModalStackEntry { id: string; data: Record | null; } /** * UI state interface */ export interface UIState { sidebarOpen: boolean; sidebarCollapsed: boolean; activeModal: string | null; modalData: Record | null; modalStack: ModalStackEntry[]; globalLoading: boolean; loadingMessage: string | null; loadingProgress: number | null; toasts: Toast[]; layoutDensity: 'compact' | 'comfortable' | 'spacious'; animationsEnabled: boolean; commandPaletteOpen: boolean; } /** * UI actions interface */ export interface UIActions { /** Toggle sidebar open/closed state */ toggleSidebar: () => void; /** Set sidebar open state explicitly */ setSidebarOpen: (open: boolean) => void; /** Set sidebar collapsed state (narrow vs full width) */ setSidebarCollapsed: (collapsed: boolean) => void; /** Open a modal by ID, optionally passing data. Supports nesting. */ openModal: (modalId: string, data?: Record) => void; /** Close current modal, returning to previous in stack if nested */ closeModal: () => void; /** Close all modals and clear the modal stack */ closeAllModals: () => void; /** Get data passed to current modal */ getModalData: >() => T | null; /** Set global loading state with optional message */ setGlobalLoading: (loading: boolean, message?: string) => void; /** Set loading progress (0-100) or null to hide progress */ setLoadingProgress: (progress: number | null) => void; /** Add a toast notification, returns the toast ID */ addToast: (toast: Omit) => string; /** Remove a specific toast by ID */ removeToast: (id: string) => void; /** Clear all toasts */ clearToasts: () => void; /** Set UI density (compact, comfortable, spacious) */ setLayoutDensity: (density: UIState['layoutDensity']) => void; /** Enable or disable UI animations */ setAnimationsEnabled: (enabled: boolean) => void; /** Toggle command palette visibility */ toggleCommandPalette: () => void; /** Set command palette open state explicitly */ setCommandPaletteOpen: (open: boolean) => void; } /** * UI slice using createSlice factory for automatic DevTools action naming * * All actions are automatically prefixed with "ui/" in DevTools, e.g.: * - ui/toggleSidebar * - ui/openModal * - ui/addToast */ export declare const uiSlice: import('zustand').StateCreator unknown>, [["zustand/immer", never], ["zustand/devtools", never]], [], UIState & UIActions & Record unknown>>; export type UISlice = UIState & UIActions;