@vritti/quantum-ui 0.6.1 → 0.6.3

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 (82) hide show
  1. package/dist/ActiveShapeUtils.js +1 -1
  2. package/dist/BarChart.js +1 -1
  3. package/dist/CartesianChart.js +1 -1
  4. package/dist/Chart.js +1 -1
  5. package/dist/IconSelect.js +595 -608
  6. package/dist/IconSelect.js.map +1 -1
  7. package/dist/LineChart.js +309 -86
  8. package/dist/LineChart.js.map +1 -1
  9. package/dist/RadarChart.js +1 -1
  10. package/dist/SelectFilter.js +19 -19
  11. package/dist/SelectFilter.js.map +1 -1
  12. package/dist/StatusSwitch.js +5 -0
  13. package/dist/StatusSwitch.js.map +1 -1
  14. package/dist/ValueFilter.js +21 -6
  15. package/dist/ValueFilter.js.map +1 -1
  16. package/dist/assets/quantum-ui.css +77 -12
  17. package/dist/chart-line.js +18 -0
  18. package/dist/chart-line.js.map +1 -0
  19. package/dist/field.js +6 -1
  20. package/dist/field.js.map +1 -1
  21. package/dist/hooks/index.js +2 -2
  22. package/dist/index.js +2 -2
  23. package/dist/index7.js.map +1 -1
  24. package/dist/lib/components/DataTable/DataTable.d.ts +1 -1
  25. package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -1
  26. package/dist/lib/components/DataTable/components/DataTableFilters.d.ts.map +1 -1
  27. package/dist/lib/components/DataTable/components/DataTableViewsMenu.d.ts.map +1 -1
  28. package/dist/lib/components/DataTable/components/bindFilters.d.ts +14 -0
  29. package/dist/lib/components/DataTable/components/bindFilters.d.ts.map +1 -0
  30. package/dist/lib/components/DataTable/hooks/useAutoUpsert.d.ts +1 -2
  31. package/dist/lib/components/DataTable/hooks/useAutoUpsert.d.ts.map +1 -1
  32. package/dist/lib/components/DataTable/hooks/useDataTable.d.ts +6 -3
  33. package/dist/lib/components/DataTable/hooks/useDataTable.d.ts.map +1 -1
  34. package/dist/lib/components/DataTable/store/store.d.ts +4 -3
  35. package/dist/lib/components/DataTable/store/store.d.ts.map +1 -1
  36. package/dist/lib/components/DataTable/store/useTableSlice.d.ts +2 -1
  37. package/dist/lib/components/DataTable/store/useTableSlice.d.ts.map +1 -1
  38. package/dist/lib/components/DataTable/types.d.ts +5 -0
  39. package/dist/lib/components/DataTable/types.d.ts.map +1 -1
  40. package/dist/lib/components/LineChart/LineChart.d.ts +5 -1
  41. package/dist/lib/components/LineChart/LineChart.d.ts.map +1 -1
  42. package/dist/lib/components/LineChart/LineChartEmpty.d.ts +18 -0
  43. package/dist/lib/components/LineChart/LineChartEmpty.d.ts.map +1 -0
  44. package/dist/lib/components/LineChart/LineChartSkeleton.d.ts +7 -0
  45. package/dist/lib/components/LineChart/LineChartSkeleton.d.ts.map +1 -0
  46. package/dist/lib/components/LineChart/index.d.ts +1 -0
  47. package/dist/lib/components/LineChart/index.d.ts.map +1 -1
  48. package/dist/lib/components/Select/SelectFilter.d.ts.map +1 -1
  49. package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts +1 -1
  50. package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts.map +1 -1
  51. package/dist/lib/components/StatusSwitch/StatusSwitch.d.ts +1 -1
  52. package/dist/lib/components/StatusSwitch/StatusSwitch.d.ts.map +1 -1
  53. package/dist/lib/components/ValueFilter/ValueFilter.d.ts +14 -3
  54. package/dist/lib/components/ValueFilter/ValueFilter.d.ts.map +1 -1
  55. package/dist/lib/config/index.d.ts +1 -1
  56. package/dist/lib/config/index.d.ts.map +1 -1
  57. package/dist/lib/hooks/useFormatters.d.ts.map +1 -1
  58. package/dist/lib/hooks/useWorkspaceCurrency.d.ts +1 -1
  59. package/dist/lib/hooks/useWorkspaceCurrency.d.ts.map +1 -1
  60. package/dist/lib/types/table-filter.d.ts +5 -1
  61. package/dist/lib/types/table-filter.d.ts.map +1 -1
  62. package/dist/lib/utils/currency.d.ts +1 -3
  63. package/dist/lib/utils/currency.d.ts.map +1 -1
  64. package/dist/lib/utils/filter.d.ts +22 -0
  65. package/dist/lib/utils/filter.d.ts.map +1 -0
  66. package/dist/shadcn/shadcnField/field.d.ts.map +1 -1
  67. package/dist/types/table-filter.js +1 -1
  68. package/dist/types/table-filter.js.map +1 -1
  69. package/dist/useDataTable.js +215 -160
  70. package/dist/useDataTable.js.map +1 -1
  71. package/dist/useFormatters.js +3 -9
  72. package/dist/useFormatters.js.map +1 -1
  73. package/dist/{useTimer.js → useWorkspaceCurrency.js} +15 -3
  74. package/dist/useWorkspaceCurrency.js.map +1 -0
  75. package/dist/utils/currency.js +3 -16
  76. package/dist/utils/currency.js.map +1 -1
  77. package/dist/utils/filter.js +21 -0
  78. package/dist/utils/filter.js.map +1 -0
  79. package/package.json +7 -1
  80. package/dist/lib/components/DataTable/components/FilterWrapper.d.ts +0 -21
  81. package/dist/lib/components/DataTable/components/FilterWrapper.d.ts.map +0 -1
  82. package/dist/useTimer.js.map +0 -1
