@acronis-platform/ui-react 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +107 -107
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +162 -162
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/category-bar/category-bar.js +50 -50
  6. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  7. package/dist/components/ui/chart/chart.js +53 -40
  8. package/dist/components/ui/chart/chart.js.map +1 -1
  9. package/dist/components/ui/composed-chart/composed-chart.js +146 -146
  10. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  11. package/dist/components/ui/confidence-cone/confidence-cone.js +97 -97
  12. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  13. package/dist/components/ui/data-table/data-table-bulk-actions-bar.js +1 -1
  14. package/dist/components/ui/data-table/data-table-bulk-actions-bar.js.map +1 -1
  15. package/dist/components/ui/data-table/data-table-view-options.js +3 -2
  16. package/dist/components/ui/data-table/data-table-view-options.js.map +1 -1
  17. package/dist/components/ui/data-table/data-table.js +136 -132
  18. package/dist/components/ui/data-table/data-table.js.map +1 -1
  19. package/dist/components/ui/funnel-chart/funnel-chart.js +120 -120
  20. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  21. package/dist/components/ui/histogram/histogram.js +58 -58
  22. package/dist/components/ui/histogram/histogram.js.map +1 -1
  23. package/dist/components/ui/line-chart/line-chart.js +91 -91
  24. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  25. package/dist/components/ui/pie-chart/pie-chart.js +92 -92
  26. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  27. package/dist/components/ui/radar-chart/radar-chart.js +37 -37
  28. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  29. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +112 -112
  30. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  31. package/dist/components/ui/sankey-chart/sankey-chart.js +78 -78
  32. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  33. package/dist/components/ui/scatter-chart/scatter-chart.js +57 -57
  34. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  35. package/dist/components/ui/table/table-view-options.js +88 -33
  36. package/dist/components/ui/table/table-view-options.js.map +1 -1
  37. package/dist/components/ui/table/table.js.map +1 -1
  38. package/dist/components/ui/treemap/treemap.js +87 -87
  39. package/dist/components/ui/treemap/treemap.js.map +1 -1
  40. package/dist/index.js +111 -111
  41. package/dist/llms/data-table.md +33 -7
  42. package/dist/llms/table.md +56 -23
  43. package/dist/llms.txt +1 -1
  44. package/dist/react.js +111 -111
  45. package/dist/src/components/ui/chart/chart.d.ts +1 -0
  46. package/dist/src/components/ui/chart/index.d.ts +1 -1
  47. package/dist/src/components/ui/data-table/data-table-view-options.d.ts +1 -1
  48. package/dist/src/components/ui/data-table/data-table.d.ts +11 -1
  49. package/dist/src/components/ui/data-table/data-table.docs.d.ts +6 -0
  50. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +3 -2
  51. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +1 -1
  52. package/dist/src/components/ui/table/table-view-options.d.ts +9 -1
  53. package/dist/src/components/ui/treemap/treemap.d.ts +3 -2
  54. package/dist/ui-react.css +1 -1
  55. package/package.json +3 -3
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/utils.js";
3
- import { ChartContainer as t, ChartTooltip as n, ChartTooltipContent as r } from "../chart/chart.js";
4
- import { resolveAnimation as i, resolveAxisDomain as a, resolveRotatedTickAnchor as o, resolveXAxisHeight as s, resolveXAxisTitle as c, resolveYAxisTitle as l } from "../chart/chart-format.js";
5
- import * as u from "react";
6
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { Bar as p, BarChart as m, CartesianGrid as h, XAxis as g, YAxis as _ } from "recharts";
3
+ import { ChartContainer as t, ChartTooltip as n, ChartTooltipContent as r, toCssKey as i } from "../chart/chart.js";
4
+ import { resolveAnimation as a, resolveAxisDomain as o, resolveRotatedTickAnchor as s, resolveXAxisHeight as c, resolveXAxisTitle as l, resolveYAxisTitle as u } from "../chart/chart-format.js";
5
+ import * as d from "react";
6
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { Bar as m, BarChart as h, CartesianGrid as g, XAxis as _, YAxis as v } from "recharts";
8
8
  //#region src/components/ui/histogram/histogram.tsx
