@siyahi/ui 0.1.9-next.31 → 0.1.9-next.33

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.
Files changed (80) hide show
  1. package/DESIGN.md +4 -3
  2. package/agents/examples/data-table.tsx +4 -1
  3. package/agents/examples/metric-strip.tsx +2 -0
  4. package/dist/components/registry/charts/area-chart-card.d.ts +2 -2
  5. package/dist/components/registry/charts/bar-chart-card.d.ts +4 -4
  6. package/dist/components/registry/charts/line-chart-card.d.ts +1 -1
  7. package/dist/components/registry/dashboard-01/section-cards.d.ts +4 -4
  8. package/dist/components/registry/dashboardcn/bar-list.d.ts +8 -8
  9. package/dist/components/registry/dashboardcn/distribution-bar.d.ts +11 -11
  10. package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +5 -3
  11. package/dist/components/registry/dashboardcn/kpi-row-card.js +1 -0
  12. package/dist/components/registry/dashboardcn/sparkline.d.ts +6 -6
  13. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +50 -50
  14. package/dist/components/registry/heatmap/status-heatmap.d.ts +44 -44
  15. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +53 -53
  16. package/dist/components/registry/minidev/copy-button.d.ts +2 -2
  17. package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +1 -1
  18. package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +1 -1
  19. package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +7 -7
  20. package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +5 -5
  21. package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +1 -1
  22. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +1 -1
  23. package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +1 -1
  24. package/dist/components/registry/niko-table/config/feature-detection.d.ts +13 -13
  25. package/dist/components/registry/niko-table/core/data-table-context.d.ts +5 -5
  26. package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +3 -3
  27. package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +2 -2
  28. package/dist/components/registry/niko-table/core/data-table-root.d.ts +36 -35
  29. package/dist/components/registry/niko-table/core/data-table-structure.d.ts +29 -22
  30. package/dist/components/registry/niko-table/core/data-table-structure.js +9 -5
  31. package/dist/components/registry/niko-table/core/data-table.d.ts +3 -3
  32. package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +5 -5
  33. package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +6 -6
  34. package/dist/components/registry/niko-table/filters/table-column-title.d.ts +2 -2
  35. package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +9 -9
  36. package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +7 -7
  37. package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +7 -7
  38. package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +2 -2
  39. package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +3 -3
  40. package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +4 -4
  41. package/dist/components/registry/niko-table/lib/styles.js +1 -1
  42. package/dist/components/registry/niko-table/types/index.d.ts +29 -29
  43. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +6 -5
  44. package/dist/components/registry/sidebar-07/nav-main.d.ts +4 -4
  45. package/dist/components/siyahi/callout.d.ts +1 -1
  46. package/dist/components/siyahi/change-bar.d.ts +3 -3
  47. package/dist/components/siyahi/change-grid.d.ts +6 -6
  48. package/dist/components/siyahi/data-bar.d.ts +2 -2
  49. package/dist/components/siyahi/data-list.d.ts +1 -1
  50. package/dist/components/siyahi/data-table-row-count.d.ts +1 -1
  51. package/dist/components/siyahi/data-table-sort-header.d.ts +1 -1
  52. package/dist/components/siyahi/delta.d.ts +2 -2
  53. package/dist/components/siyahi/drawdown-chart.d.ts +2 -2
  54. package/dist/components/siyahi/histogram-chart.d.ts +5 -5
  55. package/dist/components/siyahi/local-time.d.ts +1 -1
  56. package/dist/components/siyahi/page-section.d.ts +1 -1
  57. package/dist/components/siyahi/page-toc.d.ts +2 -2
  58. package/dist/components/siyahi/panel-grid.d.ts +2 -2
  59. package/dist/components/siyahi/price-chart.d.ts +1 -1
  60. package/dist/components/siyahi/range-position.d.ts +5 -5
  61. package/dist/components/siyahi/scale-toggle.d.ts +2 -2
  62. package/dist/components/siyahi/scatter-chart.d.ts +15 -15
  63. package/dist/components/siyahi/siyahi-provider.d.ts +3 -2
  64. package/dist/components/siyahi/siyahi-provider.js +1 -4
  65. package/dist/components/siyahi/slope-chart.d.ts +4 -4
  66. package/dist/components/siyahi/status-alert.d.ts +1 -1
  67. package/dist/components/siyahi/status-badge.d.ts +1 -1
  68. package/dist/components/siyahi/target-rows.d.ts +6 -6
  69. package/dist/components/siyahi/treemap.d.ts +8 -8
  70. package/dist/components/siyahi/waterfall-chart.d.ts +3 -3
  71. package/dist/lib/chart-frame.d.ts +13 -13
  72. package/dist/lib/chart-marks.d.ts +2 -2
  73. package/dist/lib/chart-series.d.ts +22 -22
  74. package/dist/lib/format.d.ts +1 -1
  75. package/dist/lib/optional.d.ts +7 -0
  76. package/dist/lib/optional.js +0 -0
  77. package/dist/lib/scatter.d.ts +7 -7
  78. package/dist/lib/treemap.d.ts +1 -1
  79. package/package.json +2 -2
  80. package/styles/siyahi.css +39 -6
