@siyahi/ui 0.1.9-next.32 → 0.1.9-next.34

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 (107) hide show
  1. package/DESIGN.md +20 -7
  2. package/agents/examples/chart-panels-three.tsx +51 -0
  3. package/agents/examples/context-menu.tsx +14 -4
  4. package/agents/examples/overview-dashboard.tsx +2 -2
  5. package/agents/examples/{page-hero.tsx → page-header.tsx} +4 -4
  6. package/agents/examples/select.tsx +2 -1
  7. package/agents/manifest.json +16 -3
  8. package/dist/components/registry/charts/area-chart-card.d.ts +2 -2
  9. package/dist/components/registry/charts/area-chart-card.js +1 -0
  10. package/dist/components/registry/charts/bar-chart-card.d.ts +4 -4
  11. package/dist/components/registry/charts/bar-chart-card.js +0 -2
  12. package/dist/components/registry/charts/line-chart-card.d.ts +1 -1
  13. package/dist/components/registry/dashboard-01/section-cards.d.ts +4 -4
  14. package/dist/components/registry/dashboardcn/bar-list.d.ts +8 -8
  15. package/dist/components/registry/dashboardcn/distribution-bar.d.ts +11 -11
  16. package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +4 -4
  17. package/dist/components/registry/dashboardcn/sparkline.d.ts +6 -6
  18. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +50 -50
  19. package/dist/components/registry/heatmap/calendar-heatmap.js +1 -1
  20. package/dist/components/registry/heatmap/status-heatmap.d.ts +44 -44
  21. package/dist/components/registry/heatmap/status-heatmap.js +1 -1
  22. package/dist/components/registry/heatmap/weekday-heatmap.d.ts +53 -53
  23. package/dist/components/registry/heatmap/weekday-heatmap.js +1 -1
  24. package/dist/components/registry/minidev/copy-button.d.ts +2 -2
  25. package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +1 -1
  26. package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +1 -1
  27. package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +7 -7
  28. package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +5 -5
  29. package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +1 -1
  30. package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +1 -1
  31. package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +1 -1
  32. package/dist/components/registry/niko-table/config/feature-detection.d.ts +13 -13
  33. package/dist/components/registry/niko-table/core/data-table-context.d.ts +5 -5
  34. package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +3 -3
  35. package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +2 -2
  36. package/dist/components/registry/niko-table/core/data-table-root.d.ts +36 -35
  37. package/dist/components/registry/niko-table/core/data-table-structure.d.ts +22 -22
  38. package/dist/components/registry/niko-table/core/data-table-structure.js +6 -0
  39. package/dist/components/registry/niko-table/core/data-table.d.ts +3 -3
  40. package/dist/components/registry/niko-table/core/data-table.js +1 -1
  41. package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +5 -5
  42. package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +6 -6
  43. package/dist/components/registry/niko-table/filters/table-column-sort.js +2 -2
  44. package/dist/components/registry/niko-table/filters/table-column-title.d.ts +2 -2
  45. package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +9 -9
  46. package/dist/components/registry/niko-table/filters/table-faceted-filter.js +1 -1
  47. package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +7 -7
  48. package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +7 -7
  49. package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +2 -2
  50. package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +3 -3
  51. package/dist/components/registry/niko-table/lib/column-resize-handle.js +1 -1
  52. package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +4 -4
  53. package/dist/components/registry/niko-table/types/index.d.ts +29 -29
  54. package/dist/components/registry/sidebar-07/app-sidebar.d.ts +6 -5
  55. package/dist/components/registry/sidebar-07/nav-main.d.ts +4 -4
  56. package/dist/components/registry/sidebar-07/nav-user.js +16 -19
  57. package/dist/components/siyahi/callout.d.ts +1 -1
  58. package/dist/components/siyahi/change-bar.d.ts +3 -3
  59. package/dist/components/siyahi/change-grid.d.ts +6 -6
  60. package/dist/components/siyahi/data-bar.d.ts +2 -2
  61. package/dist/components/siyahi/data-list.d.ts +1 -1
  62. package/dist/components/siyahi/data-table-row-count.d.ts +1 -1
  63. package/dist/components/siyahi/data-table-sort-header.d.ts +1 -1
  64. package/dist/components/siyahi/delta.d.ts +2 -2
  65. package/dist/components/siyahi/drawdown-chart.d.ts +2 -2
  66. package/dist/components/siyahi/histogram-chart.d.ts +5 -5
  67. package/dist/components/siyahi/local-time.d.ts +1 -1
  68. package/dist/components/siyahi/{page-hero.d.ts → page-header.d.ts} +3 -3
  69. package/dist/components/siyahi/{page-hero.js → page-header.js} +4 -4
  70. package/dist/components/siyahi/page-section.d.ts +1 -1
  71. package/dist/components/siyahi/page-toc.d.ts +2 -2
  72. package/dist/components/siyahi/panel-grid.d.ts +7 -4
  73. package/dist/components/siyahi/panel-grid.js +1 -1
  74. package/dist/components/siyahi/price-chart.d.ts +1 -1
  75. package/dist/components/siyahi/range-position.d.ts +5 -5
  76. package/dist/components/siyahi/range-position.js +1 -1
  77. package/dist/components/siyahi/scale-toggle.d.ts +2 -2
  78. package/dist/components/siyahi/scatter-chart.d.ts +15 -15
  79. package/dist/components/siyahi/scatter-chart.js +14 -1
  80. package/dist/components/siyahi/siyahi-provider.d.ts +3 -2
  81. package/dist/components/siyahi/siyahi-provider.js +1 -4
  82. package/dist/components/siyahi/slope-chart.d.ts +4 -4
  83. package/dist/components/siyahi/status-alert.d.ts +1 -1
  84. package/dist/components/siyahi/status-badge.d.ts +1 -1
  85. package/dist/components/siyahi/target-rows.d.ts +6 -6
  86. package/dist/components/siyahi/target-rows.js +2 -2
  87. package/dist/components/siyahi/treemap.d.ts +8 -8
  88. package/dist/components/siyahi/treemap.js +0 -3
  89. package/dist/components/siyahi/waterfall-chart.d.ts +3 -3
  90. package/dist/index.d.ts +2 -2
  91. package/dist/index.js +2 -2
  92. package/dist/lib/chart-frame.d.ts +48 -20
  93. package/dist/lib/chart-frame.js +60 -30
  94. package/dist/lib/chart-marks.d.ts +2 -2
  95. package/dist/lib/chart-series.d.ts +25 -24
  96. package/dist/lib/format.d.ts +1 -1
  97. package/dist/lib/optional.d.ts +7 -0
  98. package/dist/lib/optional.js +0 -0
  99. package/dist/lib/scatter.d.ts +7 -7
  100. package/dist/lib/ticks.d.ts +9 -0
  101. package/dist/lib/ticks.js +25 -3
  102. package/dist/lib/treemap.d.ts +1 -1
  103. package/dist/lib/use-render-when-fonts-load.d.ts +11 -0
  104. package/dist/lib/use-render-when-fonts-load.js +49 -0
  105. package/package.json +2 -2
  106. package/report.css +1 -0
  107. package/styles/siyahi.css +51 -4
