@nocoo/basalt 2.1.2 → 2.1.8
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/ai/INTEGRATION.md +19 -1
- package/ai/USAGE.md +1 -1
- package/ai/registry.json +81 -81
- package/dist/charts/charts.d.ts +1 -1
- package/dist/charts/charts.js +3 -16
- package/dist/charts/charts.js.map +1 -1
- package/dist/charts/custom-chart.d.ts +1 -1
- package/dist/charts/custom-chart.js +3 -16
- package/dist/charts/custom-chart.js.map +1 -1
- package/dist/charts/grouped-bar.d.ts +1 -1
- package/dist/charts/grouped-bar.js +11 -48
- package/dist/charts/grouped-bar.js.map +1 -1
- package/dist/charts/heatmap-calendar.js +80 -136
- package/dist/charts/heatmap-calendar.js.map +1 -1
- package/dist/charts/slot-bar.js +2 -12
- package/dist/charts/slot-bar.js.map +1 -1
- package/dist/charts/stat-card.js +2 -7
- package/dist/charts/stat-card.js.map +1 -1
- package/dist/charts/timeseries.d.ts +1 -1
- package/dist/charts/timeseries.js +3 -16
- package/dist/charts/timeseries.js.map +1 -1
- package/dist/charts/tooltip.js +13 -51
- package/dist/charts/tooltip.js.map +1 -1
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +3 -16
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/banner.js +28 -28
- package/dist/components/banner.js.map +1 -1
- package/dist/components/button.js +8 -9
- package/dist/components/button.js.map +1 -1
- package/dist/components/chat-composer.js +1 -2
- package/dist/components/chat-composer.js.map +1 -1
- package/dist/components/checkbox.js +50 -82
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/code.js +1 -1
- package/dist/components/code.js.map +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +3 -16
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/context-menu.d.ts +1 -67
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table.js +112 -124
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +236 -245
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/delete-resource.js +1 -1
- package/dist/components/delete-resource.js.map +1 -1
- package/dist/components/dock.js +15 -16
- package/dist/components/dock.js.map +1 -1
- package/dist/components/field.js +20 -23
- package/dist/components/field.js.map +1 -1
- package/dist/components/layer-card.d.ts +1 -1
- package/dist/components/layer-card.js +44 -51
- package/dist/components/layer-card.js.map +1 -1
- package/dist/components/skeleton-line.d.ts +2 -2
- package/dist/components/skeleton-line.js +1 -1
- package/dist/components/skeleton-line.js.map +1 -1
- package/dist/components/switch.js +46 -78
- package/dist/components/switch.js.map +1 -1
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tooltip.js +14 -13
- package/dist/components/tooltip.js.map +1 -1
- package/dist/providers/accent.js +89 -198
- package/dist/providers/accent.js.map +1 -1
- package/dist/providers/theme.js +46 -144
- package/dist/providers/theme.js.map +1 -1
- package/dist/styles/standalone.css +37 -13
- package/dist/utils/preference-store.d.ts +16 -0
- package/dist/utils/preference-store.js +106 -0
- package/dist/utils/preference-store.js.map +1 -0
- package/dist/utils/selection-indicator.js +1 -1
- package/dist/utils/selection-indicator.js.map +1 -1
- package/dist/utils/use-checkable-group.d.ts +19 -0
- package/dist/utils/use-checkable-group.js +61 -0
- package/dist/utils/use-checkable-group.js.map +1 -0
- package/package.json +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.js","names":[],"sources":["../../src/charts/charts.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type ChartsProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function Charts<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({
|
|
1
|
+
{"version":3,"file":"charts.js","names":[],"sources":["../../src/charts/charts.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type ChartsProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function Charts<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ ariaLabel = \"Charts\", ...props }: ChartsProps<TData, K>) {\n\treturn <LineChart<TData, K> ariaLabel={ariaLabel} {...props} />;\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EAAE,eAAY,UAAU,GAAG,KAAgC;CAC5D,OAAO,kBAAC,GAAD;EAAgC;EAAW,GAAI;CAAQ,CAAA;AAC/D"}
|
|
@@ -58,4 +58,4 @@ export type CustomChartProps<TData extends {
|
|
|
58
58
|
};
|
|
59
59
|
export declare function CustomChart<TData extends {
|
|
60
60
|
x: string | number;
|
|
61
|
-
} = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({
|
|
61
|
+
} = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ ariaLabel, ...props }: CustomChartProps<TData, K>): import("react").JSX.Element;
|
|
@@ -2,23 +2,10 @@
|
|
|
2
2
|
import { LineChart as e } from "./line.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/charts/custom-chart.tsx
|
|
5
|
-
function n({
|
|
5
|
+
function n({ ariaLabel: n = "Custom chart", ...r }) {
|
|
6
6
|
return /* @__PURE__ */ t(e, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ariaLabel: i,
|
|
10
|
-
className: a,
|
|
11
|
-
showAxes: o,
|
|
12
|
-
showLegend: s,
|
|
13
|
-
color: c,
|
|
14
|
-
valueFormatter: l,
|
|
15
|
-
xValueFormatter: u,
|
|
16
|
-
yDomain: d,
|
|
17
|
-
legend: f,
|
|
18
|
-
customTooltip: p,
|
|
19
|
-
summary: m,
|
|
20
|
-
dataAlternative: h,
|
|
21
|
-
accessibilityLayer: g
|
|
7
|
+
ariaLabel: n,
|
|
8
|
+
...r
|
|
22
9
|
});
|
|
23
10
|
}
|
|
24
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-chart.js","names":[],"sources":["../../src/charts/custom-chart.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type CustomChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function CustomChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({
|
|
1
|
+
{"version":3,"file":"custom-chart.js","names":[],"sources":["../../src/charts/custom-chart.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type CustomChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function CustomChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ ariaLabel = \"Custom chart\", ...props }: CustomChartProps<TData, K>) {\n\treturn <LineChart<TData, K> ariaLabel={ariaLabel} {...props} />;\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EAAE,eAAY,gBAAgB,GAAG,KAAqC;CACvE,OAAO,kBAAC,GAAD;EAAgC;EAAW,GAAI;CAAQ,CAAA;AAC/D"}
|
|
@@ -57,4 +57,4 @@ export type GroupedBarChartProps<TData extends {
|
|
|
57
57
|
};
|
|
58
58
|
export declare function GroupedBarChart<TData extends {
|
|
59
59
|
x: string | number;
|
|
60
|
-
} = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({
|
|
60
|
+
} = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ series, ariaLabel, ...props }: GroupedBarChartProps<TData, K>): import("react").JSX.Element;
|
|
@@ -1,55 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ChartLegend as u } from "./legend.js";
|
|
6
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
-
import { Bar as p, BarChart as m, CartesianGrid as h, Tooltip as g, XAxis as _, YAxis as v } from "recharts";
|
|
2
|
+
import { resolveChartSeries as e } from "./series.js";
|
|
3
|
+
import { BarChart as t } from "./bar.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
8
5
|
//#region src/charts/grouped-bar.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className: S,
|
|
17
|
-
legend: P,
|
|
18
|
-
summary: A,
|
|
19
|
-
dataAlternative: j,
|
|
20
|
-
accessibilityLayer: M,
|
|
21
|
-
children: /* @__PURE__ */ f(m, {
|
|
22
|
-
data: y,
|
|
23
|
-
margin: C ? n : r,
|
|
24
|
-
children: [
|
|
25
|
-
C ? /* @__PURE__ */ d(h, { ...i }) : null,
|
|
26
|
-
/* @__PURE__ */ d(_, {
|
|
27
|
-
dataKey: "x",
|
|
28
|
-
...a(!C),
|
|
29
|
-
tickFormatter: E
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ d(v, {
|
|
32
|
-
...a(!C),
|
|
33
|
-
tickFormatter: T,
|
|
34
|
-
...D ? { domain: D } : {}
|
|
35
|
-
}),
|
|
36
|
-
/* @__PURE__ */ d(g, { ...o({
|
|
37
|
-
formatter: T,
|
|
38
|
-
cursor: "bar",
|
|
39
|
-
customTooltip: k
|
|
40
|
-
}) }),
|
|
41
|
-
N.map((n, r) => /* @__PURE__ */ d(p, {
|
|
42
|
-
dataKey: n.key,
|
|
43
|
-
name: n.label ?? n.key,
|
|
44
|
-
fill: s(n, r),
|
|
45
|
-
radius: t.vertical,
|
|
46
|
-
...e
|
|
47
|
-
}, n.key))
|
|
48
|
-
]
|
|
49
|
-
})
|
|
6
|
+
function r({ series: r, ariaLabel: i = "Grouped bar chart", ...a }) {
|
|
7
|
+
let o = e(r, ["y", "y2"]);
|
|
8
|
+
return /* @__PURE__ */ n(t, {
|
|
9
|
+
series: o,
|
|
10
|
+
ariaLabel: i,
|
|
11
|
+
...a,
|
|
12
|
+
color: void 0
|
|
50
13
|
});
|
|
51
14
|
}
|
|
52
15
|
//#endregion
|
|
53
|
-
export {
|
|
16
|
+
export { r as GroupedBarChart };
|
|
54
17
|
|
|
55
18
|
//# sourceMappingURL=grouped-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { BarChart } from \"./bar\";\nimport type {\n\tLineChartAxisDomain,\n\tLineChartLegendRenderer,\n\tLineChartNumericKeys,\n\tLineChartTooltipRenderer,\n} from \"./line\";\nimport { type ChartSeriesDescriptor, resolveChartSeries, type XYPoint } from \"./series\";\n\nexport type GroupedBarChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function GroupedBarChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ series, ariaLabel = \"Grouped bar chart\", ...props }: GroupedBarChartProps<TData, K>) {\n\tconst resolvedSeries = resolveChartSeries(series, [\"y\", \"y2\"] as K[]);\n\treturn (\n\t\t<BarChart<TData, K>\n\t\t\tseries={resolvedSeries}\n\t\t\tariaLabel={ariaLabel}\n\t\t\t{...props}\n\t\t\tcolor={undefined}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;AAkEA,SAAgB,EAGd,EAAE,WAAQ,eAAY,qBAAqB,GAAG,KAAyC;CACxF,IAAM,IAAiB,EAAmB,GAAQ,CAAC,KAAK,IAAI,CAAQ;CACpE,OACC,kBAAC,GAAD;EACC,QAAQ;EACG;EACX,GAAI;EACJ,OAAO,KAAA;CACP,CAAA;AAEH"}
|
|
@@ -56,33 +56,9 @@ function _(e, t, n) {
|
|
|
56
56
|
return Math.ceil(i * r);
|
|
57
57
|
}
|
|
58
58
|
function v(e) {
|
|
59
|
-
|
|
60
|
-
let { colorScale: t = f.green, valueFormatter: n = (e) => e.toLocaleString(), metricLabel: r = "Value", cellSize: i = 12, cellGap: a = 2, locale: o = "en-US", weekdayLabels: s, monthLabels: c, lessLabel: l = "Less", moreLabel: d = "More", ariaLabel: p = "Heatmap calendar", className: m } = e;
|
|
61
|
-
return /* @__PURE__ */ u(b, {
|
|
62
|
-
data: e.data,
|
|
63
|
-
year: e.year,
|
|
64
|
-
colorScale: t,
|
|
65
|
-
valueFormatter: n,
|
|
66
|
-
metricLabel: r,
|
|
67
|
-
cellSize: i,
|
|
68
|
-
cellGap: a,
|
|
69
|
-
locale: o,
|
|
70
|
-
weekdayLabels: s,
|
|
71
|
-
monthLabels: c,
|
|
72
|
-
lessLabel: l,
|
|
73
|
-
moreLabel: d,
|
|
74
|
-
ariaLabel: p,
|
|
75
|
-
className: m
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
let { ariaLabel: t = "Heatmap calendar", className: n } = e;
|
|
79
|
-
return /* @__PURE__ */ u(y, {
|
|
80
|
-
values: e.values,
|
|
81
|
-
ariaLabel: t,
|
|
82
|
-
className: n
|
|
83
|
-
});
|
|
59
|
+
return "data" in e ? /* @__PURE__ */ u(b, { ...e }) : /* @__PURE__ */ u(y, { ...e });
|
|
84
60
|
}
|
|
85
|
-
function y({ values: o, ariaLabel: s, className: f }) {
|
|
61
|
+
function y({ values: o, ariaLabel: s = "Heatmap calendar", className: f }) {
|
|
86
62
|
let [p, m] = l(0), [h, g] = l(null), _ = c(null), v = c([]), y = c(!1);
|
|
87
63
|
a(() => {
|
|
88
64
|
let e = y.current;
|
|
@@ -107,20 +83,7 @@ function y({ values: o, ariaLabel: s, className: f }) {
|
|
|
107
83
|
else if (e.key === "End") n = o.length - 1;
|
|
108
84
|
else return;
|
|
109
85
|
e.preventDefault(), m(n), g(n), v.current[n]?.focus();
|
|
110
|
-
}
|
|
111
|
-
return o.length === 0 ? /* @__PURE__ */ u("div", {
|
|
112
|
-
ref: _,
|
|
113
|
-
tabIndex: -1,
|
|
114
|
-
role: "region",
|
|
115
|
-
"aria-label": s,
|
|
116
|
-
onFocus: () => {
|
|
117
|
-
y.current = !0;
|
|
118
|
-
},
|
|
119
|
-
onBlur: (e) => {
|
|
120
|
-
e.currentTarget.contains(e.relatedTarget) || (y.current = !1);
|
|
121
|
-
},
|
|
122
|
-
className: e("grid grid-cols-7 gap-1 p-0.5 outline-none", f)
|
|
123
|
-
}) : /* @__PURE__ */ u(r, { children: /* @__PURE__ */ u("div", {
|
|
86
|
+
}, x = /* @__PURE__ */ u("div", {
|
|
124
87
|
ref: _,
|
|
125
88
|
tabIndex: -1,
|
|
126
89
|
role: "region",
|
|
@@ -166,35 +129,30 @@ function y({ values: o, ariaLabel: s, className: f }) {
|
|
|
166
129
|
]
|
|
167
130
|
}) })]
|
|
168
131
|
}, r))
|
|
169
|
-
})
|
|
132
|
+
});
|
|
133
|
+
return o.length === 0 ? x : /* @__PURE__ */ u(r, { children: x });
|
|
170
134
|
}
|
|
171
|
-
function b({ data:
|
|
172
|
-
let
|
|
173
|
-
let e = h(
|
|
174
|
-
for (let e of
|
|
135
|
+
function b({ data: v, year: y, colorScale: b = f.green, valueFormatter: x = (e) => e.toLocaleString(), metricLabel: S = "Value", cellSize: C = 12, cellGap: w = 2, locale: T = "en-US", weekdayLabels: E, monthLabels: D, lessLabel: O = "Less", moreLabel: k = "More", ariaLabel: A = "Heatmap calendar", className: j }) {
|
|
136
|
+
let M = E ?? p(T), N = D ?? m(T), P = o(), F = c(null), { weeks: I, dataMap: L, maxValue: R, labels: z, validDays: B, dateToValidIndex: V } = s(() => {
|
|
137
|
+
let e = h(y), t = /* @__PURE__ */ new Map(), n = 0;
|
|
138
|
+
for (let e of v) t.set(e.date, e.value), e.value > n && (n = e.value);
|
|
175
139
|
let r = [], i = -1;
|
|
176
140
|
e.forEach((e, t) => {
|
|
177
|
-
let n = e.find((e) => e.getFullYear() ===
|
|
141
|
+
let n = e.find((e) => e.getFullYear() === y);
|
|
178
142
|
if (n) {
|
|
179
143
|
let e = n.getMonth();
|
|
180
144
|
e !== i && (r.push({
|
|
181
|
-
month:
|
|
145
|
+
month: N[e],
|
|
182
146
|
weekIndex: t
|
|
183
147
|
}), i = e);
|
|
184
148
|
}
|
|
185
149
|
});
|
|
186
150
|
let a = [], o = /* @__PURE__ */ new Map();
|
|
187
|
-
return e.forEach((e
|
|
188
|
-
e.forEach((e
|
|
189
|
-
if (e.getFullYear() ===
|
|
190
|
-
let
|
|
191
|
-
o.set(
|
|
192
|
-
dateStr: s,
|
|
193
|
-
value: c,
|
|
194
|
-
weekIndex: r,
|
|
195
|
-
dayIndex: i,
|
|
196
|
-
colorIndex: l
|
|
197
|
-
});
|
|
151
|
+
return e.forEach((e) => {
|
|
152
|
+
e.forEach((e) => {
|
|
153
|
+
if (e.getFullYear() === y) {
|
|
154
|
+
let t = g(e);
|
|
155
|
+
o.set(t, a.length), a.push(t);
|
|
198
156
|
}
|
|
199
157
|
});
|
|
200
158
|
}), {
|
|
@@ -206,80 +164,72 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
|
|
|
206
164
|
dateToValidIndex: o
|
|
207
165
|
};
|
|
208
166
|
}, [
|
|
209
|
-
f,
|
|
210
|
-
M,
|
|
211
167
|
v,
|
|
168
|
+
N,
|
|
212
169
|
y
|
|
213
|
-
]), [
|
|
170
|
+
]), [H, U] = l(() => B[0] ?? `${y}-01-01`), [W, G] = l(null), K = c(/* @__PURE__ */ new Map()), q = c(!1);
|
|
214
171
|
a(() => {
|
|
215
|
-
let e =
|
|
216
|
-
if (
|
|
217
|
-
else if (!
|
|
218
|
-
let t =
|
|
219
|
-
|
|
172
|
+
let e = q.current;
|
|
173
|
+
if (B.length === 0) U(""), G(null), e && F.current?.focus();
|
|
174
|
+
else if (!V.has(H)) {
|
|
175
|
+
let t = B[0] ?? "";
|
|
176
|
+
U(t), e && K.current.get(t)?.focus();
|
|
220
177
|
}
|
|
221
178
|
}, [
|
|
222
|
-
z,
|
|
223
179
|
B,
|
|
224
|
-
V
|
|
225
|
-
]);
|
|
226
|
-
let q = s(() => {
|
|
227
|
-
let e = B.get(V);
|
|
228
|
-
return e === void 0 ? z[0] : z[e];
|
|
229
|
-
}, [
|
|
230
180
|
V,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
]
|
|
234
|
-
e && (
|
|
235
|
-
},
|
|
236
|
-
if (
|
|
237
|
-
let n =
|
|
181
|
+
H
|
|
182
|
+
]);
|
|
183
|
+
let J = V.has(H) ? H : B[0], Y = (e) => {
|
|
184
|
+
e && (U(e), G(e), K.current.get(e)?.focus());
|
|
185
|
+
}, X = (e, t) => {
|
|
186
|
+
if (B.length === 0) return;
|
|
187
|
+
let n = V.get(t) ?? 0;
|
|
238
188
|
if (e.key === "Escape") {
|
|
239
|
-
|
|
189
|
+
G(null);
|
|
240
190
|
return;
|
|
241
191
|
}
|
|
242
192
|
if (e.key === "ArrowDown") {
|
|
243
193
|
e.preventDefault();
|
|
244
|
-
let t =
|
|
245
|
-
t &&
|
|
194
|
+
let t = B[n + 1];
|
|
195
|
+
t && Y(t);
|
|
246
196
|
} else if (e.key === "ArrowUp") {
|
|
247
197
|
e.preventDefault();
|
|
248
|
-
let t =
|
|
249
|
-
t &&
|
|
198
|
+
let t = B[n - 1];
|
|
199
|
+
t && Y(t);
|
|
250
200
|
} else if (e.key === "ArrowRight") {
|
|
251
201
|
e.preventDefault();
|
|
252
202
|
let t = n + 7;
|
|
253
|
-
t <
|
|
203
|
+
t < B.length ? Y(B[t]) : Y(B[B.length - 1]);
|
|
254
204
|
} else if (e.key === "ArrowLeft") {
|
|
255
205
|
e.preventDefault();
|
|
256
206
|
let t = n - 7;
|
|
257
|
-
|
|
258
|
-
} else e.key === "Home" ? (e.preventDefault(),
|
|
207
|
+
Y(t >= 0 ? B[t] : B[0]);
|
|
208
|
+
} else e.key === "Home" ? (e.preventDefault(), Y(B[0])) : e.key === "End" && (e.preventDefault(), Y(B[B.length - 1]));
|
|
259
209
|
};
|
|
260
210
|
return /* @__PURE__ */ u("div", {
|
|
261
|
-
ref:
|
|
211
|
+
ref: F,
|
|
262
212
|
tabIndex: -1,
|
|
263
213
|
role: "region",
|
|
264
|
-
"aria-label": `${
|
|
214
|
+
"aria-label": `${A} scrollable view`,
|
|
265
215
|
onFocus: () => {
|
|
266
|
-
|
|
216
|
+
q.current = !0;
|
|
267
217
|
},
|
|
268
218
|
onBlur: (e) => {
|
|
269
|
-
e.currentTarget.contains(e.relatedTarget) || (
|
|
219
|
+
e.currentTarget.contains(e.relatedTarget) || (q.current = !1);
|
|
270
220
|
},
|
|
271
|
-
className: e("overflow-x-auto rounded-md outline-none focus-visible:ring-1 focus-visible:ring-basalt-ring",
|
|
221
|
+
className: e("overflow-x-auto rounded-md outline-none focus-visible:ring-1 focus-visible:ring-basalt-ring", j),
|
|
272
222
|
children: /* @__PURE__ */ u(r, { children: /* @__PURE__ */ d("div", {
|
|
273
223
|
className: "inline-block p-1",
|
|
274
224
|
role: "group",
|
|
275
|
-
"aria-label":
|
|
225
|
+
"aria-label": A,
|
|
276
226
|
children: [
|
|
277
227
|
/* @__PURE__ */ u("div", {
|
|
278
228
|
className: "relative mb-1 h-4 text-xs text-basalt-muted-foreground",
|
|
279
229
|
style: { marginLeft: 30 },
|
|
280
|
-
children:
|
|
230
|
+
children: z.map((e) => /* @__PURE__ */ u("div", {
|
|
281
231
|
className: "absolute",
|
|
282
|
-
style: { left: e.weekIndex * (
|
|
232
|
+
style: { left: e.weekIndex * (C + w) },
|
|
283
233
|
children: e.month
|
|
284
234
|
}, `${e.month}-${e.weekIndex}`))
|
|
285
235
|
}),
|
|
@@ -289,83 +239,77 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
|
|
|
289
239
|
className: "mr-1 flex flex-col text-xs text-basalt-muted-foreground select-none",
|
|
290
240
|
style: { width: 30 },
|
|
291
241
|
"aria-hidden": "true",
|
|
292
|
-
children:
|
|
242
|
+
children: M.map((e, t) => /* @__PURE__ */ u("div", {
|
|
293
243
|
style: {
|
|
294
|
-
height:
|
|
295
|
-
lineHeight: `${
|
|
244
|
+
height: C + w,
|
|
245
|
+
lineHeight: `${C + w}px`,
|
|
296
246
|
visibility: t % 2 == 1 ? "visible" : "hidden"
|
|
297
247
|
},
|
|
298
248
|
children: e
|
|
299
249
|
}, `${e}-${t}`))
|
|
300
250
|
}), /* @__PURE__ */ u("div", {
|
|
301
251
|
className: "flex",
|
|
302
|
-
style: { gap:
|
|
303
|
-
children:
|
|
252
|
+
style: { gap: w },
|
|
253
|
+
children: I.map((e, r) => /* @__PURE__ */ u("div", {
|
|
304
254
|
className: "flex flex-col",
|
|
305
|
-
style: { gap:
|
|
306
|
-
children: e.map((e,
|
|
307
|
-
let
|
|
308
|
-
if (e.getFullYear() !==
|
|
255
|
+
style: { gap: w },
|
|
256
|
+
children: e.map((e, r) => {
|
|
257
|
+
let a = g(e);
|
|
258
|
+
if (e.getFullYear() !== y) return /* @__PURE__ */ u("div", {
|
|
309
259
|
style: {
|
|
310
|
-
width:
|
|
311
|
-
height:
|
|
260
|
+
width: C,
|
|
261
|
+
height: C,
|
|
312
262
|
visibility: "hidden"
|
|
313
263
|
},
|
|
314
264
|
"aria-hidden": "true"
|
|
315
|
-
},
|
|
316
|
-
let
|
|
317
|
-
dateStr: o,
|
|
318
|
-
value: s,
|
|
319
|
-
weekIndex: r,
|
|
320
|
-
dayIndex: a,
|
|
321
|
-
colorIndex: c
|
|
322
|
-
};
|
|
265
|
+
}, r);
|
|
266
|
+
let o = L.get(a) ?? 0, s = _(o, R, b), c = J === a, l = x(o, a), f = `${a}, ${S}: ${l}`;
|
|
323
267
|
return /* @__PURE__ */ d(t, {
|
|
324
|
-
open:
|
|
268
|
+
open: W === a,
|
|
325
269
|
onOpenChange: (e) => {
|
|
326
|
-
|
|
270
|
+
G(e ? a : (e) => e === a ? document.activeElement === K.current.get(a) ? e : null : e);
|
|
327
271
|
},
|
|
328
272
|
children: [/* @__PURE__ */ u(i, {
|
|
329
273
|
asChild: !0,
|
|
330
274
|
children: /* @__PURE__ */ u("button", {
|
|
331
275
|
ref: (e) => {
|
|
332
|
-
e ?
|
|
276
|
+
e ? K.current.set(a, e) : K.current.delete(a);
|
|
333
277
|
},
|
|
334
278
|
type: "button",
|
|
335
|
-
"aria-label":
|
|
336
|
-
tabIndex:
|
|
279
|
+
"aria-label": f,
|
|
280
|
+
tabIndex: c ? 0 : -1,
|
|
337
281
|
onFocus: () => {
|
|
338
|
-
|
|
282
|
+
U(a), G(a);
|
|
339
283
|
},
|
|
340
284
|
onBlur: () => {
|
|
341
|
-
|
|
285
|
+
G((e) => e === a ? null : e);
|
|
342
286
|
},
|
|
343
|
-
onKeyDown: (e) =>
|
|
287
|
+
onKeyDown: (e) => X(e, a),
|
|
344
288
|
className: "box-border m-0 cursor-pointer rounded-sm border-0 p-0 transition-colors hover:ring-1 hover:ring-basalt-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-basalt-ring",
|
|
345
289
|
style: {
|
|
346
|
-
width:
|
|
347
|
-
height:
|
|
348
|
-
backgroundColor:
|
|
290
|
+
width: C,
|
|
291
|
+
height: C,
|
|
292
|
+
backgroundColor: b[s]
|
|
349
293
|
}
|
|
350
294
|
})
|
|
351
295
|
}), /* @__PURE__ */ u(n, {
|
|
352
|
-
id: `${
|
|
296
|
+
id: `${P}-${a}`,
|
|
353
297
|
children: /* @__PURE__ */ d("div", {
|
|
354
298
|
className: "text-sm",
|
|
355
299
|
children: [/* @__PURE__ */ u("div", {
|
|
356
300
|
className: "font-medium",
|
|
357
|
-
children:
|
|
301
|
+
children: a
|
|
358
302
|
}), /* @__PURE__ */ d("div", {
|
|
359
303
|
className: "text-basalt-muted-foreground",
|
|
360
304
|
children: [
|
|
361
|
-
|
|
305
|
+
S,
|
|
362
306
|
": ",
|
|
363
|
-
|
|
307
|
+
l
|
|
364
308
|
]
|
|
365
309
|
})]
|
|
366
310
|
})
|
|
367
311
|
})]
|
|
368
|
-
},
|
|
312
|
+
}, r);
|
|
369
313
|
})
|
|
370
314
|
}, r))
|
|
371
315
|
})]
|
|
@@ -374,16 +318,16 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
|
|
|
374
318
|
className: "mt-2 flex items-center justify-end gap-1 text-xs text-basalt-muted-foreground select-none",
|
|
375
319
|
"aria-hidden": "true",
|
|
376
320
|
children: [
|
|
377
|
-
/* @__PURE__ */ u("span", { children:
|
|
378
|
-
|
|
321
|
+
/* @__PURE__ */ u("span", { children: O }),
|
|
322
|
+
b.map((e) => /* @__PURE__ */ u("div", {
|
|
379
323
|
className: "rounded-sm",
|
|
380
324
|
style: {
|
|
381
|
-
width:
|
|
382
|
-
height:
|
|
325
|
+
width: C,
|
|
326
|
+
height: C,
|
|
383
327
|
backgroundColor: e
|
|
384
328
|
}
|
|
385
329
|
}, e)),
|
|
386
|
-
/* @__PURE__ */ u("span", { children:
|
|
330
|
+
/* @__PURE__ */ u("span", { children: k })
|
|
387
331
|
]
|
|
388
332
|
})
|
|
389
333
|
]
|