@@ -20,43 +20,43 @@ export type WeekdayExtraColumnSpec = {
20
20
  compute: (data: WeekdayHourlyActivity[]) => number[];
21
21
  };
22
22
  export type WeekdayHeatmapLabels = {
23
- hours?: string[];
24
- endHour?: string | null;
25
- weekdays?: string[];
26
- stat?: string;
27
- cellLabel?: string;
28
- heatmapLabel?: string;
29
- legendLabel?: string;
30
- legendLevelLabel?: string;
23
+ hours?: string[] | undefined;
24
+ endHour?: string | null | undefined;
25
+ weekdays?: string[] | undefined;
26
+ stat?: string | undefined;
27
+ cellLabel?: string | undefined;
28
+ heatmapLabel?: string | undefined;
29
+ legendLabel?: string | undefined;
30
+ legendLevelLabel?: string | undefined;
31
31
  };
32
32
  export type ColorConfig = {
33
- empty?: string;
34
- scale?: string;
33
+ empty?: string | undefined;
34
+ scale?: string | undefined;
35
35
  };
36
36
  export type WeekdayHeatmapProps = HTMLAttributes<HTMLDivElement> & {
37
37
  data: WeekdayHourlyActivity[];
38
- weekStart?: Day;
38
+ weekStart?: Day | undefined;
39
39
  /** Displayed hours, in order; defaults to the full day. */
40
- hours?: readonly WeekdayHour[];
40
+ hours?: readonly WeekdayHour[] | undefined;
41
41
  /** Displayed days, in order; defaults to the full week from weekStart. */
42
- weekdays?: readonly WeekdayIndex[];
43
- use12Hour?: boolean;
44
- blockSize?: number;
45
- blockMargin?: number;
46
- blockRadius?: number;
47
- blockAspectRatio?: number;
48
- levels?: number;
49
- isNormalized?: boolean;
50
- colors?: ColorConfig;
51
- locale?: Locale;
52
- labels?: WeekdayHeatmapLabels;
53
- fontSize?: number;
42
+ weekdays?: readonly WeekdayIndex[] | undefined;
43
+ use12Hour?: boolean | undefined;
44
+ blockSize?: number | undefined;
45
+ blockMargin?: number | undefined;
46
+ blockRadius?: number | undefined;
47
+ blockAspectRatio?: number | undefined;
48
+ levels?: number | undefined;
49
+ isNormalized?: boolean | undefined;
50
+ colors?: ColorConfig | undefined;
51
+ locale?: Locale | undefined;
52
+ labels?: WeekdayHeatmapLabels | undefined;
53
+ fontSize?: number | undefined;
54
54
  emptyState?: ReactNode;
55
- totalCount?: number;
56
- extraRow?: WeekdayExtraRowSpec;
57
- extraColumn?: WeekdayExtraColumnSpec;
58
- style?: CSSProperties;
59
- className?: string;
55
+ totalCount?: number | undefined;
56
+ extraRow?: WeekdayExtraRowSpec | undefined;
57
+ extraColumn?: WeekdayExtraColumnSpec | undefined;
58
+ style?: CSSProperties | undefined;
59
+ className?: string | undefined;
60
60
  children: ReactNode;
61
61
  };
62
62
  /**
@@ -93,58 +93,58 @@ export type WeekdayHeatmapProps = HTMLAttributes<HTMLDivElement> & {
93
93
  export declare const WeekdayHeatmap: ({ data, weekStart, hours, weekdays: displayedWeekdays, use12Hour, blockSize: blockSizeProp, blockMargin, blockRadius, blockAspectRatio, levels: levelsProp, isNormalized, colors, locale, labels: labelsProp, fontSize, emptyState, totalCount: totalCountProp, extraRow, extraColumn, style, className, children, ...props }: WeekdayHeatmapProps) => string | number | bigint | true | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null;
94
94
  export type WeekdayHeatmapBlockProps = HTMLAttributes<SVGRectElement> & {
95
95
  /** The cell the page has picked: drawn with a ring and announced as pressed. */
96
- selected?: boolean;
96
+ selected?: boolean | undefined;
97
97
  activity: WeekdayHourlyActivityWithLevel;
98
- extra?: "row" | "column";
99
- highlighted?: boolean;
100
- onCellClick?: (activity: WeekdayHourlyActivityWithLevel) => void;
101
- onCellHover?: (activity: WeekdayHourlyActivityWithLevel | null) => void;
102
- className?: string;
98
+ extra?: "row" | "column" | undefined;
99
+ highlighted?: boolean | undefined;
100
+ onCellClick?: ((activity: WeekdayHourlyActivityWithLevel) => void) | undefined;
101
+ onCellHover?: ((activity: WeekdayHourlyActivityWithLevel | null) => void) | undefined;
102
+ className?: string | undefined;
103
103
  };
