@siyahi/ui 0.1.9-next.24 → 0.1.9-next.25

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 (45) hide show
  1. package/agents/examples/change-grid-money.tsx +36 -0
  2. package/agents/examples/change-grid.tsx +42 -0
  3. package/agents/examples/drawdown-chart.tsx +35 -0
  4. package/agents/examples/heatmap-calendar-signed.tsx +67 -0
  5. package/agents/examples/heatmap-status.tsx +6 -4
  6. package/agents/examples/histogram-chart.tsx +28 -0
  7. package/agents/examples/scatter-chart-quadrants.tsx +63 -0
  8. package/agents/examples/scatter-chart.tsx +75 -0
  9. package/agents/examples/slope-chart-market.tsx +33 -0
  10. package/agents/examples/slope-chart.tsx +26 -0
  11. package/agents/examples/waterfall-chart-stores.tsx +27 -0
  12. package/agents/examples/waterfall-chart.tsx +37 -0
  13. package/agents/manifest.json +160 -0
  14. package/dist/components/registry/heatmap/calendar-heatmap.d.ts +8 -2
  15. package/dist/components/registry/heatmap/calendar-heatmap.js +96 -18
  16. package/dist/components/registry/heatmap/status-heatmap.js +86 -47
  17. package/dist/components/siyahi/change-grid.d.ts +31 -0
  18. package/dist/components/siyahi/change-grid.js +74 -0
  19. package/dist/components/siyahi/drawdown-chart.d.ts +34 -0
  20. package/dist/components/siyahi/drawdown-chart.js +102 -0
  21. package/dist/components/siyahi/histogram-chart.d.ts +57 -0
  22. package/dist/components/siyahi/histogram-chart.js +134 -0
  23. package/dist/components/siyahi/scatter-chart.d.ts +59 -0
  24. package/dist/components/siyahi/scatter-chart.js +367 -0
  25. package/dist/components/siyahi/slope-chart.d.ts +35 -0
  26. package/dist/components/siyahi/slope-chart.js +159 -0
  27. package/dist/components/siyahi/treemap.js +3 -7
  28. package/dist/components/siyahi/waterfall-chart.d.ts +51 -0
  29. package/dist/components/siyahi/waterfall-chart.js +147 -0
  30. package/dist/index.d.ts +9 -2
  31. package/dist/index.js +7 -1
  32. package/dist/lib/chart-frame.d.ts +7 -2
  33. package/dist/lib/chart-frame.js +44 -10
  34. package/dist/lib/chart-series.d.ts +2 -3
  35. package/dist/lib/fit-text.d.ts +6 -0
  36. package/dist/lib/fit-text.js +11 -0
  37. package/dist/lib/heat.d.ts +7 -0
  38. package/dist/lib/heat.js +14 -0
  39. package/dist/lib/scatter.d.ts +98 -0
  40. package/dist/lib/scatter.js +218 -0
  41. package/dist/lib/treemap.d.ts +0 -5
  42. package/dist/lib/treemap.js +1 -16
  43. package/package.json +1 -1
  44. package/report.css +9 -0
  45. package/styles/siyahi.css +16 -0
