hazo_ui 2.17.0 → 3.0.1

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.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
+ import { RefObject } from 'react';
3
4
  import { Node, Extension } from '@tiptap/core';
4
5
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
6
  import * as vaul from 'vaul';
@@ -1179,6 +1180,152 @@ interface UseErrorDisplayResult {
1179
1180
  }
1180
1181
  declare function useErrorDisplay(): UseErrorDisplayResult;
1181
1182
 
1183
+ /**
1184
+ * Returns a debounced copy of `value`.
1185
+ * The returned value only updates after `delayMs` milliseconds have elapsed
1186
+ * with no new value. Useful for search inputs or any expensive effect that
1187
+ * should not run on every keystroke.
1188
+ *
1189
+ * @param value - The current value to debounce.
1190
+ * @param delayMs - Delay in milliseconds before the debounced value updates.
1191
+ * @returns The debounced value (same type as the input).
1192
+ *
1193
+ * @example
1194
+ * const [query, setQuery] = useState("");
1195
+ * const debouncedQuery = useDebounce(query, 300);
1196
+ * useEffect(() => { fetchResults(debouncedQuery); }, [debouncedQuery]);
1197
+ */
1198
+ declare function useDebounce<T>(value: T, delayMs: number): T;
1199
+
1200
+ interface UseCopyToClipboardResult {
1201
+ /** True for ~2 s after a successful copy; false otherwise. */
1202
+ copied: boolean;
1203
+ /**
1204
+ * Write `text` to the clipboard. Resolves silently on success.
1205
+ * In unsupported environments the promise resolves without throwing.
1206
+ */
1207
+ copy: (text: string) => Promise<void>;
1208
+ }
1209
+ /**
1210
+ * Clipboard write wrapper with a transient `copied` flag.
1211
+ *
1212
+ * @returns `{ copied, copy }` — call `copy(text)` to write to the clipboard.
1213
+ * `copied` is `true` for 2 seconds after a successful write.
1214
+ *
1215
+ * @example
1216
+ * const { copied, copy } = useCopyToClipboard();
1217
+ * <button onClick={() => copy("hello")}>{copied ? "Copied!" : "Copy"}</button>
1218
+ */
1219
+ declare function useCopyToClipboard(): UseCopyToClipboardResult;
1220
+
1221
+ /**
1222
+ * Returns `true` when the viewport width is narrower than `breakpointPx`.
1223
+ * Re-renders when the match state changes. SSR-safe (returns `false` on server).
1224
+ *
1225
+ * @param breakpointPx - Pixel threshold for "mobile". Defaults to 768 px.
1226
+ *
1227
+ * @example
1228
+ * const isMobile = useIsMobile();
1229
+ * const isTablet = useIsMobile(1024);
1230
+ */
1231
+ declare function useIsMobile(breakpointPx?: number): boolean;
1232
+ /**
1233
+ * Alias for `useIsMobile` — accepts a breakpoint in pixels.
1234
+ * Provided for consumers who prefer the `useViewport` name.
1235
+ *
1236
+ * @param breakpoint - Pixel threshold (same semantics as `useIsMobile`). Defaults to 768 px.
1237
+ */
1238
+ declare function useViewport(breakpoint?: number): boolean;
1239
+
1240
+ /**
1241
+ * localStorage-backed state hook.
1242
+ * The stored value is JSON-serialised; parse errors fall back to `initialValue`.
1243
+ *
1244
+ * @param key - localStorage key.
1245
+ * @param initialValue - Value used when no stored entry exists or on SSR.
1246
+ * @returns `[storedValue, setValue]` — same API as `useState`.
1247
+ *
1248
+ * @example
1249
+ * const [theme, setTheme] = useLocalStorage<"light" | "dark">("theme", "light");
1250
+ */
1251
+ declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void];
1252
+
1253
+ /**
1254
+ * sessionStorage-backed state hook.
1255
+ * The stored value is JSON-serialised; parse errors fall back to `initialValue`.
1256
+ *
1257
+ * @param key - sessionStorage key.
1258
+ * @param initialValue - Value used when no stored entry exists or on SSR.
1259
+ * @returns `[storedValue, setValue]` — same API as `useState`.
1260
+ *
1261
+ * @example
1262
+ * const [draft, setDraft] = useSessionStorage("form_draft", "");
1263
+ */
1264
+ declare function useSessionStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void];
1265
+
1266
+ /**
1267
+ * Fires `handler` when the user clicks (or taps) outside the element bound to `ref`.
1268
+ * Attaches a `mousedown` listener on `document`; cleans up on unmount or dependency change.
1269
+ *
1270
+ * @param ref - React ref pointing to the element to watch.
1271
+ * @param handler - Callback invoked when a click outside is detected.
1272
+ *
1273
+ * @example
1274
+ * const panel_ref = useRef<HTMLDivElement>(null);
1275
+ * useClickOutside(panel_ref, () => setOpen(false));
1276
+ * return <div ref={panel_ref}>...</div>;
1277
+ */
1278
+ declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, handler: () => void): void;
1279
+
1280
+ interface UseWakeLockResult {
1281
+ /** True when the Wake Lock API is available in this environment. */
1282
+ supported: boolean;
1283
+ /** True when a wake lock is currently held. */
1284
+ acquired: boolean;
1285
+ /** Request the screen wake lock. No-op if unsupported or already acquired. */
1286
+ request: () => Promise<void>;
1287
+ /** Release the currently held wake lock. No-op if not acquired. */
1288
+ release: () => Promise<void>;
1289
+ }
1290
+ /**
1291
+ * Web Wake Lock API wrapper. Prevents screen sleep while the lock is held.
1292
+ * Automatically reacquires the lock when the page becomes visible again
1293
+ * (e.g. after switching tabs), because the browser releases it on visibility change.
1294
+ *
1295
+ * Returns `supported: false` in environments that don't implement the API
1296
+ * (SSR, older browsers) — all other operations are no-ops in that case.
1297
+ *
1298
+ * @example
1299
+ * const { supported, acquired, request, release } = useWakeLock();
1300
+ * <button onClick={acquired ? release : request}>
1301
+ * {acquired ? "Release lock" : "Keep screen on"}
1302
+ * </button>
1303
+ */
1304
+ declare function useWakeLock(): UseWakeLockResult;
1305
+
1306
+ interface UseFullscreenResult {
1307
+ /** True when the targeted element (or document) is currently fullscreen. */
1308
+ isFullscreen: boolean;
1309
+ /** Request fullscreen. No-op if already fullscreen or unsupported. */
1310
+ enter: () => Promise<void>;
1311
+ /** Exit fullscreen. No-op if not fullscreen or unsupported. */
1312
+ exit: () => Promise<void>;
1313
+ /** Toggle between fullscreen and normal. */
1314
+ toggle: () => Promise<void>;
1315
+ }
1316
+ /**
1317
+ * Fullscreen API wrapper.
1318
+ *
1319
+ * @param elementRef - Optional ref to the element to fullscreen.
1320
+ * Defaults to `document.documentElement` when omitted.
1321
+ *
1322
+ * @example
1323
+ * const container_ref = useRef<HTMLDivElement>(null);
1324
+ * const { isFullscreen, toggle } = useFullscreen(container_ref);
1325
+ * return <div ref={container_ref}><button onClick={toggle}>Fullscreen</button></div>;
1326
+ */
1327
+ declare function useFullscreen(elementRef?: RefObject<HTMLElement | null>): UseFullscreenResult;
1328
+
1182
1329
  /**
1183
1330
  * Types for HazoUiKanban - Drag-Drop Kanban
1184
1331
  *
@@ -1735,4 +1882,54 @@ declare function format_num(n: number | null | undefined | string): string;
1735
1882
  */