package/dist/LineChart.js CHANGED
@@ -1,9 +1,11 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { $ as resolveDefaultProps, u as useAppDispatch, bb as addLine, bc as removeLine, D as DefaultZIndexes, ah as useIsPanorama, bd as useClipPathId, A as useAppSelector, be as selectXAxisSettings, bf as selectYAxisSettings, bg as selectAxisScale, bh as useViewBox, aA as svgPropertiesAndEvents, Z as ZIndexLayer, L as Layer, bi as CartesianLabelContextProvider, bj as CartesianLabelFromLabelProp, aC as isWellBehavedNumber, bk as isNumOrStr, c as createSelector, e as selectChartLayout, bl as selectChartDataWithIndexesIfNotInPanoramaPosition4, a9 as selectAxisWithScale, aa as selectTicksOfGraphicalItem, ae as selectUnfilteredCartesianItems, ac as isCategoricalAxis, ad as getBandSizeOfAxis, ag as propsAreEqual, ai as RegisterGraphicalItemId, aj as SetLegendPayload, ak as SetCartesianGraphicalItem, am as getTooltipNameProp, an as SetTooltipEntrySettings, ao as noop, ar as usePlotArea, ap as useChartLayout, y as isClipDot, Y as getValueByDataKey, as as getCateCoordinateOfLine, E as isNullish, at as useAnimationId, av as JavascriptAnimate, aw as interpolate, ay as LabelListFromLabelProp, az as CartesianLabelListContextProvider, x as svgPropertiesNoEvents, aD as arrayTooltipSearcher, aE as ChartContainer, aF as ChartTooltip, aG as ChartTooltipContent, aH as ChartLegend, aI as ChartLegendContent } from './Chart.js';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { a as clsx, c as cn } from './utils.js';
3
+ import { C as ChartLine } from './chart-line.js';
3
4
  import * as React from 'react';
