@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.
- package/DESIGN.md +4 -3
- package/agents/examples/data-table.tsx +4 -1
- package/agents/examples/metric-strip.tsx +2 -0
- package/dist/components/registry/charts/area-chart-card.d.ts +2 -2
- package/dist/components/registry/charts/bar-chart-card.d.ts +4 -4
- package/dist/components/registry/charts/line-chart-card.d.ts +1 -1
- package/dist/components/registry/dashboard-01/section-cards.d.ts +4 -4
- package/dist/components/registry/dashboardcn/bar-list.d.ts +8 -8
- package/dist/components/registry/dashboardcn/distribution-bar.d.ts +11 -11
- package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +5 -3
- package/dist/components/registry/dashboardcn/kpi-row-card.js +1 -0
- package/dist/components/registry/dashboardcn/sparkline.d.ts +6 -6
- package/dist/components/registry/heatmap/calendar-heatmap.d.ts +50 -50
- package/dist/components/registry/heatmap/status-heatmap.d.ts +44 -44
- package/dist/components/registry/heatmap/weekday-heatmap.d.ts +53 -53
- package/dist/components/registry/minidev/copy-button.d.ts +2 -2
- package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +7 -7
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +5 -5
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +1 -1
- package/dist/components/registry/niko-table/config/feature-detection.d.ts +13 -13
- package/dist/components/registry/niko-table/core/data-table-context.d.ts +5 -5
- package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +3 -3
- package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +2 -2
- package/dist/components/registry/niko-table/core/data-table-root.d.ts +36 -35
- package/dist/components/registry/niko-table/core/data-table-structure.d.ts +29 -22
- package/dist/components/registry/niko-table/core/data-table-structure.js +9 -5
- package/dist/components/registry/niko-table/core/data-table.d.ts +3 -3
- package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +5 -5
- package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +6 -6
- package/dist/components/registry/niko-table/filters/table-column-title.d.ts +2 -2
- package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +9 -9
- package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +7 -7
- package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +7 -7
- package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +2 -2
- package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +3 -3
- package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +4 -4
- package/dist/components/registry/niko-table/lib/styles.js +1 -1
- package/dist/components/registry/niko-table/types/index.d.ts +29 -29
- package/dist/components/registry/sidebar-07/app-sidebar.d.ts +6 -5
- package/dist/components/registry/sidebar-07/nav-main.d.ts +4 -4
- package/dist/components/siyahi/callout.d.ts +1 -1
- package/dist/components/siyahi/change-bar.d.ts +3 -3
- package/dist/components/siyahi/change-grid.d.ts +6 -6
- package/dist/components/siyahi/data-bar.d.ts +2 -2
- package/dist/components/siyahi/data-list.d.ts +1 -1
- package/dist/components/siyahi/data-table-row-count.d.ts +1 -1
- package/dist/components/siyahi/data-table-sort-header.d.ts +1 -1
- package/dist/components/siyahi/delta.d.ts +2 -2
- package/dist/components/siyahi/drawdown-chart.d.ts +2 -2
- package/dist/components/siyahi/histogram-chart.d.ts +5 -5
- package/dist/components/siyahi/local-time.d.ts +1 -1
- package/dist/components/siyahi/page-section.d.ts +1 -1
- package/dist/components/siyahi/page-toc.d.ts +2 -2
- package/dist/components/siyahi/panel-grid.d.ts +2 -2
- package/dist/components/siyahi/price-chart.d.ts +1 -1
- package/dist/components/siyahi/range-position.d.ts +5 -5
- package/dist/components/siyahi/scale-toggle.d.ts +2 -2
- package/dist/components/siyahi/scatter-chart.d.ts +15 -15
- package/dist/components/siyahi/siyahi-provider.d.ts +3 -2
- package/dist/components/siyahi/siyahi-provider.js +1 -4
- package/dist/components/siyahi/slope-chart.d.ts +4 -4
- package/dist/components/siyahi/status-alert.d.ts +1 -1
- package/dist/components/siyahi/status-badge.d.ts +1 -1
- package/dist/components/siyahi/target-rows.d.ts +6 -6
- package/dist/components/siyahi/treemap.d.ts +8 -8
- package/dist/components/siyahi/waterfall-chart.d.ts +3 -3
- package/dist/lib/chart-frame.d.ts +13 -13
- package/dist/lib/chart-marks.d.ts +2 -2
- package/dist/lib/chart-series.d.ts +22 -22
- package/dist/lib/format.d.ts +1 -1
- package/dist/lib/optional.d.ts +7 -0
- package/dist/lib/optional.js +0 -0
- package/dist/lib/scatter.d.ts +7 -7
- package/dist/lib/treemap.d.ts +1 -1
- package/package.json +2 -2
- package/styles/siyahi.css +39 -6
|
@@ -27,7 +27,7 @@ const DataTableHeader = React.memo(function DataTableHeader({ className, sticky
|
|
|
27
27
|
const flexColumnIds = resolveFlexColumnIds(table, !isCompact);
|
|
28
28
|
const columnSizing = table.state.columnSizing;
|
|
29
29
|
return /* @__PURE__ */ jsx(TableHeader, {
|
|
30
|
-
className: cn(sticky && "sticky top-0 z-30 bg-
|
|
30
|
+
className: cn(sticky && "sticky top-0 z-30 bg-(--table-fill)", sticky && "after:absolute after:right-0 after:bottom-0 after:left-0 after:h-px after:bg-border", className),
|
|
31
31
|
children: headerGroups.map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
32
32
|
const isFlex = flexColumnIds.has(header.column.id);
|
|
33
33
|
const headerStyle = {
|
|
@@ -62,7 +62,7 @@ const DataTableHeader = React.memo(function DataTableHeader({ className, sticky
|
|
|
62
62
|
DataTableHeader.displayName = "DataTableHeader";
|
|
63
63
|
/** Fade-pulse animation applied to a flashing cell (keyframe in the provider). */
|
|
64
64
|
const FLASH_ANIMATION = "niko-row-flash 1.2s ease-out";
|
|
65
|
-
const BodyRow = React.memo(function BodyRow({ row, displayIndex, expandColumnId, isCompact, isClickable, isExpanded, isSelected, columnWidths, isRowFlashing, flashingCellKeys, renderRowContextMenu }) {
|
|
65
|
+
const BodyRow = React.memo(function BodyRow({ row, displayIndex, expandColumnId, isCompact, isClickable, isExpanded, isSelected, columnWidths, isRowFlashing, flashingCellKeys, renderRowContextMenu, tone }) {
|
|
66
66
|
const expandCell = isExpanded && expandColumnId ? row.getAllCells().find((c) => c.column.id === expandColumnId) : void 0;
|
|
67
67
|
const visibleCells = row.getVisibleCells();
|
|
68
68
|
const rowElement = /* @__PURE__ */ jsx(TableRow, {
|
|
@@ -72,8 +72,10 @@ const BodyRow = React.memo(function BodyRow({ row, displayIndex, expandColumnId,
|
|
|
72
72
|
"data-parity": displayIndex % 2 === 0 ? "even" : "odd",
|
|
73
73
|
"data-expanded": isExpanded ? "true" : void 0,
|
|
74
74
|
"data-state": isSelected ? "selected" : void 0,
|
|
75
|
+
"data-tone": tone,
|
|
75
76
|
className: cn(isClickable && "cursor-pointer", "group data-[context-menu-open]:bg-muted/50"),
|
|
76
77
|
children: visibleCells.map((cell) => {
|
|
78
|
+
const pinned = !isCompact && cell.column.getIsPinned();
|
|
77
79
|
const flashing = isRowFlashing || flashingCellKeys.has(flashCellKey(row.id, cell.column.id));
|
|
78
80
|
const cellStyle = {
|
|
79
81
|
width: columnWidths.get(cell.column.id),
|
|
@@ -84,8 +86,9 @@ const BodyRow = React.memo(function BodyRow({ row, displayIndex, expandColumnId,
|
|
|
84
86
|
"data-flash": flashing ? "true" : void 0,
|
|
85
87
|
"data-col-id": cell.column.id,
|
|
86
88
|
"data-numeric": cell.column.columnDef.meta?.variant === "number" || void 0,
|
|
89
|
+
"data-pinned": pinned || void 0,
|
|
87
90
|
style: cellStyle,
|
|
88
|
-
className: cn(!cell.getIsGrouped() && "truncate",
|
|
91
|
+
className: cn(!cell.getIsGrouped() && "truncate", pinned && "bg-linear-to-r group-hover:from-muted/50 group-hover:to-muted/50 group-data-[context-menu-open]:from-muted/50 group-data-[context-menu-open]:to-muted/50 group-data-[state=selected]:from-muted group-data-[state=selected]:to-muted"),
|
|
89
92
|
children: renderCellContent(cell)
|
|
90
93
|
}, cell.id);
|
|
91
94
|
})
|
|
@@ -102,7 +105,7 @@ const BodyRow = React.memo(function BodyRow({ row, displayIndex, expandColumnId,
|
|
|
102
105
|
}) })] });
|
|
103
106
|
});
|
|
104
107
|
BodyRow.displayName = "BodyRow";
|
|
105
|
-
function DataTableBody({ children, className, onScroll, onScrolledTop, onScrolledBottom, scrollThreshold = 50, onRowClick, getRowMemoKey, renderRowContextMenu }) {
|
|
108
|
+
function DataTableBody({ children, className, onScroll, onScrolledTop, onScrolledBottom, scrollThreshold = 50, onRowClick, getRowMemoKey, renderRowContextMenu, getRowTone }) {
|
|
106
109
|
const { table, columns, isLoading, flashingRowIds, flashingCellKeys, registerRowScroller, headerMinWidths, isCompact } = useDataTable();
|
|
107
110
|
const { rows } = table.getRowModel();
|
|
108
111
|
const containerRef = React.useRef(null);
|
|
@@ -245,7 +248,8 @@ function DataTableBody({ children, className, onScroll, onScrolledTop, onScrolle
|
|
|
245
248
|
rowMemoKey: getRowMemoKey ? getRowMemoKey(row.original) : "",
|
|
246
249
|
isRowFlashing: flashingRowIds.has(row.id),
|
|
247
250
|
flashingCellKeys,
|
|
248
|
-
renderRowContextMenu: resolvedRenderRowContextMenu
|
|
251
|
+
renderRowContextMenu: resolvedRenderRowContextMenu,
|
|
252
|
+
tone: getRowTone?.(row.original)
|
|
249
253
|
}, row.id)) : null, children]
|
|
250
254
|
});
|
|
251
255
|
}
|
|
@@ -8,20 +8,20 @@ export interface DataTableContainerProps extends React.AriaAttributes {
|
|
|
8
8
|
* and applied as inline styles to ensure scroll event callbacks work reliably.
|
|
9
9
|
* For other height utilities, use the height/maxHeight props directly.
|
|
10
10
|
*/
|
|
11
|
-
className?: string;
|
|
11
|
+
className?: string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Sets the height of the table container.
|
|
14
14
|
* When provided, enables vertical scrolling and allows DataTableBody/DataTableVirtualizedBody
|
|
15
15
|
* to use onScroll, onScrolledTop, and onScrolledBottom callbacks.
|
|
16
16
|
* Takes precedence over height utilities in className.
|
|
17
17
|
*/
|
|
18
|
-
height?: number | string;
|
|
18
|
+
height?: number | string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Sets the maximum height of the table container.
|
|
21
21
|
* Defaults to the height value if not specified.
|
|
22
22
|
* Takes precedence over max-height utilities in className.
|
|
23
23
|
*/
|
|
24
|
-
maxHeight?: number | string;
|
|
24
|
+
maxHeight?: number | string | undefined;
|
|
25
25
|
}
|
|
26
26
|
export declare function DataTable({ children, className, height, maxHeight, "aria-label": label, "aria-labelledby": labelledBy }: DataTableContainerProps): React.JSX.Element;
|
|
27
27
|
export declare namespace DataTable {
|
|
@@ -2,25 +2,25 @@ import React from "react";
|
|
|
2
2
|
//#region src/components/registry/niko-table/filters/table-column-actions.d.ts
|
|
3
3
|
export interface TableColumnActionsProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
5
|
+
className?: string | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* Optional label shown at the top of the dropdown.
|
|
8
8
|
* @default "Column Actions"
|
|
9
9
|
*/
|
|
10
|
-
label?: string;
|
|
10
|
+
label?: string | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* Whether to show a visual indicator when actions are active.
|
|
13
13
|
*/
|
|
14
|
-
isActive?: boolean;
|
|
14
|
+
isActive?: boolean | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Custom trigger element. If not provided, uses a MoreVertical icon button.
|
|
17
17
|
*/
|
|
18
|
-
trigger?: React.ReactElement;
|
|
18
|
+
trigger?: React.ReactElement | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Alignment of the dropdown content.
|
|
21
21
|
* @default "end"
|
|
22
22
|
*/
|
|
23
|
-
align?: "start" | "center" | "end";
|
|
23
|
+
align?: "start" | "center" | "end" | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* A simple dropdown container for composing column actions.
|
|
@@ -15,10 +15,10 @@ import { RowData } from "@tanstack/react-table";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function TableColumnSortOptions<TData extends RowData, TValue>({ column, table: propTable, variant: propVariant, withSeparator }: {
|
|
17
17
|
column: DataTableColumn<TData, TValue>;
|
|
18
|
-
table?: DataTableInstance<TData
|
|
19
|
-
variant?: SortIconVariant;
|
|
18
|
+
table?: DataTableInstance<TData> | undefined;
|
|
19
|
+
variant?: SortIconVariant | undefined;
|
|
20
20
|
/** Whether to render a separator before the options. @default true */
|
|
21
|
-
withSeparator?: boolean;
|
|
21
|
+
withSeparator?: boolean | undefined;
|
|
22
22
|
}): React.JSX.Element;
|
|
23
23
|
export declare namespace TableColumnSortOptions {
|
|
24
24
|
var displayName: string;
|
|
@@ -41,9 +41,9 @@ export declare namespace TableColumnSortOptions {
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function TableColumnSortMenu<TData extends RowData, TValue>({ column, table: propTable, variant: propVariant, className }: {
|
|
43
43
|
column: DataTableColumn<TData, TValue>;
|
|
44
|
-
table?: DataTableInstance<TData
|
|
45
|
-
variant?: SortIconVariant;
|
|
46
|
-
className?: string;
|
|
44
|
+
table?: DataTableInstance<TData> | undefined;
|
|
45
|
+
variant?: SortIconVariant | undefined;
|
|
46
|
+
className?: string | undefined;
|
|
47
47
|
}): React.JSX.Element | null;
|
|
48
48
|
export declare namespace TableColumnSortMenu {
|
|
49
49
|
var displayName: string;
|
|
@@ -7,8 +7,8 @@ import { RowData } from "@tanstack/react-table";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function TableColumnTitle<TData extends RowData, TValue>({ column, title, className, children }: {
|
|
9
9
|
column: DataTableColumn<TData, TValue>;
|
|
10
|
-
title?: string;
|
|
11
|
-
className?: string;
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}): React.JSX.Element;
|
|
14
14
|
export declare namespace TableColumnTitle {
|
|
@@ -3,24 +3,24 @@ import * as React$1 from "react";
|
|
|
3
3
|
import { RowData } from "@tanstack/react-table";
|
|
4
4
|
//#region src/components/registry/niko-table/filters/table-faceted-filter.d.ts
|
|
5
5
|
export interface TableFacetedFilterProps<TData extends RowData, TValue> {
|
|
6
|
-
column?: DataTableColumn<TData, TValue
|
|
7
|
-
title?: string;
|
|
6
|
+
column?: DataTableColumn<TData, TValue> | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
8
|
options: Option[];
|
|
9
|
-
multiple?: boolean;
|
|
9
|
+
multiple?: boolean | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Callback fired when filter value changes
|
|
12
12
|
* Useful for server-side filtering or external state management
|
|
13
13
|
*/
|
|
14
|
-
onValueChange?: (value: string[] | undefined) => void;
|
|
14
|
+
onValueChange?: ((value: string[] | undefined) => void) | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Optional custom trigger element
|
|
17
17
|
*/
|
|
18
|
-
trigger?: React$1.ReactElement;
|
|
18
|
+
trigger?: React$1.ReactElement | undefined;
|
|
19
19
|
}
|
|
20
20
|
export declare function useTableFacetedFilter<TData extends RowData, TValue = unknown>({ column, onValueChange, multiple }: {
|
|
21
|
-
column?: DataTableColumn<TData, TValue
|
|
22
|
-
onValueChange?: (value: string[] | undefined) => void;
|
|
23
|
-
multiple?: boolean;
|
|
21
|
+
column?: DataTableColumn<TData, TValue> | undefined;
|
|
22
|
+
onValueChange?: ((value: string[] | undefined) => void) | undefined;
|
|
23
|
+
multiple?: boolean | undefined;
|
|
24
24
|
}): {
|
|
25
25
|
selectedValues: Set<any>;
|
|
26
26
|
onItemSelect: (option: Option, isSelected: boolean) => void;
|
|
@@ -31,7 +31,7 @@ export declare namespace TableFacetedFilter {
|
|
|
31
31
|
var displayName: string;
|
|
32
32
|
}
|
|
33
33
|
export declare function TableFacetedFilterContent({ title, options, selectedValues, onItemSelect, onReset }: {
|
|
34
|
-
title?: string;
|
|
34
|
+
title?: string | undefined;
|
|
35
35
|
options: Option[];
|
|
36
36
|
selectedValues: Set<string>;
|
|
37
37
|
onItemSelect: (option: Option, isSelected: boolean) => void;
|
|
@@ -4,13 +4,13 @@ import { RowData } from "@tanstack/react-table";
|
|
|
4
4
|
//#region src/components/registry/niko-table/filters/table-search-filter.d.ts
|
|
5
5
|
export interface TableSearchFilterProps<TData extends RowData> {
|
|
6
6
|
table: DataTableInstance<TData>;
|
|
7
|
-
className?: string;
|
|
8
|
-
placeholder?: string;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
placeholder?: string | undefined;
|
|
9
9
|
/** The field's accessible name, such as "Filter holdings". */
|
|
10
|
-
label?: string;
|
|
11
|
-
showClearButton?: boolean;
|
|
12
|
-
onChange?: (value: string) => void;
|
|
13
|
-
value?: string;
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
showClearButton?: boolean | undefined;
|
|
12
|
+
onChange?: ((value: string) => void) | undefined;
|
|
13
|
+
value?: string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Debounce ms before pushing the typed value into table state. The
|
|
16
16
|
* input reflects keystrokes immediately; only the call to
|
|
@@ -29,7 +29,7 @@ export interface TableSearchFilterProps<TData extends RowData> {
|
|
|
29
29
|
*
|
|
30
30
|
* @default 0
|
|
31
31
|
*/
|
|
32
|
-
debounceMs?: number;
|
|
32
|
+
debounceMs?: number | undefined;
|
|
33
33
|
}
|
|
34
34
|
export declare function TableSearchFilter<TData extends RowData>({ table, className, placeholder, label, showClearButton, onChange, value, debounceMs }: TableSearchFilterProps<TData>): React$1.JSX.Element;
|
|
35
35
|
export declare namespace TableSearchFilter {
|
|
@@ -6,36 +6,36 @@ export interface GenerateOptionsConfig {
|
|
|
6
6
|
* Whether to include counts for each option label
|
|
7
7
|
* @default true
|
|
8
8
|
*/
|
|
9
|
-
showCounts?: boolean;
|
|
9
|
+
showCounts?: boolean | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* If true, recompute counts based on the filtered rows; otherwise use all core rows
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
14
|
-
dynamicCounts?: boolean;
|
|
14
|
+
dynamicCounts?: boolean | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* If true, only generate options from filtered rows. If false, generate from all rows.
|
|
17
17
|
* This controls which rows are used to generate the option list itself.
|
|
18
18
|
* Note: This is separate from dynamicCounts which controls count calculation.
|
|
19
19
|
* @default true
|
|
20
20
|
*/
|
|
21
|
-
limitToFilteredRows?: boolean;
|
|
21
|
+
limitToFilteredRows?: boolean | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Only generate options for these column ids (if provided)
|
|
24
24
|
*/
|
|
25
|
-
includeColumns?: string[];
|
|
25
|
+
includeColumns?: string[] | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Exclude these column ids from option generation
|
|
28
28
|
*/
|
|
29
|
-
excludeColumns?: string[];
|
|
29
|
+
excludeColumns?: string[] | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Optional cap on number of options per column (after sorting)
|
|
32
32
|
*/
|
|
33
|
-
limitPerColumn?: number;
|
|
33
|
+
limitPerColumn?: number | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Default merge strategy when a column does not provide meta.mergeStrategy.
|
|
36
36
|
* Column-level mergeStrategy still takes precedence.
|
|
37
37
|
*/
|
|
38
|
-
mergeStrategy?: "preserve" | "augment" | "replace";
|
|
38
|
+
mergeStrategy?: "preserve" | "augment" | "replace" | undefined;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Generate a map of options for select/multiSelect columns based on table data.
|
|
@@ -11,7 +11,7 @@ export interface BuildFacetedOptionsConfig {
|
|
|
11
11
|
* columns that are not declared as `select`/`multiSelect` variants but are
|
|
12
12
|
* still being used with a faceted filter (boolean, text, etc.).
|
|
13
13
|
*/
|
|
14
|
-
staticOptions?: Option[];
|
|
14
|
+
staticOptions?: Option[] | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Narrow the returned options to values that exist in rows passing every
|
|
17
17
|
* *other* active filter (the current column's own filter is excluded).
|
|
@@ -37,7 +37,7 @@ export interface BuildFacetedOptionsConfig {
|
|
|
37
37
|
* present. Receives the stringified row value, returns the display label.
|
|
38
38
|
* Ignored when `staticOptions` is provided.
|
|
39
39
|
*/
|
|
40
|
-
formatOptionLabel?: (value: string) => string;
|
|
40
|
+
formatOptionLabel?: ((value: string) => string) | undefined;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Pure builder for the option list surfaced by a faceted filter. Handles
|
|
@@ -17,16 +17,16 @@ export interface DataTableColumnResizeHandleProps<TData extends RowData> {
|
|
|
17
17
|
* from the rendered width (no jump) and, on release, writes an explicit width
|
|
18
18
|
* — which pins the column and hands the fill to the next eligible column.
|
|
19
19
|
*/
|
|
20
|
-
isFlex?: boolean;
|
|
20
|
+
isFlex?: boolean | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Drive the resize preview line during a flex drag (from the DataTable
|
|
23
23
|
* context). Passed `{ resizingColumnId, deltaOffset }` while dragging, `null`
|
|
24
24
|
* on release.
|
|
25
25
|
*/
|
|
26
|
-
setResizePreview?: (info: {
|
|
26
|
+
setResizePreview?: ((info: {
|
|
27
27
|
resizingColumnId: string | null;
|
|
28
28
|
deltaOffset: number;
|
|
29
|
-
} | null) => void;
|
|
29
|
+
} | null) => void) | undefined;
|
|
30
30
|
}
|
|
31
31
|
export declare function DataTableColumnResizeHandle<TData extends RowData>({ header, isFlex, setResizePreview }: DataTableColumnResizeHandleProps<TData>): React$1.JSX.Element;
|
|
32
32
|
//#endregion
|
|
@@ -27,9 +27,9 @@ export interface ScrollEvent {
|
|
|
27
27
|
* a `useEffect` already key on those callbacks via their own deps.
|
|
28
28
|
*/
|
|
29
29
|
export declare function createScrollHandler({ onScroll, onScrolledTop, onScrolledBottom, scrollThreshold }: {
|
|
30
|
-
onScroll?: (event: ScrollEvent) => void;
|
|
31
|
-
onScrolledTop?: () => void;
|
|
32
|
-
onScrolledBottom?: () => void;
|
|
33
|
-
scrollThreshold?: number;
|
|
30
|
+
onScroll?: ((event: ScrollEvent) => void) | undefined;
|
|
31
|
+
onScrolledTop?: (() => void) | undefined;
|
|
32
|
+
onScrolledBottom?: (() => void) | undefined;
|
|
33
|
+
scrollThreshold?: number | undefined;
|
|
34
34
|
}): (event: Event) => void;
|
|
35
35
|
//#endregion
|
|
@@ -16,7 +16,7 @@ const getCommonPinningStyles = (column, isHeader = false, pinningEnabled = true)
|
|
|
16
16
|
maxWidth: columnSize,
|
|
17
17
|
flexShrink: 0,
|
|
18
18
|
zIndex: isHeader ? 20 : 10,
|
|
19
|
-
backgroundColor: "var(--
|
|
19
|
+
backgroundColor: "var(--table-fill)",
|
|
20
20
|
boxShadow: isLeft ? "inset -1px 0 0 0 var(--border)" : "inset 1px 0 0 0 var(--border)"
|
|
21
21
|
};
|
|
22
22
|
};
|
|
@@ -5,8 +5,8 @@ import { Cell, Column, ColumnDef, Header, ReactTable, Row, RowData, TableFeature
|
|
|
5
5
|
//#region src/components/registry/niko-table/types/index.d.ts
|
|
6
6
|
declare module "@tanstack/react-table" {
|
|
7
7
|
interface ColumnMeta<TFeatures extends TableFeatures, TData extends RowData, TValue> {
|
|
8
|
-
label?: string;
|
|
9
|
-
placeholder?: string;
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
placeholder?: string | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Which column absorbs the leftover row width when column resizing is on
|
|
12
12
|
* (needs `<DataTableColumnResize />`). Filling is ON BY DEFAULT — the first
|
|
@@ -22,7 +22,7 @@ declare module "@tanstack/react-table" {
|
|
|
22
22
|
* persistence side effects. Turn filling off for a whole table with
|
|
23
23
|
* `TableMeta.disableFlexFill`.
|
|
24
24
|
*/
|
|
25
|
-
flex?: boolean;
|
|
25
|
+
flex?: boolean | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Never hide this column to fit. Once any column sets it, a table whose
|
|
28
28
|
* columns do not fit its width hides the others, rightmost first, until
|
|
@@ -31,39 +31,39 @@ declare module "@tanstack/react-table" {
|
|
|
31
31
|
* its result. Read `useDataTable().compactColumns?.hidden` in a cell to
|
|
32
32
|
* fold a hidden figure under a kept one.
|
|
33
33
|
*/
|
|
34
|
-
compact?: boolean;
|
|
35
|
-
variant?: FilterVariant;
|
|
36
|
-
options?: Option[];
|
|
37
|
-
range?: [number, number];
|
|
34
|
+
compact?: boolean | undefined;
|
|
35
|
+
variant?: FilterVariant | undefined;
|
|
36
|
+
options?: Option[] | undefined;
|
|
37
|
+
range?: [number, number] | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* Automatically generate options for select/multiSelect columns if not provided.
|
|
40
40
|
* When true and no static `options` exist, generation logic (wrappers / hooks) may supply them.
|
|
41
41
|
*/
|
|
42
|
-
autoOptions?: boolean;
|
|
42
|
+
autoOptions?: boolean | undefined;
|
|
43
43
|
/** Whether to automatically rename option labels using formatLabel. When false, uses raw value as label. */
|
|
44
|
-
autoOptionsFormat?: boolean;
|
|
44
|
+
autoOptionsFormat?: boolean | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* Per-column label formatter applied when options are auto-derived from
|
|
47
47
|
* row data. Receives the stringified row value and returns the display
|
|
48
48
|
* label. Wins over `autoOptionsFormat` when present. Ignored when the
|
|
49
49
|
* caller passes explicit `options`.
|
|
50
50
|
*/
|
|
51
|
-
formatOptionLabel?: (value: string) => string;
|
|
51
|
+
formatOptionLabel?: ((value: string) => string) | undefined;
|
|
52
52
|
/** Per-column override for showing counts (falls back to wrapper prop). */
|
|
53
|
-
showCounts?: boolean;
|
|
53
|
+
showCounts?: boolean | undefined;
|
|
54
54
|
/** Per-column override for using filtered rows for counts (falls back to wrapper prop). */
|
|
55
|
-
dynamicCounts?: boolean;
|
|
55
|
+
dynamicCounts?: boolean | undefined;
|
|
56
56
|
/** Merge strategy override: preserve | augment | replace (falls back to wrapper prop). */
|
|
57
|
-
mergeStrategy?: "preserve" | "augment" | "replace";
|
|
58
|
-
unit?: string;
|
|
57
|
+
mergeStrategy?: "preserve" | "augment" | "replace" | undefined;
|
|
58
|
+
unit?: string | undefined;
|
|
59
59
|
icon?: React$1.ComponentType<{
|
|
60
|
-
className?: string;
|
|
61
|
-
}
|
|
62
|
-
expandedContent?: (row: TData) => React$1.ReactNode;
|
|
60
|
+
className?: string | undefined;
|
|
61
|
+
}> | undefined;
|
|
62
|
+
expandedContent?: ((row: TData) => React$1.ReactNode) | undefined;
|
|
63
63
|
}
|
|
64
64
|
interface TableMeta<TFeatures extends TableFeatures, TData extends RowData> {
|
|
65
|
-
joinOperator?: JoinOperator;
|
|
66
|
-
hasIndividualJoinOperators?: boolean;
|
|
65
|
+
joinOperator?: JoinOperator | undefined;
|
|
66
|
+
hasIndividualJoinOperators?: boolean | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* Turn off default flex fill for the whole table, so columns size to their
|
|
69
69
|
* own widths and the table scrolls horizontally instead of stretching to
|
|
@@ -73,16 +73,16 @@ declare module "@tanstack/react-table" {
|
|
|
73
73
|
* — it's read when table options are built, so toggling it at runtime
|
|
74
74
|
* alone won't re-apply until another table state change rebuilds them.
|
|
75
75
|
*/
|
|
76
|
-
disableFlexFill?: boolean;
|
|
76
|
+
disableFlexFill?: boolean | undefined;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
export interface Option {
|
|
80
80
|
label: string;
|
|
81
81
|
value: string;
|
|
82
|
-
count?: number;
|
|
82
|
+
count?: number | undefined;
|
|
83
83
|
icon?: React$1.ComponentType<{
|
|
84
|
-
className?: string;
|
|
85
|
-
}
|
|
84
|
+
className?: string | undefined;
|
|
85
|
+
}> | undefined;
|
|
86
86
|
}
|
|
87
87
|
export type FilterVariant = FilterVariant$1;
|
|
88
88
|
export type FilterOperator = FilterOperator$1;
|
|
@@ -96,7 +96,7 @@ export interface ExtendedColumnFilter<TData> {
|
|
|
96
96
|
variant: FilterVariant;
|
|
97
97
|
operator: FilterOperator;
|
|
98
98
|
filterId: string;
|
|
99
|
-
joinOperator?: JoinOperator;
|
|
99
|
+
joinOperator?: JoinOperator | undefined;
|
|
100
100
|
}
|
|
101
101
|
/** Global filter type */
|
|
102
102
|
export type GlobalFilter = string | Record<string, unknown>;
|
|
@@ -111,11 +111,11 @@ export interface ExtendedColumnSort<TData> {
|
|
|
111
111
|
* Query keys for URL state management
|
|
112
112
|
*/
|
|
113
113
|
export interface QueryKeys {
|
|
114
|
-
page?: string;
|
|
115
|
-
perPage?: string;
|
|
116
|
-
sort?: string;
|
|
117
|
-
filters?: string;
|
|
118
|
-
joinOperator?: string;
|
|
114
|
+
page?: string | undefined;
|
|
115
|
+
perPage?: string | undefined;
|
|
116
|
+
sort?: string | undefined;
|
|
117
|
+
filters?: string | undefined;
|
|
118
|
+
joinOperator?: string | undefined;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Extended column definition for data table
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Optional } from "../../../lib/optional.js";
|
|
1
2
|
import { NavMain } from "./nav-main.js";
|
|
2
3
|
import { NavProjects } from "./nav-projects.js";
|
|
3
4
|
import { NavUser } from "./nav-user.js";
|
|
@@ -5,14 +6,14 @@ import { TeamSwitcher } from "./team-switcher.js";
|
|
|
5
6
|
import { Sidebar } from "../../ui/sidebar.js";
|
|
6
7
|
import * as React$1 from "react";
|
|
7
8
|
//#region src/components/registry/sidebar-07/app-sidebar.d.ts
|
|
8
|
-
export interface AppSidebarProps extends React$1.ComponentProps<typeof Sidebar
|
|
9
|
+
export interface AppSidebarProps extends Optional<React$1.ComponentProps<typeof Sidebar>> {
|
|
9
10
|
navMain: React$1.ComponentProps<typeof NavMain>["items"];
|
|
10
|
-
navLabel?: string;
|
|
11
|
+
navLabel?: string | undefined;
|
|
11
12
|
/** Shown at the top instead of the team switcher. */
|
|
12
13
|
header?: React$1.ReactNode;
|
|
13
|
-
teams?: React$1.ComponentProps<typeof TeamSwitcher>["teams"];
|
|
14
|
-
projects?: React$1.ComponentProps<typeof NavProjects>["projects"];
|
|
15
|
-
user?: React$1.ComponentProps<typeof NavUser>["user"];
|
|
14
|
+
teams?: React$1.ComponentProps<typeof TeamSwitcher>["teams"] | undefined;
|
|
15
|
+
projects?: React$1.ComponentProps<typeof NavProjects>["projects"] | undefined;
|
|
16
|
+
user?: React$1.ComponentProps<typeof NavUser>["user"] | undefined;
|
|
16
17
|
}
|
|
17
18
|
export declare function AppSidebar({ navMain, navLabel, header, teams, projects, user, collapsible, className, ...props }: AppSidebarProps): React$1.JSX.Element;
|
|
18
19
|
//#endregion
|
|
@@ -5,13 +5,13 @@ export declare function NavMain({ items, label }: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
url: string;
|
|
7
7
|
icon: React.ReactNode;
|
|
8
|
-
isActive?: boolean;
|
|
9
|
-
linkProps?: Omit<React.ComponentProps<"a">, "href"
|
|
8
|
+
isActive?: boolean | undefined;
|
|
9
|
+
linkProps?: Omit<React.ComponentProps<"a">, "href"> | undefined;
|
|
10
10
|
items?: {
|
|
11
11
|
title: string;
|
|
12
12
|
url: string;
|
|
13
|
-
isActive?: boolean;
|
|
14
|
-
}[];
|
|
13
|
+
isActive?: boolean | undefined;
|
|
14
|
+
}[] | undefined;
|
|
15
15
|
}[];
|
|
16
16
|
}): import("react").JSX.Element;
|
|
17
17
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
3
3
|
//#region src/components/siyahi/callout.d.ts
|
|
4
4
|
export interface CalloutProps extends Omit<ComponentProps<"aside">, "title"> {
|
|
5
5
|
/** neutral for an aside, accent for a key point, warning for a caution, positive or negative for a gain or a loss. */
|
|
6
|
-
tone?: Tone;
|
|
6
|
+
tone?: Tone | undefined;
|
|
7
7
|
/** A lucide icon, drawn in the tone's colour. */
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
title?: ReactNode;
|
|
@@ -9,9 +9,9 @@ export interface ChangeBarProps {
|
|
|
9
9
|
* Draws the bar from a centre line, losses leftward and gains rightward. Pass it when the column holds both signs:
|
|
10
10
|
* rows.some((row) => row.change < 0) && rows.some((row) => row.change > 0).
|
|
11
11
|
*/
|
|
12
|
-
diverging?: boolean;
|
|
13
|
-
format?: DeltaProps["format"];
|
|
14
|
-
className?: string;
|
|
12
|
+
diverging?: boolean | undefined;
|
|
13
|
+
format?: DeltaProps["format"] | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A table cell's change as a Delta over a 3px bar whose length is the change's size against the column's largest, so
|
|
@@ -4,23 +4,23 @@ export interface ChangeGridRow {
|
|
|
4
4
|
/** One figure per column, in column order; null where there is none, such as a month still to come. NaN counts as none. */
|
|
5
5
|
values: readonly (number | null)[];
|
|
6
6
|
/** The row's total as the page works it out: monthly returns compound rather than add. Leave it out for no total. */
|
|
7
|
-
total?: number | null;
|
|
7
|
+
total?: number | null | undefined;
|
|
8
8
|
/** Unique key when labels repeat. Defaults to `label`. */
|
|
9
|
-
key?: string;
|
|
9
|
+
key?: string | undefined;
|
|
10
10
|
}
|
|
11
11
|
export interface ChangeGridProps {
|
|
12
12
|
/** The column heads, such as the months of a financial year. */
|
|
13
13
|
columns: readonly string[];
|
|
14
14
|
rows: readonly ChangeGridRow[];
|
|
15
15
|
/** "pct" takes fractions, 0.025 for 2.5%; "money" takes amounts, written short in one unit. */
|
|
16
|
-
format?: "pct" | "money";
|
|
16
|
+
format?: "pct" | "money" | undefined;
|
|
17
17
|
/** The change that takes the deepest tint, as a size. Defaults to the grid's largest, totals aside. */
|
|
18
|
-
range?: number;
|
|
18
|
+
range?: number | undefined;
|
|
19
19
|
/** Heads the total column, which draws when any row has a total. */
|
|
20
|
-
totalLabel?: string;
|
|
20
|
+
totalLabel?: string | undefined;
|
|
21
21
|
/** Names the table for a screen reader, such as "Monthly sales growth by year". */
|
|
22
22
|
label: string;
|
|
23
|
-
className?: string;
|
|
23
|
+
className?: string | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Signed changes laid out rows by columns, such as each month of each year, every cell tinted by its sign and size
|
|
@@ -5,10 +5,10 @@ export interface DataBarProps {
|
|
|
5
5
|
/** The value a full bar stands for, usually the column's largest: Math.max(...rows.map((row) => row.value)). */
|
|
6
6
|
max: number;
|
|
7
7
|
/** "sign" draws a gain in --positive and a loss in --negative; by default every bar is --chart-1. */
|
|
8
|
-
tone?: "chart" | "sign";
|
|
8
|
+
tone?: "chart" | "sign" | undefined;
|
|
9
9
|
/** The figure, as the page formats it. */
|
|
10
10
|
children: ReactNode;
|
|
11
|
-
className?: string;
|
|
11
|
+
className?: string | undefined;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* A table cell's figure behind a short bar whose length is the figure's share of max, so a column reads as a chart.
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
//#region src/components/siyahi/data-list.d.ts
|
|
3
3
|
/** Label and value pairs, such as a record's fields in a card. */
|
|
4
4
|
export declare function DataList({ className, children }: {
|
|
5
|
-
className?: string;
|
|
5
|
+
className?: string | undefined;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
8
|
export interface DataListItemProps {
|
|
@@ -4,7 +4,7 @@ export interface DataTableRowCountProps {
|
|
|
4
4
|
/** What a row is, plural: "positions" prints "48 positions" while nothing is filtered. */
|
|
5
5
|
unit: string;
|
|
6
6
|
/** Rows before any filter. Defaults to the table's data; pass it when the page narrowed the data before the table. */
|
|
7
|
-
total?: number;
|
|
7
|
+
total?: number | undefined;
|
|
8
8
|
}
|
|
9
9
|
/** How many rows the filters leave: "12 of 48", or "48 positions" when they leave all. For a table toolbar, at its end. */
|
|
10
10
|
export declare function DataTableRowCount<TData extends RowData>({ unit, total }: DataTableRowCountProps): import("react").JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { RowData } from "@tanstack/react-table";
|
|
|
7
7
|
* `header: () => <DataTableSortHeader />`; the title defaults to `meta.label`.
|
|
8
8
|
*/
|
|
9
9
|
export declare function DataTableSortHeader<TData extends RowData>({ title }: {
|
|
10
|
-
title?: string;
|
|
10
|
+
title?: string | undefined;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
12
12
|
export declare namespace DataTableSortHeader {
|
|
13
13
|
var displayName: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
export interface DeltaProps {
|
|
3
3
|
/** The signed change. For `pct`, a fraction: 0.025 is 2.5%. */
|
|
4
4
|
value: number;
|
|
5
|
-
format?: "pct" | "money";
|
|
6
|
-
className?: string;
|
|
5
|
+
format?: "pct" | "money" | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* A signed change: the figure in the surrounding text colour with its sign, and a trend icon in --positive or
|
|
@@ -21,9 +21,9 @@ export interface DrawdownChartCardProps<T extends object, K extends keyof T> ext
|
|
|
21
21
|
/** The field holding the level, such as the day's cash balance or a fund's value. */
|
|
22
22
|
levelKey: NumericKey<T>;
|
|
23
23
|
/** Writes the level and the peak in the tooltip. Defaults to useFormat().money. */
|
|
24
|
-
levelFormatter?: (value: number) => string;
|
|
24
|
+
levelFormatter?: ((value: number) => string) | undefined;
|
|
25
25
|
/** Names the fall in the legend and tooltip. */
|
|
26
|
-
label?: string;
|
|
26
|
+
label?: string | undefined;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* How far a level sits below the highest it had reached, over time: a fund's or a cash balance's fall from its
|