1736
1883
  declare function pick_x_label_indices(length: number): [number, number, number];
1737
1884
 
1738
- 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, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, 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 FilterConfig, type FilterField, 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, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, 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, 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, LineChart, type LineChartProps, LoadingTimeout, type LoadingTimeoutProps, MultiLineChart, type MultiLineChartProps, type MultiSeries, 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, 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 ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseErrorDisplayResult, type UseLoadingStateResult, applyKanbanFilter, buttonGroupVariants, create_command_suggestion_extension, errorToast, format_num, get_hazo_ui_config, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, successToast, text_to_tiptap_content, toggleVariants, useErrorDisplay, useLoadingState, useMediaQuery };
1885
+ /** Default gradient for the shareable card background. Override via shareableCard.background. */
1886
+ declare const CELEBRATION_GRADIENT = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
1887
+ interface CelebrationShareableCard {
1888
+ /**
1889
+ * CSS background value applied to the 1080×1080 card.
1890
+ * Default: CELEBRATION_GRADIENT.
1891
+ */
1892
+ background?: string;
1893
+ /** ReactNode rendered at full 1080×1080 size (scaled down for preview). */
1894
+ foreground: React.ReactNode;
1895
+ /**
1896
+ * Caption at the bottom of the card.
1897
+ * Falls back to the top-level subtitle when omitted.
1898
+ */
1899
+ caption?: string;
1900
+ }
1901
+ interface CelebrationPayload {
1902
+ /**
1903
+ * Unique identifier. Also the sessionStorage dedup key:
1904
+ * hazo_ui_celebration_<id> = "1" once shown.
1905
+ */
1906
+ id: string;
1907
+ title: string;
1908
+ subtitle?: string;
1909
+ shareableCard?: CelebrationShareableCard;
1910
+ /** Auto-dismiss the modal after autoDismissDelay ms. Default true. */
1911
+ autoDismiss?: boolean;
1912
+ /**
1913
+ * Duration in ms before auto-dismiss. Default 8000.
1914
+ * Set to a short value (e.g. 100) in tests.
1915
+ */
1916
+ autoDismissDelay?: number;
1917
+ /** Play the bundled success chime when the modal opens. Default false. */
1918
+ audioChime?: boolean;
1919
+ }
1920
+ /**
1921
+ * Fire a celebration modal from anywhere in the tree.
1922
+ * No-ops when <CelebrationProvider /> is not mounted or the id was already
1923
+ * shown this session.
1924
+ */
1925
+ declare function celebrate(payload: CelebrationPayload): void;
1926
+ interface CelebrationProviderProps {
1927
+ children: React.ReactNode;
1928
+ }
1929
+ /**
1930
+ * Mount once near the root of your app (e.g. (app)/layout.tsx).
1931
+ * Renders the current celebration modal and manages the FIFO queue.
1932
+ */
1933
+ declare function CelebrationProvider({ children }: CelebrationProviderProps): react_jsx_runtime.JSX.Element;
1934
+
1935
+ 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, 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 FilterConfig, type FilterField, 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, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, 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, 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, LineChart, type LineChartProps, LoadingTimeout, type LoadingTimeoutProps, MultiLineChart, type MultiLineChartProps, type MultiSeries, 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, 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 ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseFullscreenResult, type UseLoadingStateResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, create_command_suggestion_extension, errorToast, format_num, get_hazo_ui_config, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, successToast, text_to_tiptap_content, toggleVariants, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useViewport, useWakeLock };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
+ import { RefObject } from 'react';
3
4
  import { Node, Extension } from '@tiptap/core';
