@trackunit/react-widgets 2.2.119 → 2.2.121
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
|
@@ -186,7 +186,7 @@ const cvaWidgetContent = cssClassVarianceUtilities.cvaMerge(["@container", "over
|
|
|
186
186
|
* @param {WidgetContentProps} props - The props for the WidgetContent component
|
|
187
187
|
* @returns {ReactNode} WidgetContent component
|
|
188
188
|
*/
|
|
189
|
-
const WidgetContent = ({ children, dataTestId, layout = "none", padding = "none", gap = "none", className, centering = "none", }) => {
|
|
189
|
+
const WidgetContent = ({ children, "data-testid": dataTestId, layout = "none", padding = "none", gap = "none", className, centering = "none", }) => {
|
|
190
190
|
return (jsxRuntime.jsx("div", { className: cvaWidgetContent({ layout, padding, gap, className, centering }), "data-testid": dataTestId, children: children }));
|
|
191
191
|
};
|
|
192
192
|
|
|
@@ -221,7 +221,7 @@ const cvaWidgetEditBodyDensityContainer = cssClassVarianceUtilities.cvaMerge(["a
|
|
|
221
221
|
* @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
|
|
222
222
|
* @returns {ReactNode} WidgetEditBody component
|
|
223
223
|
*/
|
|
224
|
-
const WidgetEditBody = ({ children, dataTestId, className, onCancel, onSave, saveEditModeDisabled = false, title, }) => {
|
|
224
|
+
const WidgetEditBody = ({ children, "data-testid": dataTestId, className, onCancel, onSave, saveEditModeDisabled = false, title, }) => {
|
|
225
225
|
const [t] = useTranslation();
|
|
226
226
|
const [saving, setSaving] = React.useState(false);
|
|
227
227
|
return (jsxRuntime.jsxs(reactComponents.Card, { className: cvaWidgetEditBodyDensityContainer({ density: "none", className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(reactComponents.CardHeader, { density: "comfortable", heading: title || t("widget.edit.title"), onClose: onCancel }), jsxRuntime.jsx(reactComponents.CardBody, { density: "comfortable", children: children }), jsxRuntime.jsxs(reactComponents.CardFooter, { density: "comfortable", children: [jsxRuntime.jsx(reactComponents.Button, { onClick: onCancel, variant: "ghost-neutral", children: t("widget.edit.cancel") }), jsxRuntime.jsx(reactComponents.Button, { disabled: saveEditModeDisabled || saving, loading: saving, onClick: async () => {
|
|
@@ -307,8 +307,8 @@ const cvaWidgetKPIValueContainer = cssClassVarianceUtilities.cvaMerge(["truncate
|
|
|
307
307
|
* @param {WidgetKPIProps} props - The props for the WidgetKPI component
|
|
308
308
|
* @returns {ReactElement} WidgetKPI component
|
|
309
309
|
*/
|
|
310
|
-
const WidgetKPI = ({ title, value, loading = false, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
311
|
-
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, { gap: 6, height: [16, 24, 16], lines: 3, width: [100, 40, 60] })) : (jsxRuntime.jsx(reactComponents.SkeletonLines, { gap: 6, height: [16, 24], lines: 2, 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, {
|
|
310
|
+
const WidgetKPI = ({ title, value, loading = false, unit, className, "data-testid": dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
311
|
+
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, { gap: 6, height: [16, 24, 16], lines: 3, width: [100, 40, 60] })) : (jsxRuntime.jsx(reactComponents.SkeletonLines, { gap: 6, height: [16, 24], lines: 2, 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, { "data-testid": dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom-start", children: jsxRuntime.jsx(reactComponents.Text, { className: cvaWidgetKPITitleText(), "data-testid": dataTestId ? `${dataTestId}-title` : undefined, children: title }) })] }) }), jsxRuntime.jsx("div", { className: "flex items-end", children: jsxRuntime.jsx(reactComponents.Text, { className: cvaWidgetKPIvalueText(), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, type: "div", children: jsxRuntime.jsx("div", { className: cvaWidgetKPIValueContainer({
|
|
312
312
|
isDefaultAndHasTrendValue: Boolean(trend?.value),
|
|
313
313
|
className,
|
|
314
314
|
}), 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] })) }));
|
|
@@ -317,7 +317,7 @@ const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
|
317
317
|
if (!trend) {
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-0.5 overflow-hidden", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value ? (jsxRuntime.jsxs(reactComponents.Text, { className: cvaWidgetKPITrendValueText(),
|
|
320
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-0.5 overflow-hidden", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value ? (jsxRuntime.jsxs(reactComponents.Text, { className: cvaWidgetKPITrendValueText(), "data-testid": "trend-value", size: "small", weight: "normal", children: [trend.value, " ", unit] })) : null, trend.variant?.icon ? jsxRuntime.jsx(reactComponents.Icon, { color: trend.variant.color, name: trend.variant.icon, size: "small" }) : null, trend.percentage ? (jsxRuntime.jsxs(reactComponents.Text, { className: cvaWidgetKPITrendPercentage({ color: trend.variant?.color }), children: [trend.percentage, "%"] })) : null] }));
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
/*
|
package/index.esm.js
CHANGED
|
@@ -184,7 +184,7 @@ const cvaWidgetContent = cvaMerge(["@container", "overflow-hidden", "h-full", "w
|
|
|
184
184
|
* @param {WidgetContentProps} props - The props for the WidgetContent component
|
|
185
185
|
* @returns {ReactNode} WidgetContent component
|
|
186
186
|
*/
|
|
187
|
-
const WidgetContent = ({ children, dataTestId, layout = "none", padding = "none", gap = "none", className, centering = "none", }) => {
|
|
187
|
+
const WidgetContent = ({ children, "data-testid": dataTestId, layout = "none", padding = "none", gap = "none", className, centering = "none", }) => {
|
|
188
188
|
return (jsx("div", { className: cvaWidgetContent({ layout, padding, gap, className, centering }), "data-testid": dataTestId, children: children }));
|
|
189
189
|
};
|
|
190
190
|
|
|
@@ -219,7 +219,7 @@ const cvaWidgetEditBodyDensityContainer = cvaMerge(["absolute", "left-1/2", "top
|
|
|
219
219
|
* @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
|
|
220
220
|
* @returns {ReactNode} WidgetEditBody component
|
|
221
221
|
*/
|
|
222
|
-
const WidgetEditBody = ({ children, dataTestId, className, onCancel, onSave, saveEditModeDisabled = false, title, }) => {
|
|
222
|
+
const WidgetEditBody = ({ children, "data-testid": dataTestId, className, onCancel, onSave, saveEditModeDisabled = false, title, }) => {
|
|
223
223
|
const [t] = useTranslation();
|
|
224
224
|
const [saving, setSaving] = useState(false);
|
|
225
225
|
return (jsxs(Card, { className: cvaWidgetEditBodyDensityContainer({ density: "none", className }), "data-testid": dataTestId, children: [jsx(CardHeader, { density: "comfortable", heading: title || t("widget.edit.title"), onClose: onCancel }), jsx(CardBody, { density: "comfortable", children: children }), jsxs(CardFooter, { density: "comfortable", children: [jsx(Button, { onClick: onCancel, variant: "ghost-neutral", children: t("widget.edit.cancel") }), jsx(Button, { disabled: saveEditModeDisabled || saving, loading: saving, onClick: async () => {
|
|
@@ -305,8 +305,8 @@ const cvaWidgetKPIValueContainer = cvaMerge(["truncate", "whitespace-nowrap"], {
|
|
|
305
305
|
* @param {WidgetKPIProps} props - The props for the WidgetKPI component
|
|
306
306
|
* @returns {ReactElement} WidgetKPI component
|
|
307
307
|
*/
|
|
308
|
-
const WidgetKPI = ({ title, value, loading = false, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
309
|
-
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, { gap: 6, height: [16, 24, 16], lines: 3, width: [100, 40, 60] })) : (jsx(SkeletonLines, { gap: 6, height: [16, 24], lines: 2, 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, {
|
|
308
|
+
const WidgetKPI = ({ title, value, loading = false, unit, className, "data-testid": dataTestId, tooltipLabel, trend, iconName, iconColor = "info", notice, ...rest }) => {
|
|
309
|
+
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, { gap: 6, height: [16, 24, 16], lines: 3, width: [100, 40, 60] })) : (jsx(SkeletonLines, { gap: 6, height: [16, 24], lines: 2, 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, { "data-testid": dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom-start", children: jsx(Text, { className: cvaWidgetKPITitleText(), "data-testid": dataTestId ? `${dataTestId}-title` : undefined, children: title }) })] }) }), jsx("div", { className: "flex items-end", children: jsx(Text, { className: cvaWidgetKPIvalueText(), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, type: "div", children: jsx("div", { className: cvaWidgetKPIValueContainer({
|
|
310
310
|
isDefaultAndHasTrendValue: Boolean(trend?.value),
|
|
311
311
|
className,
|
|
312
312
|
}), 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] })) }));
|
|
@@ -315,7 +315,7 @@ const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
|
315
315
|
if (!trend) {
|
|
316
316
|
return null;
|
|
317
317
|
}
|
|
318
|
-
return (jsxs("div", { className: "flex flex-row items-center gap-0.5 overflow-hidden", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value ? (jsxs(Text, { className: cvaWidgetKPITrendValueText(),
|
|
318
|
+
return (jsxs("div", { className: "flex flex-row items-center gap-0.5 overflow-hidden", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value ? (jsxs(Text, { className: cvaWidgetKPITrendValueText(), "data-testid": "trend-value", size: "small", weight: "normal", children: [trend.value, " ", unit] })) : null, trend.variant?.icon ? jsx(Icon, { color: trend.variant.color, name: trend.variant.icon, size: "small" }) : null, trend.percentage ? (jsxs(Text, { className: cvaWidgetKPITrendPercentage({ color: trend.variant?.color }), children: [trend.percentage, "%"] })) : null] }));
|
|
319
319
|
};
|
|
320
320
|
|
|
321
321
|
/*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-widgets",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.121",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.10.
|
|
12
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
14
|
-
"@trackunit/ui-design-tokens": "1.7.
|
|
15
|
-
"@trackunit/ui-icons": "1.7.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
11
|
+
"@trackunit/react-components": "1.10.51",
|
|
12
|
+
"@trackunit/iris-app-runtime-core": "1.8.86",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.7.77",
|
|
14
|
+
"@trackunit/ui-design-tokens": "1.7.77",
|
|
15
|
+
"@trackunit/ui-icons": "1.7.78",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.7.94"
|
|
17
17
|
},
|
|
18
18
|
"module": "./index.esm.js",
|
|
19
19
|
"main": "./index.cjs.js",
|
|
@@ -41,4 +41,4 @@ export interface WidgetContentProps extends CommonProps {
|
|
|
41
41
|
* @param {WidgetContentProps} props - The props for the WidgetContent component
|
|
42
42
|
* @returns {ReactNode} WidgetContent component
|
|
43
43
|
*/
|
|
44
|
-
export declare const WidgetContent: ({ children, dataTestId, layout, padding, gap, className, centering, }: WidgetContentProps) => ReactElement;
|
|
44
|
+
export declare const WidgetContent: ({ children, "data-testid": dataTestId, layout, padding, gap, className, centering, }: WidgetContentProps) => ReactElement;
|
|
@@ -30,4 +30,4 @@ export interface WidgetEditBodyProps extends CommonProps {
|
|
|
30
30
|
* @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
|
|
31
31
|
* @returns {ReactNode} WidgetEditBody component
|
|
32
32
|
*/
|
|
33
|
-
export declare const WidgetEditBody: ({ children, dataTestId, className, onCancel, onSave, saveEditModeDisabled, title, }: WidgetEditBodyProps) => ReactElement;
|
|
33
|
+
export declare const WidgetEditBody: ({ children, "data-testid": dataTestId, className, onCancel, onSave, saveEditModeDisabled, title, }: WidgetEditBodyProps) => ReactElement;
|
|
@@ -70,4 +70,4 @@ export interface WidgetKPIProps extends CommonProps {
|
|
|
70
70
|
* @param {WidgetKPIProps} props - The props for the WidgetKPI component
|
|
71
71
|
* @returns {ReactElement} WidgetKPI component
|
|
72
72
|
*/
|
|
73
|
-
export declare const WidgetKPI: ({ title, value, loading, unit, className, dataTestId, tooltipLabel, trend, iconName, iconColor, notice, ...rest }: WidgetKPIProps) => ReactElement;
|
|
73
|
+
export declare const WidgetKPI: ({ title, value, loading, unit, className, "data-testid": dataTestId, tooltipLabel, trend, iconName, iconColor, notice, ...rest }: WidgetKPIProps) => ReactElement;
|