104
104
  export declare function WeekdayHeatmapBlock({ ref, activity, extra, highlighted, selected, onCellClick, onCellHover, onClick, onKeyDown, onMouseEnter, onMouseLeave, className, style: styleProp, ...props }: WeekdayHeatmapBlockProps & {
105
- ref?: React.RefObject<SVGRectElement | null>;
105
+ ref?: React.RefObject<SVGRectElement | null> | undefined;
106
106
  }): import("react").JSX.Element | null;
107
107
  export declare namespace WeekdayHeatmapBlock {
108
108
  var displayName: string;
109
109
  }
110
110
  export type WeekdayHeatmapBodyProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
111
- hideHourLabels?: boolean;
112
- hideWeekdayLabels?: boolean;
113
- className?: string;
114
- labelClassName?: string;
111
+ hideHourLabels?: boolean | undefined;
112
+ hideWeekdayLabels?: boolean | undefined;
113
+ className?: string | undefined;
114
+ labelClassName?: string | undefined;
115
115
  children: (props: {
116
116
  activity: WeekdayHourlyActivityWithLevel;
117
117
  weekdayIndex: number;
118
118
  }) => ReactNode;
119
- renderExtraRow?: (props: {
119
+ renderExtraRow?: ((props: {
120
120
  activity: WeekdayHourlyActivityWithLevel;
121
121
  weekdayIndex: number;
122
- }) => ReactNode;
123
- renderExtraColumn?: (props: {
122
+ }) => ReactNode) | undefined;
123
+ renderExtraColumn?: ((props: {
124
124
  activity: WeekdayHourlyActivityWithLevel;
125
125
  weekdayIndex: number;
126
- }) => ReactNode;
126
+ }) => ReactNode) | undefined;
127
127
  };
128
128
  export declare const WeekdayHeatmapBody: ({ hideHourLabels, hideWeekdayLabels, className, labelClassName, children, renderExtraRow, renderExtraColumn, ...props }: WeekdayHeatmapBodyProps) => import("react").JSX.Element;
129
129
  export type WeekdayHeatmapFooterProps = HTMLAttributes<HTMLDivElement>;
130
130
  export declare const WeekdayHeatmapFooter: ({ className, ...props }: WeekdayHeatmapFooterProps) => import("react").JSX.Element;
131
131
  export type WeekdayHeatmapStatProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
132
- compute?: (data: WeekdayHourlyActivityWithLevel[]) => number | string;
133
- label?: string;
134
- children?: (result: {
132
+ compute?: ((data: WeekdayHourlyActivityWithLevel[]) => number | string) | undefined;
133
+ label?: string | undefined;
134
+ children?: ((result: {
135
135
  value: number | string;
136
136
  data: WeekdayHourlyActivityWithLevel[];
137
- }) => ReactNode;
137
+ }) => ReactNode) | undefined;
138
138
  };
139
139
  export declare const WeekdayHeatmapStat: ({ compute, label, className, children, ...props }: WeekdayHeatmapStatProps) => import("react").JSX.Element;
140
140
  export type WeekdayHeatmapLegendProps = Omit<HTMLAttributes<HTMLFieldSetElement>, "children"> & {
141
141
  labels?: {
142
- less?: string;
143
- more?: string;
144
- };
145
- children?: (props: {
142
+ less?: string | undefined;
143
+ more?: string | undefined;
144
+ } | undefined;
145
+ children?: ((props: {
146
146
  level: number;
147
- }) => ReactNode;
147
+ }) => ReactNode) | undefined;
148
148
  };
149
149
  export declare const WeekdayHeatmapLegend: ({ labels: labelsProp, className, children, ...props }: WeekdayHeatmapLegendProps) => import("react").JSX.Element;
150
150
  //#endregion
@@ -4,8 +4,8 @@ import { VariantProps } from "class-variance-authority";
4
4
  //#region src/components/registry/minidev/copy-button.d.ts
5
5
  declare function CopyButton({ value, className, variant, size, label, copiedLabel, ...props }: {
6
6
  value: string;
7
- label?: string;
8
- copiedLabel?: string;
7
+ label?: string | undefined;
8
+ copiedLabel?: string | undefined;
9
9
  } & React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants>): React$1.JSX.Element;
10
10
  //#endregion
11
11
  export { CopyButton };
@@ -18,7 +18,7 @@ import { RowData } from "@tanstack/react-table";
18
18
  */
19
19
  export declare function DataTableColumnActions<TData extends RowData, TValue>(props: Omit<React.ComponentProps<typeof TableColumnActions>, "isActive"> & {
20
20
  /** Override to manually set active state */
21
- isActive?: boolean;
21
+ isActive?: boolean | undefined;
22
22
  }): React.JSX.Element;