@@ -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
@@ -1,5 +1,5 @@
1
1
  import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar.js";
2
- import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
2
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
3
3
  import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../../ui/sidebar.js";
4
4
  import { BadgeCheckIcon, BellIcon, ChevronsUpDownIcon, CreditCardIcon, LogOutIcon, SparklesIcon } from "lucide-react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -34,25 +34,22 @@ function NavUser({ user }) {
34
34
  align: "end",
35
35
  sideOffset: 4,
36
36
  children: [
37
- /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
38
- className: "p-0 font-normal",
39
- children: /* @__PURE__ */ jsxs("div", {
40
- className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm",
41
- children: [/* @__PURE__ */ jsxs(Avatar, { children: [/* @__PURE__ */ jsx(AvatarImage, {
42
- src: user.avatar,
43
- alt: user.name
44
- }), /* @__PURE__ */ jsx(AvatarFallback, { children: "CN" })] }), /* @__PURE__ */ jsxs("div", {
45
- className: "grid flex-1 text-left text-sm leading-tight",
46
- children: [/* @__PURE__ */ jsx("span", {
47
- className: "truncate font-medium",
48
- children: user.name
49
- }), /* @__PURE__ */ jsx("span", {
50
- className: "truncate text-xs",
51
- children: user.email
52
- })]
37
+ /* @__PURE__ */ jsxs("div", {
38
+ className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm",
39
+ children: [/* @__PURE__ */ jsxs(Avatar, { children: [/* @__PURE__ */ jsx(AvatarImage, {
40
+ src: user.avatar,
41
+ alt: user.name
42
+ }), /* @__PURE__ */ jsx(AvatarFallback, { children: "CN" })] }), /* @__PURE__ */ jsxs("div", {
43
+ className: "grid flex-1 text-left text-sm leading-tight",
44
+ children: [/* @__PURE__ */ jsx("span", {
45
+ className: "truncate font-medium",
46
+ children: user.name
47
+ }), /* @__PURE__ */ jsx("span", {
48
+ className: "truncate text-xs",
49
+ children: user.email
53
50
  })]
54
- })
55
- }) }),
51
+ })]
52
+ }),
56
53
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
57
54
  /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(SparklesIcon, {}), "Upgrade to Pro"] }) }),
