@vritti/quantum-ui 0.5.8 → 0.5.9

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 (208) hide show
  1. package/dist/ActiveShapeUtils.js +1 -1
  2. package/dist/AreaChart.js +1 -1
  3. package/dist/Avatar.js +5 -5
  4. package/dist/BarChart.js +1 -1
  5. package/dist/Breadcrumb.js +3 -1
  6. package/dist/Breadcrumb.js.map +1 -1
  7. package/dist/Button.js +1 -1
  8. package/dist/CartesianChart.js +40 -2
  9. package/dist/CartesianChart.js.map +1 -1
  10. package/dist/Chart.js +7 -3
  11. package/dist/Chart.js.map +1 -1
  12. package/dist/Checkbox.js +30 -6
  13. package/dist/Checkbox.js.map +1 -1
  14. package/dist/Checkbox2.js +2 -2
  15. package/dist/CheckboxGroup.js +20 -3
  16. package/dist/CheckboxGroup.js.map +1 -1
  17. package/dist/CurrencyField.js +17 -5
  18. package/dist/CurrencyField.js.map +1 -1
  19. package/dist/DangerZoneSkeleton.js +1 -1
  20. package/dist/DatePicker.js +144 -126
  21. package/dist/DatePicker.js.map +1 -1
  22. package/dist/DateRangePicker.js +138 -122
  23. package/dist/DateRangePicker.js.map +1 -1
  24. package/dist/DateTimePicker.js +181 -163
  25. package/dist/DateTimePicker.js.map +1 -1
  26. package/dist/DateTimeRangePicker.js +189 -173
  27. package/dist/DateTimeRangePicker.js.map +1 -1
  28. package/dist/Dialog.js +1 -1
  29. package/dist/DropdownMenu.js +1 -1
  30. package/dist/Form.js +2 -0
  31. package/dist/Form.js.map +1 -1
  32. package/dist/FormSection.js +22 -0
  33. package/dist/FormSection.js.map +1 -1
  34. package/dist/IconSelect.js +4 -2
  35. package/dist/IconSelect.js.map +1 -1
  36. package/dist/Label.js +1 -1
  37. package/dist/LineChart.js +390 -9
  38. package/dist/LineChart.js.map +1 -1
  39. package/dist/OTPField.js +39 -24
  40. package/dist/OTPField.js.map +1 -1
  41. package/dist/PermissionGate.js +25 -3
  42. package/dist/PermissionGate.js.map +1 -1
  43. package/dist/PhoneField.js +47 -30
  44. package/dist/PhoneField.js.map +1 -1
  45. package/dist/PieChart.js +1 -1
  46. package/dist/Progress.js +2 -2
  47. package/dist/RadarChart.js +1 -1
  48. package/dist/RadialChart.js +1 -1
  49. package/dist/RadioGroup.js +35 -18
  50. package/dist/RadioGroup.js.map +1 -1
  51. package/dist/Select.js +53 -33
  52. package/dist/Select.js.map +1 -1
  53. package/dist/SelectFilter.js +13 -6
  54. package/dist/SelectFilter.js.map +1 -1
  55. package/dist/Sidebar.js +1 -1
  56. package/dist/SingleSelect.js +50 -24
  57. package/dist/SingleSelect.js.map +1 -1
  58. package/dist/Switch.js +3 -3
  59. package/dist/TabsSkeleton.js +2 -2
  60. package/dist/TextArea.js +28 -12
  61. package/dist/TextArea.js.map +1 -1
  62. package/dist/TextField.js +70 -53
  63. package/dist/TextField.js.map +1 -1
  64. package/dist/Toggle.js +1 -1
  65. package/dist/UploadFile.js +22 -4
  66. package/dist/UploadFile.js.map +1 -1
  67. package/dist/assets/quantum-ui.css +76 -1
  68. package/dist/calendar2.js +1 -1
  69. package/dist/calendar2.js.map +1 -1
  70. package/dist/components/DateFilter.js +158 -0
  71. package/dist/components/DateFilter.js.map +1 -0
  72. package/dist/components/PermissionGate.js +1 -1
  73. package/dist/components/RichTextEditor.js +1 -1
  74. package/dist/components/TokenInput.js +96 -66
  75. package/dist/components/TokenInput.js.map +1 -1
  76. package/dist/contextAnchor.js +11 -0
  77. package/dist/contextAnchor.js.map +1 -0
  78. package/dist/disabledTip.js +3 -2
  79. package/dist/disabledTip.js.map +1 -1
  80. package/dist/dropdown-menu.js +5 -5
  81. package/dist/getZIndexFromUnknown.js +1 -1
  82. package/dist/image-component.js +1 -1
  83. package/dist/index.js +2 -2
  84. package/dist/index13.js +34 -5
  85. package/dist/index13.js.map +1 -1
  86. package/dist/index14.js +22 -281
  87. package/dist/index14.js.map +1 -1
  88. package/dist/index15.js +212 -1072
  89. package/dist/index15.js.map +1 -1
  90. package/dist/index16.js +1139 -14
  91. package/dist/index16.js.map +1 -1
  92. package/dist/index17.js +14 -20
  93. package/dist/index17.js.map +1 -1
  94. package/dist/index20.js +2 -2
  95. package/dist/index21.js +1 -1
  96. package/dist/index22.js +1 -1
  97. package/dist/index23.js +1 -1
  98. package/dist/index25.js +4 -232
  99. package/dist/index25.js.map +1 -1
  100. package/dist/index26.js +35 -2534
  101. package/dist/index26.js.map +1 -1
  102. package/dist/index27.js +223 -23
  103. package/dist/index27.js.map +1 -1
  104. package/dist/index28.js +1124 -3
  105. package/dist/index28.js.map +1 -1
  106. package/dist/index29.js +2481 -1035
  107. package/dist/index29.js.map +1 -1
  108. package/dist/index30.js +308 -36
  109. package/dist/index30.js.map +1 -1
  110. package/dist/index31.js +7 -307
  111. package/dist/index31.js.map +1 -1
  112. package/dist/index32.js +30 -8
  113. package/dist/index32.js.map +1 -1
  114. package/dist/index33.js +59 -29
  115. package/dist/index33.js.map +1 -1
  116. package/dist/index34.js +10 -59
  117. package/dist/index34.js.map +1 -1
  118. package/dist/index35.js +35347 -9
  119. package/dist/index35.js.map +1 -1
  120. package/dist/index36.js +79 -36
  121. package/dist/index36.js.map +1 -1
  122. package/dist/index37.js +184 -35340
  123. package/dist/index37.js.map +1 -1
  124. package/dist/index5.js +1 -1
  125. package/dist/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -1
  126. package/dist/lib/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  127. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -0
  128. package/dist/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  129. package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts +1 -0
  130. package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  131. package/dist/lib/components/CurrencyField/CurrencyField.d.ts +1 -0
  132. package/dist/lib/components/CurrencyField/CurrencyField.d.ts.map +1 -1
  133. package/dist/lib/components/DataTable/DataTable.d.ts +1 -1
  134. package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -1
  135. package/dist/lib/components/DataTable/components/RowActions.d.ts +1 -0
  136. package/dist/lib/components/DataTable/components/RowActions.d.ts.map +1 -1
  137. package/dist/lib/components/DataTable/store/store.d.ts.map +1 -1
  138. package/dist/lib/components/DataTable/types.d.ts +1 -0
  139. package/dist/lib/components/DataTable/types.d.ts.map +1 -1
  140. package/dist/lib/components/DateFilter/DateFilter.d.ts +17 -0
  141. package/dist/lib/components/DateFilter/DateFilter.d.ts.map +1 -0
  142. package/dist/lib/components/DateFilter/index.d.ts +3 -0
  143. package/dist/lib/components/DateFilter/index.d.ts.map +1 -0
  144. package/dist/lib/components/DatePicker/DatePicker.d.ts +1 -0
  145. package/dist/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
  146. package/dist/lib/components/DateRangePicker/DateRangePicker.d.ts +1 -0
  147. package/dist/lib/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  148. package/dist/lib/components/DateTimePicker/DateTimePicker.d.ts +1 -0
  149. package/dist/lib/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  150. package/dist/lib/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -0
  151. package/dist/lib/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  152. package/dist/lib/components/Form/Form.d.ts.map +1 -1
  153. package/dist/lib/components/Form/FormSection.d.ts +1 -1
  154. package/dist/lib/components/Form/FormSection.d.ts.map +1 -1
  155. package/dist/lib/components/Form/fieldPermissions.d.ts +6 -0
  156. package/dist/lib/components/Form/fieldPermissions.d.ts.map +1 -0
  157. package/dist/lib/components/LineChart/LineChart.d.ts +18 -4
  158. package/dist/lib/components/LineChart/LineChart.d.ts.map +1 -1
  159. package/dist/lib/components/LineChart/index.d.ts +1 -1
  160. package/dist/lib/components/LineChart/index.d.ts.map +1 -1
  161. package/dist/lib/components/OTPField/OTPField.d.ts +1 -0
  162. package/dist/lib/components/OTPField/OTPField.d.ts.map +1 -1
  163. package/dist/lib/components/PermissionGate/PermissionGate.d.ts +1 -0
  164. package/dist/lib/components/PermissionGate/PermissionGate.d.ts.map +1 -1
  165. package/dist/lib/components/PermissionGate/index.d.ts +1 -1
  166. package/dist/lib/components/PermissionGate/index.d.ts.map +1 -1
  167. package/dist/lib/components/PhoneField/PhoneField.d.ts +1 -0
  168. package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -1
  169. package/dist/lib/components/RadioGroup/RadioGroup.d.ts +1 -0
  170. package/dist/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  171. package/dist/lib/components/Select/Select.d.ts.map +1 -1
  172. package/dist/lib/components/Select/SelectFilter.d.ts.map +1 -1
  173. package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts +1 -0
  174. package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  175. package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts +1 -0
  176. package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts.map +1 -1
  177. package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts +3 -0
  178. package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts.map +1 -1
  179. package/dist/lib/components/Select/contextAnchor.d.ts +11 -0
  180. package/dist/lib/components/Select/contextAnchor.d.ts.map +1 -0
  181. package/dist/lib/components/TextArea/TextArea.d.ts +1 -0
  182. package/dist/lib/components/TextArea/TextArea.d.ts.map +1 -1
  183. package/dist/lib/components/TextField/TextField.d.ts +1 -0
  184. package/dist/lib/components/TextField/TextField.d.ts.map +1 -1
  185. package/dist/lib/components/TokenInput/TokenInput.d.ts +1 -0
  186. package/dist/lib/components/TokenInput/TokenInput.d.ts.map +1 -1
  187. package/dist/lib/components/UploadFile/UploadFile.d.ts +1 -0
  188. package/dist/lib/components/UploadFile/UploadFile.d.ts.map +1 -1
  189. package/dist/lib/selects/icon/IconSelect.d.ts +1 -0
  190. package/dist/lib/selects/icon/IconSelect.d.ts.map +1 -1
  191. package/dist/lib/utils/disabledTip.d.ts +1 -1
  192. package/dist/lib/utils/disabledTip.d.ts.map +1 -1
  193. package/dist/popover.js +1 -1
  194. package/dist/select2.js +1 -1
  195. package/dist/separator2.js +1 -1
  196. package/dist/shadcn/shadcnChart/Chart.d.ts +2 -1
  197. package/dist/shadcn/shadcnChart/Chart.d.ts.map +1 -1
  198. package/dist/useDataTable.js +25 -9
  199. package/dist/useDataTable.js.map +1 -1
  200. package/dist/utils/motion.js +2 -2
  201. package/dist/value.js +1 -1
  202. package/package.json +5 -1
  203. package/dist/index38.js +0 -84
  204. package/dist/index38.js.map +0 -1
  205. package/dist/index39.js +0 -199
  206. package/dist/index39.js.map +0 -1
  207. package/dist/lock-keyhole.js +0 -19
  208. package/dist/lock-keyhole.js.map +0 -1