23
23
  export declare namespace DataTableColumnActions {
24
24
  var displayName: string;
@@ -5,7 +5,7 @@ import React from "react";
5
5
  */
6
6
  export declare function DataTableColumnFilter({ children, className }: {
7
7
  children?: React.ReactNode;
8
- className?: string;
8
+ className?: string | undefined;
9
9
  }): React.JSX.Element | null;
10
10
  export declare namespace DataTableColumnFilter {
11
11
  var displayName: string;
@@ -3,7 +3,7 @@ import React from "react";
3
3
  export interface DataTableEmptyStateProps {
4
4
  children: React.ReactNode;
5
5
  isFiltered: boolean;
6
- className?: string;
6
+ className?: string | undefined;
7
7
  }
8
8
  /**
9
9
  * Root component for empty state composition.
@@ -14,7 +14,7 @@ export interface DataTableEmptyStateProps {
14
14
  export declare function DataTableEmptyState({ children, isFiltered, className }: DataTableEmptyStateProps): React.JSX.Element;
15
15
  export interface DataTableEmptyIconProps {
16
16
  children: React.ReactNode;
17
- className?: string;
17
+ className?: string | undefined;
18
18
  }
19
19
  /**
20
20
  * Icon component for empty state. Memoized so table-state changes don't re-render it.
@@ -27,7 +27,7 @@ export interface DataTableEmptyIconProps {
27
27
  export declare const DataTableEmptyIcon: React.MemoExoticComponent<({ children, className }: DataTableEmptyIconProps) => React.JSX.Element>;
28
28
  export interface DataTableEmptyMessageProps {
29
29
  children: React.ReactNode;
30
- className?: string;
30
+ className?: string | undefined;
31
31
  }
32
32
  /**
33
33
  * Message component for empty state. Memoized; renders only when not filtered.
@@ -43,7 +43,7 @@ export interface DataTableEmptyMessageProps {
43
43
  export declare const DataTableEmptyMessage: React.MemoExoticComponent<({ children, className }: DataTableEmptyMessageProps) => React.JSX.Element | null>;
44
44
  export interface DataTableEmptyFilteredMessageProps {
45
45
  children: React.ReactNode;
46
- className?: string;
46
+ className?: string | undefined;
47
47
  }
48
48
  /**
49
49
  * Filtered-state message — renders only when a filter is active. Memoized.
@@ -56,7 +56,7 @@ export interface DataTableEmptyFilteredMessageProps {
56
56
  export declare const DataTableEmptyFilteredMessage: React.MemoExoticComponent<({ children, className }: DataTableEmptyFilteredMessageProps) => React.JSX.Element | null>;
57
57
  export interface DataTableEmptyActionsProps {
58
58
  children: React.ReactNode;
59
- className?: string;
59
+ className?: string | undefined;
60
60
  }
61
61
  /**
62
62
  * Actions component for empty state.
@@ -71,7 +71,7 @@ export interface DataTableEmptyActionsProps {
71
71
  export declare const DataTableEmptyActions: React.MemoExoticComponent<({ children, className }: DataTableEmptyActionsProps) => React.JSX.Element>;
72
72
  export interface DataTableEmptyTitleProps {
73
73
  children: React.ReactNode;
74
- className?: string;
74
+ className?: string | undefined;
75
75
  }
76
76
  /**
77
77
  * Title component for empty state messages.
@@ -89,7 +89,7 @@ export interface DataTableEmptyTitleProps {
89
89
  export declare const DataTableEmptyTitle: React.MemoExoticComponent<({ children, className }: DataTableEmptyTitleProps) => React.JSX.Element>;
90
90
  export interface DataTableEmptyDescriptionProps {
91
91
  children: React.ReactNode;
92
- className?: string;
92
+ className?: string | undefined;
93
93
  }
94
94
  /**
95
95
  * Description component for empty state messages.
@@ -11,28 +11,28 @@ type DataTableFacetedFilterProps<TData extends RowData, TValue> = Omit<TableFace
11
11
  /**
12
12
  * Optional title override (if not provided, will use column.meta.label)
13
13
  */
14
- title?: string;
14
+ title?: string | undefined;
15
15
  /**
16
16
  * Static options (if provided, will be used instead of dynamic generation)
17
17
  */
18
- options?: Option[];
18
+ options?: Option[] | undefined;
19
19
  /**
20
20
  * Whether to show counts for each option
21
21
  * @default true
22
22
  */
23
- showCounts?: boolean;
23
+ showCounts?: boolean | undefined;
24
24
  /**
25
25
  * Whether to update counts based on other active filters
26
26
  * @default true
27
27
  */
28
- dynamicCounts?: boolean;
28
+ dynamicCounts?: boolean | undefined;
29
29
  /**
30
30
  * If true, only show options that exist in the currently filtered table rows.
31
31
  * If false, show all options from the entire dataset (useful for multi-select filters
32
32
  * where you want to see all possible options even if they're not in the current filtered results).
33
33
  * @default !multiple (true for single-select, false for multi-select)
34
34
  */
35
- limitToFilteredRows?: boolean;
35
+ limitToFilteredRows?: boolean | undefined;
36
36
  };
37
37
  export declare function DataTableFacetedFilter<TData extends RowData, TValue = unknown>({ accessorKey, options, showCounts, dynamicCounts, limitToFilteredRows, title, multiple, trigger, ...props }: DataTableFacetedFilterProps<TData, TValue>): React$1.JSX.Element | null;
38
38
  export declare namespace DataTableFacetedFilter {
@@ -69,7 +69,7 @@ export interface DataTableGroupedRowsProps<TData extends RowData = RowData> {
69
69
  * row for that group. Table-level gating is better expressed by simply not
70
70
  * nesting this component.
71
71
  */
72
- enabledFor?: (row: DataTableRow<TData>) => boolean;
72
+ enabledFor?: ((row: DataTableRow<TData>) => boolean) | undefined;
73
73
  }
74
74
  /**
75
75
  * Declarative, composable group rows for niko-table bodies.
@@ -19,7 +19,7 @@ export interface DataTableRowContextMenuSlotProps<TData extends RowData> {
19
19
  * menu (e.g. locked/browse-only rows). Table-level gating (e.g. "no manage
20
20
  * permission") is better done by simply not rendering the slot at all.
21
21
  */
22
- enabledFor?: (row: TData) => boolean;
22
+ enabledFor?: ((row: TData) => boolean) | undefined;
23
23
  }
24
24
  /**
25
25
  * Declarative, composable row context menu for niko-table bodies.
@@ -23,7 +23,7 @@ export interface DataTableRowContextMenuProps {
23
23
  */
24
24
  children: React$1.ReactNode;
25
25
  /** Extra className for the popup surface. */
26
- className?: string;
26
+ className?: string | undefined;
27
27
  }