4
5
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
6
  import * as vaul from 'vaul';
@@ -1179,6 +1180,152 @@ interface UseErrorDisplayResult {
1179
1180
  }
1180
1181
  declare function useErrorDisplay(): UseErrorDisplayResult;
1181
1182
 
1183
+ /**
1184
+ * Returns a debounced copy of `value`.
1185
+ * The returned value only updates after `delayMs` milliseconds have elapsed
1186
+ * with no new value. Useful for search inputs or any expensive effect that
1187
+ * should not run on every keystroke.
1188
+ *
1189
+ * @param value - The current value to debounce.
1190
+ * @param delayMs - Delay in milliseconds before the debounced value updates.
1191
+ * @returns The debounced value (same type as the input).
1192
+ *
1193
+ * @example
1194
+ * const [query, setQuery] = useState("");
1195
+ * const debouncedQuery = useDebounce(query, 300);
1196
+ * useEffect(() => { fetchResults(debouncedQuery); }, [debouncedQuery]);
1197
+ */
1198
+ declare function useDebounce<T>(value: T, delayMs: number): T;
1199
+
1200
+ interface UseCopyToClipboardResult {
1201
+ /** True for ~2 s after a successful copy; false otherwise. */
1202
+ copied: boolean;
1203
+ /**
1204
+ * Write `text` to the clipboard. Resolves silently on success.
1205
+ * In unsupported environments the promise resolves without throwing.
1206
+ */
1207
+ copy: (text: string) => Promise<void>;
1208
+ }
1209
+ /**
1210
+ * Clipboard write wrapper with a transient `copied` flag.
1211
+ *
1212
+ * @returns `{ copied, copy }` — call `copy(text)` to write to the clipboard.
1213
+ * `copied` is `true` for 2 seconds after a successful write.
1214
+ *
1215
+ * @example
1216
+ * const { copied, copy } = useCopyToClipboard();
1217
+ * <button onClick={() => copy("hello")}>{copied ? "Copied!" : "Copy"}</button>
1218
+ */
1219
+ declare function useCopyToClipboard(): UseCopyToClipboardResult;
1220
+
1221
+ /**
1222
+ * Returns `true` when the viewport width is narrower than `breakpointPx`.
1223
+ * Re-renders when the match state changes. SSR-safe (returns `false` on server).
1224
+ *
1225
+ * @param breakpointPx - Pixel threshold for "mobile". Defaults to 768 px.
1226
+ *
1227
+ * @example
1228
+ * const isMobile = useIsMobile();
1229
+ * const isTablet = useIsMobile(1024);
1230
+ */
1231
+ declare function useIsMobile(breakpointPx?: number): boolean;
1232
+ /**
1233
+ * Alias for `useIsMobile` — accepts a breakpoint in pixels.
1234
+ * Provided for consumers who prefer the `useViewport` name.
1235
+ *
1236
+ * @param breakpoint - Pixel threshold (same semantics as `useIsMobile`). Defaults to 768 px.
1237
+ */
1238
+ declare function useViewport(breakpoint?: number): boolean;
1239
+
1240
+ /**
1241
+ * localStorage-backed state hook.
1242
+ * The stored value is JSON-serialised; parse errors fall back to `initialValue`.
1243
+ *
1244
+ * @param key - localStorage key.
1245
+ * @param initialValue - Value used when no stored entry exists or on SSR.
1246
+ * @returns `[storedValue, setValue]` — same API as `useState`.
1247
+ *
1248
+ * @example
1249
+ * const [theme, setTheme] = useLocalStorage<"light" | "dark">("theme", "light");
1250
+ */
1251
+ declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void];
1252
+
1253
+ /**
1254
+ * sessionStorage-backed state hook.
1255
+ * The stored value is JSON-serialised; parse errors fall back to `initialValue`.
1256
+ *
1257
+ * @param key - sessionStorage key.
1258
+ * @param initialValue - Value used when no stored entry exists or on SSR.
1259
+ * @returns `[storedValue, setValue]` — same API as `useState`.
1260
+ *
1261
+ * @example
1262
+ * const [draft, setDraft] = useSessionStorage("form_draft", "");
1263
+ */
1264
+ declare function useSessionStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void];
1265
+
1266
+ /**
1267
+ * Fires `handler` when the user clicks (or taps) outside the element bound to `ref`.
1268
+ * Attaches a `mousedown` listener on `document`; cleans up on unmount or dependency change.
1269
+ *
1270
+ * @param ref - React ref pointing to the element to watch.
1271
+ * @param handler - Callback invoked when a click outside is detected.
1272
+ *
1273
+ * @example
1274
+ * const panel_ref = useRef<HTMLDivElement>(null);
1275
+ * useClickOutside(panel_ref, () => setOpen(false));
1276
+ * return <div ref={panel_ref}>...</div>;
1277
+ */
1278
+ declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, handler: () => void): void;
1279
+
1280
+ interface UseWakeLockResult {
1281
+ /** True when the Wake Lock API is available in this environment. */
1282
+ supported: boolean;
1283
+ /** True when a wake lock is currently held. */
1284
+ acquired: boolean;
1285
+ /** Request the screen wake lock. No-op if unsupported or already acquired. */
1286
+ request: () => Promise<void>;
1287
+ /** Release the currently held wake lock. No-op if not acquired. */
1288
+ release: () => Promise<void>;
1289
+ }
1290
+ /**
1291
+ * Web Wake Lock API wrapper. Prevents screen sleep while the lock is held.
1292
+ * Automatically reacquires the lock when the page becomes visible again
1293
+ * (e.g. after switching tabs), because the browser releases it on visibility change.
1294
+ *
1295
+ * Returns `supported: false` in environments that don't implement the API
1296
+ * (SSR, older browsers) — all other operations are no-ops in that case.
1297
+ *
1298
+ * @example
1299
+ * const { supported, acquired, request, release } = useWakeLock();
1300
+ * <button onClick={acquired ? release : request}>
1301
+ * {acquired ? "Release lock" : "Keep screen on"}
1302
+ * </button>
1303
+ */
1304
+ declare function useWakeLock(): UseWakeLockResult;
1305
+
1306
+ interface UseFullscreenResult {
1307
+ /** True when the targeted element (or document) is currently fullscreen. */
1308
+ isFullscreen: boolean;
1309
+ /** Request fullscreen. No-op if already fullscreen or unsupported. */
1310
+ enter: () => Promise<void>;
1311
+ /** Exit fullscreen. No-op if not fullscreen or unsupported. */
1312
+ exit: () => Promise<void>;
1313
+ /** Toggle between fullscreen and normal. */
1314
+ toggle: () => Promise<void>;
1315
+ }
1316
+ /**
1317
+ * Fullscreen API wrapper.
1318
+ *
1319
+ * @param elementRef - Optional ref to the element to fullscreen.
1320
+ * Defaults to `document.documentElement` when omitted.
1321
+ *
1322
+ * @example
1323
+ * const container_ref = useRef<HTMLDivElement>(null);
1324
+ * const { isFullscreen, toggle } = useFullscreen(container_ref);
1325
+ * return <div ref={container_ref}><button onClick={toggle}>Fullscreen</button></div>;
1326
+ */
1327
+ declare function useFullscreen(elementRef?: RefObject<HTMLElement | null>): UseFullscreenResult;
1328
+
1182
1329
  /**
1183
1330
  * Types for HazoUiKanban - Drag-Drop Kanban
1184
1331
  *
@@ -1735,4 +1882,54 @@ declare function format_num(n: number | null | undefined | string): string;
1735
1882
  */
