@trackunit/react-components 0.5.30 → 0.5.31
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 +2 -3
- package/index.esm.js +2 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -3229,7 +3229,7 @@ var ForwardRef = /*#__PURE__*/React.forwardRef(SvgWorkerWithSign);
|
|
|
3229
3229
|
* - For guidance purposes (e.g., onboarding, adjusting filters, exploring alternative approaches).
|
|
3230
3230
|
* - In celebratory instances (e.g., no new notifications, services up to date).
|
|
3231
3231
|
*/
|
|
3232
|
-
const EmptyState = ({ description, altText, image = "
|
|
3232
|
+
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading, dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, }) => {
|
|
3233
3233
|
var _a, _b, _c;
|
|
3234
3234
|
const ImageSource = React.useMemo(() => {
|
|
3235
3235
|
switch (image) {
|
|
@@ -3244,9 +3244,8 @@ const EmptyState = ({ description, altText, image = "WORKER_WITH_SIGN", customIm
|
|
|
3244
3244
|
case "PHONE_LOCK_SECURITY":
|
|
3245
3245
|
return ForwardRef$4;
|
|
3246
3246
|
case "SEARCH_DOCUMENT":
|
|
3247
|
-
return ForwardRef$2;
|
|
3248
3247
|
default:
|
|
3249
|
-
return ForwardRef;
|
|
3248
|
+
return ForwardRef$2;
|
|
3250
3249
|
}
|
|
3251
3250
|
}, [image]);
|
|
3252
3251
|
return (jsxRuntime.jsx("div", { className: cvaContainerStyles({ className }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : "empty-state", children: loading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Spinner, { centering: "centered", dataTestId: "spinner" }), jsxRuntime.jsx(SkeletonLines, { dataTestId: "skeleton-lines", width: 50 })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [customImageSrc ? (jsxRuntime.jsx("img", { alt: altText, className: cvaImgStyles(), height: 200, src: customImageSrc, width: 200 })) : (typeof ImageSource !== "undefined" && (jsxRuntime.jsx(ImageSource, { "data-testid": "empty-state-image", height: 200, width: 200 }, image))), description ? (jsxRuntime.jsx(Text, { align: "center", size: "large", children: description })) : null, jsxRuntime.jsxs("div", { className: "grid gap-3", children: [jsxRuntime.jsxs("div", { className: "flex gap-3", children: [secondaryAction ? (jsxRuntime.jsx(Button, { dataTestId: "empty-state-secondary-button", disabled: secondaryAction.disabled, onClick: secondaryAction.onClick, variant: "secondary", children: secondaryAction.to ? (jsxRuntime.jsx(reactRouter.Link, { params: secondaryAction.to.parameters, to: secondaryAction.to.pathname, children: secondaryAction.title })) : (secondaryAction.title) })) : null, primaryAction ? (jsxRuntime.jsx(Button, { dataTestId: "empty-state-primary-button", disabled: primaryAction.disabled, onClick: primaryAction.onClick, children: primaryAction.to ? (jsxRuntime.jsx(reactRouter.Link, { params: primaryAction.to.parameters, to: primaryAction.to.pathname, children: primaryAction.title })) : (primaryAction.title) })) : null] }), additionalHelpAction ? (jsxRuntime.jsx(Button, { asChild: true, dataTestId: "empty-state-additional-button", disabled: additionalHelpAction.disabled, onClick: additionalHelpAction.onClick, suffix: jsxRuntime.jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" }), variant: "ghost", children: jsxRuntime.jsx(reactRouter.Link, { params: (_a = additionalHelpAction.to) === null || _a === void 0 ? void 0 : _a.parameters, target: (_b = additionalHelpAction.to) === null || _b === void 0 ? void 0 : _b.target, to: (_c = additionalHelpAction.to) === null || _c === void 0 ? void 0 : _c.pathname, children: additionalHelpAction.title }) })) : null] })] })) }));
|
package/index.esm.js
CHANGED
|
@@ -3209,7 +3209,7 @@ var ForwardRef = /*#__PURE__*/forwardRef(SvgWorkerWithSign);
|
|
|
3209
3209
|
* - For guidance purposes (e.g., onboarding, adjusting filters, exploring alternative approaches).
|
|
3210
3210
|
* - In celebratory instances (e.g., no new notifications, services up to date).
|
|
3211
3211
|
*/
|
|
3212
|
-
const EmptyState = ({ description, altText, image = "
|
|
3212
|
+
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading, dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, }) => {
|
|
3213
3213
|
var _a, _b, _c;
|
|
3214
3214
|
const ImageSource = useMemo(() => {
|
|
3215
3215
|
switch (image) {
|
|
@@ -3224,9 +3224,8 @@ const EmptyState = ({ description, altText, image = "WORKER_WITH_SIGN", customIm
|
|
|
3224
3224
|
case "PHONE_LOCK_SECURITY":
|
|
3225
3225
|
return ForwardRef$4;
|
|
3226
3226
|
case "SEARCH_DOCUMENT":
|
|
3227
|
-
return ForwardRef$2;
|
|
3228
3227
|
default:
|
|
3229
|
-
return ForwardRef;
|
|
3228
|
+
return ForwardRef$2;
|
|
3230
3229
|
}
|
|
3231
3230
|
}, [image]);
|
|
3232
3231
|
return (jsx("div", { className: cvaContainerStyles({ className }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : "empty-state", children: loading ? (jsxs(Fragment, { children: [jsx(Spinner, { centering: "centered", dataTestId: "spinner" }), jsx(SkeletonLines, { dataTestId: "skeleton-lines", width: 50 })] })) : (jsxs(Fragment, { children: [customImageSrc ? (jsx("img", { alt: altText, className: cvaImgStyles(), height: 200, src: customImageSrc, width: 200 })) : (typeof ImageSource !== "undefined" && (jsx(ImageSource, { "data-testid": "empty-state-image", height: 200, width: 200 }, image))), description ? (jsx(Text, { align: "center", size: "large", children: description })) : null, jsxs("div", { className: "grid gap-3", children: [jsxs("div", { className: "flex gap-3", children: [secondaryAction ? (jsx(Button, { dataTestId: "empty-state-secondary-button", disabled: secondaryAction.disabled, onClick: secondaryAction.onClick, variant: "secondary", children: secondaryAction.to ? (jsx(Link, { params: secondaryAction.to.parameters, to: secondaryAction.to.pathname, children: secondaryAction.title })) : (secondaryAction.title) })) : null, primaryAction ? (jsx(Button, { dataTestId: "empty-state-primary-button", disabled: primaryAction.disabled, onClick: primaryAction.onClick, children: primaryAction.to ? (jsx(Link, { params: primaryAction.to.parameters, to: primaryAction.to.pathname, children: primaryAction.title })) : (primaryAction.title) })) : null] }), additionalHelpAction ? (jsx(Button, { asChild: true, dataTestId: "empty-state-additional-button", disabled: additionalHelpAction.disabled, onClick: additionalHelpAction.onClick, suffix: jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" }), variant: "ghost", children: jsx(Link, { params: (_a = additionalHelpAction.to) === null || _a === void 0 ? void 0 : _a.parameters, target: (_b = additionalHelpAction.to) === null || _b === void 0 ? void 0 : _b.target, to: (_c = additionalHelpAction.to) === null || _c === void 0 ? void 0 : _c.pathname, children: additionalHelpAction.title }) })) : null] })] })) }));
|