@trackunit/react-components 1.8.22 → 1.8.23
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 +174 -122
- package/index.esm.js +174 -122
- package/package.json +7 -7
- package/src/common/PackageNameStoryComponent.d.ts +2 -1
- package/src/components/Alert/Alert.d.ts +2 -2
- package/src/components/Badge/Badge.d.ts +2 -1
- package/src/components/Breadcrumb/Breadcrumb.d.ts +3 -2
- package/src/components/Breadcrumb/BreadcrumbForLargeScreen.d.ts +2 -1
- package/src/components/Breadcrumb/BreadcrumbForMediumScreen.d.ts +2 -1
- package/src/components/Breadcrumb/BreadcrumbForSmallScreen.d.ts +2 -1
- package/src/components/Breadcrumb/BreadcrumbItem.d.ts +2 -1
- package/src/components/Card/Card.d.ts +2 -2
- package/src/components/Card/CardBody.d.ts +2 -2
- package/src/components/Card/CardFooter.d.ts +2 -2
- package/src/components/Card/CardHeader.d.ts +3 -3
- package/src/components/Collapse/Collapse.d.ts +2 -2
- package/src/components/CompletionStatusIndicator/CompletionStatusIndicator.d.ts +2 -1
- package/src/components/CopyableText/CopyableText.d.ts +2 -1
- package/src/components/EmptyState/EmptyState.d.ts +2 -1
- package/src/components/Highlight/Highlight.d.ts +2 -2
- package/src/components/Icon/Icon.d.ts +2 -2
- package/src/components/InteractableItem/InteractableItem.variants.d.ts +2 -2
- package/src/components/KPICard/KPICard.d.ts +1 -1
- package/src/components/Menu/MenuDivider/MenuDivider.d.ts +2 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +2 -2
- package/src/components/Menu/MenuItem/MenuItem.variants.d.ts +3 -2
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +2 -2
- package/src/components/Page/Page.d.ts +2 -2
- package/src/components/Page/PageContent.d.ts +2 -2
- package/src/components/PageHeader/components/PageHeaderKpiMetrics.d.ts +9 -1
- package/src/components/PageHeader/components/PageHeaderSecondaryActions.d.ts +17 -2
- package/src/components/PageHeader/components/PageHeaderTitle.d.ts +10 -1
- package/src/components/Pagination/Pagination.d.ts +2 -1
- package/src/components/Polygon/Polygon.d.ts +2 -1
- package/src/components/Popover/PopoverContent.d.ts +2 -2
- package/src/components/Popover/PopoverTitle.d.ts +2 -2
- package/src/components/Popover/PopoverTrigger.d.ts +2 -2
- package/src/components/Portal/Portal.d.ts +2 -1
- package/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/src/components/Sidebar/useOverflowItems.d.ts +1 -1
- package/src/components/SkeletonLines/SkeletonLines.d.ts +2 -1
- package/src/components/Spacer/Spacer.d.ts +2 -1
- package/src/components/Spinner/Spinner.d.ts +2 -1
- package/src/components/Tabs/Tab.d.ts +1 -1
- package/src/components/Tabs/TabContent.d.ts +2 -2
- package/src/components/Tabs/TabList.d.ts +1 -1
- package/src/components/Tabs/Tabs.d.ts +2 -2
- package/src/components/Tag/Tag.d.ts +2 -2
- package/src/components/ToggleGroup/ToggleGroup.d.ts +3 -3
- package/src/components/ValueBar/ValueBar.d.ts +2 -1
- package/src/components/VirtualizedList/VirtualizedList.d.ts +1 -1
- package/src/components/ZStack/ZStack.d.ts +2 -2
- package/src/components/buttons/Button/Button.d.ts +2 -2
- package/src/components/buttons/IconButton/IconButton.d.ts +4 -3
- package/src/components/buttons/StarButton/StarButton.d.ts +2 -2
- package/src/hooks/useContinuousTimeout.d.ts +1 -1
- package/src/hooks/useSelfUpdatingRef.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -135,33 +135,29 @@ const isSafari = () => {
|
|
|
135
135
|
* @param {IconProps} props - The props for the Icon component
|
|
136
136
|
* @returns {ReactElement} Icon component
|
|
137
137
|
*/
|
|
138
|
-
const Icon = ({ name, size = "medium", className, dataTestId, color, onClick, type, style, forwardedRef, ariaLabel, fontSize, ariaLabelledBy, ariaDescribedBy, ariaHidden, }) => {
|
|
138
|
+
const Icon = ({ name, size = "medium", className, dataTestId, color = undefined, onClick, type = size === "large" ? "outline" : "solid", style, forwardedRef, ariaLabel, fontSize = false, ariaLabelledBy, ariaDescribedBy, ariaHidden, }) => {
|
|
139
139
|
const useTagRef = react.useRef(null);
|
|
140
140
|
const ICON_CONTAINER_ID = sharedUtils.uuidv4();
|
|
141
141
|
const correctIconType = react.useMemo(() => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return "solid";
|
|
142
|
+
switch (size) {
|
|
143
|
+
case "small":
|
|
144
|
+
return "micro";
|
|
145
|
+
case "medium":
|
|
146
|
+
return "mini";
|
|
147
|
+
default:
|
|
148
|
+
return type === "solid" ? "solid" : "outline";
|
|
150
149
|
}
|
|
151
|
-
return "outline";
|
|
152
150
|
}, [type, size]);
|
|
153
151
|
const correctViewBox = react.useMemo(() => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return "0 0 24 24";
|
|
152
|
+
switch (size) {
|
|
153
|
+
case "small":
|
|
154
|
+
return "0 0 16 16";
|
|
155
|
+
case "medium":
|
|
156
|
+
return "0 0 20 20";
|
|
157
|
+
default:
|
|
158
|
+
return "0 0 24 24";
|
|
162
159
|
}
|
|
163
|
-
|
|
164
|
-
}, [size, type]);
|
|
160
|
+
}, [size]);
|
|
165
161
|
const iconName = uiIcons.iconNames[name];
|
|
166
162
|
const href = react.useMemo(() => ({
|
|
167
163
|
solid: `${IconSpriteSolid}#${iconName}`,
|
|
@@ -260,15 +256,15 @@ const Tag = ({ className, dataTestId, children, size = "medium", onClose, color
|
|
|
260
256
|
return false;
|
|
261
257
|
}, [color]);
|
|
262
258
|
const layout = react.useMemo(() => {
|
|
263
|
-
if (onClose && isSupportedDismissColor) {
|
|
259
|
+
if (onClose !== undefined && isSupportedDismissColor) {
|
|
264
260
|
return "containsDismiss";
|
|
265
261
|
}
|
|
266
|
-
if (icon) {
|
|
262
|
+
if (icon !== null && icon !== undefined) {
|
|
267
263
|
return "containsIcon";
|
|
268
264
|
}
|
|
269
265
|
return "default";
|
|
270
266
|
}, [onClose, icon, isSupportedDismissColor]);
|
|
271
|
-
return (jsxRuntime.jsxs("div", { className: cvaTag({ className, size, color, layout, border: color === "white" ? "default" : "none" }), "data-testid": dataTestId, onMouseEnter: onMouseEnter, ref: ref, children: [icon && size === "medium" ? jsxRuntime.jsx("div", { className: cvaTagIconContainer(), children: icon }) : null, jsxRuntime.jsx("span", { className: cvaTagText(), children: children }), Boolean(onClose) && isSupportedDismissColor && size === "medium" && !disabled ? (
|
|
267
|
+
return (jsxRuntime.jsxs("div", { className: cvaTag({ className, size, color, layout, border: color === "white" ? "default" : "none" }), "data-testid": dataTestId, onMouseEnter: onMouseEnter, ref: ref, children: [icon !== null && icon !== undefined && size === "medium" ? (jsxRuntime.jsx("div", { className: cvaTagIconContainer(), children: icon })) : null, jsxRuntime.jsx("span", { className: cvaTagText(), children: children }), Boolean(onClose) && isSupportedDismissColor && size === "medium" && !disabled ? (
|
|
272
268
|
// a fix for multiselect deselecting tags working together with fade out animation
|
|
273
269
|
jsxRuntime.jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsxRuntime.jsx(Icon, { className: cvaTagIcon(), dataTestId: dataTestId + "Icon", name: "XCircle", size: "small", style: { WebkitTransition: "-webkit-transform 0.150s" }, type: "solid" }) })) : null] }));
|
|
274
270
|
};
|
|
@@ -750,7 +746,7 @@ const cvaIconButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
750
746
|
* @param {ButtonProps} props - The props for the Button component
|
|
751
747
|
* @returns {ReactElement} Button component
|
|
752
748
|
*/
|
|
753
|
-
const Button = ({ onClick, children, loading, disabled, className, fullWidth = false, prefix, suffix, variant = "primary", type = "button", size = "medium", square = false, dataTestId, title, role, tabIndex, asChild = false, circular, ref, ...rest }) => {
|
|
749
|
+
const Button = ({ onClick, children, loading = false, disabled = false, className, fullWidth = false, prefix, suffix, variant = "primary", type = "button", size = "medium", square = false, dataTestId, title, role, tabIndex, asChild = false, circular = false, ref, ...rest }) => {
|
|
754
750
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
755
751
|
const sharedCompProps = {
|
|
756
752
|
ref,
|
|
@@ -768,7 +764,7 @@ const Button = ({ onClick, children, loading, disabled, className, fullWidth = f
|
|
|
768
764
|
disabled: disabled || loading,
|
|
769
765
|
type,
|
|
770
766
|
};
|
|
771
|
-
return (jsxRuntime.jsxs(Comp, { ...sharedCompProps, ...(asChild ? {} : buttonSpecificProps), children: [loading ? (jsxRuntime.jsx(Spinner, { centering: "vertically", className: cvaButtonSpinner({ variant }), containerClassName: cvaButtonSpinnerContainer(), size: "small" })) : null, prefix && !loading ? jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: prefix }) : null, jsxRuntime.jsx(reactSlot.Slottable, { children: children }), suffix && !loading ? jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: suffix }) : null] }));
|
|
767
|
+
return (jsxRuntime.jsxs(Comp, { ...sharedCompProps, ...(asChild ? {} : buttonSpecificProps), children: [loading ? (jsxRuntime.jsx(Spinner, { centering: "vertically", className: cvaButtonSpinner({ variant }), containerClassName: cvaButtonSpinnerContainer(), size: "small" })) : null, prefix !== null && prefix !== undefined && !loading ? (jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: prefix })) : null, jsxRuntime.jsx(reactSlot.Slottable, { children: children }), suffix !== null && suffix !== undefined && !loading ? (jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: suffix })) : null] }));
|
|
772
768
|
};
|
|
773
769
|
Button.displayName = "Button";
|
|
774
770
|
|
|
@@ -778,10 +774,8 @@ Button.displayName = "Button";
|
|
|
778
774
|
/**
|
|
779
775
|
*
|
|
780
776
|
*/
|
|
781
|
-
const IconButton = ({ icon, size = "medium", square = true, loading, disabled, className, ref, ...rest }) => {
|
|
782
|
-
return (jsxRuntime.jsx(Button, { className: cvaIconButton({ size: size, className }), disabled: disabled || loading, loading: loading,
|
|
783
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
784
|
-
prefix: !loading ? icon : undefined, ref: ref, size: size, square: square, ...rest }));
|
|
777
|
+
const IconButton = ({ icon, size = "medium", square = true, loading = false, disabled = false, className, ref, ...rest }) => {
|
|
778
|
+
return (jsxRuntime.jsx(Button, { className: cvaIconButton({ size: size, className }), disabled: disabled || loading, loading: loading, prefix: !loading ? icon : undefined, ref: ref, size: size, square: square, ...rest }));
|
|
785
779
|
};
|
|
786
780
|
IconButton.displayName = "IconButton";
|
|
787
781
|
|
|
@@ -885,7 +879,7 @@ const cvaAlertIconContainer = cssClassVarianceUtilities.cvaMerge(["shrink-0", "g
|
|
|
885
879
|
* @param {AlertProps} props - The props for the Alert component
|
|
886
880
|
* @returns {ReactElement} Alert component
|
|
887
881
|
*/
|
|
888
|
-
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, actionsInline = false, }) => {
|
|
882
|
+
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll = false, actionsInline = false, }) => {
|
|
889
883
|
const ref = react.useRef(null);
|
|
890
884
|
const { isTextWrapping, ref: titleRef } = useIsTextWrapping();
|
|
891
885
|
react.useEffect(() => {
|
|
@@ -894,7 +888,19 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
894
888
|
ref.current?.scrollIntoView?.();
|
|
895
889
|
}
|
|
896
890
|
}, [ref, autoScroll]);
|
|
897
|
-
return (jsxRuntime.jsxs("div", { className: cvaAlert({ color, actionsInline, className }), "data-testid": dataTestId, ref: ref, role: "alert", children: [jsxRuntime.jsxs("div", { className: cvaAlertContentContainer({
|
|
891
|
+
return (jsxRuntime.jsxs("div", { className: cvaAlert({ color, actionsInline, className }), "data-testid": dataTestId, ref: ref, role: "alert", children: [jsxRuntime.jsxs("div", { className: cvaAlertContentContainer({
|
|
892
|
+
inline: !isTextWrapping && (children === null || children === undefined),
|
|
893
|
+
actionsInline,
|
|
894
|
+
}), children: [jsxRuntime.jsx("div", { className: cvaAlertIconContainer({
|
|
895
|
+
inline: !isTextWrapping && (children === null || children === undefined),
|
|
896
|
+
actionsInline,
|
|
897
|
+
}), children: jsxRuntime.jsx(Icon, { color: color, name: getIconName(color) }) }), jsxRuntime.jsxs("div", { className: cvaContent(), children: [title ? (jsxRuntime.jsx(Text, { dataTestId: `${dataTestId}-title`, ref: titleRef, weight: "bold", children: title })) : null, children !== null && children !== undefined ? (jsxRuntime.jsx(Text, { type: typeof children === "string" || typeof children === "number" ? "p" : "span", weight: "normal", children: children })) : null] }), onClose !== undefined && !actionsInline ? (jsxRuntime.jsx("div", { className: cvaAlertCloseButtonContainer({
|
|
898
|
+
inline: !isTextWrapping && (children === null || children === undefined),
|
|
899
|
+
actionsInline,
|
|
900
|
+
}), children: jsxRuntime.jsx(IconButton, { className: "!h-5 !min-h-0 !w-5 !p-0", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, size: "small", title: "Close Alert", variant: "ghost-neutral" }) })) : null] }), primaryAction !== undefined || secondaryAction !== undefined ? (jsxRuntime.jsxs("div", { className: cvaAlertActionsContainer({ actionsInline }), children: [secondaryAction !== undefined ? (jsxRuntime.jsx(Button, { loading: secondaryAction.loading, onClick: secondaryAction.onClick, size: "small", variant: "ghost-neutral", children: secondaryAction.label })) : null, primaryAction !== undefined ? (jsxRuntime.jsx(Button, { loading: primaryAction.loading, onClick: primaryAction.onClick, size: "small", variant: color === "danger" ? "primary-danger" : "primary", children: primaryAction.label })) : null] })) : null, onClose !== undefined && actionsInline ? (jsxRuntime.jsx("div", { className: cvaAlertCloseButtonContainer({
|
|
901
|
+
inline: !isTextWrapping && (children === null || children === undefined),
|
|
902
|
+
actionsInline,
|
|
903
|
+
}), children: jsxRuntime.jsx(IconButton, { className: "!h-5 !min-h-0 !w-5 !p-0", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, size: "small", title: "Close Alert", variant: "ghost-neutral" }) })) : null] }));
|
|
898
904
|
};
|
|
899
905
|
const getIconName = (color) => {
|
|
900
906
|
switch (color) {
|
|
@@ -968,7 +974,11 @@ const Badge = ({ color = "primary", compact = false, className, count, max, hide
|
|
|
968
974
|
if (hideZero && count === 0) {
|
|
969
975
|
return null;
|
|
970
976
|
}
|
|
971
|
-
const displayedCount = count &&
|
|
977
|
+
const displayedCount = count !== undefined && count !== 0 && !Number.isNaN(count) && max !== undefined && max !== 0 && !Number.isNaN(max)
|
|
978
|
+
? count > max
|
|
979
|
+
? `${max}+`
|
|
980
|
+
: count
|
|
981
|
+
: count;
|
|
972
982
|
const isSingleChar = displayedCount?.toString().length === 1;
|
|
973
983
|
return (jsxRuntime.jsx("span", { className: cvaBadge({ color, className, compact, isSingleChar }), "data-testid": dataTestId, children: compact ? null : displayedCount }));
|
|
974
984
|
};
|
|
@@ -1204,10 +1214,10 @@ const useDebounce = (value, delay = 500, direction, onBounce) => {
|
|
|
1204
1214
|
const [debouncedValue, setDebouncedValue] = react.useState(value);
|
|
1205
1215
|
react.useEffect(() => {
|
|
1206
1216
|
let handler;
|
|
1207
|
-
if ((direction === "in" && !debouncedValue && value) ||
|
|
1208
|
-
(direction === "out" && debouncedValue && !value) ||
|
|
1217
|
+
if ((direction === "in" && !Boolean(debouncedValue) && Boolean(value)) ||
|
|
1218
|
+
(direction === "out" && Boolean(debouncedValue) && !Boolean(value)) ||
|
|
1209
1219
|
direction === "both" ||
|
|
1210
|
-
|
|
1220
|
+
direction === undefined) {
|
|
1211
1221
|
handler = setTimeout(() => {
|
|
1212
1222
|
setDebouncedValue(value);
|
|
1213
1223
|
onBounce?.(value);
|
|
@@ -1428,7 +1438,7 @@ const useIsTextTruncated = (text) => {
|
|
|
1428
1438
|
}, [updateTextVisibility]);
|
|
1429
1439
|
// Re-check whenever text changes
|
|
1430
1440
|
react.useEffect(() => {
|
|
1431
|
-
if (
|
|
1441
|
+
if (text === undefined || text === "") {
|
|
1432
1442
|
return;
|
|
1433
1443
|
}
|
|
1434
1444
|
updateTextVisibility();
|
|
@@ -1634,7 +1644,11 @@ const useWatch = ({ value, onChange, immediate = false, isEqual }) => {
|
|
|
1634
1644
|
const prevValue = react.useRef(UNINITIALIZED);
|
|
1635
1645
|
react.useEffect(() => {
|
|
1636
1646
|
const prev = prevValue.current;
|
|
1637
|
-
const hasChanged = prev === UNINITIALIZED
|
|
1647
|
+
const hasChanged = prev === UNINITIALIZED
|
|
1648
|
+
? false
|
|
1649
|
+
: isEqual !== undefined
|
|
1650
|
+
? !isEqual(value, prev)
|
|
1651
|
+
: JSON.stringify(value) !== JSON.stringify(prev);
|
|
1638
1652
|
if (immediate && prev === UNINITIALIZED) {
|
|
1639
1653
|
onChange(value, null);
|
|
1640
1654
|
}
|
|
@@ -1894,7 +1908,7 @@ const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeav
|
|
|
1894
1908
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
1895
1909
|
* @returns {ReactElement} CardBody component
|
|
1896
1910
|
*/
|
|
1897
|
-
const CardBody = ({ density = "auto", children, dataTestId, className, direction, disableGap, id, }) => {
|
|
1911
|
+
const CardBody = ({ density = "auto", children, dataTestId, className, direction = "column", disableGap = false, id, }) => {
|
|
1898
1912
|
return (jsxRuntime.jsx("div", { className: cvaCardBodyDensityContainer$1({ density, disableGap, className, direction }), "data-testid": dataTestId, id: id, children: children }));
|
|
1899
1913
|
};
|
|
1900
1914
|
|
|
@@ -1906,7 +1920,7 @@ const CardBody = ({ density = "auto", children, dataTestId, className, direction
|
|
|
1906
1920
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
1907
1921
|
* @returns {ReactElement} CardFooter component
|
|
1908
1922
|
*/
|
|
1909
|
-
const CardFooter = ({ dataTestId, className, children, density, hideSeparator = false }) => {
|
|
1923
|
+
const CardFooter = ({ dataTestId, className, children, density = "auto", hideSeparator = false, }) => {
|
|
1910
1924
|
return (jsxRuntime.jsx("div", { className: cvaCardFooterDensityContainer({
|
|
1911
1925
|
density,
|
|
1912
1926
|
border: hideSeparator ? "borderless" : "default",
|
|
@@ -1971,12 +1985,12 @@ const Heading = ({ variant = "primary", inverted = false, subtle = false, classN
|
|
|
1971
1985
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
1972
1986
|
* @returns {ReactElement} CardHeader component
|
|
1973
1987
|
*/
|
|
1974
|
-
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, dataTestId, className, children, accessories, actions, density, hideSeparator = false, }) => {
|
|
1988
|
+
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, dataTestId, className, children, accessories, actions, density = "auto", hideSeparator = false, }) => {
|
|
1975
1989
|
return (jsxRuntime.jsx("div", { className: cvaCardHeaderDensityContainer({
|
|
1976
1990
|
density,
|
|
1977
1991
|
border: hideSeparator ? "borderless" : "default",
|
|
1978
1992
|
className,
|
|
1979
|
-
}), "data-testid": dataTestId, children: jsxRuntime.jsxs("div", { className: cvaCardHeader(), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsxRuntime.jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxRuntime.jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", dataTestId: "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1993
|
+
}), "data-testid": dataTestId, children: jsxRuntime.jsxs("div", { className: cvaCardHeader(), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsxRuntime.jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading !== null && subHeading !== undefined ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxRuntime.jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", dataTestId: "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1980
1994
|
};
|
|
1981
1995
|
|
|
1982
1996
|
const cvaCollapse = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -2062,9 +2076,9 @@ const Collapse = ({ id, initialExpanded = false, onToggle, label, children, clas
|
|
|
2062
2076
|
}
|
|
2063
2077
|
setExpanded(!expanded);
|
|
2064
2078
|
}, [expanded, onToggle]);
|
|
2065
|
-
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsxRuntime.jsx(Text, { id: LABEL_ID, type: "span", weight: "bold", children: label }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [headerAddon ? headerAddon : null, jsxRuntime.jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronUp", size: "medium" })] })] }) }), jsxRuntime.jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, children: expanded || animate ? children : null })] }));
|
|
2079
|
+
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsxRuntime.jsx(Text, { id: LABEL_ID, type: "span", weight: "bold", children: label }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [headerAddon !== null && headerAddon !== undefined ? headerAddon : null, jsxRuntime.jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronUp", size: "medium" })] })] }) }), jsxRuntime.jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, children: expanded || animate ? children : null })] }));
|
|
2066
2080
|
};
|
|
2067
|
-
const Collapsible = ({ children, expanded, id, extraPadding }) => {
|
|
2081
|
+
const Collapsible = ({ children, expanded, id, extraPadding = true }) => {
|
|
2068
2082
|
const ref = react.useRef(null);
|
|
2069
2083
|
const { height } = useGeometry(ref);
|
|
2070
2084
|
return (jsxRuntime.jsx("div", { className: cvaCollapseAnimated({ expanded }), id: id, style: { height: expanded ? height : "0" }, children: jsxRuntime.jsx("div", { ref: ref, children: jsxRuntime.jsx("div", { className: cvaCollapsible({ extraPadding }), children: children }) }) }));
|
|
@@ -2083,7 +2097,7 @@ const Collapsible = ({ children, expanded, id, extraPadding }) => {
|
|
|
2083
2097
|
* @param {boolean} props.warning - Indicates if the process has a warning.
|
|
2084
2098
|
* @param {boolean} props.success - Indicates if the process was successful.
|
|
2085
2099
|
*/
|
|
2086
|
-
const CompletionStatusIndicator = ({ loading, error, success, ...rest }) => {
|
|
2100
|
+
const CompletionStatusIndicator = ({ loading = false, error, success, ...rest }) => {
|
|
2087
2101
|
if (loading) {
|
|
2088
2102
|
return jsxRuntime.jsx(Spinner, { className: "h-[22px] w-[22px]", containerClassName: "w-min", ...rest });
|
|
2089
2103
|
}
|
|
@@ -2177,17 +2191,17 @@ const cvaSkeletonLine = cssClassVarianceUtilities.cvaMerge([
|
|
|
2177
2191
|
/**
|
|
2178
2192
|
* Display placeholder lines before the data gets loaded to reduce load-time frustration.
|
|
2179
2193
|
*/
|
|
2180
|
-
const SkeletonLines = react.memo(({ margin = "10px 0", lines = 1, height, width = "100%", className, dataTestId }) => {
|
|
2194
|
+
const SkeletonLines = react.memo(({ margin = "10px 0", lines = 1, height, width = "100%", className, dataTestId, }) => {
|
|
2181
2195
|
const skeletonLines = [];
|
|
2182
2196
|
const getWidth = (index) => {
|
|
2183
|
-
if (width
|
|
2184
|
-
return width[index]
|
|
2197
|
+
if (Array.isArray(width)) {
|
|
2198
|
+
return width[index] ?? "100%";
|
|
2185
2199
|
}
|
|
2186
2200
|
return width;
|
|
2187
2201
|
};
|
|
2188
2202
|
const getHeight = (index) => {
|
|
2189
|
-
if (height
|
|
2190
|
-
return height[index]
|
|
2203
|
+
if (Array.isArray(height)) {
|
|
2204
|
+
return height[index] ?? "auto";
|
|
2191
2205
|
}
|
|
2192
2206
|
return height;
|
|
2193
2207
|
};
|
|
@@ -2271,7 +2285,7 @@ WorkerWithSignSVG.displayName = "WorkerWithSignSVG";
|
|
|
2271
2285
|
* - For guidance purposes (e.g., onboarding, adjusting filters, exploring alternative approaches).
|
|
2272
2286
|
* - In celebratory instances (e.g., no new notifications, services up to date).
|
|
2273
2287
|
*/
|
|
2274
|
-
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading, dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, }) => {
|
|
2288
|
+
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading = false, dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, }) => {
|
|
2275
2289
|
const ImageSource = react.useMemo(() => {
|
|
2276
2290
|
switch (image) {
|
|
2277
2291
|
case "WORKER_WITH_SIGN":
|
|
@@ -2289,7 +2303,7 @@ const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customIma
|
|
|
2289
2303
|
return SearchDocumentSVG;
|
|
2290
2304
|
}
|
|
2291
2305
|
}, [image]);
|
|
2292
|
-
return (jsxRuntime.jsx("div", { className: cvaContainerStyles({ className }), "data-testid": 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 ? (typeof customImageSrc === "string" ? (jsxRuntime.jsx("img", { alt: altText, className: cvaImgStyles(), height: 200, src: customImageSrc, width: 200 })) : (customImageSrc)) : (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: "mt-4 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?.to ? (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: additionalHelpAction.to.parameters, target: additionalHelpAction.to.target, to: additionalHelpAction.to.pathname, children: additionalHelpAction.title }) })) : null] })] })) }));
|
|
2306
|
+
return (jsxRuntime.jsx("div", { className: cvaContainerStyles({ className }), "data-testid": 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 !== null && customImageSrc !== undefined ? (typeof customImageSrc === "string" ? (jsxRuntime.jsx("img", { alt: altText, className: cvaImgStyles(), height: 200, src: customImageSrc, width: 200 })) : (customImageSrc)) : (typeof ImageSource !== "undefined" && (jsxRuntime.jsx(ImageSource, { "data-testid": "empty-state-image", height: 200, width: 200 }, image))), description !== undefined && description !== "" ? (jsxRuntime.jsx(Text, { align: "center", size: "large", children: description })) : null, jsxRuntime.jsxs("div", { className: "mt-4 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?.to ? (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: additionalHelpAction.to.parameters, target: additionalHelpAction.to.target, to: additionalHelpAction.to.pathname, children: additionalHelpAction.title }) })) : null] })] })) }));
|
|
2293
2307
|
};
|
|
2294
2308
|
|
|
2295
2309
|
const cvaEmptyValue = cssClassVarianceUtilities.cvaMerge(["text-neutral-400"]);
|
|
@@ -2640,7 +2654,7 @@ const cvaPopoverTitleText = cssClassVarianceUtilities.cvaMerge(["flex-1", "text-
|
|
|
2640
2654
|
const PopoverContent = function PopoverContent({ className, dataTestId, children, portalId, ref: propRef, ...props }) {
|
|
2641
2655
|
const { context: floatingContext, customProps, ...context } = usePopoverContext();
|
|
2642
2656
|
const ref = react$1.useMergeRefs([context.refs.setFloating, propRef]);
|
|
2643
|
-
return (jsxRuntime.jsx(Portal, { id: portalId, children: context.isOpen ? (jsxRuntime.jsx(react$1.FloatingFocusManager, { closeOnFocusOut: false, context: floatingContext, guards: true, modal: context.isModal, order: ["reference", "content"], returnFocus: true, children: jsxRuntime.jsx("div", { "aria-describedby": context.descriptionId, "aria-labelledby": context.labelId, className: cvaPopoverContainer({ className: className ?? customProps.className }), "data-testid": dataTestId ?? customProps.dataTestId ?? "popover-content", ref: ref, style: {
|
|
2657
|
+
return (jsxRuntime.jsx(Portal, { id: portalId, children: context.isOpen === true ? (jsxRuntime.jsx(react$1.FloatingFocusManager, { closeOnFocusOut: false, context: floatingContext, guards: true, modal: context.isModal, order: ["reference", "content"], returnFocus: true, children: jsxRuntime.jsx("div", { "aria-describedby": context.descriptionId, "aria-labelledby": context.labelId, className: cvaPopoverContainer({ className: className ?? customProps.className }), "data-testid": dataTestId ?? customProps.dataTestId ?? "popover-content", ref: ref, style: {
|
|
2644
2658
|
position: context.strategy,
|
|
2645
2659
|
top: context.y,
|
|
2646
2660
|
left: context.x,
|
|
@@ -2655,7 +2669,7 @@ const PopoverContent = function PopoverContent({ className, dataTestId, children
|
|
|
2655
2669
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
2656
2670
|
* @returns {ReactElement} PopoverTitle component
|
|
2657
2671
|
*/
|
|
2658
|
-
const PopoverTitle = ({ children, action, divider = false, className, dataTestId }) => {
|
|
2672
|
+
const PopoverTitle = ({ children, action, divider = false, className, dataTestId, }) => {
|
|
2659
2673
|
return (jsxRuntime.jsxs("div", { className: cvaPopoverTitleContainer({ divider, className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(Text, { className: cvaPopoverTitleText(), size: "small", subtle: true, type: "div", uppercase: true, weight: "bold", children: children }), action] }));
|
|
2660
2674
|
};
|
|
2661
2675
|
|
|
@@ -2665,7 +2679,7 @@ const PopoverTitle = ({ children, action, divider = false, className, dataTestId
|
|
|
2665
2679
|
* @param {PopoverTriggerProps} props - The props for the PopoverTrigger component
|
|
2666
2680
|
* @returns {ReactElement} PopoverTrigger component
|
|
2667
2681
|
*/
|
|
2668
|
-
const PopoverTrigger = function PopoverTrigger({ children, renderButton, ref: propRef, ...props }) {
|
|
2682
|
+
const PopoverTrigger = function PopoverTrigger({ children, renderButton = false, ref: propRef, ...props }) {
|
|
2669
2683
|
const context = usePopoverContext();
|
|
2670
2684
|
const ref = react$1.useMergeRefs([context.refs.setReference, propRef]);
|
|
2671
2685
|
if (!renderButton && react.isValidElement(children)) {
|
|
@@ -2673,10 +2687,10 @@ const PopoverTrigger = function PopoverTrigger({ children, renderButton, ref: pr
|
|
|
2673
2687
|
ref,
|
|
2674
2688
|
...props,
|
|
2675
2689
|
...children.props,
|
|
2676
|
-
"data-state": context.isOpen ? "open" : "closed",
|
|
2690
|
+
"data-state": context.isOpen === true ? "open" : "closed",
|
|
2677
2691
|
}));
|
|
2678
2692
|
}
|
|
2679
|
-
return (jsxRuntime.jsx(Button, { "data-state": context.isOpen ? "open" : "closed", ref: ref, type: "button", ...context.getReferenceProps(props), children: children }));
|
|
2693
|
+
return (jsxRuntime.jsx(Button, { "data-state": context.isOpen === true ? "open" : "closed", ref: ref, type: "button", ...context.getReferenceProps(props), children: children }));
|
|
2680
2694
|
};
|
|
2681
2695
|
|
|
2682
2696
|
const cvaTooltipContainer = cssClassVarianceUtilities.cvaMerge(["flex", "leading-5"]);
|
|
@@ -2752,7 +2766,7 @@ const FloatingArrowContainer = ({ arrowRef, mode = "dark", }) => {
|
|
|
2752
2766
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
2753
2767
|
* @returns {ReactElement} Tooltip component
|
|
2754
2768
|
*/
|
|
2755
|
-
const Tooltip = ({ children, dataTestId, disabled, className, label, placement = "auto", mode = "dark", iconProps, id, }) => {
|
|
2769
|
+
const Tooltip = ({ children, dataTestId, disabled = false, className, label, placement = "auto", mode = "dark", iconProps, id, }) => {
|
|
2756
2770
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
2757
2771
|
const arrowRef = react.useRef(null);
|
|
2758
2772
|
const { refs, floatingStyles, context } = react$1.useFloating({
|
|
@@ -2918,8 +2932,8 @@ const cvaIndicatorIconBackground = cssClassVarianceUtilities.cvaMerge(["rounded-
|
|
|
2918
2932
|
* @param {IndicatorProps} props - The props for the Indicator component
|
|
2919
2933
|
* @returns {ReactElement} Indicator component
|
|
2920
2934
|
*/
|
|
2921
|
-
const Indicator = ({ dataTestId, icon, label, color = "unknown", withBackground = true, withLabel = true, ping = false, size, weight, className, ...rest }) => {
|
|
2922
|
-
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxRuntime.jsxs("div", { "aria-label": label, className: cvaIndicator(), "data-testid": dataTestId, ...rest, children: [jsxRuntime.jsxs("div", { className: cvaIndicatorIconBackground({ color, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background", children: [ping ? (jsxRuntime.jsx("div", { className: cvaIndicatorPing({ color }), "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping" })) : null, icon] }), label
|
|
2935
|
+
const Indicator = ({ dataTestId, icon, label, color = "unknown", withBackground = true, withLabel = true, ping = false, size = "medium", weight = "normal", className, ...rest }) => {
|
|
2936
|
+
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxRuntime.jsxs("div", { "aria-label": label, className: cvaIndicator(), "data-testid": dataTestId, ...rest, children: [jsxRuntime.jsxs("div", { className: cvaIndicatorIconBackground({ color, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background", children: [ping ? (jsxRuntime.jsx("div", { className: cvaIndicatorPing({ color }), "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping" })) : null, icon] }), label && withLabel ? (jsxRuntime.jsx("div", { className: cvaIndicatorLabel({ size, weight, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-label` : undefined, children: label })) : null] }) }));
|
|
2923
2937
|
};
|
|
2924
2938
|
|
|
2925
2939
|
const cvaKPI = cssClassVarianceUtilities.cvaMerge(["w-full", "px-4", "py-2", "flex", "flex-col"], {
|
|
@@ -2979,10 +2993,10 @@ const LoadingContent$1 = () => (jsxRuntime.jsx("div", { className: "flex h-11 fl
|
|
|
2979
2993
|
* @param {KPIProps} props - The props for the KPI component
|
|
2980
2994
|
* @returns {ReactElement} KPI component
|
|
2981
2995
|
*/
|
|
2982
|
-
const KPI = ({ title, value, loading, unit, className, dataTestId, tooltipLabel, variant = "default", trend, ...rest }) => {
|
|
2996
|
+
const KPI = ({ title, value, loading = false, unit, className, dataTestId, tooltipLabel, variant = "default", trend, ...rest }) => {
|
|
2983
2997
|
const isSmallVariant = variant === "small";
|
|
2984
|
-
return (jsxRuntime.jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled:
|
|
2985
|
-
isDefaultAndHasTrendValue: Boolean(trend
|
|
2998
|
+
return (jsxRuntime.jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, disabled: tooltipLabel === undefined || 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({
|
|
2999
|
+
isDefaultAndHasTrendValue: Boolean(trend !== undefined && trend.value !== undefined && !isSmallVariant),
|
|
2986
3000
|
className,
|
|
2987
3001
|
}), children: [jsxRuntime.jsxs("span", { className: cvaKPIvalueText({ variant }), children: [value, " ", unit] }), jsxRuntime.jsx(TrendIndicator, { isSmallVariant: isSmallVariant, trend: trend, unit: unit })] }) })] })) }) }));
|
|
2988
3002
|
};
|
|
@@ -2990,7 +3004,7 @@ const TrendIndicator = ({ trend, unit, isSmallVariant }) => {
|
|
|
2990
3004
|
if (!trend) {
|
|
2991
3005
|
return null;
|
|
2992
3006
|
}
|
|
2993
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-1", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value ? (jsxRuntime.jsxs(Text, { dataTestId: "trend-value", size: "small", weight: "normal", children: [trend.value, " ", unit] })) : null, trend.variant
|
|
3007
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-1", "data-testid": "trend-indicator", children: [!isSmallVariant && trend.value !== undefined ? (jsxRuntime.jsxs(Text, { dataTestId: "trend-value", size: "small", weight: "normal", children: [trend.value, " ", unit] })) : null, trend.variant !== undefined && trend.variant.icon !== undefined ? (jsxRuntime.jsx(Icon, { color: trend.variant.color, name: trend.variant.icon, size: "small" })) : null, trend.percentage !== undefined ? (jsxRuntime.jsxs(Text, { className: cvaKPITrendPercentage({ color: trend.variant?.color }), size: "small", weight: "bold", children: [trend.percentage, "%"] })) : null] }));
|
|
2994
3008
|
};
|
|
2995
3009
|
|
|
2996
3010
|
const cvaKPICard = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -3035,14 +3049,14 @@ const cvaKPIIconContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-c
|
|
|
3035
3049
|
* @param {KPICardProps} props - The props for the KPICard component
|
|
3036
3050
|
* @returns {ReactElement} KPICard component
|
|
3037
3051
|
*/
|
|
3038
|
-
const KPICard = ({ isActive, onClick, className, dataTestId, children, iconName, iconColor, ...rest }) => {
|
|
3039
|
-
const isClickable = Boolean(onClick &&
|
|
3052
|
+
const KPICard = ({ isActive = false, onClick, className, dataTestId, children, iconName = undefined, iconColor = "info", loading = false, ...rest }) => {
|
|
3053
|
+
const isClickable = Boolean(onClick !== undefined && loading !== true);
|
|
3040
3054
|
return (jsxRuntime.jsx(Card, { className: cvaKPICard({
|
|
3041
3055
|
isClickable,
|
|
3042
3056
|
isActive,
|
|
3043
3057
|
minHeight: rest.trend ? "withTrends" : "default",
|
|
3044
3058
|
className,
|
|
3045
|
-
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className: cvaCardBodyDensityContainer({ iconName: Boolean(iconName) }), density: "none", children: [jsxRuntime.jsx(KPI, { ...rest, className: tailwindMerge.twMerge(iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined }), iconName ? (jsxRuntime.jsx("div", { className: cvaKPIIconContainer({ iconColor
|
|
3059
|
+
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className: cvaCardBodyDensityContainer({ iconName: Boolean(iconName) }), density: "none", children: [jsxRuntime.jsx(KPI, { ...rest, className: tailwindMerge.twMerge(iconName ? "gap-2" : "", "p-0"), dataTestId: dataTestId ? `${dataTestId}-kpi` : undefined, loading: loading }), iconName ? (jsxRuntime.jsx("div", { className: cvaKPIIconContainer({ iconColor }), children: jsxRuntime.jsx(Icon, { name: iconName, size: "small", type: "solid" }) })) : null, children] }) }));
|
|
3046
3060
|
};
|
|
3047
3061
|
const cvaCardBodyDensityContainer = cssClassVarianceUtilities.cvaMerge(["grid", "grid-cols-[1fr_auto]"], {
|
|
3048
3062
|
variants: {
|
|
@@ -3078,9 +3092,9 @@ const cvaInteractableItem = cssClassVarianceUtilities.cvaMerge("", {
|
|
|
3078
3092
|
default: "cursor-default",
|
|
3079
3093
|
"not-allowed": "cursor-not-allowed",
|
|
3080
3094
|
},
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3095
|
+
selection: {
|
|
3096
|
+
selected: ["bg-primary-50", "hover:bg-primary-50", "focus-within:bg-primary-50"],
|
|
3097
|
+
unselected: "",
|
|
3084
3098
|
auto: [
|
|
3085
3099
|
"hover:bg-neutral-100",
|
|
3086
3100
|
"has-[:checked]:bg-primary-50",
|
|
@@ -3093,24 +3107,24 @@ const cvaInteractableItem = cssClassVarianceUtilities.cvaMerge("", {
|
|
|
3093
3107
|
true: ["pointer-events-none", "!bg-neutral-100", "!cursor-not-allowed"],
|
|
3094
3108
|
false: "", // use compoundVariants instead
|
|
3095
3109
|
},
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3110
|
+
focus: {
|
|
3111
|
+
focused: ["bg-neutral-600/5"],
|
|
3112
|
+
unfocused: "",
|
|
3099
3113
|
auto: "[&:has(:focus-visible)]:outline-native",
|
|
3100
3114
|
},
|
|
3101
3115
|
},
|
|
3102
3116
|
compoundVariants: [
|
|
3103
3117
|
{
|
|
3104
3118
|
disabled: false,
|
|
3105
|
-
|
|
3119
|
+
selection: "unselected",
|
|
3106
3120
|
className: ["hover:bg-neutral-600/5", "focus-within:bg-neutral-600/5"],
|
|
3107
3121
|
},
|
|
3108
3122
|
],
|
|
3109
3123
|
defaultVariants: {
|
|
3110
3124
|
cursor: "auto",
|
|
3111
|
-
|
|
3125
|
+
selection: "auto",
|
|
3112
3126
|
disabled: false,
|
|
3113
|
-
|
|
3127
|
+
focus: "auto",
|
|
3114
3128
|
},
|
|
3115
3129
|
});
|
|
3116
3130
|
|
|
@@ -3147,7 +3161,7 @@ const ListItem = ({ className, dataTestId, onClick, details, title, description,
|
|
|
3147
3161
|
}), children: thumbnail })) : null, jsxRuntime.jsxs("div", { className: "grid-rows-min-fr grid items-center text-sm", children: [jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center text-sm", children: typeof title === "string" ? (jsxRuntime.jsx(Text, { className: "truncate", dataTestId: dataTestId ? `${dataTestId}-title` : undefined, weight: "bold", children: title })) : (react.cloneElement(title, {
|
|
3148
3162
|
className: tailwindMerge.twMerge(title.props.className, "neutral-900 text-sm font-medium truncate"),
|
|
3149
3163
|
dataTestId: !title.props.dataTestId && dataTestId ? `${dataTestId}-title` : undefined,
|
|
3150
|
-
})) }), description ? (jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center", children: typeof description === "string" ? (jsxRuntime.jsx(Text, { className: "truncate text-xs text-neutral-500", dataTestId: dataTestId ? `${dataTestId}-description` : undefined, weight: "bold", children: description })) : (react.cloneElement(description, {
|
|
3164
|
+
})) }), description !== undefined && description !== "" ? (jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center", children: typeof description === "string" ? (jsxRuntime.jsx(Text, { className: "truncate text-xs text-neutral-500", dataTestId: dataTestId ? `${dataTestId}-description` : undefined, weight: "bold", children: description })) : (react.cloneElement(description, {
|
|
3151
3165
|
className: tailwindMerge.twMerge(description.props.className, "text-neutral-500 text-xs font-medium truncate"),
|
|
3152
3166
|
dataTestId: !description.props.dataTestId && dataTestId ? `${dataTestId}-description` : undefined,
|
|
3153
3167
|
})) })) : null, meta ? (jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center pt-0.5", children: jsxRuntime.jsx(Text, { className: "truncate text-xs text-neutral-400", dataTestId: dataTestId ? `${dataTestId}-meta` : undefined, weight: "bold", children: meta }) })) : null] })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 pl-2", children: [details, onClick ? jsxRuntime.jsx(Icon, { color: "neutral", name: "ChevronRight", size: "medium" }) : null] })] }));
|
|
@@ -3189,7 +3203,12 @@ const MenuDivider = () => {
|
|
|
3189
3203
|
*/
|
|
3190
3204
|
const cvaMenuItem = (props) => {
|
|
3191
3205
|
const { selected, disabled, focused, className, variant, fieldSize } = props ?? {};
|
|
3192
|
-
return tailwindMerge.twMerge(cvaMenuItemStyle({ variant, selected, disabled, fieldSize }), cvaInteractableItem({
|
|
3206
|
+
return tailwindMerge.twMerge(cvaMenuItemStyle({ variant, selected, disabled, fieldSize }), cvaInteractableItem({
|
|
3207
|
+
selection: selected === true ? "selected" : "unselected",
|
|
3208
|
+
disabled,
|
|
3209
|
+
cursor: "pointer",
|
|
3210
|
+
focus: focused === true ? "focused" : "unfocused",
|
|
3211
|
+
}), className);
|
|
3193
3212
|
};
|
|
3194
3213
|
const cvaMenuItemStyle = cssClassVarianceUtilities.cvaMerge(["py-2", "px-2", "h-auto", "flex", "flex-row", "items-center", "gap-x-2", "select-none", "rounded", "text-sm"], {
|
|
3195
3214
|
variants: {
|
|
@@ -3302,10 +3321,10 @@ const cvaMenuItemSuffix = cssClassVarianceUtilities.cvaMerge(["text-secondary-40
|
|
|
3302
3321
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
3303
3322
|
* @returns {ReactElement} MenuItem component
|
|
3304
3323
|
*/
|
|
3305
|
-
const MenuItem = ({ className, dataTestId, label, children, selected, focused, prefix, suffix, disabled, onClick, stopPropagation = true, id, tabIndex, optionLabelDescription, optionPrefix, fieldSize = "medium", variant = "primary", }) => {
|
|
3324
|
+
const MenuItem = ({ className, dataTestId, label, children, selected = false, focused = false, prefix, suffix, disabled = false, onClick, stopPropagation = true, id, tabIndex, optionLabelDescription, optionPrefix, fieldSize = "medium", variant = "primary", }) => {
|
|
3306
3325
|
/* Handle tab navigation */
|
|
3307
3326
|
const handleKeyDown = (e) => {
|
|
3308
|
-
if (e.key === "Enter" && onClick &&
|
|
3327
|
+
if (e.key === "Enter" && onClick !== undefined && disabled !== true) {
|
|
3309
3328
|
if (stopPropagation) {
|
|
3310
3329
|
e.stopPropagation();
|
|
3311
3330
|
}
|
|
@@ -3325,7 +3344,7 @@ const MenuItem = ({ className, dataTestId, label, children, selected, focused, p
|
|
|
3325
3344
|
e.stopPropagation();
|
|
3326
3345
|
}
|
|
3327
3346
|
onClick?.(e);
|
|
3328
|
-
}, onKeyDown: handleKeyDown, role: "menuitem", tabIndex: disabled ? -1 : (tabIndex ?? 0), children: [prefix ? (jsxRuntime.jsx("div", { className: cvaMenuItemPrefix({ selected, variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-prefix` : "menu-item-prefix", children: prefix })) : null, children && typeof children !== "string" ? (children) : (jsxRuntime.jsxs("div", { className: cvaMenuItemLabel({ variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-label` : "menu-item-label", children: [optionPrefix ? optionPrefix : null, children ?? label, optionLabelDescription ? jsxRuntime.jsxs("span", { className: "text-secondary-400 ml-1", children: ["(", optionLabelDescription, ")"] }) : null] })), suffix ? (jsxRuntime.jsx("div", { className: cvaMenuItemSuffix({ selected, variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-suffix` : "menu-item-suffix", children: suffix })) : null] }));
|
|
3347
|
+
}, onKeyDown: handleKeyDown, role: "menuitem", tabIndex: disabled ? -1 : (tabIndex ?? 0), children: [prefix !== null && prefix !== undefined ? (jsxRuntime.jsx("div", { className: cvaMenuItemPrefix({ selected, variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-prefix` : "menu-item-prefix", children: prefix })) : null, children !== null && children !== undefined && typeof children !== "string" ? (children) : (jsxRuntime.jsxs("div", { className: cvaMenuItemLabel({ variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-label` : "menu-item-label", children: [optionPrefix !== null && optionPrefix !== undefined ? optionPrefix : null, children ?? label, optionLabelDescription !== undefined && optionLabelDescription !== "" ? (jsxRuntime.jsxs("span", { className: "text-secondary-400 ml-1", children: ["(", optionLabelDescription, ")"] })) : null] })), suffix !== null && suffix !== undefined ? (jsxRuntime.jsx("div", { className: cvaMenuItemSuffix({ selected, variant, disabled }), "data-testid": dataTestId ? `${dataTestId}-suffix` : "menu-item-suffix", children: suffix })) : null] }));
|
|
3329
3348
|
};
|
|
3330
3349
|
|
|
3331
3350
|
/**
|
|
@@ -3343,16 +3362,13 @@ const MenuList = ({ dataTestId, className, children, withStickyHeader = false, i
|
|
|
3343
3362
|
const childrenArr = react.Children.toArray(children);
|
|
3344
3363
|
const [internalSelectedItems, setInternalSelectedItems] = react.useState(controlledSelectedItems ?? []);
|
|
3345
3364
|
const selectedItems = controlledSelectedItems ?? internalSelectedItems;
|
|
3346
|
-
const handleItemClick = react.useCallback((id
|
|
3347
|
-
if (disabled) {
|
|
3348
|
-
return;
|
|
3349
|
-
}
|
|
3365
|
+
const handleItemClick = react.useCallback((id) => {
|
|
3350
3366
|
const newSelectedItems = isMulti
|
|
3351
3367
|
? selectedItems.includes(id)
|
|
3352
3368
|
? selectedItems.filter(item => item !== id)
|
|
3353
3369
|
: [...selectedItems, id]
|
|
3354
3370
|
: [id];
|
|
3355
|
-
if (onSelectionChange) {
|
|
3371
|
+
if (onSelectionChange !== undefined) {
|
|
3356
3372
|
onSelectionChange(newSelectedItems);
|
|
3357
3373
|
}
|
|
3358
3374
|
else {
|
|
@@ -3361,13 +3377,15 @@ const MenuList = ({ dataTestId, className, children, withStickyHeader = false, i
|
|
|
3361
3377
|
}, [isMulti, selectedItems, onSelectionChange]);
|
|
3362
3378
|
return (jsxRuntime.jsx("div", { className: cvaMenuList({ stickyHeader: withStickyHeader, className }), "data-testid": dataTestId ? `${dataTestId}-menu-list` : "menu-list", onClick: args.onClick, role: "list", tabIndex: 0, children: childrenArr.map((menuItem, index) => {
|
|
3363
3379
|
if (react.isValidElement(menuItem)) {
|
|
3364
|
-
const isSelected = selectedItems.includes(menuItem.props.id ?? `${index}`) || menuItem.props.selected;
|
|
3380
|
+
const isSelected = (selectedItems.includes(menuItem.props.id ?? `${index}`) || menuItem.props.selected) ?? false;
|
|
3365
3381
|
return react.cloneElement(menuItem, {
|
|
3366
3382
|
...menuItem.props,
|
|
3367
3383
|
key: index,
|
|
3368
3384
|
onClick: (event) => {
|
|
3369
3385
|
menuItem.props.onClick?.(event);
|
|
3370
|
-
|
|
3386
|
+
if (menuItem.props.disabled !== true) {
|
|
3387
|
+
handleItemClick(menuItem.props.id ?? `${index}`);
|
|
3388
|
+
}
|
|
3371
3389
|
},
|
|
3372
3390
|
className: isMulti && isSelected
|
|
3373
3391
|
? cvaMenuListMultiSelect({ className: menuItem.props.className })
|
|
@@ -3449,7 +3467,7 @@ const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items
|
|
|
3449
3467
|
* @returns {ReactElement} Notice component
|
|
3450
3468
|
*/
|
|
3451
3469
|
const Notice = ({ dataTestId, icon, label, color = "neutral", withLabel = true, className, tooltipLabel = label, withTooltip = false, size = "medium", ...rest }) => {
|
|
3452
|
-
return (jsxRuntime.jsx(Tooltip, { className: className, disabled:
|
|
3470
|
+
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: withTooltip === false, label: tooltipLabel, placement: "bottom", children: jsxRuntime.jsxs("div", { "aria-label": label, className: cvaNotice(), "data-testid": dataTestId, ...rest, children: [jsxRuntime.jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label && withLabel ? (jsxRuntime.jsx("div", { className: cvaNoticeLabel({ color, size }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] }) }));
|
|
3453
3471
|
};
|
|
3454
3472
|
|
|
3455
3473
|
const cvaPage = cssClassVarianceUtilities.cvaMerge(["grid", "h-full"], {
|
|
@@ -3482,7 +3500,7 @@ const cvaPageContent = cssClassVarianceUtilities.cvaMerge(["overflow-auto", "pag
|
|
|
3482
3500
|
* Renders the page component. Adds padding and layout to the page.
|
|
3483
3501
|
*/
|
|
3484
3502
|
const Page = ({ layout, className, children, dataTestId }) => {
|
|
3485
|
-
return (jsxRuntime.jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId
|
|
3503
|
+
return (jsxRuntime.jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId ? dataTestId : "page", children: children }));
|
|
3486
3504
|
};
|
|
3487
3505
|
|
|
3488
3506
|
/**
|
|
@@ -3497,17 +3515,30 @@ const PageContent = ({ className, children, dataTestId, layout }) => {
|
|
|
3497
3515
|
};
|
|
3498
3516
|
|
|
3499
3517
|
const LoadingContent = () => (jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-3", "data-testid": "kpi-card-loading-content", children: jsxRuntime.jsx("div", { className: "w-full", children: jsxRuntime.jsx(SkeletonLines, { height: [16, 25], lines: 2, margin: "3px 0 0 0", width: [75, 50] }) }) }));
|
|
3518
|
+
/**
|
|
3519
|
+
* The PageHeaderKpiMetrics component is used to render the KPI metrics in the PageHeader component.
|
|
3520
|
+
*
|
|
3521
|
+
* @param {object} props - The props for the PageHeaderKpiMetrics component
|
|
3522
|
+
* @param {Array<PageHeaderKpiMetricsType>} props.kpiMetrics - The KPI metrics to render
|
|
3523
|
+
* @returns {ReactElement} PageHeaderKpiMetrics component
|
|
3524
|
+
*/
|
|
3500
3525
|
const PageHeaderKpiMetrics = ({ kpiMetrics }) => {
|
|
3501
3526
|
return (jsxRuntime.jsx("div", { className: "hidden items-center gap-4 md:flex", children: kpiMetrics
|
|
3502
|
-
.filter(kpi =>
|
|
3527
|
+
.filter(kpi => kpi.hidden === false || kpi.hidden === undefined)
|
|
3503
3528
|
.map((kpi, index) => {
|
|
3504
|
-
if (kpi.loading) {
|
|
3529
|
+
if (kpi.loading === true) {
|
|
3505
3530
|
return jsxRuntime.jsx(LoadingContent, {}, `${kpi}-${index}`);
|
|
3506
3531
|
}
|
|
3507
3532
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col text-nowrap text-left", children: [jsxRuntime.jsx("span", { className: "text-xs text-slate-500", children: kpi.header }), jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-1", children: [jsxRuntime.jsx("span", { className: "text-lg font-medium text-slate-900", children: kpi.value }), kpi.unit ? jsxRuntime.jsx("span", { className: "text-xs text-slate-900", children: kpi.unit }) : null] })] }, `${kpi}-${index}`));
|
|
3508
3533
|
}) }));
|
|
3509
3534
|
};
|
|
3510
3535
|
|
|
3536
|
+
/**
|
|
3537
|
+
* The ActionRenderer component is used to render the action in the PageHeaderSecondaryActions component.
|
|
3538
|
+
*
|
|
3539
|
+
* @param {ActionRendererProps} props - The props for the ActionRenderer component
|
|
3540
|
+
* @returns {ReactElement} ActionRenderer component
|
|
3541
|
+
*/
|
|
3511
3542
|
function ActionRenderer({ action, isMenuItem = false, externalOnClick }) {
|
|
3512
3543
|
const { to, tooltipLabel, prefixIconName, disabled, actionText, actionCallback, dataTestId, target, variant } = action;
|
|
3513
3544
|
// This component handles all the "wrapping" logic for Link/Tooltip
|
|
@@ -3522,10 +3553,18 @@ function ActionRenderer({ action, isMenuItem = false, externalOnClick }) {
|
|
|
3522
3553
|
// Wrap `content` with Tooltip
|
|
3523
3554
|
const wrappedWithTooltip = tooltipLabel ? (jsxRuntime.jsx(Tooltip, { className: "block", label: tooltipLabel, children: content })) : (content);
|
|
3524
3555
|
// Finally, wrap with Link if `to` is provided
|
|
3525
|
-
return to ? (jsxRuntime.jsx(reactRouter.Link, { target: target, to: to, children: wrappedWithTooltip })) : (wrappedWithTooltip);
|
|
3556
|
+
return to !== undefined && to !== "" ? (jsxRuntime.jsx(reactRouter.Link, { target: target, to: to, children: wrappedWithTooltip })) : (wrappedWithTooltip);
|
|
3526
3557
|
}
|
|
3527
|
-
|
|
3528
|
-
|
|
3558
|
+
/**
|
|
3559
|
+
* The PageHeaderSecondaryActions component is used to render the secondary actions in the PageHeader component.
|
|
3560
|
+
*
|
|
3561
|
+
* @param {object} props - The props for the PageHeaderSecondaryActions component
|
|
3562
|
+
* @param {Array<PageHeaderSecondaryActionType>} props.actions - The secondary actions to render
|
|
3563
|
+
* @param {boolean} [props.hasPrimaryAction] - Whether there is a primary action present
|
|
3564
|
+
* @returns {ReactElement} PageHeaderSecondaryActions component
|
|
3565
|
+
*/
|
|
3566
|
+
const PageHeaderSecondaryActions = ({ actions, hasPrimaryAction = false, }) => {
|
|
3567
|
+
const enabledActions = react.useMemo(() => actions.filter(action => action.hidden === false || action.hidden === undefined), [actions]);
|
|
3529
3568
|
// If we need to render a "More Menu" because we have too many actions:
|
|
3530
3569
|
if (enabledActions.length > 2 || (hasPrimaryAction && enabledActions.length > 1)) {
|
|
3531
3570
|
// Separate them into danger vs. other
|
|
@@ -3537,7 +3576,7 @@ const PageHeaderSecondaryActions = ({ actions, hasPrimaryAction, }) => {
|
|
|
3537
3576
|
return [danger, [...others, action]];
|
|
3538
3577
|
}
|
|
3539
3578
|
}, [[], []]);
|
|
3540
|
-
return (jsxRuntime.jsx(MoreMenu, { dataTestId: "secondary-actions-more-menu", iconButtonProps: { size: "small", variant: "secondary" }, children: close => (jsxRuntime.jsxs(MenuList, { className: "min-w-[160px]", children: [otherActions.map((action, index) => (jsxRuntime.jsx(ActionRenderer, { action: action, externalOnClick: close, isMenuItem: true }, `${action.actionText}-${index}`))), dangerActions.length ? jsxRuntime.jsx(MenuDivider, {}) : null, dangerActions.map((action, index) => (jsxRuntime.jsx(ActionRenderer, { action: action, externalOnClick: close, isMenuItem: true }, `${action.actionText}-${index}`)))] })) }));
|
|
3579
|
+
return (jsxRuntime.jsx(MoreMenu, { dataTestId: "secondary-actions-more-menu", iconButtonProps: { size: "small", variant: "secondary" }, children: close => (jsxRuntime.jsxs(MenuList, { className: "min-w-[160px]", children: [otherActions.map((action, index) => (jsxRuntime.jsx(ActionRenderer, { action: action, externalOnClick: close, isMenuItem: true }, `${action.actionText}-${index}`))), dangerActions.length > 0 ? jsxRuntime.jsx(MenuDivider, {}) : null, dangerActions.map((action, index) => (jsxRuntime.jsx(ActionRenderer, { action: action, externalOnClick: close, isMenuItem: true }, `${action.actionText}-${index}`)))] })) }));
|
|
3541
3580
|
}
|
|
3542
3581
|
// Otherwise, render them inline as buttons
|
|
3543
3582
|
return (jsxRuntime.jsx("div", { className: "flex flex-row items-center gap-2", children: enabledActions
|
|
@@ -3564,6 +3603,14 @@ const cvaPageHeaderContainer = cssClassVarianceUtilities.cvaMerge(["bg-white", "
|
|
|
3564
3603
|
const cvaPageHeader = cssClassVarianceUtilities.cvaMerge(["box-border", "py-4", "px-6", "flex", "items-center", "gap-y-1"]);
|
|
3565
3604
|
const cvaPageHeaderHeading = cssClassVarianceUtilities.cvaMerge(["text-slate-900", "text-xl", "font-semibold", "truncate"]);
|
|
3566
3605
|
|
|
3606
|
+
/**
|
|
3607
|
+
* The PageHeaderTitle component is used to display the title of the page header.
|
|
3608
|
+
*
|
|
3609
|
+
* @param {object} props - The props for the PageHeaderTitle component
|
|
3610
|
+
* @param {string} props.title - The title of the page header
|
|
3611
|
+
* @param {string} [props.dataTestId] - The data test id of the page header title
|
|
3612
|
+
* @returns {ReactElement} PageHeaderTitle component
|
|
3613
|
+
*/
|
|
3567
3614
|
const PageHeaderTitle = ({ title, dataTestId }) => {
|
|
3568
3615
|
const { ref, isTextTruncated } = useIsTextTruncated();
|
|
3569
3616
|
return (jsxRuntime.jsx("div", { className: "flex flex-row items-center", children: jsxRuntime.jsx(Tooltip, { className: "grid min-w-16", disabled: !isTextTruncated, label: title, placement: "top", children: jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, ref: ref, children: title }) }) }));
|
|
@@ -3579,21 +3626,21 @@ const PageHeaderTitle = ({ title, dataTestId }) => {
|
|
|
3579
3626
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
3580
3627
|
* @returns {ReactElement} PageHeader component
|
|
3581
3628
|
*/
|
|
3582
|
-
const PageHeader = ({ className, dataTestId, secondaryActions, showLoading, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon, kpiMetrics, tagTooltipLabel, primaryAction, }) => {
|
|
3629
|
+
const PageHeader = ({ className, dataTestId, secondaryActions, showLoading = false, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon = "QuestionMarkCircle", kpiMetrics, tagTooltipLabel, primaryAction, }) => {
|
|
3583
3630
|
const tagRenderer = react.useMemo(() => {
|
|
3584
|
-
if (
|
|
3631
|
+
if (tagLabel === undefined || tagLabel === "" || showLoading) {
|
|
3585
3632
|
return null;
|
|
3586
3633
|
}
|
|
3587
3634
|
// If the user passes a string, we render the string as a tag with props provided.
|
|
3588
|
-
return (jsxRuntime.jsx("div", { className: "ml-auto flex flex-row gap-2", children: jsxRuntime.jsx(Tooltip, { dataTestId: "page-header-tag-tooltip", disabled:
|
|
3635
|
+
return (jsxRuntime.jsx("div", { className: "ml-auto flex flex-row gap-2", children: jsxRuntime.jsx(Tooltip, { dataTestId: "page-header-tag-tooltip", disabled: tagTooltipLabel === undefined || tagTooltipLabel === "", label: tagTooltipLabel, placement: "top", children: jsxRuntime.jsx(Tag, { color: tagColor, dataTestId: "page-header-tag", children: tagLabel }) }) }));
|
|
3589
3636
|
}, [showLoading, tagColor, tagLabel, tagTooltipLabel]);
|
|
3590
3637
|
return (jsxRuntime.jsxs("div", { className: cvaPageHeaderContainer({
|
|
3591
3638
|
className,
|
|
3592
|
-
withBorder:
|
|
3593
|
-
}), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [backTo ? (jsxRuntime.jsx(reactRouter.Link, { to: backTo, children: jsxRuntime.jsx(Button, { className: "mr-4 bg-black/5 hover:bg-black/10", prefix: jsxRuntime.jsx(Icon, { name: "ArrowLeft", size: "small" }), size: "medium", square: true, variant: "ghost-neutral" }) })) : undefined, typeof title === "string" ? jsxRuntime.jsx(PageHeaderTitle, { dataTestId: dataTestId, title: title }) : title, tagRenderer || description ? (jsxRuntime.jsxs("div", { className: "mx-2 flex items-center gap-2", children: [description && !showLoading ? (jsxRuntime.jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-description-tooltip` : undefined, iconProps: {
|
|
3594
|
-
name: descriptionIcon
|
|
3639
|
+
withBorder: tabsList === undefined,
|
|
3640
|
+
}), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [backTo ? (jsxRuntime.jsx(reactRouter.Link, { to: backTo, children: jsxRuntime.jsx(Button, { className: "mr-4 bg-black/5 hover:bg-black/10", prefix: jsxRuntime.jsx(Icon, { name: "ArrowLeft", size: "small" }), size: "medium", square: true, variant: "ghost-neutral" }) })) : undefined, typeof title === "string" ? jsxRuntime.jsx(PageHeaderTitle, { dataTestId: dataTestId, title: title }) : title, tagRenderer || (description !== null && description !== undefined) ? (jsxRuntime.jsxs("div", { className: "mx-2 flex items-center gap-2", children: [description !== null && description !== undefined && !showLoading ? (jsxRuntime.jsx(Tooltip, { dataTestId: dataTestId ? `${dataTestId}-description-tooltip` : undefined, iconProps: {
|
|
3641
|
+
name: descriptionIcon,
|
|
3595
3642
|
dataTestId: "page-header-description-icon",
|
|
3596
|
-
}, label: description, placement: "bottom" })) : undefined, tagRenderer] })) : null, jsxRuntime.jsxs("div", { className: "ml-auto flex gap-2", children: [kpiMetrics ? jsxRuntime.jsx(PageHeaderKpiMetrics, { kpiMetrics: kpiMetrics }) : null, Array.isArray(secondaryActions) ? (jsxRuntime.jsx(PageHeaderSecondaryActions, { actions: secondaryActions, hasPrimaryAction: !!primaryAction })) : secondaryActions ? (secondaryActions) : null, primaryAction &&
|
|
3643
|
+
}, label: description, placement: "bottom" })) : undefined, tagRenderer] })) : null, jsxRuntime.jsxs("div", { className: "ml-auto flex gap-2", children: [kpiMetrics ? jsxRuntime.jsx(PageHeaderKpiMetrics, { kpiMetrics: kpiMetrics }) : null, Array.isArray(secondaryActions) ? (jsxRuntime.jsx(PageHeaderSecondaryActions, { actions: secondaryActions, hasPrimaryAction: !!primaryAction })) : secondaryActions !== null && secondaryActions !== undefined ? (secondaryActions) : null, primaryAction !== undefined && (primaryAction.hidden === false || primaryAction.hidden === undefined) ? (jsxRuntime.jsx(Tooltip, { disabled: primaryAction.tooltipLabel === undefined || primaryAction.tooltipLabel === "", label: primaryAction.tooltipLabel, children: jsxRuntime.jsx(Button, { dataTestId: primaryAction.dataTestId, disabled: primaryAction.disabled, loading: primaryAction.loading, onClick: () => primaryAction.actionCallback?.(), prefix: primaryAction.prefixIconName !== undefined ? (jsxRuntime.jsx(Icon, { name: primaryAction.prefixIconName, size: "small" })) : undefined, size: "medium", variant: primaryAction.variant, children: primaryAction.actionText }) })) : null] })] }), tabsList] }));
|
|
3597
3644
|
};
|
|
3598
3645
|
|
|
3599
3646
|
const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
|
@@ -3605,7 +3652,7 @@ const cvaPaginationText = cssClassVarianceUtilities.cvaMerge("whitespace-nowrap"
|
|
|
3605
3652
|
* @param {PaginationProps} props - The props for the Pagination component
|
|
3606
3653
|
* @returns {ReactElement} Pagination component
|
|
3607
3654
|
*/
|
|
3608
|
-
const Pagination = ({ previousPage, nextPage, canPreviousPage, canNextPage, pageCount, pageIndex, loading, className, dataTestId, getTranslatedCount, onPageChange, cursorBase, }) => {
|
|
3655
|
+
const Pagination = ({ previousPage, nextPage, canPreviousPage = false, canNextPage = false, pageCount, pageIndex, loading = false, className, dataTestId, getTranslatedCount, onPageChange, cursorBase = false, }) => {
|
|
3609
3656
|
const [page, setPage] = react.useState(pageIndex);
|
|
3610
3657
|
const [currentPage, setCurrentPage] = react.useState(String(pageIndex !== undefined ? pageIndex + 1 : 1));
|
|
3611
3658
|
if (!loading && pageCount === undefined) {
|
|
@@ -3654,7 +3701,7 @@ const STROKE_WIDTH_THRESHOLD = 32;
|
|
|
3654
3701
|
* @param { PolygonProps} props - The props for the Polygon component
|
|
3655
3702
|
* @returns {ReactElement} Polygon component
|
|
3656
3703
|
*/
|
|
3657
|
-
const Polygon = ({ points, size, color = "black", opaque = true, className, dataTestId }) => {
|
|
3704
|
+
const Polygon = ({ points, size, color = "black", opaque = true, className, dataTestId, }) => {
|
|
3658
3705
|
// Calculate the bounds of the points
|
|
3659
3706
|
const minX = Math.min(...points.map(coord => coord[0]));
|
|
3660
3707
|
const maxX = Math.max(...points.map(coord => coord[0]));
|
|
@@ -3757,7 +3804,7 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
|
3757
3804
|
* @returns {ReactElement} SectionHeader component
|
|
3758
3805
|
*/
|
|
3759
3806
|
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
3760
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(reactHelmetAsync.Helmet, { title: title }) }), jsxRuntime.jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxRuntime.jsxs("div", { className: "flex grow flex-col gap-2", children: [jsxRuntime.jsx(Heading, { dataTestId: dataTestId, variant: "secondary", children: title }), subtitle ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subtitle })) : null] }), addons ? jsxRuntime.jsx("div", { className: "flex gap-2", children: addons }) : null] }), jsxRuntime.jsx(Spacer, { size: "small" })] }));
|
|
3807
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(reactHelmetAsync.Helmet, { title: title }) }), jsxRuntime.jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxRuntime.jsxs("div", { className: "flex grow flex-col gap-2", children: [jsxRuntime.jsx(Heading, { dataTestId: dataTestId, variant: "secondary", children: title }), subtitle ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subtitle })) : null] }), addons !== null && addons !== undefined ? jsxRuntime.jsx("div", { className: "flex gap-2", children: addons }) : null] }), jsxRuntime.jsx(Spacer, { size: "small" })] }));
|
|
3761
3808
|
};
|
|
3762
3809
|
|
|
3763
3810
|
const cvaSidebar = cssClassVarianceUtilities.cvaMerge(["apply", "grid", "grid-cols-fr-min", "items-center"]);
|
|
@@ -3791,7 +3838,7 @@ const useOverflowItems = ({ threshold = 1, childUniqueIdentifierAttribute = "id"
|
|
|
3791
3838
|
entries.forEach(entry => {
|
|
3792
3839
|
// @ts-expect-error - suppressImplicitAnyIndexErrors
|
|
3793
3840
|
const targetElementId = entry.target[childUniqueIdentifierAttribute];
|
|
3794
|
-
if (targetElementId) {
|
|
3841
|
+
if (targetElementId !== null && targetElementId !== undefined) {
|
|
3795
3842
|
updatedEntries[targetElementId] = entry.isIntersecting ? false : true;
|
|
3796
3843
|
}
|
|
3797
3844
|
});
|
|
@@ -3847,19 +3894,19 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
3847
3894
|
});
|
|
3848
3895
|
const overflowItemCount = sharedUtils.objectValues(itemOverflowMap).filter(isOverflowing => isOverflowing).length;
|
|
3849
3896
|
const itemVisibilityClassName = (id) => {
|
|
3850
|
-
if (itemOverflowMap[id]) {
|
|
3897
|
+
if (itemOverflowMap[id] === true) {
|
|
3851
3898
|
return "invisible";
|
|
3852
3899
|
}
|
|
3853
3900
|
return "visible";
|
|
3854
3901
|
};
|
|
3855
|
-
return (jsxRuntime.jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid":
|
|
3902
|
+
return (jsxRuntime.jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid": `${dataTestId}-child-container`, ref: overflowContainerRef, children: react.Children.map(children, child => {
|
|
3856
3903
|
return react.cloneElement(child, {
|
|
3857
3904
|
className: tailwindMerge.twMerge(child.props.className, itemVisibilityClassName(child.props.id)),
|
|
3858
3905
|
});
|
|
3859
3906
|
}) }), overflowItemCount > 0 ? (jsxRuntime.jsx(MoreMenu, { iconButtonProps: {
|
|
3860
3907
|
variant: "ghost-neutral",
|
|
3861
|
-
}, ...moreMenuProps, className: moreMenuProps?.className, dataTestId:
|
|
3862
|
-
return itemOverflowMap[child.props.id]
|
|
3908
|
+
}, ...moreMenuProps, className: moreMenuProps?.className, dataTestId: `${dataTestId}-more-menu`, children: close => (jsxRuntime.jsx(MenuList, { ...menuListProps, dataTestId: dataTestId, children: react.Children.map(children, child => {
|
|
3909
|
+
return itemOverflowMap[child.props.id] === true
|
|
3863
3910
|
? react.cloneElement(child, {
|
|
3864
3911
|
onClick: () => {
|
|
3865
3912
|
child.props.onClick?.();
|
|
@@ -3922,8 +3969,8 @@ const cvaTab = cssClassVarianceUtilities.cvaMerge([
|
|
|
3922
3969
|
* Wrapper for radix tab component.
|
|
3923
3970
|
* We add a custom implementation of the asChild prop to make it easy to make the child element look like other tabs.
|
|
3924
3971
|
*/
|
|
3925
|
-
const Tab = ({ value, isFullWidth = false, iconName, dataTestId, className, children, suffix, asChild, appendTabStylesToChildIfAsChild = true, ...rest }) => {
|
|
3926
|
-
const renderContent = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [iconName ? jsxRuntime.jsx(Icon, { name: iconName, size: "small" }) : null, react.isValidElement(children) ? children.props.children : children, suffix] }));
|
|
3972
|
+
const Tab = ({ value, isFullWidth = false, iconName = undefined, dataTestId, className, children, suffix, asChild = false, appendTabStylesToChildIfAsChild = true, ...rest }) => {
|
|
3973
|
+
const renderContent = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [iconName !== undefined ? jsxRuntime.jsx(Icon, { name: iconName, size: "small" }) : null, react.isValidElement(children) ? children.props.children : children, suffix] }));
|
|
3927
3974
|
const commonProps = {
|
|
3928
3975
|
className: appendTabStylesToChildIfAsChild ? cvaTab({ className, isFullWidth }) : className,
|
|
3929
3976
|
...rest,
|
|
@@ -4083,8 +4130,8 @@ const ToggleGroup = ({ list, selected, setSelected, onChange, disabled = false,
|
|
|
4083
4130
|
const containerPadding = 2; // p-0.5 = 2px
|
|
4084
4131
|
const gap = 4;
|
|
4085
4132
|
const slidingLeft = containerPadding +
|
|
4086
|
-
buttonRefs.current.slice(0, validIndex).reduce((sum, ref) => sum + (ref?.offsetWidth
|
|
4087
|
-
const slidingWidth = buttonRefs.current[validIndex]?.offsetWidth
|
|
4133
|
+
buttonRefs.current.slice(0, validIndex).reduce((sum, ref) => sum + (ref?.offsetWidth ?? 0) + gap, 0);
|
|
4134
|
+
const slidingWidth = buttonRefs.current[validIndex]?.offsetWidth ?? 0;
|
|
4088
4135
|
react.useEffect(() => {
|
|
4089
4136
|
setIsMounted(true);
|
|
4090
4137
|
}, []);
|
|
@@ -4104,7 +4151,7 @@ const ToggleItem = ({ title, onClick, disabled, isIconOnly, iconName, size, clas
|
|
|
4104
4151
|
className,
|
|
4105
4152
|
selected,
|
|
4106
4153
|
disabled,
|
|
4107
|
-
}), dataTestId: dataTestId, disabled: disabled, icon: iconName ? (jsxRuntime.jsx(Icon, { className: cvaToggleItemContent({ selected, disabled }), name: iconName, size: size === "large" ? "medium" : "small" })) : null, isIconOnly: isIconOnly, onClick: onClick, ref: ref, size: size, title: title }) })) : (jsxRuntime.jsx(Tooltip, { disabled: !tooltip?.content &&
|
|
4154
|
+
}), dataTestId: dataTestId, disabled: disabled, icon: iconName ? (jsxRuntime.jsx(Icon, { className: cvaToggleItemContent({ selected, disabled }), name: iconName, size: size === "large" ? "medium" : "small" })) : null, isIconOnly: isIconOnly, onClick: onClick, ref: ref, size: size, title: title }) })) : (jsxRuntime.jsx(Tooltip, { disabled: !tooltip?.content && text?.truncate === false, label: tooltip?.content || title, placement: tooltip?.placement || "top", children: jsxRuntime.jsx(ToggleButton, { className: cvaToggleItem({
|
|
4108
4155
|
className,
|
|
4109
4156
|
selected,
|
|
4110
4157
|
disabled,
|
|
@@ -4170,7 +4217,7 @@ const cvaValueBarText = cssClassVarianceUtilities.cvaMerge(["whitespace-nowrap"]
|
|
|
4170
4217
|
*/
|
|
4171
4218
|
const getScore = (value, min, max, zeroScoreAllowed) => {
|
|
4172
4219
|
if (value <= min) {
|
|
4173
|
-
if (zeroScoreAllowed) {
|
|
4220
|
+
if (zeroScoreAllowed === true) {
|
|
4174
4221
|
return 0;
|
|
4175
4222
|
}
|
|
4176
4223
|
return 0.01; // always render at least some small fragment
|
|
@@ -4203,10 +4250,10 @@ const getDefaultFillColor = (score) => {
|
|
|
4203
4250
|
* @returns {string} color value
|
|
4204
4251
|
*/
|
|
4205
4252
|
const getFillColor = (score, levelColors) => {
|
|
4206
|
-
if (levelColors.low && score < (levelColors.low.level
|
|
4253
|
+
if (levelColors.low !== undefined && score < (levelColors.low.level !== undefined ? levelColors.low.level : 0)) {
|
|
4207
4254
|
return levelColors.low.color;
|
|
4208
4255
|
}
|
|
4209
|
-
if (levelColors.high && score >= (levelColors.high.level
|
|
4256
|
+
if (levelColors.high !== undefined && score >= (levelColors.high.level !== undefined ? levelColors.high.level : 0)) {
|
|
4210
4257
|
return levelColors.high.color;
|
|
4211
4258
|
}
|
|
4212
4259
|
return levelColors.medium?.color ?? uiDesignTokens.color("WARNING", 300);
|
|
@@ -4231,7 +4278,7 @@ const getValueBarColorByValue = (value, min, max, levelColors) => {
|
|
|
4231
4278
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
4232
4279
|
* @returns {ReactElement} ValueBar component
|
|
4233
4280
|
*/
|
|
4234
|
-
const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors, valueColor, showValue, className, dataTestId, zeroScoreAllowed, }) => {
|
|
4281
|
+
const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors, valueColor, showValue = false, className, dataTestId, zeroScoreAllowed = false, }) => {
|
|
4235
4282
|
const score = getScore(value, min, max, zeroScoreAllowed);
|
|
4236
4283
|
const barFillColor = levelColors ? getFillColor(score, levelColors) : getDefaultFillColor(score);
|
|
4237
4284
|
const valueText = `${Number(value.toFixed(1))}${sharedUtils.nonNullable(unit) ? unit : ""}`;
|
|
@@ -4294,7 +4341,12 @@ const VirtualizedList = ({ count, rowHeight = 40, pagination, children, classNam
|
|
|
4294
4341
|
return {
|
|
4295
4342
|
pagination: pagination || reactTablePagination.noPagination,
|
|
4296
4343
|
containerRef: { current: scrollParent },
|
|
4297
|
-
rowSize: pagination
|
|
4344
|
+
rowSize: pagination !== undefined &&
|
|
4345
|
+
pagination.pageInfo !== undefined &&
|
|
4346
|
+
pagination.pageInfo.hasNextPage === true &&
|
|
4347
|
+
pagination.isLoading === true
|
|
4348
|
+
? count + 1
|
|
4349
|
+
: count,
|
|
4298
4350
|
rowHeight,
|
|
4299
4351
|
};
|
|
4300
4352
|
}, [pagination, scrollParent, count, rowHeight]);
|
|
@@ -4313,9 +4365,9 @@ const VirtualizedList = ({ count, rowHeight = 40, pagination, children, classNam
|
|
|
4313
4365
|
}, [scrollParent, fetchMoreOnBottomReached]);
|
|
4314
4366
|
return (jsxRuntime.jsx("div", { className: cvaVirtualizedListContainer({ parentControlledScrollable, className }), "data-testid": dataTestId, ref: containerRef, children: jsxRuntime.jsx("ul", { className: cvaVirtualizedList(), ref: listRef, style: { height: `${getTotalSize()}px`, outline: "none" }, children: getVirtualItems().map(virtualRow => {
|
|
4315
4367
|
const isLoaderRow = virtualRow.index > count - 1;
|
|
4316
|
-
return (jsxRuntime.jsx("li", { className: cvaVirtualizedListItem({ separator }), "data-index": virtualRow.index, onClick: onRowClick ? () => onRowClick(virtualRow.index) : undefined, ref: measureElement, style: {
|
|
4368
|
+
return (jsxRuntime.jsx("li", { className: cvaVirtualizedListItem({ separator }), "data-index": virtualRow.index, onClick: onRowClick !== undefined ? () => onRowClick(virtualRow.index) : undefined, ref: measureElement, style: {
|
|
4317
4369
|
transform: `translateY(${virtualRow.start}px)`,
|
|
4318
|
-
}, tabIndex: -1, children: isLoaderRow ? (pagination?.isLoading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [loadingIndicator === "spinner" && jsxRuntime.jsx(Spinner, { centering: "horizontally", containerClassName: "p-4" }), loadingIndicator === "skeletonLines" && (jsxRuntime.jsx(SkeletonLines, { height: skeletonLinesHeight, lines: 3, width: "full" }))] })) : null) : (children(virtualRow.index)) }, virtualRow.key));
|
|
4370
|
+
}, tabIndex: -1, children: isLoaderRow ? (pagination?.isLoading === true ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [loadingIndicator === "spinner" && jsxRuntime.jsx(Spinner, { centering: "horizontally", containerClassName: "p-4" }), loadingIndicator === "skeletonLines" && (jsxRuntime.jsx(SkeletonLines, { height: skeletonLinesHeight, lines: 3, width: "full" }))] })) : null) : (children(virtualRow.index)) }, virtualRow.key));
|
|
4319
4371
|
}) }) }));
|
|
4320
4372
|
};
|
|
4321
4373
|
|