@@ -0,0 +1,51 @@
1
+ import { SeriesChartProps } from "../../lib/chart-series.js";
2
+ //#region src/components/siyahi/waterfall-chart.d.ts
3
+ /**
4
+ * One bar of a waterfall. A change moves the running total by its value. A total draws the running total from zero;
5
+ * give it a value to set the total instead, as an opening balance does. Labels may repeat, such as "Balance" at
6
+ * both ends: each bar is placed by its position.
7
+ */
8
+ export type WaterfallStep = {
9
+ kind: "change";
10
+ label: string;
11
+ value: number;
12
+ } | {
13
+ kind: "total";
14
+ label: string;
15
+ value?: number;
16
+ };
17
+ /** A step as drawn: the running total after it, and the span its bar covers. */
18
+ export interface WaterfallBar {
19
+ /** The step's position, as text: the category the bar is placed by. */
20
+ key: string;
21
+ label: string;
22
+ kind: "rise" | "fall" | "total";
23
+ /** How far the step moved the running total. */
24
+ change: number;
25
+ /** The running total after the step. */
26
+ level: number;
27
+ /** The bar's low and high ends, low first whichever way the step moved: Recharts reads a range that way. */
28
+ span: [number, number];
29
+ /** The bar picks up at the level the one before left, so a dashed line joins them. */
30
+ continues: boolean;
31
+ }
32
+ /** Walks the steps in order, keeping the running total. */
33
+ export declare function waterfallBars(steps: readonly WaterfallStep[]): WaterfallBar[];
34
+ export interface WaterfallChartCardProps extends Pick<SeriesChartProps<WaterfallBar, "key">, "title" | "description" | "action" | "height" | "valueFormatter" | "yTickFormatter" | "yLabel" | "referenceLines" | "placeholder" | "footer"> {
35
+ /** The bars in order: usually a total to start from, the changes, and a total to end on. */
36
+ steps: readonly WaterfallStep[];
37
+ /** Bars run sideways with the labels down the left, for long names such as product categories. */
38
+ horizontal?: boolean;
39
+ /** What the legend calls each kind of bar. */
40
+ labels?: {
41
+ rise: string;
42
+ fall: string;
43
+ total: string;
44
+ };
45
+ }
46
+ /**
47
+ * A running total bridged step by step: where it starts, each change that moved it, and where it ends, such as a
48
+ * year's profit built up month by month. Rises and falls float at the level the one before left; totals stand on zero.
49
+ */
50
+ export declare function WaterfallChartCard({ steps, horizontal, labels, ...props }: WaterfallChartCardProps): import("react").JSX.Element;
51
+ //#endregion
@@ -0,0 +1,147 @@
1
+ import { useLocale } from "./siyahi-provider.js";
2
+ import { ChartFrame } from "../../lib/chart-frame.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useMemo } from "react";
5
+ import { Bar, BarChart, Cell, ReferenceLine } from "recharts";
6
+ //#region src/components/siyahi/waterfall-chart.tsx
7
+ const span = (a, b) => [Math.min(a, b), Math.max(a, b)];
8
+ /** Walks the steps in order, keeping the running total. */
9
+ function waterfallBars(steps) {
10
+ let level = 0;
11
+ return steps.map((step, index) => {
12
+ const before = level;
13
+ const key = String(index);
14
+ if (step.kind === "total") {
15
+ level = step.value ?? level;
16
+ const continues = level === before;
17
+ return {
18
+ key,
19
+ label: step.label,
20
+ kind: "total",
21
+ change: level - before,
22
+ level,
23
+ span: span(0, level),
24
+ continues
25
+ };
26
+ }
27
+ level += step.value;
28
+ const kind = step.value < 0 ? "fall" : "rise";
29
+ return {
30
+ key,
31
+ label: step.label,
32
+ kind,
33
+ change: step.value,
34
+ level,
35
+ span: span(before, level),
36
+ continues: true
37
+ };
38
+ });
39
+ }
40
+ /**
41
+ * The first step whose figure is not a number. Every bar after it stands on the running total, so a missing change
42
+ * cannot be skipped without drawing wrong balances; the card says which step is missing instead.
43
+ */
44
+ const unknownStep = (steps) => steps.find((step) => step.value !== void 0 && !Number.isFinite(step.value));
45
+ const COLOR = {
46
+ rise: "var(--positive)",
47
+ fall: "var(--negative)",
48
+ total: "var(--chart-1)"
49
+ };
50
+ const LABELS = {
51
+ rise: "Increase",
52
+ fall: "Decrease",
53
+ total: "Total"
54
+ };
55
+ const MINUS = "−";
56
+ const fill = (kind) => kind === "total" ? COLOR.total : `color-mix(in oklab, ${COLOR[kind]} 35%, var(--card))`;
57
+ function Legend({ labels }) {
58
+ return /* @__PURE__ */ jsx("div", {
59
+ className: "flex items-center justify-center gap-4 pt-3",
60
+ children: [
61
+ "rise",
62
+ "fall",
63
+ "total"
64
+ ].map((kind) => /* @__PURE__ */ jsxs("div", {
65
+ className: "flex items-center gap-1.5",
66
+ children: [/* @__PURE__ */ jsx("div", {
67
+ className: "size-2 shrink-0 rounded-xs border",
68
+ style: {
69
+ backgroundColor: fill(kind),
70
+ borderColor: COLOR[kind]
71
+ }
72
+ }), labels[kind]]
73
+ }, kind))
74
+ });
75
+ }
76
+ /**
77
+ * A running total bridged step by step: where it starts, each change that moved it, and where it ends, such as a
78
+ * year's profit built up month by month. Rises and falls float at the level the one before left; totals stand on zero.
79
+ */
80
+ function WaterfallChartCard({ steps, horizontal = false, labels = LABELS, ...props }) {
81
+ const { numberLocale } = useLocale();
82
+ const bars = useMemo(() => waterfallBars(steps), [steps]);
83
+ const format = props.valueFormatter ?? new Intl.NumberFormat(numberLocale).format;
84
+ const signed = (value) => `${value > 0 ? "+" : value < 0 ? MINUS : ""}${format(Math.abs(value))}`;
85
+ const names = new Map(bars.map((bar) => [bar.key, bar.label]));
86
+ const unknown = unknownStep(steps);
87
+ return /* @__PURE__ */ jsxs(ChartFrame, {
88
+ chart: BarChart,
89
+ ...props,
90
+ placeholder: props.placeholder ?? (unknown && /* @__PURE__ */ jsxs("p", {
91
+ className: "text-sm text-muted-foreground",
92
+ children: [unknown.label, " has no figure, so the running total after it is unknown."]
93
+ })),
94
+ horizontal,
95
+ data: bars,
96
+ xKey: "key",
97
+ xFormatter: (key) => names.get(key) ?? key,
98
+ series: [{
99
+ key: "level",
100
+ label: labels.total,
101
+ color: COLOR.total
102
+ }],
103
+ legend: /* @__PURE__ */ jsx(Legend, { labels }),
104
+ tooltipRow: (_value, _name, item) => {
105
+ const bar = item.payload;
106
+ return (bar.kind === "total" ? [[labels.total, format(bar.level)]] : [[bar.kind === "rise" ? labels.rise : labels.fall, signed(bar.change)], ["Running total", format(bar.level)]]).map(([name, figure]) => /* @__PURE__ */ jsxs("div", {
107
+ className: "flex w-full items-center gap-2",
108
+ children: [/* @__PURE__ */ jsx("span", {
109
+ className: "text-muted-foreground",
110
+ children: name
111
+ }), /* @__PURE__ */ jsx("span", {
112
+ className: "ml-auto font-mono font-medium text-foreground tabular-nums",
113
+ children: figure
114
+ })]
115
+ }, name));
116
+ },
117
+ children: [bars.slice(0, -1).map((bar, i) => {
118
+ const next = bars[i + 1];
119
+ if (!next.continues) return null;
120
+ const at = (key) => horizontal ? {
121
+ x: bar.level,
122
+ y: key
123
+ } : {
124
+ x: key,
125
+ y: bar.level
126
+ };
127
+ return /* @__PURE__ */ jsx(ReferenceLine, {
128
+ segment: [at(bar.key), at(next.key)],
129
+ stroke: "var(--muted-foreground)",
130
+ strokeDasharray: "2 2",
131
+ "data-slot": "waterfall-connector"
132
+ }, bar.key);
133
+ }), /* @__PURE__ */ jsx(Bar, {
134
+ dataKey: "span",
135
+ name: labels.total,
136
+ maxBarSize: horizontal ? 24 : 48,
137
+ radius: 2,
138
+ children: bars.map((bar) => /* @__PURE__ */ jsx(Cell, {
139
+ fill: fill(bar.kind),
140
+ stroke: COLOR[bar.kind],
141
+ strokeWidth: 1.5
142
+ }, bar.key))
143
+ })]
144
+ });
145
+ }
146
+ //#endregion
147
+ export { WaterfallChartCard, waterfallBars };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChartColor, ChartCurve, ChartReferenceLine, ChartSeries, ChartSeriesItem, NumericXProps, SeriesChartProps } from "./lib/chart-series.js";
1
+ import { ChartColor, ChartCurve, ChartReferenceLine, ChartSeries, ChartSeriesItem, NumericKey, NumericXProps, SeriesChartProps } from "./lib/chart-series.js";
2
2
  import { AreaChartCard, AreaChartCardProps } from "./components/registry/charts/area-chart-card.js";
