@devalok/shilp-sutra 0.27.2 → 0.29.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 (250) hide show
  1. package/dist/_chunks/badge-group.js +299 -0
  2. package/dist/_chunks/framer.js +1915 -1980
  3. package/dist/_chunks/keybinding.js +4 -5
  4. package/dist/_chunks/primitives.js +3198 -3272
  5. package/dist/_chunks/sonner.js +29 -31
  6. package/dist/_chunks/stat-row.js +110 -131
  7. package/dist/_chunks/tiptap.js +42 -78
  8. package/dist/_chunks/tree-view.js +138 -149
  9. package/dist/_chunks/typing-indicator.js +565 -0
  10. package/dist/_chunks/use-calendar.js +416 -439
  11. package/dist/_chunks/vendor-client.js +977 -814
  12. package/dist/_chunks/vendor-utils.js +5 -5
  13. package/dist/ai/block-renderer.js +22 -22
  14. package/dist/ai/blocks/loading.d.ts.map +1 -1
  15. package/dist/ai/command-bar.d.ts.map +1 -1
  16. package/dist/ai/command-bar.js +241 -263
  17. package/dist/ai/conversation.d.ts.map +1 -1
  18. package/dist/ai/conversation.js +87 -107
  19. package/dist/composed/activity-feed.d.ts +2 -0
  20. package/dist/composed/activity-feed.d.ts.map +1 -1
  21. package/dist/composed/activity-feed.js +118 -90
  22. package/dist/composed/avatar-group.d.ts +1 -0
  23. package/dist/composed/avatar-group.d.ts.map +1 -1
  24. package/dist/composed/avatar-group.js +91 -67
  25. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  26. package/dist/composed/bulk-action-bar.js +29 -28
  27. package/dist/composed/command-palette.d.ts.map +1 -1
  28. package/dist/composed/command-palette.js +99 -113
  29. package/dist/composed/content-card.js +1 -1
  30. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  31. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  32. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  33. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  34. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  35. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  36. package/dist/composed/deadline-indicator.js +29 -28
  37. package/dist/composed/error-boundary.d.ts.map +1 -1
  38. package/dist/composed/error-boundary.js +30 -27
  39. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  40. package/dist/composed/file-preview.d.ts.map +1 -1
  41. package/dist/composed/file-preview.js +261 -271
  42. package/dist/composed/filter-bar.d.ts.map +1 -1
  43. package/dist/composed/filter-bar.js +49 -48
  44. package/dist/composed/form-section.d.ts.map +1 -1
  45. package/dist/composed/form-section.js +12 -11
  46. package/dist/composed/global-loading.js +1 -1
  47. package/dist/composed/index.js +63 -63
  48. package/dist/composed/inline-edit.d.ts.map +1 -1
  49. package/dist/composed/inline-edit.js +55 -54
  50. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  51. package/dist/composed/markdown-viewer.js +44 -43
  52. package/dist/composed/master-detail.d.ts.map +1 -1
  53. package/dist/composed/master-detail.js +35 -34
  54. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  55. package/dist/composed/multi-select-popover.js +64 -64
  56. package/dist/composed/page-header.d.ts.map +1 -1
  57. package/dist/composed/page-header.js +31 -37
  58. package/dist/composed/priority-indicator.d.ts.map +1 -1
  59. package/dist/composed/priority-indicator.js +37 -36
  60. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  61. package/dist/composed/rich-text-editor.js +287 -306
  62. package/dist/composed/schedule-view.js +62 -62
  63. package/dist/composed/status-badge.d.ts +4 -2
  64. package/dist/composed/status-badge.d.ts.map +1 -1
  65. package/dist/composed/status-badge.js +58 -45
  66. package/dist/shell/app-command-palette.d.ts.map +1 -1
  67. package/dist/shell/app-command-palette.js +93 -93
  68. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  69. package/dist/shell/bottom-navbar.js +21 -20
  70. package/dist/shell/index.js +18 -18
  71. package/dist/shell/notification-center.d.ts.map +1 -1
  72. package/dist/shell/notification-center.js +96 -95
  73. package/dist/shell/notification-preferences.d.ts.map +1 -1
  74. package/dist/shell/notification-preferences.js +82 -85
  75. package/dist/shell/sidebar.js +59 -60
  76. package/dist/shell/top-bar.d.ts.map +1 -1
  77. package/dist/shell/top-bar.js +103 -103
  78. package/dist/tailwind/index.cjs +37 -4
  79. package/dist/tailwind/preset.d.ts.map +1 -1
  80. package/dist/tailwind/preset.js +38 -5
  81. package/dist/tokens/primitives.css +10 -0
  82. package/dist/tokens/semantic.css +70 -7
  83. package/dist/ui/accordion.d.ts +5 -2
  84. package/dist/ui/accordion.d.ts.map +1 -1
  85. package/dist/ui/accordion.js +44 -39
  86. package/dist/ui/alert-dialog.js +57 -57
  87. package/dist/ui/alert.d.ts +1 -1
  88. package/dist/ui/alert.d.ts.map +1 -1
  89. package/dist/ui/alert.js +30 -29
  90. package/dist/ui/aspect-ratio.js +4 -4
  91. package/dist/ui/autocomplete.js +56 -56
  92. package/dist/ui/avatar.js +2 -2
  93. package/dist/ui/badge-group.d.ts +22 -0
  94. package/dist/ui/badge-group.d.ts.map +1 -0
  95. package/dist/ui/badge-group.js +8 -0
  96. package/dist/ui/badge-indicator.d.ts +32 -0
  97. package/dist/ui/badge-indicator.d.ts.map +1 -0
  98. package/dist/ui/badge-indicator.js +54 -0
  99. package/dist/ui/badge.d.ts +27 -24
  100. package/dist/ui/badge.d.ts.map +1 -1
  101. package/dist/ui/badge.js +13 -129
  102. package/dist/ui/banner.d.ts +1 -1
  103. package/dist/ui/banner.d.ts.map +1 -1
  104. package/dist/ui/banner.js +27 -26
  105. package/dist/ui/breadcrumb.d.ts.map +1 -1
  106. package/dist/ui/breadcrumb.js +37 -36
  107. package/dist/ui/button-group.d.ts +12 -6
  108. package/dist/ui/button-group.d.ts.map +1 -1
  109. package/dist/ui/button-group.js +18 -18
  110. package/dist/ui/button-processing.d.ts +15 -0
  111. package/dist/ui/button-processing.d.ts.map +1 -0
  112. package/dist/ui/button-processing.js +77 -0
  113. package/dist/ui/button.d.ts +50 -25
  114. package/dist/ui/button.d.ts.map +1 -1
  115. package/dist/ui/button.js +243 -127
  116. package/dist/ui/card.js +20 -21
  117. package/dist/ui/charts/index.js +499 -508
  118. package/dist/ui/chat/date-separator.d.ts +12 -0
  119. package/dist/ui/chat/date-separator.d.ts.map +1 -0
  120. package/dist/ui/chat/index.d.ts +9 -0
  121. package/dist/ui/chat/index.d.ts.map +1 -0
  122. package/dist/ui/chat/index.js +12 -0
  123. package/dist/ui/chat/message-input.d.ts +16 -0
  124. package/dist/ui/chat/message-input.d.ts.map +1 -0
  125. package/dist/ui/chat/message-list.d.ts +24 -0
  126. package/dist/ui/chat/message-list.d.ts.map +1 -0
  127. package/dist/ui/chat/message.d.ts +108 -0
  128. package/dist/ui/chat/message.d.ts.map +1 -0
  129. package/dist/ui/chat/system-message.d.ts +11 -0
  130. package/dist/ui/chat/system-message.d.ts.map +1 -0
  131. package/dist/ui/chat/typing-indicator.d.ts +14 -0
  132. package/dist/ui/chat/typing-indicator.d.ts.map +1 -0
  133. package/dist/ui/chat/unread-separator.d.ts +12 -0
  134. package/dist/ui/chat/unread-separator.d.ts.map +1 -0
  135. package/dist/ui/checkbox.js +18 -18
  136. package/dist/ui/chip.d.ts +13 -62
  137. package/dist/ui/chip.d.ts.map +1 -1
  138. package/dist/ui/chip.js +10 -109
  139. package/dist/ui/collapsible.js +4 -4
  140. package/dist/ui/color-input.d.ts +19 -5
  141. package/dist/ui/color-input.d.ts.map +1 -1
  142. package/dist/ui/color-input.js +371 -79
  143. package/dist/ui/color-swatch.js +11 -11
  144. package/dist/ui/combobox.d.ts.map +1 -1
  145. package/dist/ui/combobox.js +74 -80
  146. package/dist/ui/context-menu.d.ts.map +1 -1
  147. package/dist/ui/context-menu.js +86 -85
  148. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  149. package/dist/ui/data-table-toolbar.js +51 -57
  150. package/dist/ui/data-table.d.ts.map +1 -1
  151. package/dist/ui/data-table.js +268 -296
  152. package/dist/ui/devalok-grain.d.ts +81 -0
  153. package/dist/ui/devalok-grain.d.ts.map +1 -0
  154. package/dist/ui/devalok-grain.js +69 -0
  155. package/dist/ui/dialog.d.ts.map +1 -1
  156. package/dist/ui/dialog.js +73 -72
  157. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  158. package/dist/ui/dropdown-menu.js +93 -92
  159. package/dist/ui/file-upload.d.ts.map +1 -1
  160. package/dist/ui/file-upload.js +82 -82
  161. package/dist/ui/hover-card.js +29 -29
  162. package/dist/ui/icon-button.d.ts +7 -7
  163. package/dist/ui/icon-button.d.ts.map +1 -1
  164. package/dist/ui/icon-context.d.ts +15 -0
  165. package/dist/ui/icon-context.d.ts.map +1 -0
  166. package/dist/ui/icon-context.js +20 -0
  167. package/dist/ui/icon-group.d.ts +22 -0
  168. package/dist/ui/icon-group.d.ts.map +1 -0
  169. package/dist/ui/icon-group.js +32 -0
  170. package/dist/ui/icon.d.ts +57 -0
  171. package/dist/ui/icon.d.ts.map +1 -0
  172. package/dist/ui/icon.js +122 -0
  173. package/dist/ui/index.d.ts +8 -1
  174. package/dist/ui/index.d.ts.map +1 -1
  175. package/dist/ui/index.js +351 -329
  176. package/dist/ui/input-otp.d.ts.map +1 -1
  177. package/dist/ui/input-otp.js +21 -20
  178. package/dist/ui/input.d.ts +32 -11
  179. package/dist/ui/input.d.ts.map +1 -1
  180. package/dist/ui/input.js +149 -44
  181. package/dist/ui/label.js +1 -1
  182. package/dist/ui/lib/motion.d.ts +2 -0
  183. package/dist/ui/lib/motion.d.ts.map +1 -1
  184. package/dist/ui/lib/motion.js +13 -11
  185. package/dist/ui/lib/utils.js +1 -1
  186. package/dist/ui/menubar.d.ts.map +1 -1
  187. package/dist/ui/menubar.js +87 -86
  188. package/dist/ui/navigation-menu.d.ts.map +1 -1
  189. package/dist/ui/navigation-menu.js +23 -28
  190. package/dist/ui/number-input.d.ts.map +1 -1
  191. package/dist/ui/number-input.js +54 -53
  192. package/dist/ui/pagination.d.ts.map +1 -1
  193. package/dist/ui/pagination.js +45 -44
  194. package/dist/ui/popover.js +30 -30
  195. package/dist/ui/progress.d.ts +3 -1
  196. package/dist/ui/progress.d.ts.map +1 -1
  197. package/dist/ui/progress.js +43 -39
  198. package/dist/ui/radio.js +1 -1
  199. package/dist/ui/search-input.d.ts.map +1 -1
  200. package/dist/ui/search-input.js +47 -60
  201. package/dist/ui/segmented-control.js +1 -1
  202. package/dist/ui/select.d.ts.map +1 -1
  203. package/dist/ui/select.js +54 -53
  204. package/dist/ui/separator.js +5 -5
  205. package/dist/ui/sheet.d.ts.map +1 -1
  206. package/dist/ui/sheet.js +46 -45
  207. package/dist/ui/sidebar.d.ts.map +1 -1
  208. package/dist/ui/sidebar.js +196 -193
  209. package/dist/ui/skeleton.js +1 -1
  210. package/dist/ui/slider.js +1 -1
  211. package/dist/ui/spinner.js +74 -74
  212. package/dist/ui/stat-card.d.ts.map +1 -1
  213. package/dist/ui/stat-card.js +85 -86
  214. package/dist/ui/switch.d.ts +3 -0
  215. package/dist/ui/switch.d.ts.map +1 -1
  216. package/dist/ui/switch.js +40 -26
  217. package/dist/ui/tabs.js +43 -43
  218. package/dist/ui/text.js +1 -1
  219. package/dist/ui/textarea.js +10 -10
  220. package/dist/ui/toast.d.ts.map +1 -1
  221. package/dist/ui/toast.js +169 -169
  222. package/dist/ui/toggle-group.js +1 -1
  223. package/dist/ui/toggle.js +5 -5
  224. package/dist/ui/tooltip.js +41 -41
  225. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  226. package/docs/components/_header.md +4 -4
  227. package/docs/components/composed/activity-feed.md +7 -0
  228. package/docs/components/composed/avatar-group.md +8 -5
  229. package/docs/components/composed/status-badge.md +14 -1
  230. package/docs/components/ui/accordion.md +5 -2
  231. package/docs/components/ui/badge-group.md +38 -0
  232. package/docs/components/ui/badge-indicator.md +40 -0
  233. package/docs/components/ui/badge.md +36 -5
  234. package/docs/components/ui/button-processing.md +15 -0
  235. package/docs/components/ui/button.md +40 -11
  236. package/docs/components/ui/chat.md +214 -0
  237. package/docs/components/ui/color-input.md +58 -4
  238. package/docs/components/ui/data-table.md +3 -0
  239. package/docs/components/ui/devalok-grain.md +55 -0
  240. package/docs/components/ui/icon-button.md +12 -5
  241. package/docs/components/ui/icon-context.md +38 -0
  242. package/docs/components/ui/icon-group.md +36 -0
  243. package/docs/components/ui/icon.md +47 -0
  244. package/docs/components/ui/input.md +32 -6
  245. package/docs/components/ui/progress.md +5 -0
  246. package/docs/components/ui/spinner.md +3 -0
  247. package/docs/components/ui/switch.md +13 -0
  248. package/llms-full.txt +724 -44
  249. package/llms.txt +38 -19
  250. package/package.json +8 -2
