hazo_ui 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -1
- package/dist/index.d.ts +56 -1
- package/dist/index.js +63 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2592,4 +2592,59 @@ interface HazoUiMemoryDropdownProps {
|
|
|
2592
2592
|
*/
|
|
2593
2593
|
declare function HazoUiMemoryDropdown({ history_key, placeholder, on_select, add_entry, empty_label, }: HazoUiMemoryDropdownProps): React$1.JSX.Element;
|
|
2594
2594
|
|
|
2595
|
-
|
|
2595
|
+
/** User-facing theme mode. "system" resolves against the OS preference. */
|
|
2596
|
+
type Theme = "light" | "dark" | "system";
|
|
2597
|
+
interface ThemeProviderProps {
|
|
2598
|
+
children: React$1.ReactNode;
|
|
2599
|
+
/** Initial mode when no value is stored yet. Default: "system". */
|
|
2600
|
+
defaultTheme?: Theme;
|
|
2601
|
+
/** localStorage key used to persist the chosen mode. Default: "theme". */
|
|
2602
|
+
storageKey?: string;
|
|
2603
|
+
}
|
|
2604
|
+
interface ThemeContextValue {
|
|
2605
|
+
/** The user's chosen mode. */
|
|
2606
|
+
theme: Theme;
|
|
2607
|
+
/** Persist + apply a new mode. */
|
|
2608
|
+
setTheme: (theme: Theme) => void;
|
|
2609
|
+
/** The effective "light"|"dark" after resolving "system". */
|
|
2610
|
+
resolvedTheme: "light" | "dark";
|
|
2611
|
+
/** Flips between light and dark (sets an explicit mode, never "system"). */
|
|
2612
|
+
toggleTheme: () => void;
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2615
|
+
* Provides theme state/context and keeps `<html class="dark">` in sync.
|
|
2616
|
+
*
|
|
2617
|
+
* SSR-safe: reads/writes to `window`/`document` only ever happen inside
|
|
2618
|
+
* `useEffect`, never during render, so server and first-client render match.
|
|
2619
|
+
*/
|
|
2620
|
+
declare function HazoThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): React$1.ReactElement;
|
|
2621
|
+
/**
|
|
2622
|
+
* Reads the theme context.
|
|
2623
|
+
* @throws if called outside a <HazoThemeProvider>.
|
|
2624
|
+
*/
|
|
2625
|
+
declare function useTheme(): ThemeContextValue;
|
|
2626
|
+
interface ThemeScriptProps {
|
|
2627
|
+
/** Must match the storageKey passed to <HazoThemeProvider>. Default: "theme". */
|
|
2628
|
+
storageKey?: string;
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* No-flash inline script. Place in the root layout's <head>, BEFORE any
|
|
2632
|
+
* stylesheet/content that depends on the theme, so the `dark` class lands
|
|
2633
|
+
* on <html> before first paint.
|
|
2634
|
+
*
|
|
2635
|
+
* Reads `localStorage.getItem(storageKey)` (JSON-stringified by
|
|
2636
|
+
* useLocalStorage, so `"dark"` is stored as the string `"dark"` — parsed
|
|
2637
|
+
* safely with a try/catch fallback to a raw-string strip of the quotes).
|
|
2638
|
+
* Wrapped entirely in try/catch so it can never throw and block rendering.
|
|
2639
|
+
*/
|
|
2640
|
+
declare function ThemeScript({ storageKey }: ThemeScriptProps): React$1.ReactElement;
|
|
2641
|
+
interface ThemeToggleProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2642
|
+
className?: string;
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
* Minimal, unopinionated light/dark toggle button. Shows Sun/Moon (lucide)
|
|
2646
|
+
* and calls `toggleTheme()` from context on click.
|
|
2647
|
+
*/
|
|
2648
|
+
declare const ThemeToggle: React$1.ForwardRefExoticComponent<ThemeToggleProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2649
|
+
|
|
2650
|
+
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, HazoThemeProvider, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, Label, LoadingTimeout, type LoadingTimeoutProps, type Logger, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, type ThemeContextValue, type ThemeProviderProps, ThemeScript, type ThemeScriptProps, ThemeToggle, type ThemeToggleProps, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, median, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useTheme, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
package/dist/index.d.ts
CHANGED
|
@@ -2592,4 +2592,59 @@ interface HazoUiMemoryDropdownProps {
|
|
|
2592
2592
|
*/
|
|
2593
2593
|
declare function HazoUiMemoryDropdown({ history_key, placeholder, on_select, add_entry, empty_label, }: HazoUiMemoryDropdownProps): React$1.JSX.Element;
|
|
2594
2594
|
|
|
2595
|
-
|
|
2595
|
+
/** User-facing theme mode. "system" resolves against the OS preference. */
|
|
2596
|
+
type Theme = "light" | "dark" | "system";
|
|
2597
|
+
interface ThemeProviderProps {
|
|
2598
|
+
children: React$1.ReactNode;
|
|
2599
|
+
/** Initial mode when no value is stored yet. Default: "system". */
|
|
2600
|
+
defaultTheme?: Theme;
|
|
2601
|
+
/** localStorage key used to persist the chosen mode. Default: "theme". */
|
|
2602
|
+
storageKey?: string;
|
|
2603
|
+
}
|
|
2604
|
+
interface ThemeContextValue {
|
|
2605
|
+
/** The user's chosen mode. */
|
|
2606
|
+
theme: Theme;
|
|
2607
|
+
/** Persist + apply a new mode. */
|
|
2608
|
+
setTheme: (theme: Theme) => void;
|
|
2609
|
+
/** The effective "light"|"dark" after resolving "system". */
|
|
2610
|
+
resolvedTheme: "light" | "dark";
|
|
2611
|
+
/** Flips between light and dark (sets an explicit mode, never "system"). */
|
|
2612
|
+
toggleTheme: () => void;
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2615
|
+
* Provides theme state/context and keeps `<html class="dark">` in sync.
|
|
2616
|
+
*
|
|
2617
|
+
* SSR-safe: reads/writes to `window`/`document` only ever happen inside
|
|
2618
|
+
* `useEffect`, never during render, so server and first-client render match.
|
|
2619
|
+
*/
|
|
2620
|
+
declare function HazoThemeProvider({ children, defaultTheme, storageKey, }: ThemeProviderProps): React$1.ReactElement;
|
|
2621
|
+
/**
|
|
2622
|
+
* Reads the theme context.
|
|
2623
|
+
* @throws if called outside a <HazoThemeProvider>.
|
|
2624
|
+
*/
|
|
2625
|
+
declare function useTheme(): ThemeContextValue;
|
|
2626
|
+
interface ThemeScriptProps {
|
|
2627
|
+
/** Must match the storageKey passed to <HazoThemeProvider>. Default: "theme". */
|
|
2628
|
+
storageKey?: string;
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* No-flash inline script. Place in the root layout's <head>, BEFORE any
|
|
2632
|
+
* stylesheet/content that depends on the theme, so the `dark` class lands
|
|
2633
|
+
* on <html> before first paint.
|
|
2634
|
+
*
|
|
2635
|
+
* Reads `localStorage.getItem(storageKey)` (JSON-stringified by
|
|
2636
|
+
* useLocalStorage, so `"dark"` is stored as the string `"dark"` — parsed
|
|
2637
|
+
* safely with a try/catch fallback to a raw-string strip of the quotes).
|
|
2638
|
+
* Wrapped entirely in try/catch so it can never throw and block rendering.
|
|
2639
|
+
*/
|
|
2640
|
+
declare function ThemeScript({ storageKey }: ThemeScriptProps): React$1.ReactElement;
|
|
2641
|
+
interface ThemeToggleProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2642
|
+
className?: string;
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
* Minimal, unopinionated light/dark toggle button. Shows Sun/Moon (lucide)
|
|
2646
|
+
* and calls `toggleTheme()` from context on click.
|
|
2647
|
+
*/
|
|
2648
|
+
declare const ThemeToggle: React$1.ForwardRefExoticComponent<ThemeToggleProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
2649
|
+
|
|
2650
|
+
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, HazoThemeProvider, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, Label, LoadingTimeout, type LoadingTimeoutProps, type Logger, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, type ThemeContextValue, type ThemeProviderProps, ThemeScript, type ThemeScriptProps, ThemeToggle, type ThemeToggleProps, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, median, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useTheme, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import { cva } from 'class-variance-authority';
|
|
11
11
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
12
|
-
import { X, ChevronDown, ChevronUp, Check, Circle, ChevronRight, ChevronLeft, Filter, Plus, ArrowUpDown, Loader2, AlertTriangle, OctagonAlert, CheckCircle2, ChevronsUpDown, Download, Share2, Copy, GripVertical, ArrowUp, ArrowDown, Pencil, Calendar as Calendar$1 } from 'lucide-react';
|
|
12
|
+
import { X, ChevronDown, ChevronUp, Check, Circle, ChevronRight, Sun, Moon, ChevronLeft, Filter, Plus, ArrowUpDown, Loader2, AlertTriangle, OctagonAlert, CheckCircle2, ChevronsUpDown, Download, Share2, Copy, GripVertical, ArrowUp, ArrowDown, Pencil, Calendar as Calendar$1 } from 'lucide-react';
|
|
13
13
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
14
14
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -11321,7 +11321,68 @@ function EntryRow({ entry, on_select, onDelete }) {
|
|
|
11321
11321
|
}
|
|
11322
11322
|
);
|
|
11323
11323
|
}
|
|
11324
|
+
var ThemeContext = React26.createContext(void 0);
|
|
11325
|
+
function HazoThemeProvider({
|
|
11326
|
+
children,
|
|
11327
|
+
defaultTheme = "system",
|
|
11328
|
+
storageKey = "theme"
|
|
11329
|
+
}) {
|
|
11330
|
+
const [theme, setTheme] = useLocalStorage(storageKey, defaultTheme);
|
|
11331
|
+
const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
|
|
11332
|
+
const resolvedTheme = theme === "system" ? prefersDark ? "dark" : "light" : theme;
|
|
11333
|
+
React26.useEffect(() => {
|
|
11334
|
+
document.documentElement.classList.toggle("dark", resolvedTheme === "dark");
|
|
11335
|
+
}, [resolvedTheme]);
|
|
11336
|
+
const toggleTheme = React26.useCallback(() => {
|
|
11337
|
+
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
11338
|
+
}, [resolvedTheme, setTheme]);
|
|
11339
|
+
const value = React26.useMemo(
|
|
11340
|
+
() => ({ theme, setTheme, resolvedTheme, toggleTheme }),
|
|
11341
|
+
[theme, setTheme, resolvedTheme, toggleTheme]
|
|
11342
|
+
);
|
|
11343
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
11344
|
+
}
|
|
11345
|
+
function useTheme() {
|
|
11346
|
+
const context = React26.useContext(ThemeContext);
|
|
11347
|
+
if (context === void 0) {
|
|
11348
|
+
throw new Error("useTheme must be used within a <HazoThemeProvider>");
|
|
11349
|
+
}
|
|
11350
|
+
return context;
|
|
11351
|
+
}
|
|
11352
|
+
function ThemeScript({ storageKey = "theme" }) {
|
|
11353
|
+
const script = `(function(){try{var k=${JSON.stringify(
|
|
11354
|
+
storageKey
|
|
11355
|
+
)};var raw=localStorage.getItem(k);var t="system";if(raw){try{t=JSON.parse(raw);}catch(e){t=String(raw).replace(/^"|"$/g,"");}}var m=window.matchMedia("(prefers-color-scheme: dark)").matches;var isDark=t==="dark"||((t==="system"||!t)&&m);var c=document.documentElement.classList;if(isDark){c.add("dark");}else{c.remove("dark");}}catch(e){}})();`;
|
|
11356
|
+
return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: script } });
|
|
11357
|
+
}
|
|
11358
|
+
var ThemeToggle = React26.forwardRef(
|
|
11359
|
+
({ className, ...props }, ref) => {
|
|
11360
|
+
const { resolvedTheme, toggleTheme } = useTheme();
|
|
11361
|
+
const [mounted, setMounted] = React26.useState(false);
|
|
11362
|
+
React26.useEffect(() => {
|
|
11363
|
+
setMounted(true);
|
|
11364
|
+
}, []);
|
|
11365
|
+
const isDark = mounted && resolvedTheme === "dark";
|
|
11366
|
+
const label = isDark ? "Switch to light theme" : "Switch to dark theme";
|
|
11367
|
+
return /* @__PURE__ */ jsx(
|
|
11368
|
+
"button",
|
|
11369
|
+
{
|
|
11370
|
+
type: "button",
|
|
11371
|
+
ref,
|
|
11372
|
+
onClick: toggleTheme,
|
|
11373
|
+
"aria-label": label,
|
|
11374
|
+
className: cn(
|
|
11375
|
+
"inline-flex h-9 w-9 items-center justify-center rounded-full text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
|
11376
|
+
className
|
|
11377
|
+
),
|
|
11378
|
+
...props,
|
|
11379
|
+
children: isDark ? /* @__PURE__ */ jsx(Sun, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Moon, { className: "h-4 w-4" })
|
|
11380
|
+
}
|
|
11381
|
+
);
|
|
11382
|
+
}
|
|
11383
|
+
);
|
|
11384
|
+
ThemeToggle.displayName = "ThemeToggle";
|
|
11324
11385
|
|
|
11325
|
-
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CelebrationProvider, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, CommandNodeExtension, CommandPill, CommandPopover, DateRangeSelector, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorBanner, ErrorPage, FunnelChart, HazoContextProvider, HazoUiConfirmDialog, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, HazoUiFlexInput, HazoUiFlexRadio, HazoUiImageCropper, HazoUiImageCropperDialog, HazoUiKanban, HazoUiKanbanFilter, HazoUiMemoryDropdown, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, HazoUiProgressBar, HazoUiRte, HazoUiTable, HazoUiTextarea, HazoUiTextbox, HazoUiToaster, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, InverseSparkline, Label3 as Label, LoadingTimeout, MarkdownEditor, NotificationCountBadge, NotificationItem, NotificationPanel, Popover, PopoverContent, PopoverTrigger, ProgressiveImage, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, SkeletonCircle, SkeletonGroup, SkeletonRect, Slider, Sparkline, Spinner, StackedBars, Switch, Table2 as Table, TableBody, TableCaption, TableCell2 as TableCell, TableFooter, TableHead, TableHeader2 as TableHeader, TableRow2 as TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, applyKanbanFilter, buttonGroupVariants, celebrate, cn, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, median, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
|
11386
|
+
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CelebrationProvider, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, CommandNodeExtension, CommandPill, CommandPopover, DateRangeSelector, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorBanner, ErrorPage, FunnelChart, HazoContextProvider, HazoThemeProvider, HazoUiConfirmDialog, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, HazoUiFlexInput, HazoUiFlexRadio, HazoUiImageCropper, HazoUiImageCropperDialog, HazoUiKanban, HazoUiKanbanFilter, HazoUiMemoryDropdown, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, HazoUiProgressBar, HazoUiRte, HazoUiTable, HazoUiTextarea, HazoUiTextbox, HazoUiToaster, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, InverseSparkline, Label3 as Label, LoadingTimeout, MarkdownEditor, NotificationCountBadge, NotificationItem, NotificationPanel, Popover, PopoverContent, PopoverTrigger, ProgressiveImage, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, SkeletonCircle, SkeletonGroup, SkeletonRect, Slider, Sparkline, Spinner, StackedBars, Switch, Table2 as Table, TableBody, TableCaption, TableCell2 as TableCell, TableFooter, TableHead, TableHeader2 as TableHeader, TableRow2 as TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeScript, ThemeToggle, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, applyKanbanFilter, buttonGroupVariants, celebrate, cn, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, median, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useTheme, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
|
11326
11387
|
//# sourceMappingURL=index.js.map
|
|
11327
11388
|
//# sourceMappingURL=index.js.map
|