28
28
  /**
29
29
  * Attaches a right-click context menu to a single data-table row.
@@ -4,18 +4,18 @@ import { ReactNode } from "react";
4
4
  * Feature requirements that components can declare
5
5
  */
6
6
  export interface FeatureRequirements {
7
- enableFilters?: boolean;
8
- enablePagination?: boolean;
9
- enableRowSelection?: boolean;
10
- enableSorting?: boolean;
11
- enableMultiSort?: boolean;
12
- enableGrouping?: boolean;
13
- enableExpanding?: boolean;
14
- enableColumnResizing?: boolean;
15
- manualSorting?: boolean;
16
- manualPagination?: boolean;
17
- manualFiltering?: boolean;
18
- pageCount?: number;
7
+ enableFilters?: boolean | undefined;
8
+ enablePagination?: boolean | undefined;
9
+ enableRowSelection?: boolean | undefined;
10
+ enableSorting?: boolean | undefined;
11
+ enableMultiSort?: boolean | undefined;
12
+ enableGrouping?: boolean | undefined;
13
+ enableExpanding?: boolean | undefined;
14
+ enableColumnResizing?: boolean | undefined;
15
+ manualSorting?: boolean | undefined;
16
+ manualPagination?: boolean | undefined;
17
+ manualFiltering?: boolean | undefined;
18
+ pageCount?: number | undefined;
19
19
  }
20
20
  /**
21
21
  * Walks the React tree to aggregate feature requirements declared by child
@@ -23,7 +23,7 @@ export interface FeatureRequirements {
23
23
  */
24
24
  export declare function detectFeaturesFromChildren(children: ReactNode, columns?: Array<{
25
25
  header?: unknown;
26
- enableColumnFilter?: boolean;
26
+ enableColumnFilter?: boolean | undefined;
27
27
  }>): FeatureRequirements;
28
28
  /**
29
29
  * Register a component's feature requirements
@@ -9,7 +9,7 @@ export type DataTableContextState = {
9
9
  export type ScrollAlign = "auto" | "start" | "center" | "end";
10
10
  /** Scroll a row into view by its position in the current row model. */
11
11
  export type ScrollRowIntoView = (index: number, opts?: {
12
- align?: ScrollAlign;
12
+ align?: ScrollAlign | undefined;
13
13
  }) => void;
14
14
  /**
15
15
  * The active-selection SPAN for a grid-style cross-highlight — EVERY column
@@ -34,9 +34,9 @@ export interface ActiveSelection {
34
34
  export type ActiveCell = ActiveSelection | null;
35
35
  export interface FlashRowsOptions {
36
36
  /** How long the highlight lasts, ms. Default 1400. */
37
- durationMs?: number;
37
+ durationMs?: number | undefined;
38
38
  /** Scroll the first flashed row into view first. Default true. */
39
- scrollIntoView?: boolean;
39
+ scrollIntoView?: boolean | undefined;
40
40
  }
