@acronis-platform/ui-react 0.60.0 → 0.61.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 (83) hide show
  1. package/README.md +5 -5
  2. package/dist/components/ui/app-shell/app-shell.js.map +1 -1
  3. package/dist/components/ui/area-chart/area-chart.js +209 -146
  4. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  5. package/dist/components/ui/avatar/avatar.js +26 -23
  6. package/dist/components/ui/avatar/avatar.js.map +1 -1
  7. package/dist/components/ui/bar-chart/bar-chart.js +595 -180
  8. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  9. package/dist/components/ui/category-bar/category-bar.js +98 -77
  10. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  11. package/dist/components/ui/chart/chart-format.js +144 -14
  12. package/dist/components/ui/chart/chart-format.js.map +1 -1
  13. package/dist/components/ui/chart/chart.js +204 -150
  14. package/dist/components/ui/chart/chart.js.map +1 -1
  15. package/dist/components/ui/composed-chart/composed-chart.js +422 -125
  16. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  17. package/dist/components/ui/confidence-cone/confidence-cone.js +308 -202
  18. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  19. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  20. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  21. package/dist/components/ui/histogram/histogram.js +85 -81
  22. package/dist/components/ui/histogram/histogram.js.map +1 -1
  23. package/dist/components/ui/line-chart/line-chart.js +227 -184
  24. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  25. package/dist/components/ui/metric/metric.js +88 -70
  26. package/dist/components/ui/metric/metric.js.map +1 -1
  27. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  28. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  29. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  30. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  31. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  32. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  33. package/dist/components/ui/sankey-chart/sankey-chart.js +25 -18
  34. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  35. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -78
  36. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  37. package/dist/components/ui/timeline/timeline.js +206 -142
  38. package/dist/components/ui/timeline/timeline.js.map +1 -1
  39. package/dist/components/ui/treemap/treemap.js +183 -59
  40. package/dist/components/ui/treemap/treemap.js.map +1 -1
  41. package/dist/index.js +441 -421
  42. package/dist/index.js.map +1 -1
  43. package/dist/react.js +441 -421
  44. package/dist/react.js.map +1 -1
  45. package/dist/src/components/ui/area-chart/area-chart.d.ts +53 -3
  46. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  47. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  48. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +154 -16
  49. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  50. package/dist/src/components/ui/button/button.d.ts +1 -1
  51. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  52. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  53. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  54. package/dist/src/components/ui/chart/chart-format.d.ts +415 -0
  55. package/dist/src/components/ui/chart/chart.d.ts +9 -3
  56. package/dist/src/components/ui/chart/index.d.ts +2 -2
  57. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +156 -7
  58. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  59. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -20
  60. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  61. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  62. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  63. package/dist/src/components/ui/histogram/histogram.d.ts +2 -2
  64. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  65. package/dist/src/components/ui/line-chart/line-chart.d.ts +51 -3
  66. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  67. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  68. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  69. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  70. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  71. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  72. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -2
  73. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  74. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  75. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  76. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  77. package/dist/src/index.d.ts +0 -1
  78. package/dist/ui-react.css +1 -1
  79. package/package.json +3 -3
  80. package/dist/components/ui/search-global/search-global.js +0 -60
  81. package/dist/components/ui/search-global/search-global.js.map +0 -1
  82. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  83. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @acronis-platform/ui-react
2
2
 
3
- The next-generation Acronis React component library — a **Base UI**
4
- implementation, themed by [`@acronis-platform/tokens-pd`](../tokens-pd)
5
- (generated from [`@acronis-platform/design-tokens`](../design-tokens)).
3
+ The Acronis React component library — a **Base UI** implementation, themed by
4
+ [`@acronis-platform/tokens-pd`](../tokens-pd) (generated from
5
+ [`@acronis-platform/design-tokens`](../design-tokens)).
6
6
 
7
- > Early days: this package is being built out component by component. See
8
- > [`AGENTS.md`](./AGENTS.md) for conventions.
7
+ > This package is under active development toward v1 and grows component by
8
+ > component. See [`AGENTS.md`](./AGENTS.md) for conventions.
9
9
 