4
- import { useEffect, Component, useRef, useState, useCallback, useMemo, forwardRef } from 'react';
5
+ import { useEffect, Component, useRef, useState, useCallback, useMemo, forwardRef, useId } from 'react';
6
+ import { S as Skeleton } from './Skeleton.js';
7
+ import { $ as resolveDefaultProps, u as useAppDispatch, bi as addLine, bj as removeLine, D as DefaultZIndexes, ah as useIsPanorama, bk as useClipPathId, A as useAppSelector, bl as selectXAxisSettings, bm as selectYAxisSettings, bn as selectAxisScale, bo as useViewBox, aA as svgPropertiesAndEvents, Z as ZIndexLayer, L as Layer, bp as CartesianLabelContextProvider, bq as CartesianLabelFromLabelProp, aC as isWellBehavedNumber, br as isNumOrStr, c as createSelector, e as selectChartLayout, bs as selectChartDataWithIndexesIfNotInPanoramaPosition4, a9 as selectAxisWithScale, aa as selectTicksOfGraphicalItem, ae as selectUnfilteredCartesianItems, ac as isCategoricalAxis, ad as getBandSizeOfAxis, ag as propsAreEqual, ai as RegisterGraphicalItemId, aj as SetLegendPayload, ak as SetCartesianGraphicalItem, am as getTooltipNameProp, an as SetTooltipEntrySettings, ao as noop, ar as usePlotArea, ap as useChartLayout, y as isClipDot, Y as getValueByDataKey, as as getCateCoordinateOfLine, E as isNullish, at as useAnimationId, av as JavascriptAnimate, aw as interpolate, ay as LabelListFromLabelProp, az as CartesianLabelListContextProvider, x as svgPropertiesNoEvents, aD as arrayTooltipSearcher, aE as ChartContainer, aF as ChartTooltip, aG as ChartTooltipContent, aH as ChartLegend, aI as ChartLegendContent } from './Chart.js';
5
8
  import { r as rectWithCoords, u as useNeedsClip, G as GraphicalItemClipPath, C as CartesianChart, a as CartesianGrid, X as XAxis, Y as YAxis } from './CartesianChart.js';
6
- import { a as clsx } from './utils.js';
7
9
  import { A as ActivePoints, D as Dots } from './ActivePoints.js';
8
10
  import { S as SetErrorBarContext } from './ErrorBarContext.js';
9
11
  import { g as getRadiusAndStrokeWidthFromDot } from './getRadiusAndStrokeWidthFromDot.js';
@@ -1088,6 +1090,209 @@ var LineChart$1 = /*#__PURE__*/forwardRef((props, ref) => {
1088
1090
  });
1089
1091
  });
1090
1092
 