9
- var v = (e) => Number(e.toFixed(2));
10
- function y(e, t, n) {
9
+ var y = (e) => Number(e.toFixed(2));
10
+ function b(e, t, n) {
11
11
  let r = e.filter((e) => typeof e == "number" && Number.isFinite(e));
12
12
  if (r.length === 0 || t < 1) return [];
13
13
  let [i, a] = n ?? [Math.min(...r), Math.max(...r)], o = Math.min(i, a), s = Math.max(i, a), c = o === s ? o + 1 : s, l = (c - o) / t, u = Array.from({ length: t }, (e, n) => {
@@ -15,7 +15,7 @@ function y(e, t, n) {
15
15
  return {
16
16
  x0: r,
17
17
  x1: i,
18
- label: `${v(r)}–${v(i)}`,
18
+ label: `${y(r)}–${y(i)}`,
19
19
  count: 0
20
20
  };
21
21
  });
@@ -26,83 +26,83 @@ function y(e, t, n) {
26
26
  }
27
27
  return u;
28
28
  }
29
- var b = u.forwardRef(({ className: v, config: b, palette: x, values: S, dataKey: C = "count", binCount: w = 10, domain: T, xAxisLabel: E, yAxisLabel: D, yUnit: O, barRadius: k = 0, showGrid: A = !0, showTooltip: j = !0, showXAxis: M = !0, showYAxis: N = !0, xTickFormatter: P, yTickFormatter: F, xAxisAngle: I, xAxisInterval: L, yAxisTickCount: R, yAxisDomain: z, gridDashed: B, gridHorizontal: V, gridVertical: H, tooltipContent: U, animate: W, animationDuration: G, animationBegin: K, animationEasing: q, ...J }, Y) => {
30
- let X = i({
31
- animate: W,
32
- animationDuration: G,
33
- animationBegin: K,
34
- animationEasing: q
35
- }), Z = c(E), Q = l(D), $ = a(z), ee = s(E, I), te = u.useMemo(() => y(S, w, T), [
36
- S,
37
- w,
38
- T
29
+ var x = d.forwardRef(({ className: y, config: x, palette: S, values: C, dataKey: w = "count", binCount: T = 10, domain: E, xAxisLabel: D, yAxisLabel: O, yUnit: k, barRadius: A = 0, showGrid: j = !0, showTooltip: M = !0, showXAxis: N = !0, showYAxis: P = !0, xTickFormatter: F, yTickFormatter: I, xAxisAngle: L, xAxisInterval: R, yAxisTickCount: z, yAxisDomain: B, gridDashed: V, gridHorizontal: H, gridVertical: U, tooltipContent: W, animate: G, animationDuration: K, animationBegin: q, animationEasing: J, ...Y }, X) => {
30
+ let Z = a({
31
+ animate: G,
32
+ animationDuration: K,
33
+ animationBegin: q,
34
+ animationEasing: J
35
+ }), Q = l(D), $ = u(O), ee = o(B), te = c(D, L), ne = d.useMemo(() => b(C, T, E), [
36
+ C,
37
+ T,
38
+ E
39
39
  ]).map((e) => ({
40
40
  label: e.label,
41
- [C]: e.count
41
+ [w]: e.count
42
42
  }));
43
- return /* @__PURE__ */ d("div", {
44
- ref: Y,
45
- className: e(v),
46
- ...J,
47
- children: /* @__PURE__ */ d(t, {
48
- config: b,
49
- palette: x,
43
+ return /* @__PURE__ */ f("div", {
44
+ ref: X,
45
+ className: e(y),
46
+ ...Y,
47
+ children: /* @__PURE__ */ f(t, {
48
+ config: x,
49
+ palette: S,
50
50
  className: "size-full [&_.recharts-label]:fill-foreground",
51
- children: /* @__PURE__ */ f(m, {
52
- data: te,
51
+ children: /* @__PURE__ */ p(h, {
52
+ data: ne,
53
53
  barCategoryGap: 0,
54
54
  children: [
55
- A && /* @__PURE__ */ d(h, {
56
- horizontal: V ?? !0,
57
- vertical: H ?? !1,
58
- strokeDasharray: B ? "3 3" : void 0
55
+ j && /* @__PURE__ */ f(g, {
56
+ horizontal: H ?? !0,
57
+ vertical: U ?? !1,
58
+ strokeDasharray: V ? "3 3" : void 0
59
59
  }),
60
- /* @__PURE__ */ d(g, {
60
+ /* @__PURE__ */ f(_, {
61
61
  dataKey: "label",
62
- hide: !M,
62
+ hide: !N,
63
63
  tickLine: !1,
64
64
  axisLine: !1,
65
- tickFormatter: P,
66
- angle: I,
67
- interval: L,
68
- textAnchor: o(I),
69
- height: ee,
70
- label: Z
65
+ tickFormatter: F,
66
+ angle: L,
67
+ interval: R,
68
+ textAnchor: s(L),
69
+ height: te,
70
+ label: Q
71
71
  }),
72
- /* @__PURE__ */ d(_, {
72
+ /* @__PURE__ */ f(v, {
73
73
  type: "number",
74
- hide: !N,
74
+ hide: !P,
75
75
  tickLine: !1,
76
76
  axisLine: !1,
77
77
  allowDecimals: !1,
78
- unit: O,
79
- tickFormatter: F,
80
- tickCount: R,
81
- domain: $,
82
- width: D ? 72 : void 0,
83
- label: Q
78
+ unit: k,
79
+ tickFormatter: I,
80
+ tickCount: z,
81
+ domain: ee,
82
+ width: O ? 72 : void 0,
83
+ label: $
84
84
  }),
85
- j && /* @__PURE__ */ d(n, { content: U ?? /* @__PURE__ */ d(r, {}) }),
86
- /* @__PURE__ */ d(p, {
87
- dataKey: C,
88
- fill: `var(--color-${C})`,
85
+ M && /* @__PURE__ */ f(n, { content: W ?? /* @__PURE__ */ f(r, {}) }),
86
+ /* @__PURE__ */ f(m, {
87
+ dataKey: w,
88
+ fill: `var(--color-${i(String(w))})`,
89
89
  stroke: "var(--ui-background-surface-primary)",
90
90
  strokeWidth: 1,
91
- radius: k > 0 ? [
92
- k,
93
- k,
91
+ radius: A > 0 ? [
92
+ A,
93
+ A,
94
94
  0,
95
95
  0
96
96
  ] : void 0,
97
- ...X
97
+ ...Z
98
98
  })
99
99
  ]
100
100
  })
101
101
  })
102
102
  });
103
103
  });
104
- b.displayName = "Histogram";
104
+ x.displayName = "Histogram";
105
105
  //#endregion
106
- export { b as Histogram, y as computeHistogramBins };
106
+ export { x as Histogram, b as computeHistogramBins };
107
107
 
108
108
  //# sourceMappingURL=histogram.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"histogram.js","names":[],"sources":["../../../../src/components/ui/histogram/histogram.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n type ChartConfig,\n type ChartPalette,\n type CartesianChartProps,\n type ChartAnimationProps,\n} from '../chart';\n\n// A histogram bins a set of continuous samples into equal-width ranges and plots\n// the frequency of each as contiguous bars — distinct from BarChart, whose bars\n// are pre-categorized. The binning is the component's job (a pure helper), so the\n// consumer passes raw `values`, not pre-aggregated rows. Built on the shared\n// `Chart` primitives; no new tokens (the single series' color is caller-supplied\n// via `config`, same `--color-<key>` mechanism as the other chart types).\n\nexport interface HistogramBin {\n /** Lower bound of the bin (inclusive). */\n x0: number;\n /** Upper bound of the bin (exclusive, except the last bin which is inclusive). */\n x1: number;\n /** Human-readable range label, e.g. `\"0–10\"`. */\n label: string;\n /** How many samples fell in the bin. */\n count: number;\n}\n\nconst roundEdge = (n: number) => Number(n.toFixed(2));\n\n/**\n * Split `values` into `binCount` equal-width bins and count the samples in each.\n * The range is `domain` if given, else the data's [min, max]; values outside the\n * domain are dropped, and the max value lands in the last (inclusive) bin.\n * Returns [] when there's nothing to bin. Exported for unit tests; not part of\n * the package's public API.\n */\nexport function computeHistogramBins(\n values: ReadonlyArray<number>,\n binCount: number,\n domain?: [number, number]\n): HistogramBin[] {\n const nums = values.filter(\n (v): v is number => typeof v === 'number' && Number.isFinite(v)\n );\n if (nums.length === 0 || binCount < 1) return [];\n\n const [d0, d1] = domain ?? [Math.min(...nums), Math.max(...nums)];\n // Normalize an inverted domain ([max, min]) so binning stays robust.\n const min = Math.min(d0, d1);\n const hi = Math.max(d0, d1);\n // A zero-width range (all values equal, or a degenerate domain) can't be\n // divided — widen it by 1 so the single bin has extent.\n const max = min === hi ? min + 1 : hi;\n const width = (max - min) / binCount;\n\n const bins: HistogramBin[] = Array.from({ length: binCount }, (_, i) => {\n const x0 = min + i * width;\n const x1 = i === binCount - 1 ? max : min + (i + 1) * width;\n return { x0, x1, label: `${roundEdge(x0)}–${roundEdge(x1)}`, count: 0 };\n });\n\n for (const v of nums) {\n if (v < min || v > max) continue;\n let idx = Math.floor((v - min) / width);\n if (idx >= binCount) idx = binCount - 1; // the max value\n bins[idx].count += 1;\n }\n return bins;\n}\n\nexport interface HistogramProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n CartesianChartProps,\n ChartAnimationProps {\n /**\n * The dataviz palette this chart's series are painted from. Series that\n * state no `color` of their own take a stop of it. See `ChartPalette`.\n */\n palette?: ChartPalette;\n /** Raw continuous samples to bin (non-finite values are ignored). */\n values: ReadonlyArray<number>;\n /**\n * Single-series map of `label` / `icon` / `tone`, keyed by `dataKey` (imported\n * from the shared `Chart` primitives). Series take their colour from the\n * container's `palette`; each entry maps a key to a `label` and an optional\n * `tone`.\n */\n config: ChartConfig;\n /** `config` key that colors + labels the frequency bars. */\n dataKey?: string;\n /** Number of equal-width bins. */\n binCount?: number;\n /** Fix the binning range instead of deriving it from the data's min/max. */\n domain?: [number, number];\n /** Corner radius on the top of each bar. */\n barRadius?: number;\n}\n\nconst Histogram = React.forwardRef<HTMLDivElement, HistogramProps>(\n (\n {\n className,\n config,\n palette,\n values,\n dataKey = 'count',\n binCount = 10,\n domain,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n barRadius = 0,\n showGrid = true,\n showTooltip = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n const bins = React.useMemo(\n () => computeHistogramBins(values, binCount, domain),\n [values, binCount, domain]\n );\n // Bars carry the bin `label` as the category and `count` under `dataKey`, so\n // the tooltip resolves the frequency from `config[dataKey]`.\n const data = bins.map((bin) => ({ label: bin.label, [dataKey]: bin.count }));\n\n return (\n <div\n ref={ref}\n className={cn(className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data} barCategoryGap={0}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey=\"label\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n allowDecimals={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n <Bar\n dataKey={dataKey}\n fill={`var(--color-${dataKey})`}\n // A hairline in the surface color separates the contiguous bars so\n // they don't blend into one mass (same trick as the Treemap cells).\n stroke=\"var(--ui-background-surface-primary)\"\n strokeWidth={1}\n radius={barRadius > 0 ? [barRadius, barRadius, 0, 0] : undefined}\n {...animation}\n />\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nHistogram.displayName = 'Histogram';\n\nexport { Histogram };\n"],"mappings":"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"}
1
+ {"version":3,"file":"histogram.js","names":[],"sources":["../../../../src/components/ui/histogram/histogram.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n type ChartConfig,\n toCssKey,\n type ChartPalette,\n type CartesianChartProps,\n type ChartAnimationProps,\n} from '../chart';\n\n// A histogram bins a set of continuous samples into equal-width ranges and plots\n// the frequency of each as contiguous bars — distinct from BarChart, whose bars\n// are pre-categorized. The binning is the component's job (a pure helper), so the\n// consumer passes raw `values`, not pre-aggregated rows. Built on the shared\n// `Chart` primitives; no new tokens (the single series' color is caller-supplied\n// via `config`, same `--color-<key>` mechanism as the other chart types).\n\nexport interface HistogramBin {\n /** Lower bound of the bin (inclusive). */\n x0: number;\n /** Upper bound of the bin (exclusive, except the last bin which is inclusive). */\n x1: number;\n /** Human-readable range label, e.g. `\"0–10\"`. */\n label: string;\n /** How many samples fell in the bin. */\n count: number;\n}\n\nconst roundEdge = (n: number) => Number(n.toFixed(2));\n\n/**\n * Split `values` into `binCount` equal-width bins and count the samples in each.\n * The range is `domain` if given, else the data's [min, max]; values outside the\n * domain are dropped, and the max value lands in the last (inclusive) bin.\n * Returns [] when there's nothing to bin. Exported for unit tests; not part of\n * the package's public API.\n */\nexport function computeHistogramBins(\n values: ReadonlyArray<number>,\n binCount: number,\n domain?: [number, number]\n): HistogramBin[] {\n const nums = values.filter(\n (v): v is number => typeof v === 'number' && Number.isFinite(v)\n );\n if (nums.length === 0 || binCount < 1) return [];\n\n const [d0, d1] = domain ?? [Math.min(...nums), Math.max(...nums)];\n // Normalize an inverted domain ([max, min]) so binning stays robust.\n const min = Math.min(d0, d1);\n const hi = Math.max(d0, d1);\n // A zero-width range (all values equal, or a degenerate domain) can't be\n // divided — widen it by 1 so the single bin has extent.\n const max = min === hi ? min + 1 : hi;\n const width = (max - min) / binCount;\n\n const bins: HistogramBin[] = Array.from({ length: binCount }, (_, i) => {\n const x0 = min + i * width;\n const x1 = i === binCount - 1 ? max : min + (i + 1) * width;\n return { x0, x1, label: `${roundEdge(x0)}–${roundEdge(x1)}`, count: 0 };\n });\n\n for (const v of nums) {\n if (v < min || v > max) continue;\n let idx = Math.floor((v - min) / width);\n if (idx >= binCount) idx = binCount - 1; // the max value\n bins[idx].count += 1;\n }\n return bins;\n}\n\nexport interface HistogramProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n CartesianChartProps,\n ChartAnimationProps {\n /**\n * The dataviz palette this chart's series are painted from. Series that\n * state no `color` of their own take a stop of it. See `ChartPalette`.\n */\n palette?: ChartPalette;\n /** Raw continuous samples to bin (non-finite values are ignored). */\n values: ReadonlyArray<number>;\n /**\n * Single-series map of `label` / `icon` / `tone`, keyed by `dataKey` (imported\n * from the shared `Chart` primitives). Series take their colour from the\n * container's `palette`; each entry maps a key to a `label` and an optional\n * `tone`.\n */\n config: ChartConfig;\n /** `config` key that colors + labels the frequency bars. */\n dataKey?: string;\n /** Number of equal-width bins. */\n binCount?: number;\n /** Fix the binning range instead of deriving it from the data's min/max. */\n domain?: [number, number];\n /** Corner radius on the top of each bar. */\n barRadius?: number;\n}\n\nconst Histogram = React.forwardRef<HTMLDivElement, HistogramProps>(\n (\n {\n className,\n config,\n palette,\n values,\n dataKey = 'count',\n binCount = 10,\n domain,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n barRadius = 0,\n showGrid = true,\n showTooltip = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n const bins = React.useMemo(\n () => computeHistogramBins(values, binCount, domain),\n [values, binCount, domain]\n );\n // Bars carry the bin `label` as the category and `count` under `dataKey`, so\n // the tooltip resolves the frequency from `config[dataKey]`.\n const data = bins.map((bin) => ({ label: bin.label, [dataKey]: bin.count }));\n\n return (\n <div\n ref={ref}\n className={cn(className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data} barCategoryGap={0}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey=\"label\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n allowDecimals={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n <Bar\n dataKey={dataKey}\n fill={`var(--color-${toCssKey(String(dataKey))})`}\n // A hairline in the surface color separates the contiguous bars so\n // they don't blend into one mass (same trick as the Treemap cells).\n stroke=\"var(--ui-background-surface-primary)\"\n strokeWidth={1}\n radius={barRadius > 0 ? [barRadius, barRadius, 0, 0] : undefined}\n {...animation}\n />\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nHistogram.displayName = 'Histogram';\n\nexport { Histogram };\n"],"mappings":"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"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/utils.js";
3
3
  import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o } from "../chart/chart.js";
5
- import { CHART_LABEL_MARGIN as s, dropProjectionPayload as c, resolveAnimation as l, resolveAxisDomain as u, resolveBrushProps as d, resolveChartReferenceValue as f, resolveLabelFillClass as p, resolveReferenceLineProps as ee, resolveRotatedTickAnchor as te, resolveXAxisHeight as ne, resolveXAxisTitle as re, resolveYAxisTitle as ie, toLabelFormatter as ae, toReferenceLineList as oe } from "../chart/chart-format.js";
4
+ import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o, toCssKey as s } from "../chart/chart.js";
5
+ import { CHART_LABEL_MARGIN as c, dropProjectionPayload as l, resolveAnimation as u, resolveAxisDomain as d, resolveBrushProps as f, resolveChartReferenceValue as p, resolveLabelFillClass as ee, resolveReferenceLineProps as te, resolveRotatedTickAnchor as ne, resolveXAxisHeight as re, resolveXAxisTitle as ie, resolveYAxisTitle as ae, toLabelFormatter as oe, toReferenceLineList as se } from "../chart/chart-format.js";
6
6
  import * as m from "react";
7
7
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
- import { Area as se, Brush as ce, CartesianGrid as le, ComposedChart as ue, LabelList as de, Line as v, LineChart as fe, ReferenceLine as y, Text as pe, XAxis as me, YAxis as he, usePlotArea as b, useXAxisScale as x } from "recharts";
8
+ import { Area as ce, Brush as le, CartesianGrid as v, ComposedChart as y, LabelList as ue, Line as b, LineChart as de, ReferenceLine as fe, Text as pe, XAxis as me, YAxis as he, usePlotArea as x, useXAxisScale as S } from "recharts";
9
9
  //#region src/components/ui/line-chart/line-chart.tsx
10
- var S = t("", {
10
+ var C = t("", {
11
11
  variants: {
12
12
  curve: {
13
13
  linear: "",
@@ -29,7 +29,7 @@ var S = t("", {
29
29
  }
30
30
  });
31
31
  function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
32
- let i = x(), a = b();
32
+ let i = S(), a = x();
33
33
  if (!i || !a) return null;
34
34
  let o = i(t), s = i(e);
35
35
  if (o == null || s == null) return null;
@@ -63,15 +63,15 @@ function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
63
63
  })
64
64
  ] });
65
65
  }
66
- var C = "__band_";
67
- function w(e) {
68
- return e?.filter((e) => !String(e.dataKey).startsWith(C));
69
- }
66
+ var w = "__band_";
70
67
  function T(e) {
68
+ return e?.filter((e) => !String(e.dataKey).startsWith(w));
69
+ }
70
+ function E(e) {
71
71
  return function(t) {
72
72
  let n = {
73
73
  ...t,
74
- payload: w(t.payload)
74
+ payload: T(t.payload)
75
75
  };
76
76
  return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
77
77
  };
@@ -80,24 +80,24 @@ function _e(e) {
80
80
  return function(t) {
81
81
  let n = {
82
82
  ...t,
83
- payload: c(t.payload)
83
+ payload: l(t.payload)
84
84
  };
85
85
  return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
86
86
  };
87
87
  }
88
- var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys: E, comparisonKeys: D, deltaBands: ve, xKey: O, xAxisLabel: k, yAxisLabel: A, yUnit: ye, curve: j = "monotone", lineStyle: M = "solid", strokeWidth: N = 2, showDots: P = !1, dotSize: be = 3, showActiveDot: xe, connectNulls: F = !1, lineSettings: I, referenceLine: Se, projectionStart: L, showGrid: Ce = !0, showTooltip: we = !0, showLegend: Te = !0, showXAxis: Ee = !0, showYAxis: De = !0, xTickFormatter: R, yTickFormatter: Oe, xAxisAngle: z, xAxisInterval: ke, yAxisTickCount: Ae, yAxisDomain: je, gridDashed: Me, gridHorizontal: Ne, gridVertical: Pe, tooltipContent: B, animate: Fe, animationDuration: Ie, animationBegin: Le, animationEasing: Re, showLabels: V = !1, labelPosition: ze, labelFormatter: Be, showBrush: Ve = !1, brushHeight: He, brushAriaLabel: Ue, ...We }, Ge) => {
89
- let H = l({
88
+ var D = m.forwardRef(({ className: t, config: h, palette: x, data: S, dataKeys: D, comparisonKeys: O, deltaBands: ve, xKey: k, xAxisLabel: A, yAxisLabel: j, yUnit: ye, curve: M = "monotone", lineStyle: N = "solid", strokeWidth: P = 2, showDots: be = !1, dotSize: xe = 3, showActiveDot: Se, connectNulls: F = !1, lineSettings: I, referenceLine: Ce, projectionStart: L, showGrid: we = !0, showTooltip: Te = !0, showLegend: Ee = !0, showXAxis: De = !0, showYAxis: Oe = !0, xTickFormatter: R, yTickFormatter: ke, xAxisAngle: z, xAxisInterval: Ae, yAxisTickCount: je, yAxisDomain: B, gridDashed: Me, gridHorizontal: Ne, gridVertical: Pe, tooltipContent: V, animate: Fe, animationDuration: Ie, animationBegin: Le, animationEasing: Re, showLabels: H = !1, labelPosition: ze, labelFormatter: Be, showBrush: Ve = !1, brushHeight: He, brushAriaLabel: Ue, ...We }, Ge) => {
89
+ let U = u({
90
90
  animate: Fe,
91
91
  animationDuration: Ie,
92
92
  animationBegin: Le,
93
93
  animationEasing: Re
94
- }), Ke = ze ?? "top", qe = u(je), Je = oe(Se), U = (e) => I?.[e]?.color ?? `var(--color-${e})`, W = (e) => I?.[e]?.curveType ?? j ?? "monotone", Ye = V || Object.values(I ?? {}).some((e) => e.showLabel), G = ne(k, z), K = m.useMemo(() => L === void 0 ? -1 : x.findIndex((e) => e[O] === L), [
94
+ }), Ke = ze ?? "top", qe = d(B), Je = se(Ce), W = (e) => I?.[e]?.color ?? `var(--color-${s(e)})`, G = (e) => I?.[e]?.curveType ?? M ?? "monotone", Ye = H || Object.values(I ?? {}).some((e) => e.showLabel), Xe = re(A, z), K = m.useMemo(() => L === void 0 ? -1 : S.findIndex((e) => e[k] === L), [
95
95
  L,
96
- x,
97
- O
96
+ S,
97
+ k
98
98
  ]), q = K > 0, J = m.useMemo(() => {
99
99
  if (!q) return;
100
- let e = new Set(x.slice(K).map((e) => e[O]));
100
+ let e = new Set(S.slice(K).map((e) => e[k]));
101
101
  return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(pe, {
102
102
  ...r,
103
103
  fontSize: 12,
@@ -107,168 +107,168 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
107
107
  }, [
108
108
  q,
109
109
  K,
110
- x,
111
- O,
110
+ S,
111
+ k,
112
112
  R
113
- ]), Y = m.useMemo(() => q ? x.map((e) => ({
113
+ ]), Y = m.useMemo(() => q ? S.map((e) => ({
114
114
  ...e,
115
- ...Object.fromEntries(E.map((t) => [`_proj_${t}`, e[t]]))
116
- })) : x, [
115
+ ...Object.fromEntries(D.map((t) => [`_proj_${t}`, e[t]]))
116
+ })) : S, [
117
117
  q,
118
- x,
119
- E
118
+ S,
119
+ D
120
120
  ]), X = m.useMemo(() => {
121
- if (!(K <= 0)) return x[K - 1]?.[O];
121
+ if (!(K <= 0)) return S[K - 1]?.[k];
122
122
  }, [
123
123
  K,
124
- x,
125
- O
126
- ]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, Xe = m.useMemo(() => {
127
- if (!B) return;
128
- let e = T(B);
124
+ S,
125
+ k
126
+ ]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, Ze = m.useMemo(() => {
127
+ if (!V) return;
128
+ let e = E(V);
129
129
  return q ? _e(e) : e;
130
- }, [B, q]), Ze = re(k), Qe = ie(A), Q = (ve ?? []).map(([e, t], n) => ({
131
- field: `${C}${n}`,
130
+ }, [V, q]), Qe = ie(A), $e = ae(j), Q = (ve ?? []).map(([e, t], n) => ({
131
+ field: `${w}${n}`,
132
132
  current: e,
133
133
  comparison: t
134
- })), $ = Q.length > 0, $e = Xe ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
134
+ })), $ = Q.length > 0, et = Ze ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
135
135
  active: e.active,
136
136
  label: e.label,
137
- payload: c(w(e.payload))
138
- })) : /* @__PURE__ */ g(o, {})), et = $ || q ? ((e) => /* @__PURE__ */ g(i, {
137
+ payload: l(T(e.payload))
138
+ })) : /* @__PURE__ */ g(o, {})), tt = $ || q ? ((e) => /* @__PURE__ */ g(i, {
139
139
  verticalAlign: e.verticalAlign,
140
- payload: c(w(e.payload))
141
- })) : /* @__PURE__ */ g(i, {}), tt = Q.length ? Y.map((e) => {
140
+ payload: l(T(e.payload))
141
+ })) : /* @__PURE__ */ g(i, {}), nt = Q.length ? Y.map((e) => {
142
142
  let t = { ...e };
143
143
  for (let { field: n, current: r, comparison: i } of Q) {
144
144
  let a = e[r], o = e[i];
145
145
  t[n] = typeof a == "number" && typeof o == "number" ? [Math.min(a, o), Math.max(a, o)] : void 0;
146
146
  }
147
147
  return t;
148
- }) : Y, nt = Q.length > 0 ? ue : fe;
148
+ }) : Y, rt = Q.length > 0 ? y : de;
149
149
  return /* @__PURE__ */ g("div", {
150
150
  ref: Ge,
151
- "data-curve": j,
152
- "data-line-style": M,
153
- className: e(S({
154
- curve: j,
155
- lineStyle: M
151
+ "data-curve": M,
152
+ "data-line-style": N,
153
+ className: e(C({
154
+ curve: M,
155
+ lineStyle: N
156
156
  }), t),
157
157
  ...We,
158
158
  children: /* @__PURE__ */ g(n, {
159
159
  config: h,
160
- palette: b,
160
+ palette: x,
161
161
  className: "size-full [&_.recharts-label]:fill-foreground",
162
- children: /* @__PURE__ */ _(nt, {
163
- data: tt,
164
- margin: Ye ? s : void 0,
162
+ children: /* @__PURE__ */ _(rt, {
163
+ data: nt,
164
+ margin: Ye ? c : void 0,
165
165
  children: [
166
- Ce && /* @__PURE__ */ g(le, {
166
+ we && /* @__PURE__ */ g(v, {
167
167
  horizontal: Ne ?? !0,
168
168
  vertical: Pe ?? !1,
169
169
  strokeDasharray: Me ? "3 3" : void 0
170
170
  }),
171
171
  /* @__PURE__ */ g(me, {
172
- dataKey: O,
172
+ dataKey: k,
173
173
  type: "category",
174
- hide: !Ee,
174
+ hide: !De,
175
175
  tickLine: !1,
176
176
  axisLine: !1,
177
177
  tickMargin: 8,
178
178
  tickFormatter: J ? void 0 : R,
179
179
  tick: J,
180
180
  angle: z,
181
- interval: ke,
182
- textAnchor: te(z),
183
- height: G,
184
- label: Ze
181
+ interval: Ae,
182
+ textAnchor: ne(z),
183
+ height: Xe,
184
+ label: Qe
185
185
  }),
186
186
  /* @__PURE__ */ g(he, {
187
187
  type: "number",
188
- hide: !De,
188
+ hide: !Oe,
189
189
  tickLine: !1,
190
190
  axisLine: !1,
191
191
  unit: ye,
192
- tickFormatter: Oe,
193
- tickCount: Ae,
192
+ tickFormatter: ke,
193
+ tickCount: je,
194
194
  domain: qe,
195
- width: A ? 72 : void 0,
196
- label: Qe
195
+ width: j ? 72 : void 0,
196
+ label: $e
197
197
  }),
198
- we && /* @__PURE__ */ g(a, { content: $e }),
199
- Te && /* @__PURE__ */ g(r, { content: et }),
198
+ Te && /* @__PURE__ */ g(a, { content: et }),
199
+ Ee && /* @__PURE__ */ g(r, { content: tt }),
200
200
  q && X != null && /* @__PURE__ */ g(ge, {
201
201
  projectionStart: L,
202
202
  prevTick: X,
203
203
  clipId: Z,
204
- dataKeys: E
204
+ dataKeys: D
205
205
  }),
206
- Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(se, {
206
+ Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(ce, {
207
207
  dataKey: e,
208
- type: W(t),
208
+ type: G(t),
209
209
  stroke: "none",
210
- fill: U(t),
210
+ fill: W(t),
211
211
  fillOpacity: .12,
212
212
  connectNulls: F,
213
213
  dot: !1,
214
214
  activeDot: !1,
215
215
  clipPath: q ? `url(#${Z}-actual)` : void 0,
216
- ...H,
216
+ ...U,
217
217
  legendType: "none",
218
218
  tooltipType: "none"
219
219
  }, e)),
220
- E.map((e, t) => {
221
- let n = D?.includes(e), r = I?.[e], i = !n && (r?.showDots ?? P), a = r?.dotSize ?? be, o = !n && (xe ?? i), s = r?.dashed ?? M === "dashed", c = r?.showLabel ?? V, l = r?.labelPosition ?? Ke;
222
- return /* @__PURE__ */ g(v, {
220
+ D.map((e, t) => {
221
+ let n = O?.includes(e), r = I?.[e], i = !n && (r?.showDots ?? be), a = r?.dotSize ?? xe, o = !n && (Se ?? i), s = r?.dashed ?? N === "dashed", c = r?.showLabel ?? H, l = r?.labelPosition ?? Ke;
222
+ return /* @__PURE__ */ g(b, {
223
223
  className: q && !n ? `actual-${Z}-${t}` : void 0,
224
- type: W(e),
224
+ type: G(e),
225
225
  dataKey: e,
226
- stroke: U(e),
227
- strokeWidth: r?.strokeWidth ?? N,
226
+ stroke: W(e),
227
+ strokeWidth: r?.strokeWidth ?? P,
228
228
  strokeDasharray: n || s ? "5 5" : void 0,
229
229
  strokeOpacity: n ? .5 : void 0,
230
230
  dot: i ? { r: a } : !1,
231
231
  activeDot: o ? { r: a + 2 } : !1,
232
232
  connectNulls: F,
233
- ...H,
234
- children: c && /* @__PURE__ */ g(de, {
233
+ ...U,
234
+ children: c && /* @__PURE__ */ g(ue, {
235
235
  dataKey: e,
236
236
  position: l,
237
- formatter: ae(Be),
238
- className: p(l),
237
+ formatter: oe(Be),
238
+ className: ee(l),
239
239
  fontSize: 12
240
240
  })
241
241
  }, e);
242
242
  }),
243
- q && E.map((e, t) => {
244
- if (D?.includes(e)) return null;
243
+ q && D.map((e, t) => {
244
+ if (O?.includes(e)) return null;
245
245
  let n = I?.[e];
246
- return /* @__PURE__ */ g(v, {
246
+ return /* @__PURE__ */ g(b, {
247
247
  className: `proj-${Z}-${t}`,
248
- type: W(e),
248
+ type: G(e),
249
249
  dataKey: `_proj_${e}`,
250
250
  name: e,
251
- stroke: U(e),
252
- strokeWidth: n?.strokeWidth ?? N,
251
+ stroke: W(e),
252
+ strokeWidth: n?.strokeWidth ?? P,
253
253
  strokeDasharray: "5 5",
254
254
  dot: !1,
255
255
  activeDot: !1,
256
256
  legendType: "none",
257
257
  tooltipType: "none",
258
- ...H
258
+ ...U
259
259
  }, `_proj_${e}`);
260
260
  }),
261
261
  Je.map((e, t) => {
262
- let n = f(e, x, E);
263
- return n === void 0 ? null : /* @__PURE__ */ g(y, {
262
+ let n = p(e, S, D);
263
+ return n === void 0 ? null : /* @__PURE__ */ g(fe, {
264
264
  y: n,
265
- ...ee(e.label, e.labelPosition)
265
+ ...te(e.label, e.labelPosition)
266
266
  }, `${e.label ?? "ref"}-${t}`);
267
267
  }),
268
- Ve && /* @__PURE__ */ g(ce, {
269
- dataKey: O,
268
+ Ve && /* @__PURE__ */ g(le, {
269
+ dataKey: k,
270
270
  tickFormatter: R,
271
- ...d({
271
+ ...f({
272
272
  brushHeight: He,
273
273
  brushAriaLabel: Ue
274
274
  })
@@ -278,8 +278,8 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
278
278
  })
279
279
  });
280
280
  });
281
- E.displayName = "LineChart";
281
+ D.displayName = "LineChart";
282
282
  //#endregion
283
- export { E as LineChart, T as createBandStrippedTooltip, w as dropBandSeries, S as lineChartVariants };
283
+ export { D as LineChart, E as createBandStrippedTooltip, T as dropBandSeries, C as lineChartVariants };
284
284
 
285
285
  //# sourceMappingURL=line-chart.js.map