41
41
  /**
42
42
  * Briefly highlight rows (by id) so users see what just changed — e.g. after a
@@ -163,8 +163,8 @@ export interface CompactColumns {
163
163
  interface DataTableProviderProps<TData extends RowData> {
164
164
  children: React.ReactNode;
165
165
  table: DataTableInstance<TData>;
166
- columns?: DataTableColumnDef<TData>[];
167
- isLoading?: boolean;
166
+ columns?: DataTableColumnDef<TData>[] | undefined;
167
+ isLoading?: boolean | undefined;
168
168
  isCompact: boolean;
169
169
  onWidthChange: (width: number) => void;
170
170
  compactColumns: CompactColumns | null;
@@ -12,17 +12,17 @@ export interface DataTableErrorBoundaryProps {
12
12
  /**
13
13
  * Callback fired when an error is caught
14
14
  */
15
- onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
15
+ onError?: ((error: Error, errorInfo: React.ErrorInfo) => void) | undefined;
16
16
  /**
17
17
  * Whether to show a reset button
18
18
  * @default true
19
19
  */
20
- showResetButton?: boolean;
20
+ showResetButton?: boolean | undefined;
21
21
  /**
22
22
  * Custom reset button text
23
23
  * @default "Try Again"
24
24
  */
25
- resetButtonText?: string;
25
+ resetButtonText?: string | undefined;
26
26
  }