1093
+ const GRID_Y$1 = [4, 14, 24, 34];
1094
+ const BASELINE_Y = 24;
1095
+ const X_TICKS$1 = 5;
1096
+ const LineChartEmpty = ({
1097
+ title,
1098
+ description,
1099
+ icon,
1100
+ xDomain,
1101
+ xAxisFormatter,
1102
+ markers,
1103
+ className
1104
+ }) => {
1105
+ const [start, end] = xDomain ?? [0, 0];
1106
+ const span = end - start;
1107
+ const ticks = xDomain && span > 0 ? Array.from({ length: X_TICKS$1 }, (_, index) => start + span * index / 4) : [];
1108
+ const placed = (markers ?? []).flatMap((marker) => {
1109
+ const offset = span > 0 ? (Number(marker.x) - start) / span * 100 : Number.NaN;
1110
+ return offset >= 0 && offset <= 100 ? [{ ...marker, offset }] : [];
1111
+ });
1112
+ return /* @__PURE__ */ jsxs(
1113
+ "div",
1114
+ {
1115
+ role: "img",
1116
+ "aria-label": description ? `${title}. ${description}` : title,
1117
+ className: cn("flex gap-3", className ?? "min-h-75 w-full"),
1118
+ children: [
1119
+ /* @__PURE__ */ jsx("div", { className: "w-12 shrink-0", "aria-hidden": true }),
1120
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [
1121
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
1122
+ /* @__PURE__ */ jsxs(
1123
+ "svg",
1124
+ {
1125
+ viewBox: "0 0 100 40",
1126
+ preserveAspectRatio: "none",
1127
+ className: "absolute inset-0 size-full text-muted-foreground",
1128
+ role: "presentation",
1129
+ children: [
1130
+ GRID_Y$1.map((y) => /* @__PURE__ */ jsx(
1131
+ "line",
1132
+ {
1133
+ x1: 0,
1134
+ x2: 100,
1135
+ y1: y,
1136
+ y2: y,
1137
+ stroke: "currentColor",
1138
+ strokeOpacity: 0.12,
1139
+ vectorEffect: "non-scaling-stroke"
1140
+ },
1141
+ y
1142
+ )),
1143
+ placed.map((marker) => /* @__PURE__ */ jsx(
1144
+ "line",
1145
+ {
1146
+ x1: marker.offset,
1147
+ x2: marker.offset,
1148
+ y1: 0,
1149
+ y2: 40,
1150
+ stroke: "currentColor",
1151
+ strokeOpacity: 0.45,
1152
+ strokeDasharray: "4 4",
1153
+ vectorEffect: "non-scaling-stroke"
1154
+ },
1155
+ String(marker.x)
1156
+ )),
1157
+ /* @__PURE__ */ jsx(
1158
+ "line",
1159
+ {
1160
+ x1: 0,
1161
+ x2: 100,
1162
+ y1: BASELINE_Y,
1163
+ y2: BASELINE_Y,
1164
+ stroke: "currentColor",
1165
+ strokeOpacity: 0.35,
1166
+ strokeWidth: 1.5,
1167
+ strokeDasharray: "2 4",
1168
+ vectorEffect: "non-scaling-stroke"
1169
+ }
1170
+ )
1171
+ ]
1172
+ }
1173
+ ),
1174
+ placed.map(
1175
+ (marker) => marker.label && /* @__PURE__ */ jsx(
1176
+ "span",
1177
+ {
1178
+ className: "absolute top-0 -translate-x-full pr-1.5 text-xs text-muted-foreground",
1179
+ style: { left: `${marker.offset}%` },
1180
+ "aria-hidden": true,
1181
+ children: marker.label
1182
+ },
1183
+ String(marker.x)
1184
+ )
1185
+ ),
1186
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex max-w-xs flex-col items-center gap-2 rounded-lg bg-background px-4 py-3 text-center", children: [
1187
+ /* @__PURE__ */ jsx("span", { className: "flex size-9 items-center justify-center rounded-full border border-dashed border-border text-muted-foreground", children: icon ?? /* @__PURE__ */ jsx(ChartLine, { className: "size-4", "aria-hidden": true }) }),
1188
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: title }),
1189
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
1190
+ ] }) })
1191
+ ] }),
1192
+ /* @__PURE__ */ jsx("div", { className: "flex min-h-4 justify-between text-xs tabular-nums text-muted-foreground", "aria-hidden": true, children: ticks.map((tick) => /* @__PURE__ */ jsx("span", { children: xAxisFormatter ? xAxisFormatter(tick) : tick }, tick)) })
1193
+ ] })
1194
+ ]
1195
+ }
1196
+ );
1197
+ };
1198
+
1199
+ const GHOST_LINES = [
1200
+ { d: "M0 26 H16 V22 H38 V23 H61 V17 H79 V19 H100", dashed: false },
1201
+ { d: "M0 32 H24 V30 H49 V31 H72 V26 H100", dashed: true },
1202
+ { d: "M0 13 H20 V15 H44 V10 H67 V12 H100", dashed: false }
1203
+ ];
1204
+ const GRID_Y = [4, 14, 24, 34];
1205
+ const X_TICKS = 5;
1206
+ const LineChartSkeleton = ({ lines, className }) => {
1207
+ const id = useId();
1208
+ const maskId = `${id}-lines`;
1209
+ const glowId = `${id}-glow`;
1210
+ const ghosts = GHOST_LINES.slice(0, Math.min(Math.max(lines, 1), GHOST_LINES.length));
1211
+ return /* @__PURE__ */ jsxs(
1212
+ "div",
1213
+ {
1214
+ role: "status",
1215
+ "aria-busy": true,
1216
+ "aria-label": "Loading chart",
1217
+ className: cn("flex gap-3", className ?? "min-h-75 w-full"),
1218
+ children: [
1219
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-between py-1", "aria-hidden": true, children: GRID_Y.map((y, index) => /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-12", style: { animationDelay: `${index * 80}ms` } }, y)) }),
1220
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-2", "aria-hidden": true, children: [
1221
+ /* @__PURE__ */ jsxs(
1222
+ "svg",
1223
+ {
1224
+ viewBox: "0 0 100 40",
1225
+ preserveAspectRatio: "none",
1226
+ className: "w-full flex-1 text-muted-foreground",
1227
+ role: "presentation",
1228
+ children: [
1229
+ /* @__PURE__ */ jsxs("defs", { children: [
1230
+ /* @__PURE__ */ jsxs("linearGradient", { id: glowId, x1: "0", x2: "1", y1: "0", y2: "0", children: [
1231
+ /* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "currentColor", stopOpacity: "0" }),
1232
+ /* @__PURE__ */ jsx("stop", { offset: "0.5", stopColor: "currentColor", stopOpacity: "0.9" }),
1233
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
1234
+ ] }),
1235
+ /* @__PURE__ */ jsx("mask", { id: maskId, children: ghosts.map((line) => /* @__PURE__ */ jsx(
1236
+ "path",
1237
+ {
1238
+ d: line.d,
1239
+ fill: "none",
1240
+ stroke: "white",
1241
+ strokeWidth: 4,
1242
+ vectorEffect: "non-scaling-stroke"
1243
+ },
1244
+ line.d
1245
+ )) })
1246
+ ] }),
1247
+ GRID_Y.map((y) => /* @__PURE__ */ jsx(
1248
+ "line",
1249
+ {
1250
+ x1: 0,
1251
+ x2: 100,
1252
+ y1: y,
1253
+ y2: y,
1254
+ stroke: "currentColor",
1255
+ strokeOpacity: 0.12,
1256
+ vectorEffect: "non-scaling-stroke"
1257
+ },
1258
+ y
1259
+ )),
1260
+ ghosts.map((line, index) => /* @__PURE__ */ jsx(
1261
+ "path",
1262
+ {
1263
+ d: line.d,
1264
+ fill: "none",
1265
+ stroke: "currentColor",
1266
+ strokeOpacity: 0.3,
1267
+ strokeWidth: 2,
1268
+ strokeDasharray: line.dashed ? "6 4" : void 0,
1269
+ vectorEffect: "non-scaling-stroke",
1270
+ className: "motion-safe:animate-pulse",
1271
+ style: { animationDelay: `${index * 200}ms` }
1272
+ },
1273
+ line.d
1274
+ )),
1275
+ /* @__PURE__ */ jsx("g", { mask: `url(#${maskId})`, className: "motion-reduce:hidden", children: /* @__PURE__ */ jsx("rect", { x: -30, y: 0, width: 30, height: 40, fill: `url(#${glowId})`, opacity: 0.55, children: /* @__PURE__ */ jsx("animate", { attributeName: "x", from: "-30", to: "100", dur: "1.8s", repeatCount: "indefinite" }) }) })
1276
+ ]
1277
+ }
1278
+ ),
1279
+ /* @__PURE__ */ jsx("div", { className: "flex justify-between", children: Array.from({ length: X_TICKS }, (_, index) => /* @__PURE__ */ jsx(
1280
+ Skeleton,
1281
+ {
1282
+ className: "h-3 w-14",
1283
+ style: { animationDelay: `${index * 80}ms` }
1284
+ },
1285
+ index
1286
+ )) })
1287
+ ] })
1288
+ ]
1289
+ }
1290
+ );
1291
+ };
1292
+
1293
+ function hasValues(data, lines) {
1294
+ return data.some((row) => lines.some((line) => row[line.dataKey] != null));
1295
+ }
1091
1296
  const LineChart = ({
1092
1297
  data,
1093
1298
  config,
@@ -1100,88 +1305,106 @@ const LineChart = ({
1100
1305
  xAxisType = "category",
1101
1306
  showLegend = true,
1102
1307
  yDomain,
1103
- markers
1104
- }) => /* @__PURE__ */ jsx(ChartContainer, { config, className: className ?? "min-h-75 w-full", children: /* @__PURE__ */ jsxs(LineChart$1, { data, children: [
1105
- /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false }),
1106
- xAxisType === "time" ? /* @__PURE__ */ jsx(
1107
- XAxis,
1108
- {
1109
- dataKey: xAxisKey,
1110
- type: "number",
1111
- scale: "time",
1112
- domain: ["dataMin", "dataMax"],
1113
- padding: { left: 44, right: 44 },
1114
- tickLine: false,
1115
- axisLine: false,
1116
- tickMargin: 10,
1117
- minTickGap: 24,
1118
- tickFormatter: xAxisFormatter
1119
- }
1120
- ) : /* @__PURE__ */ jsx(
1121
- XAxis,
1122
- {
1123
- dataKey: xAxisKey,
1124
- tickLine: false,
1125
- axisLine: false,
1126
- tickMargin: 10,
1127
- minTickGap: 24,
1128
- tickFormatter: xAxisFormatter
1129
- }
1130
- ),
1131
- /* @__PURE__ */ jsx(
1132
- YAxis,
1133
- {
1134
- tickLine: false,
1135
- axisLine: false,
1136
- tickMargin: 8,
1137
- padding: { top: 8, bottom: 16 },
1138
- tickFormatter: valueFormatter,
1139
- width: valueFormatter ? "auto" : void 0,
1140
- domain: yDomain,
1141
- allowDataOverflow: false
1142
- }
1143
- ),
1144
- /* @__PURE__ */ jsx(
1145
- ChartTooltip,
1146
- {
1147
- content: /* @__PURE__ */ jsx(
1148
- ChartTooltipContent,
1149
- {
1150
- valueFormatter,
1151
- labelFormatter: xAxisFormatter ? (label, payload) => {
1152
- const xValue = payload?.[0]?.payload?.[xAxisKey] ?? label;
1153
- return typeof xValue === "string" || typeof xValue === "number" ? xAxisFormatter(xValue) : null;
1154
- } : void 0
1155
- }
1156
- )
1157
- }
1158
- ),
1159
- showLegend && /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
1160
- markers?.map((marker) => /* @__PURE__ */ jsx(
1161
- ReferenceLine,
1162
- {
1163
- x: marker.x,
1164
- stroke: "var(--muted-foreground)",
1165
- strokeDasharray: "4 4",
1166
- ifOverflow: "extendDomain",
1167
- label: marker.label ? { value: marker.label, position: "insideTopLeft", fill: "var(--muted-foreground)", fontSize: 12 } : void 0
1168
- },
1169
- String(marker.x)
1170
- )),
1171
- lines.map((line) => /* @__PURE__ */ jsx(
1172
- Line,
1173
- {
1174
- type: line.type ?? "monotone",
1175
- dataKey: line.dataKey,
1176
- stroke: `var(--color-${line.dataKey})`,
1177
- strokeWidth: 2,
1178
- strokeDasharray: line.strokeDasharray,
1179
- dot: line.dot ? { r: 4 } : false,
1180
- connectNulls: line.connectNulls ?? connectNulls
1181
- },
1182
- line.dataKey
1183
- ))
1184
- ] }) });
1308
+ markers,
1309
+ xDomain,
1310
+ isLoading = false,
1311
+ emptyState = { title: "No data to show" }
1312
+ }) => {
1313
+ if (isLoading) return /* @__PURE__ */ jsx(LineChartSkeleton, { lines: lines.length, className });
1314
+ if (!hasValues(data, lines)) {
1315
+ return /* @__PURE__ */ jsx(
1316
+ LineChartEmpty,
1317
+ {
1318
+ ...emptyState,
1319
+ xDomain: xAxisType === "time" ? xDomain : void 0,
1320
+ xAxisFormatter,
1321
+ markers,
1322
+ className
1323
+ }
1324
+ );
1325
+ }
1326
+ return /* @__PURE__ */ jsx(ChartContainer, { config, className: className ?? "min-h-75 w-full", children: /* @__PURE__ */ jsxs(LineChart$1, { data, children: [
1327
+ /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false }),
1328
+ xAxisType === "time" ? /* @__PURE__ */ jsx(
1329
+ XAxis,
1330
+ {
1331
+ dataKey: xAxisKey,
1332
+ type: "number",
1333
+ scale: "time",
1334
+ domain: xDomain ?? ["dataMin", "dataMax"],
1335
+ padding: { left: 44, right: 44 },
1336
+ tickLine: false,
1337
+ axisLine: false,
1338
+ tickMargin: 10,
1339
+ minTickGap: 24,
1340
+ tickFormatter: xAxisFormatter
1341
+ }
1342
+ ) : /* @__PURE__ */ jsx(
1343
+ XAxis,
1344
+ {
1345
+ dataKey: xAxisKey,
1346
+ tickLine: false,
1347
+ axisLine: false,
1348
+ tickMargin: 10,
1349
+ minTickGap: 24,
1350
+ tickFormatter: xAxisFormatter
1351
+ }
1352
+ ),
1353
+ /* @__PURE__ */ jsx(
1354
+ YAxis,
1355
+ {
1356
+ tickLine: false,
1357
+ axisLine: false,
1358
+ tickMargin: 8,
1359
+ padding: { top: 8, bottom: 16 },
1360
+ tickFormatter: valueFormatter,
1361
+ width: valueFormatter ? "auto" : void 0,
1362
+ domain: yDomain,
1363
+ allowDataOverflow: false
1364
+ }
1365
+ ),
1366
+ /* @__PURE__ */ jsx(
1367
+ ChartTooltip,
1368
+ {
1369
+ content: /* @__PURE__ */ jsx(
1370
+ ChartTooltipContent,
1371
+ {
1372
+ valueFormatter,
1373
+ labelFormatter: xAxisFormatter ? (label, payload) => {
1374
+ const xValue = payload?.[0]?.payload?.[xAxisKey] ?? label;
1375
+ return typeof xValue === "string" || typeof xValue === "number" ? xAxisFormatter(xValue) : null;
1376
+ } : void 0
1377
+ }
1378
+ )
1379
+ }
1380
+ ),
1381
+ showLegend && /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
1382
+ markers?.map((marker) => /* @__PURE__ */ jsx(
1383
+ ReferenceLine,
1384
+ {
1385
+ x: marker.x,
1386
+ stroke: "var(--muted-foreground)",
1387
+ strokeDasharray: "4 4",
1388
+ ifOverflow: "extendDomain",
1389
+ label: marker.label ? { value: marker.label, position: "insideTopLeft", fill: "var(--muted-foreground)", fontSize: 12 } : void 0
1390
+ },
1391
+ String(marker.x)
1392
+ )),
1393
+ lines.map((line) => /* @__PURE__ */ jsx(
1394
+ Line,
1395
+ {
1396
+ type: line.type ?? "monotone",
1397
+ dataKey: line.dataKey,
1398
+ stroke: `var(--color-${line.dataKey})`,
1399
+ strokeWidth: 2,
1400
+ strokeDasharray: line.strokeDasharray,
1401
+ dot: line.dot ? { r: 4 } : false,
1402
+ connectNulls: line.connectNulls ?? connectNulls
1403
+ },
1404
+ line.dataKey
1405
+ ))
1406
+ ] }) });
1407
+ };
1185
1408
  LineChart.displayName = "LineChart";
1186
1409
 
1187
1410
  export { LineChart as L };