10
10
  ## Install
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.js","sources":["../../../../src/components/ui/app-shell/app-shell.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// The full-page application scaffold from the Figma App Shell (node 2782-1495):\n// a left sidebar column (holds SidebarPrimary, optionally a secondary menu) beside\n// a body column of a sticky header (with the global search) over the scrolling\n// main content. Layout-only — the rich parts come from SidebarPrimary /\n// SidebarSecondary / SearchGlobal placed inside these slots. Surfaces use the\n// shared `--ui-*` tokens (bg-background / border-border; a bare `border` is\n// transparent in ui-react, so borders name `border-border`).\n\nconst AppShell = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"app-shell\"\n className={cn('flex min-h-screen w-full bg-background', className)}\n {...props}\n />\n));\nAppShell.displayName = 'AppShell';\n\nconst AppShellSidebar = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <aside\n ref={ref}\n data-slot=\"app-shell-sidebar\"\n className={cn('flex shrink-0', className)}\n {...props}\n />\n));\nAppShellSidebar.displayName = 'AppShellSidebar';\n\nconst AppShellBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"app-shell-body\"\n className={cn('flex min-w-0 flex-1 flex-col', className)}\n {...props}\n />\n));\nAppShellBody.displayName = 'AppShellBody';\n\nconst AppShellHeader = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <header\n ref={ref}\n data-slot=\"app-shell-header\"\n className={cn(\n 'sticky top-0 z-10 flex h-16 shrink-0 items-center gap-4 border-b border-border bg-background px-6',\n className\n )}\n {...props}\n />\n));\nAppShellHeader.displayName = 'AppShellHeader';\n\nconst AppShellMain = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <main\n ref={ref}\n data-slot=\"app-shell-main\"\n className={cn('flex-1 overflow-auto', className)}\n {...props}\n />\n));\nAppShellMain.displayName = 'AppShellMain';\n\nconst AppShellFooter = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <footer\n ref={ref}\n data-slot=\"app-shell-footer\"\n className={cn('shrink-0 border-t border-border bg-background px-6 py-4', className)}\n {...props}\n />\n));\nAppShellFooter.displayName = 'AppShellFooter';\n\nexport {\n AppShell,\n AppShellSidebar,\n AppShellBody,\n AppShellHeader,\n AppShellMain,\n AppShellFooter,\n};\n"],"names":["AppShell","React","className","props","ref","jsx","cn","AppShellSidebar","AppShellBody","AppShellHeader","AppShellMain","AppShellFooter"],"mappings":";;;AAYA,MAAMA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,0CAA0CJ,CAAS;AAAA,IAChE,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAS,cAAc;AAEvB,MAAMO,IAAkBN,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,iBAAiBJ,CAAS;AAAA,IACvC,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAgB,cAAc;AAE9B,MAAMC,IAAeP,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,gCAAgCJ,CAAS;AAAA,IACtD,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAa,cAAc;AAE3B,MAAMC,IAAiBR,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAe,cAAc;AAE7B,MAAMC,IAAeT,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,wBAAwBJ,CAAS;AAAA,IAC9C,GAAGC;AAAA,EAAA;AACN,CACD;AACDO,EAAa,cAAc;AAE3B,MAAMC,IAAiBV,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,2DAA2DJ,CAAS;AAAA,IACjF,GAAGC;AAAA,EAAA;AACN,CACD;AACDQ,EAAe,cAAc;"}
1
+ {"version":3,"file":"app-shell.js","sources":["../../../../src/components/ui/app-shell/app-shell.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// The full-page application scaffold from the Figma App Shell (node 2782-1495):\n// a left sidebar column (holds SidebarPrimary, optionally a secondary menu) beside\n// a body column of a sticky header over the scrolling main content. Layout-only\n// — the rich parts come from SidebarPrimary / SidebarSecondary placed inside\n// these slots. Surfaces use the shared `--ui-*` tokens (bg-background /\n// border-border; a bare `border` is transparent in ui-react, so borders name\n// `border-border`).\n\nconst AppShell = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"app-shell\"\n className={cn('flex min-h-screen w-full bg-background', className)}\n {...props}\n />\n));\nAppShell.displayName = 'AppShell';\n\nconst AppShellSidebar = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <aside\n ref={ref}\n data-slot=\"app-shell-sidebar\"\n className={cn('flex shrink-0', className)}\n {...props}\n />\n));\nAppShellSidebar.displayName = 'AppShellSidebar';\n\nconst AppShellBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"app-shell-body\"\n className={cn('flex min-w-0 flex-1 flex-col', className)}\n {...props}\n />\n));\nAppShellBody.displayName = 'AppShellBody';\n\nconst AppShellHeader = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <header\n ref={ref}\n data-slot=\"app-shell-header\"\n className={cn(\n 'sticky top-0 z-10 flex h-16 shrink-0 items-center gap-4 border-b border-border bg-background px-6',\n className\n )}\n {...props}\n />\n));\nAppShellHeader.displayName = 'AppShellHeader';\n\nconst AppShellMain = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <main\n ref={ref}\n data-slot=\"app-shell-main\"\n className={cn('flex-1 overflow-auto', className)}\n {...props}\n />\n));\nAppShellMain.displayName = 'AppShellMain';\n\nconst AppShellFooter = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ className, ...props }, ref) => (\n <footer\n ref={ref}\n data-slot=\"app-shell-footer\"\n className={cn('shrink-0 border-t border-border bg-background px-6 py-4', className)}\n {...props}\n />\n));\nAppShellFooter.displayName = 'AppShellFooter';\n\nexport {\n AppShell,\n AppShellSidebar,\n AppShellBody,\n AppShellHeader,\n AppShellMain,\n AppShellFooter,\n};\n"],"names":["AppShell","React","className","props","ref","jsx","cn","AppShellSidebar","AppShellBody","AppShellHeader","AppShellMain","AppShellFooter"],"mappings":";;;AAYA,MAAMA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,0CAA0CJ,CAAS;AAAA,IAChE,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAS,cAAc;AAEvB,MAAMO,IAAkBN,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,iBAAiBJ,CAAS;AAAA,IACvC,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAgB,cAAc;AAE9B,MAAMC,IAAeP,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,gCAAgCJ,CAAS;AAAA,IACtD,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAa,cAAc;AAE3B,MAAMC,IAAiBR,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAe,cAAc;AAE7B,MAAMC,IAAeT,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,wBAAwBJ,CAAS;AAAA,IAC9C,GAAGC;AAAA,EAAA;AACN,CACD;AACDO,EAAa,cAAc;AAE3B,MAAMC,IAAiBV,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,aAAU;AAAA,IACV,WAAWE,EAAG,2DAA2DJ,CAAS;AAAA,IACjF,GAAGC;AAAA,EAAA;AACN,CACD;AACDQ,EAAe,cAAc;"}
@@ -1,11 +1,11 @@
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("", {
1
+ import { jsx as r, jsxs as $ } from "react/jsx-runtime";
2
+ import * as T from "react";
3
+ import { cva as pe } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { AreaChart as ue, CartesianGrid as ve, XAxis as Le, YAxis as Ce, Area as Ae, LabelList as be, ReferenceLine as Re, Brush as xe } from "recharts";
5
+ import { cn as Te } from "../../../lib/utils.js";
6
+ import { resolveAnimation as $e, resolveCartesianLabelPosition as ye, CHART_LABEL_MARGIN as De, resolveRotatedTickAnchor as Pe, CHART_LABEL_FONT_SIZE as ke, resolveLabelFillClass as Fe, toLabelFormatter as Ne, resolveChartReferenceValue as Oe, resolveReferenceLineProps as _e, resolveBrushProps as Ge, resolveXAxisTitle as Ie, resolveXAxisHeight as we, resolveYAxisTitle as ze, resolveAxisDomain as Be, toReferenceLineList as He } from "../chart/chart-format.js";
7
+ import { ChartContainer as je, ChartTooltip as Ee, ChartTooltipContent as Ve, ChartLegend as Xe, ChartLegendContent as Me } from "../chart/chart.js";
8
+ const We = pe("", {
9
9
  variants: {
10
10
  layout: {
11
11
  single: "",
@@ -20,158 +20,221 @@ const et = Y("", {
20
20
  layout: "single",
21
21
  fill: "gradient"
22
22
  }
23
- }), rt = m.forwardRef(
23
+ });
24
+ function Ye({
25
+ dataKeys: s,
26
+ gradientId: n,
27
+ colorFor: i
28
+ }) {
29
+ return /* @__PURE__ */ r("defs", { children: s.map((a) => /* @__PURE__ */ $(
30
+ "linearGradient",
31
+ {
32
+ id: `${n}-${a}`,
33
+ x1: "0",
34
+ y1: "0",
35
+ x2: "0",
36
+ y2: "1",
37
+ children: [
38
+ /* @__PURE__ */ r("stop", { offset: "5%", stopColor: i(a), stopOpacity: 0.8 }),
39
+ /* @__PURE__ */ r("stop", { offset: "95%", stopColor: i(a), stopOpacity: 0.1 })
40
+ ]
41
+ },
42
+ a
43
+ )) });
44
+ }
45
+ const Ke = T.forwardRef(
24
46
  ({
25
- className: p,
26
- config: h,
27
- data: u,
28
- dataKeys: l,
29
- xKey: v,
30
- xAxisLabel: r,
31
- yAxisLabel: o,
32
- yUnit: C,
33
- layout: i = "single",
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,
47
+ className: s,
48
+ config: n,
49
+ data: i,
50
+ dataKeys: a,
51
+ xKey: p,
52
+ xAxisLabel: u,
53
+ yAxisLabel: v,
54
+ yUnit: y,
55
+ layout: c = "single",
56
+ fill: d = "gradient",
57
+ curve: D = "monotone",
58
+ strokeWidth: P = 2,
59
+ fillOpacity: k = 0.4,
60
+ showDots: F = !1,
61
+ dotSize: N = 3,
62
+ showActiveDot: O,
63
+ connectNulls: _ = !1,
64
+ areaSettings: t,
65
+ referenceLine: G,
66
+ showGrid: I = !0,
67
+ showTooltip: w = !0,
68
+ showLegend: z = !0,
69
+ showXAxis: B = !0,
70
+ showYAxis: H = !0,
71
+ xTickFormatter: L,
46
72
  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,
59
- angle: -90,
60
- position: "insideLeft",
61
- style: { textAnchor: "middle" }
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, "")}`;
63
- return /* @__PURE__ */ t(
73
+ xAxisAngle: f,
74
+ xAxisInterval: E,
75
+ yAxisTickCount: V,
76
+ yAxisDomain: X,
77
+ gridDashed: M,
78
+ gridHorizontal: W,
79
+ gridVertical: Y,
80
+ tooltipContent: K,
81
+ animate: Z,
82
+ animationDuration: q,
83
+ animationBegin: J,
84
+ animationEasing: Q,
85
+ showLabels: C = !1,
86
+ labelPosition: U,
87
+ labelFormatter: S,
88
+ showBrush: g = !1,
89
+ brushHeight: ee,
90
+ brushAriaLabel: oe,
91
+ ...re
92
+ }, ae) => {
93
+ const te = $e({
94
+ animate: Z,
95
+ animationDuration: q,
96
+ animationBegin: J,
97
+ animationEasing: Q
98
+ }), A = c === "stacked", ie = ye({
99
+ labelPosition: U,
100
+ isStacked: A
101
+ }), h = d === "gradient", le = He(G), m = (o) => {
102
+ var e;
103
+ return ((e = t == null ? void 0 : t[o]) == null ? void 0 : e.color) ?? `var(--color-${o})`;
104
+ }, se = C || Object.values(t ?? {}).some((o) => o.showLabel), ne = Ie(u), ce = ze(v), de = Be(X), fe = we(u, f), b = `area-gradient-${T.useId().replace(/:/g, "")}`;
105
+ return /* @__PURE__ */ r(
64
106
  "div",
65
107
  {
66
- ref: B,
67
- "data-layout": i,
68
- "data-fill": n,
69
- className: Q(et({ layout: i, fill: n }), p),
70
- ...x,
71
- children: /* @__PURE__ */ t(
72
- U,
108
+ ref: ae,
109
+ "data-layout": c,
110
+ "data-fill": d,
111
+ className: Te(We({ layout: c, fill: d }), s),
112
+ ...re,
113
+ children: /* @__PURE__ */ r(
114
+ je,
73
115
  {
74
- config: h,
116
+ config: n,
75
117
  className: "size-full [&_.recharts-label]:fill-foreground",
76
- children: /* @__PURE__ */ f(_, { data: u, children: [
77
- s && /* @__PURE__ */ t("defs", { children: l.map((a) => /* @__PURE__ */ f(
78
- "linearGradient",
79
- {
80
- id: `${c}-${a}`,
81
- x1: "0",
82
- y1: "0",
83
- x2: "0",
84
- y2: "1",
85
- children: [
86
- /* @__PURE__ */ t(
87
- "stop",
118
+ children: /* @__PURE__ */ $(
119
+ ue,
120
+ {
121
+ data: i,
122
+ margin: se ? De : void 0,
123
+ children: [
124
+ h && /* @__PURE__ */ r(
125
+ Ye,
126
+ {
127
+ dataKeys: a,
128
+ gradientId: b,
129
+ colorFor: m
130
+ }
131
+ ),
132
+ I && /* @__PURE__ */ r(
133
+ ve,
134
+ {
135
+ horizontal: W ?? !0,
136
+ vertical: Y ?? !1,
137
+ strokeDasharray: M ? "3 3" : void 0
138
+ }
139
+ ),
140
+ /* @__PURE__ */ r(
141
+ Le,
142
+ {
143
+ dataKey: p,
144
+ type: "category",
145
+ hide: !B,
146
+ tickLine: !1,
147
+ axisLine: !1,
148
+ tickMargin: 8,
149
+ tickFormatter: L,
150
+ angle: f,
151
+ interval: E,
152
+ textAnchor: Pe(f),
153
+ height: fe,
154
+ label: ne
155
+ }
156
+ ),
157
+ /* @__PURE__ */ r(
158
+ Ce,
159
+ {
160
+ type: "number",
161
+ hide: !H,
162
+ tickLine: !1,
163
+ axisLine: !1,
164
+ unit: y,
165
+ tickFormatter: j,
166
+ tickCount: V,
167
+ domain: de,
168
+ width: v ? 72 : void 0,
169
+ label: ce
170
+ }
171
+ ),
172
+ w && /* @__PURE__ */ r(Ee, { content: K ?? /* @__PURE__ */ r(Ve, {}) }),
173
+ z && /* @__PURE__ */ r(Xe, { content: /* @__PURE__ */ r(Me, {}) }),
174
+ a.map((o) => {
175
+ const e = t == null ? void 0 : t[o], l = (e == null ? void 0 : e.showDots) ?? F, R = (e == null ? void 0 : e.dotSize) ?? N, he = O ?? l, me = (e == null ? void 0 : e.showLabel) ?? C, x = (e == null ? void 0 : e.labelPosition) ?? ie;
176
+ return /* @__PURE__ */ r(
177
+ Ae,
88
178
  {
89
- offset: "5%",
90
- stopColor: `var(--color-${a})`,
91
- stopOpacity: 0.8
92
- }
93
- ),
94
- /* @__PURE__ */ t(
95
- "stop",
179
+ type: (e == null ? void 0 : e.curveType) ?? D ?? "monotone",
180
+ dataKey: o,
181
+ stackId: A ? "a" : void 0,
182
+ stroke: m(o),
183
+ strokeWidth: (e == null ? void 0 : e.strokeWidth) ?? P,
184
+ strokeDasharray: e != null && e.dashed ? "5 5" : void 0,
185
+ fill: h ? `url(#${b}-${o})` : m(o),
186
+ fillOpacity: (e == null ? void 0 : e.fillOpacity) ?? (h ? 1 : k),
187
+ dot: l ? { r: R } : !1,
188
+ activeDot: he ? { r: R + 2 } : !1,
189
+ connectNulls: _,
190
+ ...te,
191
+ children: me && /* @__PURE__ */ r(
192
+ be,
193
+ {
194
+ dataKey: o,
195
+ position: x,
196
+ formatter: Ne(S),
197
+ className: Fe(x, {
198
+ translucentSeries: !0
199
+ }),
200
+ fontSize: ke
201
+ }
202
+ )
203
+ },
204
+ o
205
+ );
206
+ }),
207
+ le.map((o, e) => {
208
+ const l = Oe(o, i, a);
209
+ return l === void 0 ? null : /* @__PURE__ */ r(
210
+ Re,
96
211
  {
97
- offset: "95%",
98
- stopColor: `var(--color-${a})`,
99
- stopOpacity: 0.1
100
- }
101
- )
102
- ]
103
- },
104
- a
105
- )) }),
106
- T && /* @__PURE__ */ t(
107
- q,
108
- {
109
- horizontal: R ?? !0,
110
- vertical: V ?? !1,
111
- strokeDasharray: L ? "3 3" : void 0
112
- }
113
- ),
114
- /* @__PURE__ */ t(
115
- E,
116
- {
117
- dataKey: v,
118
- type: "category",
119
- hide: !I,
120
- tickLine: !1,
121
- axisLine: !1,
122
- tickMargin: 8,
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
129
- }
130
- ),
131
- /* @__PURE__ */ t(
132
- J,
133
- {
134
- type: "number",
135
- hide: !N,
136
- tickLine: !1,
137
- axisLine: !1,
138
- unit: C,
139
- tickFormatter: j,
140
- tickCount: A,
141
- domain: S,
142
- width: o ? 72 : void 0,
143
- label: M
144
- }
145
- ),
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,
150
- {
151
- type: g ?? "monotone",
152
- dataKey: a,
153
- stackId: H ? "a" : void 0,
154
- stroke: `var(--color-${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,
161
- isAnimationActive: !1
162
- },
163
- a
164
- ))
165
- ] })
212
+ y: l,
213
+ ..._e(o.label, o.labelPosition)
214
+ },
215
+ `${o.label ?? "ref"}-${e}`
216
+ );
217
+ }),
218
+ g && /* @__PURE__ */ r(
219
+ xe,
220
+ {
221
+ dataKey: p,
222
+ tickFormatter: L,
223
+ ...Ge({ brushHeight: ee, brushAriaLabel: oe })
224
+ }
225
+ )
226
+ ]
227
+ }
228
+ )
166
229
  }
167
230
  )
168
231
  }
169
232
  );
170
233
  }
171
234
  );
172
- rt.displayName = "AreaChart";
235
+ Ke.displayName = "AreaChart";
173
236
  export {
174
- rt as AreaChart,
175
- et as areaChartVariants
237
+ Ke as AreaChart,
238
+ We as areaChartVariants
176
239
  };
177
240
  //# 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 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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A,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA/C,GAAU,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 Brush,\n CartesianGrid,\n LabelList,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n CHART_LABEL_MARGIN,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n resolveCartesianLabelPosition,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCurveType,\n type ChartDataLabelProps,\n type ChartReferenceLine,\n type CartesianLabelPosition,\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\n/**\n * Style override for one series, keyed by its `dataKeys` entry. Anything left\n * unset falls back to the chart-wide prop, so an entry only states what differs\n * — e.g. a projection band that reads fainter than the actuals beside it.\n */\nexport interface AreaChartAreaSettings {\n /** Stroke and fill color. Defaults to the series' `config` color. */\n color?: string;\n /** Width of this series' top border. Defaults to the chart's `strokeWidth`. */\n strokeWidth?: number;\n /** Dash this series' top border. */\n dashed?: boolean;\n /** Interpolation for this series only. Defaults to the chart's `curve`. */\n curveType?: ChartCurveType;\n /**\n * Fill opacity for this series. Under `fill=\"gradient\"` it scales the\n * gradient's own alpha rather than replacing it.\n */\n fillOpacity?: number;\n /** Render this series' per-point dots. Defaults to the chart's `showDots`. */\n showDots?: boolean;\n /** Dot radius for this series, in px. Defaults to the chart's `dotSize`. */\n dotSize?: number;\n /** Show/hide this series' value labels, overriding the chart's `showLabels`. */\n showLabel?: boolean;\n /** Position of this series' value labels. Defaults to the chart's `labelPosition`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nexport interface AreaChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof areaChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\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?: ChartCurveType;\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 /** Radius of each point's dot, in px. Its hover dot is 2px larger. */\n dotSize?: number;\n /**\n * Enlarge the hovered point's dot. Defaults to following `showDots`, so pass\n * it explicitly to get hover dots on a dot-less area (`showDots={false}` with\n * `showActiveDot`) or a static-only area (dots without the hover one).\n */\n showActiveDot?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the area. */\n connectNulls?: boolean;\n /**\n * Per-series style overrides, keyed by `dataKeys` entry. Series with no entry\n * render from the chart-wide props.\n */\n areaSettings?: Record<string, AreaChartAreaSettings>;\n /**\n * One or more dashed reference/average lines on the value axis — a target, a\n * threshold, or a series mean. Pass a single object or an array to draw\n * several at once. On a stacked chart the value is read against the stack's\n * axis, not one series.\n */\n referenceLine?: ChartReferenceLine | ChartReferenceLine[];\n showLegend?: boolean;\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\n/**\n * One top-to-bottom fade per series, referenced by each `<Area>`'s `fill`.\n *\n * The ids are scoped by `gradientId` because SVG `<defs>` ids are\n * document-global: two AreaCharts on the same page would otherwise share (and\n * silently overwrite) each other's stops.\n */\nfunction AreaFillGradients({\n dataKeys,\n gradientId,\n colorFor,\n}: {\n dataKeys: string[];\n gradientId: string;\n colorFor: (key: string) => string;\n}) {\n return (\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 offset=\"5%\" stopColor={colorFor(key)} stopOpacity={0.8} />\n <stop offset=\"95%\" stopColor={colorFor(key)} stopOpacity={0.1} />\n </linearGradient>\n ))}\n </defs>\n );\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 dotSize = 3,\n showActiveDot,\n connectNulls = false,\n areaSettings,\n referenceLine,\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 animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const isStacked = layout === 'stacked';\n const areaLabelPosition = resolveCartesianLabelPosition({\n labelPosition,\n isStacked,\n });\n const isGradient = fill === 'gradient';\n const referenceLines = toReferenceLineList(referenceLine);\n\n // A series' `color` override has to reach its gradient stops too, or a\n // gradient-filled chart would keep painting the `config` color.\n const colorFor = (key: string) =>\n areaSettings?.[key]?.color ?? `var(--color-${key})`;\n\n // The plot inset is needed as soon as *any* series carries outside labels —\n // a per-series `showLabel` counts, not only the chart-wide `showLabels`.\n const hasLabels =\n showLabels ||\n Object.values(areaSettings ?? {}).some((settings) => settings.showLabel);\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 = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\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\n data={data as readonly unknown[]}\n margin={hasLabels ? CHART_LABEL_MARGIN : undefined}\n >\n {isGradient && (\n <AreaFillGradients\n dataKeys={dataKeys}\n gradientId={gradientId}\n colorFor={colorFor}\n />\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={resolveRotatedTickAnchor(xAxisAngle)}\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 const settings = areaSettings?.[key];\n const seriesDots = settings?.showDots ?? showDots;\n const dotRadius = settings?.dotSize ?? dotSize;\n // The hover dot follows the static dots unless asked otherwise, so\n // a chart that sets neither renders exactly as before.\n const activeDot = showActiveDot ?? seriesDots;\n const seriesLabel = settings?.showLabel ?? showLabels;\n const seriesLabelPosition =\n settings?.labelPosition ?? areaLabelPosition;\n return (\n <Area\n key={key}\n type={settings?.curveType ?? curve ?? 'monotone'}\n dataKey={key}\n stackId={isStacked ? 'a' : undefined}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray={settings?.dashed ? '5 5' : undefined}\n fill={\n isGradient ? `url(#${gradientId}-${key})` : colorFor(key)\n }\n fillOpacity={\n settings?.fillOpacity ?? (isGradient ? 1 : fillOpacity)\n }\n dot={seriesDots ? { r: dotRadius } : false}\n activeDot={activeDot ? { r: dotRadius + 2 } : false}\n connectNulls={connectNulls}\n {...animation}\n >\n {seriesLabel && (\n <LabelList\n dataKey={key}\n position={seriesLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(seriesLabelPosition, {\n translucentSeries: true,\n })}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Area>\n );\n })}\n {/* Annotations draw over the series they describe. */}\n {referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n y={value}\n {...resolveReferenceLineProps(ref.label, ref.labelPosition)}\n />\n );\n })}\n {showBrush && (\n <Brush\n dataKey={xKey}\n tickFormatter={xTickFormatter}\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RechartsAreaChart>\n </ChartContainer>\n </div>\n );\n }\n);\nAreaChart.displayName = 'AreaChart';\n\nexport { AreaChart, areaChartVariants };\n"],"names":["areaChartVariants","cva","AreaFillGradients","dataKeys","gradientId","colorFor","jsx","key","jsxs","AreaChart","React","className","config","data","xKey","xAxisLabel","yAxisLabel","yUnit","layout","fill","curve","strokeWidth","fillOpacity","showDots","dotSize","showActiveDot","connectNulls","areaSettings","referenceLine","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","animate","animationDuration","animationBegin","animationEasing","showLabels","labelPosition","labelFormatter","showBrush","brushHeight","brushAriaLabel","props","ref","animation","resolveAnimation","isStacked","areaLabelPosition","resolveCartesianLabelPosition","isGradient","referenceLines","toReferenceLineList","_a","hasLabels","settings","xAxisTitle","resolveXAxisTitle","yAxisTitle","resolveYAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","resolveXAxisHeight","cn","ChartContainer","RechartsAreaChart","CHART_LABEL_MARGIN","CartesianGrid","XAxis","resolveRotatedTickAnchor","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","seriesDots","dotRadius","activeDot","seriesLabel","seriesLabelPosition","Area","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","index","value","resolveChartReferenceValue","ReferenceLine","resolveReferenceLineProps","Brush","resolveBrushProps"],"mappings":";;;;;;;AAwDA,MAAMA,KAAoBC,GAAI,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;AA4FD,SAASC,GAAkB;AAAA,EACzB,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,GAIG;AACD,SACE,gBAAAC,EAAC,QAAA,EACE,UAAAH,EAAS,IAAI,CAACI,MACb,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MAEC,IAAI,GAAGJ,CAAU,IAAIG,CAAG;AAAA,MACxB,IAAG;AAAA,MACH,IAAG;AAAA,MACH,IAAG;AAAA,MACH,IAAG;AAAA,MAEH,UAAA;AAAA,QAAA,gBAAAD,EAAC,QAAA,EAAK,QAAO,MAAK,WAAWD,EAASE,CAAG,GAAG,aAAa,KAAK;AAAA,QAC9D,gBAAAD,EAAC,UAAK,QAAO,OAAM,WAAWD,EAASE,CAAG,GAAG,aAAa,IAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,IAR1DA;AAAA,EAAA,CAUR,GACH;AAEJ;AAEA,MAAME,KAAYC,EAAM;AAAA,EACtB,CACE;AAAA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,gBACvD;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA5C,GAAU,cAAc;"}
