@expcat/tigercat-react 0.1.8 → 0.2.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 (169) hide show
  1. package/dist/{chunk-TBIEWDY5.js → chunk-36RRHNZD.js} +13 -2
  2. package/dist/chunk-3CDAG4HD.mjs +151 -0
  3. package/dist/chunk-3QFHVAZT.js +68 -0
  4. package/dist/{chunk-ALP3KYYY.mjs → chunk-3XKBDV2Q.mjs} +5 -5
  5. package/dist/chunk-42UKIFFQ.js +278 -0
  6. package/dist/{chunk-K7ZMB2TH.mjs → chunk-5XKYWZZZ.mjs} +16 -22
  7. package/dist/chunk-677VSTPW.mjs +65 -0
  8. package/dist/chunk-6DYS4PJT.mjs +99 -0
  9. package/dist/chunk-6PBNFLM7.js +95 -0
  10. package/dist/{chunk-DCRVIDMY.mjs → chunk-6ZC7H22S.mjs} +1 -1
  11. package/dist/{chunk-WSCSDSV7.mjs → chunk-7IKJBQQV.mjs} +27 -5
  12. package/dist/{chunk-OTRGVENC.js → chunk-7SLNHUGJ.js} +1 -1
  13. package/dist/chunk-A2UW5OKX.mjs +415 -0
  14. package/dist/{chunk-NOOPXNR4.mjs → chunk-AGUPZEUL.mjs} +2 -3
  15. package/dist/chunk-AX5XRD2Q.js +35 -0
  16. package/dist/{chunk-BJU5N7WU.mjs → chunk-BAPR7UUR.mjs} +7 -7
  17. package/dist/chunk-CBALIFPW.mjs +275 -0
  18. package/dist/{chunk-BIWO5KB4.mjs → chunk-CJJ56NVL.mjs} +2 -2
  19. package/dist/{chunk-ENR3RIMM.js → chunk-DGBYGBLR.js} +72 -59
  20. package/dist/chunk-DUWAV47E.js +42 -0
  21. package/dist/chunk-E5GD3H7L.js +94 -0
  22. package/dist/chunk-EJLJYOO7.js +367 -0
  23. package/dist/{chunk-FQ6UHRAO.js → chunk-GQMYCYZ4.js} +6 -27
  24. package/dist/{chunk-G6FSHN2I.mjs → chunk-GW4EWT2K.mjs} +45 -31
  25. package/dist/{chunk-AQQRWISY.js → chunk-GXTBCX3M.js} +1 -1
  26. package/dist/{chunk-HQXZVTP4.mjs → chunk-HGF2EL25.mjs} +74 -61
  27. package/dist/{chunk-R5BQHZWB.js → chunk-HRYBEBZC.js} +15 -21
  28. package/dist/{chunk-PAD2DX5M.mjs → chunk-IIVRVCCP.mjs} +6 -24
  29. package/dist/chunk-IS467WAO.mjs +39 -0
  30. package/dist/{chunk-CTAMMQBC.mjs → chunk-IS7YOBR7.mjs} +16 -13
  31. package/dist/{chunk-ADOPAXPG.mjs → chunk-JI7SFMUT.mjs} +2 -2
  32. package/dist/chunk-KBGURVTD.mjs +282 -0
  33. package/dist/{chunk-O3EUFIOS.mjs → chunk-KELLYJZY.mjs} +36 -30
  34. package/dist/{chunk-XZDJ5FRB.js → chunk-KPZTGRNA.js} +5 -23
  35. package/dist/chunk-KQZ4F7FZ.js +153 -0
  36. package/dist/{chunk-XDKXL2BP.mjs → chunk-KV4LLPAY.mjs} +14 -3
  37. package/dist/{chunk-LNKI6HQ3.js → chunk-LIJLFLYE.js} +27 -5
  38. package/dist/chunk-LVC43YX2.mjs +72 -0
  39. package/dist/chunk-LZNG2HGC.mjs +227 -0
  40. package/dist/chunk-M375I56K.js +75 -0
  41. package/dist/{chunk-7OLWGHUR.mjs → chunk-MF3H7WWW.mjs} +13 -2
  42. package/dist/chunk-N32MAX4A.js +230 -0
  43. package/dist/{chunk-YYKJ63LD.mjs → chunk-NMDNLB3C.mjs} +7 -28
  44. package/dist/{chunk-77D7VQMG.js → chunk-OD2NNQD2.js} +2 -2
  45. package/dist/chunk-OONM7FO7.js +418 -0
  46. package/dist/{chunk-Q5Q7FG4U.js → chunk-OZLGNWET.js} +7 -7
  47. package/dist/{chunk-LAZGEMA2.mjs → chunk-P4EFJIXU.mjs} +1 -1
  48. package/dist/chunk-QI6WAP6Y.js +285 -0
  49. package/dist/{chunk-WK5HN4OH.js → chunk-QY6I7LU5.js} +43 -29
  50. package/dist/{chunk-KSW5JDIV.js → chunk-R7TOQU3U.js} +1 -1
  51. package/dist/chunk-RQSQXQN6.mjs +91 -0
  52. package/dist/chunk-SDLMB34Y.mjs +32 -0
  53. package/dist/chunk-UG3I4PCY.js +102 -0
  54. package/dist/chunk-VBSK4TGO.mjs +364 -0
  55. package/dist/{chunk-DZJUFU55.js → chunk-VXHBQTZS.js} +14 -11
  56. package/dist/chunk-WLIFEALE.mjs +111 -0
  57. package/dist/{chunk-AQ6DHCP6.js → chunk-XRFK2IXM.js} +4 -4
  58. package/dist/{chunk-5FRENLDC.js → chunk-Y2JOJ4D6.js} +14 -3
  59. package/dist/chunk-YER7IQF4.mjs +429 -0
  60. package/dist/{chunk-NI2WNZRT.js → chunk-YESS6YKC.js} +1 -2
  61. package/dist/chunk-Z6F67MJE.mjs +92 -0
  62. package/dist/{chunk-QORSSZX4.js → chunk-ZPFZMXA6.js} +34 -28
  63. package/dist/chunk-ZUUG3WOL.js +432 -0
  64. package/dist/chunk-ZYPEO2KY.js +115 -0
  65. package/dist/components/AreaChart.d.mts +19 -0
  66. package/dist/components/AreaChart.d.ts +19 -0
  67. package/dist/components/AreaChart.js +23 -0
  68. package/dist/components/AreaChart.mjs +8 -0
  69. package/dist/components/BarChart.d.mts +16 -0
  70. package/dist/components/BarChart.d.ts +16 -0
  71. package/dist/components/BarChart.js +23 -0
  72. package/dist/components/BarChart.mjs +8 -0
  73. package/dist/components/ChartAxis.d.mts +10 -0
  74. package/dist/components/ChartAxis.d.ts +10 -0
  75. package/dist/components/ChartAxis.js +16 -0
  76. package/dist/components/ChartAxis.mjs +1 -0
  77. package/dist/components/ChartCanvas.d.mts +9 -0
  78. package/dist/components/ChartCanvas.d.ts +9 -0
  79. package/dist/components/ChartCanvas.js +16 -0
  80. package/dist/components/ChartCanvas.mjs +1 -0
  81. package/dist/components/ChartGrid.d.mts +11 -0
  82. package/dist/components/ChartGrid.d.ts +11 -0
  83. package/dist/components/ChartGrid.js +16 -0
  84. package/dist/components/ChartGrid.mjs +1 -0
  85. package/dist/components/ChartLegend.d.mts +17 -0
  86. package/dist/components/ChartLegend.d.ts +17 -0
  87. package/dist/components/ChartLegend.js +16 -0
  88. package/dist/components/ChartLegend.mjs +1 -0
  89. package/dist/components/ChartSeries.d.mts +18 -0
  90. package/dist/components/ChartSeries.d.ts +18 -0
  91. package/dist/components/ChartSeries.js +16 -0
  92. package/dist/components/ChartSeries.mjs +1 -0
  93. package/dist/components/ChartTooltip.d.mts +12 -0
  94. package/dist/components/ChartTooltip.d.ts +12 -0
  95. package/dist/components/ChartTooltip.js +16 -0
  96. package/dist/components/ChartTooltip.mjs +1 -0
  97. package/dist/components/DonutChart.d.mts +14 -0
  98. package/dist/components/DonutChart.d.ts +14 -0
  99. package/dist/components/DonutChart.js +21 -0
  100. package/dist/components/DonutChart.mjs +6 -0
  101. package/dist/components/Drawer.js +3 -3
  102. package/dist/components/Drawer.mjs +2 -2
  103. package/dist/components/Dropdown.d.mts +12 -2
  104. package/dist/components/Dropdown.d.ts +12 -2
  105. package/dist/components/Dropdown.js +4 -4
  106. package/dist/components/Dropdown.mjs +2 -2
  107. package/dist/components/DropdownItem.js +4 -4
  108. package/dist/components/DropdownItem.mjs +3 -3
  109. package/dist/components/Icon.js +2 -2
  110. package/dist/components/Icon.mjs +1 -1
  111. package/dist/components/LineChart.d.mts +19 -0
  112. package/dist/components/LineChart.d.ts +19 -0
  113. package/dist/components/LineChart.js +23 -0
  114. package/dist/components/LineChart.mjs +8 -0
  115. package/dist/components/List.js +3 -3
  116. package/dist/components/List.mjs +2 -2
  117. package/dist/components/Message.js +4 -4
  118. package/dist/components/Message.mjs +1 -1
  119. package/dist/components/Modal.js +3 -3
  120. package/dist/components/Modal.mjs +2 -2
  121. package/dist/components/Notification.js +4 -4
  122. package/dist/components/Notification.mjs +1 -1
  123. package/dist/components/Pagination.d.mts +5 -1
  124. package/dist/components/Pagination.d.ts +5 -1
  125. package/dist/components/Pagination.js +3 -3
  126. package/dist/components/Pagination.mjs +1 -1
  127. package/dist/components/PieChart.d.mts +14 -0
  128. package/dist/components/PieChart.d.ts +14 -0
  129. package/dist/components/PieChart.js +20 -0
  130. package/dist/components/PieChart.mjs +5 -0
  131. package/dist/components/Popconfirm.d.mts +12 -2
  132. package/dist/components/Popconfirm.d.ts +12 -2
  133. package/dist/components/Popconfirm.js +3 -2
  134. package/dist/components/Popconfirm.mjs +2 -1
  135. package/dist/components/Popover.d.mts +12 -2
  136. package/dist/components/Popover.d.ts +12 -2
  137. package/dist/components/Popover.js +3 -2
  138. package/dist/components/Popover.mjs +2 -1
  139. package/dist/components/RadarChart.d.mts +20 -0
  140. package/dist/components/RadarChart.d.ts +20 -0
  141. package/dist/components/RadarChart.js +20 -0
  142. package/dist/components/RadarChart.mjs +5 -0
  143. package/dist/components/ScatterChart.d.mts +32 -0
  144. package/dist/components/ScatterChart.d.ts +32 -0
  145. package/dist/components/ScatterChart.js +23 -0
  146. package/dist/components/ScatterChart.mjs +8 -0
  147. package/dist/components/Select.js +2 -2
  148. package/dist/components/Select.mjs +1 -1
  149. package/dist/components/Slider.js +2 -2
  150. package/dist/components/Slider.mjs +1 -1
  151. package/dist/components/Space.js +2 -2
  152. package/dist/components/Space.mjs +1 -1
  153. package/dist/components/Steps.js +3 -3
  154. package/dist/components/Steps.mjs +1 -1
  155. package/dist/components/StepsItem.js +2 -2
  156. package/dist/components/StepsItem.mjs +1 -1
  157. package/dist/components/Table.js +2 -2
  158. package/dist/components/Table.mjs +1 -1
  159. package/dist/components/Tooltip.d.mts +12 -2
  160. package/dist/components/Tooltip.d.ts +12 -2
  161. package/dist/components/Tooltip.js +3 -2
  162. package/dist/components/Tooltip.mjs +2 -1
  163. package/dist/index.d.mts +97 -1
  164. package/dist/index.d.ts +97 -1
  165. package/dist/index.js +178 -108
  166. package/dist/index.mjs +41 -27
  167. package/package.json +2 -2
  168. package/dist/chunk-NEULKOYJ.js +0 -48
  169. package/dist/chunk-ZO4XVOHU.mjs +0 -45
