@overdoser/react-toolkit 0.21.0 → 0.22.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 (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +27 -0
  3. package/components/Accordion/Accordion.js +48 -48
  4. package/components/ActionButton/ActionButton.js +23 -23
  5. package/components/ActionButton/CopyButton.js +5 -5
  6. package/components/Alert/Alert.js +13 -13
  7. package/components/Avatar/Avatar.js +12 -12
  8. package/components/Badge/Badge.js +6 -6
  9. package/components/Breadcrumbs/Breadcrumbs.js +15 -15
  10. package/components/Button/Button.js +14 -14
  11. package/components/Card/Card.js +26 -26
  12. package/components/Chart/AreaChart.js +103 -103
  13. package/components/Chart/Axis.js +7 -7
  14. package/components/Chart/BarChart.js +62 -62
  15. package/components/Chart/ChartContainer.js +11 -11
  16. package/components/Chart/ChartLegend.js +7 -7
  17. package/components/Chart/ChartTooltip.js +13 -13
  18. package/components/Chart/LineChart.js +88 -88
  19. package/components/Chart/PieChart.js +25 -25
  20. package/components/Chart/RadarChart.js +42 -42
  21. package/components/Chart/Sparkline.js +11 -11
  22. package/components/Chart/TradingChart.js +126 -126
  23. package/components/Chart/trading/period.js +3 -3
  24. package/components/Chip/Chip.js +24 -24
  25. package/components/CodeBlock/CodeBlock.js +31 -31
  26. package/components/CommandPalette/CommandPalette.js +166 -166
  27. package/components/ConfirmDialog/ConfirmDialog.js +60 -60
  28. package/components/Divider/Divider.js +10 -10
  29. package/components/Draggable/Draggable.js +29 -29
  30. package/components/Drawer/Drawer.js +53 -53
  31. package/components/Dropdown/Dropdown.js +66 -66
  32. package/components/Dropdown/DropdownItem.js +13 -13
  33. package/components/Dropdown/DropdownLabel.js +5 -5
  34. package/components/Dropdown/DropdownSeparator.js +5 -5
  35. package/components/Dropzone/Dropzone.js +15 -15
  36. package/components/EmptyState/EmptyState.js +11 -11
  37. package/components/Form/Form.js +17 -17
  38. package/components/Form/FormField.js +21 -21
  39. package/components/Form/FormRow.js +3 -3
  40. package/components/ImageViewer/ImageViewer.js +118 -118
  41. package/components/Kbd/Kbd.js +11 -11
  42. package/components/KeyValueList/KeyValueList.js +32 -32
  43. package/components/Link/Link.js +7 -7
  44. package/components/List/List.js +7 -7
  45. package/components/Loader/Loader.js +39 -39
  46. package/components/Modal/Modal.js +48 -48
  47. package/components/PageHeader/PageHeader.js +18 -18
  48. package/components/Pagination/Pagination.js +23 -23
  49. package/components/Popover/Popover.js +25 -25
  50. package/components/ProgressBar/ProgressBar.js +17 -17
  51. package/components/RelativeTime/RelativeTime.js +10 -10
  52. package/components/SegmentedControl/SegmentedControl.js +38 -38
  53. package/components/Skeleton/Skeleton.js +10 -10
  54. package/components/Spinner/Spinner.js +7 -7
  55. package/components/SplitButton/SplitButton.js +63 -63
  56. package/components/SplitPane/SplitPane.js +50 -50
  57. package/components/StatCard/StatCard.js +32 -32
  58. package/components/StatusDot/StatusDot.js +7 -7
  59. package/components/Table/Table.js +174 -174
  60. package/components/Tabs/Tabs.js +47 -47
  61. package/components/ThemeToggle/ThemeToggle.js +31 -31
  62. package/components/Timeline/GanttTimeline.js +213 -213
  63. package/components/Timeline/HistoryTimeline.js +306 -306
  64. package/components/Timeline/TimelineShared.js +103 -103
  65. package/components/Timeline/TraceEventDetails.js +103 -103
  66. package/components/Timeline/TraceTimeline.js +546 -546
  67. package/components/Timeline/historyLayout.js +2 -2
  68. package/components/Timer/Timer.js +39 -39
  69. package/components/Toast/Toast.js +59 -59
  70. package/components/ToggleIconButton/ToggleIconButton.js +9 -9
  71. package/components/Tooltip/Tooltip.js +16 -16
  72. package/components/Typography/Typography.js +5 -5
  73. package/components/inputs/Checkbox/Checkbox.js +11 -11
  74. package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
  75. package/components/inputs/DatePicker/CalendarPanel.js +113 -113
  76. package/components/inputs/DatePicker/DatePicker.js +39 -39
  77. package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
  78. package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
  79. package/components/inputs/DateTimePicker/TimeField.js +34 -34
  80. package/components/inputs/Input/Input.js +13 -13
  81. package/components/inputs/NumberInput/NumberInput.js +16 -16
  82. package/components/inputs/Radio/Radio.js +17 -17
  83. package/components/inputs/SearchInput/SearchInput.js +25 -25
  84. package/components/inputs/Select/Select.d.ts +55 -3
  85. package/components/inputs/Select/Select.js +485 -344
  86. package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
  87. package/components/inputs/Slider/Slider.js +21 -21
  88. package/components/inputs/Switch/Switch.js +4 -4
  89. package/components/inputs/Textarea/Textarea.js +8 -8
  90. package/hooks/usePortalPosition.d.ts +2 -1
  91. package/hooks/usePortalPosition.js +6 -3
  92. package/hooks/useResizable.js +1 -1
  93. package/hooks/useTheme.js +7 -7
  94. package/index.css +1 -1
  95. package/index.js +1 -1
  96. package/index.layered.css +1 -1
  97. package/llms.txt +25 -4
  98. package/manifest.json +33 -4
  99. package/package.json +1 -1
  100. /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
  101. /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
  102. /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
  103. /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
  104. /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
  105. /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
  106. /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
  107. /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
  108. /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
  109. /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
  110. /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
  111. /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
  112. /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
  113. /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
  114. /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
  115. /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
  116. /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
  117. /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
  118. /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
  119. /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
  120. /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
  121. /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
  122. /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
  123. /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
  124. /package/components/List/{List.module.js → List.module.scss.js} +0 -0
  125. /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
  126. /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
  127. /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
  128. /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
  129. /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
  130. /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
  131. /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
  132. /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
  133. /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
  134. /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
  135. /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
  136. /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
  137. /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
  138. /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
  139. /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
  140. /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
  141. /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
  142. /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
  143. /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
  144. /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
  145. /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
  146. /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
  147. /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
  148. /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
  149. /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
  150. /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
  151. /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
  152. /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
  153. /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
  154. /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
  155. /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
  156. /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
  157. /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
  158. /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
  159. /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
  160. /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
  161. /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { ChartContainer as e } from "./ChartContainer.js";
2
- import { ChartLegend as t } from "./ChartLegend.js";
3
- import { ChartTooltip as n } from "./ChartTooltip.js";
4
- import { bandScale as r, extent as i, linearScale as a, niceTicks as o } from "./scales.js";
5
- import s from "./Chart.module.js";
6
- import { useMemo as c, useRef as l, useState as u } from "react";
7
- import d from "clsx";
1
+ import { useMemo as e, useRef as t, useState as n } from "react";
2
+ import r from "clsx";
3
+ import { ChartContainer as i } from "./ChartContainer.js";
4
+ import { ChartLegend as a } from "./ChartLegend.js";
5
+ import { ChartTooltip as o } from "./ChartTooltip.js";
6
+ import { bandScale as s, extent as c, linearScale as l, niceTicks as u } from "./scales.js";
7
+ import d from "./Chart.module.scss.js";
8
8
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
9
  // src/components/Chart/BarChart.tsx
10
10
  var h = [
@@ -33,7 +33,7 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
33
33
  let W = w === "horizontal", G = {
34
34
  ...W ? _ : g,
35
35
  ...se
36
- }, K = c(() => Object.keys(C), [C]), q = T && K.length > 1, [J, Y] = u(null), X = l(null), Z = y.map((e) => String(e[S])), Q = I ?? J, le = c(() => {
36
+ }, K = e(() => Object.keys(C), [C]), q = T && K.length > 1, [J, Y] = n(null), X = t(null), Z = y.map((e) => String(e[S])), Q = I ?? J, le = e(() => {
37
37
  if (q) {
38
38
  let e = 0, t = 0;
39
39
  for (let n of y) {
@@ -51,7 +51,7 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
51
51
  let r = t[n];
52
52
  typeof r == "number" && e.push(r);
53
53
  }
54
- let [t, n] = i(e);
54
+ let [t, n] = c(e);
55
55
  return [Math.min(0, t), Math.max(0, n)];
56
56
  }, [
57
57
  y,
@@ -60,18 +60,18 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
60
60
  ]);
61
61
  if (y.length === 0) return /* @__PURE__ */ p("div", {
62
62
  ref: X,
63
- className: d(s.root, U?.root, V),
63
+ className: r(d.root, U?.root, V),
64
64
  style: H,
65
65
  children: /* @__PURE__ */ p("div", {
66
- className: s.canvas,
66
+ className: d.canvas,
67
67
  style: { height: D ?? 240 },
68
68
  children: /* @__PURE__ */ p("div", {
69
- className: s.empty,
69
+ className: d.empty,
70
70
  children: ce
71
71
  })
72
72
  })
73
73
  });
74
- let $ = o(le[0], le[1], ae), ue = $[0], de = $[$.length - 1], fe = (e, t) => ie === "index" ? P[t % P.length] : C[e]?.color ?? P[0], pe = te && Q !== null && y[Q] ? /* @__PURE__ */ p(n, {
74
+ let $ = u(le[0], le[1], ae), ue = $[0], de = $[$.length - 1], fe = (e, t) => ie === "index" ? P[t % P.length] : C[e]?.color ?? P[0], pe = te && Q !== null && y[Q] ? /* @__PURE__ */ p(o, {
75
75
  row: y[Q],
76
76
  x: b(y, S, G, Q, X, W, O),
77
77
  y: W ? x(y, S, G, Q, X, O) : 16,
@@ -86,34 +86,34 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
86
86
  },
87
87
  classes: U
88
88
  }) : null;
89
- return /* @__PURE__ */ p(e, {
89
+ return /* @__PURE__ */ p(i, {
90
90
  ref: X,
91
91
  aspectRatio: E,
92
92
  height: D,
93
93
  className: V,
94
94
  style: H,
95
95
  classes: U,
96
- legend: M ? /* @__PURE__ */ p(t, {
96
+ legend: M ? /* @__PURE__ */ p(a, {
97
97
  config: C,
98
98
  classes: U
99
99
  }) : void 0,
100
100
  overlay: pe,
101
101
  children: ({ width: e, height: t }) => {
102
- let n = G.left, i = e - G.right, o = G.top, c = t - G.bottom, l = Math.max(0, i - n), u = Math.max(0, c - o), h = r(Z, W ? [o, c] : [n, i], O), g = h.bandWidth(), _ = a([ue, de], W ? [n, i] : [c, o]), b = _(0), x = g / (q ? 1 : Math.max(1, K.length)), S = x * (1 - k), C = $.map((e) => ({
102
+ let n = G.left, i = e - G.right, a = G.top, o = t - G.bottom, c = Math.max(0, i - n), u = Math.max(0, o - a), h = s(Z, W ? [a, o] : [n, i], O), g = h.bandWidth(), _ = l([ue, de], W ? [n, i] : [o, a]), b = _(0), x = g / (q ? 1 : Math.max(1, K.length)), S = x * (1 - k), C = $.map((e) => ({
103
103
  value: e,
104
104
  pos: _(e)
105
105
  })), w = v(Z);
106
106
  return /* @__PURE__ */ m(f, { children: [
107
107
  j && /* @__PURE__ */ p("g", {
108
- className: d(s.axis, U?.axis),
108
+ className: r(d.axis, U?.axis),
109
109
  children: C.map(({ value: e, pos: t }) => W ? /* @__PURE__ */ p("line", {
110
- className: d(s.gridLine, U?.grid),
110
+ className: r(d.gridLine, U?.grid),
111
111
  x1: t,
112
112
  x2: t,
113
- y1: o,
114
- y2: c
113
+ y1: a,
114
+ y2: o
115
115
  }, `g-${e}`) : /* @__PURE__ */ p("line", {
116
- className: d(s.gridLine, U?.grid),
116
+ className: r(d.gridLine, U?.grid),
117
117
  x1: n,
118
118
  x2: i,
119
119
  y1: t,
@@ -121,55 +121,55 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
121
121
  }, `g-${e}`))
122
122
  }),
123
123
  /* @__PURE__ */ p("g", {
124
- className: d(s.axis, U?.axis),
124
+ className: r(d.axis, U?.axis),
125
125
  children: C.map(({ value: e, pos: t }) => {
126
- let r = R ? R(e) : String(e);
126
+ let i = R ? R(e) : String(e);
127
127
  return W ? /* @__PURE__ */ p("text", {
128
- className: d(s.axisLabel, U?.axisLabel),
128
+ className: r(d.axisLabel, U?.axisLabel),
129
129
  x: t,
130
- y: c + 16,
130
+ y: o + 16,
131
131
  textAnchor: "middle",
132
- children: r
132
+ children: i
133
133
  }, `vt-${e}`) : /* @__PURE__ */ p("text", {
134
- className: d(s.axisLabel, U?.axisLabel),
134
+ className: r(d.axisLabel, U?.axisLabel),
135
135
  x: n - 8,
136
136
  y: t,
137
137
  textAnchor: "end",
138
138
  dominantBaseline: "middle",
139
- children: r
139
+ children: i
140
140
  }, `vt-${e}`);
141
141
  })
142
142
  }),
143
143
  /* @__PURE__ */ p("g", {
144
- className: d(s.axis, U?.axis),
144
+ className: r(d.axis, U?.axis),
145
145
  children: w.map((e) => {
146
- let t = h(e), r = oe ? oe(e) : e;
146
+ let t = h(e), i = oe ? oe(e) : e;
147
147
  return W ? /* @__PURE__ */ p("text", {
148
- className: d(s.axisLabel, U?.axisLabel),
148
+ className: r(d.axisLabel, U?.axisLabel),
149
149
  x: n - 8,
150
150
  y: t,
151
151
  textAnchor: "end",
152
152
  dominantBaseline: "middle",
153
- children: r
153
+ children: i
154
154
  }, `c-${e}`) : /* @__PURE__ */ p("text", {
155
- className: d(s.axisLabel, U?.axisLabel),
155
+ className: r(d.axisLabel, U?.axisLabel),
156
156
  x: t,
157
- y: c + 16,
157
+ y: o + 16,
158
158
  textAnchor: "middle",
159
- children: r
159
+ children: i
160
160
  }, `c-${e}`);
161
161
  })
162
162
  }),
163
163
  y.map((e, t) => {
164
- let n = h(Z[t]) - g / 2, r = 0, i = 0;
164
+ let n = h(Z[t]) - g / 2, i = 0, a = 0;
165
165
  return /* @__PURE__ */ p("g", {
166
- className: d(s.series, U?.series),
167
- children: K.map((a, o) => {
168
- let c = e[a];
166
+ className: r(d.series, U?.series),
167
+ children: K.map((o, s) => {
168
+ let c = e[o];
169
169
  if (typeof c != "number") return null;
170
- let l = c, u = fe(a, t), f = F !== void 0 && l < 0 ? F : u, h = I === void 0 ? J === t : I === t, v = I !== void 0 && !h, y, b;
171
- q ? l >= 0 ? (y = r, b = r + l, r = b) : (y = i, b = i + l, i = b) : (y = 0, b = l);
172
- let C = _(y), w = _(b), T = q ? (g - S) / 2 : o * x + (x - S) / 2, E = 0, D = 0, O = 0, k = 0;
170
+ let l = c, u = fe(o, t), f = F !== void 0 && l < 0 ? F : u, h = I === void 0 ? J === t : I === t, v = I !== void 0 && !h, y, b;
171
+ q ? l >= 0 ? (y = i, b = i + l, i = b) : (y = a, b = a + l, a = b) : (y = 0, b = l);
172
+ let C = _(y), w = _(b), T = q ? (g - S) / 2 : s * x + (x - S) / 2, E = 0, D = 0, O = 0, k = 0;
173
173
  if (W) {
174
174
  let e = Math.min(C, w), t = Math.max(C, w);
175
175
  E = e, O = t - e, D = n + T, k = S;
@@ -180,7 +180,7 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
180
180
  let j = re ? re({
181
181
  row: e,
182
182
  value: l,
183
- seriesKey: a,
183
+ seriesKey: o,
184
184
  index: t
185
185
  }) : ne ? z ? z(l) : String(l) : null, M = ee({
186
186
  isHorizontal: W,
@@ -192,7 +192,7 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
192
192
  value: l
193
193
  });
194
194
  return /* @__PURE__ */ m("g", { children: [/* @__PURE__ */ p("rect", {
195
- className: d(s.bar, h && s.activeBar, U?.point),
195
+ className: r(d.bar, h && d.activeBar, U?.point),
196
196
  x: E,
197
197
  y: D,
198
198
  width: Math.max(0, O),
@@ -204,12 +204,12 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
204
204
  onClick: L ? () => L({
205
205
  row: e,
206
206
  value: l,
207
- seriesKey: a,
207
+ seriesKey: o,
208
208
  index: t
209
209
  }) : void 0,
210
210
  style: L ? { cursor: "pointer" } : void 0
211
211
  }), j != null && /* @__PURE__ */ p("text", {
212
- className: d(s.axisLabel, (N === "inside" || N === "inside-start") && s.barLabelInside),
212
+ className: r(d.axisLabel, (N === "inside" || N === "inside-start") && d.barLabelInside),
213
213
  x: M.x,
214
214
  y: M.y,
215
215
  textAnchor: M.textAnchor,
@@ -217,26 +217,26 @@ function y({ data: y, xKey: S, config: C, orientation: w = "vertical", stacked:
217
217
  transform: M.rotate ? `rotate(${M.rotate} ${M.x} ${M.y})` : void 0,
218
218
  opacity: v ? .5 : 1,
219
219
  children: j
220
- })] }, a);
220
+ })] }, o);
221
221
  })
222
222
  }, `group-${t}`);
223
223
  }),
224
224
  ue < 0 && de > 0 && /* @__PURE__ */ p("line", {
225
- className: d(s.gridLine),
225
+ className: r(d.gridLine),
226
226
  x1: W ? b : n,
227
227
  x2: W ? b : i,
228
- y1: W ? o : b,
229
- y2: W ? c : b,
228
+ y1: W ? a : b,
229
+ y2: W ? o : b,
230
230
  opacity: .9
231
231
  }),
232
232
  /* @__PURE__ */ p("rect", {
233
- className: s.interactionLayer,
233
+ className: d.interactionLayer,
234
234
  x: n,
235
- y: o,
236
- width: l,
235
+ y: a,
236
+ width: c,
237
237
  height: u,
238
238
  onMouseMove: (e) => {
239
- let t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left + n, i = e.clientY - t.top + o, a = h.step(), s = W ? i - o : r - n, c = Math.max(0, Math.min(y.length - 1, Math.round((s - a / 2) / a)));
239
+ let t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left + n, i = e.clientY - t.top + a, o = h.step(), s = W ? i - a : r - n, c = Math.max(0, Math.min(y.length - 1, Math.round((s - o / 2) / o)));
240
240
  Y(c);
241
241
  },
242
242
  onMouseLeave: () => Y(null)
@@ -297,16 +297,16 @@ function ee({ isHorizontal: e, valuePosition: t, x: n, y: r, rectW: i, rectH: a,
297
297
  dominantBaseline: s ? "auto" : "middle"
298
298
  };
299
299
  }
300
- function b(e, t, n, i, a, o, s) {
301
- let c = a.current;
300
+ function b(e, t, n, r, i, a, o) {
301
+ let c = i.current;
302
302
  if (!c) return 0;
303
303
  let l = c.getBoundingClientRect(), u = e.map((e) => String(e[t]));
304
- return o ? l.width / 2 : r(u, [n.left, l.width - n.right], s)(u[i]);
304
+ return a ? l.width / 2 : s(u, [n.left, l.width - n.right], o)(u[r]);
305
305
  }
306
- function x(e, t, n, i, a, o) {
307
- let s = a.current;
308
- if (!s) return 16;
309
- let c = s.getBoundingClientRect(), l = e.map((e) => String(e[t]));
310
- return r(l, [n.top, c.height - n.bottom], o)(l[i]);
306
+ function x(e, t, n, r, i, a) {
307
+ let o = i.current;
308
+ if (!o) return 16;
309
+ let c = o.getBoundingClientRect(), l = e.map((e) => String(e[t]));
310
+ return s(l, [n.top, c.height - n.bottom], a)(l[r]);
311
311
  }
312
312
  export { y as BarChart };
@@ -1,22 +1,22 @@
1
- import { useChartDimensions as e } from "./useChartDimensions.js";
2
- import t from "./Chart.module.js";
3
- import { forwardRef as n, useImperativeHandle as r, useRef as i } from "react";
4
- import a from "clsx";
1
+ import { forwardRef as e, useImperativeHandle as t, useRef as n } from "react";
2
+ import r from "clsx";
3
+ import { useChartDimensions as i } from "./useChartDimensions.js";
4
+ import a from "./Chart.module.scss.js";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  // src/components/Chart/ChartContainer.tsx
7
- var c = n(({ aspectRatio: n = 16 / 9, height: c, className: l, style: u, classes: d, legend: f, overlay: p, children: m }, h) => {
8
- let g = i(null);
9
- r(h, () => g.current);
10
- let { width: _ } = e(g), v = Math.max(0, _), y = c ?? Math.round(v / n);
7
+ var c = e(({ aspectRatio: e = 16 / 9, height: c, className: l, style: u, classes: d, legend: f, overlay: p, children: m }, h) => {
8
+ let g = n(null);
9
+ t(h, () => g.current);
10
+ let { width: _ } = i(g), v = Math.max(0, _), y = c ?? Math.round(v / e);
11
11
  return /* @__PURE__ */ s("div", {
12
12
  ref: g,
13
- className: a(t.root, d?.root, l),
13
+ className: r(a.root, d?.root, l),
14
14
  style: u,
15
15
  children: [/* @__PURE__ */ s("div", {
16
- className: t.canvas,
16
+ className: a.canvas,
17
17
  style: { height: y || void 0 },
18
18
  children: [v > 0 && y > 0 && /* @__PURE__ */ o("svg", {
19
- className: a(t.svg, d?.svg),
19
+ className: r(a.svg, d?.svg),
20
20
  width: v,
21
21
  height: y,
22
22
  viewBox: `0 0 ${v} ${y}`,
@@ -1,28 +1,28 @@
1
- import e from "./Chart.module.js";
2
- import t from "clsx";
1
+ import e from "clsx";
2
+ import t from "./Chart.module.scss.js";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  // src/components/Chart/ChartLegend.tsx
5
5
  function i({ config: i, order: a, classes: o }) {
6
6
  let s = a ?? Object.keys(i);
7
7
  return /* @__PURE__ */ n("div", {
8
- className: t(e.legend, o?.legend),
8
+ className: e(t.legend, o?.legend),
9
9
  role: "list",
10
10
  children: s.map((a) => {
11
11
  let s = i[a];
12
12
  return s ? /* @__PURE__ */ r("div", {
13
- className: t(e.legendItem, o?.legendItem),
13
+ className: e(t.legendItem, o?.legendItem),
14
14
  role: "listitem",
15
15
  children: [s.icon ? /* @__PURE__ */ n("span", {
16
- className: e.legendIcon,
16
+ className: t.legendIcon,
17
17
  style: { color: s.color },
18
18
  "aria-hidden": "true",
19
19
  children: s.icon
20
20
  }) : /* @__PURE__ */ n("span", {
21
- className: e.legendSwatch,
21
+ className: t.legendSwatch,
22
22
  style: { background: s.color },
23
23
  "aria-hidden": "true"
24
24
  }), /* @__PURE__ */ n("span", {
25
- className: e.legendLabel,
25
+ className: t.legendLabel,
26
26
  children: s.label
27
27
  })]
28
28
  }, a) : null;
@@ -1,12 +1,12 @@
1
- import e from "./Chart.module.js";
2
- import t from "clsx";
1
+ import e from "clsx";
2
+ import t from "./Chart.module.scss.js";
3
3
  import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  // src/components/Chart/ChartTooltip.tsx
5
5
  function a({ row: a, x: o, y: s, containerWidth: c, config: l, render: u, valueFormat: d = String, titleKey: f, resolveColor: p, classes: m }) {
6
6
  if (!a) return null;
7
7
  let h = o + 180 + 16 > c ? o - 180 - 12 : o + 12, g = Math.max(8, s - 16);
8
8
  return /* @__PURE__ */ r("div", {
9
- className: t(e.tooltip, m?.tooltip),
9
+ className: e(t.tooltip, m?.tooltip),
10
10
  style: {
11
11
  left: h,
12
12
  top: g,
@@ -14,32 +14,32 @@ function a({ row: a, x: o, y: s, containerWidth: c, config: l, render: u, valueF
14
14
  },
15
15
  role: "tooltip",
16
16
  children: u ? u(a) : /* @__PURE__ */ i(n, { children: [f && a[f] !== void 0 && /* @__PURE__ */ r("div", {
17
- className: e.tooltipTitle,
17
+ className: t.tooltipTitle,
18
18
  children: String(a[f])
19
19
  }), /* @__PURE__ */ r("div", {
20
- className: e.tooltipRows,
21
- children: Object.entries(l).map(([t, n]) => {
22
- let o = a[t];
20
+ className: t.tooltipRows,
21
+ children: Object.entries(l).map(([e, n]) => {
22
+ let o = a[e];
23
23
  if (o == null) return null;
24
- let s = typeof o == "number" ? d(o) : String(o), c = p?.(t) ?? n.color;
24
+ let s = typeof o == "number" ? d(o) : String(o), c = p?.(e) ?? n.color;
25
25
  return /* @__PURE__ */ i("div", {
26
- className: e.tooltipRow,
26
+ className: t.tooltipRow,
27
27
  children: [
28
28
  /* @__PURE__ */ r("span", {
29
- className: e.legendSwatch,
29
+ className: t.legendSwatch,
30
30
  style: { background: c },
31
31
  "aria-hidden": "true"
32
32
  }),
33
33
  /* @__PURE__ */ r("span", {
34
- className: e.tooltipLabel,
34
+ className: t.tooltipLabel,
35
35
  children: n.label
36
36
  }),
37
37
  /* @__PURE__ */ r("span", {
38
- className: e.tooltipValue,
38
+ className: t.tooltipValue,
39
39
  children: s
40
40
  })
41
41
  ]
42
- }, t);
42
+ }, e);
43
43
  })
44
44
  })] })
45
45
  });