3
3
  import { BarChartCard, BarChartCardProps } from "./components/registry/charts/bar-chart-card.js";
4
4
  import { LineChartCard, LineChartCardProps } from "./components/registry/charts/line-chart-card.js";
@@ -52,6 +52,7 @@ import { AppSidebar, AppSidebarProps } from "./components/registry/sidebar-07/ap
52
52
  import { Callout, CalloutProps } from "./components/siyahi/callout.js";
53
53
  import { Delta, DeltaProps } from "./components/siyahi/delta.js";
54
54
  import { ChangeBar, ChangeBarProps } from "./components/siyahi/change-bar.js";
55
+ import { ChangeGrid, ChangeGridProps, ChangeGridRow } from "./components/siyahi/change-grid.js";
55
56
  import { DataBar, DataBarProps } from "./components/siyahi/data-bar.js";
56
57
  import { DataList, DataListItem, DataListItemProps } from "./components/siyahi/data-list.js";
57
58
  import { DataTableCompactColumnsToggle } from "./components/siyahi/data-table-compact-columns-toggle.js";
@@ -59,6 +60,8 @@ import { DataTableFootnote, DataTableFootnoteProps } from "./components/siyahi/d
59
60
  import { DataTableRowCount, DataTableRowCountProps } from "./components/siyahi/data-table-row-count.js";
60
61
  import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
61
62
  import { defaultSidebarOpen } from "./components/siyahi/default-sidebar-open.js";
63
+ import { DrawdownChartCard, DrawdownChartCardProps, DrawdownPoint, drawdowns } from "./components/siyahi/drawdown-chart.js";
64
+ import { HistogramBin, HistogramChartCard, HistogramChartCardProps, HistogramMark, bucketOf, histogram, markLines, percentile } from "./components/siyahi/histogram-chart.js";
62
65
  import { InlineCode } from "./components/siyahi/inline-code.js";
63
66
  import { LocalTime, LocalTimeProps } from "./components/siyahi/local-time.js";
64
67
  import { PageHero, PageHeroProps } from "./components/siyahi/page-hero.js";
@@ -68,8 +71,11 @@ import { PanelGrid, PanelGridProps } from "./components/siyahi/panel-grid.js";
68
71
  import { PriceChart, PriceChartProps } from "./components/siyahi/price-chart.js";
69
72
  import { Quote, QuoteProps } from "./components/siyahi/quote.js";
70
73
  import { RangePosition, RangePositionProps } from "./components/siyahi/range-position.js";
74
+ import { ScatterQuadrants } from "./lib/scatter.js";
75
+ import { ScatterChartCard, ScatterChartCardProps, ScatterDetail, ScatterPoint } from "./components/siyahi/scatter-chart.js";
71
76
  import { SiyahiLocale, defaultLocale } from "./lib/locale.js";
72
77
  import { SiyahiProvider, SiyahiProviderProps, Surface, useLocale, useSurface } from "./components/siyahi/siyahi-provider.js";
78
+ import { SlopeChart, SlopeChartProps, SlopeItem, spread } from "./components/siyahi/slope-chart.js";
73
79
  import { Alert, AlertAction, AlertDescription, AlertTitle } from "./components/ui/alert.js";
74
80
  import { StatusAlert, StatusAlertProps } from "./components/siyahi/status-alert.js";
