@acronis-platform/ui-react 3.0.0 → 4.0.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 (219) hide show
  1. package/dist/components/ui/accordion-container/accordion-container.js +14 -14
  2. package/dist/components/ui/accordion-container/accordion-container.js.map +1 -1
  3. package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
  4. package/dist/components/ui/area-chart/area-chart.js +141 -139
  5. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  6. package/dist/components/ui/bar-chart/bar-chart.js +295 -293
  7. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  8. package/dist/components/ui/category-bar/category-bar.js +109 -93
  9. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  10. package/dist/components/ui/chart/chart-palette.js +113 -0
  11. package/dist/components/ui/chart/chart-palette.js.map +1 -0
  12. package/dist/components/ui/chart/chart.js +176 -129
  13. package/dist/components/ui/chart/chart.js.map +1 -1
  14. package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
  15. package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
  16. package/dist/components/ui/chart-state/chart-state.js +48 -34
  17. package/dist/components/ui/chart-state/chart-state.js.map +1 -1
  18. package/dist/components/ui/chart-widget/chart-widget.js +87 -0
  19. package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
  20. package/dist/components/ui/composed-chart/composed-chart.js +117 -115
  21. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  22. package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
  23. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  24. package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
  25. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  26. package/dist/components/ui/histogram/histogram.js +94 -92
  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/label/label.js +2 -9
  30. package/dist/components/ui/label/label.js.map +1 -1
  31. package/dist/components/ui/line-chart/line-chart.js +143 -141
  32. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  33. package/dist/components/ui/metric/metric.js +74 -185
  34. package/dist/components/ui/metric/metric.js.map +1 -1
  35. package/dist/components/ui/page-content/page-content.js.map +1 -1
  36. package/dist/components/ui/pie-chart/pie-chart.js +201 -195
  37. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  38. package/dist/components/ui/radar-chart/radar-chart.js +133 -131
  39. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  40. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
  41. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  42. package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
  43. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  44. package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
  45. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  46. package/dist/components/ui/section/section.js +157 -31
  47. package/dist/components/ui/section/section.js.map +1 -1
  48. package/dist/components/ui/stepper/stepper.js +24 -24
  49. package/dist/components/ui/stepper/stepper.js.map +1 -1
  50. package/dist/components/ui/stepper-item/stepper-item.js +43 -24
  51. package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
  52. package/dist/components/ui/treemap/treemap.js +133 -124
  53. package/dist/components/ui/treemap/treemap.js.map +1 -1
  54. package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
  55. package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
  56. package/dist/components/ui/wizard/wizard.js +59 -0
  57. package/dist/components/ui/wizard/wizard.js.map +1 -0
  58. package/dist/hooks/use-wizard.js +75 -0
  59. package/dist/hooks/use-wizard.js.map +1 -0
  60. package/dist/index.js +502 -497
  61. package/dist/index.js.map +1 -1
  62. package/dist/llms/accordion-container.md +181 -0
  63. package/dist/llms/accordion.md +124 -0
  64. package/dist/llms/alert.md +225 -0
  65. package/dist/llms/app-shell-chat.md +415 -0
  66. package/dist/llms/area-chart.md +355 -0
  67. package/dist/llms/avatar.md +208 -0
  68. package/dist/llms/bar-chart.md +406 -0
  69. package/dist/llms/breadcrumb.md +326 -0
  70. package/dist/llms/button-group.md +298 -0
  71. package/dist/llms/button-icon-input.md +142 -0
  72. package/dist/llms/button-icon-menu.md +209 -0
  73. package/dist/llms/button-icon.md +128 -0
  74. package/dist/llms/button-menu.md +172 -0
  75. package/dist/llms/button.md +185 -0
  76. package/dist/llms/calendar-panel.md +733 -0
  77. package/dist/llms/calendar.md +188 -0
  78. package/dist/llms/card-filter.md +214 -0
  79. package/dist/llms/card-section.md +293 -0
  80. package/dist/llms/card.md +447 -0
  81. package/dist/llms/carousel-dialog.md +156 -0
  82. package/dist/llms/category-bar.md +193 -0
  83. package/dist/llms/chart-state.md +190 -0
  84. package/dist/llms/chart-widget.md +209 -0
  85. package/dist/llms/chart.md +182 -0
  86. package/dist/llms/checkbox.md +257 -0
  87. package/dist/llms/chip.md +195 -0
  88. package/dist/llms/combobox.md +164 -0
  89. package/dist/llms/composed-chart.md +508 -0
  90. package/dist/llms/confidence-cone.md +277 -0
  91. package/dist/llms/data-table.md +474 -0
  92. package/dist/llms/date-range-picker.md +272 -0
  93. package/dist/llms/description-list.md +131 -0
  94. package/dist/llms/dialog-footer-carousel.md +147 -0
  95. package/dist/llms/dialog-footer-default.md +142 -0
  96. package/dist/llms/dialog-root.md +246 -0
  97. package/dist/llms/dialog-welcome.md +223 -0
  98. package/dist/llms/dialog.md +403 -0
  99. package/dist/llms/dropdown-menu.md +193 -0
  100. package/dist/llms/empty-overlay.md +146 -0
  101. package/dist/llms/empty.md +156 -0
  102. package/dist/llms/field.md +185 -0
  103. package/dist/llms/filter-cards.md +157 -0
  104. package/dist/llms/filter-chips.md +323 -0
  105. package/dist/llms/filter-search.md +512 -0
  106. package/dist/llms/form.md +154 -0
  107. package/dist/llms/funnel-chart.md +333 -0
  108. package/dist/llms/grid.md +80 -0
  109. package/dist/llms/histogram.md +190 -0
  110. package/dist/llms/input-date-picker.md +203 -0
  111. package/dist/llms/input-otp.md +173 -0
  112. package/dist/llms/input-password.md +197 -0
  113. package/dist/llms/input-search.md +170 -0
  114. package/dist/llms/input-select.md +278 -0
  115. package/dist/llms/input-text-area.md +271 -0
  116. package/dist/llms/input-text.md +192 -0
  117. package/dist/llms/line-chart.md +369 -0
  118. package/dist/llms/link.md +209 -0
  119. package/dist/llms/loading.md +130 -0
  120. package/dist/llms/meter.md +177 -0
  121. package/dist/llms/metric.md +204 -0
  122. package/dist/llms/number-field.md +122 -0
  123. package/dist/llms/page-content.md +69 -0
  124. package/dist/llms/page-header.md +182 -0
  125. package/dist/llms/pagination.md +133 -0
  126. package/dist/llms/pie-chart.md +307 -0
  127. package/dist/llms/popover.md +252 -0
  128. package/dist/llms/progress-circle.md +126 -0
  129. package/dist/llms/progress.md +111 -0
  130. package/dist/llms/radar-chart.md +316 -0
  131. package/dist/llms/radial-bar-chart.md +319 -0
  132. package/dist/llms/radio.md +255 -0
  133. package/dist/llms/resizable.md +195 -0
  134. package/dist/llms/sankey-chart.md +208 -0
  135. package/dist/llms/scatter-chart.md +239 -0
  136. package/dist/llms/scroll-area.md +183 -0
  137. package/dist/llms/section.md +401 -0
  138. package/dist/llms/select.md +210 -0
  139. package/dist/llms/separator.md +87 -0
  140. package/dist/llms/sheet.md +202 -0
  141. package/dist/llms/sidebar-primary.md +360 -0
  142. package/dist/llms/sidebar-secondary.md +417 -0
  143. package/dist/llms/skeleton.md +81 -0
  144. package/dist/llms/slider.md +97 -0
  145. package/dist/llms/spinner.md +100 -0
  146. package/dist/llms/stack.md +80 -0
  147. package/dist/llms/stepper-item.md +309 -0
  148. package/dist/llms/stepper.md +251 -0
  149. package/dist/llms/switch.md +140 -0
  150. package/dist/llms/table.md +436 -0
  151. package/dist/llms/tabs.md +197 -0
  152. package/dist/llms/tag.md +139 -0
  153. package/dist/llms/timeline.md +361 -0
  154. package/dist/llms/timer.md +259 -0
  155. package/dist/llms/toast.md +241 -0
  156. package/dist/llms/toggle-group.md +121 -0
  157. package/dist/llms/toolbar.md +453 -0
  158. package/dist/llms/tooltip.md +164 -0
  159. package/dist/llms/treemap.md +254 -0
  160. package/dist/llms/trend-indicator.md +132 -0
  161. package/dist/llms/widget-placeholder.md +169 -0
  162. package/dist/llms/wizard.md +412 -0
  163. package/dist/llms.txt +142 -0
  164. package/dist/react.js +502 -497
  165. package/dist/react.js.map +1 -1
  166. package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
  167. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  168. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
  169. package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
  170. package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
  171. package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
  172. package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
  173. package/dist/src/components/ui/chart/chart.d.ts +66 -15
  174. package/dist/src/components/ui/chart/index.d.ts +4 -2
  175. package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
  176. package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
  177. package/dist/src/components/ui/chart-state/index.d.ts +1 -0
  178. package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
  179. package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
  180. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
  181. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
  182. package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +1 -1
  183. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
  184. package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
  185. package/dist/src/components/ui/label/index.d.ts +1 -1
  186. package/dist/src/components/ui/label/label.d.ts +1 -5
  187. package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
  188. package/dist/src/components/ui/metric/metric.d.ts +13 -14
  189. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
  190. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
  191. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
  192. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
  193. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
  194. package/dist/src/components/ui/section/index.d.ts +1 -1
  195. package/dist/src/components/ui/section/section.d.ts +75 -6
  196. package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
  197. package/dist/src/components/ui/tag/tag.d.ts +1 -1
  198. package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
  199. package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
  200. package/dist/src/components/ui/wizard/index.d.ts +1 -0
  201. package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
  202. package/dist/src/hooks/index.d.ts +1 -0
  203. package/dist/src/hooks/use-wizard.d.ts +80 -0
  204. package/dist/src/index.d.ts +2 -3
  205. package/dist/ui-react.css +1 -1
  206. package/package.json +9 -3
  207. package/dist/components/ui/app-shell/app-shell.js +0 -75
  208. package/dist/components/ui/app-shell/app-shell.js.map +0 -1
  209. package/dist/components/ui/auth-layout/auth-layout.js +0 -56
  210. package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
  211. package/dist/components/ui/collapsible/collapsible.js +0 -22
  212. package/dist/components/ui/collapsible/collapsible.js.map +0 -1
  213. package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
  214. package/dist/src/components/ui/app-shell/index.d.ts +0 -1
  215. package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
  216. package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
  217. package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
  218. package/dist/src/components/ui/collapsible/index.d.ts +0 -1
  219. package/dist/src/components/ui/label/label.docs.d.ts +0 -10
