@acronis-platform/ui-react 0.58.0 → 0.60.0

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 (73) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +91 -63
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +104 -73
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/calendar/calendar.js +17 -15
  6. package/dist/components/ui/calendar/calendar.js.map +1 -1
  7. package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
  8. package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
  9. package/dist/components/ui/category-bar/category-bar.js +126 -0
  10. package/dist/components/ui/category-bar/category-bar.js.map +1 -0
  11. package/dist/components/ui/chart/chart-format.js +40 -0
  12. package/dist/components/ui/chart/chart-format.js.map +1 -0
  13. package/dist/components/ui/chart/chart.js.map +1 -1
  14. package/dist/components/ui/composed-chart/composed-chart.js +91 -63
  15. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  16. package/dist/components/ui/confidence-cone/confidence-cone.js +113 -85
  17. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  18. package/dist/components/ui/dialog/dialog.js +29 -29
  19. package/dist/components/ui/dialog/dialog.js.map +1 -1
  20. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
  21. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
  22. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
  23. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
  24. package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
  25. package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
  26. package/dist/components/ui/histogram/histogram.js +89 -61
  27. package/dist/components/ui/histogram/histogram.js.map +1 -1
  28. package/dist/components/ui/input/input.js.map +1 -1
  29. package/dist/components/ui/line-chart/line-chart.js +120 -92
  30. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  31. package/dist/components/ui/sankey-chart/sankey-chart.js +192 -0
  32. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
  33. package/dist/components/ui/scatter-chart/scatter-chart.js +79 -51
  34. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  35. package/dist/components/ui/toolbar/toolbar.js +82 -92
  36. package/dist/components/ui/toolbar/toolbar.js.map +1 -1
  37. package/dist/index.js +461 -439
  38. package/dist/index.js.map +1 -1
  39. package/dist/lib/breakpoints.js +9 -6
  40. package/dist/lib/breakpoints.js.map +1 -1
  41. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
  42. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
  43. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
  44. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
  45. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
  46. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
  47. package/dist/react.js +461 -439
  48. package/dist/react.js.map +1 -1
  49. package/dist/src/components/ui/area-chart/area-chart.d.ts +2 -17
  50. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +2 -17
  51. package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
  52. package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
  53. package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
  54. package/dist/src/components/ui/category-bar/index.d.ts +1 -0
  55. package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
  56. package/dist/src/components/ui/chart/chart-format.d.ts +111 -0
  57. package/dist/src/components/ui/chart/chart.d.ts +2 -0
  58. package/dist/src/components/ui/chart/index.d.ts +3 -1
  59. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +2 -17
  60. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +2 -19
  61. package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
  62. package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
  63. package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
  64. package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
  65. package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
  66. package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
  67. package/dist/src/components/ui/line-chart/line-chart.d.ts +2 -17
  68. package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
  69. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
  70. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
  71. package/dist/src/index.d.ts +5 -0
  72. package/dist/ui-react.css +1 -1
  73. package/package.json +5 -4