75
81
  import { Badge, badgeVariants } from "./components/ui/badge.js";
@@ -78,6 +84,7 @@ import { TargetRow, TargetRows, TargetRowsProps, TargetStatus } from "./componen
78
84
  import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./components/ui/progress.js";
79
85
  import { ToneProgress, ToneProgressProps } from "./components/siyahi/tone-progress.js";
80
86
  import { Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps } from "./components/siyahi/treemap.js";
87
+ import { WaterfallBar, WaterfallChartCard, WaterfallChartCardProps, WaterfallStep, waterfallBars } from "./components/siyahi/waterfall-chart.js";
81
88
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
82
89
  import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./components/ui/avatar.js";
83
90
  import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./components/ui/breadcrumb.js";
@@ -101,4 +108,4 @@ import { Textarea } from "./components/ui/textarea.js";
101
108
  import { Toggle, toggleVariants } from "./components/ui/toggle.js";
102
109
  import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
103
110
  import { Formatters, TimeOptions, count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
104
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Callout, CalloutProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChangeBar, ChangeBarProps, ChartColor, ChartConfig, ChartContainer, ChartCurve, ChartLegend, ChartLegendContent, ChartReferenceLine, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CompactColumns, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataBar, DataBarProps, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableCompactColumnsToggle, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableFootnote, DataTableFootnoteProps, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowCount, DataTableRowCountProps, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSkeletonProps, DataTableSortHeader, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DistributionBarProps, DistributionMarker, DistributionSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, LineChartCard, LineChartCardProps, LocalTime, LocalTimeProps, MetricStrip, MetricStripItem, MetricStripProps, NavMain, NavProjects, NavUser, NumericXProps, type Option, PageHero, PageHeroProps, PageSection, PageSectionProps, PageSubheading, PageToc, PageTocItem, PageTocProps, PanelGrid, PanelGridProps, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, Quote, QuoteProps, RangePosition, RangePositionProps, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, SectionCardsProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, Sparkline, SparklineProps, StatusActivity, StatusAlert, StatusAlertProps, StatusBadge, StatusBadgeProps, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Surface, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, TargetRow, TargetRows, TargetRowsProps, TargetStatus, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, ToneProgressProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps, type ValueOf, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, badgeVariants, buttonVariants, count, defaultLocale, defaultSidebarOpen, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useSurface, useTableFacetedFilter };
111
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartCard, BarChartCardProps, BarList, BarListItem, BarListProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, Callout, CalloutProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChangeBar, ChangeBarProps, ChangeGrid, ChangeGridProps, ChangeGridRow, ChartColor, ChartConfig, ChartContainer, ChartCurve, ChartLegend, ChartLegendContent, ChartReferenceLine, ChartSeries, ChartSeriesItem, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorConfig, ColumnResizeInfo, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CompactColumns, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataBar, DataBarProps, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableCompactColumnsToggle, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableFootnote, DataTableFootnoteProps, DataTableGroupRowContextValue, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableGroupedRowsProps, DataTableHeader, type DataTableHeader$1 as DataTableHeaderCell, DataTableHeaderProps, type DataTableInstance, DataTableLoading, DataTableLoadingMore, DataTableLoadingMoreProps, DataTableLoadingProps, DataTableProvider, DataTableRoot, type DataTableRow, DataTableRowContextMenu, DataTableRowContextMenuProps, DataTableRowContextMenuSlot, DataTableRowContextMenuSlotProps, DataTableRowCount, DataTableRowCountProps, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSkeletonProps, DataTableSortHeader, DataTableToolbarSection, DataTableToolbarSectionProps, Delta, DeltaProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DistributionBarProps, DistributionMarker, DistributionSegment, DrawdownChartCard, DrawdownChartCardProps, DrawdownPoint, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtendedColumnFilter, type ExtendedColumnSort, type FilterOperator, type FilterOperatorValues, type FilterVariant, type FilterVariantValues, FlashCellRef, FlashCells, FlashRows, FlashRowsOptions, Formatters, type GlobalFilter, GroupedBodyRow, GroupedBodyRowProps, HistogramBin, HistogramChartCard, HistogramChartCardProps, HistogramMark, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, type JoinOperator, type JoinOperatorValues, Labels, LineChartCard, LineChartCardProps, LocalTime, LocalTimeProps, MetricStrip, MetricStripItem, MetricStripProps, NavMain, NavProjects, NavUser, NumericKey, NumericXProps, type Option, PageHero, PageHeroProps, PageSection, PageSectionProps, PageSubheading, PageToc, PageTocItem, PageTocProps, PanelGrid, PanelGridProps, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, Quote, QuoteProps, RangePosition, RangePositionProps, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScatterChartCard, ScatterChartCardProps, ScatterDetail, ScatterPoint, type ScatterQuadrants, ScrollAlign, ScrollArea, ScrollBar, type ScrollEvent, ScrollRowIntoView, SectionCard, SectionCards, SectionCardsProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesChartProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiLocale, SiyahiProvider, SiyahiProviderProps, Skeleton, Slider, SlopeChart, SlopeChartProps, SlopeItem, Sparkline, SparklineProps, StatusActivity, StatusAlert, StatusAlertProps, StatusBadge, StatusBadgeProps, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Surface, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, TargetRow, TargetRows, TargetRowsProps, TargetStatus, TeamSwitcher, Textarea, TimeOptions, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, ToneProgressProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapItem, TreemapLegend, TreemapLegendProps, TreemapProps, type ValueOf, WaterfallBar, WaterfallChartCard, WaterfallChartCardProps, WaterfallStep, type ColorConfig$1 as WeekdayColorConfig, type WeekdayExtraColumnSpec, type WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, type WeekdayHeatmapBlockProps, WeekdayHeatmapBody, type WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, type WeekdayHeatmapFooterProps, type WeekdayHeatmapLabels, WeekdayHeatmapLegend, type WeekdayHeatmapLegendProps, type WeekdayHeatmapProps, WeekdayHeatmapStat, type WeekdayHeatmapStatProps, type WeekdayHour, type WeekdayHourlyActivity, type WeekdayIndex, badgeVariants, bucketOf, buttonVariants, count, defaultLocale, defaultSidebarOpen, drawdowns, flashCellKey, histogram, markLines, money, moneyCompact, pct, percentile, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, spread, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useSurface, useTableFacetedFilter, waterfallBars };
package/dist/index.js CHANGED
@@ -77,6 +77,7 @@ import { TeamSwitcher } from "./components/registry/sidebar-07/team-switcher.js"
77
77
  import { AppSidebar } from "./components/registry/sidebar-07/app-sidebar.js";