@@ -0,0 +1,415 @@
1
+ import { useChartInteraction } from './chunk-3CDAG4HD.mjs';
2
+ import { ChartAxis } from './chunk-RQSQXQN6.mjs';
3
+ import { ChartCanvas } from './chunk-IS467WAO.mjs';
4
+ import { ChartGrid } from './chunk-677VSTPW.mjs';
5
+ import { ChartLegend } from './chunk-Z6F67MJE.mjs';
6
+ import { ChartSeries } from './chunk-SDLMB34Y.mjs';
7
+ import { ChartTooltip } from './chunk-LVC43YX2.mjs';
8
+ import { useState, useMemo, useCallback } from 'react';
9
+ import { getChartInnerRect, stackSeriesData, getNumberExtent, createLinearScale, createPointScale, DEFAULT_CHART_COLORS, createLinePath, createAreaPath, getChartElementOpacity, classNames } from '@expcat/tigercat-core';
10
+ import { jsxs, jsx } from 'react/jsx-runtime';
11
+
12
+ var AreaChart = ({
13
+ width = 320,
14
+ height = 200,
15
+ padding = 24,
16
+ data,
17
+ series,
18
+ xScale: xScaleProp,
19
+ yScale: yScaleProp,
20
+ areaColor: _areaColor = "var(--tiger-primary,#2563eb)",
21
+ strokeWidth = 2,
22
+ fillOpacity = 0.2,
23
+ curve = "linear",
24
+ showPoints = false,
25
+ pointSize = 4,
26
+ pointColor: _pointColor,
27
+ stacked = false,
28
+ showGrid = true,
29
+ showAxis = true,
30
+ showXAxis = true,
31
+ showYAxis = true,
32
+ includeZero = true,
33
+ xAxisLabel,
34
+ yAxisLabel,
35
+ xTicks = 5,
36
+ yTicks = 5,
37
+ xTickValues,
38
+ yTickValues,
39
+ xTickFormat,
40
+ yTickFormat,
41
+ gridLineStyle = "solid",
42
+ gridStrokeWidth = 1,
43
+ colors,
44
+ hoverable = false,
45
+ hoveredIndex: hoveredIndexProp,
46
+ activeOpacity = 1,
47
+ inactiveOpacity = 0.25,
48
+ selectable = false,
49
+ selectedIndex: selectedIndexProp,
50
+ showLegend = false,
51
+ legendPosition = "bottom",
52
+ legendMarkerSize = 10,
53
+ legendGap = 8,
54
+ showTooltip = true,
55
+ tooltipFormatter,
56
+ legendFormatter,
57
+ title,
58
+ desc,
59
+ className,
60
+ onHoveredIndexChange,
61
+ onSelectedIndexChange,
62
+ onSeriesClick,
63
+ onSeriesHover,
64
+ onPointClick,
65
+ onPointHover
66
+ }) => {
67
+ const [hoveredPointInfo, setHoveredPointInfo] = useState(null);
68
+ const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });
69
+ const innerRect = useMemo(
70
+ () => getChartInnerRect(width, height, padding),
71
+ [width, height, padding]
72
+ );
73
+ const resolvedSeries = useMemo(() => {
74
+ if (series && series.length > 0) return series;
75
+ if (data && data.length > 0) return [{ data }];
76
+ return [];
77
+ }, [series, data]);
78
+ const {
79
+ activeIndex,
80
+ handleMouseEnter: handleSeriesHoverEnter,
81
+ handleMouseLeave: handleSeriesHoverLeave,
82
+ handleClick: handleSeriesSelect,
83
+ handleLegendClick,
84
+ handleLegendHover,
85
+ handleLegendLeave,
86
+ wrapperClasses
87
+ } = useChartInteraction({
88
+ hoverable,
89
+ hoveredIndexProp,
90
+ selectable,
91
+ selectedIndexProp,
92
+ activeOpacity,
93
+ inactiveOpacity,
94
+ legendPosition,
95
+ getData: (index) => resolvedSeries[index],
96
+ onHoveredIndexChange: (index) => {
97
+ onHoveredIndexChange?.(index);
98
+ onSeriesHover?.(index, index !== null ? resolvedSeries[index] : null);
99
+ },
100
+ onSelectedIndexChange: (index) => {
101
+ onSelectedIndexChange?.(index);
102
+ if (index !== null) {
103
+ onSeriesClick?.(index, resolvedSeries[index]);
104
+ }
105
+ }
106
+ });
107
+ const allData = useMemo(() => resolvedSeries.flatMap((s) => s.data), [resolvedSeries]);
108
+ const xValues = useMemo(() => allData.map((d) => d.x), [allData]);
109
+ const yValues = useMemo(() => {
110
+ if (stacked) {
111
+ const stackedData = stackSeriesData(resolvedSeries.map((s) => s.data));
112
+ return stackedData.flatMap((s) => s.map((d) => d.y1));
113
+ }
114
+ return allData.map((d) => d.y);
115
+ }, [stacked, resolvedSeries, allData]);
116
+ const isXNumeric = useMemo(() => xValues.every((v) => typeof v === "number"), [xValues]);
117
+ const resolvedXScale = useMemo(() => {
118
+ if (xScaleProp) return xScaleProp;
119
+ if (isXNumeric) {
120
+ const extent = getNumberExtent(xValues, { includeZero: false });
121
+ return createLinearScale(extent, [0, innerRect.width]);
122
+ } else {
123
+ const categories = [...new Set(xValues.map(String))];
124
+ return createPointScale(categories, [0, innerRect.width], { padding: 0.1 });
125
+ }
126
+ }, [xScaleProp, isXNumeric, xValues, innerRect.width]);
127
+ const resolvedYScale = useMemo(() => {
128
+ if (yScaleProp) return yScaleProp;
129
+ const extent = getNumberExtent(yValues, { includeZero });
130
+ return createLinearScale(extent, [innerRect.height, 0]);
131
+ }, [yScaleProp, yValues, includeZero, innerRect.height]);
132
+ const baseline = useMemo(() => resolvedYScale.map(0), [resolvedYScale]);
133
+ const resolvedShowXAxis = showAxis && showXAxis;
134
+ const resolvedShowYAxis = showAxis && showYAxis;
135
+ const palette = useMemo(
136
+ () => colors && colors.length > 0 ? colors : [...DEFAULT_CHART_COLORS],
137
+ [colors]
138
+ );
139
+ const seriesData = useMemo(() => {
140
+ const stackedData = stacked ? stackSeriesData(resolvedSeries.map((s) => s.data)) : null;
141
+ return resolvedSeries.map((s, seriesIndex) => {
142
+ const color = s.color ?? palette[seriesIndex % palette.length];
143
+ const seriesFillColor = s.fillColor ?? color;
144
+ const seriesFillOpacity = s.fillOpacity ?? fillOpacity;
145
+ let points;
146
+ let areaPath;
147
+ let linePath;
148
+ if (stacked && stackedData) {
149
+ const stackedSeries = stackedData[seriesIndex];
150
+ points = stackedSeries.map((sd, pointIndex) => ({
151
+ x: resolvedXScale.map(sd.original.x),
152
+ y: resolvedYScale.map(sd.y1),
153
+ datum: sd.original,
154
+ pointIndex
155
+ }));
156
+ const topPoints = points.map((p) => ({ x: p.x, y: p.y }));
157
+ const bottomPoints = stackedSeries.map((sd) => ({
158
+ x: resolvedXScale.map(sd.original.x),
159
+ y: resolvedYScale.map(sd.y0)
160
+ })).reverse();
161
+ const topPath = createLinePath(topPoints, curve);
162
+ const bottomPath = createLinePath(bottomPoints, curve).replace("M", "L");
163
+ areaPath = `${topPath} ${bottomPath} Z`;
164
+ linePath = topPath;
165
+ } else {
166
+ points = s.data.map((datum, pointIndex) => ({
167
+ x: resolvedXScale.map(datum.x),
168
+ y: resolvedYScale.map(datum.y),
169
+ datum,
170
+ pointIndex
171
+ }));
172
+ areaPath = createAreaPath(points, baseline, curve);
173
+ linePath = createLinePath(points, curve);
174
+ }
175
+ const opacity = getChartElementOpacity(seriesIndex, activeIndex, {
176
+ activeOpacity,
177
+ inactiveOpacity
178
+ });
179
+ return {
180
+ series: s,
181
+ seriesIndex,
182
+ color,
183
+ fillColor: seriesFillColor,
184
+ fillOpacity: seriesFillOpacity,
185
+ areaPath,
186
+ linePath,
187
+ points,
188
+ opacity,
189
+ strokeWidth: s.strokeWidth ?? strokeWidth,
190
+ strokeDasharray: s.strokeDasharray,
191
+ showPoints: s.showPoints ?? showPoints,
192
+ pointSize: s.pointSize ?? pointSize,
193
+ pointColor: s.pointColor ?? color
194
+ };
195
+ });
196
+ }, [
197
+ resolvedSeries,
198
+ palette,
199
+ resolvedXScale,
200
+ resolvedYScale,
201
+ curve,
202
+ stacked,
203
+ baseline,
204
+ activeIndex,
205
+ activeOpacity,
206
+ inactiveOpacity,
207
+ fillOpacity,
208
+ strokeWidth,
209
+ showPoints,
210
+ pointSize
211
+ ]);
212
+ const legendItems = useMemo(
213
+ () => resolvedSeries.map((s, index) => ({
214
+ index,
215
+ label: legendFormatter ? legendFormatter(s, index) : s.name ?? `Series ${index + 1}`,
216
+ color: s.color ?? palette[index % palette.length],
217
+ active: activeIndex === null || activeIndex === index
218
+ })),
219
+ [resolvedSeries, legendFormatter, palette, activeIndex]
220
+ );
221
+ const formatTooltip = useCallback(
222
+ (datum, seriesIndex, _pointIndex, s) => {
223
+ if (tooltipFormatter) return tooltipFormatter(datum, seriesIndex, _pointIndex, s);
224
+ const seriesName = s?.name ?? `Series ${seriesIndex + 1}`;
225
+ const label = datum.label ?? String(datum.x);
226
+ return `${seriesName} \xB7 ${label}: ${datum.y}`;
227
+ },
228
+ [tooltipFormatter]
229
+ );
230
+ const tooltipContent = useMemo(() => {
231
+ if (!hoveredPointInfo) return "";
232
+ const { seriesIndex, pointIndex } = hoveredPointInfo;
233
+ const s = resolvedSeries[seriesIndex];
234
+ const datum = s?.data[pointIndex];
235
+ return datum ? formatTooltip(datum, seriesIndex, pointIndex, s) : "";
236
+ }, [hoveredPointInfo, resolvedSeries, formatTooltip]);
237
+ const handlePointMouseEnter = useCallback(
238
+ (seriesIndex, pointIndex, event) => {
239
+ setHoveredPointInfo({ seriesIndex, pointIndex });
240
+ setTooltipPosition({ x: event.clientX, y: event.clientY });
241
+ onPointHover?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
242
+ },
243
+ [onPointHover, resolvedSeries]
244
+ );
245
+ const handlePointMouseMove = useCallback((event) => {
246
+ setTooltipPosition({ x: event.clientX, y: event.clientY });
247
+ }, []);
248
+ const handlePointMouseLeave = useCallback(() => {
249
+ setHoveredPointInfo(null);
250
+ onPointHover?.(null, null, null);
251
+ }, [onPointHover]);
252
+ const handlePointClick = useCallback(
253
+ (seriesIndex, pointIndex) => {
254
+ onPointClick?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
255
+ handleSeriesSelect(seriesIndex);
256
+ },
257
+ [onPointClick, resolvedSeries, handleSeriesSelect]
258
+ );
259
+ const handleKeyDown = useCallback(
260
+ (event, seriesIndex) => {
261
+ if (!selectable) return;
262
+ if (event.key !== "Enter" && event.key !== " ") return;
263
+ event.preventDefault();
264
+ handleSeriesSelect(seriesIndex);
265
+ },
266
+ [selectable, handleSeriesSelect]
267
+ );
268
+ const reversedSeriesData = useMemo(() => [...seriesData].reverse(), [seriesData]);
269
+ const chart = /* @__PURE__ */ jsxs(
270
+ ChartCanvas,
271
+ {
272
+ width,
273
+ height,
274
+ padding,
275
+ title,
276
+ desc,
277
+ className: classNames(className),
278
+ children: [
279
+ showGrid && /* @__PURE__ */ jsx(
280
+ ChartGrid,
281
+ {
282
+ xScale: resolvedXScale,
283
+ yScale: resolvedYScale,
284
+ show: "both",
285
+ xTicks,
286
+ yTicks,
287
+ xTickValues,
288
+ yTickValues,
289
+ lineStyle: gridLineStyle,
290
+ strokeWidth: gridStrokeWidth
291
+ }
292
+ ),
293
+ resolvedShowXAxis && /* @__PURE__ */ jsx(
294
+ ChartAxis,
295
+ {
296
+ scale: resolvedXScale,
297
+ orientation: "bottom",
298
+ y: innerRect.height,
299
+ ticks: xTicks,
300
+ tickValues: xTickValues,
301
+ tickFormat: xTickFormat,
302
+ label: xAxisLabel
303
+ }
304
+ ),
305
+ resolvedShowYAxis && /* @__PURE__ */ jsx(
306
+ ChartAxis,
307
+ {
308
+ scale: resolvedYScale,
309
+ orientation: "left",
310
+ ticks: yTicks,
311
+ tickValues: yTickValues,
312
+ tickFormat: yTickFormat,
313
+ label: yAxisLabel
314
+ }
315
+ ),
316
+ reversedSeriesData.map((sd) => /* @__PURE__ */ jsxs(
317
+ ChartSeries,
318
+ {
319
+ data: sd.series.data,
320
+ name: sd.series.name,
321
+ type: "area",
322
+ opacity: sd.opacity,
323
+ className: classNames(sd.series.className, (hoverable || selectable) && "cursor-pointer"),
324
+ onMouseEnter: (e) => handleSeriesHoverEnter(sd.seriesIndex, e),
325
+ onMouseLeave: handleSeriesHoverLeave,
326
+ onClick: () => handleSeriesSelect(sd.seriesIndex),
327
+ tabIndex: selectable ? 0 : void 0,
328
+ onKeyDown: (e) => handleKeyDown(e, sd.seriesIndex),
329
+ children: [
330
+ /* @__PURE__ */ jsx(
331
+ "path",
332
+ {
333
+ d: sd.areaPath,
334
+ fill: sd.fillColor,
335
+ fillOpacity: sd.fillOpacity,
336
+ stroke: "none",
337
+ className: "transition-opacity duration-150",
338
+ "data-area-series": sd.seriesIndex
339
+ }
340
+ ),
341
+ /* @__PURE__ */ jsx(
342
+ "path",
343
+ {
344
+ d: sd.linePath,
345
+ fill: "none",
346
+ stroke: sd.color,
347
+ strokeWidth: sd.strokeWidth,
348
+ strokeDasharray: sd.strokeDasharray,
349
+ strokeLinecap: "round",
350
+ strokeLinejoin: "round",
351
+ className: "transition-opacity duration-150"
352
+ }
353
+ ),
354
+ sd.showPoints && sd.points.map((point) => /* @__PURE__ */ jsx(
355
+ "circle",
356
+ {
357
+ cx: point.x,
358
+ cy: point.y,
359
+ r: sd.pointSize,
360
+ fill: sd.pointColor,
361
+ className: "transition-all duration-150",
362
+ "data-point-index": point.pointIndex,
363
+ onMouseEnter: (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e),
364
+ onMouseMove: handlePointMouseMove,
365
+ onMouseLeave: handlePointMouseLeave,
366
+ onClick: (e) => {
367
+ e.stopPropagation();
368
+ handlePointClick(sd.seriesIndex, point.pointIndex);
369
+ }
370
+ },
371
+ `point-${sd.seriesIndex}-${point.pointIndex}`
372
+ ))
373
+ ]
374
+ },
375
+ `series-${sd.seriesIndex}`
376
+ ))
377
+ ]
378
+ }
379
+ );
380
+ const tooltip = showTooltip && /* @__PURE__ */ jsx(
381
+ ChartTooltip,
382
+ {
383
+ content: tooltipContent,
384
+ visible: hoveredPointInfo !== null && tooltipContent !== "",
385
+ x: tooltipPosition.x,
386
+ y: tooltipPosition.y
387
+ }
388
+ );
389
+ if (!showLegend) {
390
+ return /* @__PURE__ */ jsxs("div", { className: "inline-block relative", children: [
391
+ chart,
392
+ tooltip
393
+ ] });
394
+ }
395
+ return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, children: [
396
+ chart,
397
+ /* @__PURE__ */ jsx(
398
+ ChartLegend,
399
+ {
400
+ items: legendItems,
401
+ position: legendPosition,
402
+ markerSize: legendMarkerSize,
403
+ gap: legendGap,
404
+ interactive: hoverable || selectable,
405
+ onItemClick: handleLegendClick,
406
+ onItemHover: handleLegendHover,
407
+ onItemLeave: handleLegendLeave
408
+ }
409
+ ),
410
+ tooltip
411
+ ] });
412
+ };
413
+ var AreaChart_default = AreaChart;
414
+
415
+ export { AreaChart, AreaChart_default };
@@ -1,8 +1,7 @@
1
- import { getSpaceGapSize, classNames, getSpaceDirectionClass, getSpaceAlignClass } from '@expcat/tigercat-core';
1
+ import { getSpaceGapSize, classNames, SPACE_BASE_CLASS, getSpaceDirectionClass, getSpaceAlignClass } from '@expcat/tigercat-core';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  // src/components/Space.tsx
5
- var baseClasses = "inline-flex";
6
5
  var Space = ({
7
6
  direction = "horizontal",
8
7
  size = "md",
@@ -20,7 +19,7 @@ var Space = ({
20
19
  {
21
20
  ...props,
22
21
  className: classNames(
23
- baseClasses,
22
+ SPACE_BASE_CLASS,
24
23
  getSpaceDirectionClass(direction),
25
24
  getSpaceAlignClass(align),
26
25
  gapSize.class,
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var tigercatCore = require('@expcat/tigercat-core');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/ChartSeries.tsx
7
+ var ChartSeries = ({
8
+ data,
9
+ name,
10
+ color,
11
+ opacity,
12
+ type,
13
+ className,
14
+ children,
15
+ ...props
16
+ }) => {
17
+ const content = typeof children === "function" ? children({ data, name, color, opacity, type }) : children;
18
+ return /* @__PURE__ */ jsxRuntime.jsx(
19
+ "g",
20
+ {
21
+ ...props,
22
+ className: tigercatCore.classNames(className),
23
+ "data-series-name": name,
24
+ "data-series-type": type,
25
+ fill: color,
26
+ stroke: color,
27
+ opacity,
28
+ children: content
29
+ }
30
+ );
31
+ };
32
+ var ChartSeries_default = ChartSeries;
33
+
34
+ exports.ChartSeries = ChartSeries;
35
+ exports.ChartSeries_default = ChartSeries_default;
@@ -1,7 +1,7 @@
1
- import { Select } from './chunk-YYKJ63LD.mjs';
1
+ import { Select } from './chunk-NMDNLB3C.mjs';
2
2
  import { Button } from './chunk-STEIWBMF.mjs';
3
3
  import { useState, useMemo } from 'react';
4
- import { getSpinnerSVG, paginateData, calculatePagination, classNames, getListClasses, listSizeClasses, listGridContainerClasses, getGridColumnClasses, listWrapperClasses, listLoadingOverlayClasses, getListHeaderFooterClasses, listEmptyStateClasses, listPaginationContainerClasses, getLoadingOverlaySpinnerClasses, getListItemClasses, listItemAvatarClasses, listItemTitleClasses, listItemDescriptionClasses, listItemContentClasses, listItemMetaClasses, listItemExtraClasses } from '@expcat/tigercat-core';
4
+ import { getSpinnerSVG, paginateData, calculatePagination, classNames, getListClasses, listSizeClasses, listGridContainerClasses, getGridColumnClasses, listWrapperClasses, listLoadingOverlayClasses, getListHeaderFooterClasses, listEmptyStateClasses, getSimplePaginationContainerClasses, getSimplePaginationTotalClasses, getSimplePaginationControlsClasses, getSimplePaginationButtonsWrapperClasses, getSimplePaginationPageIndicatorClasses, getLoadingOverlaySpinnerClasses, getListItemClasses, listItemAvatarClasses, listItemTitleClasses, listItemDescriptionClasses, listItemContentClasses, listItemMetaClasses, listItemExtraClasses } from '@expcat/tigercat-core';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var spinnerSvg = getSpinnerSVG("spinner");
@@ -194,9 +194,9 @@ var List = ({
194
194
  const { totalPages, startIndex, endIndex, hasNext, hasPrev } = paginationInfo;
195
195
  const total = dataSource.length;
196
196
  const paginationConfig = pagination;
197
- return /* @__PURE__ */ jsxs("div", { className: listPaginationContainerClasses, children: [
198
- paginationConfig.showTotal !== false && /* @__PURE__ */ jsx("div", { className: "text-sm text-[var(--tiger-text,#111827)]", children: paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} items` }),
199
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
197
+ return /* @__PURE__ */ jsxs("div", { className: getSimplePaginationContainerClasses(), children: [
198
+ paginationConfig.showTotal !== false && /* @__PURE__ */ jsx("div", { className: getSimplePaginationTotalClasses(), children: paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} items` }),
199
+ /* @__PURE__ */ jsxs("div", { className: getSimplePaginationControlsClasses(), children: [
200
200
  paginationConfig.showSizeChanger !== false && /* @__PURE__ */ jsx(
201
201
  Select,
202
202
  {
@@ -214,7 +214,7 @@ var List = ({
214
214
  }))
215
215
  }
216
216
  ),
217
- /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
217
+ /* @__PURE__ */ jsxs("div", { className: getSimplePaginationButtonsWrapperClasses(), children: [
218
218
  /* @__PURE__ */ jsx(
219
219
  Button,
220
220
  {
@@ -229,7 +229,7 @@ var List = ({
229
229
  children: "Previous"
230
230
  }
231
231
  ),
232
- /* @__PURE__ */ jsxs("span", { className: "px-3 py-1 text-sm text-[var(--tiger-text,#111827)]", children: [
232
+ /* @__PURE__ */ jsxs("span", { className: getSimplePaginationPageIndicatorClasses(), children: [
233
233
  "Page ",
234
234
  currentPage,
235
235
  " of ",