@@ -1,10 +1,11 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { cva as R } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { AreaChart as V, CartesianGrid as k, XAxis as w, YAxis as z, Area as B } from "recharts";
5
- import { cn as K } from "../../../lib/utils.js";
6
- import { ChartContainer as M, ChartTooltip as S, ChartTooltipContent as X, ChartLegend as Y, ChartLegendContent as _ } from "../chart/chart.js";
7
- const b = R("", {
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { cva as Y } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { AreaChart as _, CartesianGrid as q, XAxis as E, YAxis as J, Area as P } from "recharts";
5
+ import { cn as Q } from "../../../lib/utils.js";
6
+ import { ChartContainer as U, ChartTooltip as W, ChartTooltipContent as Z, ChartLegend as b, ChartLegendContent as tt } from "../chart/chart.js";
7
+ import { resolveAxisDomain as at } from "../chart/chart-format.js";
8
+ const et = Y("", {
8
9
  variants: {
9
10
  layout: {
10
11
  single: "",
@@ -19,53 +20,64 @@ const b = R("", {
19
20
  layout: "single",
20
21
  fill: "gradient"
21
22
  }
22
- }), q = f.forwardRef(
23
+ }), rt = m.forwardRef(
23
24
  ({
24
25
  className: p,
25
- config: m,
26
- data: h,
27
- dataKeys: s,
28
- xKey: g,
29
- xAxisLabel: e,
30
- yAxisLabel: r,
31
- yUnit: v,
26
+ config: h,
27
+ data: u,
28
+ dataKeys: l,
29
+ xKey: v,
30
+ xAxisLabel: r,
31
+ yAxisLabel: o,
32
+ yUnit: C,
32
33
  layout: i = "single",
33
- fill: o = "gradient",
34
- curve: C = "monotone",
35
- strokeWidth: u = 2,
36
- fillOpacity: $ = 0.4,
37
- showDots: l = !1,
38
- connectNulls: A = !1,
39
- showGrid: x = !0,
40
- showTooltip: y = !0,
41
- showLegend: T = !0,
42
- tooltipContent: G,
43
- ...I
44
- }, L) => {
45
- const N = i === "stacked", n = o === "gradient", O = e ? { value: e, position: "insideBottom", offset: 0 } : void 0, j = r ? {
46
- value: r,
34
+ fill: n = "gradient",
35
+ curve: g = "monotone",
36
+ strokeWidth: $ = 2,
37
+ fillOpacity: y = 0.4,
38
+ showDots: d = !1,
39
+ connectNulls: k = !1,
40
+ showGrid: T = !0,
41
+ showTooltip: D = !0,
42
+ showLegend: G = !0,
43
+ showXAxis: I = !0,
44
+ showYAxis: N = !0,
45
+ xTickFormatter: O,
46
+ yTickFormatter: j,
47
+ xAxisAngle: e,
48
+ xAxisInterval: z,
49
+ yAxisTickCount: A,
50
+ yAxisDomain: F,
51
+ gridDashed: L,
52
+ gridHorizontal: R,
53
+ gridVertical: V,
54
+ tooltipContent: w,
55
+ ...x
56
+ }, B) => {
57
+ const H = i === "stacked", s = n === "gradient", K = r ? { value: r, position: "insideBottom", offset: 0 } : void 0, M = o ? {
58
+ value: o,
47
59
  angle: -90,
48
60
  position: "insideLeft",
49
61
  style: { textAnchor: "middle" }
50
- } : void 0, d = `area-gradient-${f.useId().replace(/:/g, "")}`;
62
+ } : void 0, S = at(F), X = r || e != null ? 30 + (e != null ? 20 : 0) + (r ? 18 : 0) : void 0, c = `area-gradient-${m.useId().replace(/:/g, "")}`;
51
63
  return /* @__PURE__ */ t(
52
64
  "div",
53
65
  {
54
- ref: L,
66
+ ref: B,
55
67
  "data-layout": i,
56
- "data-fill": o,
57
- className: K(b({ layout: i, fill: o }), p),
58
- ...I,
68
+ "data-fill": n,
69
+ className: Q(et({ layout: i, fill: n }), p),
70
+ ...x,
59
71
  children: /* @__PURE__ */ t(
60
- M,
72
+ U,
61
73
  {
62
- config: m,
74
+ config: h,
63
75
  className: "size-full [&_.recharts-label]:fill-foreground",
64
- children: /* @__PURE__ */ c(V, { data: h, children: [
65
- n && /* @__PURE__ */ t("defs", { children: s.map((a) => /* @__PURE__ */ c(
76
+ children: /* @__PURE__ */ f(_, { data: u, children: [
77
+ s && /* @__PURE__ */ t("defs", { children: l.map((a) => /* @__PURE__ */ f(
66
78
  "linearGradient",
67
79
  {
68
- id: `${d}-${a}`,
80
+ id: `${c}-${a}`,
69
81
  x1: "0",
70
82
  y1: "0",
71
83
  x2: "0",
@@ -91,45 +103,61 @@ const b = R("", {
91
103
  },
92
104
  a
93
105
  )) }),
94
- x && /* @__PURE__ */ t(k, { vertical: !1 }),
106
+ T && /* @__PURE__ */ t(
107
+ q,
108
+ {
109
+ horizontal: R ?? !0,
110
+ vertical: V ?? !1,
111
+ strokeDasharray: L ? "3 3" : void 0
112
+ }
113
+ ),
95
114
  /* @__PURE__ */ t(
96
- w,
115
+ E,
97
116
  {
98
- dataKey: g,
117
+ dataKey: v,
99
118
  type: "category",
119
+ hide: !I,
100
120
  tickLine: !1,
101
121
  axisLine: !1,
102
122
  tickMargin: 8,
103
- height: e ? 48 : void 0,
104
- label: O
123
+ tickFormatter: O,
124
+ angle: e,
125
+ interval: z,
126
+ textAnchor: e != null ? e < 0 ? "end" : "start" : void 0,
127
+ height: X,
128
+ label: K
105
129
  }
106
130
  ),
107
131
  /* @__PURE__ */ t(
108
- z,
132
+ J,
109
133
  {
110
134
  type: "number",
135
+ hide: !N,
111
136
  tickLine: !1,
112
137
  axisLine: !1,
113
- unit: v,
114
- width: r ? 72 : void 0,
115
- label: j
138
+ unit: C,
139
+ tickFormatter: j,
140
+ tickCount: A,
141
+ domain: S,
142
+ width: o ? 72 : void 0,
143
+ label: M
116
144
  }
117
145
  ),
118
- y && /* @__PURE__ */ t(S, { content: G ?? /* @__PURE__ */ t(X, {}) }),
119
- T && /* @__PURE__ */ t(Y, { content: /* @__PURE__ */ t(_, {}) }),
120
- s.map((a) => /* @__PURE__ */ t(
121
- B,
146
+ D && /* @__PURE__ */ t(W, { content: w ?? /* @__PURE__ */ t(Z, {}) }),
147
+ G && /* @__PURE__ */ t(b, { content: /* @__PURE__ */ t(tt, {}) }),
148
+ l.map((a) => /* @__PURE__ */ t(
149
+ P,
122
150
  {
123
- type: C ?? "monotone",
151
+ type: g ?? "monotone",
124
152
  dataKey: a,
125
- stackId: N ? "a" : void 0,
153
+ stackId: H ? "a" : void 0,
126
154
  stroke: `var(--color-${a})`,
127
- strokeWidth: u,
128
- fill: n ? `url(#${d}-${a})` : `var(--color-${a})`,
129
- fillOpacity: n ? 1 : $,
130
- dot: l ? { r: 3 } : !1,
131
- activeDot: l ? { r: 5 } : !1,
132
- connectNulls: A,
155
+ strokeWidth: $,
156
+ fill: s ? `url(#${c}-${a})` : `var(--color-${a})`,
157
+ fillOpacity: s ? 1 : y,
158
+ dot: d ? { r: 3 } : !1,
159
+ activeDot: d ? { r: 5 } : !1,
160
+ connectNulls: k,
133
161
  isAnimationActive: !1
134
162
  },
135
163
  a
@@ -141,9 +169,9 @@ const b = R("", {
141
169
  );
142
170
  }
143
171
  );
144
- q.displayName = "AreaChart";
172
+ rt.displayName = "AreaChart";
145
173
  export {
146
- q as AreaChart,
147
- b as areaChartVariants
174
+ rt as AreaChart,
175
+ et as areaChartVariants
148
176
  };
149
177
  //# sourceMappingURL=area-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"area-chart.js","sources":["../../../../src/components/ui/area-chart/area-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n AreaChart as RechartsAreaChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Area-chart variant set: `layout` (independent\n// overlapping areas vs summed on a shared stack) and `fill` (a flat translucent\n// fill vs a vertical gradient). The classes stay empty because recharts' SVG —\n// not CSS — draws the areas: `layout` drives each `<Area>`'s `stackId` and `fill`\n// drives whether it paints from a `<linearGradient>` def or a flat token color.\n// CVA is kept so the variant set is a first-class, spec-conformant part of the\n// API (matched against ui-spec's api.yaml enums) and exposed via `VariantProps`;\n// the resolved values are also mirrored onto `data-layout` / `data-fill`.\nconst areaChartVariants = cva('', {\n variants: {\n layout: {\n single: '',\n stacked: '',\n },\n fill: {\n solid: '',\n gradient: '',\n },\n },\n defaultVariants: {\n layout: 'single',\n fill: 'gradient',\n },\n});\n\nexport interface AreaChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof areaChartVariants> {\n /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Area>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix appended to Y-axis tick values (recharts `unit`; the X axis is categorical). */\n yUnit?: string;\n /** Interpolation between points. */\n curve?: 'linear' | 'monotone' | 'step';\n /** Stroke width of each area's top border. */\n strokeWidth?: number;\n /** Flat-fill opacity — used only when `fill=\"solid\"` (gradient controls its own stops). */\n fillOpacity?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the area. */\n connectNulls?: boolean;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n layout = 'single',\n fill = 'gradient',\n curve = 'monotone',\n strokeWidth = 2,\n fillOpacity = 0.4,\n showDots = false,\n connectNulls = false,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n const isStacked = layout === 'stacked';\n const isGradient = fill === 'gradient';\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // recharts renders SVG <defs> once per chart; the gradient ids must be unique\n // across chart instances on the page. useId gives a stable per-instance id;\n // strip the colons React emits (invalid in a url(#…) reference) — same guard\n // the shared ChartContainer applies to its chart id.\n const gradientId = `area-gradient-${React.useId().replace(/:/g, '')}`;\n\n return (\n <div\n ref={ref}\n data-layout={layout}\n data-fill={fill}\n className={cn(areaChartVariants({ layout, fill }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsAreaChart data={data as readonly unknown[]}>\n {isGradient && (\n <defs>\n {dataKeys.map((key) => (\n <linearGradient\n key={key}\n id={`${gradientId}-${key}`}\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop\n offset=\"5%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.8}\n />\n <stop\n offset=\"95%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.1}\n />\n </linearGradient>\n ))}\n </defs>\n )}\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key) => (\n <Area\n key={key}\n type={curve ?? 'monotone'}\n dataKey={key}\n stackId={isStacked ? 'a' : undefined}\n stroke={`var(--color-${key})`}\n strokeWidth={strokeWidth}\n fill={isGradient ? `url(#${gradientId}-${key})` : `var(--color-${key})`}\n fillOpacity={isGradient ? 1 : fillOpacity}\n dot={showDots ? { r: 3 } : false}\n activeDot={showDots ? { r: 5 } : false}\n connectNulls={connectNulls}\n isAnimationActive={false}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n </div>\n );\n }\n);\nAreaChart.displayName = 'AreaChart';\n\nexport { AreaChart, areaChartVariants };\n"],"names":["areaChartVariants","cva","AreaChart","React","className","config","data","dataKeys","xKey","xAxisLabel","yAxisLabel","yUnit","layout","fill","curve","strokeWidth","fillOpacity","showDots","connectNulls","showGrid","showTooltip","showLegend","tooltipContent","props","ref","isStacked","isGradient","xAxisTitle","yAxisTitle","gradientId","jsx","cn","ChartContainer","jsxs","RechartsAreaChart","key","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","Area"],"mappings":";;;;;;AA+BA,MAAMA,IAAoBC,EAAI,IAAI;AAAA,EAChC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAEV,CAAC,GA6CKC,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,aAAAC,IA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E,GAAG,MAAM;AAAA,kBAC3B,WAAWA,IAAW,EAAE,GAAG,MAAM;AAAA,kBACjC,cAAAC;AAAA,kBACA,mBAAmB;AAAA,gBAAA;AAAA,gBAXdiB;AAAA,cAAA,CAaR;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAjC,EAAU,cAAc;"}
1
+ {"version":3,"file":"area-chart.js","sources":["../../../../src/components/ui/area-chart/area-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n AreaChart as RechartsAreaChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAxisDomain,\n type ChartConfig,\n type CartesianChartProps,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Area-chart variant set: `layout` (independent\n// overlapping areas vs summed on a shared stack) and `fill` (a flat translucent\n// fill vs a vertical gradient). The classes stay empty because recharts' SVG —\n// not CSS — draws the areas: `layout` drives each `<Area>`'s `stackId` and `fill`\n// drives whether it paints from a `<linearGradient>` def or a flat token color.\n// CVA is kept so the variant set is a first-class, spec-conformant part of the\n// API (matched against ui-spec's api.yaml enums) and exposed via `VariantProps`;\n// the resolved values are also mirrored onto `data-layout` / `data-fill`.\nconst areaChartVariants = cva('', {\n variants: {\n layout: {\n single: '',\n stacked: '',\n },\n fill: {\n solid: '',\n gradient: '',\n },\n },\n defaultVariants: {\n layout: 'single',\n fill: 'gradient',\n },\n});\n\nexport interface AreaChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof areaChartVariants>,\n CartesianChartProps {\n /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the area unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Area>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Interpolation between points. */\n curve?: 'linear' | 'monotone' | 'step';\n /** Stroke width of each area's top border. */\n strokeWidth?: number;\n /** Flat-fill opacity — used only when `fill=\"solid\"` (gradient controls its own stops). */\n fillOpacity?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the area. */\n connectNulls?: boolean;\n showLegend?: boolean;\n}\n\nconst AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n layout = 'single',\n fill = 'gradient',\n curve = 'monotone',\n strokeWidth = 2,\n fillOpacity = 0.4,\n showDots = false,\n connectNulls = false,\n showGrid = true,\n showTooltip = true,\n showLegend = 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 ...props\n },\n ref\n ) => {\n const isStacked = layout === 'stacked';\n const isGradient = fill === 'gradient';\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n // Room for the X tick row: recharts' default 30, plus a rotated tick row\n // (+20) and/or the axis title (+18). Additive — both can be present at once,\n // which the old label-or-angle ternary under-allocated.\n const xAxisHeight =\n xAxisLabel || xAxisAngle != null\n ? 30 + (xAxisAngle != null ? 20 : 0) + (xAxisLabel ? 18 : 0)\n : undefined;\n\n // recharts renders SVG <defs> once per chart; the gradient ids must be unique\n // across chart instances on the page. useId gives a stable per-instance id;\n // strip the colons React emits (invalid in a url(#…) reference) — same guard\n // the shared ChartContainer applies to its chart id.\n const gradientId = `area-gradient-${React.useId().replace(/:/g, '')}`;\n\n return (\n <div\n ref={ref}\n data-layout={layout}\n data-fill={fill}\n className={cn(areaChartVariants({ layout, fill }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsAreaChart data={data as readonly unknown[]}>\n {isGradient && (\n <defs>\n {dataKeys.map((key) => (\n <linearGradient\n key={key}\n id={`${gradientId}-${key}`}\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <stop\n offset=\"5%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.8}\n />\n <stop\n offset=\"95%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.1}\n />\n </linearGradient>\n ))}\n </defs>\n )}\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={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 {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key) => (\n <Area\n key={key}\n type={curve ?? 'monotone'}\n dataKey={key}\n stackId={isStacked ? 'a' : undefined}\n stroke={`var(--color-${key})`}\n strokeWidth={strokeWidth}\n fill={isGradient ? `url(#${gradientId}-${key})` : `var(--color-${key})`}\n fillOpacity={isGradient ? 1 : fillOpacity}\n dot={showDots ? { r: 3 } : false}\n activeDot={showDots ? { r: 5 } : false}\n connectNulls={connectNulls}\n isAnimationActive={false}\n />\n ))}\n </RechartsAreaChart>\n </ChartContainer>\n </div>\n );\n }\n);\nAreaChart.displayName = 'AreaChart';\n\nexport { AreaChart, areaChartVariants };\n"],"names":["areaChartVariants","cva","AreaChart","React","className","config","data","dataKeys","xKey","xAxisLabel","yAxisLabel","yUnit","layout","fill","curve","strokeWidth","fillOpacity","showDots","connectNulls","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","props","ref","isStacked","isGradient","xAxisTitle","yAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","gradientId","jsx","cn","ChartContainer","jsxs","RechartsAreaChart","key","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","Area"],"mappings":";;;;;;;AAiCA,MAAMA,KAAoBC,EAAI,IAAI;AAAA,EAChC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,MAAM;AA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U,cAAc;"}
@@ -1,10 +1,11 @@
1
- import { jsx as t, jsxs as p, Fragment as C } from "react/jsx-runtime";
2
- import * as R from "react";
3
- import { cva as S } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { BarChart as F, CartesianGrid as G, XAxis as z, YAxis as k, Bar as I, ReferenceLine as M } from "recharts";
5
- import { cn as O } from "../../../lib/utils.js";
6
- import { ChartContainer as X, ChartTooltip as Y, ChartTooltipContent as _, ChartLegend as q, ChartLegendContent as E } from "../chart/chart.js";
7
- const H = S("", {
1
+ import { jsx as t, jsxs as p, Fragment as V } from "react/jsx-runtime";
2
+ import * as Q from "react";
3
+ import { cva as U } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { BarChart as W, CartesianGrid as X, XAxis as j, YAxis as w, Bar as Y, ReferenceLine as Z } from "recharts";
5
+ import { cn as x } from "../../../lib/utils.js";
6
+ import { ChartContainer as A, ChartTooltip as tt, ChartTooltipContent as at, ChartLegend as rt, ChartLegendContent as et } from "../chart/chart.js";
7
+ import { resolveAxisDomain as ot } from "../chart/chart-format.js";
8
+ const it = U("", {
8
9
  variants: {
9
10
  orientation: {
10
11
  vertical: "",
@@ -20,138 +21,168 @@ const H = S("", {
20
21
  layout: "grouped"
21
22
  }
22
23
  });
23
- function J(e, h, d) {
24
+ function nt(e, v, u) {
24
25
  if (!e) return;
25
26
  if (typeof e.value == "number") return e.value;
26
27
  if (!e.average) return;
27
- const n = typeof e.average == "string" ? [e.average] : d, l = h.flatMap(
28
- (o) => n.map((a) => o[a]).filter((a) => typeof a == "number")
28
+ const s = typeof e.average == "string" ? [e.average] : u, l = v.flatMap(
29
+ (o) => s.map((a) => o[a]).filter((a) => typeof a == "number")
29
30
  );
30
31
  if (l.length !== 0)
31
32
  return l.reduce((o, a) => o + a, 0) / l.length;
32
33
  }
33
- const K = R.forwardRef(
34
+ const lt = Q.forwardRef(
34
35
  ({
35
36
  className: e,
36
- config: h,
37
- data: d,
38
- dataKeys: n,
37
+ config: v,
38
+ data: u,
39
+ dataKeys: s,
39
40
  xKey: l,
40
41
  referenceLine: o,
41
42
  xAxisLabel: a,
42
- yAxisLabel: u,
43
- xUnit: x,
44
- yUnit: B,
43
+ yAxisLabel: h,
44
+ xUnit: R,
45
+ yUnit: S,
45
46
  orientation: r = "vertical",
46
47
  layout: f = "grouped",
47
- barRadius: s = 4,
48
- showGrid: b = !0,
49
- showTooltip: T = !0,
50
- showLegend: w = !0,
51
- tooltipContent: $,
52
- ...A
53
- }, N) => {
54
- const V = r === "horizontal" ? "vertical" : "horizontal", m = f === "stacked", j = o ? Array.isArray(o) ? o : [o] : [], g = a ? { value: a, position: "insideBottom", offset: 0 } : void 0, y = u ? {
55
- value: u,
48
+ barRadius: d = 4,
49
+ showGrid: T = !0,
50
+ showTooltip: G = !0,
51
+ showLegend: H = !0,
52
+ showXAxis: y = !0,
53
+ showYAxis: g = !0,
54
+ xTickFormatter: C,
55
+ yTickFormatter: k,
56
+ xAxisAngle: i,
57
+ xAxisInterval: z,
58
+ yAxisTickCount: B,
59
+ yAxisDomain: M,
60
+ gridDashed: O,
61
+ gridHorizontal: _,
62
+ gridVertical: q,
63
+ tooltipContent: E,
64
+ ...I
65
+ }, J) => {
66
+ const K = r === "horizontal" ? "vertical" : "horizontal", b = f === "stacked", L = o ? Array.isArray(o) ? o : [o] : [], D = a ? { value: a, position: "insideBottom", offset: 0 } : void 0, $ = h ? {
67
+ value: h,
56
68
  angle: -90,
57
69
  position: "insideLeft",
58
70
  style: { textAnchor: "middle" }
59
- } : void 0, D = r === "horizontal" ? [0, s, s, 0] : [s, s, 0, 0];
71
+ } : void 0, F = ot(M), N = a || i != null ? 30 + (i != null ? 20 : 0) + (a ? 18 : 0) : void 0, P = r === "horizontal" ? [0, d, d, 0] : [d, d, 0, 0];
60
72
  return /* @__PURE__ */ t(
61
73
  "div",
62
74
  {
63
- ref: N,
75
+ ref: J,
64
76
  "data-orientation": r,
65
77
  "data-layout": f,
66
- className: O(H({ orientation: r, layout: f }), e),
67
- ...A,
78
+ className: x(it({ orientation: r, layout: f }), e),
79
+ ...I,
68
80
  children: /* @__PURE__ */ t(
69
- X,
81
+ A,
70
82
  {
71
- config: h,
83
+ config: v,
72
84
  className: "size-full [&_.recharts-label]:fill-foreground",
73
- children: /* @__PURE__ */ p(F, { data: d, layout: V, children: [
74
- b && /* @__PURE__ */ t(
75
- G,
85
+ children: /* @__PURE__ */ p(W, { data: u, layout: K, children: [
86
+ T && /* @__PURE__ */ t(
87
+ X,
76
88
  {
77
- horizontal: r === "vertical",
78
- vertical: r === "horizontal"
89
+ horizontal: _ ?? r === "vertical",
90
+ vertical: q ?? r === "horizontal",
91
+ strokeDasharray: O ? "3 3" : void 0
79
92
  }
80
93
  ),
81
- r === "horizontal" ? /* @__PURE__ */ p(C, { children: [
94
+ r === "horizontal" ? /* @__PURE__ */ p(V, { children: [
82
95
  /* @__PURE__ */ t(
83
- z,
96
+ j,
84
97
  {
85
98
  type: "number",
99
+ hide: !y,
86
100
  tickLine: !1,
87
101
  axisLine: !1,
88
- unit: x,
89
- height: a ? 48 : void 0,
90
- label: g
102
+ unit: R,
103
+ tickFormatter: C,
104
+ angle: i,
105
+ interval: z,
106
+ textAnchor: i != null ? i < 0 ? "end" : "start" : void 0,
107
+ tickCount: B,
108
+ domain: F,
109
+ height: N,
110
+ label: D
91
111
  }
92
112
  ),
93
113
  /* @__PURE__ */ t(
94
- k,
114
+ w,
95
115
  {
96
116
  dataKey: l,
97
117
  type: "category",
118
+ hide: !g,
98
119
  tickLine: !1,
99
120
  axisLine: !1,
100
- width: u ? 96 : 80,
101
- label: y
121
+ tickFormatter: k,
122
+ width: h ? 96 : 80,
123
+ label: $
102
124
  }
103
125
  )
104
- ] }) : /* @__PURE__ */ p(C, { children: [
126
+ ] }) : /* @__PURE__ */ p(V, { children: [
105
127
  /* @__PURE__ */ t(
106
- z,
128
+ j,
107
129
  {
108
130
  dataKey: l,
109
131
  type: "category",
132
+ hide: !y,
110
133
  tickLine: !1,
111
134
  axisLine: !1,
112
- height: a ? 48 : void 0,
113
- label: g
135
+ tickFormatter: C,
136
+ angle: i,
137
+ interval: z,
138
+ textAnchor: i != null ? i < 0 ? "end" : "start" : void 0,
139
+ height: N,
140
+ label: D
114
141
  }
115
142
  ),
116
143
  /* @__PURE__ */ t(
117
- k,
144
+ w,
118
145
  {
119
146
  type: "number",
147
+ hide: !g,
120
148
  tickLine: !1,
121
149
  axisLine: !1,
122
- unit: B,
123
- width: u ? 72 : void 0,
124
- label: y
150
+ unit: S,
151
+ tickFormatter: k,
152
+ tickCount: B,
153
+ domain: F,
154
+ width: h ? 72 : void 0,
155
+ label: $
125
156
  }
126
157
  )
127
158
  ] }),
128
- T && /* @__PURE__ */ t(Y, { content: $ ?? /* @__PURE__ */ t(_, {}) }),
129
- w && /* @__PURE__ */ t(q, { content: /* @__PURE__ */ t(E, {}) }),
130
- n.map((i, v) => {
131
- const c = m ? v === n.length - 1 : !0;
159
+ G && /* @__PURE__ */ t(tt, { content: E ?? /* @__PURE__ */ t(at, {}) }),
160
+ H && /* @__PURE__ */ t(rt, { content: /* @__PURE__ */ t(et, {}) }),
161
+ s.map((n, m) => {
162
+ const c = b ? m === s.length - 1 : !0;
132
163
  return /* @__PURE__ */ t(
133
- I,
164
+ Y,
134
165
  {
135
- dataKey: i,
136
- fill: `var(--color-${i})`,
137
- stackId: m ? "a" : void 0,
138
- radius: s > 0 && c ? D : void 0,
166
+ dataKey: n,
167
+ fill: `var(--color-${n})`,
168
+ stackId: b ? "a" : void 0,
169
+ radius: d > 0 && c ? P : void 0,
139
170
  isAnimationActive: !1
140
171
  },
141
- i
172
+ n
142
173
  );
143
174
  }),
144
- j.map((i, v) => {
145
- const c = J(i, d, n);
175
+ L.map((n, m) => {
176
+ const c = nt(n, u, s);
146
177
  return c === void 0 ? null : /* @__PURE__ */ t(
147
- M,
178
+ Z,
148
179
  {
149
180
  ...r === "horizontal" ? { x: c } : { y: c },
150
181
  stroke: "var(--ui-text-on-surface-secondary)",
151
182
  strokeDasharray: "4 4",
152
183
  ifOverflow: "extendDomain",
153
- label: i.label ? {
154
- value: i.label,
184
+ label: n.label ? {
185
+ value: n.label,
155
186
  // Sit the caption at the top of the line: above the
156
187
  // right end of a horizontal line (vertical bars), or
157
188
  // above the top of a vertical line (horizontal bars).
@@ -160,7 +191,7 @@ const K = R.forwardRef(
160
191
  fontSize: 12
161
192
  } : void 0
162
193
  },
163
- `${i.label ?? "ref"}-${v}`
194
+ `${n.label ?? "ref"}-${m}`
164
195
  );
165
196
  })
166
197
  ] })
@@ -170,10 +201,10 @@ const K = R.forwardRef(
170
201
  );
171
202
  }
172
203
  );
173
- K.displayName = "BarChart";
204
+ lt.displayName = "BarChart";
174
205
  export {
175
- K as BarChart,
176
- J as barChartReferenceValue,
177
- H as barChartVariants
206
+ lt as BarChart,
207
+ nt as barChartReferenceValue,
208
+ it as barChartVariants
178
209
  };
179
210
  //# sourceMappingURL=bar-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\nexport interface BarChartReferenceLine {\n /** Fixed position on the value axis. Takes precedence over `average`. */\n value?: number;\n /**\n * Draw the line at the mean of one series (a `dataKeys` entry) or, when\n * `true`, of every plotted series' values.\n */\n average?: boolean | string;\n /** Optional caption rendered alongside the line. */\n label?: string;\n}\n\n/**\n * Resolve a `referenceLine` config to a position on the value axis: a fixed\n * `value` wins; otherwise the mean of the requested series (a single `dataKeys`\n * entry, or all of them when `average` is `true`). Returns `undefined` when\n * there is nothing to draw (no config, or no numeric values to average).\n * Exported for unit tests; not part of the package's public API.\n */\nexport function barChartReferenceValue(\n referenceLine: BarChartReferenceLine | undefined,\n data: ReadonlyArray<Record<string, string | number>>,\n dataKeys: string[]\n): number | undefined {\n if (!referenceLine) return undefined;\n if (typeof referenceLine.value === 'number') return referenceLine.value;\n if (!referenceLine.average) return undefined;\n\n const keys =\n typeof referenceLine.average === 'string'\n ? [referenceLine.average]\n : dataKeys;\n const nums = data.flatMap((row) =>\n keys\n .map((key) => row[key])\n .filter((value): value is number => typeof value === 'number')\n );\n if (nums.length === 0) return undefined;\n return nums.reduce((sum, n) => sum + n, 0) / nums.length;\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants> {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /**\n * One or more dashed reference/average lines on the value axis (Y for vertical\n * bars, X for horizontal). Each is driven by a fixed `value` or a computed\n * series `average`. Pass a single object or an array to draw several at once.\n */\n referenceLine?: BarChartReferenceLine | BarChartReferenceLine[];\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Unit suffix on Y-axis tick values (recharts `unit`) — applies when the Y axis is numeric (`orientation=\"vertical\"`). */\n yUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n\n const referenceLines = referenceLine\n ? Array.isArray(referenceLine)\n ? referenceLine\n : [referenceLine]\n : [];\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data as readonly unknown[]} layout={rechartsLayout}>\n {showGrid && (\n <CartesianGrid\n horizontal={orientation === 'vertical'}\n vertical={orientation === 'horizontal'}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n <XAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n )}\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n return (\n <Bar\n key={key}\n dataKey={key}\n fill={`var(--color-${key})`}\n stackId={isStacked ? 'a' : undefined}\n radius={barRadius > 0 && rounded ? endRadius : undefined}\n isAnimationActive={false}\n />\n );\n })}\n {referenceLines.map((ref, index) => {\n const value = barChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n // Draw on the value axis: Y for vertical bars, X for horizontal.\n {...(orientation === 'horizontal' ? { x: value } : { y: value })}\n stroke=\"var(--ui-text-on-surface-secondary)\"\n strokeDasharray=\"4 4\"\n // extendDomain so a target beyond the data max stays visible.\n ifOverflow=\"extendDomain\"\n label={\n ref.label\n ? {\n value: ref.label,\n // Sit the caption at the top of the line: above the\n // right end of a horizontal line (vertical bars), or\n // above the top of a vertical line (horizontal bars).\n position:\n orientation === 'horizontal'\n ? 'top'\n : 'insideTopRight',\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined\n }\n />\n );\n })}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","barChartReferenceValue","referenceLine","data","dataKeys","keys","nums","row","key","value","sum","n","BarChart","React","className","config","xKey","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","showGrid","showTooltip","showLegend","tooltipContent","props","ref","rechartsLayout","isStacked","referenceLines","xAxisTitle","yAxisTitle","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","index","rounded","Bar","ReferenceLine"],"mappings":";;;;;;AAgCA,MAAMA,IAAmBC,EAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA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ACP,iBAAgB;AAAA,oBAEhB,YAAW;AAAA,oBACX,OACEoB,EAAI,QACA;AAAA,sBACE,OAAOA,EAAI;AAAA;AAAA;AAAA;AAAA,sBAIX,UACER,MAAgB,eACZ,QACA;AAAA,sBACN,MAAM;AAAA,sBACN,UAAU;AAAA,oBAAA,IAEZ;AAAA,kBAAA;AAAA,kBArBD,GAAGQ,EAAI,SAAS,KAAK,IAAIoB,CAAK;AAAA,gBAAA;AAAA,cAyBzC,CAAC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACArC,EAAS,cAAc;"}
1
+ {"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAxisDomain,\n type ChartConfig,\n type CartesianChartProps,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\nexport interface BarChartReferenceLine {\n /** Fixed position on the value axis. Takes precedence over `average`. */\n value?: number;\n /**\n * Draw the line at the mean of one series (a `dataKeys` entry) or, when\n * `true`, of every plotted series' values.\n */\n average?: boolean | string;\n /** Optional caption rendered alongside the line. */\n label?: string;\n}\n\n/**\n * Resolve a `referenceLine` config to a position on the value axis: a fixed\n * `value` wins; otherwise the mean of the requested series (a single `dataKeys`\n * entry, or all of them when `average` is `true`). Returns `undefined` when\n * there is nothing to draw (no config, or no numeric values to average).\n * Exported for unit tests; not part of the package's public API.\n */\nexport function barChartReferenceValue(\n referenceLine: BarChartReferenceLine | undefined,\n data: ReadonlyArray<Record<string, string | number>>,\n dataKeys: string[]\n): number | undefined {\n if (!referenceLine) return undefined;\n if (typeof referenceLine.value === 'number') return referenceLine.value;\n if (!referenceLine.average) return undefined;\n\n const keys =\n typeof referenceLine.average === 'string'\n ? [referenceLine.average]\n : dataKeys;\n const nums = data.flatMap((row) =>\n keys\n .map((key) => row[key])\n .filter((value): value is number => typeof value === 'number')\n );\n if (nums.length === 0) return undefined;\n return nums.reduce((sum, n) => sum + n, 0) / nums.length;\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants>,\n CartesianChartProps {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /**\n * One or more dashed reference/average lines on the value axis (Y for vertical\n * bars, X for horizontal). Each is driven by a fixed `value` or a computed\n * series `average`. Pass a single object or an array to draw several at once.\n */\n referenceLine?: BarChartReferenceLine | BarChartReferenceLine[];\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showLegend?: boolean;\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n showGrid = true,\n showTooltip = true,\n showLegend = 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 ...props\n },\n ref\n ) => {\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n\n const referenceLines = referenceLine\n ? Array.isArray(referenceLine)\n ? referenceLine\n : [referenceLine]\n : [];\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n // Room for the X tick row: recharts' default 30, plus a rotated tick row\n // (+20) and/or the axis title (+18). Additive — both can be present at once,\n // which the old label-or-angle ternary under-allocated.\n const xAxisHeight =\n xAxisLabel || xAxisAngle != null\n ? 30 + (xAxisAngle != null ? 20 : 0) + (xAxisLabel ? 18 : 0)\n : undefined;\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data as readonly unknown[]} layout={rechartsLayout}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? orientation === 'vertical'}\n vertical={gridVertical ?? orientation === 'horizontal'}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n {/* Horizontal bars put the values on X, so the value-axis\n props (tickCount/domain) belong here — recharts ignores both\n on the category axis. */}\n <XAxis\n type=\"number\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n tickCount={yAxisTickCount}\n domain={yDomain}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={yTickFormatter}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n )}\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n return (\n <Bar\n key={key}\n dataKey={key}\n fill={`var(--color-${key})`}\n stackId={isStacked ? 'a' : undefined}\n radius={barRadius > 0 && rounded ? endRadius : undefined}\n isAnimationActive={false}\n />\n );\n })}\n {referenceLines.map((ref, index) => {\n const value = barChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n // Draw on the value axis: Y for vertical bars, X for horizontal.\n {...(orientation === 'horizontal' ? { x: value } : { y: value })}\n stroke=\"var(--ui-text-on-surface-secondary)\"\n strokeDasharray=\"4 4\"\n // extendDomain so a target beyond the data max stays visible.\n ifOverflow=\"extendDomain\"\n label={\n ref.label\n ? {\n value: ref.label,\n // Sit the caption at the top of the line: above the\n // right end of a horizontal line (vertical bars), or\n // above the top of a vertical line (horizontal bars).\n position:\n orientation === 'horizontal'\n ? 'top'\n : 'insideTopRight',\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined\n }\n />\n );\n })}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","barChartReferenceValue","referenceLine","data","dataKeys","keys","nums","row","key","value","sum","n","BarChart","React","className","config","xKey","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","props","ref","rechartsLayout","isStacked","referenceLines","xAxisTitle","yAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","index","rounded","Bar","ReferenceLine"],"mappings":";;;;;;;AAkCA,MAAMA,KAAmBC,EAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,EAAA;AAEZ,CAAC;AAqBM,SAASC,GACdC,GACAC,GACAC,GACoB;AACpB,MAAI,CAACF,EAAe;AACpB,MAAI,OAAOA,EAAc,SAAU,iBAAiBA,EAAc;AAClE,MAAI,CAACA,EAAc,QAAS;AAE5B,QAAMG,IACJ,OAAOH,EAAc,WAAY,WAC7B,CAACA,EAAc,OAAO,IACtBE,GACAE,IAAOH,EAAK;AAAA,IAAQ,CAACI,MACzBF,EACG,IAAI,CAACG,MAAQD,EAAIC,CAAG,CAAC,EACrB,OAAO,CAACC,MAA2B,OAAOA,KAAU,QAAQ;AAAA,EAAA;AAEjE,MAAIH,EAAK,WAAW;AACpB,WAAOA,EAAK,OAAO,CAACI,GAAKC,MAAMD,IAAMC,GAAG,CAAC,IAAIL,EAAK;AACpD;AA+BA,MAAMM,KAAWC,EAAM;AAAA,EACrB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAZ;AAAA,IACA,UAAAC;AAAA,IACA,MAAAY;AAAA,IACA,eAAAd;AAAA,IACA,YAAAe;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;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