@acronis-platform/ui-react 2.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 (243) hide show
  1. package/dist/components/ui/accordion-container/accordion-container.js +144 -0
  2. package/dist/components/ui/accordion-container/accordion-container.js.map +1 -0
  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/avatar/avatar.js +33 -22
  7. package/dist/components/ui/avatar/avatar.js.map +1 -1
  8. package/dist/components/ui/bar-chart/bar-chart.js +295 -293
  9. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  10. package/dist/components/ui/card/card.js +150 -74
  11. package/dist/components/ui/card/card.js.map +1 -1
  12. package/dist/components/ui/card-section/card-section.js +111 -0
  13. package/dist/components/ui/card-section/card-section.js.map +1 -0
  14. package/dist/components/ui/category-bar/category-bar.js +109 -93
  15. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  16. package/dist/components/ui/chart/chart-palette.js +113 -0
  17. package/dist/components/ui/chart/chart-palette.js.map +1 -0
  18. package/dist/components/ui/chart/chart.js +176 -129
  19. package/dist/components/ui/chart/chart.js.map +1 -1
  20. package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
  21. package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
  22. package/dist/components/ui/chart-state/chart-state.js +48 -34
  23. package/dist/components/ui/chart-state/chart-state.js.map +1 -1
  24. package/dist/components/ui/chart-widget/chart-widget.js +87 -0
  25. package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
  26. package/dist/components/ui/composed-chart/composed-chart.js +117 -115
  27. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  28. package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
  29. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  30. package/dist/components/ui/data-table/data-table.js +4 -2
  31. package/dist/components/ui/data-table/data-table.js.map +1 -1
  32. package/dist/components/ui/empty-overlay/empty-overlay.js +49 -0
  33. package/dist/components/ui/empty-overlay/empty-overlay.js.map +1 -0
  34. package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
  35. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  36. package/dist/components/ui/histogram/histogram.js +94 -92
  37. package/dist/components/ui/histogram/histogram.js.map +1 -1
  38. package/dist/components/ui/input/input.js.map +1 -1
  39. package/dist/components/ui/label/label.js +2 -9
  40. package/dist/components/ui/label/label.js.map +1 -1
  41. package/dist/components/ui/line-chart/line-chart.js +143 -141
  42. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  43. package/dist/components/ui/metric/metric.js +74 -185
  44. package/dist/components/ui/metric/metric.js.map +1 -1
  45. package/dist/components/ui/page-content/page-content.js.map +1 -1
  46. package/dist/components/ui/pie-chart/pie-chart.js +201 -195
  47. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  48. package/dist/components/ui/radar-chart/radar-chart.js +133 -131
  49. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  50. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
  51. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  52. package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
  53. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  54. package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
  55. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  56. package/dist/components/ui/section/section.js +157 -31
  57. package/dist/components/ui/section/section.js.map +1 -1
  58. package/dist/components/ui/stepper/stepper.js +24 -24
  59. package/dist/components/ui/stepper/stepper.js.map +1 -1
  60. package/dist/components/ui/stepper-item/stepper-item.js +43 -24
  61. package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
  62. package/dist/components/ui/table/table.js +27 -27
  63. package/dist/components/ui/table/table.js.map +1 -1
  64. package/dist/components/ui/treemap/treemap.js +133 -124
  65. package/dist/components/ui/treemap/treemap.js.map +1 -1
  66. package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
  67. package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
  68. package/dist/components/ui/wizard/wizard.js +59 -0
  69. package/dist/components/ui/wizard/wizard.js.map +1 -0
  70. package/dist/hooks/use-wizard.js +75 -0
  71. package/dist/hooks/use-wizard.js.map +1 -0
  72. package/dist/index.js +540 -525
  73. package/dist/index.js.map +1 -1
  74. package/dist/llms/accordion-container.md +181 -0
  75. package/dist/llms/accordion.md +124 -0
  76. package/dist/llms/alert.md +225 -0
  77. package/dist/llms/app-shell-chat.md +415 -0
  78. package/dist/llms/area-chart.md +355 -0
  79. package/dist/llms/avatar.md +208 -0
  80. package/dist/llms/bar-chart.md +406 -0
  81. package/dist/llms/breadcrumb.md +326 -0
  82. package/dist/llms/button-group.md +298 -0
  83. package/dist/llms/button-icon-input.md +142 -0
  84. package/dist/llms/button-icon-menu.md +209 -0
  85. package/dist/llms/button-icon.md +128 -0
  86. package/dist/llms/button-menu.md +172 -0
  87. package/dist/llms/button.md +185 -0
  88. package/dist/llms/calendar-panel.md +733 -0
  89. package/dist/llms/calendar.md +188 -0
  90. package/dist/llms/card-filter.md +214 -0
  91. package/dist/llms/card-section.md +293 -0
  92. package/dist/llms/card.md +447 -0
  93. package/dist/llms/carousel-dialog.md +156 -0
  94. package/dist/llms/category-bar.md +193 -0
  95. package/dist/llms/chart-state.md +190 -0
  96. package/dist/llms/chart-widget.md +209 -0
  97. package/dist/llms/chart.md +182 -0
  98. package/dist/llms/checkbox.md +257 -0
  99. package/dist/llms/chip.md +195 -0
  100. package/dist/llms/combobox.md +164 -0
  101. package/dist/llms/composed-chart.md +508 -0
  102. package/dist/llms/confidence-cone.md +277 -0
  103. package/dist/llms/data-table.md +474 -0
  104. package/dist/llms/date-range-picker.md +272 -0
  105. package/dist/llms/description-list.md +131 -0
  106. package/dist/llms/dialog-footer-carousel.md +147 -0
  107. package/dist/llms/dialog-footer-default.md +142 -0
  108. package/dist/llms/dialog-root.md +246 -0
  109. package/dist/llms/dialog-welcome.md +223 -0
  110. package/dist/llms/dialog.md +403 -0
  111. package/dist/llms/dropdown-menu.md +193 -0
  112. package/dist/llms/empty-overlay.md +146 -0
  113. package/dist/llms/empty.md +156 -0
  114. package/dist/llms/field.md +185 -0
  115. package/dist/llms/filter-cards.md +157 -0
  116. package/dist/llms/filter-chips.md +323 -0
  117. package/dist/llms/filter-search.md +512 -0
  118. package/dist/llms/form.md +154 -0
  119. package/dist/llms/funnel-chart.md +333 -0
  120. package/dist/llms/grid.md +80 -0
  121. package/dist/llms/histogram.md +190 -0
  122. package/dist/llms/input-date-picker.md +203 -0
  123. package/dist/llms/input-otp.md +173 -0
  124. package/dist/llms/input-password.md +197 -0
  125. package/dist/llms/input-search.md +170 -0
  126. package/dist/llms/input-select.md +278 -0
  127. package/dist/llms/input-text-area.md +271 -0
  128. package/dist/llms/input-text.md +192 -0
  129. package/dist/llms/line-chart.md +369 -0
  130. package/dist/llms/link.md +209 -0
  131. package/dist/llms/loading.md +130 -0
  132. package/dist/llms/meter.md +177 -0
  133. package/dist/llms/metric.md +204 -0
  134. package/dist/llms/number-field.md +122 -0
  135. package/dist/llms/page-content.md +69 -0
  136. package/dist/llms/page-header.md +182 -0
  137. package/dist/llms/pagination.md +133 -0
  138. package/dist/llms/pie-chart.md +307 -0
  139. package/dist/llms/popover.md +252 -0
  140. package/dist/llms/progress-circle.md +126 -0
  141. package/dist/llms/progress.md +111 -0
  142. package/dist/llms/radar-chart.md +316 -0
  143. package/dist/llms/radial-bar-chart.md +319 -0
  144. package/dist/llms/radio.md +255 -0
  145. package/dist/llms/resizable.md +195 -0
  146. package/dist/llms/sankey-chart.md +208 -0
  147. package/dist/llms/scatter-chart.md +239 -0
  148. package/dist/llms/scroll-area.md +183 -0
  149. package/dist/llms/section.md +401 -0
  150. package/dist/llms/select.md +210 -0
  151. package/dist/llms/separator.md +87 -0
  152. package/dist/llms/sheet.md +202 -0
  153. package/dist/llms/sidebar-primary.md +360 -0
  154. package/dist/llms/sidebar-secondary.md +417 -0
  155. package/dist/llms/skeleton.md +81 -0
  156. package/dist/llms/slider.md +97 -0
  157. package/dist/llms/spinner.md +100 -0
  158. package/dist/llms/stack.md +80 -0
  159. package/dist/llms/stepper-item.md +309 -0
  160. package/dist/llms/stepper.md +251 -0
  161. package/dist/llms/switch.md +140 -0
  162. package/dist/llms/table.md +436 -0
  163. package/dist/llms/tabs.md +197 -0
  164. package/dist/llms/tag.md +139 -0
  165. package/dist/llms/timeline.md +361 -0
  166. package/dist/llms/timer.md +259 -0
  167. package/dist/llms/toast.md +241 -0
  168. package/dist/llms/toggle-group.md +121 -0
  169. package/dist/llms/toolbar.md +453 -0
  170. package/dist/llms/tooltip.md +164 -0
  171. package/dist/llms/treemap.md +254 -0
  172. package/dist/llms/trend-indicator.md +132 -0
  173. package/dist/llms/widget-placeholder.md +169 -0
  174. package/dist/llms/wizard.md +412 -0
  175. package/dist/llms.txt +142 -0
  176. package/dist/react.js +540 -525
  177. package/dist/react.js.map +1 -1
  178. package/dist/src/components/ui/accordion-container/accordion-container.d.ts +44 -0
  179. package/dist/src/components/ui/accordion-container/index.d.ts +1 -0
  180. package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
  181. package/dist/src/components/ui/avatar/avatar.d.ts +27 -8
  182. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
  183. package/dist/src/components/ui/button/button.d.ts +1 -1
  184. package/dist/src/components/ui/card/card.d.ts +69 -8
  185. package/dist/src/components/ui/card/index.d.ts +1 -1
  186. package/dist/src/components/ui/card-section/card-section.d.ts +50 -0
  187. package/dist/src/components/ui/card-section/index.d.ts +1 -0
  188. package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
  189. package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
  190. package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
  191. package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
  192. package/dist/src/components/ui/chart/chart.d.ts +66 -15
  193. package/dist/src/components/ui/chart/index.d.ts +4 -2
  194. package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
  195. package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
  196. package/dist/src/components/ui/chart-state/index.d.ts +1 -0
  197. package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
  198. package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
  199. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
  200. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
  201. package/dist/src/components/ui/dialog/dialog.d.ts +1 -1
  202. package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +20 -0
  203. package/dist/src/components/ui/empty-overlay/index.d.ts +2 -0
  204. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
  205. package/dist/src/components/ui/grid/grid.d.ts +1 -1
  206. package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
  207. package/dist/src/components/ui/label/index.d.ts +1 -1
  208. package/dist/src/components/ui/label/label.d.ts +1 -5
  209. package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
  210. package/dist/src/components/ui/metric/metric.d.ts +13 -14
  211. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
  212. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
  213. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
  214. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
  215. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
  216. package/dist/src/components/ui/section/index.d.ts +1 -1
  217. package/dist/src/components/ui/section/section.d.ts +75 -6
  218. package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
  219. package/dist/src/components/ui/stack/stack.d.ts +1 -1
  220. package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
  221. package/dist/src/components/ui/tag/tag.d.ts +1 -1
  222. package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
  223. package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
  224. package/dist/src/components/ui/wizard/index.d.ts +1 -0
  225. package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
  226. package/dist/src/hooks/index.d.ts +1 -0
  227. package/dist/src/hooks/use-wizard.d.ts +80 -0
  228. package/dist/src/index.d.ts +5 -3
  229. package/dist/ui-react.css +1 -1
  230. package/package.json +12 -6
  231. package/dist/components/ui/app-shell/app-shell.js +0 -75
  232. package/dist/components/ui/app-shell/app-shell.js.map +0 -1
  233. package/dist/components/ui/auth-layout/auth-layout.js +0 -56
  234. package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
  235. package/dist/components/ui/collapsible/collapsible.js +0 -22
  236. package/dist/components/ui/collapsible/collapsible.js.map +0 -1
  237. package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
  238. package/dist/src/components/ui/app-shell/index.d.ts +0 -1
  239. package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
  240. package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
  241. package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
  242. package/dist/src/components/ui/collapsible/index.d.ts +0 -1
  243. package/dist/src/components/ui/label/label.docs.d.ts +0 -10