@@ -1,115 +1,115 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as g, Fragment as te } from "react/jsx-runtime";
3
- import * as ne from "react";
4
- import { useRef as ye, useState as me, useEffect as xe, useCallback as ke } from "react";
5
- import { cn as H } from "../lib/utils.js";
6
- import { scaleBand as Se, scaleLinear as oe, scalePoint as Ce } from "d3-scale";
7
- import { tweens as se, motionProps as ie } from "../lib/motion.js";
2
+ import { jsx as e, jsxs as p, Fragment as ee } from "react/jsx-runtime";
3
+ import * as te from "react";
4
+ import { useRef as ve, useState as de, useEffect as ye, useCallback as ke } from "react";
5
+ import { cn as Q } from "../lib/utils.js";
6
+ import { scaleBand as Ge, scaleLinear as ae, scalePoint as Ce } from "d3-scale";
7
+ import { tweens as le, motionProps as se } from "../lib/motion.js";
8
8
  import { axisLeft as Xe, axisBottom as De, axisRight as Pe, axisTop as ze } from "d3-axis";
9
9
  import { select as Be } from "d3-selection";
10
10
  import { u as Ve } from "../../_chunks/motion-provider.js";
11
- import { m as re } from "../../_chunks/framer.js";
12
- import { line as he, curveMonotoneX as de, curveLinear as Ae, stack as _e, stackOrderNone as je, stackOffsetNone as Te, area as Ne, pie as Ye, arc as ve, lineRadial as Oe, curveLinearClosed as We } from "d3-shape";
11
+ import { m as ne } from "../../_chunks/framer.js";
12
+ import { line as me, curveMonotoneX as ue, curveLinear as Ae, stack as _e, stackOrderNone as je, stackOffsetNone as Te, area as Me, pie as Ye, arc as ge, lineRadial as Oe, curveLinearClosed as We } from "d3-shape";
13
13
  const Ie = {
14
14
  top: 20,
15
15
  right: 20,
16
16
  bottom: 40,
17
17
  left: 50
18
- }, be = ne.forwardRef(
18
+ }, xe = te.forwardRef(
19
19
  ({
20
20
  height: t = 300,
21
- margin: o,
22
- className: a,
21
+ margin: a,
22
+ className: o,
23
23
  children: y,
24
- ...f
24
+ ...m
25
25
  }, x) => {
26
- const i = ye(null), [M, B] = me(0), N = { ...Ie, ...o };
27
- xe(() => {
28
- if (!i.current) return;
29
- const T = new ResizeObserver((D) => {
30
- const R = D[0];
31
- R && B(R.contentRect.width);
26
+ const c = ve(null), [M, z] = de(0), N = { ...Ie, ...a };
27
+ ye(() => {
28
+ if (!c.current) return;
29
+ const j = new ResizeObserver((P) => {
30
+ const R = P[0];
31
+ R && z(R.contentRect.width);
32
32
  });
33
- return T.observe(i.current), () => T.disconnect();
33
+ return j.observe(c.current), () => j.disconnect();
34
34
  }, []);
35
35
  const A = Math.max(0, M - N.left - N.right), k = Math.max(0, t - N.top - N.bottom);
36
36
  return /* @__PURE__ */ e(
37
37
  "div",
38
38
  {
39
- ref: (T) => {
40
- i.current = T, typeof x == "function" ? x(T) : x && (x.current = T);
39
+ ref: (j) => {
40
+ c.current = j, typeof x == "function" ? x(j) : x && (x.current = j);
41
41
  },
42
- className: H("relative w-full", a),
43
- ...f,
42
+ className: Q("relative w-full", o),
43
+ ...m,
44
44
  children: M > 0 && /* @__PURE__ */ e("svg", { width: M, height: t, role: "img", "aria-label": "Chart", children: /* @__PURE__ */ e("g", { transform: `translate(${N.left},${N.top})`, children: y({ width: A, height: k, margin: N }) }) })
45
45
  }
46
46
  );
47
47
  }
48
48
  );
49
- be.displayName = "ChartContainer";
50
- function ee({
49
+ xe.displayName = "ChartContainer";
50
+ function K({
51
51
  scale: t,
52
- orientation: o,
53
- transform: a,
52
+ orientation: a,
53
+ transform: o,
54
54
  tickCount: y,
55
- tickFormat: f,
55
+ tickFormat: m,
56
56
  label: x,
57
- className: i
57
+ className: c
58
58
  }) {
59
- const M = ye(null);
60
- return xe(() => {
59
+ const M = ve(null);
60
+ return ye(() => {
61
61
  if (!M.current) return;
62
62
  const N = {
63
63
  top: ze,
64
64
  right: Pe,
65
65
  bottom: De,
66
66
  left: Xe
67
- }[o];
67
+ }[a];
68
68
  let A = N(t);
69
- y && (A = A.ticks(y)), f && (A = A.tickFormat(f));
69
+ y && (A = A.ticks(y)), m && (A = A.tickFormat(m));
70
70
  const k = Be(M.current);
71
71
  k.call(A), k.selectAll(".tick line").attr("stroke", "var(--color-surface-border)"), k.selectAll(".tick text").attr("fill", "var(--color-surface-fg-muted)").attr("font-size", "var(--font-size-xs)"), k.selectAll(".domain").attr("stroke", "var(--color-surface-border-strong)");
72
- }, [t, o, y, f]), /* @__PURE__ */ e("g", { ref: M, transform: a, className: i, children: x && /* @__PURE__ */ e(
72
+ }, [t, a, y, m]), /* @__PURE__ */ e("g", { ref: M, transform: o, className: c, children: x && /* @__PURE__ */ e(
73
73
  "text",
74
74
  {
75
75
  textAnchor: "middle",
76
76
  fill: "var(--color-surface-fg-muted)",
77
77
  fontSize: "var(--font-size-sm)",
78
- ...o === "bottom" ? { x: "50%", dy: 35 } : o === "left" ? { transform: "rotate(-90)", y: -40, x: 0 } : {},
78
+ ...a === "bottom" ? { x: "50%", dy: 35 } : a === "left" ? { transform: "rotate(-90)", y: -40, x: 0 } : {},
79
79
  children: x
80
80
  }
81
81
  ) });
82
82
  }
83
- ee.displayName = "Axis";
84
- function fe({
83
+ K.displayName = "Axis";
84
+ function he({
85
85
  width: t,
86
- height: o,
87
- xScale: a,
86
+ height: a,
87
+ xScale: o,
88
88
  yScale: y,
89
- horizontal: f = !0,
89
+ horizontal: m = !0,
90
90
  vertical: x = !1
91
91
  }) {
92
- return /* @__PURE__ */ g("g", { className: "grid-lines", children: [
93
- f && (y == null ? void 0 : y.ticks) && y.ticks().map((i, M) => /* @__PURE__ */ e(
92
+ return /* @__PURE__ */ p("g", { className: "grid-lines", children: [
93
+ m && y?.ticks && y.ticks().map((c, M) => /* @__PURE__ */ e(
94
94
  "line",
95
95
  {
96
96
  x1: 0,
97
97
  x2: t,
98
- y1: y(i),
99
- y2: y(i),
98
+ y1: y(c),
99
+ y2: y(c),
100
100
  stroke: "var(--color-surface-border)",
101
101
  strokeDasharray: "3,3",
102
102
  opacity: 0.6
103
103
  },
104
104
  `h-${M}`
105
105
  )),
106
- x && (a == null ? void 0 : a.ticks) && a.ticks().map((i, M) => /* @__PURE__ */ e(
106
+ x && o?.ticks && o.ticks().map((c, M) => /* @__PURE__ */ e(
107
107
  "line",
108
108
  {
109
- x1: a(i),
110
- x2: a(i),
109
+ x1: o(c),
110
+ x2: o(c),
111
111
  y1: 0,
112
- y2: o,
112
+ y2: a,
113
113
  stroke: "var(--color-surface-border)",
114
114
  strokeDasharray: "3,3",
115
115
  opacity: 0.6
@@ -118,62 +118,62 @@ function fe({
118
118
  ))
119
119
  ] });
120
120
  }
121
- fe.displayName = "GridLines";
122
- function ce({ items: t, position: o = "bottom", className: a }) {
121
+ he.displayName = "GridLines";
122
+ function ce({ items: t, position: a = "bottom", className: o }) {
123
123
  return /* @__PURE__ */ e(
124
124
  "div",
125
125
  {
126
- className: H(
126
+ className: Q(
127
127
  "flex gap-ds-04 text-ds-sm text-surface-fg-muted",
128
- o === "left" || o === "right" ? "flex-col" : "flex-row flex-wrap justify-center",
129
- a
128
+ a === "left" || a === "right" ? "flex-col" : "flex-row flex-wrap justify-center",
129
+ o
130
130
  ),
131
- children: t.map((f) => /* @__PURE__ */ g("div", { className: "flex items-center gap-ds-02", children: [
131
+ children: t.map((m) => /* @__PURE__ */ p("div", { className: "flex items-center gap-ds-02", children: [
132
132
  /* @__PURE__ */ e(
133
133
  "span",
134
134
  {
135
135
  className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
136
- style: { backgroundColor: f.color }
136
+ style: { backgroundColor: m.color }
137
137
  }
138
138
  ),
139
- /* @__PURE__ */ e("span", { children: f.label })
140
- ] }, f.label))
139
+ /* @__PURE__ */ e("span", { children: m.label })
140
+ ] }, m.label))
141
141
  }
142
142
  );
143
143
  }
144
144
  ce.displayName = "Legend";
145
- function ue({ state: t, className: o }) {
145
+ function ie({ state: t, className: a }) {
146
146
  return t.visible ? /* @__PURE__ */ e(
147
147
  "div",
148
148
  {
149
- className: H(
149
+ className: Q(
150
150
  "pointer-events-none absolute z-tooltip",
151
151
  "rounded-ds-md border border-surface-border-strong",
152
152
  "bg-surface-overlay px-ds-03 py-ds-02",
153
153
  "shadow-raised-hover",
154
154
  "text-ds-sm text-surface-fg",
155
- o
155
+ a
156
156
  ),
157
157
  style: { left: t.x + 12, top: t.y - 12 },
158
158
  children: t.content
159
159
  }
160
160
  ) : null;
161
161
  }
162
- ue.displayName = "ChartTooltip";
163
- function pe() {
164
- const [t, o] = me({
162
+ ie.displayName = "ChartTooltip";
163
+ function fe() {
164
+ const [t, a] = de({
165
165
  visible: !1,
166
166
  x: 0,
167
167
  y: 0,
168
168
  content: null
169
- }), a = ke((f, x, i) => {
170
- o({ visible: !0, x: f, y: x, content: i });
169
+ }), o = ke((m, x, c) => {
170
+ a({ visible: !0, x: m, y: x, content: c });
171
171
  }, []), y = ke(() => {
172
- o((f) => ({ ...f, visible: !1 }));
172
+ a((m) => ({ ...m, visible: !1 }));
173
173
  }, []);
174
- return { tooltip: t, show: a, hide: y };
174
+ return { tooltip: t, show: o, hide: y };
175
175
  }
176
- const Me = [
176
+ const be = [
177
177
  "chart-1",
178
178
  "chart-2",
179
179
  "chart-3",
@@ -186,141 +186,140 @@ const Me = [
186
186
  function Re(t) {
187
187
  return `var(--${t})`;
188
188
  }
189
- function ae(t, o = 0) {
190
- return t ? Me.includes(t) ? Re(t) : t : Re(Me[o % Me.length]);
189
+ function re(t, a = 0) {
190
+ return t ? be.includes(t) ? Re(t) : t : Re(be[a % be.length]);
191
191
  }
192
- function le() {
192
+ function oe() {
193
193
  const { reducedMotion: t } = Ve();
194
194
  return t;
195
195
  }
196
- function Fe(t, o = 300) {
197
- return t ? 0 : o;
196
+ function Fe(t, a = 300) {
197
+ return t ? 0 : a;
198
198
  }
199
- const Ee = ne.forwardRef(
199
+ const Ee = te.forwardRef(
200
200
  ({
201
201
  data: t,
202
- xKey: o,
203
- yKey: a,
202
+ xKey: a,
203
+ yKey: o,
204
204
  orientation: y = "vertical",
205
- stacked: f = !1,
205
+ stacked: m = !1,
206
206
  grouped: x = !1,
207
- color: i,
207
+ color: c,
208
208
  height: M = 300,
209
- showGrid: B = !0,
209
+ showGrid: z = !0,
210
210
  showTooltip: N = !0,
211
211
  showLegend: A = !1,
212
212
  animate: k = !0,
213
- barRadius: T = 4,
214
- xLabel: D,
213
+ barRadius: j = 4,
214
+ xLabel: P,
215
215
  yLabel: R,
216
- seriesLabels: w,
217
- className: Z,
218
- ...E
219
- }, q) => {
220
- const { tooltip: U, show: O, hide: _ } = pe(), Q = le(), h = y === "vertical", X = k && !Q, b = Array.isArray(a) ? a : [a], c = b.length > 1, j = c ? b.map(
221
- ($, L) => ae(
222
- Array.isArray(i) ? i[L] : typeof i == "string" ? i : void 0,
216
+ seriesLabels: X,
217
+ className: E,
218
+ ...W
219
+ }, U) => {
220
+ const { tooltip: I, show: T, hide: B } = fe(), q = oe(), d = y === "vertical", w = k && !q, b = Array.isArray(o) ? o : [o], i = b.length > 1, V = i ? b.map(
221
+ ($, L) => re(
222
+ Array.isArray(c) ? c[L] : typeof c == "string" ? c : void 0,
223
223
  L
224
224
  )
225
225
  ) : [
226
- ae(
227
- typeof i == "string" ? i : Array.isArray(i) ? i[0] : void 0,
226
+ re(
227
+ typeof c == "string" ? c : Array.isArray(c) ? c[0] : void 0,
228
228
  0
229
229
  )
230
230
  ];
231
- return /* @__PURE__ */ g(
232
- re.div,
231
+ return /* @__PURE__ */ p(
232
+ ne.div,
233
233
  {
234
- ref: q,
235
- className: H("relative", Z),
236
- ...X ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
237
- ...ie(E),
234
+ ref: U,
235
+ className: Q("relative", E),
236
+ ...w ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
237
+ ...se(W),
238
238
  children: [
239
- /* @__PURE__ */ e(be, { height: M, children: ({ width: $, height: L, margin: u }) => {
240
- const s = t.map((G) => String(G[o]));
239
+ /* @__PURE__ */ e(xe, { height: M, children: ({ width: $, height: L, margin: u }) => {
240
+ const s = t.map((S) => String(S[a]));
241
241
  let l;
242
- f ? l = Math.max(
242
+ m ? l = Math.max(
243
243
  ...t.map(
244
- (G) => b.reduce((S, C) => S + (Number(G[C]) || 0), 0)
244
+ (S) => b.reduce((G, C) => G + (Number(S[C]) || 0), 0)
245
245
  )
246
246
  ) : l = Math.max(
247
- ...t.flatMap((G) => b.map((S) => Number(G[S]) || 0))
247
+ ...t.flatMap((S) => b.map((G) => Number(S[G]) || 0))
248
248
  );
249
- const p = Se().domain(s).range(h ? [0, $] : [0, L]).padding(0.2), n = oe().domain([0, l * 1.1]).range(h ? [L, 0] : [0, $]).nice(), r = p.bandwidth(), d = c && x ? r / b.length : r;
250
- return /* @__PURE__ */ g(te, { children: [
251
- B && /* @__PURE__ */ e(
252
- fe,
249
+ const g = Ge().domain(s).range(d ? [0, $] : [0, L]).padding(0.2), n = ae().domain([0, l * 1.1]).range(d ? [L, 0] : [0, $]).nice(), r = g.bandwidth(), f = i && x ? r / b.length : r;
250
+ return /* @__PURE__ */ p(ee, { children: [
251
+ z && /* @__PURE__ */ e(
252
+ he,
253
253
  {
254
254
  width: $,
255
255
  height: L,
256
- yScale: h ? n : void 0,
257
- xScale: h ? void 0 : n,
258
- horizontal: h,
259
- vertical: !h
256
+ yScale: d ? n : void 0,
257
+ xScale: d ? void 0 : n,
258
+ horizontal: d,
259
+ vertical: !d
260
260
  }
261
261
  ),
262
- t.map((G) => {
263
- const S = String(G[o]);
262
+ t.map((S) => {
263
+ const G = String(S[a]);
264
264
  let C = 0;
265
- return b.map((W, m) => {
266
- const v = Number(G[W]) || 0, P = j[m] || j[0];
267
- let I, V, J, z;
268
- return h ? (I = (p(S) ?? 0) + (x && c ? m * d : 0), V = n(f ? C + v : v), J = d, z = f ? n(C) - n(C + v) : L - n(v)) : (I = f ? n(C) : 0, V = (p(S) ?? 0) + (x && c ? m * d : 0), J = f ? n(C + v) - n(C) : n(v), z = d), f && (C += v), /* @__PURE__ */ e(
265
+ return b.map((J, h) => {
266
+ const v = Number(S[J]) || 0, _ = V[h] || V[0];
267
+ let Y, F, H, D;
268
+ return d ? (Y = (g(G) ?? 0) + (x && i ? h * f : 0), F = n(m ? C + v : v), H = f, D = m ? n(C) - n(C + v) : L - n(v)) : (Y = m ? n(C) : 0, F = (g(G) ?? 0) + (x && i ? h * f : 0), H = m ? n(C + v) - n(C) : n(v), D = f), m && (C += v), /* @__PURE__ */ e(
269
269
  "rect",
270
270
  {
271
- x: I,
272
- y: V,
273
- width: Math.max(0, J),
274
- height: Math.max(0, z),
275
- rx: T,
276
- fill: P,
271
+ x: Y,
272
+ y: F,
273
+ width: Math.max(0, H),
274
+ height: Math.max(0, D),
275
+ rx: j,
276
+ fill: _,
277
277
  className: "transition-opacity hover:opacity-80",
278
- onMouseMove: (F) => {
279
- var Y;
278
+ onMouseMove: (Z) => {
280
279
  if (N) {
281
- const K = (Y = F.currentTarget.closest("div")) == null ? void 0 : Y.getBoundingClientRect();
282
- O(
283
- F.clientX - ((K == null ? void 0 : K.left) ?? 0),
284
- F.clientY - ((K == null ? void 0 : K.top) ?? 0),
285
- /* @__PURE__ */ g("div", { children: [
286
- /* @__PURE__ */ e("div", { className: "font-medium", children: S }),
287
- c && /* @__PURE__ */ e("div", { className: "text-surface-fg-muted", children: (w == null ? void 0 : w[m]) ?? W }),
280
+ const O = Z.currentTarget.closest("div")?.getBoundingClientRect();
281
+ T(
282
+ Z.clientX - (O?.left ?? 0),
283
+ Z.clientY - (O?.top ?? 0),
284
+ /* @__PURE__ */ p("div", { children: [
285
+ /* @__PURE__ */ e("div", { className: "font-medium", children: G }),
286
+ i && /* @__PURE__ */ e("div", { className: "text-surface-fg-muted", children: X?.[h] ?? J }),
288
287
  /* @__PURE__ */ e("div", { children: v.toLocaleString() })
289
288
  ] })
290
289
  );
291
290
  }
292
291
  },
293
- onMouseLeave: _
292
+ onMouseLeave: B
294
293
  },
295
- `${S}-${W}`
294
+ `${G}-${J}`
296
295
  );
297
296
  });
298
297
  }),
299
- h ? /* @__PURE__ */ g(te, { children: [
298
+ d ? /* @__PURE__ */ p(ee, { children: [
300
299
  /* @__PURE__ */ e(
301
- ee,
300
+ K,
302
301
  {
303
- scale: p,
302
+ scale: g,
304
303
  orientation: "bottom",
305
304
  transform: `translate(0,${L})`,
306
- label: D
305
+ label: P
307
306
  }
308
307
  ),
309
- /* @__PURE__ */ e(ee, { scale: n, orientation: "left", label: R })
310
- ] }) : /* @__PURE__ */ g(te, { children: [
308
+ /* @__PURE__ */ e(K, { scale: n, orientation: "left", label: R })
309
+ ] }) : /* @__PURE__ */ p(ee, { children: [
311
310
  /* @__PURE__ */ e(
312
- ee,
311
+ K,
313
312
  {
314
313
  scale: n,
315
314
  orientation: "bottom",
316
315
  transform: `translate(0,${L})`,
317
- label: D
316
+ label: P
318
317
  }
319
318
  ),
320
319
  /* @__PURE__ */ e(
321
- ee,
320
+ K,
322
321
  {
323
- scale: p,
322
+ scale: g,
324
323
  orientation: "left",
325
324
  label: R
326
325
  }
@@ -328,13 +327,13 @@ const Ee = ne.forwardRef(
328
327
  ] })
329
328
  ] });
330
329
  } }),
331
- N && /* @__PURE__ */ e(ue, { state: U }),
332
- A && c && /* @__PURE__ */ e(
330
+ N && /* @__PURE__ */ e(ie, { state: I }),
331
+ A && i && /* @__PURE__ */ e(
333
332
  ce,
334
333
  {
335
334
  items: b.map(($, L) => ({
336
- label: (w == null ? void 0 : w[L]) ?? $,
337
- color: j[L]
335
+ label: X?.[L] ?? $,
336
+ color: V[L]
338
337
  })),
339
338
  className: "mt-ds-04"
340
339
  }
@@ -345,106 +344,105 @@ const Ee = ne.forwardRef(
345
344
  }
346
345
  );
347
346
  Ee.displayName = "BarChart";
348
- const Ue = ne.forwardRef(
347
+ const Ue = te.forwardRef(
349
348
  ({
350
349
  data: t,
351
- xKey: o,
352
- series: a,
350
+ xKey: a,
351
+ series: o,
353
352
  curved: y = !1,
354
- showDots: f = !1,
353
+ showDots: m = !1,
355
354
  dotSize: x = 4,
356
- strokeWidth: i = 2,
355
+ strokeWidth: c = 2,
357
356
  height: M = 300,
358
- showGrid: B = !0,
357
+ showGrid: z = !0,
359
358
  showTooltip: N = !0,
360
359
  showLegend: A = !1,
361
360
  animate: k = !0,
362
- xLabel: T,
363
- yLabel: D,
361
+ xLabel: j,
362
+ yLabel: P,
364
363
  className: R,
365
- ...w
366
- }, Z) => {
367
- const { tooltip: E, show: q, hide: U } = pe(), O = le(), _ = k && !O, Q = a.map((h, X) => ae(h.color, X));
368
- return /* @__PURE__ */ g(
369
- re.div,
364
+ ...X
365
+ }, E) => {
366
+ const { tooltip: W, show: U, hide: I } = fe(), T = oe(), B = k && !T, q = o.map((d, w) => re(d.color, w));
367
+ return /* @__PURE__ */ p(
368
+ ne.div,
370
369
  {
371
- ref: Z,
372
- className: H("relative", R),
373
- ..._ ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
374
- ...ie(w),
370
+ ref: E,
371
+ className: Q("relative", R),
372
+ ...B ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
373
+ ...se(X),
375
374
  children: [
376
- /* @__PURE__ */ e(be, { height: M, children: ({ width: h, height: X, margin: b }) => {
377
- const c = t.map((r) => r[o]), j = c.every((r) => typeof r == "number");
375
+ /* @__PURE__ */ e(xe, { height: M, children: ({ width: d, height: w, margin: b }) => {
376
+ const i = t.map((r) => r[a]), V = i.every((r) => typeof r == "number");
378
377
  let $, L;
379
- if (j) {
380
- const r = c, d = Math.min(...r), G = Math.max(...r), S = oe().domain([d, G]).range([0, h]);
381
- $ = S, L = (C) => S(Number(C[o]));
378
+ if (V) {
379
+ const r = i, f = Math.min(...r), S = Math.max(...r), G = ae().domain([f, S]).range([0, d]);
380
+ $ = G, L = (C) => G(Number(C[a]));
382
381
  } else {
383
- const r = c.map(String), d = Ce().domain(r).range([0, h]).padding(0.5);
384
- $ = d, L = (G) => d(String(G[o])) ?? 0;
382
+ const r = i.map(String), f = Ce().domain(r).range([0, d]).padding(0.5);
383
+ $ = f, L = (S) => f(String(S[a])) ?? 0;
385
384
  }
386
385
  const u = t.flatMap(
387
- (r) => a.map((d) => Number(r[d.key]) || 0)
388
- ), s = Math.max(...u), l = oe().domain([0, s * 1.1]).range([X, 0]).nice(), p = y ? de : Ae, n = he().curve(p).defined((r) => r != null);
389
- return /* @__PURE__ */ g(te, { children: [
390
- B && /* @__PURE__ */ e(
391
- fe,
386
+ (r) => o.map((f) => Number(r[f.key]) || 0)
387
+ ), s = Math.max(...u), l = ae().domain([0, s * 1.1]).range([w, 0]).nice(), g = y ? ue : Ae, n = me().curve(g).defined((r) => r != null);
388
+ return /* @__PURE__ */ p(ee, { children: [
389
+ z && /* @__PURE__ */ e(
390
+ he,
392
391
  {
393
- width: h,
394
- height: X,
392
+ width: d,
393
+ height: w,
395
394
  yScale: l,
396
395
  horizontal: !0
397
396
  }
398
397
  ),
399
- a.map((r, d) => {
400
- const S = n.x((C) => L(C)).y((C) => l(Number(C[r.key]) || 0))(t) ?? "";
401
- return /* @__PURE__ */ g("g", { children: [
398
+ o.map((r, f) => {
399
+ const G = n.x((C) => L(C)).y((C) => l(Number(C[r.key]) || 0))(t) ?? "";
400
+ return /* @__PURE__ */ p("g", { children: [
402
401
  /* @__PURE__ */ e(
403
402
  "path",
404
403
  {
405
- d: S,
404
+ d: G,
406
405
  fill: "none",
407
- stroke: Q[d],
408
- strokeWidth: i,
406
+ stroke: q[f],
407
+ strokeWidth: c,
409
408
  strokeLinejoin: "round",
410
409
  strokeLinecap: "round"
411
410
  }
412
411
  ),
413
- f && t.map((C, W) => {
414
- const m = L(C), v = l(Number(C[r.key]) || 0);
412
+ m && t.map((C, J) => {
413
+ const h = L(C), v = l(Number(C[r.key]) || 0);
415
414
  return /* @__PURE__ */ e(
416
415
  "circle",
417
416
  {
418
- cx: m,
417
+ cx: h,
419
418
  cy: v,
420
419
  r: x,
421
- fill: Q[d],
420
+ fill: q[f],
422
421
  className: "transition-opacity hover:opacity-80"
423
422
  },
424
- `${r.key}-dot-${W}`
423
+ `${r.key}-dot-${J}`
425
424
  );
426
425
  })
427
426
  ] }, r.key);
428
427
  }),
429
- N && t.map((r, d) => {
430
- const G = L(r), S = h / Math.max(t.length - 1, 1);
428
+ N && t.map((r, f) => {
429
+ const S = L(r), G = d / Math.max(t.length - 1, 1);
431
430
  return /* @__PURE__ */ e(
432
431
  "rect",
433
432
  {
434
- x: G - S / 2,
433
+ x: S - G / 2,
435
434
  y: 0,
436
- width: S,
437
- height: X,
435
+ width: G,
436
+ height: w,
438
437
  fill: "transparent",
439
438
  onMouseMove: (C) => {
440
- var m;
441
- const W = (m = C.currentTarget.closest("div")) == null ? void 0 : m.getBoundingClientRect();
442
- q(
443
- C.clientX - ((W == null ? void 0 : W.left) ?? 0),
444
- C.clientY - ((W == null ? void 0 : W.top) ?? 0),
445
- /* @__PURE__ */ g("div", { children: [
446
- /* @__PURE__ */ e("div", { className: "font-medium", children: String(r[o]) }),
447
- a.map((v, P) => /* @__PURE__ */ g(
439
+ const J = C.currentTarget.closest("div")?.getBoundingClientRect();
440
+ U(
441
+ C.clientX - (J?.left ?? 0),
442
+ C.clientY - (J?.top ?? 0),
443
+ /* @__PURE__ */ p("div", { children: [
444
+ /* @__PURE__ */ e("div", { className: "font-medium", children: String(r[a]) }),
445
+ o.map((h, v) => /* @__PURE__ */ p(
448
446
  "div",
449
447
  {
450
448
  className: "flex items-center gap-ds-02",
@@ -453,46 +451,46 @@ const Ue = ne.forwardRef(
453
451
  "span",
454
452
  {
455
453
  className: "inline-block h-2 w-2 rounded-ds-full",
456
- style: { backgroundColor: Q[P] }
454
+ style: { backgroundColor: q[v] }
457
455
  }
458
456
  ),
459
- /* @__PURE__ */ g("span", { className: "text-surface-fg-muted", children: [
460
- v.label,
457
+ /* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
458
+ h.label,
461
459
  ":"
462
460
  ] }),
463
461
  " ",
464
- Number(r[v.key]).toLocaleString()
462
+ Number(r[h.key]).toLocaleString()
465
463
  ]
466
464
  },
467
- v.key
465
+ h.key
468
466
  ))
469
467
  ] })
470
468
  );
471
469
  },
472
- onMouseLeave: U
470
+ onMouseLeave: I
473
471
  },
474
- `hover-${d}`
472
+ `hover-${f}`
475
473
  );
476
474
  }),
477
475
  /* @__PURE__ */ e(
478
- ee,
476
+ K,
479
477
  {
480
478
  scale: $,
481
479
  orientation: "bottom",
482
- transform: `translate(0,${X})`,
483
- label: T
480
+ transform: `translate(0,${w})`,
481
+ label: j
484
482
  }
485
483
  ),
486
- /* @__PURE__ */ e(ee, { scale: l, orientation: "left", label: D })
484
+ /* @__PURE__ */ e(K, { scale: l, orientation: "left", label: P })
487
485
  ] });
488
486
  } }),
489
- N && /* @__PURE__ */ e(ue, { state: E }),
490
- A && a.length > 1 && /* @__PURE__ */ e(
487
+ N && /* @__PURE__ */ e(ie, { state: W }),
488
+ A && o.length > 1 && /* @__PURE__ */ e(
491
489
  ce,
492
490
  {
493
- items: a.map((h, X) => ({
494
- label: h.label,
495
- color: Q[X]
491
+ items: o.map((d, w) => ({
492
+ label: d.label,
493
+ color: q[w]
496
494
  })),
497
495
  className: "mt-ds-04"
498
496
  }
@@ -503,74 +501,73 @@ const Ue = ne.forwardRef(
503
501
  }
504
502
  );
505
503
  Ue.displayName = "LineChart";
506
- const Ze = ne.forwardRef(
504
+ const Ze = te.forwardRef(
507
505
  ({
508
506
  data: t,
509
- xKey: o,
510
- series: a,
507
+ xKey: a,
508
+ series: o,
511
509
  curved: y = !1,
512
- stacked: f = !1,
510
+ stacked: m = !1,
513
511
  fillOpacity: x = 0.3,
514
- gradient: i = !1,
512
+ gradient: c = !1,
515
513
  strokeWidth: M = 2,
516
- height: B = 300,
514
+ height: z = 300,
517
515
  showGrid: N = !0,
518
516
  showTooltip: A = !0,
519
517
  showLegend: k = !1,
520
- animate: T = !0,
521
- xLabel: D,
518
+ animate: j = !0,
519
+ xLabel: P,
522
520
  yLabel: R,
523
- className: w,
524
- ...Z
525
- }, E) => {
526
- const { tooltip: q, show: U, hide: O } = pe(), _ = le(), Q = T && !_, h = a.map((b, c) => ae(b.color, c)), X = ne.useId();
527
- return /* @__PURE__ */ g(
528
- re.div,
521
+ className: X,
522
+ ...E
523
+ }, W) => {
524
+ const { tooltip: U, show: I, hide: T } = fe(), B = oe(), q = j && !B, d = o.map((b, i) => re(b.color, i)), w = te.useId();
525
+ return /* @__PURE__ */ p(
526
+ ne.div,
529
527
  {
530
- ref: E,
531
- className: H("relative", w),
532
- ...Q ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
533
- ...ie(Z),
528
+ ref: W,
529
+ className: Q("relative", X),
530
+ ...q ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
531
+ ...se(E),
534
532
  children: [
535
- /* @__PURE__ */ e(be, { height: B, children: ({ width: b, height: c, margin: j }) => {
536
- const $ = t.map((m) => m[o]), L = $.every((m) => typeof m == "number");
533
+ /* @__PURE__ */ e(xe, { height: z, children: ({ width: b, height: i, margin: V }) => {
534
+ const $ = t.map((h) => h[a]), L = $.every((h) => typeof h == "number");
537
535
  let u, s, l;
538
536
  if (L) {
539
- const m = $, v = Math.min(...m), P = Math.max(...m), I = oe().domain([v, P]).range([0, b]);
540
- u = I, s = (V) => I(Number(V[o])), l = (V) => I(Number(t[V][o]));
537
+ const h = $, v = Math.min(...h), _ = Math.max(...h), Y = ae().domain([v, _]).range([0, b]);
538
+ u = Y, s = (F) => Y(Number(F[a])), l = (F) => Y(Number(t[F][a]));
541
539
  } else {
542
- const m = $.map(String), v = Ce().domain(m).range([0, b]).padding(0.5);
543
- u = v, s = (P) => v(String(P[o])) ?? 0, l = (P) => v(String(t[P][o])) ?? 0;
540
+ const h = $.map(String), v = Ce().domain(h).range([0, b]).padding(0.5);
541
+ u = v, s = (_) => v(String(_[a])) ?? 0, l = (_) => v(String(t[_][a])) ?? 0;
544
542
  }
545
- let p;
546
- f ? p = Math.max(
543
+ let g;
544
+ m ? g = Math.max(
547
545
  ...t.map(
548
- (m) => a.reduce((v, P) => v + (Number(m[P.key]) || 0), 0)
546
+ (h) => o.reduce((v, _) => v + (Number(h[_.key]) || 0), 0)
549
547
  )
550
- ) : p = Math.max(
548
+ ) : g = Math.max(
551
549
  ...t.flatMap(
552
- (m) => a.map((v) => Number(m[v.key]) || 0)
550
+ (h) => o.map((v) => Number(h[v.key]) || 0)
553
551
  )
554
552
  );
555
- const n = oe().domain([0, p * 1.1]).range([c, 0]).nice(), r = y ? de : Ae, d = () => t.map((m, v) => {
556
- const P = s(m), I = b / Math.max(t.length - 1, 1);
553
+ const n = ae().domain([0, g * 1.1]).range([i, 0]).nice(), r = y ? ue : Ae, f = () => t.map((h, v) => {
554
+ const _ = s(h), Y = b / Math.max(t.length - 1, 1);
557
555
  return /* @__PURE__ */ e(
558
556
  "rect",
559
557
  {
560
- x: P - I / 2,
558
+ x: _ - Y / 2,
561
559
  y: 0,
562
- width: I,
563
- height: c,
560
+ width: Y,
561
+ height: i,
564
562
  fill: "transparent",
565
- onMouseMove: (V) => {
566
- var z;
567
- const J = (z = V.currentTarget.closest("div")) == null ? void 0 : z.getBoundingClientRect();
568
- U(
569
- V.clientX - ((J == null ? void 0 : J.left) ?? 0),
570
- V.clientY - ((J == null ? void 0 : J.top) ?? 0),
571
- /* @__PURE__ */ g("div", { children: [
572
- /* @__PURE__ */ e("div", { className: "font-medium", children: String(m[o]) }),
573
- a.map((F, Y) => /* @__PURE__ */ g(
563
+ onMouseMove: (F) => {
564
+ const H = F.currentTarget.closest("div")?.getBoundingClientRect();
565
+ I(
566
+ F.clientX - (H?.left ?? 0),
567
+ F.clientY - (H?.top ?? 0),
568
+ /* @__PURE__ */ p("div", { children: [
569
+ /* @__PURE__ */ e("div", { className: "font-medium", children: String(h[a]) }),
570
+ o.map((D, Z) => /* @__PURE__ */ p(
574
571
  "div",
575
572
  {
576
573
  className: "flex items-center gap-ds-02",
@@ -579,30 +576,30 @@ const Ze = ne.forwardRef(
579
576
  "span",
580
577
  {
581
578
  className: "inline-block h-2 w-2 rounded-ds-full",
582
- style: { backgroundColor: h[Y] }
579
+ style: { backgroundColor: d[Z] }
583
580
  }
584
581
  ),
585
- /* @__PURE__ */ g("span", { className: "text-surface-fg-muted", children: [
586
- F.label,
582
+ /* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
583
+ D.label,
587
584
  ":"
588
585
  ] }),
589
586
  " ",
590
- Number(m[F.key]).toLocaleString()
587
+ Number(h[D.key]).toLocaleString()
591
588
  ]
592
589
  },
593
- F.key
590
+ D.key
594
591
  ))
595
592
  ] })
596
593
  );
597
594
  },
598
- onMouseLeave: O
595
+ onMouseLeave: T
599
596
  },
600
597
  `hover-${v}`
601
598
  );
602
- }), G = () => i ? /* @__PURE__ */ e("defs", { children: a.map((m, v) => /* @__PURE__ */ g(
599
+ }), S = () => c ? /* @__PURE__ */ e("defs", { children: o.map((h, v) => /* @__PURE__ */ p(
603
600
  "linearGradient",
604
601
  {
605
- id: `${X}-gradient-${v}`,
602
+ id: `${w}-gradient-${v}`,
606
603
  x1: "0",
607
604
  y1: "0",
608
605
  x2: "0",
@@ -612,7 +609,7 @@ const Ze = ne.forwardRef(
612
609
  "stop",
613
610
  {
614
611
  offset: "0%",
615
- stopColor: h[v],
612
+ stopColor: d[v],
616
613
  stopOpacity: x
617
614
  }
618
615
  ),
@@ -620,118 +617,118 @@ const Ze = ne.forwardRef(
620
617
  "stop",
621
618
  {
622
619
  offset: "100%",
623
- stopColor: h[v],
620
+ stopColor: d[v],
624
621
  stopOpacity: 0.05
625
622
  }
626
623
  )
627
624
  ]
628
625
  },
629
626
  `grad-${v}`
630
- )) }) : null, S = () => /* @__PURE__ */ g(te, { children: [
627
+ )) }) : null, G = () => /* @__PURE__ */ p(ee, { children: [
631
628
  /* @__PURE__ */ e(
632
- ee,
629
+ K,
633
630
  {
634
631
  scale: u,
635
632
  orientation: "bottom",
636
- transform: `translate(0,${c})`,
637
- label: D
633
+ transform: `translate(0,${i})`,
634
+ label: P
638
635
  }
639
636
  ),
640
- /* @__PURE__ */ e(ee, { scale: n, orientation: "left", label: R })
637
+ /* @__PURE__ */ e(K, { scale: n, orientation: "left", label: R })
641
638
  ] });
642
- if (f) {
643
- const m = a.map((z) => z.key), v = _e().keys(m).order(je).offset(Te), P = t.map((z) => {
644
- const F = { [o]: String(z[o]) };
645
- for (const Y of a)
646
- F[Y.key] = Number(z[Y.key]) || 0;
647
- return F;
648
- }), I = v(P), V = Ne().curve(r).x((z, F) => l(F)).y0((z) => n(z[0])).y1((z) => n(z[1])), J = he().curve(r).x((z, F) => l(F)).y((z) => n(z[1]));
649
- return /* @__PURE__ */ g(te, { children: [
650
- G(),
639
+ if (m) {
640
+ const h = o.map((D) => D.key), v = _e().keys(h).order(je).offset(Te), _ = t.map((D) => {
641
+ const Z = { [a]: String(D[a]) };
642
+ for (const O of o)
643
+ Z[O.key] = Number(D[O.key]) || 0;
644
+ return Z;
645
+ }), Y = v(_), F = Me().curve(r).x((D, Z) => l(Z)).y0((D) => n(D[0])).y1((D) => n(D[1])), H = me().curve(r).x((D, Z) => l(Z)).y((D) => n(D[1]));
646
+ return /* @__PURE__ */ p(ee, { children: [
647
+ S(),
651
648
  N && /* @__PURE__ */ e(
652
- fe,
649
+ he,
653
650
  {
654
651
  width: b,
655
- height: c,
652
+ height: i,
656
653
  yScale: n,
657
654
  horizontal: !0
658
655
  }
659
656
  ),
660
- [...I].reverse().map((z, F) => {
661
- const Y = I.length - 1 - F, K = z, we = V(K) ?? "", Le = J(K) ?? "", Ge = i ? `url(#${X}-gradient-${Y})` : h[Y];
662
- return /* @__PURE__ */ g("g", { children: [
657
+ [...Y].reverse().map((D, Z) => {
658
+ const O = Y.length - 1 - Z, Ne = D, Le = F(Ne) ?? "", Se = H(Ne) ?? "", we = c ? `url(#${w}-gradient-${O})` : d[O];
659
+ return /* @__PURE__ */ p("g", { children: [
663
660
  /* @__PURE__ */ e(
664
661
  "path",
665
662
  {
666
- d: we,
667
- fill: Ge,
668
- opacity: i ? 1 : x
663
+ d: Le,
664
+ fill: we,
665
+ opacity: c ? 1 : x
669
666
  }
670
667
  ),
671
668
  /* @__PURE__ */ e(
672
669
  "path",
673
670
  {
674
- d: Le,
671
+ d: Se,
675
672
  fill: "none",
676
- stroke: h[Y],
673
+ stroke: d[O],
677
674
  strokeWidth: M,
678
675
  strokeLinejoin: "round",
679
676
  strokeLinecap: "round"
680
677
  }
681
678
  )
682
- ] }, a[Y].key);
679
+ ] }, o[O].key);
683
680
  }),
684
- A && d(),
685
- S()
681
+ A && f(),
682
+ G()
686
683
  ] });
687
684
  }
688
- const C = Ne().curve(r).defined((m) => m != null), W = he().curve(r).defined((m) => m != null);
689
- return /* @__PURE__ */ g(te, { children: [
690
- G(),
685
+ const C = Me().curve(r).defined((h) => h != null), J = me().curve(r).defined((h) => h != null);
686
+ return /* @__PURE__ */ p(ee, { children: [
687
+ S(),
691
688
  N && /* @__PURE__ */ e(
692
- fe,
689
+ he,
693
690
  {
694
691
  width: b,
695
- height: c,
692
+ height: i,
696
693
  yScale: n,
697
694
  horizontal: !0
698
695
  }
699
696
  ),
700
- [...a].reverse().map((m, v) => {
701
- const P = a.length - 1 - v, I = C.x((Y) => s(Y)).y0(c).y1((Y) => n(Number(Y[m.key]) || 0)), V = W.x((Y) => s(Y)).y((Y) => n(Number(Y[m.key]) || 0)), J = I(t) ?? "", z = V(t) ?? "", F = i ? `url(#${X}-gradient-${P})` : h[P];
702
- return /* @__PURE__ */ g("g", { children: [
697
+ [...o].reverse().map((h, v) => {
698
+ const _ = o.length - 1 - v, Y = C.x((O) => s(O)).y0(i).y1((O) => n(Number(O[h.key]) || 0)), F = J.x((O) => s(O)).y((O) => n(Number(O[h.key]) || 0)), H = Y(t) ?? "", D = F(t) ?? "", Z = c ? `url(#${w}-gradient-${_})` : d[_];
699
+ return /* @__PURE__ */ p("g", { children: [
703
700
  /* @__PURE__ */ e(
704
701
  "path",
705
702
  {
706
- d: J,
707
- fill: F,
708
- opacity: i ? 1 : x
703
+ d: H,
704
+ fill: Z,
705
+ opacity: c ? 1 : x
709
706
  }
710
707
  ),
711
708
  /* @__PURE__ */ e(
712
709
  "path",
713
710
  {
714
- d: z,
711
+ d: D,
715
712
  fill: "none",
716
- stroke: h[P],
713
+ stroke: d[_],
717
714
  strokeWidth: M,
718
715
  strokeLinejoin: "round",
719
716
  strokeLinecap: "round"
720
717
  }
721
718
  )
722
- ] }, m.key);
719
+ ] }, h.key);
723
720
  }),
724
- A && d(),
725
- S()
721
+ A && f(),
722
+ G()
726
723
  ] });
727
724
  } }),
728
- A && /* @__PURE__ */ e(ue, { state: q }),
729
- k && a.length > 1 && /* @__PURE__ */ e(
725
+ A && /* @__PURE__ */ e(ie, { state: U }),
726
+ k && o.length > 1 && /* @__PURE__ */ e(
730
727
  ce,
731
728
  {
732
- items: a.map((b, c) => ({
729
+ items: o.map((b, i) => ({
733
730
  label: b.label,
734
- color: h[c]
731
+ color: d[i]
735
732
  })),
736
733
  className: "mt-ds-04"
737
734
  }
@@ -742,78 +739,77 @@ const Ze = ne.forwardRef(
742
739
  }
743
740
  );
744
741
  Ze.displayName = "AreaChart";
745
- const qe = ne.forwardRef(
742
+ const qe = te.forwardRef(
746
743
  ({
747
744
  data: t,
748
- variant: o = "pie",
749
- innerRadius: a = 0.6,
745
+ variant: a = "pie",
746
+ innerRadius: o = 0.6,
750
747
  padAngle: y = 0,
751
- cornerRadius: f = 0,
748
+ cornerRadius: m = 0,
752
749
  height: x = 300,
753
- showTooltip: i = !0,
750
+ showTooltip: c = !0,
754
751
  showLegend: M = !1,
755
- showLabels: B = !1,
752
+ showLabels: z = !1,
756
753
  animate: N = !0,
757
754
  className: A,
758
755
  centerLabel: k,
759
- ...T
760
- }, D) => {
761
- const R = ye(null), [w, Z] = me(0), [E, q] = me(null), { tooltip: U, show: O, hide: _ } = pe(), Q = le(), h = N && !Q;
762
- xe(() => {
756
+ ...j
757
+ }, P) => {
758
+ const R = ve(null), [X, E] = de(0), [W, U] = de(null), { tooltip: I, show: T, hide: B } = fe(), q = oe(), d = N && !q;
759
+ ye(() => {
763
760
  if (!R.current) return;
764
761
  const n = new ResizeObserver((r) => {
765
- const d = r[0];
766
- d && Z(d.contentRect.width);
762
+ const f = r[0];
763
+ f && E(f.contentRect.width);
767
764
  });
768
765
  return n.observe(R.current), () => n.disconnect();
769
766
  }, []);
770
- const b = (w > 0 ? Math.min(w, x) : x) / 2, c = o === "donut" ? b * a : 0, j = t.map((n, r) => ae(n.color, r)), $ = t.reduce((n, r) => n + r.value, 0), u = Ye().value((n) => n.value).padAngle(y).sort(null)(t), s = ve().innerRadius(c).outerRadius(b - 2).cornerRadius(f), l = c + (b - 2 - c) * 0.7, p = ve().innerRadius(l).outerRadius(l);
771
- return /* @__PURE__ */ g(
772
- re.div,
767
+ const b = (X > 0 ? Math.min(X, x) : x) / 2, i = a === "donut" ? b * o : 0, V = t.map((n, r) => re(n.color, r)), $ = t.reduce((n, r) => n + r.value, 0), u = Ye().value((n) => n.value).padAngle(y).sort(null)(t), s = ge().innerRadius(i).outerRadius(b - 2).cornerRadius(m), l = i + (b - 2 - i) * 0.7, g = ge().innerRadius(l).outerRadius(l);
768
+ return /* @__PURE__ */ p(
769
+ ne.div,
773
770
  {
774
771
  ref: (n) => {
775
- R.current = n, typeof D == "function" ? D(n) : D && (D.current = n);
772
+ R.current = n, typeof P == "function" ? P(n) : P && (P.current = n);
776
773
  },
777
- className: H("relative w-full", A),
778
- ...h ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
779
- ...ie(T),
774
+ className: Q("relative w-full", A),
775
+ ...d ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
776
+ ...se(j),
780
777
  children: [
781
- w > 0 && /* @__PURE__ */ g(te, { children: [
778
+ X > 0 && /* @__PURE__ */ p(ee, { children: [
782
779
  /* @__PURE__ */ e(
783
780
  "svg",
784
781
  {
785
- width: w,
782
+ width: X,
786
783
  height: x,
787
784
  role: "img",
788
785
  "aria-label": "Pie chart",
789
- children: /* @__PURE__ */ g("g", { transform: `translate(${w / 2},${x / 2})`, children: [
786
+ children: /* @__PURE__ */ p("g", { transform: `translate(${X / 2},${x / 2})`, children: [
790
787
  u.map((n, r) => {
791
- const d = s(n);
792
- if (!d) return null;
793
- const [G, S] = s.centroid(n), C = Math.atan2(S, G), W = Math.cos(C) * 4, m = Math.sin(C) * 4, v = E === r;
788
+ const f = s(n);
789
+ if (!f) return null;
790
+ const [S, G] = s.centroid(n), C = Math.atan2(G, S), J = Math.cos(C) * 4, h = Math.sin(C) * 4, v = W === r;
794
791
  return /* @__PURE__ */ e(
795
792
  "path",
796
793
  {
797
- d,
798
- fill: j[r],
794
+ d: f,
795
+ fill: V[r],
799
796
  className: "cursor-pointer transition-transform",
800
797
  style: {
801
- transform: v ? `translate(${W}px, ${m}px)` : void 0
798
+ transform: v ? `translate(${J}px, ${h}px)` : void 0
802
799
  },
803
- onMouseEnter: () => q(r),
804
- onMouseMove: (P) => {
805
- var I;
806
- if (i) {
807
- const V = (I = P.currentTarget.closest("div")) == null ? void 0 : I.getBoundingClientRect(), J = $ > 0 ? (n.data.value / $ * 100).toFixed(1) : "0";
808
- O(
809
- P.clientX - ((V == null ? void 0 : V.left) ?? 0),
810
- P.clientY - ((V == null ? void 0 : V.top) ?? 0),
811
- /* @__PURE__ */ g("div", { children: [
800
+ onMouseEnter: () => U(r),
801
+ onMouseMove: (_) => {
802
+ if (c) {
803
+ const Y = _.currentTarget.closest("div")?.getBoundingClientRect(), F = $ > 0 ? (n.data.value / $ * 100).toFixed(1) : "0";
804
+ T(
805
+ _.clientX - (Y?.left ?? 0),
806
+ _.clientY - (Y?.top ?? 0),
807
+ /* @__PURE__ */ p("div", { children: [
812
808
  /* @__PURE__ */ e("div", { className: "font-medium", children: n.data.label }),
813
- /* @__PURE__ */ g("div", { children: [
809
+ /* @__PURE__ */ p("div", { children: [
814
810
  n.data.value.toLocaleString(),
815
811
  " (",
816
- J,
812
+ F,
817
813
  "%)"
818
814
  ] })
819
815
  ] })
@@ -821,51 +817,51 @@ const qe = ne.forwardRef(
821
817
  }
822
818
  },
823
819
  onMouseLeave: () => {
824
- q(null), _();
820
+ U(null), B();
825
821
  }
826
822
  },
827
823
  `slice-${n.data.label}-${r}`
828
824
  );
829
825
  }),
830
- B && u.map((n, r) => {
831
- const [d, G] = p.centroid(n), S = $ > 0 ? (n.data.value / $ * 100).toFixed(0) : "0";
832
- return $ > 0 && n.data.value / $ < 0.03 ? null : /* @__PURE__ */ g(
826
+ z && u.map((n, r) => {
827
+ const [f, S] = g.centroid(n), G = $ > 0 ? (n.data.value / $ * 100).toFixed(0) : "0";
828
+ return $ > 0 && n.data.value / $ < 0.03 ? null : /* @__PURE__ */ p(
833
829
  "text",
834
830
  {
835
- x: d,
836
- y: G,
831
+ x: f,
832
+ y: S,
837
833
  textAnchor: "middle",
838
834
  dominantBaseline: "central",
839
835
  className: "pointer-events-none fill-accent-fg text-ds-xs font-medium",
840
836
  children: [
841
- S,
837
+ G,
842
838
  "%"
843
839
  ]
844
840
  },
845
841
  `label-${n.data.label}-${r}`
846
842
  );
847
843
  }),
848
- o === "donut" && k && c > 0 && /* @__PURE__ */ e(
844
+ a === "donut" && k && i > 0 && /* @__PURE__ */ e(
849
845
  "foreignObject",
850
846
  {
851
- x: -c * 0.7,
852
- y: -c * 0.7,
853
- width: c * 1.4,
854
- height: c * 1.4,
847
+ x: -i * 0.7,
848
+ y: -i * 0.7,
849
+ width: i * 1.4,
850
+ height: i * 1.4,
855
851
  children: /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center text-center text-surface-fg", children: k })
856
852
  }
857
853
  )
858
854
  ] })
859
855
  }
860
856
  ),
861
- i && /* @__PURE__ */ e(ue, { state: U })
857
+ c && /* @__PURE__ */ e(ie, { state: I })
862
858
  ] }),
863
859
  M && /* @__PURE__ */ e(
864
860
  ce,
865
861
  {
866
862
  items: t.map((n, r) => ({
867
863
  label: n.label,
868
- color: j[r]
864
+ color: V[r]
869
865
  })),
870
866
  className: "mt-ds-04"
871
867
  }
@@ -876,47 +872,47 @@ const qe = ne.forwardRef(
876
872
  }
877
873
  );
878
874
  qe.displayName = "PieChart";
879
- const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
875
+ const $e = { duration: 1, ease: "easeOut" }, Je = te.forwardRef(
880
876
  ({
881
877
  data: t,
882
- variant: o = "line",
883
- width: a = 120,
878
+ variant: a = "line",
879
+ width: o = 120,
884
880
  height: y = 32,
885
- color: f,
881
+ color: m,
886
882
  showLastDot: x = !1,
887
- strokeWidth: i = 1.5,
883
+ strokeWidth: c = 1.5,
888
884
  animate: M = !0,
889
- className: B,
885
+ className: z,
890
886
  ...N
891
887
  }, A) => {
892
- const k = ae(f, 0), T = le(), D = M && !T;
888
+ const k = re(m, 0), j = oe(), P = M && !j;
893
889
  if (!t.length) return null;
894
- const R = o === "bar" ? 1 : i, w = a - R * 2, Z = y - R * 2, E = oe().domain([0, Math.max(t.length - 1, 1)]).range([R, R + w]), q = Math.min(...t), U = Math.max(...t), O = q === U ? [q - 1, U + 1] : [q, U], _ = oe().domain(O).range([R + Z, R]);
895
- if (o === "bar") {
896
- const j = Math.max(
890
+ const R = a === "bar" ? 1 : c, X = o - R * 2, E = y - R * 2, W = ae().domain([0, Math.max(t.length - 1, 1)]).range([R, R + X]), U = Math.min(...t), I = Math.max(...t), T = U === I ? [U - 1, I + 1] : [U, I], B = ae().domain(T).range([R + E, R]);
891
+ if (a === "bar") {
892
+ const V = Math.max(
897
893
  1,
898
- (w - 1 * (t.length - 1)) / t.length
899
- ), $ = R + Z;
894
+ (X - 1 * (t.length - 1)) / t.length
895
+ ), $ = R + E;
900
896
  return /* @__PURE__ */ e(
901
897
  "svg",
902
898
  {
903
899
  ref: A,
904
- width: a,
900
+ width: o,
905
901
  height: y,
906
902
  role: "img",
907
903
  "aria-label": "Sparkline bar chart",
908
- className: H("inline-block align-middle", B),
904
+ className: Q("inline-block align-middle", z),
909
905
  ...N,
910
906
  children: t.map((L, u) => {
911
- const s = R + u * (j + 1), l = _(L), p = Math.max(1, $ - l);
907
+ const s = R + u * (V + 1), l = B(L), g = Math.max(1, $ - l);
912
908
  return /* @__PURE__ */ e(
913
909
  "rect",
914
910
  {
915
911
  x: s,
916
912
  y: l,
917
- width: j,
918
- height: p,
919
- rx: Math.min(1, j / 2),
913
+ width: V,
914
+ height: g,
915
+ rx: Math.min(1, V / 2),
920
916
  fill: k
921
917
  },
922
918
  u
@@ -925,27 +921,27 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
925
921
  }
926
922
  );
927
923
  }
928
- if (o === "area") {
929
- const c = Ne().curve(de).x((l, p) => E(p)).y0(R + Z).y1((l) => _(l)), j = he().curve(de).x((l, p) => E(p)).y((l) => _(l)), $ = c(t) ?? "", L = j(t) ?? "", u = E(t.length - 1), s = _(t[t.length - 1]);
930
- return /* @__PURE__ */ g(
924
+ if (a === "area") {
925
+ const i = Me().curve(ue).x((l, g) => W(g)).y0(R + E).y1((l) => B(l)), V = me().curve(ue).x((l, g) => W(g)).y((l) => B(l)), $ = i(t) ?? "", L = V(t) ?? "", u = W(t.length - 1), s = B(t[t.length - 1]);
926
+ return /* @__PURE__ */ p(
931
927
  "svg",
932
928
  {
933
929
  ref: A,
934
- width: a,
930
+ width: o,
935
931
  height: y,
936
932
  role: "img",
937
933
  "aria-label": "Sparkline area chart",
938
- className: H("inline-block align-middle", B),
934
+ className: Q("inline-block align-middle", z),
939
935
  ...N,
940
936
  children: [
941
937
  /* @__PURE__ */ e("path", { d: $, fill: k, opacity: 0.2 }),
942
- D ? /* @__PURE__ */ e(
943
- re.path,
938
+ P ? /* @__PURE__ */ e(
939
+ ne.path,
944
940
  {
945
941
  d: L,
946
942
  fill: "none",
947
943
  stroke: k,
948
- strokeWidth: i,
944
+ strokeWidth: c,
949
945
  strokeLinejoin: "round",
950
946
  strokeLinecap: "round",
951
947
  initial: { pathLength: 0 },
@@ -958,7 +954,7 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
958
954
  d: L,
959
955
  fill: "none",
960
956
  stroke: k,
961
- strokeWidth: i,
957
+ strokeWidth: c,
962
958
  strokeLinejoin: "round",
963
959
  strokeLinecap: "round"
964
960
  }
@@ -968,7 +964,7 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
968
964
  {
969
965
  cx: u,
970
966
  cy: s,
971
- r: i + 1,
967
+ r: c + 1,
972
968
  fill: k
973
969
  }
974
970
  )
@@ -976,25 +972,25 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
976
972
  }
977
973
  );
978
974
  }
979
- const h = he().curve(de).x((c, j) => E(j)).y((c) => _(c))(t) ?? "", X = E(t.length - 1), b = _(t[t.length - 1]);
980
- return /* @__PURE__ */ g(
975
+ const d = me().curve(ue).x((i, V) => W(V)).y((i) => B(i))(t) ?? "", w = W(t.length - 1), b = B(t[t.length - 1]);
976
+ return /* @__PURE__ */ p(
981
977
  "svg",
982
978
  {
983
979
  ref: A,
984
- width: a,
980
+ width: o,
985
981
  height: y,
986
982
  role: "img",
987
983
  "aria-label": "Sparkline chart",
988
- className: H("inline-block align-middle", B),
984
+ className: Q("inline-block align-middle", z),
989
985
  ...N,
990
986
  children: [
991
- D ? /* @__PURE__ */ e(
992
- re.path,
987
+ P ? /* @__PURE__ */ e(
988
+ ne.path,
993
989
  {
994
- d: h,
990
+ d,
995
991
  fill: "none",
996
992
  stroke: k,
997
- strokeWidth: i,
993
+ strokeWidth: c,
998
994
  strokeLinejoin: "round",
999
995
  strokeLinecap: "round",
1000
996
  initial: { pathLength: 0 },
@@ -1004,10 +1000,10 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
1004
1000
  ) : /* @__PURE__ */ e(
1005
1001
  "path",
1006
1002
  {
1007
- d: h,
1003
+ d,
1008
1004
  fill: "none",
1009
1005
  stroke: k,
1010
- strokeWidth: i,
1006
+ strokeWidth: c,
1011
1007
  strokeLinejoin: "round",
1012
1008
  strokeLinecap: "round"
1013
1009
  }
@@ -1015,9 +1011,9 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
1015
1011
  x && /* @__PURE__ */ e(
1016
1012
  "circle",
1017
1013
  {
1018
- cx: X,
1014
+ cx: w,
1019
1015
  cy: b,
1020
- r: i + 1,
1016
+ r: c + 1,
1021
1017
  fill: k
1022
1018
  }
1023
1019
  )
@@ -1027,44 +1023,44 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
1027
1023
  }
1028
1024
  );
1029
1025
  Je.displayName = "Sparkline";
1030
- const ge = (t) => t * Math.PI / 180, Qe = ne.forwardRef(
1026
+ const pe = (t) => t * Math.PI / 180, Qe = te.forwardRef(
1031
1027
  ({
1032
1028
  value: t,
1033
- max: o = 100,
1034
- min: a = 0,
1029
+ max: a = 100,
1030
+ min: o = 0,
1035
1031
  label: y,
1036
- valueLabel: f,
1032
+ valueLabel: m,
1037
1033
  color: x,
1038
- trackColor: i = "var(--color-surface-border)",
1034
+ trackColor: c = "var(--color-surface-border)",
1039
1035
  height: M = 200,
1040
- startAngle: B = -120,
1036
+ startAngle: z = -120,
1041
1037
  endAngle: N = 120,
1042
1038
  thickness: A = 16,
1043
1039
  animate: k = !0,
1044
- className: T,
1045
- ...D
1040
+ className: j,
1041
+ ...P
1046
1042
  }, R) => {
1047
- const w = le(), Z = Fe(w, k ? 600 : 0), E = k && !w, q = ae(x, 0), U = M, O = U / 2, _ = Math.min(Math.max(t, a), o), Q = o === a ? 0 : (_ - a) / (o - a), h = B + (N - B) * Q, X = typeof f == "function" ? f(_) : typeof f == "string" ? f : String(_), b = ve().innerRadius(O - A).outerRadius(O).startAngle(ge(B)).endAngle(ge(N)).cornerRadius(A / 2), c = ve().innerRadius(O - A).outerRadius(O).startAngle(ge(B)).endAngle(ge(h)).cornerRadius(A / 2), j = b(null) ?? "", $ = c(null) ?? "";
1043
+ const X = oe(), E = Fe(X, k ? 600 : 0), W = k && !X, U = re(x, 0), I = M, T = I / 2, B = Math.min(Math.max(t, o), a), q = a === o ? 0 : (B - o) / (a - o), d = z + (N - z) * q, w = typeof m == "function" ? m(B) : typeof m == "string" ? m : String(B), b = ge().innerRadius(T - A).outerRadius(T).startAngle(pe(z)).endAngle(pe(N)).cornerRadius(A / 2), i = ge().innerRadius(T - A).outerRadius(T).startAngle(pe(z)).endAngle(pe(d)).cornerRadius(A / 2), V = b(null) ?? "", $ = i(null) ?? "";
1048
1044
  return /* @__PURE__ */ e(
1049
- re.div,
1045
+ ne.div,
1050
1046
  {
1051
1047
  ref: R,
1052
- className: H("inline-flex flex-col items-center", T),
1053
- ...E ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
1054
- ...ie(D),
1048
+ className: Q("inline-flex flex-col items-center", j),
1049
+ ...W ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
1050
+ ...se(P),
1055
1051
  role: "meter",
1056
- "aria-valuenow": _,
1057
- "aria-valuemin": a,
1058
- "aria-valuemax": o,
1052
+ "aria-valuenow": B,
1053
+ "aria-valuemin": o,
1054
+ "aria-valuemax": a,
1059
1055
  "aria-label": y ?? "Gauge chart",
1060
- children: /* @__PURE__ */ e("svg", { width: U, height: U, role: "img", "aria-hidden": "true", children: /* @__PURE__ */ g("g", { transform: `translate(${O},${O})`, children: [
1061
- /* @__PURE__ */ e("path", { d: j, fill: i }),
1056
+ children: /* @__PURE__ */ e("svg", { width: I, height: I, role: "img", "aria-hidden": "true", children: /* @__PURE__ */ p("g", { transform: `translate(${T},${T})`, children: [
1057
+ /* @__PURE__ */ e("path", { d: V, fill: c }),
1062
1058
  /* @__PURE__ */ e(
1063
1059
  "path",
1064
1060
  {
1065
1061
  d: $,
1066
- fill: q,
1067
- style: Z > 0 ? { transition: `d ${Z}ms ease-out` } : void 0
1062
+ fill: U,
1063
+ style: E > 0 ? { transition: `d ${E}ms ease-out` } : void 0
1068
1064
  }
1069
1065
  ),
1070
1066
  /* @__PURE__ */ e(
@@ -1075,7 +1071,7 @@ const ge = (t) => t * Math.PI / 180, Qe = ne.forwardRef(
1075
1071
  textAnchor: "middle",
1076
1072
  dominantBaseline: "central",
1077
1073
  className: "fill-surface-fg text-ds-2xl font-semibold",
1078
- children: X
1074
+ children: w
1079
1075
  }
1080
1076
  ),
1081
1077
  y && /* @__PURE__ */ e(
@@ -1095,72 +1091,69 @@ const ge = (t) => t * Math.PI / 180, Qe = ne.forwardRef(
1095
1091
  }
1096
1092
  );
1097
1093
  Qe.displayName = "GaugeChart";
1098
- const He = ne.forwardRef(
1094
+ const He = te.forwardRef(
1099
1095
  ({
1100
1096
  data: t,
1101
- axes: o,
1102
- series: a,
1097
+ axes: a,
1098
+ series: o,
1103
1099
  maxValue: y,
1104
- levels: f = 5,
1100
+ levels: m = 5,
1105
1101
  fillOpacity: x = 0.25,
1106
- showDots: i = !1,
1102
+ showDots: c = !1,
1107
1103
  height: M = 300,
1108
- showTooltip: B = !0,
1104
+ showTooltip: z = !0,
1109
1105
  showLegend: N = !1,
1110
1106
  animate: A = !0,
1111
1107
  className: k,
1112
- ...T
1113
- }, D) => {
1114
- const R = ye(null), [w, Z] = me(0), { tooltip: E, show: q, hide: U } = pe(), O = le(), _ = A && !O;
1115
- xe(() => {
1108
+ ...j
1109
+ }, P) => {
1110
+ const R = ve(null), [X, E] = de(0), { tooltip: W, show: U, hide: I } = fe(), T = oe(), B = A && !T;
1111
+ ye(() => {
1116
1112
  if (!R.current) return;
1117
1113
  const u = new ResizeObserver((s) => {
1118
1114
  const l = s[0];
1119
- l && Z(l.contentRect.width);
1115
+ l && E(l.contentRect.width);
1120
1116
  });
1121
1117
  return u.observe(R.current), () => u.disconnect();
1122
1118
  }, []);
1123
- const h = (w > 0 ? Math.min(w, M) : M) / 2 - 40, X = a.map((u, s) => ae(u.color, s)), b = y ?? Math.max(
1124
- ...t.flatMap((u) => a.map((s) => Number(u[s.key]) || 0)),
1119
+ const d = (X > 0 ? Math.min(X, M) : M) / 2 - 40, w = o.map((u, s) => re(u.color, s)), b = y ?? Math.max(
1120
+ ...t.flatMap((u) => o.map((s) => Number(u[s.key]) || 0)),
1125
1121
  1
1126
- ), c = 2 * Math.PI / o.length, j = Oe().radius((u) => h * u / b).angle((u, s) => s * c).curve(We), $ = (u) => o.map((s, l) => {
1127
- var p;
1128
- return Number((p = t[l]) == null ? void 0 : p[u]) || 0;
1129
- }), L = (u, s) => {
1130
- const l = c * u - Math.PI / 2, p = h * s / b;
1122
+ ), i = 2 * Math.PI / a.length, V = Oe().radius((u) => d * u / b).angle((u, s) => s * i).curve(We), $ = (u) => a.map((s, l) => Number(t[l]?.[u]) || 0), L = (u, s) => {
1123
+ const l = i * u - Math.PI / 2, g = d * s / b;
1131
1124
  return {
1132
- x: p * Math.cos(l),
1133
- y: p * Math.sin(l)
1125
+ x: g * Math.cos(l),
1126
+ y: g * Math.sin(l)
1134
1127
  };
1135
1128
  };
1136
- return /* @__PURE__ */ g(
1137
- re.div,
1129
+ return /* @__PURE__ */ p(
1130
+ ne.div,
1138
1131
  {
1139
1132
  ref: (u) => {
1140
- R.current = u, typeof D == "function" ? D(u) : D && (D.current = u);
1133
+ R.current = u, typeof P == "function" ? P(u) : P && (P.current = u);
1141
1134
  },
1142
- className: H("relative w-full", k),
1143
- ..._ ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: se.fade } : {},
1144
- ...ie(T),
1135
+ className: Q("relative w-full", k),
1136
+ ...B ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
1137
+ ...se(j),
1145
1138
  children: [
1146
- w > 0 && /* @__PURE__ */ g(te, { children: [
1139
+ X > 0 && /* @__PURE__ */ p(ee, { children: [
1147
1140
  /* @__PURE__ */ e(
1148
1141
  "svg",
1149
1142
  {
1150
- width: w,
1143
+ width: X,
1151
1144
  height: M,
1152
1145
  role: "img",
1153
1146
  "aria-label": "Radar chart",
1154
- children: /* @__PURE__ */ g("g", { transform: `translate(${w / 2},${M / 2})`, children: [
1155
- Array.from({ length: f }, (u, s) => {
1156
- const l = h / f * (s + 1), p = o.map((n, r) => {
1157
- const d = c * r - Math.PI / 2;
1158
- return `${l * Math.cos(d)},${l * Math.sin(d)}`;
1147
+ children: /* @__PURE__ */ p("g", { transform: `translate(${X / 2},${M / 2})`, children: [
1148
+ Array.from({ length: m }, (u, s) => {
1149
+ const l = d / m * (s + 1), g = a.map((n, r) => {
1150
+ const f = i * r - Math.PI / 2;
1151
+ return `${l * Math.cos(f)},${l * Math.sin(f)}`;
1159
1152
  }).join(" ");
1160
1153
  return /* @__PURE__ */ e(
1161
1154
  "polygon",
1162
1155
  {
1163
- points: p,
1156
+ points: g,
1164
1157
  fill: "none",
1165
1158
  stroke: "var(--color-surface-border)",
1166
1159
  strokeDasharray: "3,3",
@@ -1169,14 +1162,14 @@ const He = ne.forwardRef(
1169
1162
  `grid-${s}`
1170
1163
  );
1171
1164
  }),
1172
- o.map((u, s) => {
1173
- const l = c * s - Math.PI / 2, p = h * Math.cos(l), n = h * Math.sin(l);
1165
+ a.map((u, s) => {
1166
+ const l = i * s - Math.PI / 2, g = d * Math.cos(l), n = d * Math.sin(l);
1174
1167
  return /* @__PURE__ */ e(
1175
1168
  "line",
1176
1169
  {
1177
1170
  x1: 0,
1178
1171
  y1: 0,
1179
- x2: p,
1172
+ x2: g,
1180
1173
  y2: n,
1181
1174
  stroke: "var(--color-surface-border)",
1182
1175
  strokeWidth: 1
@@ -1184,15 +1177,15 @@ const He = ne.forwardRef(
1184
1177
  `axis-${s}`
1185
1178
  );
1186
1179
  }),
1187
- o.map((u, s) => {
1188
- const l = c * s - Math.PI / 2, p = h + 18, n = p * Math.cos(l), r = p * Math.sin(l);
1189
- let d = "middle";
1190
- return Math.abs(Math.cos(l)) > 0.1 && (d = Math.cos(l) > 0 ? "start" : "end"), /* @__PURE__ */ e(
1180
+ a.map((u, s) => {
1181
+ const l = i * s - Math.PI / 2, g = d + 18, n = g * Math.cos(l), r = g * Math.sin(l);
1182
+ let f = "middle";
1183
+ return Math.abs(Math.cos(l)) > 0.1 && (f = Math.cos(l) > 0 ? "start" : "end"), /* @__PURE__ */ e(
1191
1184
  "text",
1192
1185
  {
1193
1186
  x: n,
1194
1187
  y: r,
1195
- textAnchor: d,
1188
+ textAnchor: f,
1196
1189
  dominantBaseline: "central",
1197
1190
  className: "fill-surface-fg-muted text-ds-xs",
1198
1191
  children: u
@@ -1200,13 +1193,13 @@ const He = ne.forwardRef(
1200
1193
  `label-${s}`
1201
1194
  );
1202
1195
  }),
1203
- Array.from({ length: f }, (u, s) => {
1204
- const l = Math.round(b / f * (s + 1)), p = h / f * (s + 1), n = -Math.PI / 2, r = p * Math.cos(n) + 4, d = p * Math.sin(n);
1196
+ Array.from({ length: m }, (u, s) => {
1197
+ const l = Math.round(b / m * (s + 1)), g = d / m * (s + 1), n = -Math.PI / 2, r = g * Math.cos(n) + 4, f = g * Math.sin(n);
1205
1198
  return /* @__PURE__ */ e(
1206
1199
  "text",
1207
1200
  {
1208
1201
  x: r,
1209
- y: d,
1202
+ y: f,
1210
1203
  textAnchor: "start",
1211
1204
  dominantBaseline: "auto",
1212
1205
  className: "fill-surface-fg-subtle text-ds-xs",
@@ -1215,29 +1208,29 @@ const He = ne.forwardRef(
1215
1208
  `level-label-${s}`
1216
1209
  );
1217
1210
  }),
1218
- a.map((u, s) => {
1219
- const l = $(u.key), p = j(l);
1220
- return p ? /* @__PURE__ */ g("g", { children: [
1211
+ o.map((u, s) => {
1212
+ const l = $(u.key), g = V(l);
1213
+ return g ? /* @__PURE__ */ p("g", { children: [
1221
1214
  /* @__PURE__ */ e(
1222
1215
  "path",
1223
1216
  {
1224
- d: p,
1225
- fill: X[s],
1217
+ d: g,
1218
+ fill: w[s],
1226
1219
  fillOpacity: x,
1227
- stroke: X[s],
1220
+ stroke: w[s],
1228
1221
  strokeWidth: 2,
1229
1222
  strokeLinejoin: "round"
1230
1223
  }
1231
1224
  ),
1232
- i && l.map((n, r) => {
1233
- const { x: d, y: G } = L(r, n);
1225
+ c && l.map((n, r) => {
1226
+ const { x: f, y: S } = L(r, n);
1234
1227
  return /* @__PURE__ */ e(
1235
1228
  "circle",
1236
1229
  {
1237
- cx: d,
1238
- cy: G,
1230
+ cx: f,
1231
+ cy: S,
1239
1232
  r: 4,
1240
- fill: X[s],
1233
+ fill: w[s],
1241
1234
  stroke: "var(--color-surface-base)",
1242
1235
  strokeWidth: 2,
1243
1236
  className: "transition-opacity"
@@ -1247,28 +1240,26 @@ const He = ne.forwardRef(
1247
1240
  })
1248
1241
  ] }, u.key) : null;
1249
1242
  }),
1250
- B && o.map((u, s) => {
1251
- const l = c * s - Math.PI / 2, p = h * Math.cos(l), n = h * Math.sin(l);
1243
+ z && a.map((u, s) => {
1244
+ const l = i * s - Math.PI / 2, g = d * Math.cos(l), n = d * Math.sin(l);
1252
1245
  return /* @__PURE__ */ e(
1253
1246
  "circle",
1254
1247
  {
1255
- cx: p,
1248
+ cx: g,
1256
1249
  cy: n,
1257
1250
  r: 16,
1258
1251
  fill: "transparent",
1259
1252
  className: "cursor-pointer",
1260
1253
  onMouseMove: (r) => {
1261
- var G;
1262
- const d = (G = r.currentTarget.closest("div")) == null ? void 0 : G.getBoundingClientRect();
1263
- q(
1264
- r.clientX - ((d == null ? void 0 : d.left) ?? 0),
1265
- r.clientY - ((d == null ? void 0 : d.top) ?? 0),
1266
- /* @__PURE__ */ g("div", { children: [
1254
+ const f = r.currentTarget.closest("div")?.getBoundingClientRect();
1255
+ U(
1256
+ r.clientX - (f?.left ?? 0),
1257
+ r.clientY - (f?.top ?? 0),
1258
+ /* @__PURE__ */ p("div", { children: [
1267
1259
  /* @__PURE__ */ e("div", { className: "font-medium", children: u }),
1268
- a.map((S, C) => {
1269
- var m;
1270
- const W = Number((m = t[s]) == null ? void 0 : m[S.key]) || 0;
1271
- return /* @__PURE__ */ g(
1260
+ o.map((S, G) => {
1261
+ const C = Number(t[s]?.[S.key]) || 0;
1262
+ return /* @__PURE__ */ p(
1272
1263
  "div",
1273
1264
  {
1274
1265
  className: "flex items-center gap-ds-02",
@@ -1277,15 +1268,15 @@ const He = ne.forwardRef(
1277
1268
  "span",
1278
1269
  {
1279
1270
  className: "inline-block h-2 w-2 rounded-ds-full",
1280
- style: { backgroundColor: X[C] }
1271
+ style: { backgroundColor: w[G] }
1281
1272
  }
1282
1273
  ),
1283
- /* @__PURE__ */ g("span", { className: "text-surface-fg-muted", children: [
1274
+ /* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
1284
1275
  S.label,
1285
1276
  ":"
1286
1277
  ] }),
1287
1278
  " ",
1288
- W.toLocaleString()
1279
+ C.toLocaleString()
1289
1280
  ]
1290
1281
  },
1291
1282
  S.key
@@ -1294,7 +1285,7 @@ const He = ne.forwardRef(
1294
1285
  ] })
1295
1286
  );
1296
1287
  },
1297
- onMouseLeave: U
1288
+ onMouseLeave: I
1298
1289
  },
1299
1290
  `hover-${s}`
1300
1291
  );
@@ -1302,14 +1293,14 @@ const He = ne.forwardRef(
1302
1293
  ] })
1303
1294
  }
1304
1295
  ),
1305
- B && /* @__PURE__ */ e(ue, { state: E })
1296
+ z && /* @__PURE__ */ e(ie, { state: W })
1306
1297
  ] }),
1307
1298
  N && /* @__PURE__ */ e(
1308
1299
  ce,
1309
1300
  {
1310
- items: a.map((u, s) => ({
1301
+ items: o.map((u, s) => ({
1311
1302
  label: u.label,
1312
- color: X[s]
1303
+ color: w[s]
1313
1304
  })),
1314
1305
  className: "mt-ds-04"
1315
1306
  }
@@ -1323,7 +1314,7 @@ He.displayName = "RadarChart";
1323
1314
  export {
1324
1315
  Ze as AreaChart,
1325
1316
  Ee as BarChart,
1326
- be as ChartContainer,
1317
+ xe as ChartContainer,
1327
1318
  Qe as GaugeChart,
1328
1319
  ce as Legend,
1329
1320
  Ue as LineChart,