hazo_ui 2.11.0 → 2.17.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.d.cts CHANGED
@@ -1179,4 +1179,560 @@ interface UseErrorDisplayResult {
1179
1179
  }
1180
1180
  declare function useErrorDisplay(): UseErrorDisplayResult;
1181
1181
 
1182
- 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, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, 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, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiRte, type HazoUiRteProps, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, type InsertedCommand, Label, LoadingTimeout, type LoadingTimeoutProps, 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, Spinner, type SuggestionState, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseErrorDisplayResult, type UseLoadingStateResult, buttonGroupVariants, create_command_suggestion_extension, errorToast, get_hazo_ui_config, parse_commands_from_text, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, successToast, text_to_tiptap_content, toggleVariants, useErrorDisplay, useLoadingState, useMediaQuery };
1182
+ /**
1183
+ * Types for HazoUiKanban - Drag-Drop Kanban
1184
+ *
1185
+ * Public type surface for the kanban components. No @dnd-kit types leak here;
1186
+ * consumers see only HazoUi* shapes.
1187
+ */
1188
+
1189
+ /**
1190
+ * Priority levels drive the left-border tint. P0..P3 ship with default colors;
1191
+ * any other string is allowed if the consumer defines a custom CSS variable
1192
+ * (e.g. priority "critical" → --hazo-kanban-priority-critical).
1193
+ */
1194
+ type KanbanPriority = "P0" | "P1" | "P2" | "P3" | string;
1195
+ /**
1196
+ * Minimal item shape required by the board. Consumers extend this with their
1197
+ * own payload fields (title, category, etc.).
1198
+ */
1199
+ interface KanbanItem {
1200
+ id: string;
1201
+ columnKey: string;
1202
+ priority?: KanbanPriority;
1203
+ }
1204
+ /**
1205
+ * Column descriptor passed to the board.
1206
+ */
1207
+ interface KanbanColumn {
1208
+ key: string;
1209
+ title: string;
1210
+ /** Optional gate: returning false rejects an incoming drop. */
1211
+ accepts?: (item: KanbanItem) => boolean;
1212
+ }
1213
+ /**
1214
+ * Handle attached to move/reorder events. Calling revert() removes the
1215
+ * library's optimistic overlay entry, snapping the visible state back to
1216
+ * whatever the consumer's `items` prop currently says.
1217
+ */
1218
+ interface KanbanMoveHandle {
1219
+ revert: () => void;
1220
+ }
1221
+ /**
1222
+ * Fired when a card is dropped into a different column.
1223
+ */
1224
+ type KanbanMoveEvent<T extends KanbanItem = KanbanItem> = {
1225
+ itemId: string;
1226
+ item: T;
1227
+ fromColumn: string;
1228
+ toColumn: string;
1229
+ newIndex: number;
1230
+ } & KanbanMoveHandle;
1231
+ /**
1232
+ * Fired when a card is reordered within the same column.
1233
+ */
1234
+ type KanbanReorderEvent<T extends KanbanItem = KanbanItem> = {
1235
+ itemId: string;
1236
+ item: T;
1237
+ columnKey: string;
1238
+ newIndex: number;
1239
+ } & KanbanMoveHandle;
1240
+ /**
1241
+ * Screen-reader announcement strings produced from drag lifecycle events.
1242
+ * Defaults are provided; consumers can pass a partial override.
1243
+ */
1244
+ interface KanbanAnnouncements {
1245
+ onDragStart: (ctx: {
1246
+ item: KanbanItem;
1247
+ fromColumn: string;
1248
+ }) => string;
1249
+ onDragOver: (ctx: {
1250
+ item: KanbanItem;
1251
+ overColumn: string | null;
1252
+ }) => string;
1253
+ onDragEnd: (ctx: {
1254
+ item: KanbanItem;
1255
+ fromColumn: string;
1256
+ toColumn: string;
1257
+ newIndex: number;
1258
+ }) => string;
1259
+ onDragCancel: (ctx: {
1260
+ item: KanbanItem;
1261
+ fromColumn: string;
1262
+ }) => string;
1263
+ }
1264
+ /**
1265
+ * Props for HazoUiKanban.
1266
+ */
1267
+ interface HazoUiKanbanProps<T extends KanbanItem = KanbanItem> {
1268
+ columns: KanbanColumn[];
1269
+ items: T[];
1270
+ renderCard: (item: T) => React.ReactNode;
1271
+ onMove?: (event: KanbanMoveEvent<T>) => void;
1272
+ onReorder?: (event: KanbanReorderEvent<T>) => void;
1273
+ /** Default 640 (Tailwind sm). Below this width the board collapses to tabs. */
1274
+ mobileBreakpoint?: number;
1275
+ /** Override default screen-reader messages. Partial — unset keys use defaults. */
1276
+ announcements?: Partial<KanbanAnnouncements>;
1277
+ /** Rendered when a column has zero items. Default: muted "—" placeholder. */
1278
+ emptyColumn?: React.ReactNode;
1279
+ /** Class on the board root. */
1280
+ className?: string;
1281
+ /** Class on each card shell (the wrapper around renderCard output). */
1282
+ cardClassName?: string;
1283
+ /**
1284
+ * Optional accessor for the announcement label of an item.
1285
+ * Defaults to item.id if not provided.
1286
+ */
1287
+ itemLabel?: (item: T) => string;
1288
+ /**
1289
+ * Declarative field schema for the default editor. If omitted, the
1290
+ * editor auto-detects all string-typed fields on the item except `id`,
1291
+ * `columnKey`, and `priority`, rendering each as a text input.
1292
+ */
1293
+ editorFields?: KanbanEditorField[];
1294
+ /**
1295
+ * Pool of priorities used when a field has `type: 'priority'`.
1296
+ * Defaults to ["P0","P1","P2","P3"].
1297
+ */
1298
+ editorPriorities?: KanbanPriority[];
1299
+ /**
1300
+ * Dialog title. Defaults to `Edit ${item.id}`.
1301
+ */
1302
+ editorTitle?: (item: T) => string;
1303
+ /**
1304
+ * Override the body of the editor dialog. The library still renders the
1305
+ * Dialog wrapper, title, and (by default) the Cancel/Save footer.
1306
+ */
1307
+ renderCardEditor?: (item: T, ctx: KanbanEditorCtx<T>) => React.ReactNode;
1308
+ /**
1309
+ * Suppress the library's default Cancel/Save footer. Only honored when
1310
+ * renderCardEditor is also provided — in default mode there is no
1311
+ * alternate way to trigger save, so the footer always renders.
1312
+ */
1313
+ hideEditorFooter?: boolean;
1314
+ /**
1315
+ * Fired when the user clicks Save. Consumer is responsible for
1316
+ * persisting and (on success) updating `items`. Returning a Promise
1317
+ * gates the dialog close and shows a spinner on Save; rejecting the
1318
+ * Promise keeps the dialog open with the error rendered.
1319
+ */
1320
+ onCardSave?: (event: KanbanSaveEvent<T>) => void | Promise<void>;
1321
+ /**
1322
+ * Hide the edit pencil entirely (read-only board). The pencil is also
1323
+ * automatically hidden when onCardSave is not provided.
1324
+ */
1325
+ disableEdit?: boolean;
1326
+ }
1327
+ /**
1328
+ * Filter shape consumed by HazoUiKanbanFilter and applyKanbanFilter.
1329
+ */
1330
+ interface KanbanFilterValue {
1331
+ search: string;
1332
+ categories: string[];
1333
+ priority: KanbanPriority | null;
1334
+ }
1335
+ /**
1336
+ * Props for HazoUiKanbanFilter.
1337
+ */
1338
+ interface HazoUiKanbanFilterProps {
1339
+ /** Show the search input. Default true. */
1340
+ search?: boolean;
1341
+ /** Search input placeholder. Default "Search...". */
1342
+ searchPlaceholder?: string;
1343
+ /** Categories rendered as multi-select chips. Hidden when omitted/empty. */
1344
+ categories?: string[];
1345
+ /** Priority chips (single-select). Hidden when omitted/empty. */
1346
+ priorities?: KanbanPriority[];
1347
+ /** Controlled value. */
1348
+ value?: KanbanFilterValue;
1349
+ /** Default value for uncontrolled usage. */
1350
+ defaultValue?: KanbanFilterValue;
1351
+ /** Called whenever any filter field changes. */
1352
+ onChange?: (value: KanbanFilterValue) => void;
1353
+ /** Class on the filter root. */
1354
+ className?: string;
1355
+ }
1356
+ /**
1357
+ * Built-in field types the default editor knows how to render.
1358
+ * `priority` renders a Select pre-populated from HazoUiKanban's
1359
+ * `editorPriorities` prop (defaulting to ["P0","P1","P2","P3"]).
1360
+ * `status` renders a Select pre-populated from HazoUiKanban's `columns`
1361
+ * prop (using each column's `title` as the option label and `key` as the
1362
+ * value). Bound to `columnKey` by convention — saving with a different
1363
+ * status moves the card to a new column through the consumer's
1364
+ * onCardSave handler.
1365
+ */
1366
+ type KanbanEditorFieldType = "text" | "textarea" | "select" | "number" | "checkbox" | "priority" | "status";
1367
+ /**
1368
+ * Declarative field config for the default editor. One per editable key.
1369
+ */
1370
+ interface KanbanEditorField {
1371
+ /** Top-level string key on the item being edited. */
1372
+ key: string;
1373
+ /** Display label. Defaults to a humanized version of `key`. */
1374
+ label?: string;
1375
+ type: KanbanEditorFieldType;
1376
+ /** Options list for `type: 'select'`. Ignored otherwise. */
1377
+ options?: string[];
1378
+ /** Placeholder for `type: 'text' | 'textarea' | 'number' | 'select' | 'priority'`. */
1379
+ placeholder?: string;
1380
+ /**
1381
+ * If true, the field shows a `*` marker on its label and Save is disabled
1382
+ * when empty. Only honored for text / textarea / number; ignored for
1383
+ * select / priority / checkbox (those types are never "empty").
1384
+ */
1385
+ required?: boolean;
1386
+ }
1387
+ /**
1388
+ * Context passed to renderCardEditor render-prop. The library owns the
1389
+ * dialog open/close lifecycle; the consumer reads and writes the draft
1390
+ * through this handle and calls save()/close() to drive the lifecycle.
1391
+ */
1392
+ interface KanbanEditorCtx<T extends KanbanItem = KanbanItem> {
1393
+ /** Current draft. Mutated as the user types. */
1394
+ draft: T;
1395
+ /** Update the draft. Accepts a value or an updater function. */
1396
+ setDraft: (next: T | ((prev: T) => T)) => void;
1397
+ /** Trigger the save lifecycle: validates required fields, calls onCardSave. */
1398
+ save: () => Promise<void>;
1399
+ /** Dismiss the dialog without saving. */
1400
+ close: () => void;
1401
+ /** True while onCardSave's returned promise is pending. */
1402
+ saving: boolean;
1403
+ /** Last save error message, or null. Cleared at the start of each save attempt. */
1404
+ error: string | null;
1405
+ /** True when JSON.stringify(draft) !== JSON.stringify(item). */
1406
+ isDirty: boolean;
1407
+ }
1408
+ /**
1409
+ * Fired when the user clicks Save (or the consumer's renderCardEditor
1410
+ * calls ctx.save()).
1411
+ */
1412
+ interface KanbanSaveEvent<T extends KanbanItem = KanbanItem> {
1413
+ itemId: string;
1414
+ /** Original item before edits. */
1415
+ item: T;
1416
+ /** New item with the user's edits applied. */
1417
+ next: T;
1418
+ }
1419
+
1420
+ declare function HazoUiKanbanFilter({ search, searchPlaceholder, categories, priorities, value, defaultValue, onChange, className, }: HazoUiKanbanFilterProps): react_jsx_runtime.JSX.Element;
1421
+
1422
+ /**
1423
+ * Pure helper: filters KanbanItem[] by search / categories / priority.
1424
+ *
1425
+ * - search: case-insensitive substring against any string-typed field of the item.
1426
+ * - categories: keep items whose item.category (string) is in the list.
1427
+ * - priority: exact equality on item.priority.
1428
+ *
1429
+ * Consumers needing different filter logic should write their own — this is
1430
+ * a convenience export, not the public contract for filtering.
1431
+ */
1432
+
1433
+ declare function applyKanbanFilter<T extends KanbanItem>(items: T[], filter: KanbanFilterValue): T[];
1434
+
1435
+ declare function HazoUiKanban<T extends KanbanItem = KanbanItem>({ columns, items, renderCard, onMove, onReorder, mobileBreakpoint, announcements, emptyColumn, className, cardClassName, itemLabel, editorFields, editorPriorities, editorTitle, renderCardEditor, hideEditorFooter, onCardSave, disableEdit, }: HazoUiKanbanProps<T>): react_jsx_runtime.JSX.Element;
1436
+
1437
+ declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
1438
+ declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
1439
+ declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
1440
+ declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
1441
+ declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
1442
+ declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
1443
+ declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
1444
+ declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
1445
+
1446
+ /**
1447
+ * HazoUiTable — public types.
1448
+ *
1449
+ * The `TableColumn` is the single source of truth: it carries display,
1450
+ * sort, filter, and search metadata. From it the component derives the
1451
+ * `availableFields` arrays for the existing HazoUiMultiSortDialog and
1452
+ * HazoUiMultiFilterDialog.
1453
+ */
1454
+
1455
+ type SortDir = "asc" | "desc";
1456
+ interface TableSortEntry {
1457
+ key: string;
1458
+ dir: SortDir;
1459
+ }
1460
+ type TableSort = TableSortEntry[];
1461
+ /** Public prop shape — accepts single entry, array, or null; normalized to array internally. */
1462
+ type TableSortProp = TableSortEntry | TableSort | null;
1463
+ interface TableFilter {
1464
+ search?: string;
1465
+ fields?: FilterConfig[];
1466
+ }
1467
+ type TableFormatter = "date" | "number" | "currency" | "percent";
1468
+ interface TableColumn<TRow extends object = any> {
1469
+ key: keyof TRow & string;
1470
+ label: string;
1471
+ sortable?: boolean;
1472
+ cell?: (row: TRow, index: number) => React.ReactNode;
1473
+ formatter?: TableFormatter;
1474
+ /** ISO-4217 currency code used when `formatter` is "currency". Defaults to "USD". */
1475
+ currency?: string;
1476
+ /**
1477
+ * BCP-47 locale tag for the `number`, `currency`, and `percent`
1478
+ * formatters. Defaults to `"en-US"` (matches across SSR + CSR).
1479
+ * Set explicitly to override per column (e.g. `"de-DE"`, `"ja-JP"`).
1480
+ */
1481
+ locale?: string;
1482
+ align?: "left" | "right" | "center";
1483
+ className?: string;
1484
+ headerClassName?: string;
1485
+ filterType?: FilterField["type"];
1486
+ filterConfig?: Pick<FilterField, "textConfig" | "numberConfig" | "comboboxOptions" | "booleanLabels">;
1487
+ searchable?: boolean;
1488
+ }
1489
+ interface HazoUiTablePagination {
1490
+ pageSize: number;
1491
+ }
1492
+ interface HazoUiTableServerLoadArgs {
1493
+ page: number;
1494
+ sort: TableSort;
1495
+ filter: TableFilter;
1496
+ }
1497
+ interface HazoUiTableServerLoadResult<TRow> {
1498
+ rows: TRow[];
1499
+ total: number;
1500
+ }
1501
+ interface HazoUiTableProps<TRow extends object = any> {
1502
+ columns: TableColumn<TRow>[];
1503
+ rows: TRow[];
1504
+ getRowKey?: (row: TRow, index: number) => string | number;
1505
+ sort?: TableSortProp;
1506
+ defaultSort?: TableSortProp;
1507
+ onSortChange?: (sort: TableSort) => void;
1508
+ filter?: TableFilter;
1509
+ defaultFilter?: TableFilter;
1510
+ onFilterChange?: (filter: TableFilter) => void;
1511
+ page?: number;
1512
+ defaultPage?: number;
1513
+ onPageChange?: (page: number) => void;
1514
+ pagination?: HazoUiTablePagination | false;
1515
+ enableSortDialog?: boolean;
1516
+ enableFilterDialog?: boolean;
1517
+ enableSearch?: boolean;
1518
+ searchPlaceholder?: string;
1519
+ searchDebounceMs?: number;
1520
+ loading?: boolean;
1521
+ empty?: React.ReactNode;
1522
+ noResults?: React.ReactNode;
1523
+ /**
1524
+ * Rendered when `onLoad` rejects. Receives the thrown error.
1525
+ * If not provided (or returns null), the table falls back to the
1526
+ * `noResults` empty-state visual. `console.warn` runs regardless.
1527
+ */
1528
+ error?: React.ReactNode | ((err: unknown) => React.ReactNode);
1529
+ onRowClick?: (row: TRow, index: number) => void;
1530
+ mobileCardFallback?: boolean;
1531
+ mobileBreakpoint?: number;
1532
+ onLoad?: (args: HazoUiTableServerLoadArgs) => Promise<HazoUiTableServerLoadResult<TRow>>;
1533
+ className?: string;
1534
+ caption?: string;
1535
+ }
1536
+
1537
+ declare function HazoUiTable<TRow extends object = any>(props: HazoUiTableProps<TRow>): react_jsx_runtime.JSX.Element;
1538
+
1539
+ /**
1540
+ * Public types for hazo_ui_charts. Keep dependency-free so consumers can
1541
+ * import these without pulling in React types they don't need.
1542
+ */
1543
+ /** One series-value. `null` is a missing point — the chart will skip it. */
1544
+ type ChartDataPoint = number | null;
1545
+ /** Ordered time-series for a single line / area / sparkline. */
1546
+ type ChartDataSeries = ChartDataPoint[];
1547
+ /** Multi-line chart series with its own color + label. */
1548
+ interface MultiSeries {
1549
+ label: string;
1550
+ color: string;
1551
+ data: ChartDataSeries;
1552
+ }
1553
+ /** Single stacked bar — one column on the X-axis. */
1554
+ interface StackedBar {
1555
+ /** Display label below the bar (date, category, etc.). */
1556
+ label: string;
1557
+ /** Top-to-bottom band order. `value` is the band's contribution to the bar's total height. */
1558
+ segments: {
1559
+ value: number;
1560
+ color: string;
1561
+ }[];
1562
+ }
1563
+ /** Date-range selector option. Value is opaque to the component. */
1564
+ interface DateRangeOption {
1565
+ value: string;
1566
+ label: string;
1567
+ }
1568
+
1569
+ /**
1570
+ * Sparkline — tiny single-series line for KPI cards.
1571
+ *
1572
+ * Intentionally axisless (per PRD §6b — sparklines are for trend *shape*,
1573
+ * the value is shown above them in the card itself). 12% area fill makes
1574
+ * the trajectory readable even at 40px high; a 2px dot marks the latest
1575
+ * non-null point so "now" is obvious.
1576
+ *
1577
+ * SVG renders edge-to-edge with `preserveAspectRatio="none"` so the line
1578
+ * stretches across whatever width the parent gives it.
1579
+ */
1580
+
1581
+ interface SparklineProps {
1582
+ /** Time-series. `null` entries are skipped. */
1583
+ data: ChartDataSeries;
1584
+ /** Stroke / dot / area-fill color. */
1585
+ color: string;
1586
+ /** Container className passthrough. */
1587
+ className?: string;
1588
+ /** Override the default 40px height. */
1589
+ height?: number;
1590
+ }
1591
+ declare function Sparkline({ data, color, className, height, }: SparklineProps): React.ReactElement;
1592
+
1593
+ /**
1594
+ * InverseSparkline — tiny axisless line where lower = better.
1595
+ *
1596
+ * Used for GSC position trends: rank 1 is best, rank 50 is bad, so the Y
1597
+ * axis is flipped relative to a regular sparkline. No area fill, no dot —
1598
+ * the only signal is the line's direction. 62×18 by default matches the
1599
+ * "scrollable list of queries" layout in the GSC deep-dive mockup.
1600
+ */
1601
+
1602
+ interface InverseSparklineProps {
1603
+ /** Time-series (e.g. GSC avg-position values). `null` is skipped. */
1604
+ data: ChartDataSeries;
1605
+ /** Stroke color. */
1606
+ color: string;
1607
+ /** Container className passthrough. */
1608
+ className?: string;
1609
+ /** Override default 62px width. */
1610
+ width?: number;
1611
+ /** Override default 18px height. */
1612
+ height?: number;
1613
+ }
1614
+ declare function InverseSparkline({ data, color, className, width, height, }: InverseSparklineProps): React.ReactElement;
1615
+
1616
+ /**
1617
+ * LineChart — full-anatomy single-series chart (PRD §6b spec).
1618
+ *
1619
+ * ┌─────────────────────────────────────────────┐
1620
+ * │ Y-max ─ - - - - - - - - - - - - - - - - - │ ← three dashed gridlines
1621
+ * │ Y-mid ─ - - - - - - - - - - ╭──•value │ ← marker dot + label
1622
+ * │ Y-min ─ - - - - - - -╭──────╯ │ + dashed guide to Y-axis
1623
+ * │ └───────────────────────────────── │
1624
+ * │ Mar 4 Mar 10 Mar 17 │ ← three X labels
1625
+ * └─────────────────────────────────────────────┘
1626
+ *
1627
+ * Hover anywhere over the plot area to surface a cursor line + value
1628
+ * bubble at the nearest data point. Set `showTooltip={false}` to disable
1629
+ * — useful when the chart is small or non-interactive (print export).
1630
+ */
1631
+
1632
+ interface LineChartProps {
1633
+ /** Time-series. `null` entries are gaps in the line. */
1634
+ data: ChartDataSeries;
1635
+ /** Labels for the X-axis. Length should match `data`. */
1636
+ dates: string[];
1637
+ /** Stroke / area / marker color. */
1638
+ color: string;
1639
+ /** Override default 360-wide viewBox. */
1640
+ width?: number;
1641
+ /** Override default 130-tall viewBox. */
1642
+ height?: number;
1643
+ /** Optional suffix shown next to the current-value label (e.g. "%"). */
1644
+ unit?: string;
1645
+ /** Disable hover tooltip. Defaults to enabled. */
1646
+ showTooltip?: boolean;
1647
+ /** Container className passthrough. */
1648
+ className?: string;
1649
+ }
1650
+ declare function LineChart({ data, dates, color, width, height, unit, showTooltip, className, }: LineChartProps): React.ReactElement;
1651
+
1652
+ /**
1653
+ * MultiLineChart — multi-series chart with shared Y-axis.
1654
+ *
1655
+ * No area fill (PRD §6b — "multi-series uses lines only to avoid color
1656
+ * collisions"). Each series gets a per-endpoint marker + value label so
1657
+ * the latest value is readable without hovering. Hover surfaces a single
1658
+ * cursor line with one bubble per series stacked vertically.
1659
+ */
1660
+
1661
+ interface MultiLineChartProps {
1662
+ series: MultiSeries[];
1663
+ dates: string[];
1664
+ width?: number;
1665
+ height?: number;
1666
+ showTooltip?: boolean;
1667
+ showLegend?: boolean;
1668
+ className?: string;
1669
+ }
1670
+ declare function MultiLineChart({ series, dates, width, height, showTooltip, showLegend, className, }: MultiLineChartProps): React.ReactElement;
1671
+
1672
+ /**
1673
+ * StackedBars — one vertical bar per X position, each split into top-to-bottom
1674
+ * colored bands.
1675
+ *
1676
+ * Generic enough for any distribution-over-time visual: GSC position buckets
1677
+ * (Top 3 / 4-10 / 11-20 / 20+), traffic source mix (organic / direct / referral),
1678
+ * etc. The component is data-driven via `bars: StackedBar[]` — the consumer
1679
+ * picks the segment colors, the labels, and the band order.
1680
+ */
1681
+
1682
+ interface StackedBarsProps {
1683
+ bars: StackedBar[];
1684
+ width?: number;
1685
+ height?: number;
1686
+ /** Show Y-axis ticks (max, mid, 0). Defaults to true. */
1687
+ showYAxis?: boolean;
1688
+ className?: string;
1689
+ }
1690
+ declare function StackedBars({ bars, width, height, showYAxis, className, }: StackedBarsProps): React.ReactElement;
1691
+
1692
+ /**
1693
+ * DateRangeSelector — segmented control for picking a chart's time window.
1694
+ *
1695
+ * Framework-agnostic: emits the new value via `onChange`. The consumer
1696
+ * decides whether to write it to a URL query param (Next.js router), a
1697
+ * local state, or a global store — hazo_ui has no opinion on routing.
1698
+ *
1699
+ * Visually a row of pills, the active one tinted with the primary color.
1700
+ * Designed to sit immediately above a chart on the Trends / Bing / GA4
1701
+ * pages where users need to flip between "14d", "30d", and "since launch".
1702
+ */
1703
+
1704
+ interface DateRangeSelectorProps {
1705
+ value: string;
1706
+ onChange: (value: string) => void;
1707
+ options: DateRangeOption[];
1708
+ className?: string;
1709
+ /** Aria label for the whole group. Defaults to "Date range". */
1710
+ ariaLabel?: string;
1711
+ }
1712
+ declare function DateRangeSelector({ value, onChange, options, className, ariaLabel, }: DateRangeSelectorProps): React.ReactElement;
1713
+
1714
+ /**
1715
+ * Number/date formatters shared across hazo_ui_charts.
1716
+ *
1717
+ * Kept as pure, zero-dependency helpers so the chart primitives stay
1718
+ * deterministic across SSR/CSR. Locale is intentionally pinned (the same
1719
+ * lesson as v2.15.1's Intl fix on HazoUiTable).
1720
+ */
1721
+ /**
1722
+ * Compact number formatter used on Y-axis ticks, marker labels, and legends.
1723
+ *
1724
+ * null / undefined / NaN → empty string
1725
+ * ≥ 1,000 → `1.0k`, `12.3k`, `1.0M`
1726
+ * integer → no decimals (`14`, `0`)
1727
+ * fractional → one decimal (`5.7`)
1728
+ *
1729
+ * Strings pass through unchanged so callers can pre-format if needed.
1730
+ */
1731
+ declare function format_num(n: number | null | undefined | string): string;
1732
+ /**
1733
+ * Pick three index positions for X-axis labels: start, middle, end.
1734
+ * Returns `[0, mid, last]` for length ≥ 3; falls back gracefully below that.
1735
+ */
1736
+ declare function pick_x_label_indices(length: number): [number, number, number];
1737
+
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 };