1736
1883
  declare function pick_x_label_indices(length: number): [number, number, number];
1737
1884
 
1738
- 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, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, 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 FilterConfig, type FilterField, 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, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, 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, 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, LineChart, type LineChartProps, LoadingTimeout, type LoadingTimeoutProps, MultiLineChart, type MultiLineChartProps, type MultiSeries, 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, 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 ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseErrorDisplayResult, type UseLoadingStateResult, applyKanbanFilter, buttonGroupVariants, create_command_suggestion_extension, errorToast, format_num, get_hazo_ui_config, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, successToast, text_to_tiptap_content, toggleVariants, useErrorDisplay, useLoadingState, useMediaQuery };
1885
+ /** Default gradient for the shareable card background. Override via shareableCard.background. */
1886
+ declare const CELEBRATION_GRADIENT = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
1887
+ interface CelebrationShareableCard {
1888
+ /**
1889
+ * CSS background value applied to the 1080×1080 card.
1890
+ * Default: CELEBRATION_GRADIENT.
1891
+ */
1892
+ background?: string;
1893
+ /** ReactNode rendered at full 1080×1080 size (scaled down for preview). */
1894
+ foreground: React.ReactNode;
1895
+ /**
1896
+ * Caption at the bottom of the card.
1897
+ * Falls back to the top-level subtitle when omitted.
1898
+ */
1899
+ caption?: string;
1900
+ }
1901
+ interface CelebrationPayload {
1902
+ /**
1903
+ * Unique identifier. Also the sessionStorage dedup key:
1904
+ * hazo_ui_celebration_<id> = "1" once shown.
1905
+ */
1906
+ id: string;
1907
+ title: string;
1908
+ subtitle?: string;
1909
+ shareableCard?: CelebrationShareableCard;
1910
+ /** Auto-dismiss the modal after autoDismissDelay ms. Default true. */
1911
+ autoDismiss?: boolean;
1912
+ /**
1913
+ * Duration in ms before auto-dismiss. Default 8000.
1914
+ * Set to a short value (e.g. 100) in tests.
1915
+ */
1916
+ autoDismissDelay?: number;
1917
+ /** Play the bundled success chime when the modal opens. Default false. */
1918
+ audioChime?: boolean;
1919
+ }
1920
+ /**
1921
+ * Fire a celebration modal from anywhere in the tree.
1922
+ * No-ops when <CelebrationProvider /> is not mounted or the id was already
1923
+ * shown this session.
1924
+ */
1925
+ declare function celebrate(payload: CelebrationPayload): void;
1926
+ interface CelebrationProviderProps {
1927
+ children: React.ReactNode;
1928
+ }
1929
+ /**
1930
+ * Mount once near the root of your app (e.g. (app)/layout.tsx).
1931
+ * Renders the current celebration modal and manages the FIFO queue.
1932
+ */
1933
+ declare function CelebrationProvider({ children }: CelebrationProviderProps): react_jsx_runtime.JSX.Element;
1934
+
1935
+ 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, 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 FilterConfig, type FilterField, 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, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, 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, 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, LineChart, type LineChartProps, LoadingTimeout, type LoadingTimeoutProps, MultiLineChart, type MultiLineChartProps, type MultiSeries, 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, 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 ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseFullscreenResult, type UseLoadingStateResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, create_command_suggestion_extension, errorToast, format_num, get_hazo_ui_config, parse_commands_from_text, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, successToast, text_to_tiptap_content, toggleVariants, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useMediaQuery, useSessionStorage, useViewport, useWakeLock };