78
78
  import { Callout } from "./components/siyahi/callout.js";
79
79
  import { ChangeBar } from "./components/siyahi/change-bar.js";
80
+ import { ChangeGrid } from "./components/siyahi/change-grid.js";
80
81
  import { DataBar } from "./components/siyahi/data-bar.js";
81
82
  import { DataList, DataListItem } from "./components/siyahi/data-list.js";
82
83
  import { DataTableCompactColumnsToggle } from "./components/siyahi/data-table-compact-columns-toggle.js";
@@ -84,6 +85,8 @@ import { DataTableFootnote } from "./components/siyahi/data-table-footnote.js";
84
85
  import { DataTableRowCount } from "./components/siyahi/data-table-row-count.js";
85
86
  import { DataTableSortHeader } from "./components/siyahi/data-table-sort-header.js";
86
87
  import { defaultSidebarOpen } from "./components/siyahi/default-sidebar-open.js";
88
+ import { DrawdownChartCard, drawdowns } from "./components/siyahi/drawdown-chart.js";
89
+ import { HistogramChartCard, bucketOf, histogram, markLines, percentile } from "./components/siyahi/histogram-chart.js";
87
90
  import { InlineCode } from "./components/siyahi/inline-code.js";
88
91
  import { LocalTime } from "./components/siyahi/local-time.js";
89
92
  import { PageHero } from "./components/siyahi/page-hero.js";
@@ -93,9 +96,12 @@ import { PanelGrid } from "./components/siyahi/panel-grid.js";
93
96
  import { PriceChart } from "./components/siyahi/price-chart.js";
94
97
  import { Quote } from "./components/siyahi/quote.js";
95
98
  import { RangePosition } from "./components/siyahi/range-position.js";
99
+ import { ScatterChartCard } from "./components/siyahi/scatter-chart.js";
100
+ import { SlopeChart, spread } from "./components/siyahi/slope-chart.js";
96
101
  import { StatusAlert } from "./components/siyahi/status-alert.js";
97
102
  import { StatusBadge } from "./components/siyahi/status-badge.js";
98
103
  import { TargetRows } from "./components/siyahi/target-rows.js";
99
104
  import { ToneProgress } from "./components/siyahi/tone-progress.js";
100
105
  import { Treemap, TreemapLegend } from "./components/siyahi/treemap.js";
101
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChangeBar, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataBar, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableCompactColumnsToggle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableFootnote, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowCount, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSortHeader, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, LineChartCard, LocalTime, MetricStrip, NavMain, NavProjects, NavUser, PageHero, PageSection, PageSubheading, PageToc, PanelGrid, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, Quote, RangePosition, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, Sparkline, StatusAlert, StatusBadge, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, Tabs, TabsContent, TabsList, TabsTrigger, TargetRows, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, badgeVariants, buttonVariants, count, defaultLocale, defaultSidebarOpen, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useSurface, useTableFacetedFilter };
106
+ import { WaterfallChartCard, waterfallBars } from "./components/siyahi/waterfall-chart.js";
107
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChangeBar, ChangeGrid, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataBar, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableCompactColumnsToggle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, DataTableFootnote, DataTableGroupRowProvider, DataTableGroupedRowCells, DataTableGroupedRows, DataTableHeader, DataTableLoading, DataTableLoadingMore, DataTableProvider, DataTableRoot, DataTableRowContextMenu, DataTableRowContextMenuSlot, DataTableRowCount, DataTableRowMenuScope, DataTableSearchFilter, DataTableSkeleton, DataTableSortHeader, DataTableToolbarSection, Delta, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DistributionBar, DrawdownChartCard, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, HistogramChartCard, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, LineChartCard, LocalTime, MetricStrip, NavMain, NavProjects, NavUser, PageHero, PageSection, PageSubheading, PageToc, PanelGrid, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, Quote, RangePosition, RowMenuGroup, RowMenuItem, RowMenuLabel, RowMenuSeparator, RowMenuSub, RowMenuSubContent, RowMenuSubTrigger, ScatterChartCard, ScrollArea, ScrollBar, SectionCards, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiyahiProvider, Skeleton, Slider, SlopeChart, Sparkline, StatusAlert, StatusBadge, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, Tabs, TabsContent, TabsList, TabsTrigger, TargetRows, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WaterfallChartCard, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, badgeVariants, bucketOf, buttonVariants, count, defaultLocale, defaultSidebarOpen, drawdowns, flashCellKey, histogram, markLines, money, moneyCompact, pct, percentile, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, spread, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useSurface, useTableFacetedFilter, waterfallBars };
@@ -1,5 +1,6 @@
1
1
  import { ChartColor, ChartSeries, ChartSeriesItem, NumericXProps, SeriesChartProps } from "./chart-series.js";
