@trackunit/react-components 1.5.34 → 1.5.36
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
|
@@ -206,7 +206,7 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
|
206
206
|
color: {
|
|
207
207
|
primary: ["bg-primary-100", "text-primary-700"],
|
|
208
208
|
secondary: ["bg-secondary-100", "text-secondary-700"],
|
|
209
|
-
neutral: ["bg-neutral-
|
|
209
|
+
neutral: ["bg-neutral-200", "text-neutral-700"],
|
|
210
210
|
black: ["bg-neutral-100", "text-neutral-700"],
|
|
211
211
|
white: ["bg-white", "text-neutral-600"],
|
|
212
212
|
info: ["bg-info-100", "text-info-700"],
|
|
@@ -219,7 +219,7 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
|
219
219
|
working: ["bg-working-100", "text-working-700"],
|
|
220
220
|
stopped: ["bg-stopped-100", "text-stopped-700"],
|
|
221
221
|
idle: ["bg-idle-100", "text-idle-700"],
|
|
222
|
-
unknown: ["bg-unknown-
|
|
222
|
+
unknown: ["bg-unknown-200", "text-unknown-700"],
|
|
223
223
|
moving: ["bg-neutral-100", "text-neutral-700"],
|
|
224
224
|
active: ["bg-neutral-100", "text-neutral-700"],
|
|
225
225
|
excessive_usage: ["bg-danger-100", "text-danger-700"],
|
|
@@ -232,7 +232,7 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
|
232
232
|
defaultVariants: {
|
|
233
233
|
size: "medium",
|
|
234
234
|
layout: "default",
|
|
235
|
-
color: "
|
|
235
|
+
color: "info",
|
|
236
236
|
},
|
|
237
237
|
});
|
|
238
238
|
const cvaTagText = cssClassVarianceUtilities.cvaMerge(["truncate"]);
|
|
@@ -252,9 +252,9 @@ const cvaTagIcon = cssClassVarianceUtilities.cvaMerge(["cursor-pointer", "transi
|
|
|
252
252
|
* @param {TagProps} props - The props for the Tag component.
|
|
253
253
|
* @returns {ReactElement} The rendered Tag component.
|
|
254
254
|
*/
|
|
255
|
-
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "
|
|
255
|
+
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "info", disabled = false, ref, icon, onMouseEnter, }) => {
|
|
256
256
|
const isSupportedDismissColor = react.useMemo(() => {
|
|
257
|
-
if (color === "neutral" || color === "primary" || color === "white") {
|
|
257
|
+
if (color === "neutral" || color === "primary" || color === "white" || color === "info") {
|
|
258
258
|
return true;
|
|
259
259
|
}
|
|
260
260
|
return false;
|
|
@@ -2875,7 +2875,7 @@ const LoadingContent$1 = () => (jsxRuntime.jsx("div", { className: "flex h-11 fl
|
|
|
2875
2875
|
* @param {KPIProps} props - The props for the KPI component
|
|
2876
2876
|
* @returns {ReactElement} KPI component
|
|
2877
2877
|
*/
|
|
2878
|
-
const KPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, variant = "default", trend, iconName, iconColor = "
|
|
2878
|
+
const KPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, variant = "default", trend, iconName, iconColor = "info", ...rest }) => {
|
|
2879
2879
|
const isSmallVariant = variant === "small";
|
|
2880
2880
|
return (jsxRuntime.jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom", children: jsxRuntime.jsx("div", { className: cvaKPI({ variant, className }), "data-testid": dataTestId ? `${dataTestId}` : undefined, ...rest, children: loading ? (jsxRuntime.jsx(LoadingContent$1, {})) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: cvaKPIHeader(), children: jsxRuntime.jsx(Text, { className: cvaKPITitleText(), dataTestId: dataTestId ? `${dataTestId}-title` : undefined, size: isSmallVariant ? "small" : "medium", subtle: true, weight: isSmallVariant ? "normal" : "bold", children: title }) }), jsxRuntime.jsx(Text, { className: cvaKPIvalueText({ variant }), dataTestId: dataTestId ? `${dataTestId}-value` : undefined, size: isSmallVariant ? "small" : "large", type: "div", weight: isSmallVariant ? "bold" : "thick", children: jsxRuntime.jsxs("div", { className: cvaKPIValueContainer({
|
|
2881
2881
|
isDefaultAndHasTrendValue: Boolean(trend?.value && !isSmallVariant),
|
|
@@ -2922,10 +2922,11 @@ const cvaKPICard = cssClassVarianceUtilities.cvaMerge([
|
|
|
2922
2922
|
const cvaKPIIconContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "justify-center", "w-7", "h-7", "rounded-md", "text-white"], {
|
|
2923
2923
|
variants: {
|
|
2924
2924
|
iconColor: {
|
|
2925
|
-
primary: ["bg-primary-600"],
|
|
2926
2925
|
success: ["bg-success-600"],
|
|
2927
2926
|
warning: ["bg-warning-500"],
|
|
2928
2927
|
danger: ["bg-danger-600"],
|
|
2928
|
+
info: ["bg-info-600"],
|
|
2929
|
+
neutral: ["bg-neutral-600"],
|
|
2929
2930
|
},
|
|
2930
2931
|
},
|
|
2931
2932
|
});
|
|
@@ -2944,7 +2945,7 @@ const KPICard = ({ isActive, onClick, className, dataTestId, children, ...rest }
|
|
|
2944
2945
|
minHeight: rest.trend ? "withTrends" : "default",
|
|
2945
2946
|
variant: rest.variant,
|
|
2946
2947
|
className,
|
|
2947
|
-
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className: tailwindMerge.twMerge(rest.iconName ? "grid grid-cols-[1fr_auto] gap-2" : ""), density: "kpi", children: [jsxRuntime.jsx(KPI, { ...rest, className: tailwindMerge.twMerge(rest.iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined }), rest.iconName ? (jsxRuntime.jsx("div", { className: cvaKPIIconContainer({ iconColor: rest.iconColor ?? "
|
|
2948
|
+
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className: tailwindMerge.twMerge(rest.iconName ? "grid grid-cols-[1fr_auto] gap-2" : ""), density: "kpi", children: [jsxRuntime.jsx(KPI, { ...rest, className: tailwindMerge.twMerge(rest.iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined }), rest.iconName ? (jsxRuntime.jsx("div", { className: cvaKPIIconContainer({ iconColor: rest.iconColor ?? "info" }), children: jsxRuntime.jsx(Icon, { name: rest.iconName, size: "small", type: "solid" }) })) : null, children] }) }));
|
|
2948
2949
|
};
|
|
2949
2950
|
|
|
2950
2951
|
const cvaMenuList = cssClassVarianceUtilities.cvaMerge([
|
package/index.esm.js
CHANGED
|
@@ -204,7 +204,7 @@ const cvaTag = cvaMerge([
|
|
|
204
204
|
color: {
|
|
205
205
|
primary: ["bg-primary-100", "text-primary-700"],
|
|
206
206
|
secondary: ["bg-secondary-100", "text-secondary-700"],
|
|
207
|
-
neutral: ["bg-neutral-
|
|
207
|
+
neutral: ["bg-neutral-200", "text-neutral-700"],
|
|
208
208
|
black: ["bg-neutral-100", "text-neutral-700"],
|
|
209
209
|
white: ["bg-white", "text-neutral-600"],
|
|
210
210
|
info: ["bg-info-100", "text-info-700"],
|
|
@@ -217,7 +217,7 @@ const cvaTag = cvaMerge([
|
|
|
217
217
|
working: ["bg-working-100", "text-working-700"],
|
|
218
218
|
stopped: ["bg-stopped-100", "text-stopped-700"],
|
|
219
219
|
idle: ["bg-idle-100", "text-idle-700"],
|
|
220
|
-
unknown: ["bg-unknown-
|
|
220
|
+
unknown: ["bg-unknown-200", "text-unknown-700"],
|
|
221
221
|
moving: ["bg-neutral-100", "text-neutral-700"],
|
|
222
222
|
active: ["bg-neutral-100", "text-neutral-700"],
|
|
223
223
|
excessive_usage: ["bg-danger-100", "text-danger-700"],
|
|
@@ -230,7 +230,7 @@ const cvaTag = cvaMerge([
|
|
|
230
230
|
defaultVariants: {
|
|
231
231
|
size: "medium",
|
|
232
232
|
layout: "default",
|
|
233
|
-
color: "
|
|
233
|
+
color: "info",
|
|
234
234
|
},
|
|
235
235
|
});
|
|
236
236
|
const cvaTagText = cvaMerge(["truncate"]);
|
|
@@ -250,9 +250,9 @@ const cvaTagIcon = cvaMerge(["cursor-pointer", "transition-opacity", "hover:opac
|
|
|
250
250
|
* @param {TagProps} props - The props for the Tag component.
|
|
251
251
|
* @returns {ReactElement} The rendered Tag component.
|
|
252
252
|
*/
|
|
253
|
-
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "
|
|
253
|
+
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "info", disabled = false, ref, icon, onMouseEnter, }) => {
|
|
254
254
|
const isSupportedDismissColor = useMemo(() => {
|
|
255
|
-
if (color === "neutral" || color === "primary" || color === "white") {
|
|
255
|
+
if (color === "neutral" || color === "primary" || color === "white" || color === "info") {
|
|
256
256
|
return true;
|
|
257
257
|
}
|
|
258
258
|
return false;
|
|
@@ -2873,7 +2873,7 @@ const LoadingContent$1 = () => (jsx("div", { className: "flex h-11 flex-row item
|
|
|
2873
2873
|
* @param {KPIProps} props - The props for the KPI component
|
|
2874
2874
|
* @returns {ReactElement} KPI component
|
|
2875
2875
|
*/
|
|
2876
|
-
const KPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, variant = "default", trend, iconName, iconColor = "
|
|
2876
|
+
const KPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, variant = "default", trend, iconName, iconColor = "info", ...rest }) => {
|
|
2877
2877
|
const isSmallVariant = variant === "small";
|
|
2878
2878
|
return (jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: !tooltipLabel, label: tooltipLabel, placement: "bottom", children: jsx("div", { className: cvaKPI({ variant, className }), "data-testid": dataTestId ? `${dataTestId}` : undefined, ...rest, children: loading ? (jsx(LoadingContent$1, {})) : (jsxs(Fragment, { children: [jsx("div", { className: cvaKPIHeader(), children: jsx(Text, { className: cvaKPITitleText(), dataTestId: dataTestId ? `${dataTestId}-title` : undefined, size: isSmallVariant ? "small" : "medium", subtle: true, weight: isSmallVariant ? "normal" : "bold", children: title }) }), jsx(Text, { className: cvaKPIvalueText({ variant }), dataTestId: dataTestId ? `${dataTestId}-value` : undefined, size: isSmallVariant ? "small" : "large", type: "div", weight: isSmallVariant ? "bold" : "thick", children: jsxs("div", { className: cvaKPIValueContainer({
|
|
2879
2879
|
isDefaultAndHasTrendValue: Boolean(trend?.value && !isSmallVariant),
|
|
@@ -2920,10 +2920,11 @@ const cvaKPICard = cvaMerge([
|
|
|
2920
2920
|
const cvaKPIIconContainer = cvaMerge(["flex", "items-center", "justify-center", "w-7", "h-7", "rounded-md", "text-white"], {
|
|
2921
2921
|
variants: {
|
|
2922
2922
|
iconColor: {
|
|
2923
|
-
primary: ["bg-primary-600"],
|
|
2924
2923
|
success: ["bg-success-600"],
|
|
2925
2924
|
warning: ["bg-warning-500"],
|
|
2926
2925
|
danger: ["bg-danger-600"],
|
|
2926
|
+
info: ["bg-info-600"],
|
|
2927
|
+
neutral: ["bg-neutral-600"],
|
|
2927
2928
|
},
|
|
2928
2929
|
},
|
|
2929
2930
|
});
|
|
@@ -2942,7 +2943,7 @@ const KPICard = ({ isActive, onClick, className, dataTestId, children, ...rest }
|
|
|
2942
2943
|
minHeight: rest.trend ? "withTrends" : "default",
|
|
2943
2944
|
variant: rest.variant,
|
|
2944
2945
|
className,
|
|
2945
|
-
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxs(CardBody, { className: twMerge(rest.iconName ? "grid grid-cols-[1fr_auto] gap-2" : ""), density: "kpi", children: [jsx(KPI, { ...rest, className: twMerge(rest.iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined }), rest.iconName ? (jsx("div", { className: cvaKPIIconContainer({ iconColor: rest.iconColor ?? "
|
|
2946
|
+
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxs(CardBody, { className: twMerge(rest.iconName ? "grid grid-cols-[1fr_auto] gap-2" : ""), density: "kpi", children: [jsx(KPI, { ...rest, className: twMerge(rest.iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined }), rest.iconName ? (jsx("div", { className: cvaKPIIconContainer({ iconColor: rest.iconColor ?? "info" }), children: jsx(Icon, { name: rest.iconName, size: "small", type: "solid" }) })) : null, children] }) }));
|
|
2946
2947
|
};
|
|
2947
2948
|
|
|
2948
2949
|
const cvaMenuList = cvaMerge([
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ export interface KPIProps extends CommonProps {
|
|
|
33
33
|
/**
|
|
34
34
|
* The color of the icon
|
|
35
35
|
*/
|
|
36
|
-
iconColor?: "
|
|
36
|
+
iconColor?: "success" | "warning" | "danger" | "info" | "neutral";
|
|
37
37
|
/**
|
|
38
38
|
* The trend of the KPI Card
|
|
39
39
|
*/
|
|
@@ -21,7 +21,7 @@ export interface KPICardProps extends KPIProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* The color of the icon
|
|
23
23
|
*/
|
|
24
|
-
iconColor?: "
|
|
24
|
+
iconColor?: "success" | "warning" | "danger" | "info" | "neutral";
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* The KPICard component is used to display KPIs.
|
|
@@ -5,5 +5,5 @@ export declare const cvaKPICard: (props?: ({
|
|
|
5
5
|
variant?: "default" | "small" | "condensed" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export declare const cvaKPIIconContainer: (props?: ({
|
|
8
|
-
iconColor?: "
|
|
8
|
+
iconColor?: "success" | "warning" | "danger" | "info" | "neutral" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|