@@ -1,11 +1,11 @@
1
- import { jsx as a, jsxs as rr } from "react/jsx-runtime";
2
- import * as ar from "react";
3
- import { cva as or } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { RadarChart as tr, PolarGrid as ir, PolarAngleAxis as lr, PolarRadiusAxis as cr, Radar as dr, LabelList as er } from "recharts";
5
- import { cn as nr } from "../../../lib/utils.js";
6
- import { resolveAnimation as ur, CHART_LABEL_FONT_SIZE as fr, resolveLabelFillClass as pr, toLabelFormatter as mr } from "../chart/chart-format.js";
7
- import { ChartContainer as hr, ChartTooltip as vr, ChartTooltipContent as Cr, ChartLegend as kr, ChartLegendContent as Lr } from "../chart/chart.js";
8
- const Rr = or("", {
1
+ import { jsx as a, jsxs as ar } from "react/jsx-runtime";
2
+ import * as or from "react";
3
+ import { cva as tr } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { RadarChart as ir, PolarGrid as lr, PolarAngleAxis as cr, PolarRadiusAxis as dr, Radar as er, LabelList as nr } from "recharts";
5
+ import { cn as ur } from "../../../lib/utils.js";
6
+ import { resolveAnimation as fr, CHART_LABEL_FONT_SIZE as pr, resolveLabelFillClass as mr, toLabelFormatter as hr } from "../chart/chart-format.js";
7
+ import { ChartContainer as vr, ChartTooltip as Cr, ChartTooltipContent as kr, ChartLegend as Lr, ChartLegendContent as Rr } from "../chart/chart.js";
8
+ const _r = tr("", {
9
9
  variants: {
10
10
  gridType: {
11
11
  polygon: "",
@@ -16,7 +16,7 @@ const Rr = or("", {
16
16
  gridType: "polygon"
17
17
  }
18
18
  });
19
- function _r(o, r) {
19
+ function yr(o, r) {
20
20
  switch (o) {
21
21
  case "auto":
22
22
  return ["auto", "auto"];
@@ -26,7 +26,7 @@ function _r(o, r) {
26
26
  return;
27
27
  }
28
28
  }
29
- function yr(o, r, t) {
29
+ function Dr(o, r, t) {
30
30
  const i = (r == null ? void 0 : r.color) ?? `var(--color-${o})`, l = (r == null ? void 0 : r.dot) ?? t.showDots;
31
31
  return {
32
32
  fill: i,
@@ -37,8 +37,8 @@ function yr(o, r, t) {
37
37
  activeDot: (r == null ? void 0 : r.activeDot) ?? t.activeDot
38
38
  };
39
39
  }
40
- const Dr = 30;
41
- function xr({
40
+ const xr = 30;
41
+ function Tr({
42
42
  seriesKey: o,
43
43
  style: r,
44
44
  animation: t,
@@ -47,7 +47,7 @@ function xr({
47
47
  labelFormatter: c
48
48
  }) {
49
49
  return /* @__PURE__ */ a(
50
- dr,
50
+ er,
51
51
  {
52
52
  dataKey: o,
53
53
  stroke: r.stroke,
@@ -58,154 +58,156 @@ function xr({
58
58
  activeDot: r.activeDot,
59
59
  ...t,
60
60
  children: i && /* @__PURE__ */ a(
61
- er,
61
+ nr,
62
62
  {
63
63
  dataKey: o,
64
64
  position: l,
65
- formatter: mr(c),
66
- className: pr(l, {
65
+ formatter: hr(c),
66
+ className: mr(l, {
67
67
  translucentSeries: !0
68
68
  }),
69
- fontSize: fr
69
+ fontSize: pr
70
70
  }
71
71
  )
72
72
  },
73
73
  o
74
74
  );
75
75
  }
76
- const Tr = ar.forwardRef(
76
+ const br = or.forwardRef(
77
77
  ({
78
78
  className: o,
79
79
  config: r,
80
- data: t,
81
- dataKeys: i,
82
- angleKey: l,
83
- seriesSettings: c,
84
- gridType: d = "polygon",
85
- fillOpacity: v = 0.3,
86
- strokeWidth: C = 2,
87
- showDots: k = !1,
88
- dotRadius: L = 3,
89
- activeDot: R,
90
- showGrid: _ = !0,
91
- radialLines: y = !0,
92
- showAngleAxis: e = !0,
93
- angleAxisOrientation: D,
94
- angleAxisLine: x = !0,
95
- angleAxisLineType: T,
96
- angleTickLine: b = !0,
97
- angleTickSize: A,
98
- showRadiusAxis: n = !1,
99
- radiusAxisAngle: N,
100
- radiusAxisOrientation: O,
101
- radiusAxisDomain: W,
102
- radiusAxisDomainMax: E,
103
- radiusAxisTickCount: F,
104
- radiusAxisReversed: f = !1,
105
- cx: S,
106
- cy: z,
107
- startAngle: I,
108
- endAngle: K,
109
- innerRadius: P,
110
- outerRadius: j,
111
- margin: B,
112
- showTooltip: V = !0,
113
- showLegend: Z = !0,
114
- legendPosition: p = "bottom",
115
- tooltipContent: $,
116
- animate: G,
117
- animationDuration: H,
118
- animationBegin: q,
119
- animationEasing: J,
120
- showLabels: m = !1,
121
- labelPosition: M,
122
- labelFormatter: Q,
123
- ...U
124
- }, X) => {
125
- const Y = ur({
126
- animate: G,
127
- animationDuration: H,
128
- animationBegin: q,
129
- animationEasing: J
130
- }), w = M ?? "top", h = _r(
131
- W,
132
- E
133
- ), s = n || h !== void 0 || f, g = {
134
- fillOpacity: v,
135
- strokeWidth: C,
136
- showDots: k,
137
- dotRadius: L,
138
- activeDot: R
80
+ palette: t,
81
+ data: i,
82
+ dataKeys: l,
83
+ angleKey: c,
84
+ seriesSettings: d,
85
+ gridType: e = "polygon",
86
+ fillOpacity: C = 0.3,
87
+ strokeWidth: k = 2,
88
+ showDots: L = !1,
89
+ dotRadius: R = 3,
90
+ activeDot: _,
91
+ showGrid: y = !0,
92
+ radialLines: D = !0,
93
+ showAngleAxis: n = !0,
94
+ angleAxisOrientation: x,
95
+ angleAxisLine: T = !0,
96
+ angleAxisLineType: b,
97
+ angleTickLine: A = !0,
98
+ angleTickSize: N,
99
+ showRadiusAxis: u = !1,
100
+ radiusAxisAngle: O,
101
+ radiusAxisOrientation: W,
102
+ radiusAxisDomain: E,
103
+ radiusAxisDomainMax: F,
104
+ radiusAxisTickCount: S,
105
+ radiusAxisReversed: p = !1,
106
+ cx: z,
107
+ cy: I,
108
+ startAngle: K,
109
+ endAngle: P,
110
+ innerRadius: j,
111
+ outerRadius: B,
112
+ margin: V,
113
+ showTooltip: Z = !0,
114
+ showLegend: $ = !0,
115
+ legendPosition: m = "bottom",
116
+ tooltipContent: G,
117
+ animate: H,
118
+ animationDuration: q,
119
+ animationBegin: J,
120
+ animationEasing: M,
121
+ showLabels: h = !1,
122
+ labelPosition: Q,
123
+ labelFormatter: U,
124
+ ...X
125
+ }, Y) => {
126
+ const w = fr({
127
+ animate: H,
128
+ animationDuration: q,
129
+ animationBegin: J,
130
+ animationEasing: M
131
+ }), s = Q ?? "top", v = yr(
132
+ E,
133
+ F
134
+ ), g = u || v !== void 0 || p, rr = {
135
+ fillOpacity: C,
136
+ strokeWidth: k,
137
+ showDots: L,
138
+ dotRadius: R,
139
+ activeDot: _
139
140
  };
140
141
  return /* @__PURE__ */ a(
141
142
  "div",
142
143
  {
143
- ref: X,
144
- "data-grid-type": d,
145
- className: nr(Rr({ gridType: d }), o),
146
- ...U,
144
+ ref: Y,
145
+ "data-grid-type": e,
146
+ className: ur(_r({ gridType: e }), o),
147
+ ...X,
147
148
  children: /* @__PURE__ */ a(
148
- hr,
149
+ vr,
149
150
  {
150
151
  config: r,
152
+ palette: t,
151
153
  className: "size-full [&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-line]:stroke-border [&_.recharts-polar-radius-axis-tick_text]:fill-muted-foreground",
152
- children: /* @__PURE__ */ rr(
153
- tr,
154
+ children: /* @__PURE__ */ ar(
155
+ ir,
154
156
  {
155
- data: t,
156
- cx: S,
157
- cy: z,
158
- startAngle: I,
159
- endAngle: K,
160
- innerRadius: P,
161
- outerRadius: j,
162
- margin: B,
157
+ data: i,
158
+ cx: z,
159
+ cy: I,
160
+ startAngle: K,
161
+ endAngle: P,
162
+ innerRadius: j,
163
+ outerRadius: B,
164
+ margin: V,
163
165
  children: [
164
- V && /* @__PURE__ */ a(vr, { content: $ ?? /* @__PURE__ */ a(Cr, {}) }),
165
- _ && /* @__PURE__ */ a(ir, { gridType: d ?? "polygon", radialLines: y }),
166
+ Z && /* @__PURE__ */ a(Cr, { content: G ?? /* @__PURE__ */ a(kr, {}) }),
167
+ y && /* @__PURE__ */ a(lr, { gridType: e ?? "polygon", radialLines: D }),
166
168
  /* @__PURE__ */ a(
167
- lr,
169
+ cr,
168
170
  {
169
- dataKey: l,
170
- orientation: D,
171
- axisLineType: T,
172
- tick: e,
173
- axisLine: e && x,
174
- tickLine: e && b,
175
- tickSize: A ?? (m ? Dr : void 0)
171
+ dataKey: c,
172
+ orientation: x,
173
+ axisLineType: b,
174
+ tick: n,
175
+ axisLine: n && T,
176
+ tickLine: n && A,
177
+ tickSize: N ?? (h ? xr : void 0)
176
178
  }
177
179
  ),
178
- s && /* @__PURE__ */ a(
179
- cr,
180
+ g && /* @__PURE__ */ a(
181
+ dr,
180
182
  {
181
- angle: N,
182
- orientation: O,
183
- domain: h,
184
- tickCount: F,
185
- reversed: f,
186
- tick: n,
187
- axisLine: n
183
+ angle: O,
184
+ orientation: W,
185
+ domain: v,
186
+ tickCount: S,
187
+ reversed: p,
188
+ tick: u,
189
+ axisLine: u
188
190
  }
189
191
  ),
190
- Z && /* @__PURE__ */ a(
191
- kr,
192
+ $ && /* @__PURE__ */ a(
193
+ Lr,
192
194
  {
193
- verticalAlign: p,
194
- content: /* @__PURE__ */ a(Lr, { verticalAlign: p })
195
+ verticalAlign: m,
196
+ content: /* @__PURE__ */ a(Rr, { verticalAlign: m })
195
197
  }
196
198
  ),
197
- i.map(
198
- (u) => xr({
199
- seriesKey: u,
200
- style: yr(
201
- u,
202
- c == null ? void 0 : c[u],
203
- g
199
+ l.map(
200
+ (f) => Tr({
201
+ seriesKey: f,
202
+ style: Dr(
203
+ f,
204
+ d == null ? void 0 : d[f],
205
+ rr
204
206
  ),
205
- animation: Y,
206
- showLabels: m,
207
- labelPosition: w,
208
- labelFormatter: Q
207
+ animation: w,
208
+ showLabels: h,
209
+ labelPosition: s,
210
+ labelFormatter: U
209
211
  })
210
212
  )
211
213
  ]
@@ -217,11 +219,11 @@ const Tr = ar.forwardRef(
217
219
  );
218
220
  }
219
221
  );
220
- Tr.displayName = "RadarChart";
222
+ br.displayName = "RadarChart";
221
223
  export {
222
- Tr as RadarChart,
223
- Rr as radarChartVariants,
224
- _r as radarRadiusAxisDomain,
225
- yr as radarSeriesStyle
224
+ br as RadarChart,
225
+ _r as radarChartVariants,
226
+ yr as radarRadiusAxisDomain,
227
+ Dr as radarSeriesStyle
226
228
  };
227
229
  //# sourceMappingURL=radar-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radar-chart.js","sources":["../../../../src/components/ui/radar-chart/radar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n LabelList,\n PolarAngleAxis,\n PolarGrid,\n PolarRadiusAxis,\n Radar,\n RadarChart as RechartsRadarChart,\n type AxisDomainItem,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n toLabelFormatter,\n resolveLabelFillClass,\n CHART_LABEL_FONT_SIZE,\n type ChartConfig,\n type ChartAnimationProps,\n type ChartDataLabelProps,\n type CartesianLabelPosition,\n type ResolvedAnimation,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives — the first\n// polar chart type. The single CVA axis is the design's Radar-chart variant set:\n// `gridType` (the polar web is drawn as straight-edged `polygon` rings or smooth\n// `circle` rings). The class stays empty because recharts' SVG — not CSS — draws\n// the web: `gridType` drives `<PolarGrid gridType>`. CVA is kept so the variant\n// set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved value is\n// also mirrored onto `data-grid-type`.\nconst radarChartVariants = cva('', {\n variants: {\n gridType: {\n polygon: '',\n circle: '',\n },\n },\n defaultVariants: {\n gridType: 'polygon',\n },\n});\n\n/** Per-series overrides, keyed by the series' `dataKeys` entry. */\nexport interface RadarChartSeriesSettings {\n /**\n * Fill for this series' area, overriding its `config` color. Reference an\n * existing semantic `--ui-*` token, same as `config`.\n */\n color?: string;\n /**\n * Outline color, when it should read differently from the fill (e.g. a solid\n * outline over a barely-tinted area). Defaults to the fill.\n *\n * recharts derives a Radar's legend/tooltip color from its stroke first, so\n * setting this alone also recolors that series' legend swatch and tooltip dot\n * — set `color` too if the marker should keep following the fill.\n */\n stroke?: string;\n /** Fill opacity for this series, overriding the chart-level `fillOpacity`. */\n fillOpacity?: number;\n /** Outline width for this series, overriding the chart-level `strokeWidth`. */\n strokeWidth?: number;\n /** Per-point dots for this series, overriding the chart-level `showDots`. */\n dot?: boolean;\n /** Dot radius for this series, overriding the chart-level `dotRadius`. */\n dotRadius?: number;\n /**\n * Highlight this series' hovered point, overriding the chart-level\n * `activeDot`.\n */\n activeDot?: boolean;\n}\n\n/**\n * Map the `radiusAxisDomain` preset to a recharts radius-axis `domain`. Exported\n * for unit tests; not part of the package's public API.\n *\n * The radius axis is what scales the web, so this is the difference between \"the\n * largest value in the data reaches the outer ring\" (recharts' own behavior, and\n * what an unset preset keeps) and \"the outer ring is a known maximum\" (`fixed`\n * plus `radiusAxisDomainMax`). The two only mean something together: a `fixed`\n * preset with no maximum falls back to the data's own top, i.e. that same\n * default.\n */\nexport function radarRadiusAxisDomain(\n preset: 'auto' | 'fixed' | undefined,\n max: number | undefined\n): Readonly<[AxisDomainItem, AxisDomainItem]> | undefined {\n switch (preset) {\n case 'auto':\n return ['auto', 'auto'];\n case 'fixed':\n // A maximum that isn't a positive, finite number can't bound a scale that\n // grows outward from 0: `[0, 0]` collapses the web onto its centre and a\n // negative inverts it. A computed max (`Math.max` over an empty or all-zero\n // series) reaches this, so fall back to the data's own top — the same\n // behavior as `fixed` with no maximum at all.\n return [0, max !== undefined && Number.isFinite(max) && max > 0 ? max : 'auto'];\n default:\n return undefined;\n }\n}\n\n/** The chart-level styling a `seriesSettings` entry overrides. */\nexport interface RadarSeriesDefaults {\n fillOpacity: number;\n strokeWidth: number;\n showDots: boolean;\n dotRadius: number;\n activeDot: boolean | undefined;\n}\n\n/** Resolved recharts `<Radar>` styling for one series. */\nexport interface RadarSeriesStyle {\n fill: string;\n stroke: string;\n fillOpacity: number;\n strokeWidth: number;\n dot: { r: number } | false;\n activeDot: boolean | undefined;\n}\n\n/**\n * Fold a series' `seriesSettings` entry over the chart-level styling. Exported\n * for unit tests; not part of the package's public API.\n *\n * Every fallback is `??`, not `||`, so a deliberate falsy override survives —\n * `fillOpacity: 0` (outline only), `strokeWidth: 0` (fill only), `dot: false`\n * and `activeDot: false` all have to beat a truthy chart-level value. An\n * un-overridden fill stays the `--color-<key>` custom property the shared\n * `ChartContainer` injects from `config`, so the series a caller doesn't name\n * keeps reading its config color.\n */\nexport function radarSeriesStyle(\n key: string,\n settings: RadarChartSeriesSettings | undefined,\n defaults: RadarSeriesDefaults\n): RadarSeriesStyle {\n const fill = settings?.color ?? `var(--color-${key})`;\n const dot = settings?.dot ?? defaults.showDots;\n return {\n fill,\n stroke: settings?.stroke ?? fill,\n fillOpacity: settings?.fillOpacity ?? defaults.fillOpacity,\n strokeWidth: settings?.strokeWidth ?? defaults.strokeWidth,\n dot: dot ? { r: settings?.dotRadius ?? defaults.dotRadius } : false,\n activeDot: settings?.activeDot ?? defaults.activeDot,\n };\n}\n\nexport interface RadarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof radarChartVariants>,\n ChartAnimationProps,\n ChartDataLabelProps {\n /**\n * Row-per-axis data. Each object holds the `angleKey` label + one numeric field\n * per series. Every plotted series needs a value in every row: recharts places a\n * missing one at the centre, which reads as a zero rather than as a gap.\n */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Turned into `--color-<key>` custom properties. Series colors\n * are caller-supplied — reference an existing semantic `--ui-*` token; there is\n * no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Radar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** The categorical axis key placed around the web (e.g. `\"subject\"`). */\n angleKey: string;\n /**\n * Per-series style overrides, keyed by a `dataKeys` entry — color, outline, and\n * dots for one series while the rest keep the chart-level values. Keys that\n * aren't plotted are ignored. An overridden `color` — or `stroke`, which\n * recharts reads first — follows through to that series' legend swatch and\n * tooltip dot.\n */\n seriesSettings?: Record<string, RadarChartSeriesSettings>;\n /** Fill opacity of each radar area. */\n fillOpacity?: number;\n /** Stroke width of each radar outline. */\n strokeWidth?: number;\n /** Render a dot at each axis point. */\n showDots?: boolean;\n /** Radius of the per-point dots when `showDots` is on. */\n dotRadius?: number;\n /**\n * Enlarge the hovered point's dot. On by default (recharts' behavior) — pass\n * `false` for a chart that shouldn't react to the pointer at all.\n */\n activeDot?: boolean;\n /** Render the polar grid (the web). */\n showGrid?: boolean;\n /**\n * Draw the grid's spokes — the radial lines from the centre out to each\n * category. Defaults to `true`; off leaves only the concentric rings.\n */\n radialLines?: boolean;\n /**\n * Render the categorical axis around the web (its spoke labels, tick lines,\n * and outer line). Defaults to `true`. Turning it off keeps the axis itself —\n * so the tooltip still names each category — and only hides its chrome.\n */\n showAngleAxis?: boolean;\n /** Place the spoke labels outside the web (default) or inside it. */\n angleAxisOrientation?: 'inner' | 'outer';\n /** Draw the line around the web that the spoke labels sit against. Defaults to `true`. */\n angleAxisLine?: boolean;\n /**\n * Shape of that line: straight-edged `polygon` (recharts' default) or a smooth\n * `circle`. Independent of `gridType`, so pair them to keep a circular web's\n * outline circular too.\n */\n angleAxisLineType?: 'polygon' | 'circle';\n /** Draw a tick line from the axis line to each spoke label. Defaults to `true`. */\n angleTickLine?: boolean;\n /**\n * Distance from the web to the spoke labels, in px (recharts' default is 8).\n * Left alone, `showLabels` widens it so a vertex's value can't land on its own\n * category label.\n */\n angleTickSize?: number;\n /**\n * Render the value scale — a radial axis of ticks from the centre outward, so\n * an area can be read as a number and not only compared to its neighbours.\n * Defaults to `false` (recharts draws no radius axis unless asked).\n *\n * `radiusAxisAngle` and `radiusAxisOrientation` only describe the drawn scale,\n * so they need it shown. `radiusAxisDomain`, `radiusAxisReversed` and\n * `radiusAxisTickCount` apply while it's hidden too — the first two scale the\n * web, and the third sets how many rings the grid draws (recharts takes the\n * grid's concentric radii from the radius axis' ticks).\n */\n showRadiusAxis?: boolean;\n /**\n * Angle the value scale is drawn at, in degrees counter-clockwise from 3\n * o'clock (recharts' default is `0`). Point it *between* two spokes: on a\n * spoke, the outermost tick collides with that category's own label.\n *\n * The ticks sit over the areas at any angle — a radar's plot area is its\n * areas — so this trades one overlap for none of the other.\n */\n radiusAxisAngle?: number;\n /** Which side of the scale its tick labels sit on. Defaults to `right`. */\n radiusAxisOrientation?: 'left' | 'right' | 'middle';\n /**\n * How the value scale is bounded — and with it the web, since the radius axis\n * is what maps a value to a radius:\n *\n * - unset — recharts' own scaling: the data's largest value reaches the outer\n * ring, so two charts of the same metric aren't comparable.\n * - `fixed` — pin the outer ring to `radiusAxisDomainMax` (the metric's own\n * maximum, e.g. a score out of 150), which is what makes a radar readable as\n * an absolute profile rather than a relative one.\n * - `auto` — fit the data at both ends; the scale need not start at 0.\n *\n * Takes effect whether or not the scale is shown, so a chart can be scaled to a\n * known maximum without displaying the ticks.\n */\n radiusAxisDomain?: 'auto' | 'fixed';\n /**\n * The value at the outer ring when `radiusAxisDomain` is `fixed`. Must be\n * positive — a `0` or negative maximum can't bound an outward-growing scale, so\n * it falls back to the data's own top.\n */\n radiusAxisDomainMax?: number;\n /**\n * Desired number of ticks on the value scale (a hint, not exact). Defaults to\n * recharts' `5`. Also sets how many rings the grid draws, whether or not the\n * scale itself is shown.\n */\n radiusAxisTickCount?: number;\n /**\n * Invert the value scale — the maximum at the centre and 0 at the outer ring —\n * for a metric where less is better (latency, error rate), so a good profile\n * still reads as a large area.\n */\n radiusAxisReversed?: boolean;\n /** Horizontal centre of the web, in px or a percentage of the width. Defaults to `50%`. */\n cx?: number | string;\n /** Vertical centre of the web, in px or a percentage of the height. Defaults to `50%`. */\n cy?: number | string;\n /** Angle the first category sits at, in degrees. Defaults to `90` (12 o'clock). */\n startAngle?: number;\n /**\n * Angle the sweep ends at, in degrees. Defaults to `-270` — a full turn\n * clockwise from `startAngle`. Together the two rotate the web (or wrap the\n * categories into a partial sweep).\n */\n endAngle?: number;\n /**\n * Radius of the hole at the centre, in px or a percentage of the available\n * radius. Defaults to `0`. Also lifts the grid and the areas off the centre,\n * which separates the series where they all bottom out.\n */\n innerRadius?: number | string;\n /** Outer radius of the web, in px or a percentage of the available radius. Defaults to `80%`. */\n outerRadius?: number | string;\n /**\n * Plot-area margin, in px. Omit it entirely to use recharts' default (5 on\n * every side) — passing the object replaces all four, and recharts fills the\n * sides you leave out with `0`, not with `5`. Name every side you want.\n */\n margin?: { top?: number; right?: number; bottom?: number; left?: number };\n showTooltip?: boolean;\n showLegend?: boolean;\n /** Which side of the chart the legend sits on. Defaults to `bottom`. */\n legendPosition?: 'top' | 'bottom';\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting, per-series rows, or extra fields without composing\n * recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\n// Distance from the polygon to the category tick text when value labels are on\n// (recharts' default is 8). Has to clear a CHART_LABEL_FONT_SIZE line plus the\n// LabelList's own 5px offset, or the topmost vertex's value overlaps its tick.\nconst RADAR_LABEL_TICK_SIZE = 30;\n\n/**\n * One series' `<Radar>` (and its value labels).\n *\n * Called as a plain function rather than mounted as `<RadarSeries />`, purely\n * to keep the chart's children readable as a flat list — recharts imposes no\n * constraint here. `RadarChart` picks up the series from the store `<Radar>`\n * registers itself in, and `Radar` passes its children straight through to a\n * label-list context instead of scanning them by type. `<Cell>` is the only\n * child recharts still looks up by element type, and a radar series has none.\n */\nfunction radarSeries({\n seriesKey,\n style,\n animation,\n showLabels,\n labelPosition,\n labelFormatter,\n}: {\n seriesKey: string;\n style: RadarSeriesStyle;\n animation: ResolvedAnimation;\n showLabels: boolean;\n labelPosition: CartesianLabelPosition;\n labelFormatter: ChartDataLabelProps['labelFormatter'];\n}) {\n return (\n <Radar\n key={seriesKey}\n dataKey={seriesKey}\n stroke={style.stroke}\n fill={style.fill}\n fillOpacity={style.fillOpacity}\n strokeWidth={style.strokeWidth}\n dot={style.dot}\n activeDot={style.activeDot}\n {...animation}\n >\n {showLabels && (\n <LabelList\n dataKey={seriesKey}\n position={labelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n // A radar area is a flat `fillOpacity`, so an `inside*` label sits on\n // the *surface tinted by* the series color, not on the color itself —\n // the white on-fill token disappears into it in light mode. Same call\n // as the other translucent families (Area, the composed chart's areas).\n className={resolveLabelFillClass(labelPosition, {\n translucentSeries: true,\n })}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Radar>\n );\n}\n\nconst RadarChart = React.forwardRef<HTMLDivElement, RadarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n angleKey,\n seriesSettings,\n gridType = 'polygon',\n fillOpacity = 0.3,\n strokeWidth = 2,\n showDots = false,\n dotRadius = 3,\n activeDot,\n showGrid = true,\n radialLines = true,\n showAngleAxis = true,\n angleAxisOrientation,\n angleAxisLine = true,\n angleAxisLineType,\n angleTickLine = true,\n angleTickSize,\n showRadiusAxis = false,\n radiusAxisAngle,\n radiusAxisOrientation,\n radiusAxisDomain,\n radiusAxisDomainMax,\n radiusAxisTickCount,\n radiusAxisReversed = false,\n cx,\n cy,\n startAngle,\n endAngle,\n innerRadius,\n outerRadius,\n margin,\n showTooltip = true,\n showLegend = true,\n legendPosition = 'bottom',\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const radarLabelPosition = labelPosition ?? 'top';\n const radiusDomain = radarRadiusAxisDomain(\n radiusAxisDomain,\n radiusAxisDomainMax\n );\n // The radius axis is only mounted when it has something to do: it either\n // paints the scale, or it carries a domain/reversal that rescales the web\n // (recharts registers those from the element even when nothing is drawn).\n // Without one of the three, leaving the element out keeps recharts' own\n // implicit axis — and every existing chart's geometry.\n const hasRadiusAxis =\n showRadiusAxis || radiusDomain !== undefined || radiusAxisReversed;\n const seriesDefaults: RadarSeriesDefaults = {\n fillOpacity,\n strokeWidth,\n showDots,\n dotRadius,\n activeDot,\n };\n\n return (\n <div\n ref={ref}\n data-grid-type={gridType}\n className={cn(radarChartVariants({ gridType }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n // The shared container themes cartesian axis ticks but not polar ones,\n // so scope the angle-axis (spoke) labels and the radius-axis scale to\n // the muted-foreground / border tokens here — otherwise they render\n // near-black (or recharts' raw `#ccc`) and vanish in dark mode. This\n // is a shared-primitives gap (a Chart task); worked around locally, not\n // by editing chart.tsx.\n className=\"size-full [&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-line]:stroke-border [&_.recharts-polar-radius-axis-tick_text]:fill-muted-foreground\"\n >\n <RechartsRadarChart\n data={data as readonly unknown[]}\n cx={cx}\n cy={cy}\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n margin={margin}\n >\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showGrid && (\n <PolarGrid gridType={gridType ?? 'polygon'} radialLines={radialLines} />\n )}\n <PolarAngleAxis\n dataKey={angleKey}\n orientation={angleAxisOrientation}\n axisLineType={angleAxisLineType}\n // `showAngleAxis` hides the chrome rather than dropping the axis:\n // the angle axis is also what maps a row to its category name, so\n // removing it would leave the tooltip labelling rows by index.\n tick={showAngleAxis}\n axisLine={showAngleAxis && angleAxisLine}\n tickLine={showAngleAxis && angleTickLine}\n // Push the category ticks out when value labels are on. recharts\n // gives a Radar's label list a *cartesian* viewBox (width/height 0\n // at the vertex), so `top` offsets straight up in screen space —\n // at the topmost vertex the value lands on its own category tick.\n // The tick text is drawn at `outerRadius + tickSize`, so this is\n // the only lever that adds *absolute* clearance: shrinking\n // outerRadius scales the tick ring down with the polygon and keeps\n // the overlap.\n tickSize={\n angleTickSize ?? (showLabels ? RADAR_LABEL_TICK_SIZE : undefined)\n }\n />\n {hasRadiusAxis && (\n <PolarRadiusAxis\n angle={radiusAxisAngle}\n orientation={radiusAxisOrientation}\n domain={radiusDomain}\n tickCount={radiusAxisTickCount}\n reversed={radiusAxisReversed}\n tick={showRadiusAxis}\n axisLine={showRadiusAxis}\n />\n )}\n {showLegend && (\n <ChartLegend\n verticalAlign={legendPosition}\n content={<ChartLegendContent verticalAlign={legendPosition} />}\n />\n )}\n {dataKeys.map((key) =>\n radarSeries({\n seriesKey: key,\n style: radarSeriesStyle(\n key,\n seriesSettings?.[key],\n seriesDefaults\n ),\n animation,\n showLabels,\n labelPosition: radarLabelPosition,\n labelFormatter,\n })\n )}\n </RechartsRadarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nRadarChart.displayName = 'RadarChart';\n\nexport { RadarChart, radarChartVariants };\n"],"names":["radarChartVariants","cva","radarRadiusAxisDomain","preset","max","radarSeriesStyle","key","settings","defaults","fill","dot","RADAR_LABEL_TICK_SIZE","radarSeries","seriesKey","style","animation","showLabels","labelPosition","labelFormatter","jsx","Radar","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","RadarChart","React","className","config","data","dataKeys","angleKey","seriesSettings","gridType","fillOpacity","strokeWidth","showDots","dotRadius","activeDot","showGrid","radialLines","showAngleAxis","angleAxisOrientation","angleAxisLine","angleAxisLineType","angleTickLine","angleTickSize","showRadiusAxis","radiusAxisAngle","radiusAxisOrientation","radiusAxisDomain","radiusAxisDomainMax","radiusAxisTickCount","radiusAxisReversed","cx","cy","startAngle","endAngle","innerRadius","outerRadius","margin","showTooltip","showLegend","legendPosition","tooltipContent","animate","animationDuration","animationBegin","animationEasing","props","ref","resolveAnimation","radarLabelPosition","radiusDomain","hasRadiusAxis","seriesDefaults","cn","ChartContainer","jsxs","RechartsRadarChart","ChartTooltip","ChartTooltipContent","PolarGrid","PolarAngleAxis","PolarRadiusAxis","ChartLegend","ChartLegendContent"],"mappings":";;;;;;;AAwCA,MAAMA,KAAqBC,GAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,UAAU;AAAA,MACR,SAAS;AAAA,MACT,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,iBAAiB;AAAA,IACf,UAAU;AAAA,EAAA;AAEd,CAAC;AA4CM,SAASC,GACdC,GACAC,GACwD;AACxD,UAAQD,GAAA;AAAA,IACN,KAAK;AACH,aAAO,CAAC,QAAQ,MAAM;AAAA,IACxB,KAAK;AAMH,aAAO,CAAC,GAAGC,MAAQ,UAAa,OAAO,SAASA,CAAG,KAAKA,IAAM,IAAIA,IAAM,MAAM;AAAA,IAChF;AACE;AAAA,EAAO;AAEb;AAgCO,SAASC,GACdC,GACAC,GACAC,GACkB;AAClB,QAAMC,KAAOF,KAAA,gBAAAA,EAAU,UAAS,eAAeD,CAAG,KAC5CI,KAAMH,KAAA,gBAAAA,EAAU,QAAOC,EAAS;AACtC,SAAO;AAAA,IACL,MAAAC;AAAA,IACA,SAAQF,KAAA,gBAAAA,EAAU,WAAUE;AAAA,IAC5B,cAAaF,KAAA,gBAAAA,EAAU,gBAAeC,EAAS;AAAA,IAC/C,cAAaD,KAAA,gBAAAA,EAAU,gBAAeC,EAAS;AAAA,IAC/C,KAAKE,IAAM,EAAE,IAAGH,KAAA,gBAAAA,EAAU,cAAaC,EAAS,cAAc;AAAA,IAC9D,YAAWD,KAAA,gBAAAA,EAAU,cAAaC,EAAS;AAAA,EAAA;AAE/C;AAgLA,MAAMG,KAAwB;AAY9B,SAASC,GAAY;AAAA,EACnB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AACF,GAOG;AACD,SACE,gBAAAC;A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,GAAI;AAAA,kBAEnE1C,KACC,gBAAApB,EAAC+D,IAAA,EAAU,UAAUjD,KAAY,WAAW,aAAAO,GAA0B;AAAA,kBAExE,gBAAArB;AAAA,oBAACgE;AAAA,oBAAA;AAAA,sBACC,SAASpD;AAAA,sBACT,aAAaW;AAAA,sBACb,cAAcE;AAAA,sBAId,MAAMH;AAAA,sBACN,UAAUA,KAAiBE;AAAA,sBAC3B,UAAUF,KAAiBI;AAAA,sBAS3B,UACEC,MAAkB9B,IAAaL,KAAwB;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAG1D+D,KACC,gBAAAvD;AAAA,oBAACiE;AAAA,oBAAA;AAAA,sBACC,OAAOpC;AAAA,sBACP,aAAaC;AAAA,sBACb,QAAQwB;AAAA,sBACR,WAAWrB;AAAA,sBACX,UAAUC;AAAA,sBACV,MAAMN;AAAA,sBACN,UAAUA;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAGbe,KACC,gBAAA3C;AAAA,oBAACkE;AAAA,oBAAA;AAAA,sBACC,eAAetB;AAAA,sBACf,SAAS,gBAAA5C,EAACmE,IAAA,EAAmB,eAAevB,EAAA,CAAgB;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAG/DjC,EAAS;AAAA,oBAAI,CAACxB,MACbM,GAAY;AAAA,sBACV,WAAWN;AAAA,sBACX,OAAOD;AAAA,wBACLC;AAAA,wBACA0B,KAAA,gBAAAA,EAAiB1B;AAAA,wBACjBqE;AAAA,sBAAA;AAAA,sBAEF,WAAA5D;AAAA,sBACA,YAAAC;AAAA,sBACA,eAAewD;AAAA,sBACf,gBAAAtD;AAAA,oBAAA,CACD;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAO,GAAW,cAAc;"}
1
+ {"version":3,"file":"radar-chart.js","sources":["../../../../src/components/ui/radar-chart/radar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n LabelList,\n PolarAngleAxis,\n PolarGrid,\n PolarRadiusAxis,\n Radar,\n RadarChart as RechartsRadarChart,\n type AxisDomainItem,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n toLabelFormatter,\n resolveLabelFillClass,\n CHART_LABEL_FONT_SIZE,\n type ChartConfig,\n type ChartPalette,\n type ChartAnimationProps,\n type ChartDataLabelProps,\n type CartesianLabelPosition,\n type ResolvedAnimation,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives — the first\n// polar chart type. The single CVA axis is the design's Radar-chart variant set:\n// `gridType` (the polar web is drawn as straight-edged `polygon` rings or smooth\n// `circle` rings). The class stays empty because recharts' SVG — not CSS — draws\n// the web: `gridType` drives `<PolarGrid gridType>`. CVA is kept so the variant\n// set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved value is\n// also mirrored onto `data-grid-type`.\nconst radarChartVariants = cva('', {\n variants: {\n gridType: {\n polygon: '',\n circle: '',\n },\n },\n defaultVariants: {\n gridType: 'polygon',\n },\n});\n\n/** Per-series overrides, keyed by the series' `dataKeys` entry. */\nexport interface RadarChartSeriesSettings {\n /**\n * Fill for this series' area, overriding its `config` color. Reference an\n * existing semantic `--ui-*` token, same as `config`.\n */\n color?: string;\n /**\n * Outline color, when it should read differently from the fill (e.g. a solid\n * outline over a barely-tinted area). Defaults to the fill.\n *\n * recharts derives a Radar's legend/tooltip color from its stroke first, so\n * setting this alone also recolors that series' legend swatch and tooltip dot\n * — set `color` too if the marker should keep following the fill.\n */\n stroke?: string;\n /** Fill opacity for this series, overriding the chart-level `fillOpacity`. */\n fillOpacity?: number;\n /** Outline width for this series, overriding the chart-level `strokeWidth`. */\n strokeWidth?: number;\n /** Per-point dots for this series, overriding the chart-level `showDots`. */\n dot?: boolean;\n /** Dot radius for this series, overriding the chart-level `dotRadius`. */\n dotRadius?: number;\n /**\n * Highlight this series' hovered point, overriding the chart-level\n * `activeDot`.\n */\n activeDot?: boolean;\n}\n\n/**\n * Map the `radiusAxisDomain` preset to a recharts radius-axis `domain`. Exported\n * for unit tests; not part of the package's public API.\n *\n * The radius axis is what scales the web, so this is the difference between \"the\n * largest value in the data reaches the outer ring\" (recharts' own behavior, and\n * what an unset preset keeps) and \"the outer ring is a known maximum\" (`fixed`\n * plus `radiusAxisDomainMax`). The two only mean something together: a `fixed`\n * preset with no maximum falls back to the data's own top, i.e. that same\n * default.\n */\nexport function radarRadiusAxisDomain(\n preset: 'auto' | 'fixed' | undefined,\n max: number | undefined\n): Readonly<[AxisDomainItem, AxisDomainItem]> | undefined {\n switch (preset) {\n case 'auto':\n return ['auto', 'auto'];\n case 'fixed':\n // A maximum that isn't a positive, finite number can't bound a scale that\n // grows outward from 0: `[0, 0]` collapses the web onto its centre and a\n // negative inverts it. A computed max (`Math.max` over an empty or all-zero\n // series) reaches this, so fall back to the data's own top — the same\n // behavior as `fixed` with no maximum at all.\n return [0, max !== undefined && Number.isFinite(max) && max > 0 ? max : 'auto'];\n default:\n return undefined;\n }\n}\n\n/** The chart-level styling a `seriesSettings` entry overrides. */\nexport interface RadarSeriesDefaults {\n fillOpacity: number;\n strokeWidth: number;\n showDots: boolean;\n dotRadius: number;\n activeDot: boolean | undefined;\n}\n\n/** Resolved recharts `<Radar>` styling for one series. */\nexport interface RadarSeriesStyle {\n fill: string;\n stroke: string;\n fillOpacity: number;\n strokeWidth: number;\n dot: { r: number } | false;\n activeDot: boolean | undefined;\n}\n\n/**\n * Fold a series' `seriesSettings` entry over the chart-level styling. Exported\n * for unit tests; not part of the package's public API.\n *\n * Every fallback is `??`, not `||`, so a deliberate falsy override survives —\n * `fillOpacity: 0` (outline only), `strokeWidth: 0` (fill only), `dot: false`\n * and `activeDot: false` all have to beat a truthy chart-level value. An\n * un-overridden fill stays the `--color-<key>` custom property the shared\n * `ChartContainer` injects from `config`, so the series a caller doesn't name\n * keeps reading its config color.\n */\nexport function radarSeriesStyle(\n key: string,\n settings: RadarChartSeriesSettings | undefined,\n defaults: RadarSeriesDefaults\n): RadarSeriesStyle {\n const fill = settings?.color ?? `var(--color-${key})`;\n const dot = settings?.dot ?? defaults.showDots;\n return {\n fill,\n stroke: settings?.stroke ?? fill,\n fillOpacity: settings?.fillOpacity ?? defaults.fillOpacity,\n strokeWidth: settings?.strokeWidth ?? defaults.strokeWidth,\n dot: dot ? { r: settings?.dotRadius ?? defaults.dotRadius } : false,\n activeDot: settings?.activeDot ?? defaults.activeDot,\n };\n}\n\nexport interface RadarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof radarChartVariants>,\n ChartAnimationProps,\n ChartDataLabelProps {\n /**\n * The dataviz palette this chart's series are painted from. Series that\n * state no `color` of their own take a stop of it. See `ChartPalette`.\n */\n palette?: ChartPalette;\n /**\n * Row-per-axis data. Each object holds the `angleKey` label + one numeric field\n * per series. Every plotted series needs a value in every row: recharts places a\n * missing one at the centre, which reads as a zero rather than as a gap.\n */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `icon` / `tone` (imported from the shared\n * `Chart` primitives). Turned into `--color-<key>` custom properties. Series\n * take their colour from the container's `palette`; each entry maps a key to a\n * `label` and an optional `tone`.\n */\n config: ChartConfig;\n /** Series to plot — one `<Radar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** The categorical axis key placed around the web (e.g. `\"subject\"`). */\n angleKey: string;\n /**\n * Per-series style overrides, keyed by a `dataKeys` entry — color, outline, and\n * dots for one series while the rest keep the chart-level values. Keys that\n * aren't plotted are ignored. An overridden `color` — or `stroke`, which\n * recharts reads first — follows through to that series' legend swatch and\n * tooltip dot.\n */\n seriesSettings?: Record<string, RadarChartSeriesSettings>;\n /** Fill opacity of each radar area. */\n fillOpacity?: number;\n /** Stroke width of each radar outline. */\n strokeWidth?: number;\n /** Render a dot at each axis point. */\n showDots?: boolean;\n /** Radius of the per-point dots when `showDots` is on. */\n dotRadius?: number;\n /**\n * Enlarge the hovered point's dot. On by default (recharts' behavior) — pass\n * `false` for a chart that shouldn't react to the pointer at all.\n */\n activeDot?: boolean;\n /** Render the polar grid (the web). */\n showGrid?: boolean;\n /**\n * Draw the grid's spokes — the radial lines from the centre out to each\n * category. Defaults to `true`; off leaves only the concentric rings.\n */\n radialLines?: boolean;\n /**\n * Render the categorical axis around the web (its spoke labels, tick lines,\n * and outer line). Defaults to `true`. Turning it off keeps the axis itself —\n * so the tooltip still names each category — and only hides its chrome.\n */\n showAngleAxis?: boolean;\n /** Place the spoke labels outside the web (default) or inside it. */\n angleAxisOrientation?: 'inner' | 'outer';\n /** Draw the line around the web that the spoke labels sit against. Defaults to `true`. */\n angleAxisLine?: boolean;\n /**\n * Shape of that line: straight-edged `polygon` (recharts' default) or a smooth\n * `circle`. Independent of `gridType`, so pair them to keep a circular web's\n * outline circular too.\n */\n angleAxisLineType?: 'polygon' | 'circle';\n /** Draw a tick line from the axis line to each spoke label. Defaults to `true`. */\n angleTickLine?: boolean;\n /**\n * Distance from the web to the spoke labels, in px (recharts' default is 8).\n * Left alone, `showLabels` widens it so a vertex's value can't land on its own\n * category label.\n */\n angleTickSize?: number;\n /**\n * Render the value scale — a radial axis of ticks from the centre outward, so\n * an area can be read as a number and not only compared to its neighbours.\n * Defaults to `false` (recharts draws no radius axis unless asked).\n *\n * `radiusAxisAngle` and `radiusAxisOrientation` only describe the drawn scale,\n * so they need it shown. `radiusAxisDomain`, `radiusAxisReversed` and\n * `radiusAxisTickCount` apply while it's hidden too — the first two scale the\n * web, and the third sets how many rings the grid draws (recharts takes the\n * grid's concentric radii from the radius axis' ticks).\n */\n showRadiusAxis?: boolean;\n /**\n * Angle the value scale is drawn at, in degrees counter-clockwise from 3\n * o'clock (recharts' default is `0`). Point it *between* two spokes: on a\n * spoke, the outermost tick collides with that category's own label.\n *\n * The ticks sit over the areas at any angle — a radar's plot area is its\n * areas — so this trades one overlap for none of the other.\n */\n radiusAxisAngle?: number;\n /** Which side of the scale its tick labels sit on. Defaults to `right`. */\n radiusAxisOrientation?: 'left' | 'right' | 'middle';\n /**\n * How the value scale is bounded — and with it the web, since the radius axis\n * is what maps a value to a radius:\n *\n * - unset — recharts' own scaling: the data's largest value reaches the outer\n * ring, so two charts of the same metric aren't comparable.\n * - `fixed` — pin the outer ring to `radiusAxisDomainMax` (the metric's own\n * maximum, e.g. a score out of 150), which is what makes a radar readable as\n * an absolute profile rather than a relative one.\n * - `auto` — fit the data at both ends; the scale need not start at 0.\n *\n * Takes effect whether or not the scale is shown, so a chart can be scaled to a\n * known maximum without displaying the ticks.\n */\n radiusAxisDomain?: 'auto' | 'fixed';\n /**\n * The value at the outer ring when `radiusAxisDomain` is `fixed`. Must be\n * positive — a `0` or negative maximum can't bound an outward-growing scale, so\n * it falls back to the data's own top.\n */\n radiusAxisDomainMax?: number;\n /**\n * Desired number of ticks on the value scale (a hint, not exact). Defaults to\n * recharts' `5`. Also sets how many rings the grid draws, whether or not the\n * scale itself is shown.\n */\n radiusAxisTickCount?: number;\n /**\n * Invert the value scale — the maximum at the centre and 0 at the outer ring —\n * for a metric where less is better (latency, error rate), so a good profile\n * still reads as a large area.\n */\n radiusAxisReversed?: boolean;\n /** Horizontal centre of the web, in px or a percentage of the width. Defaults to `50%`. */\n cx?: number | string;\n /** Vertical centre of the web, in px or a percentage of the height. Defaults to `50%`. */\n cy?: number | string;\n /** Angle the first category sits at, in degrees. Defaults to `90` (12 o'clock). */\n startAngle?: number;\n /**\n * Angle the sweep ends at, in degrees. Defaults to `-270` — a full turn\n * clockwise from `startAngle`. Together the two rotate the web (or wrap the\n * categories into a partial sweep).\n */\n endAngle?: number;\n /**\n * Radius of the hole at the centre, in px or a percentage of the available\n * radius. Defaults to `0`. Also lifts the grid and the areas off the centre,\n * which separates the series where they all bottom out.\n */\n innerRadius?: number | string;\n /** Outer radius of the web, in px or a percentage of the available radius. Defaults to `80%`. */\n outerRadius?: number | string;\n /**\n * Plot-area margin, in px. Omit it entirely to use recharts' default (5 on\n * every side) — passing the object replaces all four, and recharts fills the\n * sides you leave out with `0`, not with `5`. Name every side you want.\n */\n margin?: { top?: number; right?: number; bottom?: number; left?: number };\n showTooltip?: boolean;\n showLegend?: boolean;\n /** Which side of the chart the legend sits on. Defaults to `bottom`. */\n legendPosition?: 'top' | 'bottom';\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` —\n * to customize formatting, per-series rows, or extra fields without composing\n * recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\n// Distance from the polygon to the category tick text when value labels are on\n// (recharts' default is 8). Has to clear a CHART_LABEL_FONT_SIZE line plus the\n// LabelList's own 5px offset, or the topmost vertex's value overlaps its tick.\nconst RADAR_LABEL_TICK_SIZE = 30;\n\n/**\n * One series' `<Radar>` (and its value labels).\n *\n * Called as a plain function rather than mounted as `<RadarSeries />`, purely\n * to keep the chart's children readable as a flat list — recharts imposes no\n * constraint here. `RadarChart` picks up the series from the store `<Radar>`\n * registers itself in, and `Radar` passes its children straight through to a\n * label-list context instead of scanning them by type. `<Cell>` is the only\n * child recharts still looks up by element type, and a radar series has none.\n */\nfunction radarSeries({\n seriesKey,\n style,\n animation,\n showLabels,\n labelPosition,\n labelFormatter,\n}: {\n seriesKey: string;\n style: RadarSeriesStyle;\n animation: ResolvedAnimation;\n showLabels: boolean;\n labelPosition: CartesianLabelPosition;\n labelFormatter: ChartDataLabelProps['labelFormatter'];\n}) {\n return (\n <Radar\n key={seriesKey}\n dataKey={seriesKey}\n stroke={style.stroke}\n fill={style.fill}\n fillOpacity={style.fillOpacity}\n strokeWidth={style.strokeWidth}\n dot={style.dot}\n activeDot={style.activeDot}\n {...animation}\n >\n {showLabels && (\n <LabelList\n dataKey={seriesKey}\n position={labelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n // A radar area is a flat `fillOpacity`, so an `inside*` label sits on\n // the *surface tinted by* the series color, not on the color itself —\n // the white on-fill token disappears into it in light mode. Same call\n // as the other translucent families (Area, the composed chart's areas).\n className={resolveLabelFillClass(labelPosition, {\n translucentSeries: true,\n })}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Radar>\n );\n}\n\nconst RadarChart = React.forwardRef<HTMLDivElement, RadarChartProps>(\n (\n {\n className,\n config,\n palette,\n data,\n dataKeys,\n angleKey,\n seriesSettings,\n gridType = 'polygon',\n fillOpacity = 0.3,\n strokeWidth = 2,\n showDots = false,\n dotRadius = 3,\n activeDot,\n showGrid = true,\n radialLines = true,\n showAngleAxis = true,\n angleAxisOrientation,\n angleAxisLine = true,\n angleAxisLineType,\n angleTickLine = true,\n angleTickSize,\n showRadiusAxis = false,\n radiusAxisAngle,\n radiusAxisOrientation,\n radiusAxisDomain,\n radiusAxisDomainMax,\n radiusAxisTickCount,\n radiusAxisReversed = false,\n cx,\n cy,\n startAngle,\n endAngle,\n innerRadius,\n outerRadius,\n margin,\n showTooltip = true,\n showLegend = true,\n legendPosition = 'bottom',\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const radarLabelPosition = labelPosition ?? 'top';\n const radiusDomain = radarRadiusAxisDomain(\n radiusAxisDomain,\n radiusAxisDomainMax\n );\n // The radius axis is only mounted when it has something to do: it either\n // paints the scale, or it carries a domain/reversal that rescales the web\n // (recharts registers those from the element even when nothing is drawn).\n // Without one of the three, leaving the element out keeps recharts' own\n // implicit axis — and every existing chart's geometry.\n const hasRadiusAxis =\n showRadiusAxis || radiusDomain !== undefined || radiusAxisReversed;\n const seriesDefaults: RadarSeriesDefaults = {\n fillOpacity,\n strokeWidth,\n showDots,\n dotRadius,\n activeDot,\n };\n\n return (\n <div\n ref={ref}\n data-grid-type={gridType}\n className={cn(radarChartVariants({ gridType }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n // The shared container themes cartesian axis ticks but not polar ones,\n // so scope the angle-axis (spoke) labels and the radius-axis scale to\n // the muted-foreground / border tokens here — otherwise they render\n // near-black (or recharts' raw `#ccc`) and vanish in dark mode. This\n // is a shared-primitives gap (a Chart task); worked around locally, not\n // by editing chart.tsx.\n className=\"size-full [&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-line]:stroke-border [&_.recharts-polar-radius-axis-tick_text]:fill-muted-foreground\"\n >\n <RechartsRadarChart\n data={data as readonly unknown[]}\n cx={cx}\n cy={cy}\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n margin={margin}\n >\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showGrid && (\n <PolarGrid gridType={gridType ?? 'polygon'} radialLines={radialLines} />\n )}\n <PolarAngleAxis\n dataKey={angleKey}\n orientation={angleAxisOrientation}\n axisLineType={angleAxisLineType}\n // `showAngleAxis` hides the chrome rather than dropping the axis:\n // the angle axis is also what maps a row to its category name, so\n // removing it would leave the tooltip labelling rows by index.\n tick={showAngleAxis}\n axisLine={showAngleAxis && angleAxisLine}\n tickLine={showAngleAxis && angleTickLine}\n // Push the category ticks out when value labels are on. recharts\n // gives a Radar's label list a *cartesian* viewBox (width/height 0\n // at the vertex), so `top` offsets straight up in screen space —\n // at the topmost vertex the value lands on its own category tick.\n // The tick text is drawn at `outerRadius + tickSize`, so this is\n // the only lever that adds *absolute* clearance: shrinking\n // outerRadius scales the tick ring down with the polygon and keeps\n // the overlap.\n tickSize={\n angleTickSize ?? (showLabels ? RADAR_LABEL_TICK_SIZE : undefined)\n }\n />\n {hasRadiusAxis && (\n <PolarRadiusAxis\n angle={radiusAxisAngle}\n orientation={radiusAxisOrientation}\n domain={radiusDomain}\n tickCount={radiusAxisTickCount}\n reversed={radiusAxisReversed}\n tick={showRadiusAxis}\n axisLine={showRadiusAxis}\n />\n )}\n {showLegend && (\n <ChartLegend\n verticalAlign={legendPosition}\n content={<ChartLegendContent verticalAlign={legendPosition} />}\n />\n )}\n {dataKeys.map((key) =>\n radarSeries({\n seriesKey: key,\n style: radarSeriesStyle(\n key,\n seriesSettings?.[key],\n seriesDefaults\n ),\n animation,\n showLabels,\n labelPosition: radarLabelPosition,\n labelFormatter,\n })\n )}\n </RechartsRadarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nRadarChart.displayName = 'RadarChart';\n\nexport { RadarChart, radarChartVariants };\n"],"names":["radarChartVariants","cva","radarRadiusAxisDomain","preset","max","radarSeriesStyle","key","settings","defaults","fill","dot","RADAR_LABEL_TICK_SIZE","radarSeries","seriesKey","style","animation","showLabels","labelPosition","labelFormatter","jsx","Radar","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","RadarChart","React","className","config","palette","data","dataKeys","angleKey","seriesSettings","gridType","fillOpacity","strokeWidth","showDots","dotRadius","activeDot","showGrid","radialLines","showAngleAxis","angleAxisOrientation","angleAxisLine","angleAxisLineType","angleTickLine","angleTickSize","showRadiusAxis","radiusAxisAngle","radiusAxisOrientation","radiusAxisDomain","radiusAxisDomainMax","radiusAxisTickCount","radiusAxisReversed","cx","cy","startAngle","endAngle","innerRadius","outerRadius","margin","showTooltip","showLegend","legendPosition","tooltipContent","animate","animationDuration","animationBegin","animationEasing","props","ref","resolveAnimation","radarLabelPosition","radiusDomain","hasRadiusAxis","seriesDefaults","cn","ChartContainer","jsxs","RechartsRadarChart","ChartTooltip","ChartTooltipContent","PolarGrid","PolarAngleAxis","PolarRadiusAxis","ChartLegend","ChartLegendContent"],"mappings":";;;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