@siyahi/ui 0.1.9-next.1 → 0.1.9-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/THIRD_PARTY_NOTICES.md +2 -1
- package/dist/components/registry/charts/area-chart-card.d.ts +4 -3
- package/dist/components/registry/charts/area-chart-card.js +2 -2
- package/dist/components/registry/charts/bar-chart-card.d.ts +7 -1
- package/dist/components/registry/charts/bar-chart-card.js +33 -14
- package/dist/components/registry/charts/line-chart-card.d.ts +5 -2
- package/dist/components/registry/charts/line-chart-card.js +2 -2
- package/dist/components/registry/dashboard-01/section-cards.d.ts +2 -0
- package/dist/components/registry/dashboard-01/section-cards.js +3 -2
- package/dist/components/registry/dashboardcn/bar-list.d.ts +3 -1
- package/dist/components/registry/dashboardcn/bar-list.js +3 -3
- package/dist/components/registry/dashboardcn/distribution-bar.d.ts +38 -0
- package/dist/components/registry/dashboardcn/distribution-bar.js +118 -0
- package/dist/components/registry/minidev/copy-button.d.ts +11 -0
- package/dist/components/registry/minidev/copy-button.js +34 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +3 -2
- package/dist/lib/chart-frame.d.ts +15 -3
- package/dist/lib/chart-frame.js +183 -56
- package/dist/lib/chart-series.d.ts +55 -3
- package/package.json +1 -1
- package/registry.lock.json +16 -0
- package/dist/lib/recharts.d.ts +0 -2
- package/dist/lib/recharts.js +0 -1
package/README.md
CHANGED
|
@@ -104,7 +104,11 @@ Every merge to `main` also attaches both tarballs to a GitHub release
|
|
|
104
104
|
| Counts or amounts per period, one series or several | `BarChartCard`; `stacked` when the series add up to a total |
|
|
105
105
|
| A running level, such as a portfolio's value against money put in | `AreaChartCard` |
|
|
106
106
|
| Series compared point by point, such as a return against an index | `LineChartCard` |
|
|
107
|
-
|
|
|
107
|
+
| Samples in time with limits and events marked | `LineChartCard` with `xDomain`, `xTicks` and `referenceLines` |
|
|
108
|
+
| Long category names, such as sectors | `BarChartCard` with `horizontal` |
|
|
109
|
+
| A gain above zero and a loss below it | a series with `color` and `negativeColor` |
|
|
110
|
+
| Ranked counts or amounts by category (a name, a bar and a figure) | `BarList`; give two lists one `max` to share a scale |
|
|
111
|
+
| Where a budget sits, a split of a whole, or losses against gains | `DistributionBar` |
|
|
108
112
|
| Headline figures with their change | `SectionCards`, with a `Delta` in each badge |
|
|
109
113
|
| One instrument's price history | `PriceChart` |
|
|
110
114
|
| Holdings sized by weight and coloured by change | `Treemap` |
|
|
@@ -117,6 +121,7 @@ Every merge to `main` also attaches both tarballs to a GitHub release
|
|
|
117
121
|
| One part of a long page: rule, eyebrow, heading, lead, action | `PageSection`, with `PageSubheading` inside |
|
|
118
122
|
| Label and value pairs, such as a record's fields | `DataList` and `DataListItem` |
|
|
119
123
|
| A command or file to copy, wrapped or scrolling | `CodeBlock` with `CodeBlockCopyButton` |
|
|
124
|
+
| A labelled copy action, such as "Copy all" for a section | `CopyButton` |
|
|
120
125
|
| A command, file or identifier inside prose | `InlineCode` |
|
|
121
126
|
| A signed figure (a gain, a loss, a change) | `Delta` |
|
|
122
127
|
| A time, with the viewer's own clock on hover | `LocalTime` |
|
|
@@ -125,7 +130,10 @@ The three chart cards take the rows, the field the x axis reads and the series,
|
|
|
125
130
|
and own everything else: the card and its header action (a range or mode
|
|
126
131
|
toggle), the axes, the dashed horizontal grid, Geist Mono ticks, a tooltip that
|
|
127
132
|
names the hovered point and gives each series' formatted value, and the legend
|
|
128
|
-
below.
|
|
133
|
+
below. Props cover the rest: a footer, a placeholder while data loads,
|
|
134
|
+
reference lines, a numeric x axis, a fixed value axis, axis titles, a second
|
|
135
|
+
line under each tick, a picked category, sideways bars and straight segments.
|
|
136
|
+
A page never puts Recharts axes, grids or tooltips together itself.
|
|
129
137
|
|
|
130
138
|
```tsx
|
|
131
139
|
<BarChartCard
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -17,7 +17,8 @@ file as copied; `packages/ui/registry.lock.json` lists them all and
|
|
|
17
17
|
| Heatmaps: calendar, weekday by hour, status timeline | `src/components/registry/heatmap/*` | https://shadcn-heatmap.pages.dev/r/calendar-heatmap.json, https://shadcn-heatmap.pages.dev/r/weekday-heatmap.json, https://shadcn-heatmap.pages.dev/r/status-heatmap.json (source: https://github.com/rutopio/shadcn-heatmap) | MIT, Copyright (c) 2026 ChingRu |
|
|
18
18
|
| niko-table data table on TanStack Table | `src/components/registry/niko-table/*` | https://niko-table.com/r/data-table.json, https://niko-table.com/r/data-table-core.json, https://niko-table.com/r/data-table-ui.json, https://niko-table.com/r/data-table-faceted-filter.json, https://niko-table.com/r/data-table-column-sort.json, https://niko-table.com/r/data-table-search-filter.json (source: https://github.com/Semkoo/niko-table-registry) | MIT, Copyright (c) 2025 Semir N.; original work Copyright (c) 2025 WebDevSimplified |
|
|
19
19
|
| shadcn chart blocks `chart-bar-multiple`, `chart-area-stacked`, `chart-line-multiple` | `src/components/registry/charts/*` | https://ui.shadcn.com/r/styles/new-york-v4/chart-bar-multiple.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-area-stacked.json, https://ui.shadcn.com/r/styles/new-york-v4/chart-line-multiple.json | MIT, Copyright (c) 2023 shadcn |
|
|
20
|
-
| dashboardcn ranked list (`BarList`)
|
|
20
|
+
| dashboardcn ranked list (`BarList`) and stacked bar (`DistributionBar`) | `src/components/registry/dashboardcn/*` | https://dashboardcn.com/r/bar-list.json, https://dashboardcn.com/r/distribution-bar.json (source: https://github.com/NoahGdev/dashboardcn) | MIT, Copyright (c) 2026 dashboardcn contributors |
|
|
21
|
+
| MiniDev copy button (`CopyButton`) | `src/components/registry/minidev/copy-button.tsx` | https://ui.minidev.pro/r/copy-button.json (source: https://github.com/amankaushik481/minidev-ui) | MIT, Copyright (c) 2026 MiniDev |
|
|
21
22
|
|
|
22
23
|
## Runtime dependencies with attribution terms
|
|
23
24
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { SeriesChartProps } from "../../../lib/chart-series.js";
|
|
1
|
+
import { ChartCurve, NumericXProps, SeriesChartProps } from "../../../lib/chart-series.js";
|
|
2
2
|
//#region src/components/registry/charts/area-chart-card.d.ts
|
|
3
|
-
export interface AreaChartCardProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K
|
|
3
|
+
export interface AreaChartCardProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K>, NumericXProps {
|
|
4
4
|
/** Stack the series into a total instead of overlapping them. */
|
|
5
5
|
stacked?: boolean;
|
|
6
|
+
curve?: ChartCurve;
|
|
6
7
|
}
|
|
7
8
|
/** Values over an ordered axis as filled areas: one series, or several overlapping or stacked. */
|
|
8
|
-
export declare function AreaChartCard<T extends object, K extends keyof T>({ stacked, ...props }: AreaChartCardProps<T, K>): import("react").JSX.Element;
|
|
9
|
+
export declare function AreaChartCard<T extends object, K extends keyof T>({ stacked, curve, ...props }: AreaChartCardProps<T, K>): import("react").JSX.Element;
|
|
9
10
|
//#endregion
|
|
@@ -4,13 +4,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { Area, AreaChart } from "recharts";
|
|
5
5
|
//#region src/components/registry/charts/area-chart-card.tsx
|
|
6
6
|
/** Values over an ordered axis as filled areas: one series, or several overlapping or stacked. */
|
|
7
|
-
function AreaChartCard({ stacked = false, ...props }) {
|
|
7
|
+
function AreaChartCard({ stacked = false, curve = "monotone", ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(ChartFrame, {
|
|
9
9
|
chart: AreaChart,
|
|
10
10
|
...props,
|
|
11
11
|
children: props.series.map(({ key, color }) => /* @__PURE__ */ jsx(Area, {
|
|
12
12
|
dataKey: key,
|
|
13
|
-
type:
|
|
13
|
+
type: curve,
|
|
14
14
|
fill: color,
|
|
15
15
|
fillOpacity: stacked ? .4 : .2,
|
|
16
16
|
stroke: color,
|
|
@@ -3,7 +3,13 @@ import { SeriesChartProps } from "../../../lib/chart-series.js";
|
|
|
3
3
|
export interface BarChartCardProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K> {
|
|
4
4
|
/** Stack the series in one bar per point instead of side by side. */
|
|
5
5
|
stacked?: boolean;
|
|
6
|
+
/** Bars run sideways, categories down the left: for long names, such as sectors. */
|
|
7
|
+
horizontal?: boolean;
|
|
8
|
+
/** The picked category's x value: its bars stay solid and the rest fade. */
|
|
9
|
+
selected?: T[K] | null;
|
|
10
|
+
/** Called with a clicked category's x value, or null when the picked one is clicked again. */
|
|
11
|
+
onSelect?: (value: T[K] | null) => void;
|
|
6
12
|
}
|
|
7
13
|
/** Values over an ordered axis as bars: one series, or several grouped or stacked. */
|
|
8
|
-
export declare function BarChartCard<T extends object, K extends keyof T>({ stacked, ...props }: BarChartCardProps<T, K>): import("react").JSX.Element;
|
|
14
|
+
export declare function BarChartCard<T extends object, K extends keyof T>({ stacked, selected, onSelect, ...props }: BarChartCardProps<T, K>): import("react").JSX.Element;
|
|
9
15
|
//#endregion
|
|
@@ -1,24 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ChartFrame } from "../../../lib/chart-frame.js";
|
|
2
|
+
import { ChartFrame, seriesFill } from "../../../lib/chart-frame.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Bar, BarChart } from "recharts";
|
|
4
|
+
import { Bar, BarChart, Cell } from "recharts";
|
|
5
5
|
//#region src/components/registry/charts/bar-chart-card.tsx
|
|
6
6
|
/** Values over an ordered axis as bars: one series, or several grouped or stacked. */
|
|
7
|
-
function BarChartCard({ stacked = false, ...props }) {
|
|
7
|
+
function BarChartCard({ stacked = false, selected = null, onSelect, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(ChartFrame, {
|
|
9
9
|
chart: BarChart,
|
|
10
10
|
...props,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
0,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
stackOffset: stacked ? "sign" : void 0,
|
|
12
|
+
children: props.series.map((item, index) => {
|
|
13
|
+
const { key, label, color, negativeColor } = item;
|
|
14
|
+
return /* @__PURE__ */ jsx(Bar, {
|
|
15
|
+
dataKey: key,
|
|
16
|
+
name: label,
|
|
17
|
+
fill: seriesFill(item, props.data),
|
|
18
|
+
stackId: stacked ? "stack" : void 0,
|
|
19
|
+
radius: !stacked ? 2 : index === props.series.length - 1 ? props.horizontal ? [
|
|
20
|
+
0,
|
|
21
|
+
2,
|
|
22
|
+
2,
|
|
23
|
+
0
|
|
24
|
+
] : [
|
|
25
|
+
2,
|
|
26
|
+
2,
|
|
27
|
+
0,
|
|
28
|
+
0
|
|
29
|
+
] : 0,
|
|
30
|
+
className: onSelect ? "cursor-pointer" : void 0,
|
|
31
|
+
onClick: onSelect && ((bar) => {
|
|
32
|
+
const value = bar.payload?.[props.xKey];
|
|
33
|
+
if (value !== void 0) onSelect(value === selected ? null : value);
|
|
34
|
+
}),
|
|
35
|
+
children: (negativeColor || selected !== null) && props.data.map((row, i) => /* @__PURE__ */ jsx(Cell, {
|
|
36
|
+
fill: negativeColor && Number(row[key]) < 0 ? negativeColor : color,
|
|
37
|
+
fillOpacity: selected === null || row[props.xKey] === selected ? 1 : .35
|
|
38
|
+
}, i))
|
|
39
|
+
}, key);
|
|
40
|
+
})
|
|
22
41
|
});
|
|
23
42
|
}
|
|
24
43
|
//#endregion
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { SeriesChartProps } from "../../../lib/chart-series.js";
|
|
1
|
+
import { ChartCurve, NumericXProps, SeriesChartProps } from "../../../lib/chart-series.js";
|
|
2
2
|
//#region src/components/registry/charts/line-chart-card.d.ts
|
|
3
|
+
export interface LineChartCardProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K>, NumericXProps {
|
|
4
|
+
curve?: ChartCurve;
|
|
5
|
+
}
|
|
3
6
|
/** Values over an ordered axis as lines: one series, or several to compare, such as a portfolio against its index. */
|
|
4
|
-
export declare function LineChartCard<T extends object, K extends keyof T>(props:
|
|
7
|
+
export declare function LineChartCard<T extends object, K extends keyof T>({ curve, ...props }: LineChartCardProps<T, K>): import("react").JSX.Element;
|
|
5
8
|
//#endregion
|
|
@@ -4,13 +4,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { Line, LineChart } from "recharts";
|
|
5
5
|
//#region src/components/registry/charts/line-chart-card.tsx
|
|
6
6
|
/** Values over an ordered axis as lines: one series, or several to compare, such as a portfolio against its index. */
|
|
7
|
-
function LineChartCard(props) {
|
|
7
|
+
function LineChartCard({ curve = "monotone", ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(ChartFrame, {
|
|
9
9
|
chart: LineChart,
|
|
10
10
|
...props,
|
|
11
11
|
children: props.series.map(({ key, color }) => /* @__PURE__ */ jsx(Line, {
|
|
12
12
|
dataKey: key,
|
|
13
|
-
type:
|
|
13
|
+
type: curve,
|
|
14
14
|
stroke: color,
|
|
15
15
|
strokeWidth: 2,
|
|
16
16
|
dot: false
|
|
@@ -10,6 +10,8 @@ export interface SectionCard {
|
|
|
10
10
|
headline?: React$1.ReactNode;
|
|
11
11
|
/** Muted second footer line. */
|
|
12
12
|
detail?: React$1.ReactNode;
|
|
13
|
+
/** In a picker, a tile that cannot be picked, such as one with nothing in it: faded, and its button disabled. */
|
|
14
|
+
disabled?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export interface SectionCardsProps {
|
|
15
17
|
items: SectionCard[];
|
|
@@ -18,12 +18,13 @@ function SectionCards({ items, selected, onSelect }) {
|
|
|
18
18
|
children: /* @__PURE__ */ jsx("div", {
|
|
19
19
|
className: cn("grid grid-cols-1 gap-4", COLUMNS[items.length] ?? COLUMNS[4]),
|
|
20
20
|
children: items.map((item) => /* @__PURE__ */ jsxs(Card, {
|
|
21
|
-
className: cn("@container/card", onSelect && "relative", item.label === selected && "ring-2 ring-primary!"),
|
|
21
|
+
className: cn("@container/card", onSelect && "relative", item.label === selected && "ring-2 ring-primary!", onSelect && item.disabled && "opacity-60"),
|
|
22
22
|
children: [
|
|
23
23
|
onSelect && /* @__PURE__ */ jsx("button", {
|
|
24
24
|
type: "button",
|
|
25
25
|
"aria-label": item.label,
|
|
26
26
|
"aria-pressed": item.label === selected,
|
|
27
|
+
disabled: item.disabled,
|
|
27
28
|
onClick: () => onSelect(item.label),
|
|
28
29
|
className: "absolute inset-0 z-10 rounded-4xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset"
|
|
29
30
|
}),
|
|
@@ -41,7 +42,7 @@ function SectionCards({ items, selected, onSelect }) {
|
|
|
41
42
|
(item.headline || item.detail) && /* @__PURE__ */ jsxs(CardFooter, {
|
|
42
43
|
className: "flex-col items-start gap-1.5 text-sm",
|
|
43
44
|
children: [item.headline && /* @__PURE__ */ jsx("div", {
|
|
44
|
-
className: "
|
|
45
|
+
className: "flex flex-wrap gap-2 font-medium",
|
|
45
46
|
children: item.headline
|
|
46
47
|
}), item.detail && /* @__PURE__ */ jsx("div", {
|
|
47
48
|
className: "text-muted-foreground",
|
|
@@ -19,8 +19,10 @@ export interface BarListProps extends React$1.ComponentProps<"div"> {
|
|
|
19
19
|
color?: string;
|
|
20
20
|
/** Show each row's share of the total next to its value. */
|
|
21
21
|
showPercentage?: boolean;
|
|
22
|
+
/** The value a full-width bar stands for. Give two lists the same max to draw them on one scale. Defaults to the largest value. */
|
|
23
|
+
max?: number;
|
|
22
24
|
onItemClick?: (item: BarListItem) => void;
|
|
23
25
|
}
|
|
24
|
-
declare function BarList({ data, valueFormatter, sortOrder, color, showPercentage, onItemClick, className, ...props }: BarListProps): React$1.JSX.Element;
|
|
26
|
+
declare function BarList({ data, valueFormatter, sortOrder, color, showPercentage, max: scale, onItemClick, className, ...props }: BarListProps): React$1.JSX.Element;
|
|
25
27
|
//#endregion
|
|
26
28
|
export { BarList };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useLocale } from "../../siyahi/siyahi-provider.js";
|
|
2
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { useLocale } from "../../siyahi/siyahi-provider.js";
|
|
3
3
|
import { pct } from "../../../lib/format.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import * as React$1 from "react";
|
|
6
6
|
//#region src/components/registry/dashboardcn/bar-list.tsx
|
|
7
|
-
function BarList({ data, valueFormatter, sortOrder = "descending", color = "var(--chart-1)", showPercentage = false, onItemClick, className, ...props }) {
|
|
7
|
+
function BarList({ data, valueFormatter, sortOrder = "descending", color = "var(--chart-1)", showPercentage = false, max: scale, onItemClick, className, ...props }) {
|
|
8
8
|
const locale = useLocale();
|
|
9
9
|
const format = valueFormatter ?? ((value) => new Intl.NumberFormat(locale.numberLocale, {
|
|
10
10
|
notation: "compact",
|
|
@@ -15,7 +15,7 @@ function BarList({ data, valueFormatter, sortOrder = "descending", color = "var(
|
|
|
15
15
|
const sorted = [...data].sort((a, b) => a.value - b.value);
|
|
16
16
|
return sortOrder === "descending" ? sorted.reverse() : sorted;
|
|
17
17
|
}, [data, sortOrder]);
|
|
18
|
-
const max = Math.max(...items.map((item) => item.value), 0);
|
|
18
|
+
const max = scale ?? Math.max(...items.map((item) => item.value), 0);
|
|
19
19
|
const total = items.reduce((sum, item) => sum + item.value, 0);
|
|
20
20
|
return /* @__PURE__ */ jsx("div", {
|
|
21
21
|
"data-slot": "bar-list",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChartColor } from "../../../lib/chart-series.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/registry/dashboardcn/distribution-bar.d.ts
|
|
4
|
+
export interface DistributionSegment {
|
|
5
|
+
name: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Defaults to chart-1 through chart-5 in order; var(--muted) for space that is free. */
|
|
8
|
+
color?: ChartColor | "var(--muted)";
|
|
9
|
+
/** Stable key when names can repeat. */
|
|
10
|
+
key?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DistributionMarker {
|
|
13
|
+
/** The value the line marks, on the bar's scale. */
|
|
14
|
+
at: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DistributionBarProps extends Omit<React$1.ComponentProps<"div">, "onMouseLeave"> {
|
|
18
|
+
segments: DistributionSegment[];
|
|
19
|
+
valueFormatter?: (value: number) => string;
|
|
20
|
+
showLegend?: boolean;
|
|
21
|
+
/** Show absolute values in the legend in addition to the share. */
|
|
22
|
+
showValues?: boolean;
|
|
23
|
+
/** The value the bar's right end stands for. Defaults to the positive segments' total. */
|
|
24
|
+
max?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The value the bar's left end stands for. Defaults to the negative segments' total, or 0 when there are none.
|
|
27
|
+
* Above zero, segments (which start at zero) fall off the bar.
|
|
28
|
+
*/
|
|
29
|
+
min?: number;
|
|
30
|
+
markers?: DistributionMarker[];
|
|
31
|
+
/** The key (or name) of the one segment to keep solid; the rest fade. */
|
|
32
|
+
highlighted?: string | null;
|
|
33
|
+
/** Called with the segment under the pointer, and null when it leaves the bar. */
|
|
34
|
+
onHover?: (segment: DistributionSegment | null) => void;
|
|
35
|
+
}
|
|
36
|
+
declare function DistributionBar({ segments, valueFormatter, showLegend, showValues, max, min, markers, highlighted, onHover, className, "aria-label": ariaLabel, ...props }: DistributionBarProps): React$1.JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DistributionBar };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { useLocale } from "../../siyahi/siyahi-provider.js";
|
|
3
|
+
import { pct } from "../../../lib/format.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
//#region src/components/registry/dashboardcn/distribution-bar.tsx
|
|
7
|
+
const defaultColors = [
|
|
8
|
+
"var(--chart-1)",
|
|
9
|
+
"var(--chart-2)",
|
|
10
|
+
"var(--chart-3)",
|
|
11
|
+
"var(--chart-4)",
|
|
12
|
+
"var(--chart-5)"
|
|
13
|
+
];
|
|
14
|
+
function DistributionBar({ segments, valueFormatter, showLegend = true, showValues = false, max, min, markers = [], highlighted = null, onHover, className, "aria-label": ariaLabel, ...props }) {
|
|
15
|
+
const locale = useLocale();
|
|
16
|
+
const format = valueFormatter ?? ((value) => new Intl.NumberFormat(locale.numberLocale, {
|
|
17
|
+
notation: "compact",
|
|
18
|
+
maximumFractionDigits: 1
|
|
19
|
+
}).format(value));
|
|
20
|
+
const total = segments.reduce((sum, segment) => sum + Math.abs(segment.value), 0);
|
|
21
|
+
const gains = segments.reduce((sum, segment) => sum + Math.max(segment.value, 0), 0);
|
|
22
|
+
const losses = segments.reduce((sum, segment) => sum + Math.min(segment.value, 0), 0);
|
|
23
|
+
const bottom = min ?? losses;
|
|
24
|
+
const top = max ?? gains;
|
|
25
|
+
const span = top - bottom || 1;
|
|
26
|
+
const position = (value) => (value - bottom) / span * 100;
|
|
27
|
+
const shown = markers.filter((marker) => marker.at >= bottom && marker.at <= top).map((marker, index) => ({
|
|
28
|
+
...marker,
|
|
29
|
+
key: `${marker.at}:${marker.label ?? ""}:${index}`
|
|
30
|
+
}));
|
|
31
|
+
let above = 0;
|
|
32
|
+
let below = 0;
|
|
33
|
+
const resolved = segments.map((segment, index) => {
|
|
34
|
+
const key = segment.key ?? segment.name;
|
|
35
|
+
const size = Math.abs(segment.value);
|
|
36
|
+
const start = segment.value < 0 ? below -= size : (above += size) - size;
|
|
37
|
+
return {
|
|
38
|
+
...segment,
|
|
39
|
+
key,
|
|
40
|
+
color: segment.color ?? defaultColors[index % defaultColors.length],
|
|
41
|
+
share: total > 0 ? size / total : 0,
|
|
42
|
+
left: position(start),
|
|
43
|
+
width: size / span * 100
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const figure = (segment) => max === void 0 ? pct(segment.share, locale) : format(segment.value);
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
"data-slot": "distribution-bar",
|
|
49
|
+
className: cn("flex flex-col gap-3", className),
|
|
50
|
+
...props,
|
|
51
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "relative",
|
|
53
|
+
children: [
|
|
54
|
+
shown.some((m) => m.label) ? /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "text-muted-foreground relative h-4 font-mono text-xs",
|
|
56
|
+
children: shown.map((marker) => marker.label ? /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: cn("absolute top-0 whitespace-nowrap", position(marker.at) <= 5 ? "translate-x-0" : position(marker.at) >= 95 ? "-translate-x-full" : "-translate-x-1/2"),
|
|
58
|
+
style: { left: `${position(marker.at)}%` },
|
|
59
|
+
children: marker.label
|
|
60
|
+
}, marker.key) : null)
|
|
61
|
+
}) : null,
|
|
62
|
+
/* @__PURE__ */ jsx("div", {
|
|
63
|
+
role: "img",
|
|
64
|
+
"aria-label": ariaLabel ?? resolved.map((segment) => `${segment.name} ${figure(segment)}`).join(", "),
|
|
65
|
+
className: "bg-muted relative h-2.5 w-full overflow-hidden rounded-full",
|
|
66
|
+
onMouseLeave: onHover ? () => onHover(null) : void 0,
|
|
67
|
+
children: resolved.map((segment) => segment.width > 0 ? /* @__PURE__ */ jsx("div", {
|
|
68
|
+
"data-slot": "distribution-segment",
|
|
69
|
+
className: "border-card absolute inset-y-0 border-x transition-[width,left,opacity] duration-300",
|
|
70
|
+
style: {
|
|
71
|
+
left: `${segment.left}%`,
|
|
72
|
+
width: `${segment.width}%`,
|
|
73
|
+
backgroundColor: segment.color,
|
|
74
|
+
opacity: highlighted === null || highlighted === segment.key ? 1 : .35
|
|
75
|
+
},
|
|
76
|
+
onMouseEnter: onHover ? () => onHover(segment) : void 0
|
|
77
|
+
}, segment.key) : null)
|
|
78
|
+
}),
|
|
79
|
+
shown.map((marker) => /* @__PURE__ */ jsx("div", {
|
|
80
|
+
"data-slot": "distribution-marker",
|
|
81
|
+
"aria-hidden": "true",
|
|
82
|
+
className: "bg-foreground absolute bottom-0 h-2.5 w-0.5 -translate-x-1/2",
|
|
83
|
+
style: { left: `${position(marker.at)}%` }
|
|
84
|
+
}, marker.key))
|
|
85
|
+
]
|
|
86
|
+
}), showLegend ? /* @__PURE__ */ jsx("ul", {
|
|
87
|
+
className: "flex flex-wrap gap-x-4 gap-y-1.5 text-sm",
|
|
88
|
+
children: resolved.map((segment) => /* @__PURE__ */ jsxs("li", {
|
|
89
|
+
className: "flex items-center gap-2",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx("span", {
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
className: "size-2.5 shrink-0 rounded-xs",
|
|
94
|
+
style: { backgroundColor: segment.color }
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: "text-muted-foreground",
|
|
98
|
+
children: segment.name
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("span", {
|
|
101
|
+
className: "font-medium tabular-nums",
|
|
102
|
+
children: figure(segment)
|
|
103
|
+
}),
|
|
104
|
+
showValues && max === void 0 ? /* @__PURE__ */ jsxs("span", {
|
|
105
|
+
className: "text-muted-foreground tabular-nums",
|
|
106
|
+
children: [
|
|
107
|
+
"(",
|
|
108
|
+
format(segment.value),
|
|
109
|
+
")"
|
|
110
|
+
]
|
|
111
|
+
}) : null
|
|
112
|
+
]
|
|
113
|
+
}, segment.key))
|
|
114
|
+
}) : null]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { DistributionBar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buttonVariants } from "../../ui/button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/registry/minidev/copy-button.d.ts
|
|
5
|
+
declare function CopyButton({ value, className, variant, size, label, copiedLabel, ...props }: {
|
|
6
|
+
value: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
copiedLabel?: string;
|
|
9
|
+
} & React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants>): React$1.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CopyButton };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "../../ui/button.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import "class-variance-authority";
|
|
8
|
+
//#region src/components/registry/minidev/copy-button.tsx
|
|
9
|
+
function CopyButton({ value, className, variant = "outline", size = "sm", label = "Copy", copiedLabel = "Copied", ...props }) {
|
|
10
|
+
const [copied, setCopied] = React$1.useState(false);
|
|
11
|
+
React$1.useEffect(() => {
|
|
12
|
+
if (!copied) return;
|
|
13
|
+
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
14
|
+
return () => clearTimeout(timeout);
|
|
15
|
+
}, [copied]);
|
|
16
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
17
|
+
type: "button",
|
|
18
|
+
variant,
|
|
19
|
+
size,
|
|
20
|
+
"data-slot": "copy-button",
|
|
21
|
+
className: cn(className),
|
|
22
|
+
"aria-label": copied ? copiedLabel : label,
|
|
23
|
+
onClick: async () => {
|
|
24
|
+
try {
|
|
25
|
+
await navigator.clipboard.writeText(value);
|
|
26
|
+
setCopied(true);
|
|
27
|
+
} catch {}
|
|
28
|
+
},
|
|
29
|
+
...props,
|
|
30
|
+
children: [copied ? /* @__PURE__ */ jsx(CheckIcon, { "data-icon": "inline-start" }) : /* @__PURE__ */ jsx(CopyIcon, { "data-icon": "inline-start" }), copied ? copiedLabel : label]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { CopyButton };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { ChartColor, ChartSeries, ChartSeriesItem, SeriesChartProps } from "./lib/chart-series.js";
|
|
1
|
+
import { ChartColor, ChartCurve, ChartReferenceLine, ChartSeries, ChartSeriesItem, 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
|
-
import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
4
|
+
import { LineChartCard, LineChartCardProps } from "./components/registry/charts/line-chart-card.js";
|
|
5
5
|
import { SectionCard, SectionCards, SectionCardsProps } from "./components/registry/dashboard-01/section-cards.js";
|
|
6
6
|
import { BarList, BarListItem, BarListProps } from "./components/registry/dashboardcn/bar-list.js";
|
|
7
|
+
import { DistributionBar, DistributionBarProps, DistributionMarker, DistributionSegment } from "./components/registry/dashboardcn/distribution-bar.js";
|
|
7
8
|
import { Activity, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBlockProps, CalendarHeatmapBody, CalendarHeatmapBodyProps, CalendarHeatmapFooter, CalendarHeatmapFooterProps, CalendarHeatmapLegend, CalendarHeatmapLegendProps, CalendarHeatmapProps, CalendarHeatmapStat, CalendarHeatmapStatProps, ColorConfig, Labels } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
8
9
|
import { StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue } from "./components/registry/heatmap/status-heatmap.js";
|
|
9
10
|
import { ColorConfig as ColorConfig$1, WeekdayExtraColumnSpec, WeekdayExtraRowSpec, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBlockProps, WeekdayHeatmapBody, WeekdayHeatmapBodyProps, WeekdayHeatmapFooter, WeekdayHeatmapFooterProps, WeekdayHeatmapLabels, WeekdayHeatmapLegend, WeekdayHeatmapLegendProps, WeekdayHeatmapProps, WeekdayHeatmapStat, WeekdayHeatmapStatProps, WeekdayHour, WeekdayHourlyActivity, WeekdayIndex } from "./components/registry/heatmap/weekday-heatmap.js";
|
|
11
|
+
import { Button, buttonVariants } from "./components/ui/button.js";
|
|
12
|
+
import { CopyButton } from "./components/registry/minidev/copy-button.js";
|
|
10
13
|
import { TableColumnActions, TableColumnActionsProps } from "./components/registry/niko-table/filters/table-column-actions.js";
|
|
11
14
|
import { DataTableColumnActions } from "./components/registry/niko-table/components/data-table-column-actions.js";
|
|
12
15
|
import { DataTableColumnFilter } from "./components/registry/niko-table/components/data-table-column-filter.js";
|
|
@@ -38,7 +41,6 @@ import { NavMain } from "./components/registry/sidebar-07/nav-main.js";
|
|
|
38
41
|
import { NavProjects } from "./components/registry/sidebar-07/nav-projects.js";
|
|
39
42
|
import { NavUser } from "./components/registry/sidebar-07/nav-user.js";
|
|
40
43
|
import { TeamSwitcher } from "./components/registry/sidebar-07/team-switcher.js";
|
|
41
|
-
import { Button, buttonVariants } from "./components/ui/button.js";
|
|
42
44
|
import { Input } from "./components/ui/input.js";
|
|
43
45
|
import { Separator } from "./components/ui/separator.js";
|
|
44
46
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
@@ -83,5 +85,4 @@ import { Textarea } from "./components/ui/textarea.js";
|
|
|
83
85
|
import { Toggle, toggleVariants } from "./components/ui/toggle.js";
|
|
84
86
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
85
87
|
import { Formatters, TimeOptions, count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
86
|
-
|
|
87
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActiveCell, ActiveSelection, Activity, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, AppSidebarProps, Area, AreaChart, AreaChartCard, AreaChartCardProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, 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, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, ChartColor, ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, 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, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, 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, 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, Line, LineChart, LineChartCard, LocalTime, LocalTimeProps, NavMain, NavProjects, NavUser, type Option, PageSection, PageSectionProps, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, ReferenceLine, 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, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, 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, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
88
|
+
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, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, 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, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DataList, DataListItem, DataListItemProps, DataTable, DataTableActions, DataTableBody, DataTableBodyProps, type DataTableCell, type DataTableColumn, DataTableColumnActions, type DataTableColumnDef, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, type DataTableColumns, DataTableConfig, DataTableContainerProps, DataTableContext, DataTableContextState, DataTableEmptyActions, DataTableEmptyActionsProps, DataTableEmptyBody, DataTableEmptyBodyProps, DataTableEmptyDescription, DataTableEmptyDescriptionProps, DataTableEmptyFilteredMessage, DataTableEmptyFilteredMessageProps, DataTableEmptyIcon, DataTableEmptyIconProps, DataTableEmptyMessage, DataTableEmptyMessageProps, DataTableEmptyState, DataTableEmptyStateProps, DataTableEmptyTitle, DataTableEmptyTitleProps, DataTableErrorBoundary, DataTableErrorBoundaryProps, DataTableFacetedFilter, DataTableFacetedFilterContent, 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, NavMain, NavProjects, NavUser, NumericXProps, type Option, PageSection, PageSectionProps, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, PriceChartProps, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, type QueryKeys, 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, StatusActivity, StatusColorConfig, StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBlockProps, StatusHeatmapBody, StatusHeatmapBodyProps, StatusHeatmapFooter, StatusHeatmapFooterProps, StatusHeatmapLabels, StatusHeatmapLegend, StatusHeatmapLegendProps, StatusHeatmapProps, StatusHeatmapStat, StatusHeatmapStatProps, StatusValue, Table, TableBody, TableCaption, TableCell, TableColumnActions, TableColumnActionsProps, TableColumnSortMenu, TableColumnSortOptions, TableColumnTitle, TableFacetedFilter, TableFacetedFilterContent, TableFacetedFilterProps, TableFooter, TableHead, TableHeader, TableRow, TableSearchFilter, TableSearchFilterProps, Tabs, TabsContent, TabsList, TabsTrigger, 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, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
package/dist/index.js
CHANGED
|
@@ -38,9 +38,11 @@ import { LineChartCard } from "./components/registry/charts/line-chart-card.js";
|
|
|
38
38
|
import { SectionCards } from "./components/registry/dashboard-01/section-cards.js";
|
|
39
39
|
import { count, money, moneyCompact, pct, time, useFormat } from "./lib/format.js";
|
|
40
40
|
import { BarList } from "./components/registry/dashboardcn/bar-list.js";
|
|
41
|
+
import { DistributionBar } from "./components/registry/dashboardcn/distribution-bar.js";
|
|
41
42
|
import { CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat } from "./components/registry/heatmap/calendar-heatmap.js";
|
|
42
43
|
import { StatusHeatmap, StatusHeatmapBlock, StatusHeatmapBody, StatusHeatmapFooter, StatusHeatmapLegend, StatusHeatmapStat } from "./components/registry/heatmap/status-heatmap.js";
|
|
43
44
|
import { WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat } from "./components/registry/heatmap/weekday-heatmap.js";
|
|
45
|
+
import { CopyButton } from "./components/registry/minidev/copy-button.js";
|
|
44
46
|
import { TableColumnActions } from "./components/registry/niko-table/filters/table-column-actions.js";
|
|
45
47
|
import { DataTableColumnHeader, DataTableColumnHeaderRoot, useColumnHeaderContext } from "./components/registry/niko-table/components/data-table-column-header.js";
|
|
46
48
|
import { DataTableColumnActions } from "./components/registry/niko-table/components/data-table-column-actions.js";
|
|
@@ -80,5 +82,4 @@ import { PageSection, PageSubheading } from "./components/siyahi/page-section.js
|
|
|
80
82
|
import { PriceChart } from "./components/siyahi/price-chart.js";
|
|
81
83
|
import { ToneProgress } from "./components/siyahi/tone-progress.js";
|
|
82
84
|
import { Treemap, TreemapLegend } from "./components/siyahi/treemap.js";
|
|
83
|
-
|
|
84
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertTitle, AppSidebar, Area, AreaChart, AreaChartCard, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Bar, BarChart, BarChartCard, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, CalendarHeatmap, CalendarHeatmapBlock, CalendarHeatmapBody, CalendarHeatmapFooter, CalendarHeatmapLegend, CalendarHeatmapStat, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CartesianGrid, 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, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, 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, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, GroupedBodyRow, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Line, LineChart, LineChartCard, LocalTime, NavMain, NavProjects, NavUser, PageSection, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, ReferenceLine, 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, 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, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, XAxis, YAxis, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
85
|
+
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, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, 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, DataList, DataListItem, DataTable, DataTableActions, DataTableBody, DataTableColumnActions, DataTableColumnFilter, DataTableColumnHeader, DataTableColumnHeaderRoot, DataTableColumnSortMenu, DataTableColumnSortOptions, DataTableColumnTitle, DataTableContext, DataTableEmptyActions, DataTableEmptyBody, DataTableEmptyDescription, DataTableEmptyFilteredMessage, DataTableEmptyIcon, DataTableEmptyMessage, DataTableEmptyState, DataTableEmptyTitle, DataTableErrorBoundary, DataTableFacetedFilter, DataTableFacetedFilterContent, 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, NavMain, NavProjects, NavUser, PageSection, PageSubheading, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PriceChart, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, 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, 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, TeamSwitcher, Textarea, Toggle, ToggleGroup, ToggleGroupItem, ToneProgress, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Treemap, TreemapLegend, WeekdayHeatmap, WeekdayHeatmapBlock, WeekdayHeatmapBody, WeekdayHeatmapFooter, WeekdayHeatmapLegend, WeekdayHeatmapStat, badgeVariants, buttonVariants, count, defaultLocale, flashCellKey, money, moneyCompact, pct, resolveGroupedRowsSlot, resolveRowContextMenuRenderer, tabsListVariants, time, toggleVariants, useColumnHeaderContext, useColumnResizeInfo, useDataTable, useDataTableActiveCell, useDataTableActiveCellSetter, useDataTableGroupRow, useDataTableRow, useFormat, useLocale, useResolvedRowContextMenuRenderer, useSidebar, useTableFacetedFilter };
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import { ChartSeries, SeriesChartProps } from "./chart-series.js";
|
|
1
|
+
import { ChartColor, ChartSeries, ChartSeriesItem, NumericXProps, SeriesChartProps } from "./chart-series.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { AreaChart, BarChart, LineChart } from "recharts";
|
|
4
4
|
//#region src/lib/chart-frame.d.ts
|
|
5
|
-
interface ChartFrameProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K
|
|
5
|
+
interface ChartFrameProps<T extends object, K extends keyof T> extends SeriesChartProps<T, K>, NumericXProps {
|
|
6
6
|
chart: typeof AreaChart | typeof BarChart | typeof LineChart;
|
|
7
7
|
/** One Bar, Area or Line per series. */
|
|
8
8
|
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Bars run sideways: the categories go down the left, where long names fit, and the value axis is hidden, as
|
|
11
|
+
* in shadcn's chart-bar-horizontal. x and y keep their meaning: x is the category, y the value.
|
|
12
|
+
*/
|
|
13
|
+
horizontal?: boolean;
|
|
14
|
+
/** "sign" stacks negative values below zero and positive ones above, rather than on one running total. */
|
|
15
|
+
stackOffset?: "sign";
|
|
9
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The colour a series' Bar takes, which its legend chip shows: the negative colour when every value drawn is below
|
|
19
|
+
* zero, since each bar's own Cell follows its sign but the chip follows the Bar.
|
|
20
|
+
*/
|
|
21
|
+
export declare function seriesFill<T>(item: ChartSeriesItem<T>, data: readonly T[]): ChartColor;
|
|
10
22
|
/** A tooltip row: the series' colour and label, then its value as the page formats it, or — when the row has none. */
|
|
11
23
|
export declare function seriesRow<T>(series: ChartSeries<T>, formatValue: (value: number) => string): (value: unknown, _name: unknown, item: {
|
|
12
24
|
dataKey?: unknown;
|
|
@@ -17,6 +29,6 @@ export declare function seriesRow<T>(series: ChartSeries<T>, formatValue: (value
|
|
|
17
29
|
* that gave its category axis its own id (dash#88) got a plot split in two
|
|
18
30
|
* and every tooltip headed with the series name instead of the category.
|
|
19
31
|
*/
|
|
20
|
-
export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, title, description, action, data, xKey, series, xFormatter, valueFormatter, yTickFormatter, height }: ChartFrameProps<T, K>): import("react").JSX.Element;
|
|
32
|
+
export declare function ChartFrame<T extends object, K extends keyof T>({ chart: Chart, children, horizontal, stackOffset, 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;
|
|
21
33
|
//#endregion
|
|
22
34
|
export {};
|
package/dist/lib/chart-frame.js
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../components/ui/card.js";
|
|
1
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../components/ui/card.js";
|
|
2
2
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "../components/ui/chart.js";
|
|
3
|
+
import { cn } from "./utils.js";
|
|
3
4
|
import { useLocale } from "../components/siyahi/siyahi-provider.js";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { CartesianGrid, ReferenceLine, XAxis, YAxis } from "recharts";
|
|
6
7
|
//#region src/lib/chart-frame.tsx
|
|
8
|
+
const AXIS_TITLE = "fill-muted-foreground text-xs";
|
|
9
|
+
const TICK = { className: "fill-muted-foreground font-mono" };
|
|
10
|
+
const NO_LINES = [];
|
|
11
|
+
/**
|
|
12
|
+
* The colour a series' Bar takes, which its legend chip shows: the negative colour when every value drawn is below
|
|
13
|
+
* zero, since each bar's own Cell follows its sign but the chip follows the Bar.
|
|
14
|
+
*/
|
|
15
|
+
function seriesFill(item, data) {
|
|
16
|
+
const values = data.map((row) => row[item.key]).filter((value) => Number.isFinite(value)).map(Number);
|
|
17
|
+
return item.negativeColor && values.length > 0 && values.every((value) => value < 0) ? item.negativeColor : item.color;
|
|
18
|
+
}
|
|
7
19
|
/** A tooltip row: the series' colour and label, then its value as the page formats it, or — when the row has none. */
|
|
8
20
|
function seriesRow(series, formatValue) {
|
|
9
21
|
return (value, _name, item) => {
|
|
10
22
|
const entry = series.find(({ key }) => key === item.dataKey);
|
|
23
|
+
const color = entry?.negativeColor && Number(value) < 0 ? entry.negativeColor : entry?.color;
|
|
11
24
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
25
|
/* @__PURE__ */ jsx("span", {
|
|
13
26
|
className: "size-2.5 shrink-0 rounded-xs",
|
|
14
|
-
style: { backgroundColor:
|
|
27
|
+
style: { backgroundColor: color }
|
|
15
28
|
}),
|
|
16
29
|
/* @__PURE__ */ jsx("span", {
|
|
17
30
|
className: "text-muted-foreground",
|
|
@@ -24,13 +37,63 @@ function seriesRow(series, formatValue) {
|
|
|
24
37
|
] });
|
|
25
38
|
};
|
|
26
39
|
}
|
|
40
|
+
const GEIST_WIDTH = 6.6;
|
|
41
|
+
const MONO_WIDTH = 7.2;
|
|
42
|
+
/**
|
|
43
|
+
* Room to keep right of the plot when every named tick is drawn: half the last label, which centres on the
|
|
44
|
+
* domain's right end, and at least 24px.
|
|
45
|
+
*/
|
|
46
|
+
function endRoom(xFormatter, xTicks) {
|
|
47
|
+
const last = xTicks.at(-1);
|
|
48
|
+
return Math.max(24, Math.ceil((last === void 0 ? 0 : xFormatter(last).length * MONO_WIDTH) / 2) + 4);
|
|
49
|
+
}
|
|
50
|
+
/** Squeezes a line into its column with SVG's own textLength when it would run into the next one. */
|
|
51
|
+
const fitTo = (text, room, charWidth) => room > 0 && text.length * charWidth > room ? {
|
|
52
|
+
textLength: room,
|
|
53
|
+
lengthAdjust: "spacingAndGlyphs"
|
|
54
|
+
} : {};
|
|
55
|
+
/**
|
|
56
|
+
* An x tick fitted to its column, drawn whenever a page names its ticks or gives each a second line: Recharts'
|
|
57
|
+
* own ticks would rather drop a label than let it run into the next. With a detail, the second line comes from the
|
|
58
|
+
* tick's row; under a column the lines hang below the axis, and beside a horizontal bar they straddle its middle.
|
|
59
|
+
* A two-line tick is set in Geist, not Mono: a name with a figure under it reads as a label, as in BarList, and
|
|
60
|
+
* sector names in Mono would take most of a phone's width.
|
|
61
|
+
*/
|
|
62
|
+
function fittedTick(data, xKey, xFormatter, detailOf, beside) {
|
|
63
|
+
const charWidth = detailOf ? GEIST_WIDTH : MONO_WIDTH;
|
|
64
|
+
return ({ x, y, width, visibleTicksCount, payload }) => {
|
|
65
|
+
const value = payload?.value;
|
|
66
|
+
const row = data.find((r) => r[xKey] === value);
|
|
67
|
+
const name = xFormatter(value);
|
|
68
|
+
const detail = row && detailOf ? detailOf(row) : null;
|
|
69
|
+
const room = beside || !visibleTicksCount ? 0 : Number(width) / visibleTicksCount - 6;
|
|
70
|
+
return /* @__PURE__ */ jsxs("text", {
|
|
71
|
+
x,
|
|
72
|
+
y,
|
|
73
|
+
textAnchor: beside ? "end" : "middle",
|
|
74
|
+
className: cn("recharts-cartesian-axis-tick-value fill-muted-foreground", !detailOf && "font-mono"),
|
|
75
|
+
children: [/* @__PURE__ */ jsx("tspan", {
|
|
76
|
+
x,
|
|
77
|
+
dy: beside ? -4 : 12,
|
|
78
|
+
...fitTo(name, room, charWidth),
|
|
79
|
+
children: name
|
|
80
|
+
}), detail !== null && /* @__PURE__ */ jsx("tspan", {
|
|
81
|
+
x,
|
|
82
|
+
dy: 15,
|
|
83
|
+
className: "tabular-nums",
|
|
84
|
+
...fitTo(detail, room, charWidth),
|
|
85
|
+
children: detail
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
}
|
|
27
90
|
/**
|
|
28
91
|
* The card, axes, grid, tooltip and legend the three chart cards share. Both
|
|
29
92
|
* axes keep Recharts' default ids: marks find their axes by id, and a page
|
|
30
93
|
* that gave its category axis its own id (dash#88) got a plot split in two
|
|
31
94
|
* and every tooltip headed with the series name instead of the category.
|
|
32
95
|
*/
|
|
33
|
-
function ChartFrame({ chart: Chart, children, title, description, action, data, xKey, series, xFormatter = String, valueFormatter, yTickFormatter, height }) {
|
|
96
|
+
function ChartFrame({ chart: Chart, children, horizontal = false, stackOffset, 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 }) {
|
|
34
97
|
const { numberLocale } = useLocale();
|
|
35
98
|
const formatValue = valueFormatter ?? new Intl.NumberFormat(numberLocale).format;
|
|
36
99
|
const config = Object.fromEntries(series.map(({ key, label, color }) => [key, {
|
|
@@ -38,59 +101,123 @@ function ChartFrame({ chart: Chart, children, title, description, action, data,
|
|
|
38
101
|
color
|
|
39
102
|
}]));
|
|
40
103
|
const crossesZero = data.some((row) => series.some(({ key }) => Number(row[key]) < 0));
|
|
41
|
-
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
106
|
+
/* @__PURE__ */ jsx(CardTitle, { children: title }),
|
|
107
|
+
description && /* @__PURE__ */ jsx(CardDescription, { children: description }),
|
|
108
|
+
action && /* @__PURE__ */ jsx(CardAction, { children: action })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsx(CardContent, { children: placeholder ? /* @__PURE__ */ jsx("div", {
|
|
111
|
+
"data-slot": "chart-placeholder",
|
|
112
|
+
className: "flex items-center justify-center",
|
|
113
|
+
style: { height },
|
|
114
|
+
children: placeholder
|
|
115
|
+
}) : /* @__PURE__ */ jsx(ChartContainer, {
|
|
116
|
+
config,
|
|
117
|
+
className: "aspect-auto w-full",
|
|
118
|
+
style: { height },
|
|
119
|
+
children: /* @__PURE__ */ jsxs(Chart, {
|
|
120
|
+
data,
|
|
121
|
+
layout: horizontal ? "vertical" : "horizontal",
|
|
122
|
+
stackOffset,
|
|
123
|
+
margin: {
|
|
124
|
+
left: 0,
|
|
125
|
+
right: xTicks ? endRoom(xFormatter, xTicks) : 8
|
|
126
|
+
},
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx(CartesianGrid, {
|
|
129
|
+
vertical: horizontal,
|
|
130
|
+
horizontal: !horizontal,
|
|
131
|
+
strokeDasharray: "3 3"
|
|
132
|
+
}),
|
|
133
|
+
horizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
134
|
+
type: "number",
|
|
135
|
+
hide: true,
|
|
136
|
+
domain: yDomain,
|
|
137
|
+
ticks: yTicks
|
|
138
|
+
}), /* @__PURE__ */ jsx(YAxis, {
|
|
139
|
+
dataKey: xKey,
|
|
140
|
+
type: "category",
|
|
141
|
+
width: "auto",
|
|
142
|
+
tickLine: false,
|
|
143
|
+
axisLine: false,
|
|
144
|
+
tickMargin: 8,
|
|
145
|
+
tickFormatter: (value) => xFormatter(value),
|
|
146
|
+
tick: xTickDetail ? fittedTick(data, xKey, xFormatter, xTickDetail, horizontal) : TICK,
|
|
147
|
+
interval: 0
|
|
148
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
149
|
+
dataKey: xKey,
|
|
150
|
+
type: xDomain ? "number" : "category",
|
|
151
|
+
domain: xDomain,
|
|
152
|
+
ticks: xTicks,
|
|
153
|
+
height: (xTickDetail ? 40 : 30) + (xLabel ? 18 : 0),
|
|
154
|
+
label: xLabel ? {
|
|
155
|
+
value: xLabel,
|
|
156
|
+
position: "insideBottom",
|
|
157
|
+
className: AXIS_TITLE
|
|
158
|
+
} : void 0,
|
|
159
|
+
tickLine: false,
|
|
160
|
+
axisLine: false,
|
|
161
|
+
tickMargin: 8,
|
|
162
|
+
tickFormatter: (value) => xFormatter(value),
|
|
163
|
+
tick: xTickDetail || xTicks ? fittedTick(data, xKey, xFormatter, xTickDetail, false) : TICK,
|
|
164
|
+
interval: xTickDetail || xTicks ? 0 : void 0
|
|
165
|
+
}), /* @__PURE__ */ jsx(YAxis, {
|
|
166
|
+
tickLine: false,
|
|
167
|
+
axisLine: false,
|
|
168
|
+
width: "auto",
|
|
169
|
+
domain: yDomain,
|
|
170
|
+
ticks: yTicks,
|
|
171
|
+
label: yLabel ? {
|
|
172
|
+
value: yLabel,
|
|
173
|
+
angle: -90,
|
|
174
|
+
position: "insideLeft",
|
|
175
|
+
style: { textAnchor: "middle" },
|
|
176
|
+
className: AXIS_TITLE
|
|
177
|
+
} : void 0,
|
|
178
|
+
tickFormatter: (value) => (yTickFormatter ?? formatValue)(value),
|
|
179
|
+
tick: TICK
|
|
180
|
+
})] }),
|
|
181
|
+
crossesZero && (horizontal ? /* @__PURE__ */ jsx(ReferenceLine, {
|
|
182
|
+
x: 0,
|
|
183
|
+
stroke: "var(--border)"
|
|
184
|
+
}) : /* @__PURE__ */ jsx(ReferenceLine, {
|
|
185
|
+
y: 0,
|
|
186
|
+
stroke: "var(--border)"
|
|
187
|
+
})),
|
|
188
|
+
referenceLines.map(({ label, emphasis = "muted", labelPosition = "insideTopLeft", ...at }) => /* @__PURE__ */ jsx(ReferenceLine, {
|
|
189
|
+
...horizontal ? {
|
|
190
|
+
x: at.y,
|
|
191
|
+
y: at.x
|
|
192
|
+
} : at,
|
|
193
|
+
stroke: emphasis === "strong" ? "var(--foreground)" : "var(--muted-foreground)",
|
|
194
|
+
strokeDasharray: at.y === void 0 ? void 0 : "4 4",
|
|
195
|
+
label: label === void 0 ? void 0 : {
|
|
196
|
+
value: label,
|
|
197
|
+
position: labelPosition,
|
|
198
|
+
className: "fill-muted-foreground text-xs"
|
|
199
|
+
}
|
|
200
|
+
}, `${at.x ?? ""}:${at.y ?? ""}:${label ?? ""}`)),
|
|
201
|
+
/* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
202
|
+
labelFormatter: (_, payload) => {
|
|
203
|
+
const row = payload[0]?.payload;
|
|
204
|
+
return row ? xTooltipFormatter(row[xKey]) : null;
|
|
205
|
+
},
|
|
206
|
+
formatter: seriesRow(series, formatValue)
|
|
207
|
+
}) }),
|
|
208
|
+
children,
|
|
209
|
+
/* @__PURE__ */ jsx(ChartLegend, {
|
|
210
|
+
content: /* @__PURE__ */ jsx(ChartLegendContent, {}),
|
|
211
|
+
itemSorter: null
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
})
|
|
215
|
+
}) }),
|
|
216
|
+
footer && /* @__PURE__ */ jsx(CardFooter, {
|
|
217
|
+
className: "flex-col items-start gap-2 text-sm",
|
|
218
|
+
children: footer
|
|
92
219
|
})
|
|
93
|
-
|
|
220
|
+
] });
|
|
94
221
|
}
|
|
95
222
|
//#endregion
|
|
96
|
-
export { ChartFrame, seriesRow };
|
|
223
|
+
export { ChartFrame, seriesFill, seriesRow };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
//#region src/lib/chart-series.d.ts
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The colours a series may take: the five chart slots, muted for an "Other" past five, and the two meaning
|
|
5
|
+
* colours for a gain and a loss.
|
|
6
|
+
*/
|
|
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)";
|
|
5
8
|
/** The fields of a row that hold numbers: the ones a series can plot. */
|
|
6
9
|
type NumericKey<T> = { [K in keyof T]-?: T[K] extends number | null | undefined ? K : never; }[keyof T] & string;
|
|
7
10
|
/** One series: the field it plots, its name in the legend and tooltip, and its colour. */
|
|
@@ -9,6 +12,8 @@ export interface ChartSeriesItem<T> {
|
|
|
9
12
|
key: NumericKey<T>;
|
|
10
13
|
label: string;
|
|
11
14
|
color: ChartColor;
|
|
15
|
+
/** A bar below zero takes this colour instead, such as var(--negative) for a loss beside var(--positive). */
|
|
16
|
+
negativeColor?: ChartColor;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* The series in draw, stack and legend order; give the slots in order from
|
|
@@ -16,6 +21,23 @@ export interface ChartSeriesItem<T> {
|
|
|
16
21
|
* number-like keys such as "2024" first whatever order the page wrote them in.
|
|
17
22
|
*/
|
|
18
23
|
export type ChartSeries<T> = readonly ChartSeriesItem<T>[];
|
|
24
|
+
/**
|
|
25
|
+
* A labelled line across the plot: a level on the value axis (y), such as a limit, or a point on the x axis, such
|
|
26
|
+
* as an event. A level is dashed, an event solid.
|
|
27
|
+
*/
|
|
28
|
+
export type ChartReferenceLine = ({
|
|
29
|
+
y: number;
|
|
30
|
+
x?: never;
|
|
31
|
+
} | {
|
|
32
|
+
x: number | string;
|
|
33
|
+
y?: never;
|
|
34
|
+
}) & {
|
|
35
|
+
label?: string;
|
|
36
|
+
/** "strong" draws it in the text colour, for the line that matters most; "muted" by default. */
|
|
37
|
+
emphasis?: "muted" | "strong";
|
|
38
|
+
/** Where the label sits against the line. Defaults to insideTopLeft. */
|
|
39
|
+
labelPosition?: "insideTopLeft" | "insideTopRight" | "insideBottomLeft" | "insideBottomRight";
|
|
40
|
+
};
|
|
19
41
|
/** What BarChartCard, AreaChartCard and LineChartCard all take. */
|
|
20
42
|
export interface SeriesChartProps<T extends object, K extends keyof T> {
|
|
21
43
|
title: ReactNode;
|
|
@@ -27,14 +49,44 @@ export interface SeriesChartProps<T extends object, K extends keyof T> {
|
|
|
27
49
|
/** The field the x axis reads: a month, an hour of day, a price bucket. One row per value; a repeated value is hidden behind the first. */
|
|
28
50
|
xKey: K;
|
|
29
51
|
series: ChartSeries<NoInfer<T>>;
|
|
30
|
-
/** The x axis ticks and the tooltip's heading. Defaults to the value as text. */
|
|
52
|
+
/** The x axis ticks, and the tooltip's heading unless xTooltipFormatter is set. Defaults to the value as text. */
|
|
31
53
|
xFormatter?: (value: T[K]) => string;
|
|
54
|
+
/** The tooltip's heading, when it should say more than a tick: "19:34:13 IST, 10 s average" against "19:34". */
|
|
55
|
+
xTooltipFormatter?: (value: T[K]) => string;
|
|
32
56
|
/** A series' value in the tooltip, and the y axis unless yTickFormatter is set. Defaults to the locale's numbers. */
|
|
33
57
|
valueFormatter?: (value: number) => string;
|
|
34
58
|
/** The y axis, when its ticks should be shorter than the tooltip's figures: moneyCompact against money. */
|
|
35
59
|
yTickFormatter?: (value: number) => string;
|
|
60
|
+
/** A fixed range for the value axis, such as [0, 100] for a percentage; by default it fits the data. */
|
|
61
|
+
yDomain?: [number, number];
|
|
62
|
+
/** Where the value axis puts its ticks, such as [0, 25, 50, 75, 100]. */
|
|
63
|
+
yTicks?: readonly number[];
|
|
36
64
|
/** Height of the plot and legend, in pixels. */
|
|
37
65
|
height: number;
|
|
66
|
+
/** A second line under each x tick, so a row's figure reads without a hover: "FY24" then "▲₹1.2L". */
|
|
67
|
+
xTickDetail?: (row: T) => string;
|
|
68
|
+
/** A title under the x axis, such as "Hour of day (IST)". Not drawn on sideways bars. */
|
|
69
|
+
xLabel?: string;
|
|
70
|
+
/** A title beside the value axis, read bottom to top, such as "Orders". Not drawn on sideways bars. */
|
|
71
|
+
yLabel?: string;
|
|
72
|
+
/** Limits and events to mark on the plot. A zero line draws by itself when a value goes below zero. */
|
|
73
|
+
referenceLines?: readonly ChartReferenceLine[];
|
|
74
|
+
/** Shown in the plot's place, at its height, while the data loads or after it failed to. */
|
|
75
|
+
placeholder?: ReactNode;
|
|
76
|
+
/** Lines under the chart, such as a caption or a takeaway, in the card's footer. */
|
|
77
|
+
footer?: ReactNode;
|
|
38
78
|
}
|
|
79
|
+
/** A numeric x axis, for samples in time or any measure where a mark can sit between two rows. */
|
|
80
|
+
export interface NumericXProps {
|
|
81
|
+
/** The x axis runs over this range of the xKey field, which must hold numbers; without it the axis is one slot per row. */
|
|
82
|
+
xDomain?: [number, number];
|
|
83
|
+
/** Where the x axis puts its ticks, in the xKey field's units; give xDomain with it, so the axis is numeric. */
|
|
84
|
+
xTicks?: readonly number[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* How a line or an area's edge joins its points: "linear" draws straight segments, as measured samples should
|
|
88
|
+
* be drawn; "monotone", the default, smooths between them without overshooting a point.
|
|
89
|
+
*/
|
|
90
|
+
export type ChartCurve = "monotone" | "linear";
|
|
39
91
|
//#endregion
|
|
40
92
|
export {};
|
package/package.json
CHANGED
package/registry.lock.json
CHANGED
|
@@ -41,6 +41,14 @@
|
|
|
41
41
|
"copied": "2026-10-20",
|
|
42
42
|
"sha256": "bc19cf1f5e486fa11273e7d7ed620eb7b82ba360f72e5a15e6bf488f992d16ce"
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"file": "src/components/registry/dashboardcn/distribution-bar.tsx",
|
|
46
|
+
"registry": "@dashboardcn/distribution-bar",
|
|
47
|
+
"origin": "https://dashboardcn.com/r/distribution-bar.json",
|
|
48
|
+
"licence": "MIT, Copyright (c) 2026 dashboardcn contributors, https://github.com/NoahGdev/dashboardcn/blob/main/LICENSE",
|
|
49
|
+
"copied": "2026-10-22",
|
|
50
|
+
"sha256": "9028368f1363732cef765dabad2eca3ba98b608f1e237123b09df701c41c8b5a"
|
|
51
|
+
},
|
|
44
52
|
{
|
|
45
53
|
"file": "src/components/registry/heatmap/calendar-heatmap.tsx",
|
|
46
54
|
"registry": "@heatmap/calendar-heatmap",
|
|
@@ -65,6 +73,14 @@
|
|
|
65
73
|
"copied": "2026-10-20",
|
|
66
74
|
"sha256": "b7af6139e3764e1479880fb232988e758edb27ce4e4280d9e0349cbdf9b3d30c"
|
|
67
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"file": "src/components/registry/minidev/copy-button.tsx",
|
|
78
|
+
"registry": "@minidev/copy-button",
|
|
79
|
+
"origin": "https://ui.minidev.pro/r/copy-button.json",
|
|
80
|
+
"licence": "MIT, Copyright (c) 2026 MiniDev, https://github.com/amankaushik481/minidev-ui/blob/main/LICENSE",
|
|
81
|
+
"copied": "2026-10-22",
|
|
82
|
+
"sha256": "67f491ea6c947ebf3bf058423a373347badd49ad07861e022599ebdbb11cab44"
|
|
83
|
+
},
|
|
68
84
|
{
|
|
69
85
|
"file": "src/components/registry/niko-table/components/data-table-column-actions.tsx",
|
|
70
86
|
"registry": "@niko-table/data-table",
|
package/dist/lib/recharts.d.ts
DELETED
package/dist/lib/recharts.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Area, AreaChart, Bar, BarChart, CartesianGrid, Line, LineChart, ReferenceLine, XAxis, YAxis } from "recharts";
|