@siyahi/ui 0.1.9-next.32 → 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/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 +4 -4
- 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 +22 -22
- 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/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
|
@@ -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
|
|
@@ -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
|
|
@@ -38,15 +38,15 @@ export interface HistogramChartCardProps extends Pick<SeriesChartProps<Histogram
|
|
|
38
38
|
/** The raw values, one per item, such as each request's response time. */
|
|
39
39
|
values: readonly number[];
|
|
40
40
|
/** About how many buckets; the width is rounded, so the count varies a little. */
|
|
41
|
-
bins?: number;
|
|
41
|
+
bins?: number | undefined;
|
|
42
42
|
/** Writes the bucket edges and the marks, such as (v) => `${v} ms`. Defaults to the locale's numbers. */
|
|
43
|
-
valueFormatter?: (value: number) => string;
|
|
43
|
+
valueFormatter?: ((value: number) => string) | undefined;
|
|
44
44
|
/** The bucket edges under the axis, when they should be shorter than valueFormatter: 1,000 against 1,000 ms. */
|
|
45
|
-
tickFormatter?: (value: number) => string;
|
|
45
|
+
tickFormatter?: ((value: number) => string) | undefined;
|
|
46
46
|
/** What is counted, in the legend and tooltip, such as "Requests". */
|
|
47
|
-
countLabel?: string;
|
|
47
|
+
countLabel?: string | undefined;
|
|
48
48
|
/** Percentiles to mark with a line at their bucket; their exact values are written under the chart. */
|
|
49
|
-
marks?: readonly HistogramMark[];
|
|
49
|
+
marks?: readonly HistogramMark[] | undefined;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* How values spread: counts in buckets of one round width, such as response times by 50 ms, with the median or a
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export interface LocalTimeProps {
|
|
3
3
|
value: Date | number | string;
|
|
4
4
|
/** Write the date, in the same zone, before the time: 20 Oct 2026, 14:30 IST. */
|
|
5
|
-
withDate?: boolean;
|
|
5
|
+
withDate?: boolean | undefined;
|
|
6
6
|
}
|
|
7
7
|
/** A time in the configured zone (14:30 IST), with the viewer's own clock in a tooltip. */
|
|
8
8
|
export declare function LocalTime({ value, withDate }: LocalTimeProps): import("react").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
//#region src/components/siyahi/page-section.d.ts
|
|
3
3
|
export interface PageSectionProps {
|
|
4
4
|
/** Anchor for a table of contents; the section scrolls in with room above it. */
|
|
5
|
-
id?: string;
|
|
5
|
+
id?: string | undefined;
|
|
6
6
|
/** Small muted line above the title, such as "Part 2". */
|
|
7
7
|
eyebrow?: ReactNode;
|
|
8
8
|
title: ReactNode;
|
|
@@ -7,9 +7,9 @@ export interface PageTocItem {
|
|
|
7
7
|
export interface PageTocProps {
|
|
8
8
|
items: PageTocItem[];
|
|
9
9
|
/** Names the navigation for screen readers. */
|
|
10
|
-
label?: string;
|
|
10
|
+
label?: string | undefined;
|
|
11
11
|
/** Layout only, such as `top-14` under a sticky page header. */
|
|
12
|
-
className?: string;
|
|
12
|
+
className?: string | undefined;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* A long page's sections as one sticky "On this page" index. It stays at the top while the reader scrolls,
|
|
@@ -8,9 +8,9 @@ declare const COLUMNS: {
|
|
|
8
8
|
};
|
|
9
9
|
export interface PanelGridProps {
|
|
10
10
|
/** Blocks across on a wide page; two on a medium one, and one on a phone. */
|
|
11
|
-
columns?: keyof typeof COLUMNS;
|
|
11
|
+
columns?: keyof typeof COLUMNS | undefined;
|
|
12
12
|
children: ReactNode;
|
|
13
|
-
className?: string;
|
|
13
|
+
className?: string | undefined;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Data blocks side by side: chart cards, tables, a MetricStrip. On a ruled surface, the default, the grid is filled
|
|
@@ -5,7 +5,7 @@ export interface PriceChartProps {
|
|
|
5
5
|
/** Fixed height in pixels. */
|
|
6
6
|
height: number;
|
|
7
7
|
/** TradingView's licence asks for a credit on the page; turn it off on the second chart. */
|
|
8
|
-
credit?: boolean;
|
|
8
|
+
credit?: boolean | undefined;
|
|
9
9
|
}
|
|
10
10
|
/** A TradingView Lightweight Charts price chart in the theme's colours, redrawn when the scheme changes. */
|
|
11
11
|
export declare function PriceChart({ data, height, credit }: PriceChartProps): import("react").JSX.Element;
|
|
@@ -5,15 +5,15 @@ export interface RangePositionProps {
|
|
|
5
5
|
high: number;
|
|
6
6
|
value: number;
|
|
7
7
|
/** Names the low end: "52-week low". */
|
|
8
|
-
lowLabel?: string;
|
|
9
|
-
highLabel?: string;
|
|
8
|
+
lowLabel?: string | undefined;
|
|
9
|
+
highLabel?: string | undefined;
|
|
10
10
|
/** Follows the percentage in the full variant: "of the way up the 52-week range". */
|
|
11
11
|
caption?: ReactNode;
|
|
12
12
|
/** Writes low, high and value; useFormat().money by default. */
|
|
13
|
-
valueFormatter?: (value: number) => string;
|
|
13
|
+
valueFormatter?: ((value: number) => string) | undefined;
|
|
14
14
|
/** compact fits a table cell: the ends' figures either side of the track, nothing above it. */
|
|
15
|
-
variant?: "full" | "compact";
|
|
16
|
-
className?: string;
|
|
15
|
+
variant?: "full" | "compact" | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* How far a value sits between a low and a high, such as a price in its 52-week range: a track filled to the value
|
|
@@ -7,11 +7,11 @@ export interface ScaleToggleProps {
|
|
|
7
7
|
/** The group's accessible name, such as "Share of book scale". */
|
|
8
8
|
label: string;
|
|
9
9
|
/** The axis' name shown before the buttons, for a card with a toggle on each axis. */
|
|
10
|
-
caption?: string;
|
|
10
|
+
caption?: string | undefined;
|
|
11
11
|
value: AxisScale;
|
|
12
12
|
onValueChange: (scale: AxisScale) => void;
|
|
13
13
|
/** Why log cannot draw this data, such as a value at or below zero: Log is disabled and this shows beside it. */
|
|
14
|
-
logBlocked?: string;
|
|
14
|
+
logBlocked?: string | undefined;
|
|
15
15
|
}
|
|
16
16
|
/** Linear and Log buttons for one chart axis, in the header's toggle style. */
|
|
17
17
|
export declare function ScaleToggle({ label, caption, value, onValueChange, logBlocked }: ScaleToggleProps): import("react").JSX.Element;
|
|
@@ -9,12 +9,12 @@ export interface ScatterPoint {
|
|
|
9
9
|
/** Up. `null` when unknown: the point is not drawn, so say on the page how many are missing. */
|
|
10
10
|
y: number | null;
|
|
11
11
|
/** Unique key when names repeat, such as one product sold in two regions. Defaults to `name`. */
|
|
12
|
-
key?: string;
|
|
12
|
+
key?: string | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A weight, such as a holding's value: the dot's area follows it. Give every point a size, or none. A size that is
|
|
15
15
|
* not a positive number draws the smallest dot and leaves the others' sizes as they are.
|
|
16
16
|
*/
|
|
17
|
-
size?: number;
|
|
17
|
+
size?: number | undefined;
|
|
18
18
|
}
|
|
19
19
|
/** One tooltip row: a label and its figure, such as ["Sales", "₹9.8L"]. */
|
|
20
20
|
export type ScatterDetail = readonly [label: string, value: string];
|
|
@@ -35,33 +35,33 @@ export interface ScatterChartCardProps<T extends ScatterPoint> {
|
|
|
35
35
|
* "log" spreads values across powers of ten, for sizes that run from tiny to large. With xScaleToggle it is the
|
|
36
36
|
* first selection. Log draws only when every x is above zero; otherwise the axis is linear.
|
|
37
37
|
*/
|
|
38
|
-
xScale?: AxisScale;
|
|
38
|
+
xScale?: AxisScale | undefined;
|
|
39
39
|
/** Linear and Log buttons for the x axis in the header, so a reader can switch. */
|
|
40
|
-
xScaleToggle?: boolean;
|
|
40
|
+
xScaleToggle?: boolean | undefined;
|
|
41
41
|
/** As xScale, for the y axis: log draws only when every y is above zero. */
|
|
42
|
-
yScale?: AxisScale;
|
|
42
|
+
yScale?: AxisScale | undefined;
|
|
43
43
|
/** Linear and Log buttons for the y axis in the header. */
|
|
44
|
-
yScaleToggle?: boolean;
|
|
44
|
+
yScaleToggle?: boolean | undefined;
|
|
45
45
|
/** The x ticks and the tooltip's x figure. Defaults to the locale's numbers. */
|
|
46
|
-
xFormatter?: (value: number) => string;
|
|
46
|
+
xFormatter?: ((value: number) => string) | undefined;
|
|
47
47
|
/** The y ticks and the tooltip's y figure. Defaults to the locale's numbers. */
|
|
48
|
-
yFormatter?: (value: number) => string;
|
|
48
|
+
yFormatter?: ((value: number) => string) | undefined;
|
|
49
49
|
/** How many points get their name beside the dot, at most; a name with no free spot is left to the tooltip. */
|
|
50
|
-
labels?: number;
|
|
50
|
+
labels?: number | undefined;
|
|
51
51
|
/** The tooltip's rows under the point's name, and what a screen reader hears. Defaults to the two axes' figures. */
|
|
52
|
-
details?: (point: T) => readonly ScatterDetail[];
|
|
52
|
+
details?: ((point: T) => readonly ScatterDetail[]) | undefined;
|
|
53
53
|
/** The point that carries a ring, matched by key; pass back what onSelect gave. */
|
|
54
|
-
selected?: T | null;
|
|
54
|
+
selected?: T | null | undefined;
|
|
55
55
|
/** Gets a tapped or keyed point, and null on a second tap, Escape or a tap on the plot. */
|
|
56
|
-
onSelect?: (point: T | null) => void;
|
|
56
|
+
onSelect?: ((point: T | null) => void) | undefined;
|
|
57
57
|
/** Lines under the chart, such as a caption or how many points are not drawn. */
|
|
58
58
|
footer?: ReactNode;
|
|
59
59
|
/** Dashed lines at a value on each axis, splitting the plot into four, and the corners' names. */
|
|
60
|
-
quadrants?: ScatterQuadrants;
|
|
60
|
+
quadrants?: ScatterQuadrants | undefined;
|
|
61
61
|
/** Names the size in the tooltip, such as "Value". Defaults to "Size". */
|
|
62
|
-
sizeLabel?: string;
|
|
62
|
+
sizeLabel?: string | undefined;
|
|
63
63
|
/** The tooltip's size figure. Defaults to the locale's numbers. */
|
|
64
|
-
sizeFormatter?: (value: number) => string;
|
|
64
|
+
sizeFormatter?: ((value: number) => string) | undefined;
|
|
65
65
|
}
|
|
66
66
|
/** Two measures per item as dots, such as size against growth, with the leading names beside their dots. */
|
|
67
67
|
export declare function ScatterChartCard<T extends ScatterPoint>({ title, description, action, points, height, xLabel, yLabel, xScale, xScaleToggle, yScale, yScaleToggle, xFormatter, yFormatter, labels, details, selected, onSelect, footer, quadrants, sizeLabel, sizeFormatter }: ScatterChartCardProps<T>): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Optional } from "../../lib/optional.js";
|
|
1
2
|
import { SiyahiLocale } from "../../lib/locale.js";
|
|
2
3
|
import { ReactNode } from "react";
|
|
3
4
|
//#region src/components/siyahi/siyahi-provider.d.ts
|
|
@@ -10,12 +11,12 @@ import { ReactNode } from "react";
|
|
|
10
11
|
export type Surface = "ruled" | "card" | "open";
|
|
11
12
|
export interface SiyahiProviderProps {
|
|
12
13
|
/** Any setting left out keeps its default: en-IN, INR, Asia/Kolkata. */
|
|
13
|
-
locale?:
|
|
14
|
+
locale?: Optional<SiyahiLocale> | undefined;
|
|
14
15
|
/**
|
|
15
16
|
* Set it on a nested provider for one part of a page. Left out, a provider keeps the surface around it, so a
|
|
16
17
|
* provider that only changes the locale changes nothing else; the outermost default is "ruled".
|
|
17
18
|
*/
|
|
18
|
-
surface?: Surface;
|
|
19
|
+
surface?: Surface | undefined;
|
|
19
20
|
children: ReactNode;
|
|
20
21
|
}
|
|
21
22
|
/** Wrap the app once. Carries the locale, the surface and the tooltip provider shadcn asks for. */
|
|
@@ -7,10 +7,7 @@ const LocaleContext = createContext(defaultLocale);
|
|
|
7
7
|
const SurfaceContext = createContext("ruled");
|
|
8
8
|
/** Wrap the app once. Carries the locale, the surface and the tooltip provider shadcn asks for. */
|
|
9
9
|
function SiyahiProvider({ locale, surface, children }) {
|
|
10
|
-
const { numberLocale, currency, timeZone } = {
|
|
11
|
-
...defaultLocale,
|
|
12
|
-
...locale
|
|
13
|
-
};
|
|
10
|
+
const { numberLocale = defaultLocale.numberLocale, currency = defaultLocale.currency, timeZone = defaultLocale.timeZone } = locale ?? {};
|
|
14
11
|
const value = useMemo(() => ({
|
|
15
12
|
numberLocale,
|
|
16
13
|
currency,
|
|
@@ -6,7 +6,7 @@ export interface SlopeItem {
|
|
|
6
6
|
/** The value on the right: after, or our own figure. */
|
|
7
7
|
to: number;
|
|
8
8
|
/** Unique key when names repeat. Defaults to `name`. */
|
|
9
|
-
key?: string;
|
|
9
|
+
key?: string | undefined;
|
|
10
10
|
}
|
|
11
11
|
export interface SlopeChartProps {
|
|
12
12
|
/** An item whose from or to is not a finite number is not drawn: say on the page how many are left out. */
|
|
@@ -16,10 +16,10 @@ export interface SlopeChartProps {
|
|
|
16
16
|
/** Heads the right side, such as "Portfolio" or "2026". */
|
|
17
17
|
toLabel: string;
|
|
18
18
|
/** Keys (or names) of the items to draw in the accent colour; the rest stay grey. */
|
|
19
|
-
highlighted?: readonly string[];
|
|
19
|
+
highlighted?: readonly string[] | undefined;
|
|
20
20
|
/** Writes each end's value; useFormat().pct by default. */
|
|
21
|
-
valueFormatter?: (value: number) => string;
|
|
22
|
-
className?: string;
|
|
21
|
+
valueFormatter?: ((value: number) => string) | undefined;
|
|
22
|
+
className?: string | undefined;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Pushes labels apart so none sits closer than `gap` to the next, keeping their order and staying inside [min, max]:
|
|
@@ -4,7 +4,7 @@ import { ComponentProps } from "react";
|
|
|
4
4
|
//#region src/components/siyahi/status-alert.d.ts
|
|
5
5
|
export interface StatusAlertProps extends Omit<ComponentProps<typeof Alert>, "variant"> {
|
|
6
6
|
/** neutral for information, warning for a caution, negative for an error, positive for a success. */
|
|
7
|
-
tone?: Tone;
|
|
7
|
+
tone?: Tone | undefined;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* A notice the reader must not miss: the whole card takes its tone, a faint wash inside a border of the same colour,
|