@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,35 +1,36 @@
1
- import { jsx as o, jsxs as S, Fragment as ie } from "react/jsx-runtime";
2
- import * as L from "react";
3
- import { RadialBarChart as ce, PolarGrid as se, PolarAngleAxis as ue, RadialBar as A, Cell as me, LabelList as de, Label as fe } from "recharts";
4
- import { cn as he } from "../../../lib/utils.js";
5
- import { resolveAnimation as ge, CHART_LABEL_FONT_SIZE as pe, resolveLabelFillClass as Ce } from "../chart/chart-format.js";
6
- import { ChartLegendContent as j, ChartContainer as xe, ChartTooltip as ve, ChartLegend as be, ChartTooltipContent as T } from "../chart/chart.js";
7
- function z({
1
+ import { jsxs as N, jsx as i, Fragment as me } from "react/jsx-runtime";
2
+ import * as $ from "react";
3
+ import { RadialBarChart as fe, PolarGrid as de, PolarAngleAxis as he, RadialBar as O, Cell as ge, LabelList as pe, Label as ve } from "recharts";
4
+ import { cn as I } from "../../../lib/utils.js";
5
+ import { resolveAnimation as Ce, CHART_LABEL_FONT_SIZE as xe, resolveLabelFillClass as be } from "../chart/chart-format.js";
6
+ import { resolveChartColors as Se, ChartTooltip as Ne, ChartContainer as Te, ChartLegendContent as Be, ChartTooltipContent as F } from "../chart/chart.js";
7
+ import { CHART_DEFAULT_PALETTE as $e } from "../chart/chart-palette.js";
8
+ function V({
8
9
  centerLabel: a
9
10
  }) {
10
- return /* @__PURE__ */ o(
11
- fe,
11
+ return /* @__PURE__ */ i(
12
+ ve,
12
13
  {
13
- content: ({ viewBox: r }) => {
14
- if (!r || !("cx" in r)) return null;
15
- const { cx: e = 0, cy: t = 0 } = r, n = a.value != null, l = a.label != null, i = n && l;
16
- return /* @__PURE__ */ S("g", { children: [
17
- n && /* @__PURE__ */ o(
14
+ content: ({ viewBox: t }) => {
15
+ if (!t || !("cx" in t)) return null;
16
+ const { cx: n = 0, cy: e = 0 } = t, l = a.value != null, o = a.label != null, r = l && o;
17
+ return /* @__PURE__ */ N("g", { children: [
18
+ l && /* @__PURE__ */ i(
18
19
  "text",
19
20
  {
20
- x: e,
21
- y: i ? t - 10 : t,
21
+ x: n,
22
+ y: r ? e - 10 : e,
22
23
  textAnchor: "middle",
23
24
  dominantBaseline: "central",
24
25
  className: "fill-foreground text-2xl font-semibold",
25
26
  children: a.value
26
27
  }
27
28
  ),
28
- l && /* @__PURE__ */ o(
29
+ o && /* @__PURE__ */ i(
29
30
  "text",
30
31
  {
31
- x: e,
32
- y: i ? t + 13 : t,
32
+ x: n,
33
+ y: r ? e + 13 : e,
33
34
  textAnchor: "middle",
34
35
  dominantBaseline: "central",
35
36
  className: "fill-muted-foreground text-sm",
@@ -41,337 +42,368 @@ function z({
41
42
  }
42
43
  );
43
44
  }
44
- function Se(a) {
45
- const { format: r, name: e, value: t, formatter: n } = a;
46
- if (t == null) return "";
47
- const l = n ? n(t) : String(t);
48
- return r === "name-value" && e != null ? `${e}: ${l}` : l;
45
+ function ke(a) {
46
+ const { format: t, name: n, value: e, formatter: l } = a;
47
+ if (e == null) return "";
48
+ const o = l ? l(e) : String(e);
49
+ return t === "name-value" && n != null ? `${n}: ${o}` : o;
49
50
  }
50
- const Be = 3;
51
- function Ne(a) {
52
- const { value: r, domain: e, segments: t, sweep: n, closed: l } = a, i = l ? t : t - 1, c = i > 0 ? Math.min(Math.max(a.gap, 0), n / (2 * i)) : 0, s = (n - c * i) / t, [u, d] = e, C = d - u;
53
- let v = (C > 0 ? Math.min(Math.max((r - u) / C, 0), 1) : 0) * s * t;
54
- const m = [];
55
- for (let f = 0; f < t; f++) {
56
- const h = Math.min(Math.max(v, 0), s);
57
- v -= h, m.push({ key: `seg-${f}-value`, degrees: h, kind: "value" }), m.push({
58
- key: `seg-${f}-track`,
59
- degrees: s - h,
51
+ const Me = 3;
52
+ function Re(a) {
53
+ const { value: t, domain: n, segments: e, sweep: l, closed: o } = a, r = o ? e : e - 1, s = r > 0 ? Math.min(Math.max(a.gap, 0), l / (2 * r)) : 0, h = (l - s * r) / e, [u, x] = n, m = x - u;
54
+ let S = (m > 0 ? Math.min(Math.max((t - u) / m, 0), 1) : 0) * h * e;
55
+ const f = [];
56
+ for (let g = 0; g < e; g++) {
57
+ const p = Math.min(Math.max(S, 0), h);
58
+ S -= p, f.push({ key: `seg-${g}-value`, degrees: p, kind: "value" }), f.push({
59
+ key: `seg-${g}-track`,
60
+ degrees: h - p,
60
61
  kind: "track"
61
- }), c > 0 && (l || f < t - 1) && m.push({ key: `seg-${f}-gap`, degrees: c, kind: "gap" });
62
+ }), s > 0 && (o || g < e - 1) && f.push({ key: `seg-${g}-gap`, degrees: s, kind: "gap" });
62
63
  }
63
- return m;
64
+ return f;
64
65
  }
65
- function ke(a, r) {
66
- return a === "gap" ? "transparent" : a === "track" ? "var(--ui-background-surface-secondary)" : `var(--color-${r})`;
66
+ function Le(a, t) {
67
+ return a === "gap" ? "transparent" : a === "track" ? "var(--ui-border-on-status-neutral)" : `var(--color-${t})`;
67
68
  }
68
- function $e(a) {
69
+ function Ee(a) {
69
70
  var u;
70
- const { config: r, row: e, nameKey: t, dataKey: n, domainMax: l } = a, i = String(e[t]), c = e[n], s = typeof c == "number" ? c.toLocaleString() : String(c ?? "");
71
+ const { config: t, row: n, nameKey: e, dataKey: l, domainMax: o } = a, r = String(n[e]), s = n[l], h = typeof s == "number" ? s.toLocaleString() : String(s ?? "");
71
72
  return {
72
- colorName: i,
73
- label: ((u = r[i]) == null ? void 0 : u.label) ?? i,
73
+ colorName: r,
74
+ label: ((u = t[r]) == null ? void 0 : u.label) ?? r,
74
75
  // The gauge's scale is the other half of the reading, so a known maximum
75
76
  // comes along: "29 / 38", not a bare "29".
76
- valueText: l == null ? s : `${s} / ${l.toLocaleString()}`
77
+ valueText: o == null ? h : `${h} / ${o.toLocaleString()}`
77
78
  };
78
79
  }
79
- function Le({
80
+ function Fe({
80
81
  active: a,
81
- payload: r,
82
- ...e
82
+ payload: t,
83
+ ...n
83
84
  }) {
84
- const { colorName: t, label: n, valueText: l } = $e(e);
85
- return /* @__PURE__ */ o(
86
- T,
85
+ const { colorName: e, label: l, valueText: o } = Ee(n);
86
+ return /* @__PURE__ */ i(
87
+ F,
87
88
  {
88
89
  active: a,
89
- payload: r == null ? void 0 : r.slice(0, 1),
90
+ payload: t == null ? void 0 : t.slice(0, 1),
90
91
  hideLabel: !0,
91
- formatter: () => /* @__PURE__ */ S(ie, { children: [
92
- /* @__PURE__ */ o(
92
+ formatter: () => /* @__PURE__ */ N(me, { children: [
93
+ /* @__PURE__ */ i(
93
94
  "div",
94
95
  {
95
96
  className: "h-2.5 w-2.5 shrink-0 rounded-full",
96
- style: { backgroundColor: `var(--color-${t})` }
97
+ style: { backgroundColor: `var(--color-${e})` }
97
98
  }
98
99
  ),
99
- /* @__PURE__ */ S("div", { className: "flex flex-1 items-center justify-between gap-2 leading-none", children: [
100
- /* @__PURE__ */ o("span", { className: "text-muted-foreground", children: n }),
101
- /* @__PURE__ */ o("span", { className: "font-medium tabular-nums text-foreground", children: l })
100
+ /* @__PURE__ */ N("div", { className: "flex flex-1 items-center justify-between gap-2 leading-none", children: [
101
+ /* @__PURE__ */ i("span", { className: "text-muted-foreground", children: l }),
102
+ /* @__PURE__ */ i("span", { className: "font-medium tabular-nums text-foreground", children: o })
102
103
  ] })
103
104
  ] })
104
105
  }
105
106
  );
106
107
  }
107
- function Te(a, r) {
108
- const e = a == null ? void 0 : a[r];
109
- return e == null ? "" : String(e);
108
+ function Ae(a, t) {
109
+ const n = a == null ? void 0 : a[t];
110
+ return n == null ? "" : String(n);
110
111
  }
111
- function Me(a) {
112
- var c;
113
- const { key: r, row: e, isMultiMetric: t, nameKey: n, config: l } = a;
114
- if (!t) return e == null ? void 0 : e[n];
115
- const i = (c = l[r]) == null ? void 0 : c.label;
116
- return typeof i == "string" || typeof i == "number" ? i : r;
112
+ function Pe(a) {
113
+ var s;
114
+ const { key: t, row: n, isMultiMetric: e, nameKey: l, config: o } = a;
115
+ if (!e) return n == null ? void 0 : n[l];
116
+ const r = (s = o[t]) == null ? void 0 : s.label;
117
+ return typeof r == "string" || typeof r == "number" ? r : t;
117
118
  }
118
- function Re({
119
+ function _e({
119
120
  seriesKeys: a,
120
- seriesData: r,
121
- isMultiMetric: e,
122
- config: t,
123
- nameKey: n,
124
- showBackground: l,
125
- cornerRadius: i,
126
- minPointSize: c,
127
- animation: s,
121
+ seriesData: t,
122
+ isMultiMetric: n,
123
+ config: e,
124
+ nameKey: l,
125
+ showBackground: o,
126
+ cornerRadius: r,
127
+ minPointSize: s,
128
+ animation: h,
128
129
  centerLabel: u,
129
- showLabels: d,
130
- labelPosition: C,
131
- labelFormat: B,
132
- labelFormatter: v
130
+ showLabels: x,
131
+ labelPosition: m,
132
+ labelFormat: T,
133
+ labelFormatter: S
133
134
  }) {
134
- return a.map((m, f) => /* @__PURE__ */ S(
135
- A,
135
+ return a.map((f, g) => /* @__PURE__ */ N(
136
+ O,
136
137
  {
137
- dataKey: m,
138
- fill: e ? `var(--color-${m})` : void 0,
139
- background: l,
140
- cornerRadius: i,
141
- minPointSize: c,
142
- ...s,
138
+ dataKey: f,
139
+ fill: n ? `var(--color-${f})` : void 0,
140
+ background: o ? { fill: "var(--ui-border-on-status-neutral)" } : !1,
141
+ cornerRadius: r,
142
+ minPointSize: s,
143
+ ...h,
143
144
  children: [
144
- !e && r.map((h, b) => (
145
+ !n && t.map((p, k) => (
145
146
  // Keyed by index, not the name: two arcs could share a nameKey
146
147
  // value, which would collide as a React key. Same-named arcs
147
148
  // intentionally share a color/config entry via `--color-<name>`.
148
- /* @__PURE__ */ o(me, { fill: `var(--color-${h[n]})` }, b)
149
+ /* @__PURE__ */ i(ge, { fill: `var(--color-${p[l]})` }, k)
149
150
  )),
150
- f === 0 && u && /* @__PURE__ */ o(z, { centerLabel: u }),
151
- d && /* @__PURE__ */ o(
152
- de,
151
+ g === 0 && u && /* @__PURE__ */ i(V, { centerLabel: u }),
152
+ x && /* @__PURE__ */ i(
153
+ pe,
153
154
  {
154
- valueAccessor: (h) => Se({
155
- format: B,
156
- name: Me({
157
- key: m,
158
- row: h.payload,
159
- isMultiMetric: e,
160
- nameKey: n,
161
- config: t
155
+ valueAccessor: (p) => ke({
156
+ format: T,
157
+ name: Pe({
158
+ key: f,
159
+ row: p.payload,
160
+ isMultiMetric: n,
161
+ nameKey: l,
162
+ config: e
162
163
  }),
163
- value: h.value,
164
- formatter: v
164
+ value: p.value,
165
+ formatter: S
165
166
  }),
166
- position: C,
167
- className: Ce(C),
168
- fontSize: pe
167
+ position: m,
168
+ className: be(m),
169
+ fontSize: xe
169
170
  }
170
171
  )
171
172
  ]
172
173
  },
173
- m
174
+ f
174
175
  ));
175
176
  }
176
- function Ee({
177
+ function ze({
177
178
  ringSegments: a,
178
- row: r,
179
- nameKey: e,
180
- cornerRadius: t,
181
- animation: n,
182
- centerLabel: l
179
+ row: t,
180
+ nameKey: n,
181
+ cornerRadius: e,
182
+ animation: l,
183
+ centerLabel: o
183
184
  }) {
184
- return a.map((i, c) => /* @__PURE__ */ o(
185
- A,
185
+ return a.map((r, s) => /* @__PURE__ */ i(
186
+ O,
186
187
  {
187
- dataKey: i.key,
188
+ dataKey: r.key,
188
189
  stackId: "segments",
189
- name: String(r[e]),
190
- fill: ke(i.kind, r[e]),
191
- cornerRadius: t,
192
- ...n,
193
- children: c === 0 && l && /* @__PURE__ */ o(z, { centerLabel: l })
190
+ name: String(t[n]),
191
+ fill: Le(r.kind, t[n]),
192
+ cornerRadius: e,
193
+ ...l,
194
+ children: s === 0 && o && /* @__PURE__ */ i(V, { centerLabel: o })
194
195
  },
195
- i.key
196
+ r.key
196
197
  ));
197
198
  }
198
- const Fe = L.forwardRef(
199
+ const je = $.forwardRef(
199
200
  ({
200
201
  className: a,
201
- config: r,
202
+ config: t,
203
+ palette: n,
202
204
  data: e,
203
- dataKey: t,
204
- dataKeys: n,
205
- nameKey: l,
206
- innerRadius: i = 30,
207
- outerRadius: c = 110,
208
- startAngle: s = 90,
209
- endAngle: u = -270,
210
- valueDomain: d,
211
- cornerRadius: C = 4,
212
- cx: B,
213
- cy: v,
214
- barSize: m,
215
- barGap: f,
216
- barCategoryGap: h,
217
- minAngle: b,
218
- margin: G,
219
- segments: N,
220
- segmentGap: I = Be,
221
- showBackground: O = !0,
222
- showPolarGrid: V = !1,
223
- centerLabel: M,
224
- showTooltip: H = !0,
225
- showLegend: X = !0,
226
- tooltipContent: Y,
227
- animate: Z,
228
- animationDuration: q,
205
+ dataKey: l,
206
+ dataKeys: o,
207
+ nameKey: r,
208
+ innerRadius: s = 20,
209
+ outerRadius: h = 60,
210
+ startAngle: u = 90,
211
+ endAngle: x = -270,
212
+ valueDomain: m,
213
+ cornerRadius: T = 4,
214
+ cx: S,
215
+ cy: f,
216
+ barSize: g,
217
+ barGap: p,
218
+ barCategoryGap: k,
219
+ minAngle: M,
220
+ margin: U,
221
+ segments: R,
222
+ segmentGap: X = Me,
223
+ showBackground: Y = !0,
224
+ showPolarGrid: Z = !1,
225
+ centerLabel: A,
226
+ showTooltip: q = !0,
227
+ showLegend: B = !0,
228
+ legendValueFormatter: D,
229
+ tooltipContent: J,
230
+ animate: Q,
231
+ animationDuration: W,
229
232
  animationBegin: w,
230
- animationEasing: J,
231
- showLabels: Q = !1,
232
- labelPosition: U,
233
- labelFormat: W = "value",
234
- labelFormatter: D,
235
- ...y
236
- }, K) => {
237
- const R = ge({
238
- animate: Z,
239
- animationDuration: q,
233
+ animationEasing: y,
234
+ showLabels: P = !1,
235
+ labelPosition: K,
236
+ labelFormat: ee = "value",
237
+ labelFormatter: re,
238
+ ...te
239
+ }, ne) => {
240
+ const _ = Ce({
241
+ animate: Q,
242
+ animationDuration: W,
240
243
  animationBegin: w,
241
- animationEasing: J
242
- }), ee = U ?? "insideStart", x = !!(n != null && n.length), p = N != null && N > 1 && !x && e.length === 1 && typeof e[0][t] == "number", te = x ? n : [t], E = L.useMemo(
243
- () => n != null && n.length ? n : [t],
244
- [n, t]
245
- ), k = Math.abs(u - s), F = p ? Ne({
246
- value: e[0][t],
244
+ animationEasing: y
245
+ }), L = K ?? "insideStart", d = !!(o != null && o.length), v = R != null && R > 1 && !d && e.length === 1 && typeof e[0][l] == "number", oe = d ? o : [l], z = $.useMemo(
246
+ () => o != null && o.length ? o : [l],
247
+ [o, l]
248
+ ), E = Math.abs(x - u), j = v ? Re({
249
+ value: e[0][l],
247
250
  // Without a domain a lone value is its own maximum, so the ring fills.
248
- domain: d ?? [0, e[0][t]],
249
- segments: N,
250
- gap: I,
251
- sweep: k,
252
- closed: k >= 360
253
- }) : [], P = x ? e : e.map((g) => ({
254
- ...g,
255
- fill: `var(--color-${g[l]})`
256
- })), re = p ? [
251
+ domain: m ?? [0, e[0][l]],
252
+ segments: R,
253
+ gap: X,
254
+ sweep: E,
255
+ closed: E >= 360
256
+ }) : [], G = d ? e : e.map((c) => ({
257
+ ...c,
258
+ fill: `var(--color-${c[r]})`
259
+ })), le = v ? [
257
260
  {
258
261
  ...e[0],
259
- ...Object.fromEntries(F.map((g) => [g.key, g.degrees]))
260
- }
261
- ] : P, ne = b === void 0 ? void 0 : u < s ? -b : b, ae = L.useCallback(
262
- () => /* @__PURE__ */ o(
263
- j,
264
- {
265
- payload: E.map((g) => ({
266
- value: g,
267
- dataKey: g,
268
- color: `var(--color-${g})`,
269
- type: "rect"
270
- }))
271
- }
272
- ),
273
- [E]
274
- ), le = x ? ae : /* @__PURE__ */ o(j, { nameKey: l }), oe = () => p ? /* @__PURE__ */ o(
275
- Le,
276
- {
277
- config: r,
278
- row: e[0],
279
- nameKey: l,
280
- dataKey: t,
281
- domainMax: d == null ? void 0 : d[1]
262
+ ...Object.fromEntries(j.map((c) => [c.key, c.degrees]))
282
263
  }
283
- ) : x ? /* @__PURE__ */ o(
284
- T,
264
+ ] : G, ae = M === void 0 ? void 0 : x < u ? -M : M, b = $.useMemo(
265
+ () => B ? Se(t, n ?? $e) : null,
266
+ [B, t, n]
267
+ ), ie = $.useMemo(() => b ? d ? z.map((c) => {
268
+ var C;
269
+ return {
270
+ value: c,
271
+ dataKey: c,
272
+ color: ((C = b[c]) == null ? void 0 : C.color) ?? `var(--color-${c})`,
273
+ type: "rect",
274
+ payload: {}
275
+ };
276
+ }) : e.map((c) => {
277
+ var C;
278
+ return {
279
+ value: String(c[r]),
280
+ dataKey: r,
281
+ color: ((C = b[String(c[r])]) == null ? void 0 : C.color) ?? `var(--color-${String(c[r])})`,
282
+ type: "rect",
283
+ payload: c
284
+ };
285
+ }) : [], [b, d, z, e, r]), se = B && !v && !!b, ce = /* @__PURE__ */ N(
286
+ fe,
285
287
  {
286
- labelFormatter: (g, $) => {
287
- var _;
288
- return Te(
289
- (_ = $ == null ? void 0 : $[0]) == null ? void 0 : _.payload,
290
- l
291
- );
292
- }
293
- }
294
- ) : /* @__PURE__ */ o(T, { nameKey: l, hideLabel: !0 });
295
- return /* @__PURE__ */ o("div", { ref: K, className: he(a), ...y, children: /* @__PURE__ */ o(xe, { config: r, className: "size-full", children: /* @__PURE__ */ S(
296
- ce,
297
- {
298
- data: re,
299
- dataKey: x || p ? void 0 : t,
300
- cx: B,
301
- cy: v,
302
- innerRadius: i,
303
- outerRadius: c,
304
- startAngle: s,
305
- endAngle: u,
306
- barSize: m,
307
- barGap: f,
308
- barCategoryGap: h,
309
- margin: G,
288
+ data: le,
289
+ dataKey: d || v ? void 0 : l,
290
+ cx: S,
291
+ cy: f,
292
+ innerRadius: s,
293
+ outerRadius: h,
294
+ startAngle: u,
295
+ endAngle: x,
296
+ barSize: g,
297
+ barGap: p,
298
+ barCategoryGap: k,
299
+ margin: U ?? { top: 0, right: 0, bottom: 0, left: 0 },
310
300
  children: [
311
- V && /* @__PURE__ */ o(se, { gridType: "circle", radialLines: !1 }),
312
- (d || p) && // The angular scale itself, not chrome: it maps a value onto a
301
+ Z && /* @__PURE__ */ i(de, { gridType: "circle", radialLines: !1 }),
302
+ (m || v) && // The angular scale itself, not chrome: it maps a value onto a
313
303
  // fraction of the sweep. Ticks/axis line stay off — the arcs and
314
304
  // the optional center readout are the readout. A segmented ring is
315
305
  // already measured in degrees, so its scale *is* the sweep.
316
- /* @__PURE__ */ o(
317
- ue,
306
+ /* @__PURE__ */ i(
307
+ he,
318
308
  {
319
309
  type: "number",
320
- domain: p ? [0, k] : d,
310
+ domain: v ? [0, E] : m,
321
311
  tick: !1,
322
312
  axisLine: !1
323
313
  }
324
314
  ),
325
- H && /* @__PURE__ */ o(
326
- ve,
315
+ q && /* @__PURE__ */ i(
316
+ Ne,
327
317
  {
328
- cursor: p ? !1 : void 0,
329
- content: Y ?? oe()
318
+ cursor: v ? !1 : void 0,
319
+ content: J ?? (v ? /* @__PURE__ */ i(
320
+ Fe,
321
+ {
322
+ config: t,
323
+ row: e[0],
324
+ nameKey: r,
325
+ dataKey: l,
326
+ domainMax: m == null ? void 0 : m[1]
327
+ }
328
+ ) : d ? /* @__PURE__ */ i(
329
+ F,
330
+ {
331
+ labelFormatter: (c, C) => {
332
+ var H;
333
+ return Ae(
334
+ (H = C == null ? void 0 : C[0]) == null ? void 0 : H.payload,
335
+ r
336
+ );
337
+ }
338
+ }
339
+ ) : /* @__PURE__ */ i(F, { nameKey: r, hideLabel: !0 }))
330
340
  }
331
341
  ),
332
- p ? /* @__PURE__ */ o(
333
- Ee,
342
+ v ? /* @__PURE__ */ i(
343
+ ze,
334
344
  {
335
- ringSegments: F,
345
+ ringSegments: j,
336
346
  row: e[0],
337
- nameKey: l,
338
- cornerRadius: C,
339
- animation: R,
340
- centerLabel: M
347
+ nameKey: r,
348
+ cornerRadius: T,
349
+ animation: _,
350
+ centerLabel: A
341
351
  }
342
- ) : /* @__PURE__ */ o(
343
- Re,
352
+ ) : /* @__PURE__ */ i(
353
+ _e,
344
354
  {
345
- seriesKeys: te,
346
- seriesData: P,
347
- isMultiMetric: x,
348
- config: r,
349
- nameKey: l,
350
- showBackground: O,
351
- cornerRadius: C,
352
- minPointSize: ne,
353
- animation: R,
354
- centerLabel: M,
355
- showLabels: Q,
356
- labelPosition: ee,
357
- labelFormat: W,
358
- labelFormatter: D
355
+ seriesKeys: oe,
356
+ seriesData: G,
357
+ isMultiMetric: d,
358
+ config: t,
359
+ nameKey: r,
360
+ showBackground: Y,
361
+ cornerRadius: T,
362
+ minPointSize: ae,
363
+ animation: _,
364
+ centerLabel: A,
365
+ showLabels: P,
366
+ labelPosition: L,
367
+ labelFormat: ee,
368
+ labelFormatter: re
359
369
  }
360
- ),
361
- X && !p && /* @__PURE__ */ o(be, { content: le })
370
+ )
371
+ ]
372
+ }
373
+ ), ue = P && (L === "outside" || L === "end") ? "size-[200px]" : "size-[120px]";
374
+ return /* @__PURE__ */ N(
375
+ "div",
376
+ {
377
+ ref: ne,
378
+ className: I("flex flex-row items-center gap-4", !se && "justify-center", a),
379
+ ...te,
380
+ children: [
381
+ /* @__PURE__ */ i("div", { className: I(ue, "shrink-0"), children: /* @__PURE__ */ i(Te, { config: t, palette: n, className: "size-full", children: ce }) }),
382
+ B && !v && b && /* @__PURE__ */ i(
383
+ Be,
384
+ {
385
+ variant: "list",
386
+ payload: ie,
387
+ config: b,
388
+ nameKey: d ? void 0 : r,
389
+ valueKey: d ? void 0 : l,
390
+ valueFormatter: d ? void 0 : D,
391
+ className: "min-w-0 flex-1"
392
+ }
393
+ )
362
394
  ]
363
395
  }
364
- ) }) });
396
+ );
365
397
  }
366
398
  );
367
- Fe.displayName = "RadialBarChart";
399
+ je.displayName = "RadialBarChart";
368
400
  export {
369
- Fe as RadialBarChart,
370
- Le as RadialBarChartSegmentedTooltipContent,
371
- Te as radialBarChartBandName,
372
- Se as radialBarChartLabelText,
373
- ke as radialBarChartSegmentFill,
374
- $e as radialBarChartSegmentedReading,
375
- Ne as radialBarChartSegments
401
+ je as RadialBarChart,
402
+ Fe as RadialBarChartSegmentedTooltipContent,
403
+ Ae as radialBarChartBandName,
404
+ ke as radialBarChartLabelText,
405
+ Le as radialBarChartSegmentFill,
406
+ Ee as radialBarChartSegmentedReading,
407
+ Re as radialBarChartSegments
376
408
  };
377
409
  //# sourceMappingURL=radial-bar-chart.js.map