hazo_ui 4.6.1 → 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/CHANGE_LOG.md +25 -0
- package/README.md +4 -0
- package/dist/index.cjs +298 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +154 -3
- package/dist/index.d.ts +154 -3
- package/dist/index.js +295 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -430,10 +430,16 @@ interface CanvasTextToolbarProps {
|
|
|
430
430
|
onUnderline?: () => void;
|
|
431
431
|
onColor?: (color: string) => void;
|
|
432
432
|
onAlign?: (align: "left" | "center" | "right") => void;
|
|
433
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
434
|
+
font?: string;
|
|
435
|
+
bullet?: boolean;
|
|
436
|
+
onVerticalAlign?: (v: "top" | "middle" | "bottom") => void;
|
|
437
|
+
onFont?: (font: string) => void;
|
|
438
|
+
onBullet?: () => void;
|
|
433
439
|
className?: string;
|
|
434
440
|
style?: React$1.CSSProperties;
|
|
435
441
|
}
|
|
436
|
-
declare function CanvasTextToolbar({ bold, italic, underline, color, align, onBold, onItalic, onUnderline, onColor, onAlign, className, style, }: CanvasTextToolbarProps): React$1.JSX.Element;
|
|
442
|
+
declare function CanvasTextToolbar({ bold, italic, underline, color, align, onBold, onItalic, onUnderline, onColor, onAlign, verticalAlign, font, bullet, onVerticalAlign, onFont, onBullet, className, style, }: CanvasTextToolbarProps): React$1.JSX.Element;
|
|
437
443
|
|
|
438
444
|
/** A toolbar button that inserts a snippet at the cursor. */
|
|
439
445
|
interface MarkdownEmbed {
|
|
@@ -917,6 +923,24 @@ interface HazoUiDialogProps {
|
|
|
917
923
|
actionButtonVariant?: ButtonVariant;
|
|
918
924
|
cancelButtonText?: string;
|
|
919
925
|
showCancelButton?: boolean;
|
|
926
|
+
/**
|
|
927
|
+
* Shows the action (confirm) button. Defaults to true.
|
|
928
|
+
* Set false to render a cancel-only footer, or combine with
|
|
929
|
+
* showCancelButton=false for a footer with no default buttons.
|
|
930
|
+
* Ignored if footerContent is provided.
|
|
931
|
+
*/
|
|
932
|
+
showActionButton?: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* When true, clicking the action button closes the dialog (calls
|
|
935
|
+
* onOpenChange(false)) after invoking onConfirm. Defaults to false so
|
|
936
|
+
* existing consumers keep controlling close themselves.
|
|
937
|
+
*
|
|
938
|
+
* Enables the common "acknowledge / Okay" pattern: pair with
|
|
939
|
+
* showCancelButton={false} and actionButtonText="Okay" for a single
|
|
940
|
+
* self-closing button.
|
|
941
|
+
* Ignored if footerContent is provided.
|
|
942
|
+
*/
|
|
943
|
+
closeOnConfirm?: boolean;
|
|
920
944
|
/**
|
|
921
945
|
* Shows a loading spinner and disables the action button.
|
|
922
946
|
* When true, renders a spinner icon before the action button text.
|
|
@@ -983,7 +1007,7 @@ interface HazoUiDialogProps {
|
|
|
983
1007
|
*
|
|
984
1008
|
* A flexible dialog component with standardized layout and customizable behavior
|
|
985
1009
|
*/
|
|
986
|
-
declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, fixedSize, compact, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): React$1.JSX.Element;
|
|
1010
|
+
declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, showActionButton, closeOnConfirm, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, fixedSize, compact, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): React$1.JSX.Element;
|
|
987
1011
|
|
|
988
1012
|
/**
|
|
989
1013
|
* hazo_ui_confirm_dialog/index.tsx
|
|
@@ -2496,4 +2520,131 @@ interface HazoUiEtaProgressProps {
|
|
|
2496
2520
|
*/
|
|
2497
2521
|
declare function HazoUiEtaProgress({ estimateKey, unitCount, concurrency, windowSize, fallbackUnitMs, level, label, endpoint, handleRef, className, }: HazoUiEtaProgressProps): React$1.JSX.Element;
|
|
2498
2522
|
|
|
2499
|
-
|
|
2523
|
+
/**
|
|
2524
|
+
* Pure list helpers for HazoUiMemoryDropdown history entries.
|
|
2525
|
+
* No React dependency — safe to import in unit tests without a DOM.
|
|
2526
|
+
*/
|
|
2527
|
+
/** A single history entry stored in hazo_state. */
|
|
2528
|
+
interface MemoryEntry {
|
|
2529
|
+
/** Stable unique identifier for the entry. */
|
|
2530
|
+
id: string;
|
|
2531
|
+
/** Human-readable label shown in the dropdown list. */
|
|
2532
|
+
label: string;
|
|
2533
|
+
/** Optional structured value associated with the entry. */
|
|
2534
|
+
value?: unknown;
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Upsert an entry into the list:
|
|
2538
|
+
* - If an entry with the same `id` already exists, replace it and move it to the front.
|
|
2539
|
+
* - Otherwise prepend it to the front.
|
|
2540
|
+
* - Enforces a maximum of {@link MAX_ENTRIES} entries — excess entries are dropped from the tail.
|
|
2541
|
+
*
|
|
2542
|
+
* @param entries - Current list.
|
|
2543
|
+
* @param entry - Entry to add or update.
|
|
2544
|
+
* @returns New list (original is not mutated).
|
|
2545
|
+
*/
|
|
2546
|
+
declare function upsertEntry(entries: MemoryEntry[], entry: MemoryEntry): MemoryEntry[];
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Props for {@link HazoUiMemoryDropdown}.
|
|
2550
|
+
*/
|
|
2551
|
+
interface HazoUiMemoryDropdownProps {
|
|
2552
|
+
/**
|
|
2553
|
+
* hazo_state key used to persist the history list, scoped to the current org.
|
|
2554
|
+
* Choose a key that is unique to the context where the dropdown is used.
|
|
2555
|
+
*/
|
|
2556
|
+
history_key: string;
|
|
2557
|
+
/** Placeholder text shown inside the search input. */
|
|
2558
|
+
placeholder?: string;
|
|
2559
|
+
/**
|
|
2560
|
+
* Called when the user clicks a history entry row (excluding the delete button).
|
|
2561
|
+
* The full entry object is passed so consumers can populate a form field.
|
|
2562
|
+
*/
|
|
2563
|
+
on_select: (entry: MemoryEntry) => void;
|
|
2564
|
+
/**
|
|
2565
|
+
* When non-null, upsert this entry into the persisted history list.
|
|
2566
|
+
* Typical usage: pass the just-confirmed selection here to record it.
|
|
2567
|
+
* Set to `null` (or omit) to skip any write.
|
|
2568
|
+
*/
|
|
2569
|
+
add_entry?: MemoryEntry | null;
|
|
2570
|
+
/**
|
|
2571
|
+
* Message shown when the filtered list is empty.
|
|
2572
|
+
* Defaults to `"No history yet"`.
|
|
2573
|
+
*/
|
|
2574
|
+
empty_label?: string;
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* A search-filtered history dropdown backed by hazo_state at the org level.
|
|
2578
|
+
*
|
|
2579
|
+
* Renders a search input and a scrollable list of previously used entries.
|
|
2580
|
+
* Entries are persisted per-org under `history_key`. Up to 50 entries are kept;
|
|
2581
|
+
* new entries are prepended (or promoted to front on repeat use).
|
|
2582
|
+
*
|
|
2583
|
+
* Usage:
|
|
2584
|
+
* ```tsx
|
|
2585
|
+
* <HazoUiMemoryDropdown
|
|
2586
|
+
* history_key="invoice_ref"
|
|
2587
|
+
* placeholder="Search past references..."
|
|
2588
|
+
* on_select={(entry) => setRef(entry.label)}
|
|
2589
|
+
* add_entry={confirmedEntry}
|
|
2590
|
+
* />
|
|
2591
|
+
* ```
|
|
2592
|
+
*/
|
|
2593
|
+
declare function HazoUiMemoryDropdown({ history_key, placeholder, on_select, add_entry, empty_label, }: HazoUiMemoryDropdownProps): React$1.JSX.Element;
|
|
2594
|
+
|
|
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
|
@@ -430,10 +430,16 @@ interface CanvasTextToolbarProps {
|
|
|
430
430
|
onUnderline?: () => void;
|
|
431
431
|
onColor?: (color: string) => void;
|
|
432
432
|
onAlign?: (align: "left" | "center" | "right") => void;
|
|
433
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
434
|
+
font?: string;
|
|
435
|
+
bullet?: boolean;
|
|
436
|
+
onVerticalAlign?: (v: "top" | "middle" | "bottom") => void;
|
|
437
|
+
onFont?: (font: string) => void;
|
|
438
|
+
onBullet?: () => void;
|
|
433
439
|
className?: string;
|
|
434
440
|
style?: React$1.CSSProperties;
|
|
435
441
|
}
|
|
436
|
-
declare function CanvasTextToolbar({ bold, italic, underline, color, align, onBold, onItalic, onUnderline, onColor, onAlign, className, style, }: CanvasTextToolbarProps): React$1.JSX.Element;
|
|
442
|
+
declare function CanvasTextToolbar({ bold, italic, underline, color, align, onBold, onItalic, onUnderline, onColor, onAlign, verticalAlign, font, bullet, onVerticalAlign, onFont, onBullet, className, style, }: CanvasTextToolbarProps): React$1.JSX.Element;
|
|
437
443
|
|
|
438
444
|
/** A toolbar button that inserts a snippet at the cursor. */
|
|
439
445
|
interface MarkdownEmbed {
|
|
@@ -917,6 +923,24 @@ interface HazoUiDialogProps {
|
|
|
917
923
|
actionButtonVariant?: ButtonVariant;
|
|
918
924
|
cancelButtonText?: string;
|
|
919
925
|
showCancelButton?: boolean;
|
|
926
|
+
/**
|
|
927
|
+
* Shows the action (confirm) button. Defaults to true.
|
|
928
|
+
* Set false to render a cancel-only footer, or combine with
|
|
929
|
+
* showCancelButton=false for a footer with no default buttons.
|
|
930
|
+
* Ignored if footerContent is provided.
|
|
931
|
+
*/
|
|
932
|
+
showActionButton?: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* When true, clicking the action button closes the dialog (calls
|
|
935
|
+
* onOpenChange(false)) after invoking onConfirm. Defaults to false so
|
|
936
|
+
* existing consumers keep controlling close themselves.
|
|
937
|
+
*
|
|
938
|
+
* Enables the common "acknowledge / Okay" pattern: pair with
|
|
939
|
+
* showCancelButton={false} and actionButtonText="Okay" for a single
|
|
940
|
+
* self-closing button.
|
|
941
|
+
* Ignored if footerContent is provided.
|
|
942
|
+
*/
|
|
943
|
+
closeOnConfirm?: boolean;
|
|
920
944
|
/**
|
|
921
945
|
* Shows a loading spinner and disables the action button.
|
|
922
946
|
* When true, renders a spinner icon before the action button text.
|
|
@@ -983,7 +1007,7 @@ interface HazoUiDialogProps {
|
|
|
983
1007
|
*
|
|
984
1008
|
* A flexible dialog component with standardized layout and customizable behavior
|
|
985
1009
|
*/
|
|
986
|
-
declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, fixedSize, compact, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): React$1.JSX.Element;
|
|
1010
|
+
declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, showActionButton, closeOnConfirm, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, fixedSize, compact, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): React$1.JSX.Element;
|
|
987
1011
|
|
|
988
1012
|
/**
|
|
989
1013
|
* hazo_ui_confirm_dialog/index.tsx
|
|
@@ -2496,4 +2520,131 @@ interface HazoUiEtaProgressProps {
|
|
|
2496
2520
|
*/
|
|
2497
2521
|
declare function HazoUiEtaProgress({ estimateKey, unitCount, concurrency, windowSize, fallbackUnitMs, level, label, endpoint, handleRef, className, }: HazoUiEtaProgressProps): React$1.JSX.Element;
|
|
2498
2522
|
|
|
2499
|
-
|
|
2523
|
+
/**
|
|
2524
|
+
* Pure list helpers for HazoUiMemoryDropdown history entries.
|
|
2525
|
+
* No React dependency — safe to import in unit tests without a DOM.
|
|
2526
|
+
*/
|
|
2527
|
+
/** A single history entry stored in hazo_state. */
|
|
2528
|
+
interface MemoryEntry {
|
|
2529
|
+
/** Stable unique identifier for the entry. */
|
|
2530
|
+
id: string;
|
|
2531
|
+
/** Human-readable label shown in the dropdown list. */
|
|
2532
|
+
label: string;
|
|
2533
|
+
/** Optional structured value associated with the entry. */
|
|
2534
|
+
value?: unknown;
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Upsert an entry into the list:
|
|
2538
|
+
* - If an entry with the same `id` already exists, replace it and move it to the front.
|
|
2539
|
+
* - Otherwise prepend it to the front.
|
|
2540
|
+
* - Enforces a maximum of {@link MAX_ENTRIES} entries — excess entries are dropped from the tail.
|
|
2541
|
+
*
|
|
2542
|
+
* @param entries - Current list.
|
|
2543
|
+
* @param entry - Entry to add or update.
|
|
2544
|
+
* @returns New list (original is not mutated).
|
|
2545
|
+
*/
|
|
2546
|
+
declare function upsertEntry(entries: MemoryEntry[], entry: MemoryEntry): MemoryEntry[];
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Props for {@link HazoUiMemoryDropdown}.
|
|
2550
|
+
*/
|
|
2551
|
+
interface HazoUiMemoryDropdownProps {
|
|
2552
|
+
/**
|
|
2553
|
+
* hazo_state key used to persist the history list, scoped to the current org.
|
|
2554
|
+
* Choose a key that is unique to the context where the dropdown is used.
|
|
2555
|
+
*/
|
|
2556
|
+
history_key: string;
|
|
2557
|
+
/** Placeholder text shown inside the search input. */
|
|
2558
|
+
placeholder?: string;
|
|
2559
|
+
/**
|
|
2560
|
+
* Called when the user clicks a history entry row (excluding the delete button).
|
|
2561
|
+
* The full entry object is passed so consumers can populate a form field.
|
|
2562
|
+
*/
|
|
2563
|
+
on_select: (entry: MemoryEntry) => void;
|
|
2564
|
+
/**
|
|
2565
|
+
* When non-null, upsert this entry into the persisted history list.
|
|
2566
|
+
* Typical usage: pass the just-confirmed selection here to record it.
|
|
2567
|
+
* Set to `null` (or omit) to skip any write.
|
|
2568
|
+
*/
|
|
2569
|
+
add_entry?: MemoryEntry | null;
|
|
2570
|
+
/**
|
|
2571
|
+
* Message shown when the filtered list is empty.
|
|
2572
|
+
* Defaults to `"No history yet"`.
|
|
2573
|
+
*/
|
|
2574
|
+
empty_label?: string;
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* A search-filtered history dropdown backed by hazo_state at the org level.
|
|
2578
|
+
*
|
|
2579
|
+
* Renders a search input and a scrollable list of previously used entries.
|
|
2580
|
+
* Entries are persisted per-org under `history_key`. Up to 50 entries are kept;
|
|
2581
|
+
* new entries are prepended (or promoted to front on repeat use).
|
|
2582
|
+
*
|
|
2583
|
+
* Usage:
|
|
2584
|
+
* ```tsx
|
|
2585
|
+
* <HazoUiMemoryDropdown
|
|
2586
|
+
* history_key="invoice_ref"
|
|
2587
|
+
* placeholder="Search past references..."
|
|
2588
|
+
* on_select={(entry) => setRef(entry.label)}
|
|
2589
|
+
* add_entry={confirmedEntry}
|
|
2590
|
+
* />
|
|
2591
|
+
* ```
|
|
2592
|
+
*/
|
|
2593
|
+
declare function HazoUiMemoryDropdown({ history_key, placeholder, on_select, add_entry, empty_label, }: HazoUiMemoryDropdownProps): React$1.JSX.Element;
|
|
2594
|
+
|
|
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 };
|