27
27
  interface DataTableErrorBoundaryState {
28
28
  hasError: boolean;
@@ -38,12 +38,12 @@ export interface GroupedBodyRowProps<TData extends RowData = RowData> {
38
38
  * usually a different height from a leaf row, so it has to be measured
39
39
  * rather than assumed — without this the rows below it drift.
40
40
  */
41
- measureRef?: (node: HTMLTableRowElement | null) => void;
41
+ measureRef?: ((node: HTMLTableRowElement | null) => void) | undefined;
42
42
  /**
43
43
  * Virtualized bodies only: the row's index in the virtual window, which the
44
44
  * virtualizer reads back off the DOM as `data-index`.
45
45
  */
46
- virtualIndex?: number;
46
+ virtualIndex?: number | undefined;
47
47
  }
48
48
  export declare const GroupedBodyRow: <TData extends RowData = RowData>(props: GroupedBodyRowProps<TData>) => React.JSX.Element;
49
49
  //#endregion
@@ -1,16 +1,17 @@
1
1
  import { DataTableFeatures } from "../lib/data-table-features.js";
2
2
  import { DataTableColumns, GlobalFilter } from "../types/index.js";
3
+ import { Optional } from "../../../../lib/optional.js";
3
4
  import React from "react";
4
5
  import { ColumnFiltersState, ColumnOrderState, ColumnVisibilityState, ExpandedState, GroupingState, PaginationState, ReactTable, RowData, RowSelectionState, SortingState, TableOptions, Updater } from "@tanstack/react-table";
5
6
  //#region src/components/registry/niko-table/core/data-table-root.d.ts
6
7
  export interface DataTableConfig {
7
- enablePagination?: boolean;
8
- enableFilters?: boolean;
9
- enableSorting?: boolean;
10
- enableRowSelection?: boolean;
11
- enableMultiSort?: boolean;
12
- enableGrouping?: boolean;
13
- enableExpanding?: boolean;
8
+ enablePagination?: boolean | undefined;
9
+ enableFilters?: boolean | undefined;
10
+ enableSorting?: boolean | undefined;
11
+ enableRowSelection?: boolean | undefined;
12
+ enableMultiSort?: boolean | undefined;
13
+ enableGrouping?: boolean | undefined;
14
+ enableExpanding?: boolean | undefined;
14
15
  /**
15
16
  * Enable drag-to-resize column widths (opt-in; off by default so existing
16
17
  * tables are unaffected). When on, columns render at `column.getSize()` and a
@@ -18,41 +19,41 @@ export interface DataTableConfig {
18
19
  * `<DataTableColumnResize />` inside the root to enable via feature detection.
19
20
  * Double-click a grip to autosize; columns opt out with `enableResizing: false`.
20
21
  */
21
- enableColumnResizing?: boolean;
22
+ enableColumnResizing?: boolean | undefined;
22
23
  /**
23
24
  * When grouping is active, how grouped columns are placed in the column flow.
24
25
  * TanStack default: `'reorder'` (move grouped columns to the start).
25
26
  * `'remove'` hides them; `false` leaves them in place.
26
27
  */
27
- groupedColumnMode?: false | "reorder" | "remove";
28
- manualSorting?: boolean;
29
- manualPagination?: boolean;
30
- manualFiltering?: boolean;
31
- pageCount?: number;
32
- initialPageSize?: number;
33
- initialPageIndex?: number;
34
- autoResetPageIndex?: boolean;
35
- autoResetExpanded?: boolean;
28
+ groupedColumnMode?: false | "reorder" | "remove" | undefined;
29
+ manualSorting?: boolean | undefined;
30
+ manualPagination?: boolean | undefined;
31
+ manualFiltering?: boolean | undefined;
32
+ pageCount?: number | undefined;
33
+ initialPageSize?: number | undefined;
34
+ initialPageIndex?: number | undefined;
35
+ autoResetPageIndex?: boolean | undefined;
36
+ autoResetExpanded?: boolean | undefined;
36
37
  }
37
- interface TableRootProps<TData extends RowData> extends Omit<Partial<TableOptions<DataTableFeatures, TData>>, "columns" | "data" | "getRowId" | "key"> {
38
- table?: ReactTable<DataTableFeatures, TData>;
39
- columns?: DataTableColumns<TData>;
40
- data?: TData[];
38
+ interface TableRootProps<TData extends RowData> extends Omit<Optional<TableOptions<DataTableFeatures, TData>>, "columns" | "data" | "getRowId" | "key"> {
39
+ table?: ReactTable<DataTableFeatures, TData> | undefined;
40
+ columns?: DataTableColumns<TData> | undefined;
41
+ data?: TData[] | undefined;
41
42
  children: React.ReactNode;
42
- className?: string;
43
- config?: DataTableConfig;
44
- getRowId?: (originalRow: TData, index: number) => string;
45
- isLoading?: boolean;
46
- onGlobalFilterChange?: (value: GlobalFilter) => void;
47
- onPaginationChange?: (updater: Updater<PaginationState>) => void;
48
- onSortingChange?: (updater: Updater<SortingState>) => void;
49
- onColumnVisibilityChange?: (updater: Updater<ColumnVisibilityState>) => void;
50
- onColumnFiltersChange?: (updater: Updater<ColumnFiltersState>) => void;
51
- onRowSelectionChange?: (updater: Updater<RowSelectionState>) => void;
52
- onExpandedChange?: (updater: Updater<ExpandedState>) => void;
53
- onGroupingChange?: (updater: Updater<GroupingState>) => void;
54
- onColumnOrderChange?: (updater: Updater<ColumnOrderState>) => void;
55
- onRowSelection?: (selectedRows: TData[]) => void;
43
+ className?: string | undefined;
44
+ config?: DataTableConfig | undefined;
45
+ getRowId?: ((originalRow: TData, index: number) => string) | undefined;
46
+ isLoading?: boolean | undefined;
47
+ onGlobalFilterChange?: ((value: GlobalFilter) => void) | undefined;
48
+ onPaginationChange?: ((updater: Updater<PaginationState>) => void) | undefined;
49
+ onSortingChange?: ((updater: Updater<SortingState>) => void) | undefined;
50
+ onColumnVisibilityChange?: ((updater: Updater<ColumnVisibilityState>) => void) | undefined;
51
+ onColumnFiltersChange?: ((updater: Updater<ColumnFiltersState>) => void) | undefined;
52
+ onRowSelectionChange?: ((updater: Updater<RowSelectionState>) => void) | undefined;
53
+ onExpandedChange?: ((updater: Updater<ExpandedState>) => void) | undefined;
54
+ onGroupingChange?: ((updater: Updater<GroupingState>) => void) | undefined;
55
+ onColumnOrderChange?: ((updater: Updater<ColumnOrderState>) => void) | undefined;
56
+ onRowSelection?: ((selectedRows: TData[]) => void) | undefined;
56
57
  }
57
58
  export declare function DataTableRoot<TData extends RowData>({ table: externalTable, columns, data, children, className, isLoading, ...rest }: TableRootProps<TData>): React.JSX.Element;
58
59
  export declare namespace DataTableRoot {
@@ -3,21 +3,21 @@ import React from "react";
3
3
  import { RowData } from "@tanstack/react-table";
4
4
  //#region src/components/registry/niko-table/core/data-table-structure.d.ts
5
5
  export interface DataTableHeaderProps {
6
- className?: string;
6
+ className?: string | undefined;
7
7
  /**
8
8
  * Makes the header sticky at the top when scrolling.
9
9
  * @default true
10
10
  */
11
- sticky?: boolean;
11
+ sticky?: boolean | undefined;
12
12
  }
13
13
  export declare const DataTableHeader: React.MemoExoticComponent<({ className, sticky }: DataTableHeaderProps) => React.JSX.Element | null>;
14
14
  export interface DataTableBodyProps<TData extends RowData> {
15
15
  children?: React.ReactNode;
16
- className?: string;
17
- onScroll?: (event: ScrollEvent) => void;
18
- onScrolledTop?: () => void;
19
- onScrolledBottom?: () => void;
20
- scrollThreshold?: number;
16
+ className?: string | undefined;
17
+ onScroll?: ((event: ScrollEvent) => void) | undefined;
18
+ onScrolledTop?: (() => void) | undefined;
19
+ onScrolledBottom?: (() => void) | undefined;
20
+ scrollThreshold?: number | undefined;
21
21
  /**
22
22
  * Click is dispatched per-row from each cell's onClick. The event's
23
23
  * `currentTarget` is the `<td>` cell — typed as `HTMLElement` to
@@ -25,12 +25,12 @@ export interface DataTableBodyProps<TData extends RowData> {
25
25
  * `<tbody>`). Consumers needing the row element can
26
26
  * `event.target.closest("tr[data-row-id]")`.
27
27
  */
28
- onRowClick?: (row: TData, event: React.MouseEvent<HTMLElement>) => void;
28
+ onRowClick?: ((row: TData, event: React.MouseEvent<HTMLElement>) => void) | undefined;
29
29
  /**
30
30
  * Return a per-row memo invalidation key. When this key changes for a
31
31
  * specific row, only that row re-renders.
32
32
  */
33
- getRowMemoKey?: (row: TData) => string;
33
+ getRowMemoKey?: ((row: TData) => string) | undefined;
34
34
  /**
35
35
  * Attach a native right-click context menu to each row. Return the menu
36
36
  * items (`ContextMenuItem`, `ContextMenuSeparator`, `ContextMenuSub`, …)
@@ -39,16 +39,23 @@ export interface DataTableBodyProps<TData extends RowData> {
39
39
  *
40
40
  * Wrap the callback in `useCallback` so memoized rows don't re-render.
41
41
  */
42
- renderRowContextMenu?: (row: TData) => React.ReactNode;
42
+ renderRowContextMenu?: ((row: TData) => React.ReactNode) | undefined;
43
+ /**
44
+ * Mark the row that needs a look, such as a holding in deep loss: return
45
+ * `"negative"` or `"warning"` and the row takes a faint wash of that
46
+ * colour, as a `TableRow` with `data-tone` does; `undefined` leaves it
47
+ * plain. The page decides, never the sign. Mark one or two rows.
48
+ */
49
+ getRowTone?: ((row: TData) => "negative" | "warning" | undefined) | undefined;
43
50
  }
44
- export declare function DataTableBody<TData extends RowData>({ children, className, onScroll, onScrolledTop, onScrolledBottom, scrollThreshold, onRowClick, getRowMemoKey, renderRowContextMenu }: DataTableBodyProps<TData>): React.JSX.Element;
51
+ export declare function DataTableBody<TData extends RowData>({ children, className, onScroll, onScrolledTop, onScrolledBottom, scrollThreshold, onRowClick, getRowMemoKey, renderRowContextMenu, getRowTone }: DataTableBodyProps<TData>): React.JSX.Element;
45
52
  export declare namespace DataTableBody {
46
53
  var displayName: string;
47
54
  }
48
55
  export interface DataTableEmptyBodyProps {
49
56
  children?: React.ReactNode;
50
- colSpan?: number;
51
- className?: string;
57
+ colSpan?: number | undefined;
58
+ className?: string | undefined;
52
59
  }
53
60
  /**
54
61
  * Empty state component for data tables.
@@ -79,16 +86,16 @@ export declare namespace DataTableEmptyBody {
79
86
  }
80
87
  export interface DataTableSkeletonProps {
81
88
  children?: React.ReactNode;
82
- colSpan?: number;
89
+ colSpan?: number | undefined;
83
90
  /**
84
91
  * Number of skeleton rows to display.
85
92
  * @default 5
86
93
  * @recommendation Set this to match your page size for better UX (e.g., if page size is 10, set rows={10})
87
94
  */
88
- rows?: number;
89
- className?: string;
90
- cellClassName?: string;
91
- skeletonClassName?: string;
95
+ rows?: number | undefined;
96
+ className?: string | undefined;
97
+ cellClassName?: string | undefined;
98
+ skeletonClassName?: string | undefined;
92
99
  }
93
100
  export declare function DataTableSkeleton({ children, colSpan, rows, className, cellClassName, skeletonClassName }: DataTableSkeletonProps): React.JSX.Element | null;
94
101
  export declare namespace DataTableSkeleton {
@@ -96,8 +103,8 @@ export declare namespace DataTableSkeleton {
96
103
  }
97
104
  export interface DataTableLoadingProps {
98
105
  children?: React.ReactNode;
99
- colSpan?: number;
100
- className?: string;
106
+ colSpan?: number | undefined;
107
+ className?: string | undefined;
101
108
  }
102
109
  export declare function DataTableLoading({ children, colSpan, className }: DataTableLoadingProps): React.JSX.Element | null;
103
110
  export declare namespace DataTableLoading {
@@ -116,8 +123,8 @@ export interface DataTableLoadingMoreProps {
116
123
  * customize the label per-table (e.g. "Loading more venues…").
117
124
  */
118
125
  children?: React.ReactNode;
119
- colSpan?: number;
120
- className?: string;
126
+ colSpan?: number | undefined;
127
+ className?: string | undefined;
121
128
  }
122
129
  /**
123
130
  * Composable "loading more" row for infinite-scroll tables. Renders