@@ -1,9 +1,9 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import { Avatar as v } from "@base-ui/react/avatar";
4
- import { cva as s } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cva as c } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
5
5
  import { cn as l } from "../../../lib/utils.js";
6
- const c = s(
6
+ const s = c(
7
7
  "relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] [box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] text-xs font-semibold leading-4",
8
8
  {
9
9
  variants: {
@@ -12,45 +12,48 @@ const c = s(
12
12
  violet: "bg-[var(--ui-avatar-color-violet)] text-[var(--ui-avatar-label-color-violet)]",
13
13
  red: "bg-[var(--ui-avatar-color-red)] text-[var(--ui-avatar-label-color-red)]",
14
14
  yellow: "bg-[var(--ui-avatar-color-yellow)] text-[var(--ui-avatar-label-color-yellow)]",
15
- orange: "bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]"
15
+ orange: "bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]",
16
+ blue: "bg-[var(--ui-avatar-color-blue)] text-[var(--ui-avatar-label-color-blue)]",
17
+ gray: "bg-[var(--ui-avatar-color-gray)] text-[var(--ui-avatar-label-color-gray)]",
18
+ green: "bg-[var(--ui-avatar-color-green)] text-[var(--ui-avatar-label-color-green)]"
16
19
  }
17
20
  },
18
21
  defaultVariants: {
19
22
  color: "teal"
20
23
  }
21
24
  }
22
- ), d = o.forwardRef(({ className: a, color: r, ...t }, i) => /* @__PURE__ */ e(
25
+ ), b = o.forwardRef(({ className: a, color: r, ...e }, i) => /* @__PURE__ */ t(
23
26
  v.Root,
24
27
  {
25
28
  ref: i,
26
- className: l(c({ color: r }), a),
27
- ...t
29
+ className: l(s({ color: r }), a),
30
+ ...e
28
31
  }
29
32
  ));
30
- d.displayName = "Avatar";
31
- const n = o.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
33
+ b.displayName = "Avatar";
34
+ const u = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
32
35
  v.Image,
33
36
  {
34
- ref: t,
37
+ ref: e,
35
38
  className: l("size-full object-cover", a),
36
39
  ...r
37
40
  }
38
41
  ));