package/dist/Label.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { R as Root } from './index16.js';
2
+ import { R as Root } from './index17.js';
3
3
  import { c as cn } from './utils.js';
4
4
 
5
5
  function Label({ className, ...props }) {
package/dist/LineChart.js CHANGED
@@ -1,14 +1,319 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { c as createSelector, e as selectChartLayout, a7 as selectChartDataWithIndexesIfNotInPanoramaPosition4, a8 as selectAxisWithScale, a9 as selectTicksOfGraphicalItem, aa as selectUnfilteredCartesianItems, ab as isCategoricalAxis, ac as getBandSizeOfAxis, ad as propsAreEqual, $ as resolveDefaultProps, D as DefaultZIndexes, ae as useIsPanorama, af as RegisterGraphicalItemId, ag as SetLegendPayload, ah as SetCartesianGraphicalItem, ai as getTooltipNameProp, aj as SetTooltipEntrySettings, ak as noop, al as usePlotArea, am as useChartLayout, A as useAppSelector, y as isClipDot, Z as ZIndexLayer, L as Layer, Y as getValueByDataKey, an as getCateCoordinateOfLine, E as isNullish, ao as useAnimationId, ap as JavascriptAnimate, aq as interpolate, ar as LabelListFromLabelProp, as as CartesianLabelListContextProvider, at as svgPropertiesAndEvents, x as svgPropertiesNoEvents, au as arrayTooltipSearcher, av as ChartContainer, aw as ChartTooltip, ax as ChartTooltipContent, ay as ChartLegend, az as ChartLegendContent } from './Chart.js';
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';
3
3
  import * as React from 'react';
4
- import { Component, useRef, useState, useCallback, useMemo, forwardRef } from 'react';
5
- import { u as useNeedsClip, G as GraphicalItemClipPath, C as CartesianChart, a as CartesianGrid, X as XAxis, Y as YAxis } from './CartesianChart.js';
4
+ import { useEffect, Component, useRef, useState, useCallback, useMemo, forwardRef } from 'react';
5
+ 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
6
  import { a as clsx } from './utils.js';
7
7
  import { A as ActivePoints, D as Dots } from './ActivePoints.js';
8
8
  import { S as SetErrorBarContext } from './ErrorBarContext.js';
9
9
  import { g as getRadiusAndStrokeWidthFromDot } from './getRadiusAndStrokeWidthFromDot.js';
10
10
  import { S as Shape } from './ActiveShapeUtils.js';
11
11
 
12
+ /**
13
+ * Groups X and Y scale functions together and provides helper methods.
14
+ */
15
+ class CartesianScaleHelperImpl {
16
+ constructor(_ref) {
17
+ var {
18
+ x,
19
+ y
20
+ } = _ref;
21
+ this.xAxisScale = x;
22
+ this.yAxisScale = y;
23
+ }
24
+ map(value, _ref2) {
25
+ var _this$xAxisScale$map, _this$yAxisScale$map;
26
+ var {
27
+ position
28
+ } = _ref2;
29
+ return {
30
+ x: (_this$xAxisScale$map = this.xAxisScale.map(value.x, {
31
+ position
32
+ })) !== null && _this$xAxisScale$map !== void 0 ? _this$xAxisScale$map : 0,
33
+ y: (_this$yAxisScale$map = this.yAxisScale.map(value.y, {
34
+ position
35
+ })) !== null && _this$yAxisScale$map !== void 0 ? _this$yAxisScale$map : 0
36
+ };
37
+ }
38
+ mapWithFallback(value, _ref3) {
39
+ var _this$xAxisScale$map2, _this$yAxisScale$map2;
40
+ var {
41
+ position,
42
+ fallback
43
+ } = _ref3;
44
+ var fallbackY, fallbackX;
45
+ if (fallback === 'rangeMin') {
46
+ fallbackY = this.yAxisScale.rangeMin();
47
+ } else if (fallback === 'rangeMax') {
48
+ fallbackY = this.yAxisScale.rangeMax();
49
+ } else {
50
+ fallbackY = 0;
51
+ }
52
+ if (fallback === 'rangeMin') {
53
+ fallbackX = this.xAxisScale.rangeMin();
54
+ } else if (fallback === 'rangeMax') {
55
+ fallbackX = this.xAxisScale.rangeMax();
56
+ } else {
57
+ fallbackX = 0;
58
+ }
59
+ return {
60
+ x: (_this$xAxisScale$map2 = this.xAxisScale.map(value.x, {
61
+ position
62
+ })) !== null && _this$xAxisScale$map2 !== void 0 ? _this$xAxisScale$map2 : fallbackX,
63
+ y: (_this$yAxisScale$map2 = this.yAxisScale.map(value.y, {
64
+ position
65
+ })) !== null && _this$yAxisScale$map2 !== void 0 ? _this$yAxisScale$map2 : fallbackY
66
+ };
67
+ }
68
+ isInRange(_ref4) {
69
+ var {
70
+ x,
71
+ y
72
+ } = _ref4;
73
+ var xInRange = x == null || this.xAxisScale.isInRange(x);
74
+ var yInRange = y == null || this.yAxisScale.isInRange(y);
75
+ return xInRange && yInRange;
76
+ }
77
+ }
78
+
79
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
80
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
81
+ function _defineProperty$1(e, r, t) { return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
82
+ function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == typeof i ? i : i + ""; }
83
+ function _toPrimitive$1(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
84
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
85
+
86
+ /**
87
+ * Single point that defines one end of a segment.
88
+ * These coordinates are in data space, meaning that you should provide
89
+ * values that correspond to the data domain of the axes.
90
+ * So you would provide a value of `Page A` to indicate the data value `Page A`
91
+ * and then recharts will convert that to pixels.
92
+ *
93
+ * Likewise for numbers. If your x-axis goes from 0 to 100,
94
+ * and you want the line to end at 50, you would provide `50` here.
95
+ *
96
+ * @inline
97
+ */
98
+
99
+ /**
100
+ * This excludes `viewBox` prop from svg for two reasons:
101
+ * 1. The components wants viewBox of object type, and svg wants string
102
+ * - so there's a conflict, and the component will throw if it gets string
103
+ * 2. Internally the component calls `svgPropertiesNoEvents` which filters the viewBox away anyway
104
+ */
105
+
106
+ var renderLine = (option, props) => {
107
+ var line;
108
+ if (/*#__PURE__*/React.isValidElement(option)) {
109
+ // @ts-expect-error element cloning is not typed
110
+ line = /*#__PURE__*/React.cloneElement(option, props);
111
+ } else if (typeof option === 'function') {
112
+ line = option(props);
113
+ } else {
114
+ if (!isWellBehavedNumber(props.x1) || !isWellBehavedNumber(props.y1) || !isWellBehavedNumber(props.x2) || !isWellBehavedNumber(props.y2)) {
115
+ return null;
116
+ }
117
+ line = /*#__PURE__*/React.createElement("line", _extends$1({}, props, {
118
+ className: "recharts-reference-line-line"
119
+ }));
120
+ }
121
+ return line;
122
+ };
123
+ var getHorizontalLineEndPoints = (yCoord, ifOverflow, position, yAxisOrientation, yAxisScale, viewBox) => {
124
+ var {
125
+ x,
126
+ width
127
+ } = viewBox;
128
+ var coord = yAxisScale.map(yCoord, {
129
+ position
130
+ });
131
+ // don't render the line if the scale can't compute a result that makes sense
132
+ if (!isWellBehavedNumber(coord)) {
133
+ return null;
134
+ }
135
+ if (ifOverflow === 'discard' && !yAxisScale.isInRange(coord)) {
136
+ return null;
137
+ }
138
+ var points = [{
139
+ x: x + width,
140
+ y: coord
141
+ }, {
142
+ x,
143
+ y: coord
144
+ }];
145
+ return yAxisOrientation === 'left' ? points.reverse() : points;
146
+ };
147
+ var getVerticalLineEndPoints = (xCoord, ifOverflow, position, xAxisOrientation, xAxisScale, viewBox) => {
148
+ var {
149
+ y,
150
+ height
151
+ } = viewBox;
152
+ var coord = xAxisScale.map(xCoord, {
153
+ position
154
+ });
155
+ // don't render the line if the scale can't compute a result that makes sense
156
+ if (!isWellBehavedNumber(coord)) {
157
+ return null;
158
+ }
159
+ if (ifOverflow === 'discard' && !xAxisScale.isInRange(coord)) {
160
+ return null;
161
+ }
162
+ var points = [{
163
+ x: coord,
164
+ y: y + height
165
+ }, {
166
+ x: coord,
167
+ y
168
+ }];
169
+ return xAxisOrientation === 'top' ? points.reverse() : points;
170
+ };
171
+ var getSegmentLineEndPoints = (segment, ifOverflow, position, scales) => {
172
+ var points = [scales.mapWithFallback(segment[0], {
173
+ position,
174
+ fallback: 'rangeMin'
175
+ }), scales.mapWithFallback(segment[1], {
176
+ position,
177
+ fallback: 'rangeMax'
178
+ })];
179
+ if (ifOverflow === 'discard' && points.some(p => !scales.isInRange(p))) {
180
+ return null;
181
+ }
182
+ return points;
183
+ };
184
+ var getEndPoints = (xAxisScale, yAxisScale, viewBox, position, xAxisOrientation, yAxisOrientation, props) => {
185
+ var {
186
+ x: xCoord,
187
+ y: yCoord,
188
+ segment,
189
+ ifOverflow
190
+ } = props;
191
+ var isFixedX = isNumOrStr(xCoord);
192
+ var isFixedY = isNumOrStr(yCoord);
193
+ if (isFixedY) {
194
+ return getHorizontalLineEndPoints(yCoord, ifOverflow, position, yAxisOrientation, yAxisScale, viewBox);
195
+ }
196
+ if (isFixedX) {
197
+ return getVerticalLineEndPoints(xCoord, ifOverflow, position, xAxisOrientation, xAxisScale, viewBox);
198
+ }
199
+ if (segment != null && segment.length === 2) {
200
+ return getSegmentLineEndPoints(segment, ifOverflow, position, new CartesianScaleHelperImpl({
201
+ x: xAxisScale,
202
+ y: yAxisScale
203
+ }));
204
+ }
205
+ return null;
206
+ };
207
+ function ReportReferenceLine(props) {
208
+ var dispatch = useAppDispatch();
209
+ useEffect(() => {
210
+ dispatch(addLine(props));
211
+ return () => {
212
+ dispatch(removeLine(props));
213
+ };
214
+ });
215
+ return null;
216
+ }
217
+ function ReferenceLineImpl(props) {
218
+ var {
219
+ xAxisId,
220
+ yAxisId,
221
+ shape,
222
+ className,
223
+ ifOverflow
224
+ } = props;
225
+ var isPanorama = useIsPanorama();
226
+ var clipPathId = useClipPathId();
227
+ var xAxis = useAppSelector(state => selectXAxisSettings(state, xAxisId));
228
+ var yAxis = useAppSelector(state => selectYAxisSettings(state, yAxisId));
229
+ var xAxisScale = useAppSelector(state => selectAxisScale(state, 'xAxis', xAxisId, isPanorama));
230
+ var yAxisScale = useAppSelector(state => selectAxisScale(state, 'yAxis', yAxisId, isPanorama));
231
+ var viewBox = useViewBox();
232
+ if (!clipPathId || !viewBox || xAxis == null || yAxis == null || xAxisScale == null || yAxisScale == null) {
233
+ return null;
234
+ }
235
+ var endPoints = getEndPoints(xAxisScale, yAxisScale, viewBox, props.position, xAxis.orientation, yAxis.orientation, props);
236
+ if (!endPoints) {
237
+ return null;
238
+ }
239
+ var point1 = endPoints[0];
240
+ var point2 = endPoints[1];
241
+ if (point1 == null || point2 == null) {
242
+ return null;
243
+ }
244
+ var {
245
+ x: x1,
246
+ y: y1
247
+ } = point1;
248
+ var {
249
+ x: x2,
250
+ y: y2
251
+ } = point2;
252
+ var clipPath = ifOverflow === 'hidden' ? "url(#".concat(clipPathId, ")") : undefined;
253
+ var lineProps = _objectSpread$1(_objectSpread$1({
254
+ clipPath
255
+ }, svgPropertiesAndEvents(props)), {}, {
256
+ x1,
257
+ y1,
258
+ x2,
259
+ y2
260
+ });
261
+ var rect = rectWithCoords({
262
+ x1,
263
+ y1,
264
+ x2,
265
+ y2
266
+ });
267
+ return /*#__PURE__*/React.createElement(ZIndexLayer, {
268
+ zIndex: props.zIndex
269
+ }, /*#__PURE__*/React.createElement(Layer, {
270
+ className: clsx('recharts-reference-line', className)
271
+ }, renderLine(shape, lineProps), /*#__PURE__*/React.createElement(CartesianLabelContextProvider, _extends$1({}, rect, {
272
+ lowerWidth: rect.width,
273
+ upperWidth: rect.width
274
+ }), /*#__PURE__*/React.createElement(CartesianLabelFromLabelProp, {
275
+ label: props.label
276
+ }), props.children)));
277
+ }
278
+ var referenceLineDefaultProps = {
279
+ ifOverflow: 'discard',
280
+ xAxisId: 0,
281
+ yAxisId: 0,
282
+ fill: 'none',
283
+ label: false,
284
+ stroke: '#ccc',
285
+ fillOpacity: 1,
286
+ strokeWidth: 1,
287
+ position: 'middle',
288
+ zIndex: DefaultZIndexes.line
289
+ };
290
+ /**
291
+ * Draws a line on the chart connecting two points.
292
+ *
293
+ * This component, unlike {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/line line}, is aware of the cartesian coordinate system,
294
+ * so you specify the dimensions by using data coordinates instead of pixels.
295
+ *
296
+ * ReferenceLine will calculate the pixels based on the provided data coordinates.
297
+ *
298
+ * If you prefer to render using pixels rather than data coordinates,
299
+ * consider using the {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/line line SVG element} instead.
300
+ *
301
+ * @provides CartesianLabelContext
302
+ * @consumes CartesianChartContext
303
+ */
304
+ function ReferenceLine(outsideProps) {
305
+ var props = resolveDefaultProps(outsideProps, referenceLineDefaultProps);
306
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ReportReferenceLine, {
307
+ yAxisId: props.yAxisId,
308
+ xAxisId: props.xAxisId,
309
+ ifOverflow: props.ifOverflow,
310
+ x: props.x,
311
+ y: props.y,
312
+ segment: props.segment
313
+ }), /*#__PURE__*/React.createElement(ReferenceLineImpl, props));
314
+ }
315
+ ReferenceLine.displayName = 'ReferenceLine';
316
+
12
317
  var selectXAxisWithScale = (state, xAxisId, _yAxisId, isPanorama) => selectAxisWithScale(state, 'xAxis', xAxisId, isPanorama);