2
- import { ComponentProps, ReactNode } from "react";
2
+ import { ChartTooltipContent } from "../components/ui/chart.js";
3
+ import { ComponentProps, ReactElement, ReactNode } from "react";
3
4
  import { AreaChart, BarChart, LineChart, YAxisProps } from "recharts";
4
5
  //#region src/lib/chart-frame.d.ts
5
6
  interface ChartFrameProps<T extends object, K extends keyof T> extends Omit<SeriesChartProps<T, K>, "yDomain">, NumericXProps {
@@ -17,6 +18,10 @@ interface ChartFrameProps<T extends object, K extends keyof T> extends Omit<Seri
17
18
  /** "sign" stacks negative values below zero and positive ones above, rather than on one running total. */
18
19
  stackOffset?: "sign";
19
20
  onClick?: ComponentProps<typeof BarChart>["onClick"];
21
+ /** A tooltip row per hovered mark; by default each series' colour, label and formatted value (seriesRow). */
22
+ tooltipRow?: ComponentProps<typeof ChartTooltipContent>["formatter"];
23
+ /** The legend under the plot; by default one chip per series. */
24
+ legend?: ReactElement;
20
25
  }
21
26
  /**
22
27
  * The colour a series' Bar takes, which its legend chip shows: the negative colour when every value drawn is below
@@ -42,6 +47,6 @@ export declare function seriesRow<T>(series: ChartSeries<T>, formatValue: (value
42
47
  * that gave its category axis its own id (dash#88) got a plot split in two
43
48
  * and every tooltip headed with the series name instead of the category.
44
49
  */
45
- export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, horizontal, stackOffset, onClick, title, description, action, data, xKey, series, xFormatter, xTooltipFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines, placeholder, footer, xDomain, xTicks }: ChartFrameProps<T, K>): import("react").JSX.Element;
50
+ export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, horizontal, stackOffset, onClick, tooltipRow, legend, title, description, action, data, xKey, series, xFormatter, xTooltipFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines, placeholder, footer, xDomain, xTicks }: ChartFrameProps<T, K>): import("react").JSX.Element;
46
51
  //#endregion
47
52
  export {};
@@ -9,6 +9,31 @@ import { CartesianGrid, ReferenceLine, Text, XAxis, YAxis, useChartWidth, useXAx
9
9
  const AXIS_TITLE = "fill-muted-foreground text-xs";
10
10
  const TICK = { className: "fill-muted-foreground font-mono" };
11
11
  const NO_LINES = [];
12
+ const SERIES_LEGEND = /* @__PURE__ */ jsx(ChartLegendContent, { className: "flex-wrap gap-y-1" });
13
+ /**
14
+ * A reference line over a card-coloured band, so it stays traceable where it crosses a bar or an area: the text
15
+ * colour on --chart-1 is only 2:1, but each against the card is well over 3:1.
16
+ */
17
+ function haloLine({ x1, y1, x2, y2, stroke, strokeDasharray }) {
18
+ return /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
19
+ "data-slot": "reference-line-halo",
20
+ x1,
21
+ y1,
22
+ x2,
23
+ y2,
24
+ stroke: "var(--card)",
25
+ strokeWidth: 4
26
+ }), /* @__PURE__ */ jsx("line", {
27
+ className: "recharts-reference-line-line",
28
+ x1,
29
+ y1,
30
+ x2,
31
+ y2,
32
+ stroke,
33
+ strokeDasharray,
34
+ strokeWidth: 1
35
+ })] });
36
+ }
12
37
  /**
13
38
  * The colour a series' Bar takes, which its legend chip shows: the negative colour when every value drawn is below
14
39
  * zero, since each bar's own Cell follows its sign but the chip follows the Bar.
@@ -161,7 +186,7 @@ function HorizontalAxis({ data, xKey, xFormatter, xTickDetail, xTicks }) {
161
186
  * that gave its category axis its own id (dash#88) got a plot split in two
162
187
  * and every tooltip headed with the series name instead of the category.
163
188
  */