39
- n.displayName = "AvatarImage";
40
- const b = o.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
42
+ u.displayName = "AvatarImage";
43
+ const n = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
41
44
  v.Fallback,
42
45
  {
43
- ref: t,
46
+ ref: e,
44
47
  className: l("flex size-full items-center justify-center", a),
45
48
  ...r
46
49
  }
47
50
  ));
48
- b.displayName = "AvatarFallback";
49
- const m = o.forwardRef(
50
- ({ className: a, ...r }, t) => /* @__PURE__ */ e(
51
+ n.displayName = "AvatarFallback";
52
+ const d = o.forwardRef(
53
+ ({ className: a, ...r }, e) => /* @__PURE__ */ t(
51
54
  "div",
52
55
  {
53
- ref: t,
56
+ ref: e,
54
57
  className: l(
55
58
  "flex items-center [&>*:not(:first-child)]:ms-[var(--ui-avatar-global-avatar-group-gap)]",
56
59
  a
@@ -59,12 +62,12 @@ const m = o.forwardRef(
59
62
  }
60
63
  )
61
64
  );
62
- m.displayName = "AvatarGroup";
65
+ d.displayName = "AvatarGroup";
63
66
  export {
64
- d as Avatar,
65
- b as AvatarFallback,
66
- m as AvatarGroup,
67
- n as AvatarImage,
68
- c as avatarVariants
67
+ b as Avatar,
68
+ n as AvatarFallback,
69
+ d as AvatarGroup,
70
+ u as AvatarImage,
71
+ s as avatarVariants
69
72
  };
70
73
  //# sourceMappingURL=avatar.js.map