13
318
  var selectXAxisTicks = (state, xAxisId, _yAxisId, isPanorama) => selectTicksOfGraphicalItem(state, 'xAxis', xAxisId, isPanorama);
14
319
  var selectYAxisWithScale = (state, _xAxisId, yAxisId, isPanorama) => selectAxisWithScale(state, 'yAxis', yAxisId, isPanorama);
@@ -783,12 +1088,86 @@ var LineChart$1 = /*#__PURE__*/forwardRef((props, ref) => {
783
1088
  });
784
1089
  });
785
1090
 
786
- const LineChart = ({ data, config, xAxisKey, lines, className }) => /* @__PURE__ */ jsx(ChartContainer, { config, className: className ?? "min-h-[300px] w-full", children: /* @__PURE__ */ jsxs(LineChart$1, { data, children: [
1091
+ const LineChart = ({
1092
+ data,
1093
+ config,
1094
+ xAxisKey,
1095
+ lines,
1096
+ className,
1097
+ valueFormatter,
1098
+ xAxisFormatter,
1099
+ connectNulls = false,
1100
+ xAxisType = "category",
1101
+ showLegend = true,
1102
+ yDomain,
1103
+ markers
1104
+ }) => /* @__PURE__ */ jsx(ChartContainer, { config, className: className ?? "min-h-75 w-full", children: /* @__PURE__ */ jsxs(LineChart$1, { data, children: [
787
1105
  /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false }),
788
- /* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tickLine: false, axisLine: false }),
789
- /* @__PURE__ */ jsx(YAxis, { tickLine: false, axisLine: false }),
790
- /* @__PURE__ */ jsx(ChartTooltip, { content: /* @__PURE__ */ jsx(ChartTooltipContent, {}) }),
791
- /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
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
+ )),
792
1171
  lines.map((line) => /* @__PURE__ */ jsx(
793
1172
  Line,
794
1173
  {
@@ -796,7 +1175,9 @@ const LineChart = ({ data, config, xAxisKey, lines, className }) => /* @__PURE__
796
1175
  dataKey: line.dataKey,
797
1176
  stroke: `var(--color-${line.dataKey})`,
798
1177
  strokeWidth: 2,
799
- dot: false
1178
+ strokeDasharray: line.strokeDasharray,
1179
+ dot: line.dot ? { r: 4 } : false,
1180
+ connectNulls: line.connectNulls ?? connectNulls
800
1181
  },
801
1182
  line.dataKey
802
1183
  ))