@trackunit/react-chart-components 0.0.336 → 0.0.338

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
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var jsxRuntime = require('react/jsx-runtime');
6
4
  var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
7
5
  var reactComponents = require('@trackunit/react-components');
@@ -9,10 +7,6 @@ var EChart = require('echarts-for-react');
9
7
  var react = require('react');
10
8
  var uiDesignTokens = require('@trackunit/ui-design-tokens');
11
9
 
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var EChart__default = /*#__PURE__*/_interopDefaultLegacy(EChart);
15
-
16
10
  /**
17
11
  * The Chart component is a wrapper component for ECharts.
18
12
  *
@@ -72,7 +66,7 @@ const Chart = ({ options, unsafeOptions, showLoading, className, style, onChartR
72
66
  }
73
67
  };
74
68
  }, [onClick, echartsRef]);
75
- return (jsxRuntime.jsx("div", { className: cvaChartContainer(), "data-testid": dataTestId, style: { height: (_a = style === null || style === void 0 ? void 0 : style.height) !== null && _a !== void 0 ? _a : "300px", width: (_b = style === null || style === void 0 ? void 0 : style.width) !== null && _b !== void 0 ? _b : "100%" }, children: showLoading ? (jsxRuntime.jsxs("div", { className: cvaChartSpinnerContainer(), "data-testid": `${dataTestId}-loading`, children: [jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), (loadingOption === null || loadingOption === void 0 ? void 0 : loadingOption.text) ? (jsxRuntime.jsx(reactComponents.Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EChart__default["default"], { className: className, notMerge: !merge, onChartReady: onChartReady, onEvents: eventHandlers, option: options !== null && options !== void 0 ? options : unsafeOptions, opts: { width: "auto", height: "auto", renderer: renderer }, ref: echartsRef, style: style }), timezoneLabel] })) }));
69
+ return (jsxRuntime.jsx("div", { className: cvaChartContainer(), "data-testid": dataTestId, style: { height: (_a = style === null || style === void 0 ? void 0 : style.height) !== null && _a !== void 0 ? _a : "300px", width: (_b = style === null || style === void 0 ? void 0 : style.width) !== null && _b !== void 0 ? _b : "100%" }, children: showLoading ? (jsxRuntime.jsxs("div", { className: cvaChartSpinnerContainer(), "data-testid": `${dataTestId}-loading`, children: [jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), (loadingOption === null || loadingOption === void 0 ? void 0 : loadingOption.text) ? (jsxRuntime.jsx(reactComponents.Text, { align: "center", subtle: true, children: loadingOption.text })) : null] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EChart, { className: className, notMerge: !merge, onChartReady: onChartReady, onEvents: eventHandlers, option: options !== null && options !== void 0 ? options : unsafeOptions, opts: { width: "auto", height: "auto", renderer: renderer }, ref: echartsRef, style: style }), timezoneLabel] })) }));
76
70
  };
77
71
  const cvaChartContainer = cssClassVarianceUtilities.cvaMerge(["grid", "gap-1", "grid-rows-1", "grid-cols-1", "h-full", "w-full", "items-center"]);
78
72
  const cvaChartSpinnerContainer = cssClassVarianceUtilities.cvaMerge(["grid", "place-items-center", "overflow-y-auto"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-chart-components",
3
- "version": "0.0.336",
3
+ "version": "0.0.338",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -11,9 +11,10 @@
11
11
  "@trackunit/react-components": "*",
12
12
  "echarts": "^5.4.3",
13
13
  "echarts-for-react": "^3.0.2",
14
- "react": "^18.2.0",
14
+ "react": "18.3.1",
15
15
  "@trackunit/ui-design-tokens": "*"
16
16
  },
17
17
  "module": "./index.esm.js",
18
- "main": "./index.cjs.js"
19
- }
18
+ "main": "./index.cjs.js",
19
+ "types": "./index.esm.d.ts"
20
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface DonutChartProps {
3
2
  /**
4
3
  * The color to be used for the count portion in the chart.
@@ -45,5 +44,5 @@ interface DonutChartProps {
45
44
  @param {number} totalCount - The total count of the KPI to be displayed.
46
45
  @returns {JSX.Element} - A donut chart displaying the KPI count and total count.
47
46
  */
48
- export declare const KPIDonutChart: ({ dataTestId, loading, countColor, totalCountColor, count, totalCount, }: DonutChartProps) => JSX.Element;
47
+ export declare const KPIDonutChart: ({ dataTestId, loading, countColor, totalCountColor, count, totalCount, }: DonutChartProps) => import("react/jsx-runtime").JSX.Element;
49
48
  export {};
package/src/KPI/Kpi.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CommonProps } from "@trackunit/react-components";
3
2
  export interface KpiProps extends CommonProps {
4
3
  /**
@@ -72,4 +71,4 @@ export interface KpiProps extends CommonProps {
72
71
  * @param {boolean} inline - Boolean to control whether the KPI is displayed inline or not.
73
72
  * @returns {JSX.Element} Kpi component
74
73
  */
75
- export declare const Kpi: ({ className, dataTestId, showChart, count, description, totalCount, countColor, totalCountColor, suffix, inline, loading, }: KpiProps) => JSX.Element;
74
+ export declare const Kpi: ({ className, dataTestId, showChart, count, description, totalCount, countColor, totalCountColor, suffix, inline, loading, }: KpiProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface LegendItemProps {
3
2
  label?: string;
4
3
  selected?: boolean;
@@ -14,4 +13,4 @@ export interface LegendItemProps {
14
13
  * @param {LegendItem} props - The props for the LegendItem component
15
14
  * @returns {JSX.Element} LegendItem component
16
15
  */
17
- export declare const LegendItem: ({ className, label, disabled, selected, onClick, color, dataTestId }: LegendItemProps) => JSX.Element;
16
+ export declare const LegendItem: ({ className, label, disabled, selected, onClick, color, dataTestId }: LegendItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CommonProps } from "@trackunit/react-components";
3
2
  type Size = "compact" | "full";
4
3
  export interface ChartData<TProps extends object = object> {