@trackunit/react-chart-components 1.17.3 → 1.17.4

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.
package/index.cjs.js CHANGED
@@ -276,7 +276,7 @@ const cvaLegendItemIndicator = cssClassVarianceUtilities.cvaMerge(["w-3", "mr-1"
276
276
  * @param {LegendItem} props - The props for the LegendItem component
277
277
  * @returns {ReactElement} LegendItem component
278
278
  */
279
- const LegendItem = ({ className, count, label, disabled, selected, onClick, color, "data-testid": dataTestId, onMouseEnter, onMouseLeave, unit, hideValue = false, }) => {
279
+ const LegendItem = ({ className, count, label, disabled = false, selected = false, onClick, color, "data-testid": dataTestId, onMouseEnter, onMouseLeave, unit = undefined, hideValue = false, }) => {
280
280
  const handleOnClick = onClick && !disabled ? e => onClick(e) : undefined;
281
281
  return (jsxRuntime.jsxs("div", { className: cvaLegendItem({ disabled, selected, isClickable: !disabled && onClick !== undefined, className }), "data-testid": dataTestId, onClick: handleOnClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [jsxRuntime.jsx("div", { className: cvaLegendItemIndicator({ selected }), "data-testid": dataTestId ? `${dataTestId}-indicator` : null, style: { backgroundColor: color } }), jsxRuntime.jsxs("p", { className: "truncate text-xs", children: [label, "\u00A0"] }), hideValue ? null : (jsxRuntime.jsxs("p", { className: "text-xs", children: ["(", count ?? 0, ")", unit ?? ""] }))] }));
282
282
  };
@@ -381,7 +381,7 @@ const useLimitDataSet = (data, limit, autoSortData = true, othersName) => {
381
381
  * @param {DonutChartProps} props - The props for the Chart component
382
382
  * @returns {ReactElement} Chart component
383
383
  */
384
- const DonutChart = ({ data, size = "full", loading = false, onClick, className, "data-testid": dataTestId, maxDataPoints = 6, showOthers = true, unit, overrideTotal, autoSortData = true, hideLegendValues = false, othersName, ref, }) => {
384
+ const DonutChart = ({ data, size = "full", loading = false, onClick, className, "data-testid": dataTestId, maxDataPoints = 6, showOthers = true, unit = undefined, overrideTotal, autoSortData = true, hideLegendValues = false, othersName, ref, }) => {
385
385
  const containerRef = react.useRef(null);
386
386
  const mergedRef = reactComponents.useMergeRefs([containerRef, ref]);
387
387
  const chartRef = react.useRef(null);
package/index.esm.js CHANGED
@@ -255,7 +255,7 @@ const cvaLegendItemIndicator = cvaMerge(["w-3", "mr-1", "h-3", "rounded-[50%]",
255
255
  * @param {LegendItem} props - The props for the LegendItem component
256
256
  * @returns {ReactElement} LegendItem component
257
257
  */
258
- const LegendItem = ({ className, count, label, disabled, selected, onClick, color, "data-testid": dataTestId, onMouseEnter, onMouseLeave, unit, hideValue = false, }) => {
258
+ const LegendItem = ({ className, count, label, disabled = false, selected = false, onClick, color, "data-testid": dataTestId, onMouseEnter, onMouseLeave, unit = undefined, hideValue = false, }) => {
259
259
  const handleOnClick = onClick && !disabled ? e => onClick(e) : undefined;
260
260
  return (jsxs("div", { className: cvaLegendItem({ disabled, selected, isClickable: !disabled && onClick !== undefined, className }), "data-testid": dataTestId, onClick: handleOnClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [jsx("div", { className: cvaLegendItemIndicator({ selected }), "data-testid": dataTestId ? `${dataTestId}-indicator` : null, style: { backgroundColor: color } }), jsxs("p", { className: "truncate text-xs", children: [label, "\u00A0"] }), hideValue ? null : (jsxs("p", { className: "text-xs", children: ["(", count ?? 0, ")", unit ?? ""] }))] }));
261
261
  };
@@ -360,7 +360,7 @@ const useLimitDataSet = (data, limit, autoSortData = true, othersName) => {
360
360
  * @param {DonutChartProps} props - The props for the Chart component
361
361
  * @returns {ReactElement} Chart component
362
362
  */
363
- const DonutChart = ({ data, size = "full", loading = false, onClick, className, "data-testid": dataTestId, maxDataPoints = 6, showOthers = true, unit, overrideTotal, autoSortData = true, hideLegendValues = false, othersName, ref, }) => {
363
+ const DonutChart = ({ data, size = "full", loading = false, onClick, className, "data-testid": dataTestId, maxDataPoints = 6, showOthers = true, unit = undefined, overrideTotal, autoSortData = true, hideLegendValues = false, othersName, ref, }) => {
364
364
  const containerRef = useRef(null);
365
365
  const mergedRef = useMergeRefs([containerRef, ref]);
366
366
  const chartRef = useRef(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-chart-components",
3
- "version": "1.17.3",
3
+ "version": "1.17.4",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,11 +9,11 @@
9
9
  "dependencies": {
10
10
  "echarts": "5.6.0",
11
11
  "@trackunit/date-and-time-utils": "1.11.79",
12
- "@trackunit/react-date-and-time-hooks": "1.17.3",
12
+ "@trackunit/react-date-and-time-hooks": "1.17.4",
13
13
  "@trackunit/ui-design-tokens": "1.11.74",
14
14
  "@trackunit/shared-utils": "1.13.77",
15
15
  "@trackunit/css-class-variance-utilities": "1.11.77",
16
- "@trackunit/react-components": "1.20.3"
16
+ "@trackunit/react-components": "1.20.4"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "^19.0.0"