164
- function ChartFrame({ chart: Chart, children, horizontal = false, stackOffset, onClick, title, description, action, data, xKey, series, xFormatter = String, xTooltipFormatter = xFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines = NO_LINES, placeholder, footer, xDomain, xTicks }) {
189
+ function ChartFrame({ chart: Chart, children, horizontal = false, stackOffset, onClick, tooltipRow, legend = SERIES_LEGEND, title, description, action, data, xKey, series, xFormatter = String, xTooltipFormatter = xFormatter, valueFormatter, yTickFormatter, yDomain, yTicks, height, xTickDetail, xLabel, yLabel, referenceLines = NO_LINES, placeholder, footer, xDomain, xTicks }) {
165
190
  const { numberLocale } = useLocale();
166
191
  const formatValue = useMemo(() => valueFormatter ?? new Intl.NumberFormat(numberLocale).format, [valueFormatter, numberLocale]);
167
192
  const config = Object.fromEntries(series.map(({ key, label, color }) => [key, {
@@ -293,23 +318,32 @@ function ChartFrame({ chart: Chart, children, horizontal = false, stackOffset, o
293
318
  y: at.x
294
319
  } : at,
295
320
  stroke: emphasis === "strong" ? "var(--foreground)" : "var(--muted-foreground)",
321
+ shape: haloLine,
296
322
  strokeDasharray: at.y === void 0 ? void 0 : "4 4",
297
323
  label: label === void 0 ? void 0 : {
298
324
  value: label,
299
325
  position: labelPosition,
300
- className: "fill-muted-foreground text-xs"
326
+ className: "fill-muted-foreground stroke-card text-xs",
327
+ style: {
328
+ paintOrder: "stroke",
329
+ strokeWidth: 3,
330
+ strokeLinejoin: "round"
331
+ }
301
332
  }
302
333
  }, `${at.x ?? ""}:${at.y ?? ""}:${label ?? ""}`)),
303
- /* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(ChartTooltipContent, {
304
- labelFormatter: (_, payload) => {
305
- const row = payload[0]?.payload;
306
- return row ? xTooltipFormatter(row[xKey]) : null;
307
- },
308
- formatter: seriesRow(series, formatValue)
309
- }) }),
334
+ /* @__PURE__ */ jsx(ChartTooltip, {
335
+ cursor: { fillOpacity: .4 },
336
+ content: /* @__PURE__ */ jsx(ChartTooltipContent, {
337
+ labelFormatter: (_, payload) => {
338
+ const row = payload[0]?.payload;
339
+ return row ? xTooltipFormatter(row[xKey]) : null;
340
+ },
341
+ formatter: tooltipRow ?? seriesRow(series, formatValue)
342
+ })
343
+ }),
310
344
  children,
311
345
  /* @__PURE__ */ jsx(ChartLegend, {
312
- content: /* @__PURE__ */ jsx(ChartLegendContent, {}),
346
+ content: legend,
313
347
  itemSorter: null
314
348
  })
315
349
  ]
@@ -6,7 +6,7 @@ import { ReactNode } from "react";
6
6
  */
7
7
  export type ChartColor = "var(--chart-1)" | "var(--chart-2)" | "var(--chart-3)" | "var(--chart-4)" | "var(--chart-5)" | "var(--muted-foreground)" | "var(--positive)" | "var(--negative)";
8
8
  /** The fields of a row that hold numbers: the ones a series can plot. */
9
- type NumericKey<T> = { [K in keyof T]-?: T[K] extends number | null | undefined ? K : never; }[keyof T] & string;
9
+ export type NumericKey<T> = { [K in keyof T]-?: T[K] extends number | null | undefined ? K : never; }[keyof T] & string;
10
10
  /** One series: the field it plots, its name in the legend and tooltip, and its colour. */
11
11
  export interface ChartSeriesItem<T> {
12
12
  key: NumericKey<T>;
@@ -94,5 +94,4 @@ export interface NumericXProps {
94
94
  * be drawn; "monotone", the default, smooths between them without overshooting a point.
95
95
  */
96
96
  export type ChartCurve = "monotone" | "linear";
97
- //#endregion
98
- export {};
97
+ //#endregion
@@ -0,0 +1,6 @@
1
+ //#region src/lib/fit-text.d.ts
2
+ /** About how wide a text-xs label draws, in pixels. */
3
+ export declare const textWidth: (text: string) => number;
4
+ /** The label, cut with an ellipsis when it would draw wider than `width` pixels at text-xs. */
5
+ export declare function fit(text: string, width: number): string;
6
+ //#endregion
@@ -0,0 +1,11 @@
1
+ //#region src/lib/fit-text.ts
2
+ const CHAR_PX = 6.6;
3
+ /** About how wide a text-xs label draws, in pixels. */
4
+ const textWidth = (text) => text.length * CHAR_PX;
5
+ /** The label, cut with an ellipsis when it would draw wider than `width` pixels at text-xs. */
6
+ function fit(text, width) {
7
+ const room = Math.floor(width / CHAR_PX);
8
+ return text.length <= room ? text : `${text.slice(0, Math.max(room - 1, 1)).trimEnd()}…`;
9
+ }
10
+ //#endregion
11
+ export { fit, textWidth };
@@ -0,0 +1,7 @@
1
+ //#region src/lib/heat.d.ts
2
+ export declare const HEAT_STEPS = 5;
3
+ /** The range the heat scale uses: one that is not a positive number falls back to ±5%. */
4
+ export declare const heatRange: (range?: number) => number;
5
+ export declare const heatFill: (side: "positive" | "negative", step: number) => string;
6
+ export declare function heat(change: number | null, range?: number): string;
7
+ //#endregion
@@ -0,0 +1,14 @@
1
+ //#region src/lib/heat.ts
2
+ /** The signed heat scale a Treemap tile and a ChangeGrid cell share: five steps of gain or loss mixed into the card. */
3
+ const DEFAULT_RANGE = .05;
4
+ const HEAT_STEPS = 5;
5
+ /** The range the heat scale uses: one that is not a positive number falls back to ±5%. */
6
+ const heatRange = (range = DEFAULT_RANGE) => Number.isFinite(range) && range > 0 ? range : DEFAULT_RANGE;
7
+ const heatFill = (side, step) => `color-mix(in oklab, var(--${side}) var(--heat-${step}), var(--card))`;
8
+ function heat(change, range) {
9
+ if (!change || !Number.isFinite(change)) return "var(--muted)";
10
+ const step = Math.min(5, Math.ceil(Math.abs(change) / heatRange(range) * 5));
11
+ return heatFill(change > 0 ? "positive" : "negative", step);
12
+ }
13
+ //#endregion
14
+ export { HEAT_STEPS, heat, heatFill, heatRange };
@@ -0,0 +1,98 @@
1
+ //#region src/lib/scatter.d.ts
2
+ /**
3
+ * Ticks for a log axis at 1, 2 and 5 times a power of ten, from the largest at or under min to the smallest at or
4
+ * over max, so the axis ends on a tick and every label reads as a round number.
5
+ */
6
+ export declare function logTicks(min: number, max: number): number[];
7
+ /**
8
+ * Ticks for a linear axis that just covers min to max, about `count` of them, a step of 1, 2, 2.5 or 5 times a power
9
+ * of ten: −50% to +75% by 25s, never −50% to +150% because the step had to be 50. Values that differ only by float
10
+ * noise, such as 0.3 and 0.30000000000000004, count as one value and get that value as their only tick.
11
+ */
12
+ export declare function linearTicks(min: number, max: number, count?: number): number[];
13
+ export interface Box {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ }
19
+ export interface LabelCandidate {
20
+ key: string;
21
+ text: string;
22
+ /** The dot's centre, in pixels. */
23
+ cx: number;
24
+ cy: number;
25
+ /** The dot's radius, its edge included: a sized dot keeps names off all of itself. */
26
+ r: number;
27
+ }
28
+ export interface PlacedLabel {
29
+ key: string;
30
+ text: string;
31
+ /** Where the text starts and its baseline, with textAnchor="start". */
32
+ x: number;
33
+ y: number;
34
+ }
35
+ /** How labels are set: their type size in pixels and a name's width in that type. */
36
+ export interface LabelType {
37
+ size: number;
38
+ measure: (text: string) => number;
39
+ }
40
+ /**
41
+ * Names beside dots, in the candidates' order, up to `limit`: each tries the right of its dot, then the left, above,
42
+ * below and the four corners, and takes the first spot inside the plot that covers no other label, no other dot and
43
+ * nothing `reserved` (such as a quadrant's name). A name that finds no spot is left to the tooltip, so labels never sit
44
+ * on top of each other.
45
+ */
46
+ export declare function placeLabels(candidates: readonly LabelCandidate[], plot: Box, limit: number, { size, measure }: LabelType, reserved?: readonly Box[]): PlacedLabel[];
47
+ /**
48
+ * Splits the plot into four at a value on each axis, such as zero, with an optional name in each corner. On a log
49
+ * axis x must be above zero, or no split is drawn. A name that does not fit its quadrant in two lines is left out.
50
+ */
51
+ export interface ScatterQuadrants {
52
+ x: number;
53
+ y: number;
54
+ labels?: {
55
+ topLeft?: string;
56
+ topRight?: string;
57
+ bottomLeft?: string;
58
+ bottomRight?: string;
59
+ };
60
+ }
61
+ export type QuadrantLabels = ScatterQuadrants["labels"];
62
+ /** A split a log axis cannot place, at or below zero, or one that is not a number, is no split at all. */
63
+ export declare function quadrantSplit(quadrants: ScatterQuadrants | undefined, xScale: "linear" | "log"): ScatterQuadrants | undefined;
64
+ /** The largest sized dot; the smallest stays big enough to see and to tap. */
65
+ export declare const MAX_RADIUS = 20;
66
+ /**
67
+ * Each dot's radius. Area, not radius, follows size, so a holding twice as large has twice the ink. A size that weighs
68
+ * nothing draws the smallest dot, so it cannot shrink or hide the others. Points without sizes all take `plain`.
69
+ */
70
+ export declare function dotSizes(points: readonly {
71
+ size?: number;
72
+ }[], plain: number): {
73
+ radiusOf: (p: {
74
+ size?: number;
75
+ }) => number;
76
+ sized: boolean;
77
+ };
78
+ /**
79
+ * Each corner's name in the plot's corner, in the band the y axis keeps clear above or below the data, wrapped to its
80
+ * own quadrant's width so two names on one edge never meet: where its lines are drawn, and the box they take.
81
+ */
82
+ export declare function corners(plot: Box, names: QuadrantLabels, split: {
83
+ x: number;
84
+ y: number;
85
+ } | null, type: LabelType): {
86
+ key: string;
87
+ lines: string[];
88
+ x: number;
89
+ y: number;
90
+ line: number;
91
+ box: {
92
+ x: number;
93
+ y: number;
94
+ width: number;
95
+ height: number;
96
+ };
97
+ }[];
98
+ //#endregion