@@ -1,11 +1,11 @@
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("", {
1
+ import { jsx as r, jsxs as y } from "react/jsx-runtime";
2
+ import * as $ from "react";
3
+ import { cva as ue } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { AreaChart as ve, CartesianGrid as Le, XAxis as Ce, YAxis as Ae, Area as be, LabelList as Re, ReferenceLine as xe, Brush as Te } from "recharts";
5
+ import { cn as $e } from "../../../lib/utils.js";
6
+ import { resolveAnimation as ye, resolveCartesianLabelPosition as De, CHART_LABEL_MARGIN as Pe, resolveRotatedTickAnchor as ke, CHART_LABEL_FONT_SIZE as Fe, resolveLabelFillClass as Ne, toLabelFormatter as Oe, resolveChartReferenceValue as _e, resolveReferenceLineProps as Ge, resolveBrushProps as Ie, resolveXAxisTitle as we, resolveXAxisHeight as ze, resolveYAxisTitle as Be, resolveAxisDomain as He, toReferenceLineList as je } from "../chart/chart-format.js";
7
+ import { ChartContainer as Ee, ChartTooltip as Ve, ChartTooltipContent as Xe, ChartLegend as Me, ChartLegendContent as We } from "../chart/chart.js";
8
+ const Ye = ue("", {
9
9
  variants: {
10
10
  layout: {
11
11
  single: "",
@@ -21,12 +21,12 @@ const We = pe("", {
21
21
  fill: "gradient"
22
22
  }
23
23
  });
24
- function Ye({
24
+ function Ke({
25
25
  dataKeys: s,
26
26
  gradientId: n,
27
- colorFor: i
27
+ colorFor: l
28
28
  }) {
29
- return /* @__PURE__ */ r("defs", { children: s.map((a) => /* @__PURE__ */ $(
29
+ return /* @__PURE__ */ r("defs", { children: s.map((a) => /* @__PURE__ */ y(
30
30
  "linearGradient",
31
31
  {
32
32
  id: `${n}-${a}`,
@@ -35,192 +35,194 @@ function Ye({
35
35
  x2: "0",
36
36
  y2: "1",
37
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 })
38
+ /* @__PURE__ */ r("stop", { offset: "5%", stopColor: l(a), stopOpacity: 0.8 }),
39
+ /* @__PURE__ */ r("stop", { offset: "95%", stopColor: l(a), stopOpacity: 0.1 })
40
40
  ]
41
41
  },
42
42
  a
43
43
  )) });
44
44
  }
45
- const Ke = T.forwardRef(
45
+ const Ze = $.forwardRef(
46
46
  ({
47
47
  className: s,
48
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,
49
+ palette: l,
50
+ data: a,
51
+ dataKeys: c,
52
+ xKey: u,
53
+ xAxisLabel: v,
54
+ yAxisLabel: L,
55
+ yUnit: D,
56
+ layout: d = "single",
57
+ fill: f = "gradient",
58
+ curve: P = "monotone",
59
+ strokeWidth: k = 2,
60
+ fillOpacity: F = 0.4,
61
+ showDots: N = !1,
62
+ dotSize: O = 3,
63
+ showActiveDot: _,
64
+ connectNulls: G = !1,
64
65
  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,
72
- yTickFormatter: j,
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) => {
66
+ referenceLine: I,
67
+ showGrid: w = !0,
68
+ showTooltip: z = !0,
69
+ showLegend: B = !0,
70
+ showXAxis: H = !0,
71
+ showYAxis: j = !0,
72
+ xTickFormatter: C,
73
+ yTickFormatter: E,
74
+ xAxisAngle: h,
75
+ xAxisInterval: V,
76
+ yAxisTickCount: X,
77
+ yAxisDomain: M,
78
+ gridDashed: W,
79
+ gridHorizontal: Y,
80
+ gridVertical: K,
81
+ tooltipContent: Z,
82
+ animate: q,
83
+ animationDuration: J,
84
+ animationBegin: Q,
85
+ animationEasing: U,
86
+ showLabels: A = !1,
87
+ labelPosition: S,
88
+ labelFormatter: g,
89
+ showBrush: ee = !1,
90
+ brushHeight: oe,
91
+ brushAriaLabel: re,
92
+ ...ae
93
+ }, te) => {
94
+ const ie = ye({
95
+ animate: q,
96
+ animationDuration: J,
97
+ animationBegin: Q,
98
+ animationEasing: U
99
+ }), b = d === "stacked", le = De({
100
+ labelPosition: S,
101
+ isStacked: b
102
+ }), m = f === "gradient", se = je(I), p = (o) => {
102
103
  var e;
103
104
  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
+ }, ne = A || Object.values(t ?? {}).some((o) => o.showLabel), ce = we(v), de = Be(L), fe = He(M), he = ze(v, h), R = `area-gradient-${$.useId().replace(/:/g, "")}`;
105
106
  return /* @__PURE__ */ r(
106
107
  "div",
107
108
  {
108
- ref: ae,
109
- "data-layout": c,
110
- "data-fill": d,
111
- className: Te(We({ layout: c, fill: d }), s),
112
- ...re,
109
+ ref: te,
110
+ "data-layout": d,
111
+ "data-fill": f,
112
+ className: $e(Ye({ layout: d, fill: f }), s),
113
+ ...ae,
113
114
  children: /* @__PURE__ */ r(
114
- je,
115
+ Ee,
115
116
  {
116
117
  config: n,
118
+ palette: l,
117
119
  className: "size-full [&_.recharts-label]:fill-foreground",
118
- children: /* @__PURE__ */ $(
119
- ue,
120
+ children: /* @__PURE__ */ y(
121
+ ve,
120
122
  {
121
- data: i,
122
- margin: se ? De : void 0,
123
+ data: a,
124
+ margin: ne ? Pe : void 0,
123
125
  children: [
124
- h && /* @__PURE__ */ r(
125
- Ye,
126
+ m && /* @__PURE__ */ r(
127
+ Ke,
126
128
  {
127
- dataKeys: a,
128
- gradientId: b,
129
- colorFor: m
129
+ dataKeys: c,
130
+ gradientId: R,
131
+ colorFor: p
130
132
  }
131
133
  ),
132
- I && /* @__PURE__ */ r(
133
- ve,
134
+ w && /* @__PURE__ */ r(
135
+ Le,
134
136
  {
135
- horizontal: W ?? !0,
136
- vertical: Y ?? !1,
137
- strokeDasharray: M ? "3 3" : void 0
137
+ horizontal: Y ?? !0,
138
+ vertical: K ?? !1,
139
+ strokeDasharray: W ? "3 3" : void 0
138
140
  }
139
141
  ),
140
142
  /* @__PURE__ */ r(
141
- Le,
143
+ Ce,
142
144
  {
143
- dataKey: p,
145
+ dataKey: u,
144
146
  type: "category",
145
- hide: !B,
147
+ hide: !H,
146
148
  tickLine: !1,
147
149
  axisLine: !1,
148
150
  tickMargin: 8,
149
- tickFormatter: L,
150
- angle: f,
151
- interval: E,
152
- textAnchor: Pe(f),
153
- height: fe,
154
- label: ne
151
+ tickFormatter: C,
152
+ angle: h,
153
+ interval: V,
154
+ textAnchor: ke(h),
155
+ height: he,
156
+ label: ce
155
157
  }
156
158
  ),
157
159
  /* @__PURE__ */ r(
158
- Ce,
160
+ Ae,
159
161
  {
160
162
  type: "number",
161
- hide: !H,
163
+ hide: !j,
162
164
  tickLine: !1,
163
165
  axisLine: !1,
164
- unit: y,
165
- tickFormatter: j,
166
- tickCount: V,
167
- domain: de,
168
- width: v ? 72 : void 0,
169
- label: ce
166
+ unit: D,
167
+ tickFormatter: E,
168
+ tickCount: X,
169
+ domain: fe,
170
+ width: L ? 72 : void 0,
171
+ label: de
170
172
  }
171
173
  ),
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;
174
+ z && /* @__PURE__ */ r(Ve, { content: Z ?? /* @__PURE__ */ r(Xe, {}) }),
175
+ B && /* @__PURE__ */ r(Me, { content: /* @__PURE__ */ r(We, {}) }),
176
+ c.map((o) => {
177
+ const e = t == null ? void 0 : t[o], i = (e == null ? void 0 : e.showDots) ?? N, x = (e == null ? void 0 : e.dotSize) ?? O, me = _ ?? i, pe = (e == null ? void 0 : e.showLabel) ?? A, T = (e == null ? void 0 : e.labelPosition) ?? le;
176
178
  return /* @__PURE__ */ r(
177
- Ae,
179
+ be,
178
180
  {
179
- type: (e == null ? void 0 : e.curveType) ?? D ?? "monotone",
181
+ type: (e == null ? void 0 : e.curveType) ?? P ?? "monotone",
180
182
  dataKey: o,
181
- stackId: A ? "a" : void 0,
182
- stroke: m(o),
183
- strokeWidth: (e == null ? void 0 : e.strokeWidth) ?? P,
183
+ stackId: b ? "a" : void 0,
184
+ stroke: p(o),
185
+ strokeWidth: (e == null ? void 0 : e.strokeWidth) ?? k,
184
186
  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,
187
+ fill: m ? `url(#${R}-${o})` : p(o),
188
+ fillOpacity: (e == null ? void 0 : e.fillOpacity) ?? (m ? 1 : F),
189
+ dot: i ? { r: x } : !1,
190
+ activeDot: me ? { r: x + 2 } : !1,
191
+ connectNulls: G,
192
+ ...ie,
193
+ children: pe && /* @__PURE__ */ r(
194
+ Re,
193
195
  {
194
196
  dataKey: o,
195
- position: x,
196
- formatter: Ne(S),
197
- className: Fe(x, {
197
+ position: T,
198
+ formatter: Oe(g),
199
+ className: Ne(T, {
198
200
  translucentSeries: !0
199
201
  }),
200
- fontSize: ke
202
+ fontSize: Fe
201
203
  }
202
204
  )
203
205
  },
204
206
  o
205
207
  );
206
208
  }),
207
- le.map((o, e) => {
208
- const l = Oe(o, i, a);
209
- return l === void 0 ? null : /* @__PURE__ */ r(
210
- Re,
209
+ se.map((o, e) => {
210
+ const i = _e(o, a, c);
211
+ return i === void 0 ? null : /* @__PURE__ */ r(
212
+ xe,
211
213
  {
212
- y: l,
213
- ..._e(o.label, o.labelPosition)
214
+ y: i,
215
+ ...Ge(o.label, o.labelPosition)
214
216
  },
215
217
  `${o.label ?? "ref"}-${e}`
216
218
  );
217
219
  }),
218
- g && /* @__PURE__ */ r(
219
- xe,
220
+ ee && /* @__PURE__ */ r(
221
+ Te,
220
222
  {
221
- dataKey: p,
222
- tickFormatter: L,
223
- ...Ge({ brushHeight: ee, brushAriaLabel: oe })
223
+ dataKey: u,
224
+ tickFormatter: C,
225
+ ...Ie({ brushHeight: oe, brushAriaLabel: re })
224
226
  }
225
227
  )
226
228
  ]
@@ -232,9 +234,9 @@ const Ke = T.forwardRef(
232
234
  );
233
235
  }
234
236
  );
235
- Ke.displayName = "AreaChart";
237
+ Ze.displayName = "AreaChart";
236
238
  export {
237
- Ke as AreaChart,
238
- We as areaChartVariants
239
+ Ze as AreaChart,
240
+ Ye as areaChartVariants
239
241
  };
240
242
  //# 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 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,QAA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AGA,EAAI,SAAS,KAAK,IAAI0C,CAAK;AAAA,oBAAA;AAAA,kBAKzC,CAAC;AAAA,kBACA9C,KACC,gBAAA7C;AAAA,oBAACgG;AAAA,oBAAA;AAAA,sBACC,SAASxF;AAAA,sBACT,eAAeoB;AAAA,sBACd,GAAGqE,GAAkB,EAAE,aAAAnD,IAAa,gBAAAC,IAAgB;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACvD;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA5C,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 ChartPalette,\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 /**\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 /** 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` / `icon` / `tone` (from the shared `Chart`\n * primitives). Series take their colour from the container's `palette`; each\n * entry maps a key to a `label` and an optional `tone`.\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 palette,\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 palette={palette}\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","palette","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":";;;;;;;AAyDA,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;AAiGD,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,IAA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QC,GAA2B5C,GAAK1C,GAAMX,CAAQ;AAC5D,2BAAIgG,MAAU,SAAkB,OAE9B,gBAAA7F;AAAA,sBAAC+F;AAAA,sBAAA;AAAA,wBAEC,GAAGF;AAAA,wBACF,GAAGG,GAA0B9C,EAAI,OAAOA,EAAI,aAAa;AAAA,sBAAA;AAAA,sBAFrD,GAAGA,EAAI,SAAS,KAAK,IAAI0C,CAAK;AAAA,oBAAA;AAAA,kBAKzC,CAAC;AAAA,kBACA9C,MACC,gBAAA9C;AAAA,oBAACiG;AAAA,oBAAA;AAAA,sBACC,SAASxF;AAAA,sBACT,eAAeoB;AAAA,sBACd,GAAGqE,GAAkB,EAAE,aAAAnD,IAAa,gBAAAC,IAAgB;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACvD;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA7C,GAAU,cAAc;"}
@@ -1,9 +1,9 @@
1
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 c } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cva as d } 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 s = c(
6
+ const g = d(
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: {
@@ -22,16 +22,7 @@ const s = c(
22
22
  color: "teal"
23
23
  }
24
24
  }
25
- ), b = o.forwardRef(({ className: a, color: r, ...e }, i) => /* @__PURE__ */ t(
26
- v.Root,
27
- {
28
- ref: i,
29
- className: l(s({ color: r }), a),
30
- ...e
31
- }
32
- ));
33
- b.displayName = "Avatar";
34
- const u = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
25
+ ), m = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
35
26
  v.Image,
36
27
  {
37
28
  ref: e,
@@ -39,8 +30,8 @@ const u = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
39
30
  ...r
40
31
  }
41
32
  ));
42
- u.displayName = "AvatarImage";
43
- const n = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
33
+ m.displayName = "AvatarImage";
34
+ const c = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
44
35
  v.Fallback,
45
36
  {
46
37
  ref: e,
@@ -48,8 +39,28 @@ const n = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
48
39
  ...r
49
40
  }
50
41
  ));
51
- n.displayName = "AvatarFallback";
52
- const d = o.forwardRef(
42
+ c.displayName = "AvatarFallback";
43
+ const f = o.forwardRef(
44
+ ({
45
+ className: a,
46
+ color: r,
47
+ variant: e = "text",
48
+ label: s = "SB",
49
+ icon: b,
50
+ children: i,
51
+ ...u
52
+ }, n) => /* @__PURE__ */ t(
53
+ v.Root,
54
+ {
55
+ ref: n,
56
+ className: l(g({ color: r }), a),
57
+ ...u,
58
+ children: i !== void 0 ? i : e === "icon" ? b : /* @__PURE__ */ t(c, { children: s })
59
+ }
60
+ )
61
+ );
62
+ f.displayName = "Avatar";
63
+ const x = o.forwardRef(
53
64
  ({ className: a, ...r }, e) => /* @__PURE__ */ t(
54
65
  "div",
55
66
  {
@@ -62,12 +73,12 @@ const d = o.forwardRef(
62
73
  }
63
74
  )
64
75
  );
65
- d.displayName = "AvatarGroup";
76
+ x.displayName = "AvatarGroup";
66
77
  export {
67
- b as Avatar,
68
- n as AvatarFallback,
69
- d as AvatarGroup,
70
- u as AvatarImage,
71
- s as avatarVariants
78
+ f as Avatar,
79
+ c as AvatarFallback,
80
+ x as AvatarGroup,
81
+ m as AvatarImage,
82
+ g as avatarVariants
72
83
  };
73
84
  //# sourceMappingURL=avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Wraps Base UI's Avatar primitive (Root / Image / Fallback), themed by the\n// dedicated next-gen `--ui-avatar-*` token tier from @acronis-platform/tokens-pd.\n// A 32px circle (`--ui-avatar-global-avatar-size` / `-border-border-radius`) with a 2px\n// ring (`-border-border-width` / `-border-color`) — the ring is what visually\n// separates avatars when they overlap in an `AvatarGroup`. When no image is set\n// (or it fails to load) the `AvatarFallback` shows initials.\n//\n// The ring is a `box-shadow`, not a CSS `border`: Figma draws the 2px stroke\n// with `strokeAlign: OUTSIDE`, so the 32px is the *colored circle* and the ring\n// sits outside it. A CSS border would be drawn inside the border-box, shrinking\n// the visible circle to 28px (PLTFRM-92393). A box-shadow ring paints outside\n// without inflating the 32px layout box, so the `AvatarGroup` overlap step\n// (32px − 6px gap) still matches the design.\n//\n// It is written as a raw `[box-shadow:…]` arbitrary property, not Tailwind's\n// `shadow-[…]` utility: the utility routes the value through `--tw-shadow-color`\n// (`0 0 0 var(--tw-shadow-color, <spread>) <color>`), which resolves\n// inconsistently for a spread-only ring across engine versions. The raw property\n// emits the literal declaration so every renderer draws the same 2px outset ring.\n//\n// `color` selects one of the eight Figma color schemes; it tints the fallback\n// background (`--ui-avatar-color-<scheme>`) and the initials\n// (`--ui-avatar-label-color-<scheme>`). Initials use the 12px/16px/600 caption\n// style baked into the design (`text-xs font-semibold leading-4`).\nconst avatarVariants = cva(\n 'relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden ' +\n 'size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] ' +\n '[box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] ' +\n 'text-xs font-semibold leading-4',\n {\n variants: {\n color: {\n teal: 'bg-[var(--ui-avatar-color-teal)] text-[var(--ui-avatar-label-color-teal)]',\n violet:\n 'bg-[var(--ui-avatar-color-violet)] text-[var(--ui-avatar-label-color-violet)]',\n red: 'bg-[var(--ui-avatar-color-red)] text-[var(--ui-avatar-label-color-red)]',\n yellow:\n 'bg-[var(--ui-avatar-color-yellow)] text-[var(--ui-avatar-label-color-yellow)]',\n orange:\n 'bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]',\n blue: 'bg-[var(--ui-avatar-color-blue)] text-[var(--ui-avatar-label-color-blue)]',\n gray: 'bg-[var(--ui-avatar-color-gray)] text-[var(--ui-avatar-label-color-gray)]',\n green:\n 'bg-[var(--ui-avatar-color-green)] text-[var(--ui-avatar-label-color-green)]',\n },\n },\n defaultVariants: {\n color: 'teal',\n },\n }\n);\n\nexport interface AvatarProps\n extends\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {}\n\n/**\n * A user/entity avatar: a colored circle showing an image or initials. Compose\n * `AvatarImage` and/or `AvatarFallback` inside; stack several in `AvatarGroup`.\n */\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, color, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(avatarVariants({ color }), className)}\n {...props}\n />\n));\nAvatar.displayName = 'Avatar';\n\nexport type AvatarImageProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Image\n>;\n\n/** The avatar image; hidden by Base UI until it loads, revealing the fallback. */\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n AvatarImageProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('size-full object-cover', className)}\n {...props}\n />\n));\nAvatarImage.displayName = 'AvatarImage';\n\nexport type AvatarFallbackProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Fallback\n>;\n\n/** Shown when there's no image (or it fails) — typically the user's initials. */\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n AvatarFallbackProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn('flex size-full items-center justify-center', className)}\n {...props}\n />\n));\nAvatarFallback.displayName = 'AvatarFallback';\n\nexport type AvatarGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Overlapping stack of avatars. Each avatar after the first is pulled left by\n * `--ui-avatar-global-avatar-group-gap` (a negative offset), so their 2px\n * borders form the layered look; later avatars render above earlier ones.\n */\nconst AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center [&>*:not(:first-child)]:ms-[var(--ui-avatar-global-avatar-group-gap)]',\n className\n )}\n {...props}\n />\n )\n);\nAvatarGroup.displayName = 'AvatarGroup';\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarGroup, avatarVariants };\n"],"names":["avatarVariants","cva","Avatar","React","className","color","props","ref","jsx","AvatarPrimitive","cn","AvatarImage","AvatarFallback","AvatarGroup"],"mappings":";;;;;AA8BA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EAIA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,QACE;AAAA,QACF,KAAK;AAAA,QACL,QACE;AAAA,QACF,QACE;AAAA,QACF,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GAWMC,IAASC,EAAM,WAGnB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGC,KAASC,MACjC,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAGV,EAAe,EAAE,OAAAK,EAAA,CAAO,GAAGD,CAAS;AAAA,IACjD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAO,cAAc;AAOrB,MAAMS,IAAcR,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAG,0BAA0BN,CAAS;AAAA,IAChD,GAAGE;AAAA,EAAA;AACN,CACD;AACDK,EAAY,cAAc;AAO1B,MAAMC,IAAiBT,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAG,8CAA8CN,CAAS;AAAA,IACpE,GAAGE;AAAA,EAAA;AACN,CACD;AACDM,EAAe,cAAc;AAS7B,MAAMC,IAAcV,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV;AACAO,EAAY,cAAc;"}
1
+ {"version":3,"file":"avatar.js","sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Wraps Base UI's Avatar primitive (Root / Image / Fallback), themed by the\n// dedicated next-gen `--ui-avatar-*` token tier from @acronis-platform/tokens-pd.\n// A 32px circle (`--ui-avatar-global-avatar-size` / `-border-border-radius`) with a 2px\n// ring (`-border-border-width` / `-border-color`) — the ring is what visually\n// separates avatars when they overlap in an `AvatarGroup`. When no image is set\n// (or it fails to load) the `AvatarFallback` shows initials.\n//\n// `variant`/`label`/`icon` are a convenience for the common no-photo case (the\n// Figma component has no \"image\" variant at all — just Text/Icon): with no\n// `children` composed, Avatar auto-renders either `label` (Text) or `icon`\n// (Icon). Composing `AvatarImage`/`AvatarFallback` as `children` — for the real\n// photo-with-fallback case — always takes precedence over both.\n//\n// \"No `children` composed\" means `children === undefined` specifically, not\n// merely falsy. An explicit `null` child is a deliberate \"render nothing\" and\n// has to stay empty: `timeline.tsx`'s marker passes\n// `icon ?? (initials ? <AvatarFallback/> : null)`, so a blank marker resolves to\n// `null`, and a `children ?? …` check would paint the default 'SB' label over\n// what should be an empty dot.\n//\n// The ring is a `box-shadow`, not a CSS `border`: Figma draws the 2px stroke\n// with `strokeAlign: OUTSIDE`, so the 32px is the *colored circle* and the ring\n// sits outside it. A CSS border would be drawn inside the border-box, shrinking\n// the visible circle to 28px (PLTFRM-92393). A box-shadow ring paints outside\n// without inflating the 32px layout box, so the `AvatarGroup` overlap step\n// (32px − 6px gap) still matches the design.\n//\n// It is written as a raw `[box-shadow:…]` arbitrary property, not Tailwind's\n// `shadow-[…]` utility: the utility routes the value through `--tw-shadow-color`\n// (`0 0 0 var(--tw-shadow-color, <spread>) <color>`), which resolves\n// inconsistently for a spread-only ring across engine versions. The raw property\n// emits the literal declaration so every renderer draws the same 2px outset ring.\n//\n// `color` selects one of the eight Figma color schemes; it tints the fallback\n// background (`--ui-avatar-color-<scheme>`) and the initials\n// (`--ui-avatar-label-color-<scheme>`). Initials use the 12px/16px/600 caption\n// style baked into the design (`text-xs font-semibold leading-4`).\nconst avatarVariants = cva(\n 'relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden ' +\n 'size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] ' +\n '[box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] ' +\n 'text-xs font-semibold leading-4',\n {\n variants: {\n color: {\n teal: 'bg-[var(--ui-avatar-color-teal)] text-[var(--ui-avatar-label-color-teal)]',\n violet:\n 'bg-[var(--ui-avatar-color-violet)] text-[var(--ui-avatar-label-color-violet)]',\n red: 'bg-[var(--ui-avatar-color-red)] text-[var(--ui-avatar-label-color-red)]',\n yellow:\n 'bg-[var(--ui-avatar-color-yellow)] text-[var(--ui-avatar-label-color-yellow)]',\n orange:\n 'bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]',\n blue: 'bg-[var(--ui-avatar-color-blue)] text-[var(--ui-avatar-label-color-blue)]',\n gray: 'bg-[var(--ui-avatar-color-gray)] text-[var(--ui-avatar-label-color-gray)]',\n green:\n 'bg-[var(--ui-avatar-color-green)] text-[var(--ui-avatar-label-color-green)]',\n },\n },\n defaultVariants: {\n color: 'teal',\n },\n }\n);\n\nexport type AvatarImageProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Image\n>;\n\n/** The avatar image; hidden by Base UI until it loads, revealing the fallback. */\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n AvatarImageProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('size-full object-cover', className)}\n {...props}\n />\n));\nAvatarImage.displayName = 'AvatarImage';\n\nexport type AvatarFallbackProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Fallback\n>;\n\n/** Shown when there's no image (or it fails) — typically the user's initials. */\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n AvatarFallbackProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn('flex size-full items-center justify-center', className)}\n {...props}\n />\n));\nAvatarFallback.displayName = 'AvatarFallback';\n\nexport interface AvatarProps\n extends\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Selects the auto-rendered fallback content when no `children` are\n * composed: initials (`label`) or an `icon`. Ignored once `children` (e.g.\n * `AvatarImage`/`AvatarFallback`) are composed directly — including an\n * explicit `null`, which renders an empty circle.\n */\n variant?: 'text' | 'icon';\n /**\n * Initials shown for the `text` variant when no `children` are composed\n * (i.e. `children` is `undefined`).\n */\n label?: string;\n /**\n * Icon shown for the `icon` variant when no `children` are composed\n * (i.e. `children` is `undefined`).\n */\n icon?: React.ReactNode;\n}\n\n/**\n * A user/entity avatar: a colored circle showing an image, initials, or an\n * icon. Compose `AvatarImage`/`AvatarFallback` for the photo-with-fallback\n * case, or use `variant`/`label`/`icon` for a quick text or icon badge; stack\n * several in `AvatarGroup`.\n */\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(\n (\n {\n className,\n color,\n variant = 'text',\n label = 'SB',\n icon,\n children,\n ...props\n },\n ref\n ) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(avatarVariants({ color }), className)}\n {...props}\n >\n {children !== undefined ? (\n children\n ) : variant === 'icon' ? (\n icon\n ) : (\n <AvatarFallback>{label}</AvatarFallback>\n )}\n </AvatarPrimitive.Root>\n )\n);\nAvatar.displayName = 'Avatar';\n\nexport type AvatarGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Overlapping stack of avatars. Each avatar after the first is pulled left by\n * `--ui-avatar-global-avatar-group-gap` (a negative offset), so their 2px\n * borders form the layered look; later avatars render above earlier ones.\n */\nconst AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center [&>*:not(:first-child)]:ms-[var(--ui-avatar-global-avatar-group-gap)]',\n className\n )}\n {...props}\n />\n )\n);\nAvatarGroup.displayName = 'AvatarGroup';\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarGroup, avatarVariants };\n"],"names":["avatarVariants","cva","AvatarImage","React","className","props","ref","jsx","AvatarPrimitive","cn","AvatarFallback","Avatar","color","variant","label","icon","children","AvatarGroup"],"mappings":";;;;;AA2CA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EAIA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,QACE;AAAA,QACF,KAAK;AAAA,QACL,QACE;AAAA,QACF,QACE;AAAA,QACF,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GAOMC,IAAcC,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAG,0BAA0BL,CAAS;AAAA,IAChD,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAY,cAAc;AAO1B,MAAMQ,IAAiBP,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG,EAAG,8CAA8CL,CAAS;AAAA,IACpE,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAe,cAAc;AA+B7B,MAAMC,IAASR,EAAM;AAAA,EAInB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAQ;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGX;AAAA,EAAA,GAELC,MAEA,gBAAAC;AAAA,IAACC,EAAgB;AAA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