@trackunit/react-widgets 2.1.73 → 2.1.75
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 +4 -4
- package/index.esm.js +5 -5
- package/package.json +10 -10
- package/src/WidgetList/WidgetList.variants.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -302,11 +302,11 @@ const cvaWidgetKPIValueContainer = cssClassVarianceUtilities.cvaMerge(["truncate
|
|
|
302
302
|
* @param {WidgetKPIProps} props - The props for the WidgetKPI component
|
|
303
303
|
* @returns {ReactElement} WidgetKPI component
|
|
304
304
|
*/
|
|
305
|
-
const WidgetKPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
305
|
+
const WidgetKPI = ({ title, value, loading = false, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
306
306
|
return (jsxRuntime.jsx("div", { className: cvaWidgetKPI({ className }), "data-testid": dataTestId ? `${dataTestId}` : undefined, ...rest, children: loading ? (jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pt-6", "data-testid": dataTestId ? `${dataTestId}-loading` : "WidgetKPI-loading", children: trend ? (jsxRuntime.jsx(reactComponents.SkeletonLines, { height: [16, 24, 16], lines: 3, margin: "6px 0", width: [100, 40, 60] })) : (jsxRuntime.jsx(reactComponents.SkeletonLines, { height: [16, 24], lines: 2, margin: "6px 0", width: [100, 40] })) })) : (jsxRuntime.jsxs("div", { className: "flex h-full flex-col justify-between", children: [jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsx("div", { className: cvaWidgetKPIHeader(), children: jsxRuntime.jsxs("div", { className: "flex items-start gap-1", children: [iconName ? (jsxRuntime.jsx(reactComponents.Icon, { className: "flex-shrink-0 py-0.5", color: iconColor, name: iconName, size: "small" })) : null, jsxRuntime.jsx(reactComponents.Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom-start", children: jsxRuntime.jsx(reactComponents.Text, { className: cvaWidgetKPITitleText(), dataTestId: dataTestId ? `${dataTestId}-title` : undefined, children: title }) })] }) }), jsxRuntime.jsx("div", { className: "flex items-end", children: jsxRuntime.jsx(reactComponents.Text, { className: cvaWidgetKPIvalueText(), dataTestId: dataTestId ? `${dataTestId}-value` : undefined, type: "div", children: jsxRuntime.jsx("div", { className: cvaWidgetKPIValueContainer({
|
|
307
307
|
isDefaultAndHasTrendValue: Boolean(trend?.value),
|
|
308
308
|
className,
|
|
309
|
-
}), children: jsxRuntime.jsxs("span", { className: cvaWidgetKPIvalueText(), children: [value, " ", unit] }) }) }) })] }), trend ? (jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: jsxRuntime.jsx(TrendIndicator, { isSmallVariant: false, trend: trend, unit: unit }) })) : notice ? (jsxRuntime.jsx("div", { className: cvaWidgetKPINotice(), children: typeof notice === "string" || typeof notice === "number" ? jsxRuntime.jsx("span", { children: notice }) : notice })) : null] })) }));
|
|
309
|
+
}), children: jsxRuntime.jsxs("span", { className: cvaWidgetKPIvalueText(), children: [value, " ", unit] }) }) }) })] }), trend ? (jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: jsxRuntime.jsx(TrendIndicator, { isSmallVariant: false, trend: trend, unit: unit }) })) : notice !== undefined ? (jsxRuntime.jsx("div", { className: cvaWidgetKPINotice(), children: typeof notice === "string" || typeof notice === "number" ? jsxRuntime.jsx("span", { children: notice }) : notice })) : null] })) }));
|
|
310
310
|
};
|
|
311
311
|
const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
312
312
|
if (!trend) {
|
|
@@ -316,7 +316,7 @@ const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
const cvaWidgetList = cssClassVarianceUtilities.cvaMerge(["min-h-0"]);
|
|
319
|
-
const
|
|
319
|
+
const cvaWidgetListList = cssClassVarianceUtilities.cvaMerge(["w-full"]);
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
322
|
* WidgetList used for rendering a list of in a widget. It is a wrapper component for the ListItem components.
|
|
@@ -325,7 +325,7 @@ const cvaWidgetListVirtualizedList = cssClassVarianceUtilities.cvaMerge(["w-full
|
|
|
325
325
|
* @returns {Element} WidgetList component
|
|
326
326
|
*/
|
|
327
327
|
const WidgetList = ({ dataTestId, pagination, count, children, className, rowHeight = 56, scrollRef, }) => {
|
|
328
|
-
return (jsxRuntime.jsx("div", { className: cvaWidgetList({ className }), children: jsxRuntime.jsx(reactComponents.
|
|
328
|
+
return (jsxRuntime.jsx("div", { className: cvaWidgetList({ className }), children: jsxRuntime.jsx(reactComponents.List, { className: cvaWidgetListList(), count: count, dataTestId: dataTestId, loadingIndicator: "skeletonLines", pagination: pagination, rowHeight: rowHeight, scrollRef: scrollRef, separator: "line", skeletonLinesHeight: `${rowHeight / 3}px`, children: index => {
|
|
329
329
|
return children(index);
|
|
330
330
|
} }) }));
|
|
331
331
|
};
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { EmptyState, useScrollDetection, Card, CardHeader, CardBody, CardFooter, Button, SkeletonLines, Icon, Tooltip, Text,
|
|
3
|
+
import { EmptyState, useScrollDetection, Card, CardHeader, CardBody, CardFooter, Button, SkeletonLines, Icon, Tooltip, Text, List } from '@trackunit/react-components';
|
|
4
4
|
import { Children, Fragment, useState } from 'react';
|
|
5
5
|
import { WidgetConfigRuntime } from '@trackunit/iris-app-runtime-core';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
@@ -300,11 +300,11 @@ const cvaWidgetKPIValueContainer = cvaMerge(["truncate", "whitespace-nowrap"], {
|
|
|
300
300
|
* @param {WidgetKPIProps} props - The props for the WidgetKPI component
|
|
301
301
|
* @returns {ReactElement} WidgetKPI component
|
|
302
302
|
*/
|
|
303
|
-
const WidgetKPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
303
|
+
const WidgetKPI = ({ title, value, loading = false, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
304
304
|
return (jsx("div", { className: cvaWidgetKPI({ className }), "data-testid": dataTestId ? `${dataTestId}` : undefined, ...rest, children: loading ? (jsx("div", { className: "flex flex-col gap-2 pt-6", "data-testid": dataTestId ? `${dataTestId}-loading` : "WidgetKPI-loading", children: trend ? (jsx(SkeletonLines, { height: [16, 24, 16], lines: 3, margin: "6px 0", width: [100, 40, 60] })) : (jsx(SkeletonLines, { height: [16, 24], lines: 2, margin: "6px 0", width: [100, 40] })) })) : (jsxs("div", { className: "flex h-full flex-col justify-between", children: [jsxs("div", { className: "flex flex-col gap-1", children: [jsx("div", { className: cvaWidgetKPIHeader(), children: jsxs("div", { className: "flex items-start gap-1", children: [iconName ? (jsx(Icon, { className: "flex-shrink-0 py-0.5", color: iconColor, name: iconName, size: "small" })) : null, jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom-start", children: jsx(Text, { className: cvaWidgetKPITitleText(), dataTestId: dataTestId ? `${dataTestId}-title` : undefined, children: title }) })] }) }), jsx("div", { className: "flex items-end", children: jsx(Text, { className: cvaWidgetKPIvalueText(), dataTestId: dataTestId ? `${dataTestId}-value` : undefined, type: "div", children: jsx("div", { className: cvaWidgetKPIValueContainer({
|
|
305
305
|
isDefaultAndHasTrendValue: Boolean(trend?.value),
|
|
306
306
|
className,
|
|
307
|
-
}), children: jsxs("span", { className: cvaWidgetKPIvalueText(), children: [value, " ", unit] }) }) }) })] }), trend ? (jsx("div", { className: "flex items-center gap-1", children: jsx(TrendIndicator, { isSmallVariant: false, trend: trend, unit: unit }) })) : notice ? (jsx("div", { className: cvaWidgetKPINotice(), children: typeof notice === "string" || typeof notice === "number" ? jsx("span", { children: notice }) : notice })) : null] })) }));
|
|
307
|
+
}), children: jsxs("span", { className: cvaWidgetKPIvalueText(), children: [value, " ", unit] }) }) }) })] }), trend ? (jsx("div", { className: "flex items-center gap-1", children: jsx(TrendIndicator, { isSmallVariant: false, trend: trend, unit: unit }) })) : notice !== undefined ? (jsx("div", { className: cvaWidgetKPINotice(), children: typeof notice === "string" || typeof notice === "number" ? jsx("span", { children: notice }) : notice })) : null] })) }));
|
|
308
308
|
};
|
|
309
309
|
const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
310
310
|
if (!trend) {
|
|
@@ -314,7 +314,7 @@ const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
|
314
314
|
};
|
|
315
315
|
|
|
316
316
|
const cvaWidgetList = cvaMerge(["min-h-0"]);
|
|
317
|
-
const
|
|
317
|
+
const cvaWidgetListList = cvaMerge(["w-full"]);
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
320
|
* WidgetList used for rendering a list of in a widget. It is a wrapper component for the ListItem components.
|
|
@@ -323,7 +323,7 @@ const cvaWidgetListVirtualizedList = cvaMerge(["w-full"]);
|
|
|
323
323
|
* @returns {Element} WidgetList component
|
|
324
324
|
*/
|
|
325
325
|
const WidgetList = ({ dataTestId, pagination, count, children, className, rowHeight = 56, scrollRef, }) => {
|
|
326
|
-
return (jsx("div", { className: cvaWidgetList({ className }), children: jsx(
|
|
326
|
+
return (jsx("div", { className: cvaWidgetList({ className }), children: jsx(List, { className: cvaWidgetListList(), count: count, dataTestId: dataTestId, loadingIndicator: "skeletonLines", pagination: pagination, rowHeight: rowHeight, scrollRef: scrollRef, separator: "line", skeletonLinesHeight: `${rowHeight / 3}px`, children: index => {
|
|
327
327
|
return children(index);
|
|
328
328
|
} }) }));
|
|
329
329
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-widgets",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.75",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.8.
|
|
12
|
-
"@trackunit/iris-app-runtime-core": "1.7.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.6.
|
|
14
|
-
"@trackunit/ui-design-tokens": "1.6.
|
|
15
|
-
"@trackunit/ui-icons": "1.6.
|
|
16
|
-
"@trackunit/react-table-pagination": "1.6.
|
|
17
|
-
"@trackunit/shared-utils": "1.8.
|
|
18
|
-
"@trackunit/i18n-library-translation": "1.6.
|
|
19
|
-
"@trackunit/react-test-setup": "1.3.
|
|
11
|
+
"@trackunit/react-components": "1.8.24",
|
|
12
|
+
"@trackunit/iris-app-runtime-core": "1.7.52",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.6.50",
|
|
14
|
+
"@trackunit/ui-design-tokens": "1.6.52",
|
|
15
|
+
"@trackunit/ui-icons": "1.6.49",
|
|
16
|
+
"@trackunit/react-table-pagination": "1.6.49",
|
|
17
|
+
"@trackunit/shared-utils": "1.8.50",
|
|
18
|
+
"@trackunit/i18n-library-translation": "1.6.54",
|
|
19
|
+
"@trackunit/react-test-setup": "1.3.50"
|
|
20
20
|
},
|
|
21
21
|
"module": "./index.esm.js",
|
|
22
22
|
"main": "./index.cjs.js",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const cvaWidgetList: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const cvaWidgetListList: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|