58
55
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- //#region src/components/siyahi/page-hero.d.ts
3
- export interface PageHeroProps {
2
+ //#region src/components/siyahi/page-header.d.ts
3
+ export interface PageHeaderProps {
4
4
  /** A short line above the title in the mono face and the link colour, such as the app or a section name. */
5
5
  eyebrow?: ReactNode;
6
6
  /** The page's h1. */
@@ -19,5 +19,5 @@ export interface PageHeroProps {
19
19
  * the actions at the right, and a hairline under it all. One per page, above everything else; a section uses
20
20
  * PageSection.
21
21
  */
22
- export declare function PageHero({ eyebrow, title, lead, detail, actions, mark }: PageHeroProps): import("react").JSX.Element;
22
+ export declare function PageHeader({ eyebrow, title, lead, detail, actions, mark }: PageHeaderProps): import("react").JSX.Element;
23
23
  //#endregion
@@ -1,13 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- //#region src/components/siyahi/page-hero.tsx
2
+ //#region src/components/siyahi/page-header.tsx
3
3
  /**
4
4
  * The masthead at the top of a page: a small mark and eyebrow, the title, one muted line saying what the page is,
5
5
  * the actions at the right, and a hairline under it all. One per page, above everything else; a section uses
6
6
  * PageSection.
7
7
  */
8
- function PageHero({ eyebrow, title, lead, detail, actions, mark }) {
8
+ function PageHeader({ eyebrow, title, lead, detail, actions, mark }) {
9
9
  return /* @__PURE__ */ jsxs("header", {
10
- "data-slot": "page-hero",
10
+ "data-slot": "page-header",
11
11
  className: "flex flex-wrap items-end justify-between gap-x-6 gap-y-3 border-b pb-4",
12
12
  children: [/* @__PURE__ */ jsxs("div", {
13
13
  className: "flex min-w-0 flex-col gap-1",
@@ -40,4 +40,4 @@ function PageHero({ eyebrow, title, lead, detail, actions, mark }) {
40
40
  });
41
41
  }
42
42
  //#endregion
43
- export { PageHero };
43
+ export { PageHeader };
@@ -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,
@@ -3,14 +3,17 @@ import { ReactNode } from "react";
3
3
  declare const COLUMNS: {
4
4
  readonly 1: "";
5
5
  readonly 2: "@2xl/panels:grid-cols-2";
6
- readonly 3: "@2xl/panels:grid-cols-2 @5xl/panels:grid-cols-3";
6
+ readonly 3: "@2xl/panels:grid-cols-3";
7
7
  readonly 4: "@2xl/panels:grid-cols-2 @5xl/panels:grid-cols-4";
8
8
  };
9
9
  export interface PanelGridProps {
10
- /** Blocks across on a wide page; two on a medium one, and one on a phone. */
11
- columns?: keyof typeof COLUMNS;
10
+ /**
11
+ * Blocks across from a 42rem grid, so three short ones fit a reading column (an article's 55rem); 4 goes two across
12
+ * there and four from 64rem. Below 42rem they sit one under another.
13
+ */
14
+ columns?: keyof typeof COLUMNS | undefined;
12
15
  children: ReactNode;
13
- className?: string;
16
+ className?: string | undefined;
14
17
  }
15
18
  /**
16
19
  * Data blocks side by side: chart cards, tables, a MetricStrip. On a ruled surface, the default, the grid is filled
@@ -6,7 +6,7 @@ import { Children } from "react";
6
6
  const COLUMNS = {
7
7
  1: "",
8
8
  2: "@2xl/panels:grid-cols-2",
9
- 3: "@2xl/panels:grid-cols-2 @5xl/panels:grid-cols-3",
9
+ 3: "@2xl/panels:grid-cols-3",
10
10
  4: "@2xl/panels:grid-cols-2 @5xl/panels:grid-cols-4"
11
11
  };
12
12
  /**
@@ -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
@@ -26,7 +26,7 @@ function RangePosition({ low, high, value, lowLabel = "Low", highLabel = "High",
26
26
  style: { width: at }
27
27
  }), /* @__PURE__ */ jsx("div", {
28
28
  "data-slot": "range-thumb",
29
- className: cn("absolute top-1/2 -translate-1/2 rounded-full border-2 border-foreground bg-card", variant === "full" ? "size-3.5" : "size-2.5"),
29
+ className: cn("absolute top-1/2 -translate-1/2 border-2 border-foreground bg-card", variant === "full" ? "size-3.5" : "size-2.5"),
30
30
  style: { left: at }
31
31
  })]
32
32
  });
@@ -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;
@@ -3,6 +3,7 @@ import { ChartContainer } from "../ui/chart.js";
3
3
  import { LOG_BLOCKED, useAxisScale } from "./scale-toggle.js";
4
4
  import { useLocale } from "./siyahi-provider.js";
5
5
  import { fitsLog, ticksFor } from "../../lib/ticks.js";
6
+ import { fontLoads, useRenderWhenFontsLoad } from "../../lib/use-render-when-fonts-load.js";
6
7
  import { corners, dotSizes, placeLabels, quadrantSplit } from "../../lib/scatter.js";
7
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
9
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -43,6 +44,10 @@ function ScatterChartCard({ title, description, action, points, height, xLabel,
43
44
  const formatY = useMemo(() => yFormatter ?? new Intl.NumberFormat(numberLocale).format, [yFormatter, numberLocale]);
44
45
  const formatSize = useMemo(() => sizeFormatter ?? new Intl.NumberFormat(numberLocale).format, [sizeFormatter, numberLocale]);
45
46
  const drawn = useMemo(() => points.filter((p) => p.y !== null && Number.isFinite(p.y) && Number.isFinite(p.x)), [points]);
47
+ useRenderWhenFontsLoad(() => {
48
+ const { measure } = labelType();
49
+ return [...labels > 0 ? drawn.map(({ name }) => name) : [], ...Object.values(quadrants?.labels ?? {})].map((name) => name ? measure(name) : 0).join();
50
+ });
46
51
  const both = xScaleToggle && yScaleToggle;
47
52
  const across = useAxisScale({
48
53
  initial: xScale,
@@ -297,8 +302,12 @@ function Dot({ cx, cy, payload, index, "data-recharts-item-id": itemId, selected
297
302
  strokeWidth: RING
298
303
  }), dot] });
299
304
  }
300
- /** A name's width in the labels' type, measured on a canvas once per font and name. */
305
+ /**
306
+ * A name's width in the labels' type, measured on a canvas once per font and name, and again after each font load:
307
+ * the font string is the same before and after Geist arrives, and a width measured before was the fallback's.
308
+ */
301
309
  const widths = /* @__PURE__ */ new Map();
310
+ let widthsAfter = 0;
302
311
  let canvas;
303
312
  /** The labels' type as the page sets it: text-xs is three quarters of the root size, which a reader may enlarge. */
304
313
  function labelType() {
@@ -309,6 +318,10 @@ function labelType() {
309
318
  const size = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) * .75;
310
319
  const font = `500 ${size}px ${getComputedStyle(document.body).fontFamily}`;
311
320
  canvas ??= document.createElement("canvas").getContext("2d");
321
+ if (fontLoads() !== widthsAfter) {
322
+ widths.clear();
323
+ widthsAfter = fontLoads();
324
+ }
312
325
  const measure = (text) => {
313
326
  const id = `${font}\n${text}`;
314
327
  let width = widths.get(id);