@trackunit/react-components 1.22.2 → 1.22.5
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 +166 -132
- package/index.esm.js +167 -133
- package/package.json +5 -5
- package/src/common/Styleable.d.ts +5 -1
- package/src/components/Alert/Alert.d.ts +3 -2
- package/src/components/Badge/Badge.d.ts +3 -2
- package/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/src/components/Breadcrumb/BreadcrumbForLargeScreen.d.ts +1 -1
- package/src/components/Breadcrumb/BreadcrumbForMediumScreen.d.ts +1 -1
- package/src/components/Breadcrumb/BreadcrumbForSmallScreen.d.ts +1 -1
- package/src/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/src/components/Breadcrumb/utils/types.d.ts +4 -3
- package/src/components/Card/Card.d.ts +2 -1
- package/src/components/Card/CardBody.d.ts +3 -2
- package/src/components/Card/CardFooter.d.ts +3 -2
- package/src/components/Card/CardHeader.d.ts +3 -2
- package/src/components/Collapse/Collapse.d.ts +3 -2
- package/src/components/CompletionStatusIndicator/CompletionStatusIndicator.d.ts +2 -1
- package/src/components/CopyableText/CopyableText.d.ts +3 -2
- package/src/components/DetailsList/DetailsList.d.ts +4 -3
- package/src/components/EmptyState/EmptyState.d.ts +3 -2
- package/src/components/EmptyValue/EmptyValue.d.ts +3 -2
- package/src/components/ExternalLink/ExternalLink.d.ts +3 -2
- package/src/components/GridAreas/GridAreas.d.ts +3 -2
- package/src/components/Heading/Heading.d.ts +2 -1
- package/src/components/Highlight/Highlight.d.ts +3 -2
- package/src/components/HorizontalOverflowScroller/HorizontalOverflowScroller.d.ts +2 -2
- package/src/components/HorizontalOverflowScroller/OverflowIndicator.d.ts +3 -2
- package/src/components/Icon/Icon.d.ts +3 -8
- package/src/components/Indicator/Indicator.d.ts +2 -1
- package/src/components/KPI/KPI.d.ts +1 -1
- package/src/components/KPI/KPISkeleton.d.ts +1 -1
- package/src/components/KPICard/KPICardSkeleton.d.ts +1 -1
- package/src/components/KPICard/components/TrendIndicator/TrendIndicator.d.ts +3 -2
- package/src/components/KPICard/components/TrendIndicators.d.ts +3 -2
- package/src/components/List/List.d.ts +3 -2
- package/src/components/List/ListLoadingIndicator.d.ts +3 -2
- package/src/components/List/useList.d.ts +2 -1
- package/src/components/ListItem/ListItem.d.ts +2 -1
- package/src/components/ListItem/ListItemSkeleton.d.ts +4 -2
- package/src/components/Menu/MenuDivider/MenuDivider.d.ts +3 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +3 -2
- package/src/components/Menu/MenuList/MenuList.d.ts +3 -2
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +3 -2
- package/src/components/Notice/Notice.d.ts +2 -1
- package/src/components/Page/Page.d.ts +3 -2
- package/src/components/Page/PageContent.d.ts +3 -2
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/PageHeader/components/PageHeaderKpiMetrics.d.ts +7 -2
- package/src/components/PageHeader/components/PageHeaderTitle.d.ts +4 -2
- package/src/components/PageHeader/types.d.ts +3 -2
- package/src/components/Pagination/Pagination.d.ts +4 -10
- package/src/components/Polygon/Polygon.d.ts +3 -2
- package/src/components/Popover/PopoverTitle.d.ts +3 -2
- package/src/components/PreferenceCard/PreferenceCard.d.ts +3 -2
- package/src/components/PreferenceCard/PreferenceCardSkeleton.d.ts +4 -2
- package/src/components/SectionHeader/SectionHeader.d.ts +3 -2
- package/src/components/Sheet/Sheet.d.ts +1 -1
- package/src/components/Sheet/sheet-types.d.ts +2 -1
- package/src/components/Sidebar/Sidebar.d.ts +4 -3
- package/src/components/Skeleton/SkeletonBlock/SkeletonBlock.d.ts +2 -1
- package/src/components/Skeleton/SkeletonLabel/SkeletonLabel.d.ts +2 -1
- package/src/components/SkeletonLines/SkeletonLines.d.ts +4 -3
- package/src/components/Spacer/Spacer.d.ts +3 -2
- package/src/components/Spinner/Spinner.d.ts +3 -2
- package/src/components/Tag/Tag.d.ts +3 -2
- package/src/components/Text/Text.d.ts +2 -1
- package/src/components/ToggleGroup/ToggleGroup.d.ts +5 -4
- package/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/src/components/ValueBar/SegmentedValueBar.d.ts +3 -2
- package/src/components/ValueBar/ValueBar.d.ts +3 -2
- package/src/components/ZStack/ZStack.d.ts +3 -2
- package/src/components/buttons/shared/ButtonProps.d.ts +2 -1
- package/src/index.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -160,7 +160,7 @@ const Icon = ({ name, size = "medium", className, "data-testid": dataTestId, col
|
|
|
160
160
|
useTagRef.current.setAttribute("href", href[correctIconType]);
|
|
161
161
|
}
|
|
162
162
|
}, [correctIconType, href]);
|
|
163
|
-
return (jsxRuntime.jsx("span", { ...rest, "aria-describedby": ariaDescribedBy, "aria-hidden": ariaHidden, "aria-label": ariaLabel ? ariaLabel : stringTs.titleCase(iconName), "aria-labelledby": ariaLabelledBy, className: cvaIcon({ color, size, fontSize, className }), "data-testid": dataTestId, id: iconContainerId, onClick: onClick, ref: ref, children: jsxRuntime.jsx("svg", { "aria-labelledby": iconContainerId, "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, role: "img",
|
|
163
|
+
return (jsxRuntime.jsx("span", { ...rest, "aria-describedby": ariaDescribedBy, "aria-hidden": ariaHidden, "aria-label": ariaLabel ? ariaLabel : stringTs.titleCase(iconName), "aria-labelledby": ariaLabelledBy, className: cvaIcon({ color, size, fontSize, className }), "data-testid": dataTestId, id: iconContainerId, onClick: onClick, ref: ref, style: style, children: jsxRuntime.jsx("svg", { "aria-labelledby": iconContainerId, "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, role: "img", viewBox: correctViewBox, children: jsxRuntime.jsx("use", { href: href[correctIconType], ref: useTagRef }) }) }));
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
/**
|
|
@@ -291,7 +291,7 @@ const TAG_TEXT_MIN_WIDTH_PX = sharedUtils.parseTailwindArbitraryValue(TAG_TEXT_M
|
|
|
291
291
|
* @param {TagProps} props - The props for the Tag component.
|
|
292
292
|
* @returns {ReactElement} The rendered Tag component.
|
|
293
293
|
*/
|
|
294
|
-
const Tag = ({ className, "data-testid": dataTestId, children, size = "medium", onClickClose, color = "info", disabled = false, ref, icon, onMouseEnter, }) => {
|
|
294
|
+
const Tag = ({ className, "data-testid": dataTestId, children, size = "medium", onClickClose, color = "info", disabled = false, ref, icon, onMouseEnter, style, }) => {
|
|
295
295
|
const textRef = react.useRef(null);
|
|
296
296
|
const [shouldTruncate, setShouldTruncate] = react.useState(false);
|
|
297
297
|
react.useLayoutEffect(() => {
|
|
@@ -326,7 +326,7 @@ const Tag = ({ className, "data-testid": dataTestId, children, size = "medium",
|
|
|
326
326
|
color,
|
|
327
327
|
layout,
|
|
328
328
|
border: color === "white" ? "default" : "none",
|
|
329
|
-
}), "data-testid": dataTestId, onMouseEnter: onMouseEnter, ref: ref, children: [icon !== null && icon !== undefined && size === "medium" ? (jsxRuntime.jsx("div", { className: cvaTagIconContainer(), "data-slot": "icon", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaTagText({ truncate: shouldTruncate }), ref: textRef, children: children }), Boolean(onClickClose) && isSupportedDismissColor && size === "medium" && !disabled ? (jsxRuntime.jsx("div", { className: cvaTagIconContainer(), "data-slot": "dismiss", onClick: onClickClose, children: jsxRuntime.jsx(Icon, { className: cvaTagIcon(), "data-testid": dataTestId + "Icon", name: "XCircle", size: "small", style: { WebkitTransition: "-webkit-transform 0.150s" }, type: "solid" }) })) : null] }));
|
|
329
|
+
}), "data-testid": dataTestId, onMouseEnter: onMouseEnter, ref: ref, style: style, children: [icon !== null && icon !== undefined && size === "medium" ? (jsxRuntime.jsx("div", { className: cvaTagIconContainer(), "data-slot": "icon", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaTagText({ truncate: shouldTruncate }), ref: textRef, children: children }), Boolean(onClickClose) && isSupportedDismissColor && size === "medium" && !disabled ? (jsxRuntime.jsx("div", { className: cvaTagIconContainer(), "data-slot": "dismiss", onClick: onClickClose, children: jsxRuntime.jsx(Icon, { className: cvaTagIcon(), "data-testid": dataTestId + "Icon", name: "XCircle", size: "small", style: { WebkitTransition: "-webkit-transform 0.150s" }, type: "solid" }) })) : null] }));
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
/**
|
|
@@ -631,8 +631,8 @@ const cvaSpinnerLabel = cssClassVarianceUtilities.cvaMerge(["self-center", "text
|
|
|
631
631
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
632
632
|
* @returns {ReactElement} Spinner component
|
|
633
633
|
*/
|
|
634
|
-
const Spinner = ({ mode = "light", size = "medium", centering = "centered", className, containerClassName, "data-testid": dataTestId = "spinner", label, ref, }) => {
|
|
635
|
-
return (jsxRuntime.jsx("div", { className: cvaSpinnerContainer({ centering, className: containerClassName }), ref: ref, children: jsxRuntime.jsxs("div", { className: cvaSpinnerContainerInner(), children: [jsxRuntime.jsx("div", { className: cvaSpinner({ size, mode, className }), "data-testid": dataTestId, role: "spinbutton" }), label ? jsxRuntime.jsx("span", { className: cvaSpinnerLabel(), children: label }) : null] }) }));
|
|
634
|
+
const Spinner = ({ mode = "light", size = "medium", centering = "centered", className, containerClassName, "data-testid": dataTestId = "spinner", label, style, ref, }) => {
|
|
635
|
+
return (jsxRuntime.jsx("div", { className: cvaSpinnerContainer({ centering, className: containerClassName }), ref: ref, style: style, children: jsxRuntime.jsxs("div", { className: cvaSpinnerContainerInner(), children: [jsxRuntime.jsx("div", { className: cvaSpinner({ size, mode, className }), "data-testid": dataTestId, role: "spinbutton" }), label ? jsxRuntime.jsx("span", { className: cvaSpinnerLabel(), children: label }) : null] }) }));
|
|
636
636
|
};
|
|
637
637
|
|
|
638
638
|
const cvaButton = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -1161,7 +1161,7 @@ const cvaAlertIconContainer = cssClassVarianceUtilities.cvaMerge(["shrink-0", "g
|
|
|
1161
1161
|
* @param {AlertProps} props - The props for the Alert component
|
|
1162
1162
|
* @returns {ReactElement} Alert component
|
|
1163
1163
|
*/
|
|
1164
|
-
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClickClose, "data-testid": dataTestId, autoScroll = false, actionsInline = false, ref, }) => {
|
|
1164
|
+
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClickClose, "data-testid": dataTestId, autoScroll = false, actionsInline = false, style, ref, }) => {
|
|
1165
1165
|
const scrollRef = react.useRef(null);
|
|
1166
1166
|
const mergedRef = useMergeRefs([scrollRef, ref]);
|
|
1167
1167
|
const { isTextWrapping, ref: titleRef } = useIsTextWrapping();
|
|
@@ -1173,7 +1173,7 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
1175
|
}, [autoScroll]);
|
|
1176
|
-
return (jsxRuntime.jsxs("div", { className: cvaAlert({ color, actionsInline, className }), "data-testid": dataTestId, ref: mergedRef, role: "alert", children: [jsxRuntime.jsxs("div", { className: cvaAlertContentContainer({
|
|
1176
|
+
return (jsxRuntime.jsxs("div", { className: cvaAlert({ color, actionsInline, className }), "data-testid": dataTestId, ref: mergedRef, role: "alert", style: style, children: [jsxRuntime.jsxs("div", { className: cvaAlertContentContainer({
|
|
1177
1177
|
inline: !isTextWrapping && (children === null || children === undefined),
|
|
1178
1178
|
actionsInline,
|
|
1179
1179
|
}), children: [jsxRuntime.jsx("div", { className: cvaAlertIconContainer({
|
|
@@ -1295,7 +1295,7 @@ const cvaBadge = cssClassVarianceUtilities.cvaMerge([
|
|
|
1295
1295
|
* @param {BadgeProps} props - The props for the Badge component
|
|
1296
1296
|
* @returns {ReactElement} Badge component
|
|
1297
1297
|
*/
|
|
1298
|
-
const Badge = ({ color = "primary", size = "default", compact = false, className, count, max, hideZero = false, "data-testid": dataTestId, ref, }) => {
|
|
1298
|
+
const Badge = ({ color = "primary", size = "default", compact = false, className, count, max, hideZero = false, "data-testid": dataTestId, style, ref, }) => {
|
|
1299
1299
|
if (hideZero && count === 0) {
|
|
1300
1300
|
return null;
|
|
1301
1301
|
}
|
|
@@ -1305,7 +1305,7 @@ const Badge = ({ color = "primary", size = "default", compact = false, className
|
|
|
1305
1305
|
: count
|
|
1306
1306
|
: count;
|
|
1307
1307
|
const isSingleChar = displayedCount?.toString().length === 1;
|
|
1308
|
-
return (jsxRuntime.jsx("span", { className: cvaBadge({ color, size, className, compact, isSingleChar }), "data-testid": dataTestId, ref: ref, children: compact ? null : displayedCount }));
|
|
1308
|
+
return (jsxRuntime.jsx("span", { className: cvaBadge({ color, size, className, compact, isSingleChar }), "data-testid": dataTestId, ref: ref, style: style, children: compact ? null : displayedCount }));
|
|
1309
1309
|
};
|
|
1310
1310
|
|
|
1311
1311
|
/**
|
|
@@ -1416,22 +1416,22 @@ const cvaBreadcrumbForMediumScreen = cssClassVarianceUtilities.cvaMerge(["flex",
|
|
|
1416
1416
|
/**
|
|
1417
1417
|
* BreadcrumbItem is a helper component that renders the individual breadcrumb item.
|
|
1418
1418
|
*/
|
|
1419
|
-
const BreadcrumbItem = ({ item, "data-testid": dataTestId }) => {
|
|
1419
|
+
const BreadcrumbItem = ({ item, "data-testid": dataTestId, className, style, }) => {
|
|
1420
1420
|
const id = sharedUtils.uuidv4();
|
|
1421
|
-
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbItem(), "data-testid": dataTestId, id: `${item.props.label}-${id}`, children: item }));
|
|
1421
|
+
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbItem({ className }), "data-testid": dataTestId, id: `${item.props.label}-${id}`, style: style, children: item }));
|
|
1422
1422
|
};
|
|
1423
1423
|
|
|
1424
1424
|
/**
|
|
1425
1425
|
* BreadcrumbForLargeScreen is a helper component that renders the breadcrumb items for large screens.
|
|
1426
1426
|
*/
|
|
1427
|
-
const BreadcrumbForLargeScreen = ({ "data-testid": dataTestId, breadcrumbItems, }) => {
|
|
1428
|
-
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForLargeScreen(), "data-testid": dataTestId, children: breadcrumbItems.map((item, index) => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `BreadcrumbItem-${dataTestId}`, item: item }, `breadcrumbItem-${index}`))) }));
|
|
1427
|
+
const BreadcrumbForLargeScreen = ({ "data-testid": dataTestId, breadcrumbItems, className, style, }) => {
|
|
1428
|
+
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForLargeScreen({ className }), "data-testid": dataTestId, style: style, children: breadcrumbItems.map((item, index) => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `BreadcrumbItem-${dataTestId}`, item: item }, `breadcrumbItem-${index}`))) }));
|
|
1429
1429
|
};
|
|
1430
1430
|
|
|
1431
1431
|
/**
|
|
1432
1432
|
* BreadcrumbForMediumScreen is a helper component that renders the breadcrumb items for medium screens.
|
|
1433
1433
|
*/
|
|
1434
|
-
const BreadcrumbForMediumScreen = ({ "data-testid": dataTestId, breadcrumbItems, }) => {
|
|
1434
|
+
const BreadcrumbForMediumScreen = ({ "data-testid": dataTestId, breadcrumbItems, className, style, }) => {
|
|
1435
1435
|
const [expanded, setExpanded] = react.useState(false);
|
|
1436
1436
|
const getReducedArray = react.useCallback(() => {
|
|
1437
1437
|
let reducedArrayElements = [];
|
|
@@ -1444,15 +1444,15 @@ const BreadcrumbForMediumScreen = ({ "data-testid": dataTestId, breadcrumbItems,
|
|
|
1444
1444
|
return reducedArrayElements;
|
|
1445
1445
|
}, [breadcrumbItems, dataTestId]);
|
|
1446
1446
|
const reducedArray = getReducedArray();
|
|
1447
|
-
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForMediumScreen({ expanded }), "data-testid": dataTestId, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${sharedUtils.uuidv4()}`))) }));
|
|
1447
|
+
return (jsxRuntime.jsx("div", { className: cvaBreadcrumbForMediumScreen({ className, expanded }), "data-testid": dataTestId, style: style, children: (!expanded && reducedArray.length !== 0 ? reducedArray : breadcrumbItems).map(item => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `breadcrumbItem-${dataTestId}`, item: item }, `${item.props.label}-${sharedUtils.uuidv4()}`))) }));
|
|
1448
1448
|
};
|
|
1449
1449
|
|
|
1450
1450
|
/**
|
|
1451
1451
|
* BreadcrumbForSmallScreen is a helper component that renders the breadcrumb items for small screens.
|
|
1452
1452
|
*/
|
|
1453
|
-
const BreadcrumbForSmallScreen = ({ "data-testid": dataTestId, breadcrumbItems, }) => {
|
|
1453
|
+
const BreadcrumbForSmallScreen = ({ "data-testid": dataTestId, breadcrumbItems, className, style, }) => {
|
|
1454
1454
|
const lastBreadcrumbItem = breadcrumbItems.slice(-1);
|
|
1455
|
-
return (jsxRuntime.jsx("div", { "data-testid": dataTestId, children: lastBreadcrumbItem.map((item, index) => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `breadcrumbItem-${dataTestId}`, item: item }, `breadcrumbItem-${index}`))) }));
|
|
1455
|
+
return (jsxRuntime.jsx("div", { className: className, "data-testid": dataTestId, style: style, children: lastBreadcrumbItem.map((item, index) => (jsxRuntime.jsx(BreadcrumbItem, { "data-testid": `breadcrumbItem-${dataTestId}`, item: item }, `breadcrumbItem-${index}`))) }));
|
|
1456
1456
|
};
|
|
1457
1457
|
|
|
1458
1458
|
/**
|
|
@@ -1504,9 +1504,9 @@ const useBreadcrumbItemsToRender = (breadcrumbItems) => {
|
|
|
1504
1504
|
* @param {BreadcrumbProps} props - The props for the Breadcrumb component
|
|
1505
1505
|
* @returns {ReactElement} Breadcrumb component
|
|
1506
1506
|
*/
|
|
1507
|
-
const Breadcrumb = ({ className, "data-testid": dataTestId, breadcrumbItems, onClickBack, ref, }) => {
|
|
1507
|
+
const Breadcrumb = ({ className, "data-testid": dataTestId, breadcrumbItems, onClickBack, style, ref, }) => {
|
|
1508
1508
|
const breadCrumbItemsToJSX = useBreadcrumbItemsToRender(breadcrumbItems);
|
|
1509
|
-
return (jsxRuntime.jsxs("div", { className: cvaBreadcrumb({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx(IconButton, { "data-testid": `backButton-${dataTestId}`, icon: jsxRuntime.jsx(Icon, { name: "ArrowLeft", size: "small" }), onClick: onClickBack, size: "small", variant: "ghost-neutral" }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(BreadcrumbContainer, { breadcrumbItems: breadCrumbItemsToJSX, "data-testid": dataTestId }) })] }));
|
|
1509
|
+
return (jsxRuntime.jsxs("div", { className: cvaBreadcrumb({ className }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx(IconButton, { "data-testid": `backButton-${dataTestId}`, icon: jsxRuntime.jsx(Icon, { name: "ArrowLeft", size: "small" }), onClick: onClickBack, size: "small", variant: "ghost-neutral" }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(BreadcrumbContainer, { breadcrumbItems: breadCrumbItemsToJSX, "data-testid": dataTestId }) })] }));
|
|
1510
1510
|
};
|
|
1511
1511
|
/**
|
|
1512
1512
|
* BreadcrumbContainer is a helper component that renders the breadcrumb items based on the screen size.
|
|
@@ -1733,13 +1733,13 @@ Card.displayName = "Card";
|
|
|
1733
1733
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
1734
1734
|
* @returns {ReactElement} CardBody component
|
|
1735
1735
|
*/
|
|
1736
|
-
const CardBody = ({ children, "data-testid": dataTestId, className, direction = "column", gap = "default", padding = "default", id, ref, }) => {
|
|
1736
|
+
const CardBody = ({ children, "data-testid": dataTestId, className, direction = "column", gap = "default", padding = "default", id, style, ref, }) => {
|
|
1737
1737
|
return (jsxRuntime.jsx("div", { className: cvaCardBodyContainer({
|
|
1738
1738
|
gap,
|
|
1739
1739
|
padding,
|
|
1740
1740
|
className,
|
|
1741
1741
|
direction,
|
|
1742
|
-
}), "data-card-body": true, "data-testid": dataTestId, id: id, ref: ref, children: children }));
|
|
1742
|
+
}), "data-card-body": true, "data-testid": dataTestId, id: id, ref: ref, style: style, children: children }));
|
|
1743
1743
|
};
|
|
1744
1744
|
|
|
1745
1745
|
/**
|
|
@@ -1791,12 +1791,12 @@ const CardBody = ({ children, "data-testid": dataTestId, className, direction =
|
|
|
1791
1791
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
1792
1792
|
* @returns {ReactElement} CardFooter component
|
|
1793
1793
|
*/
|
|
1794
|
-
const CardFooter = ({ "data-testid": dataTestId, className, children, padding = "default", hideSeparator = false, ref, }) => {
|
|
1794
|
+
const CardFooter = ({ "data-testid": dataTestId, className, children, padding = "default", hideSeparator = false, style, ref, }) => {
|
|
1795
1795
|
return (jsxRuntime.jsx("div", { className: cvaCardFooterContainerRoot({
|
|
1796
1796
|
border: hideSeparator ? "borderless" : "default",
|
|
1797
1797
|
padding,
|
|
1798
1798
|
className,
|
|
1799
|
-
}), "data-card-footer": true, "data-testid": dataTestId, ref: ref, children: jsxRuntime.jsx("div", { className: cvaCardFooterContainer(), children: children }) }));
|
|
1799
|
+
}), "data-card-footer": true, "data-testid": dataTestId, ref: ref, style: style, children: jsxRuntime.jsx("div", { className: cvaCardFooterContainer(), children: children }) }));
|
|
1800
1800
|
};
|
|
1801
1801
|
|
|
1802
1802
|
const cvaHeading = cssClassVarianceUtilities.cvaMerge(["m-0", "leading-normal", "text-black"], {
|
|
@@ -1919,12 +1919,12 @@ const Heading = ({ variant = "primary", inverted = false, subtle = false, classN
|
|
|
1919
1919
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
1920
1920
|
* @returns {ReactElement} CardHeader component
|
|
1921
1921
|
*/
|
|
1922
|
-
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClickClose, "data-testid": dataTestId, className, children, accessories, actions, padding = "default", hideSeparator = false, ref, }) => {
|
|
1922
|
+
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClickClose, "data-testid": dataTestId, className, children, accessories, actions, padding = "default", hideSeparator = false, style, ref, }) => {
|
|
1923
1923
|
return (jsxRuntime.jsx("div", { className: cvaCardHeaderContainer({
|
|
1924
1924
|
border: hideSeparator ? "borderless" : "default",
|
|
1925
1925
|
padding,
|
|
1926
1926
|
className,
|
|
1927
|
-
}), "data-card-header": true, "data-testid": dataTestId, ref: ref, 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, onClickClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClickClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1927
|
+
}), "data-card-header": true, "data-testid": dataTestId, ref: ref, style: style, 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, onClickClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClickClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1928
1928
|
};
|
|
1929
1929
|
|
|
1930
1930
|
const cvaClickable = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -2195,7 +2195,7 @@ const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge(["transition-transform
|
|
|
2195
2195
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
2196
2196
|
* @returns {ReactElement} Collapse component
|
|
2197
2197
|
*/
|
|
2198
|
-
const Collapse = ({ id, variant = "primary", initialExpanded = false, onToggle, label, children, className, headerClassName, headerAddon, "data-testid": dataTestId, animate = true, extraPadding = true, ref, }) => {
|
|
2198
|
+
const Collapse = ({ id, variant = "primary", initialExpanded = false, onToggle, label, children, className, headerClassName, headerAddon, "data-testid": dataTestId, animate = true, extraPadding = true, style, ref, }) => {
|
|
2199
2199
|
const LABEL_ID = sharedUtils.uuidv4();
|
|
2200
2200
|
const [expanded, setExpanded] = react.useState(initialExpanded);
|
|
2201
2201
|
const handleClick = react.useCallback((e) => {
|
|
@@ -2204,7 +2204,7 @@ const Collapse = ({ id, variant = "primary", initialExpanded = false, onToggle,
|
|
|
2204
2204
|
}
|
|
2205
2205
|
setExpanded(!expanded);
|
|
2206
2206
|
}, [expanded, onToggle]);
|
|
2207
|
-
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ variant: variant, className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, variant, extraPadding, className: headerClassName }), onClick: handleClick, role: "button", children: jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer({ variant }), children: [jsxRuntime.jsx(Text, { className: cvaCollapseLabel({ variant }), id: LABEL_ID, size: variant === "secondary" ? "small" : "medium", type: "span", weight: "bold", children: label }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [headerAddon !== null && headerAddon !== undefined && variant !== "secondary" ? headerAddon : null, jsxRuntime.jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronDown", size: variant === "secondary" ? "small" : "medium" })] })] }) }), jsxRuntime.jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, variant: variant, children: expanded || animate ? children : null })] }));
|
|
2207
|
+
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ variant: variant, className }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, variant, extraPadding, className: headerClassName }), onClick: handleClick, role: "button", children: jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer({ variant }), children: [jsxRuntime.jsx(Text, { className: cvaCollapseLabel({ variant }), id: LABEL_ID, size: variant === "secondary" ? "small" : "medium", type: "span", weight: "bold", children: label }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [headerAddon !== null && headerAddon !== undefined && variant !== "secondary" ? headerAddon : null, jsxRuntime.jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronDown", size: variant === "secondary" ? "small" : "medium" })] })] }) }), jsxRuntime.jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, variant: variant, children: expanded || animate ? children : null })] }));
|
|
2208
2208
|
};
|
|
2209
2209
|
const Collapsible = ({ children, expanded, id, variant, extraPadding }) => {
|
|
2210
2210
|
const { geometry, ref } = useMeasure();
|
|
@@ -2557,9 +2557,20 @@ const usePopover = ({ initialOpen = false, placement = "bottom", isModal, isOpen
|
|
|
2557
2557
|
customProps: {
|
|
2558
2558
|
id,
|
|
2559
2559
|
className,
|
|
2560
|
-
"data-testid": dataTestId
|
|
2560
|
+
"data-testid": dataTestId,
|
|
2561
2561
|
},
|
|
2562
|
-
}), [
|
|
2562
|
+
}), [
|
|
2563
|
+
isOpen,
|
|
2564
|
+
setUncontrolledIsOpen,
|
|
2565
|
+
combinedInteractions,
|
|
2566
|
+
popoverData,
|
|
2567
|
+
isModal,
|
|
2568
|
+
labelId,
|
|
2569
|
+
descriptionId,
|
|
2570
|
+
id,
|
|
2571
|
+
className,
|
|
2572
|
+
dataTestId,
|
|
2573
|
+
]);
|
|
2563
2574
|
};
|
|
2564
2575
|
|
|
2565
2576
|
const PopoverContext = react.createContext(null);
|
|
@@ -2997,7 +3008,7 @@ const Content = ({ text, withIcon, }) => {
|
|
|
2997
3008
|
* @param {CopyableTextProps} props - The props for the CopyableText component
|
|
2998
3009
|
* @returns {ReactElement} CopyableText component
|
|
2999
3010
|
*/
|
|
3000
|
-
const CopyableText = ({ text, withIcon = true, size = "sm", copyLabel = "Copy", copiedLabel = "Copied!", "data-testid": dataTestId, className, ref, }) => {
|
|
3011
|
+
const CopyableText = ({ text, withIcon = true, size = "sm", copyLabel = "Copy", copiedLabel = "Copied!", "data-testid": dataTestId, className, style, ref, }) => {
|
|
3001
3012
|
const [animating, setAnimating] = react.useState(false);
|
|
3002
3013
|
const [showCopied, setShowCopied] = react.useState(false);
|
|
3003
3014
|
const [, copyToClipboard] = useCopyToClipboard();
|
|
@@ -3022,7 +3033,7 @@ const CopyableText = ({ text, withIcon = true, size = "sm", copyLabel = "Copy",
|
|
|
3022
3033
|
if (hovering) {
|
|
3023
3034
|
e.currentTarget.blur();
|
|
3024
3035
|
}
|
|
3025
|
-
}, onMouseEnter: onMouseEnter, onMouseLeave: handleMouseLeave, ref: ref, type: "button", children: jsxRuntime.jsx(Content, { text: text, withIcon: withIcon }) }) }));
|
|
3036
|
+
}, onMouseEnter: onMouseEnter, onMouseLeave: handleMouseLeave, ref: ref, style: style, type: "button", children: jsxRuntime.jsx(Content, { text: text, withIcon: withIcon }) }) }));
|
|
3026
3037
|
};
|
|
3027
3038
|
|
|
3028
3039
|
const cvaDetailsList = cssClassVarianceUtilities.cvaMerge(["flex", "w-full", "min-w-0", "items-center", "truncate", "text-xs", "text-neutral-600", "font-medium", "pt-0"], {
|
|
@@ -3068,10 +3079,26 @@ const cvaDetailsListItem = cssClassVarianceUtilities.cvaMerge(["last:truncate"])
|
|
|
3068
3079
|
* @param {DetailsListProps} props - The props for the DetailsList component
|
|
3069
3080
|
* @returns {ReactElement} DetailsList component
|
|
3070
3081
|
*/
|
|
3071
|
-
const DetailsList = ({ details, className, hasLink = false, ref }) => {
|
|
3072
|
-
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className, hasLink }), ref: ref, children: details.map((value, index, array) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsxRuntime.jsx("div", { className: "mx-0.5 flex items-center", children: jsxRuntime.jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
3082
|
+
const DetailsList = ({ details, className, "data-testid": dataTestId, hasLink = false, style, ref, }) => {
|
|
3083
|
+
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className, hasLink }), "data-testid": dataTestId, ref: ref, style: style, children: details.map((value, index, array) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsxRuntime.jsx("div", { className: "mx-0.5 flex items-center", children: jsxRuntime.jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
3073
3084
|
};
|
|
3074
3085
|
|
|
3086
|
+
/**
|
|
3087
|
+
* Merges inline styles where `base` defines component defaults and `override` (typically from props) wins on conflicts.
|
|
3088
|
+
*/
|
|
3089
|
+
function mergeDomStyles(base, override) {
|
|
3090
|
+
if (base === undefined && override === undefined) {
|
|
3091
|
+
return undefined;
|
|
3092
|
+
}
|
|
3093
|
+
if (base === undefined) {
|
|
3094
|
+
return override;
|
|
3095
|
+
}
|
|
3096
|
+
if (override === undefined) {
|
|
3097
|
+
return base;
|
|
3098
|
+
}
|
|
3099
|
+
return { ...base, ...override };
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3075
3102
|
const VALID_SIZE_KEYS = [
|
|
3076
3103
|
"xs",
|
|
3077
3104
|
"sm",
|
|
@@ -3227,14 +3254,14 @@ const cvaSkeleton = cssClassVarianceUtilities.cvaMerge([
|
|
|
3227
3254
|
* @returns {ReactElement} SkeletonLabel component
|
|
3228
3255
|
*/
|
|
3229
3256
|
const SkeletonLabel = react.memo((props) => {
|
|
3230
|
-
const { width = "100%", textSize = "text-base", flexibleWidth = true, className, "data-testid": dataTestId, children, ref, } = props;
|
|
3257
|
+
const { width = "100%", textSize = "text-base", flexibleWidth = true, className, "data-testid": dataTestId, children, style, ref, } = props;
|
|
3231
3258
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
3232
3259
|
const heightValue = getHeightValue(textSize);
|
|
3233
|
-
return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ textSize, className }), "data-testid": dataTestId, ref: ref, role: "status", style: {
|
|
3260
|
+
return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ textSize, className }), "data-testid": dataTestId, ref: ref, role: "status", style: mergeDomStyles({
|
|
3234
3261
|
width: flexibleWidth ? "100%" : widthValue,
|
|
3235
3262
|
maxWidth: flexibleWidth ? widthValue : undefined,
|
|
3236
3263
|
height: heightValue,
|
|
3237
|
-
}, children: children }));
|
|
3264
|
+
}, style), children: children }));
|
|
3238
3265
|
});
|
|
3239
3266
|
SkeletonLabel.displayName = "SkeletonLabel";
|
|
3240
3267
|
|
|
@@ -3350,7 +3377,7 @@ WorkerWithSignSVG.displayName = "WorkerWithSignSVG";
|
|
|
3350
3377
|
* );
|
|
3351
3378
|
* ```
|
|
3352
3379
|
*/
|
|
3353
|
-
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading = false, "data-testid": dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, }) => {
|
|
3380
|
+
const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customImageSrc, loading = false, "data-testid": dataTestId, className, primaryAction, secondaryAction, additionalHelpAction, style, ref, }) => {
|
|
3354
3381
|
const ImageSource = react.useMemo(() => {
|
|
3355
3382
|
switch (image) {
|
|
3356
3383
|
case "WORKER_WITH_SIGN":
|
|
@@ -3368,7 +3395,7 @@ const EmptyState = ({ description, altText, image = "SEARCH_DOCUMENT", customIma
|
|
|
3368
3395
|
return SearchDocumentSVG;
|
|
3369
3396
|
}
|
|
3370
3397
|
}, [image]);
|
|
3371
|
-
return (jsxRuntime.jsx("div", { className: cvaContainerStyles({ className }), "data-testid": dataTestId ?? "empty-state", children: loading ? (jsxRuntime.jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsxRuntime.jsx(Spinner, { centering: "centered", "data-testid": "spinner" }), jsxRuntime.jsx(SkeletonLabel, { textSize: "text-base", width: "clamp(20%, 200px, 80%)" })] })) : (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: "medium", 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, { "data-testid": "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, { "data-testid": "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, "data-testid": "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] })] })) }));
|
|
3398
|
+
return (jsxRuntime.jsx("div", { className: cvaContainerStyles({ className }), "data-testid": dataTestId ?? "empty-state", ref: ref, style: style, children: loading ? (jsxRuntime.jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsxRuntime.jsx(Spinner, { centering: "centered", "data-testid": "spinner" }), jsxRuntime.jsx(SkeletonLabel, { textSize: "text-base", width: "clamp(20%, 200px, 80%)" })] })) : (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: "medium", 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, { "data-testid": "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, { "data-testid": "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, "data-testid": "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] })] })) }));
|
|
3372
3399
|
};
|
|
3373
3400
|
|
|
3374
3401
|
const cvaEmptyValue = cssClassVarianceUtilities.cvaMerge(["text-neutral-400"]);
|
|
@@ -3397,8 +3424,8 @@ const cvaEmptyValue = cssClassVarianceUtilities.cvaMerge(["text-neutral-400"]);
|
|
|
3397
3424
|
* @param {EmptyValueProps} props - The props for the EmptyValue component
|
|
3398
3425
|
* @returns {ReactElement} EmptyValue component
|
|
3399
3426
|
*/
|
|
3400
|
-
const EmptyValue = ({ className, "data-testid": dataTestId }) => {
|
|
3401
|
-
return (jsxRuntime.jsx("div", { className: cvaEmptyValue({ className }), "data-testid": dataTestId, children: "-" }));
|
|
3427
|
+
const EmptyValue = ({ className, "data-testid": dataTestId, style, ref }) => {
|
|
3428
|
+
return (jsxRuntime.jsx("div", { className: cvaEmptyValue({ className }), "data-testid": dataTestId, ref: ref, style: style, children: "-" }));
|
|
3402
3429
|
};
|
|
3403
3430
|
|
|
3404
3431
|
const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "decoration-[1.5px]", "underline-offset-2", "text-sm"], {
|
|
@@ -3469,8 +3496,8 @@ const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "decora
|
|
|
3469
3496
|
* @param {ExternalLinkProps} props - The props for the ExternalLink component
|
|
3470
3497
|
* @returns {ReactElement} ExternalLink component
|
|
3471
3498
|
*/
|
|
3472
|
-
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, "data-testid": dataTestId, onClick, color = "primary", ref, }) => {
|
|
3473
|
-
return (jsxRuntime.jsx("a", { className: cvaExternalLink({ className, color }), "data-testid": dataTestId, href: href, onClick: onClick, ref: ref, rel: rel, target: target, title: title, children: children }));
|
|
3499
|
+
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, "data-testid": dataTestId, onClick, color = "primary", style, ref, }) => {
|
|
3500
|
+
return (jsxRuntime.jsx("a", { className: cvaExternalLink({ className, color }), "data-testid": dataTestId, href: href, onClick: onClick, ref: ref, rel: rel, style: style, target: target, title: title, children: children }));
|
|
3474
3501
|
};
|
|
3475
3502
|
|
|
3476
3503
|
// =============================================================================
|
|
@@ -3613,9 +3640,9 @@ function createGrid() {
|
|
|
3613
3640
|
* }
|
|
3614
3641
|
* ```
|
|
3615
3642
|
*/
|
|
3616
|
-
function GridAreas({ slots, css, containerProps, validationRef, className, children, asChild = false, }) {
|
|
3643
|
+
function GridAreas({ slots, css, containerProps, validationRef, className, style, children, asChild = false, }) {
|
|
3617
3644
|
const Comp = asChild ? reactSlot.Slot : "div";
|
|
3618
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("style", { children: css }), jsxRuntime.jsx(Comp, { ref: validationRef, ...containerProps, className: tailwindMerge.twMerge("@container grid", className), children: children(slots) })] }));
|
|
3645
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("style", { children: css }), jsxRuntime.jsx(Comp, { ref: validationRef, ...containerProps, className: tailwindMerge.twMerge("@container grid", className), style: style, children: children(slots) })] }));
|
|
3619
3646
|
}
|
|
3620
3647
|
|
|
3621
3648
|
/**
|
|
@@ -4294,8 +4321,8 @@ const cvaHighlightText = cssClassVarianceUtilities.cvaMerge(["truncate"]);
|
|
|
4294
4321
|
* @param {HighlightProps} props - The props for the Highlight component
|
|
4295
4322
|
* @returns {ReactElement} Highlight component
|
|
4296
4323
|
*/
|
|
4297
|
-
const Highlight = ({ className, "data-testid": dataTestId, children, size = "small", color = "warning", ref, }) => {
|
|
4298
|
-
return (jsxRuntime.jsx("div", { className: cvaHighlight({ className, size, color }), "data-testid": dataTestId, ref: ref, children: jsxRuntime.jsx("span", { className: cvaHighlightText(), children: children }) }));
|
|
4324
|
+
const Highlight = ({ className, "data-testid": dataTestId, children, size = "small", color = "warning", style, ref, }) => {
|
|
4325
|
+
return (jsxRuntime.jsx("div", { className: cvaHighlight({ className, size, color }), "data-testid": dataTestId, ref: ref, style: style, children: jsxRuntime.jsx("span", { className: cvaHighlightText(), children: children }) }));
|
|
4299
4326
|
};
|
|
4300
4327
|
Highlight.displayName = "Highlight";
|
|
4301
4328
|
|
|
@@ -4579,8 +4606,8 @@ const cvaZStackItem = cssClassVarianceUtilities.cvaMerge(["col-start-1", "col-en
|
|
|
4579
4606
|
* @param {ZStackProps} props - The props for the ZStack component
|
|
4580
4607
|
* @returns {ReactElement} ZStack component
|
|
4581
4608
|
*/
|
|
4582
|
-
const ZStack = ({ children, className, "data-testid": dataTestId, ref }) => {
|
|
4583
|
-
return (jsxRuntime.jsx("div", { className: cvaZStackContainer({ className }), "data-testid": dataTestId, ref: ref, children: react.Children.map(children, (child, index) => {
|
|
4609
|
+
const ZStack = ({ children, className, "data-testid": dataTestId, style, ref }) => {
|
|
4610
|
+
return (jsxRuntime.jsx("div", { className: cvaZStackContainer({ className }), "data-testid": dataTestId, ref: ref, style: style, children: react.Children.map(children, (child, index) => {
|
|
4584
4611
|
if (!react.isValidElement(child)) {
|
|
4585
4612
|
return child;
|
|
4586
4613
|
}
|
|
@@ -4648,9 +4675,9 @@ const cvaOverflowIndicatorButton = cssClassVarianceUtilities.cvaMerge([
|
|
|
4648
4675
|
* @param {OverflowIndicatorProps} props - The props for the component
|
|
4649
4676
|
* @returns {ReactElement} OverflowIndicator component
|
|
4650
4677
|
*/
|
|
4651
|
-
const OverflowIndicator = ({ className, "data-testid": dataTestId, direction, onClickScroll, }) => {
|
|
4678
|
+
const OverflowIndicator = ({ className, "data-testid": dataTestId, direction, onClickScroll, style, }) => {
|
|
4652
4679
|
const iconName = direction === "left" ? "ChevronLeft" : "ChevronRight";
|
|
4653
|
-
return (jsxRuntime.jsxs(ZStack, { className: cvaOverflowIndicatorContainer({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { className: cvaJustificationContainer({ direction }), children: jsxRuntime.jsx("div", { className: cvaOverflowIndicatorGradient({ direction }), "data-testid": dataTestId ? `${dataTestId}-gradient` : undefined }) }), jsxRuntime.jsx("div", { className: cvaJustificationContainer({ direction }), children: jsxRuntime.jsx(IconButton, { className: cvaOverflowIndicatorButton(), "data-testid": dataTestId ? `${dataTestId}-button` : undefined, icon: jsxRuntime.jsx(Icon, { name: iconName, size: "small" }), onClick: onClickScroll, size: "small", variant: "secondary" }) })] }));
|
|
4680
|
+
return (jsxRuntime.jsxs(ZStack, { className: cvaOverflowIndicatorContainer({ className }), "data-testid": dataTestId, style: style, children: [jsxRuntime.jsx("div", { className: cvaJustificationContainer({ direction }), children: jsxRuntime.jsx("div", { className: cvaOverflowIndicatorGradient({ direction }), "data-testid": dataTestId ? `${dataTestId}-gradient` : undefined }) }), jsxRuntime.jsx("div", { className: cvaJustificationContainer({ direction }), children: jsxRuntime.jsx(IconButton, { className: cvaOverflowIndicatorButton(), "data-testid": dataTestId ? `${dataTestId}-button` : undefined, icon: jsxRuntime.jsx(Icon, { name: iconName, size: "small" }), onClick: onClickScroll, size: "small", variant: "secondary" }) })] }));
|
|
4654
4681
|
};
|
|
4655
4682
|
|
|
4656
4683
|
/**
|
|
@@ -4680,7 +4707,7 @@ const OverflowIndicator = ({ className, "data-testid": dataTestId, direction, on
|
|
|
4680
4707
|
* @param {HorizontalOverflowScrollerProps} props - The props for the HorizontalOverflowScroller component
|
|
4681
4708
|
* @returns {ReactElement} HorizontalOverflowScroller component
|
|
4682
4709
|
*/
|
|
4683
|
-
const HorizontalOverflowScroller = ({ className, "data-testid": dataTestId, children, onScrollStateChange, ref, }) => {
|
|
4710
|
+
const HorizontalOverflowScroller = ({ className, "data-testid": dataTestId, children, onScrollStateChange, style, ref, }) => {
|
|
4684
4711
|
const childrenArray = react.Children.toArray(children);
|
|
4685
4712
|
const { geometry: containerGeometry, ref: measureRef, element } = useMeasure();
|
|
4686
4713
|
const { ref: scrollRef, isScrollable, isAtBeginning, isAtEnd, } = useScrollDetection({
|
|
@@ -4710,7 +4737,7 @@ const HorizontalOverflowScroller = ({ className, "data-testid": dataTestId, chil
|
|
|
4710
4737
|
behavior: "smooth",
|
|
4711
4738
|
});
|
|
4712
4739
|
};
|
|
4713
|
-
return (jsxRuntime.jsxs(ZStack, { className: cvaHorizontalOverflowScrollerAndIndicatorsContainer({ className }), children: [jsxRuntime.jsx("div", { className: cvaHorizontalOverflowScroller(), "data-testid": dataTestId, ref: mergedRef, children: childrenArray.map((child, index) => (jsxRuntime.jsx(react.Fragment, { children: child }, index))) }), isScrollable && !isAtBeginning ? (jsxRuntime.jsx(OverflowIndicator, { "data-testid": `${dataTestId}-left-indicator`, direction: "left", onClickScroll: handleScrollLeft })) : null, isScrollable && !isAtEnd ? (jsxRuntime.jsx(OverflowIndicator, { "data-testid": `${dataTestId}-right-indicator`, direction: "right", onClickScroll: handleScrollRight })) : null] }));
|
|
4740
|
+
return (jsxRuntime.jsxs(ZStack, { className: cvaHorizontalOverflowScrollerAndIndicatorsContainer({ className }), style: style, children: [jsxRuntime.jsx("div", { className: cvaHorizontalOverflowScroller(), "data-testid": dataTestId, ref: mergedRef, children: childrenArray.map((child, index) => (jsxRuntime.jsx(react.Fragment, { children: child }, index))) }), isScrollable && !isAtBeginning ? (jsxRuntime.jsx(OverflowIndicator, { "data-testid": `${dataTestId}-left-indicator`, direction: "left", onClickScroll: handleScrollLeft })) : null, isScrollable && !isAtEnd ? (jsxRuntime.jsx(OverflowIndicator, { "data-testid": `${dataTestId}-right-indicator`, direction: "right", onClickScroll: handleScrollRight })) : null] }));
|
|
4714
4741
|
};
|
|
4715
4742
|
|
|
4716
4743
|
const cvaIndicator = cssClassVarianceUtilities.cvaMerge(["inline-flex", "items-center"]);
|
|
@@ -5044,8 +5071,8 @@ const KPISkeleton = ({ variant = "default", className, "data-testid": dataTestId
|
|
|
5044
5071
|
* @param {TrendIndicatorProps} props - The props for the TrendIndicator component
|
|
5045
5072
|
* @returns {ReactElement} TrendIndicator component
|
|
5046
5073
|
*/
|
|
5047
|
-
const TrendIndicator = ({ value, trend, label, icon = undefined, color = undefined, "data-testid": dataTestId, className, ref, }) => {
|
|
5048
|
-
return (jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-row items-center gap-1", className), "data-testid": dataTestId, ref: ref, children: [value !== undefined ? (jsxRuntime.jsx(Text, { "data-testid": dataTestId ? `${dataTestId}-value` : undefined, size: "small", weight: "normal", children: value })) : null, jsxRuntime.jsxs("div", { className: "flex items-center", children: [icon ? (jsxRuntime.jsx(Icon, { color: color, "data-testid": dataTestId ? `${dataTestId}-icon` : undefined, name: icon, size: "small" })) : null, jsxRuntime.jsx(Text, { className: cvaKPITrendPercentage({ color }), "data-testid": dataTestId ? `${dataTestId}-trend` : undefined, size: "small", weight: "bold", children: trend })] }), jsxRuntime.jsx(Text, { "data-testid": dataTestId ? `${dataTestId}-label` : undefined, size: "small", weight: "normal", children: label })] }));
|
|
5074
|
+
const TrendIndicator = ({ value, trend, label, icon = undefined, color = undefined, "data-testid": dataTestId, className, style, ref, }) => {
|
|
5075
|
+
return (jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-row items-center gap-1", className), "data-testid": dataTestId, ref: ref, style: style, children: [value !== undefined ? (jsxRuntime.jsx(Text, { "data-testid": dataTestId ? `${dataTestId}-value` : undefined, size: "small", weight: "normal", children: value })) : null, jsxRuntime.jsxs("div", { className: "flex items-center", children: [icon ? (jsxRuntime.jsx(Icon, { color: color, "data-testid": dataTestId ? `${dataTestId}-icon` : undefined, name: icon, size: "small" })) : null, jsxRuntime.jsx(Text, { className: cvaKPITrendPercentage({ color }), "data-testid": dataTestId ? `${dataTestId}-trend` : undefined, size: "small", weight: "bold", children: trend })] }), jsxRuntime.jsx(Text, { "data-testid": dataTestId ? `${dataTestId}-label` : undefined, size: "small", weight: "normal", children: label })] }));
|
|
5049
5076
|
};
|
|
5050
5077
|
|
|
5051
5078
|
/**
|
|
@@ -5054,8 +5081,8 @@ const TrendIndicator = ({ value, trend, label, icon = undefined, color = undefin
|
|
|
5054
5081
|
* @param {TrendIndicatorsProps} props - The props for the TrendIndicators component
|
|
5055
5082
|
* @returns {ReactElement} TrendIndicators component
|
|
5056
5083
|
*/
|
|
5057
|
-
const TrendIndicators = ({ trends, "data-testid": dataTestId, className, ref, }) => {
|
|
5058
|
-
return (jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("flex flex-row items-center gap-1", className), "data-testid": dataTestId, ref: ref, children: trends.map((trend, index) => (jsxRuntime.jsx(TrendIndicator, { "data-testid": dataTestId ? `${dataTestId}-trend-indicator-${index}` : undefined, ...trend }, index))) }));
|
|
5084
|
+
const TrendIndicators = ({ trends, "data-testid": dataTestId, className, style, ref, }) => {
|
|
5085
|
+
return (jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("flex flex-row items-center gap-1", className), "data-testid": dataTestId, ref: ref, style: style, children: trends.map((trend, index) => (jsxRuntime.jsx(TrendIndicator, { "data-testid": dataTestId ? `${dataTestId}-trend-indicator-${index}` : undefined, ...trend }, index))) }));
|
|
5059
5086
|
};
|
|
5060
5087
|
|
|
5061
5088
|
const valueBarContainerClassName = "relative flex w-full items-center gap-2";
|
|
@@ -5202,11 +5229,11 @@ const getValueBarColorByValue = (value, min, max, levelColors) => {
|
|
|
5202
5229
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
5203
5230
|
* @returns {ReactElement} ValueBar component
|
|
5204
5231
|
*/
|
|
5205
|
-
const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors, valueColor, showValue = false, className, "data-testid": dataTestId, zeroScoreAllowed = false, ref, }) => {
|
|
5232
|
+
const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors, valueColor, showValue = false, className, "data-testid": dataTestId, zeroScoreAllowed = false, style, ref, }) => {
|
|
5206
5233
|
const score = getScore(value, min, max, zeroScoreAllowed);
|
|
5207
5234
|
const barFillColor = levelColors ? getFillColor(score, levelColors) : getDefaultFillColor(score);
|
|
5208
5235
|
const valueText = `${Number(value.toFixed(1))}${sharedUtils.nonNullable(unit) ? unit : ""}`;
|
|
5209
|
-
return (jsxRuntime.jsxs("span", { className: valueBarContainerClassName, "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("progress", { "aria-label": valueText, className: cvaValueBar({ className, size }), max: 100, style: { color: barFillColor }, value: score * 100 }), showValue && (size === "small" || size === "large") ? (jsxRuntime.jsx(Text, { className: cvaValueBarText({ size }), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: jsxRuntime.jsx("span", { style: valueColor ? { color: valueColor } : undefined, children: valueText }) })) : null] }));
|
|
5236
|
+
return (jsxRuntime.jsxs("span", { className: valueBarContainerClassName, "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx("progress", { "aria-label": valueText, className: cvaValueBar({ className, size }), max: 100, style: { color: barFillColor }, value: score * 100 }), showValue && (size === "small" || size === "large") ? (jsxRuntime.jsx(Text, { className: cvaValueBarText({ size }), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: jsxRuntime.jsx("span", { style: valueColor ? { color: valueColor } : undefined, children: valueText }) })) : null] }));
|
|
5210
5237
|
};
|
|
5211
5238
|
|
|
5212
5239
|
const cvaKPICard = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -5330,14 +5357,14 @@ const KPICard = ({ isActive = false, onClick, className, "data-testid": dataTest
|
|
|
5330
5357
|
* @returns {ReactElement} SkeletonBlock component
|
|
5331
5358
|
*/
|
|
5332
5359
|
const SkeletonBlock = react.memo((props) => {
|
|
5333
|
-
const { width = "100%", height = 16, flexibleWidth = false, className, "data-testid": dataTestId, children, ref, } = props;
|
|
5360
|
+
const { width = "100%", height = 16, flexibleWidth = false, className, "data-testid": dataTestId, children, style, ref, } = props;
|
|
5334
5361
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
5335
5362
|
const heightValue = typeof height === "number" ? `${height}px` : height;
|
|
5336
|
-
return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ className }), "data-testid": dataTestId, ref: ref, role: "status", style: {
|
|
5363
|
+
return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ className }), "data-testid": dataTestId, ref: ref, role: "status", style: mergeDomStyles({
|
|
5337
5364
|
width: flexibleWidth ? "100%" : widthValue,
|
|
5338
5365
|
maxWidth: flexibleWidth ? widthValue : undefined,
|
|
5339
5366
|
height: heightValue,
|
|
5340
|
-
}, children: children }));
|
|
5367
|
+
}, style), children: children }));
|
|
5341
5368
|
});
|
|
5342
5369
|
SkeletonBlock.displayName = "SkeletonBlock";
|
|
5343
5370
|
|
|
@@ -5469,29 +5496,29 @@ const DEFAULT_SKELETON_LIST_ITEM_PROPS = {
|
|
|
5469
5496
|
* @param {ListItemSkeletonProps} props - The props for the ListItemSkeleton component
|
|
5470
5497
|
* @returns {ReactElement} ListItemSkeleton component
|
|
5471
5498
|
*/
|
|
5472
|
-
const ListItemSkeleton = ({ hasThumbnail = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasThumbnail, thumbnailShape = "circle", hasDescription = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasDescription, hasMeta = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasMeta, hasDetails = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasDetails, }) => {
|
|
5499
|
+
const ListItemSkeleton = ({ hasThumbnail = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasThumbnail, thumbnailShape = "circle", hasDescription = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasDescription, hasMeta = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasMeta, hasDetails = DEFAULT_SKELETON_LIST_ITEM_PROPS.hasDetails, className, "data-testid": dataTestId, style, }) => {
|
|
5473
5500
|
// Generate stable random widths once and never change them
|
|
5474
5501
|
const [titleWidth, descriptionWidth, metaWidth, detailsWidth] = useRandomCSSLengths({
|
|
5475
5502
|
count: 4,
|
|
5476
5503
|
min: 25,
|
|
5477
5504
|
max: 85,
|
|
5478
5505
|
});
|
|
5479
|
-
return (jsxRuntime.jsxs("div", { className: cvaListItem({ className: "w-full" }), children: [jsxRuntime.jsxs("div", { className: cvaMainInformationClass({ hasThumbnail, className: "w-full" }), children: [hasThumbnail ? (jsxRuntime.jsx("div", { className: cvaThumbnailContainer({ className: "bg-gray-200" }), children: jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("bg-neutral-300", thumbnailShape === "circle" ? "rounded-full" : "rounded"), style: { width: 20, height: 20 } }) })) : null, jsxRuntime.jsxs("div", { className: cvaTextContainer(), children: [jsxRuntime.jsx("div", { className: cvaTitleRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: titleWidth }) }), hasDescription ? (jsxRuntime.jsx("div", { className: cvaDescriptionRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: descriptionWidth }) })) : null, hasMeta ? (jsxRuntime.jsx("div", { className: cvaMetaRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: metaWidth }) })) : null] })] }), hasDetails ? (jsxRuntime.jsx("div", { className: cvaDetailsContainer(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: detailsWidth }) })) : null] }));
|
|
5506
|
+
return (jsxRuntime.jsxs("div", { className: cvaListItem({ className: tailwindMerge.twMerge("w-full", className) }), "data-testid": dataTestId, style: style, children: [jsxRuntime.jsxs("div", { className: cvaMainInformationClass({ hasThumbnail, className: "w-full" }), children: [hasThumbnail ? (jsxRuntime.jsx("div", { className: cvaThumbnailContainer({ className: "bg-gray-200" }), children: jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("bg-neutral-300", thumbnailShape === "circle" ? "rounded-full" : "rounded"), style: { width: 20, height: 20 } }) })) : null, jsxRuntime.jsxs("div", { className: cvaTextContainer(), children: [jsxRuntime.jsx("div", { className: cvaTitleRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: titleWidth }) }), hasDescription ? (jsxRuntime.jsx("div", { className: cvaDescriptionRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: descriptionWidth }) })) : null, hasMeta ? (jsxRuntime.jsx("div", { className: cvaMetaRow(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: metaWidth }) })) : null] })] }), hasDetails ? (jsxRuntime.jsx("div", { className: cvaDetailsContainer(), children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: detailsWidth }) })) : null] }));
|
|
5480
5507
|
};
|
|
5481
5508
|
|
|
5482
5509
|
/**
|
|
5483
5510
|
*
|
|
5484
5511
|
*/
|
|
5485
|
-
const ListLoadingIndicator = ({ type, hasThumbnail, thumbnailShape, hasDescription, component, hasMeta, hasDetails, }) => {
|
|
5512
|
+
const ListLoadingIndicator = ({ type, hasThumbnail, thumbnailShape, hasDescription, component, hasMeta, hasDetails, style, }) => {
|
|
5486
5513
|
switch (type) {
|
|
5487
5514
|
case "none":
|
|
5488
5515
|
return null;
|
|
5489
5516
|
case "spinner":
|
|
5490
|
-
return jsxRuntime.jsx(Spinner, { centering: "horizontally", containerClassName: "p-4" });
|
|
5517
|
+
return jsxRuntime.jsx(Spinner, { centering: "horizontally", containerClassName: "p-4", style: style });
|
|
5491
5518
|
case "custom":
|
|
5492
|
-
return component;
|
|
5519
|
+
return (jsxRuntime.jsx("div", { className: "flex w-full justify-center p-4", style: style, children: component }));
|
|
5493
5520
|
case "skeleton":
|
|
5494
|
-
return (jsxRuntime.jsx(ListItemSkeleton, { hasDescription: hasDescription, hasDetails: hasDetails, hasMeta: hasMeta, hasThumbnail: hasThumbnail, thumbnailShape: thumbnailShape }));
|
|
5521
|
+
return (jsxRuntime.jsx(ListItemSkeleton, { hasDescription: hasDescription, hasDetails: hasDetails, hasMeta: hasMeta, hasThumbnail: hasThumbnail, style: style, thumbnailShape: thumbnailShape }));
|
|
5495
5522
|
default: {
|
|
5496
5523
|
throw new Error(`${type} is not known`);
|
|
5497
5524
|
}
|
|
@@ -5565,7 +5592,7 @@ const ListLoadingIndicator = ({ type, hasThumbnail, thumbnailShape, hasDescripti
|
|
|
5565
5592
|
* );
|
|
5566
5593
|
* ```
|
|
5567
5594
|
*/
|
|
5568
|
-
const List = ({ children, className, "data-testid": dataTestId,
|
|
5595
|
+
const List = ({ children, className, "data-testid": dataTestId, style,
|
|
5569
5596
|
// UseListResult properties
|
|
5570
5597
|
containerRef, listRef, rows, getListItemProps, header, loadingIndicator, shouldShowLoaderAtIndex, count, isScrolling, separator, topSeparatorOnScroll, isAtTop, contentFillsContainer,
|
|
5571
5598
|
// Unused but part of UseListResult interface (can be used from parent)
|
|
@@ -5573,7 +5600,7 @@ scrollOffset: _scrollOffset, getTotalSize: _getTotalSize, getVirtualItems: _getV
|
|
|
5573
5600
|
return (jsxRuntime.jsx("div", { className: cvaListContainer({
|
|
5574
5601
|
withTopSeparator: topSeparatorOnScroll && !isAtTop,
|
|
5575
5602
|
className,
|
|
5576
|
-
}), "data-is-scrolling": isScrolling, "data-testid": dataTestId, ref: containerRef, children: jsxRuntime.jsx("ul", { className: cvaList(), ref: listRef, children: rows.map(row => {
|
|
5603
|
+
}), "data-is-scrolling": isScrolling, "data-testid": dataTestId, ref: containerRef, style: style, children: jsxRuntime.jsx("ul", { className: cvaList(), ref: listRef, children: rows.map(row => {
|
|
5577
5604
|
// Generate list item props with clean separator styling
|
|
5578
5605
|
const listItemProps = getListItemProps(row, {
|
|
5579
5606
|
className: cvaListItem$1({
|
|
@@ -6115,8 +6142,8 @@ const cvaMenuListItem = cssClassVarianceUtilities.cvaMerge("max-w-full");
|
|
|
6115
6142
|
* ```
|
|
6116
6143
|
* @returns {ReactElement} MenuDivider component
|
|
6117
6144
|
*/
|
|
6118
|
-
const MenuDivider = () => {
|
|
6119
|
-
return jsxRuntime.jsx("div", { className: cvaMenuListDivider(), "data-testid": "menu-divider" });
|
|
6145
|
+
const MenuDivider = ({ style }) => {
|
|
6146
|
+
return jsxRuntime.jsx("div", { className: cvaMenuListDivider(), "data-testid": "menu-divider", style: style });
|
|
6120
6147
|
};
|
|
6121
6148
|
|
|
6122
6149
|
/**
|
|
@@ -6273,7 +6300,7 @@ const cvaMenuItemSuffix = cssClassVarianceUtilities.cvaMerge(["text-neutral-400"
|
|
|
6273
6300
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
6274
6301
|
* @returns {ReactElement} MenuItem component
|
|
6275
6302
|
*/
|
|
6276
|
-
const MenuItem = ({ className, "data-testid": dataTestId, label, children, selected = false, focused = false, prefix, suffix, disabled = false, onClick, stopPropagation = true, id, tabIndex, optionLabelDescription, optionPrefix, fieldSize = "medium", variant = "primary", ref, }) => {
|
|
6303
|
+
const MenuItem = ({ className, "data-testid": dataTestId, label, children, selected = false, focused = false, prefix, suffix, disabled = false, onClick, stopPropagation = true, id, tabIndex, optionLabelDescription, optionPrefix, fieldSize = "medium", variant = "primary", style, ref, }) => {
|
|
6277
6304
|
/* Handle tab navigation */
|
|
6278
6305
|
const handleKeyDown = (e) => {
|
|
6279
6306
|
if (e.key === "Enter" && onClick !== undefined && disabled !== true) {
|
|
@@ -6296,7 +6323,7 @@ const MenuItem = ({ className, "data-testid": dataTestId, label, children, selec
|
|
|
6296
6323
|
e.stopPropagation();
|
|
6297
6324
|
}
|
|
6298
6325
|
onClick?.(e);
|
|
6299
|
-
}, onKeyDown: handleKeyDown, ref: ref, 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: "ml-1 text-neutral-400", 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] }));
|
|
6326
|
+
}, onKeyDown: handleKeyDown, ref: ref, role: "menuitem", style: style, 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: "ml-1 text-neutral-400", 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] }));
|
|
6300
6327
|
};
|
|
6301
6328
|
|
|
6302
6329
|
/**
|
|
@@ -6355,7 +6382,7 @@ const MenuItem = ({ className, "data-testid": dataTestId, label, children, selec
|
|
|
6355
6382
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
6356
6383
|
* @returns {ReactElement} MenuList component
|
|
6357
6384
|
*/
|
|
6358
|
-
const MenuList = ({ "data-testid": dataTestId, className, children, isMulti = false, selectedItems: controlledSelectedItems, onSelectionChange, ref, ...args }) => {
|
|
6385
|
+
const MenuList = ({ "data-testid": dataTestId, className, children, isMulti = false, selectedItems: controlledSelectedItems, onSelectionChange, style, ref, ...args }) => {
|
|
6359
6386
|
const childrenArr = react.Children.toArray(children);
|
|
6360
6387
|
const [internalSelectedItems, setInternalSelectedItems] = react.useState(controlledSelectedItems ?? []);
|
|
6361
6388
|
const selectedItems = controlledSelectedItems ?? internalSelectedItems;
|
|
@@ -6372,7 +6399,7 @@ const MenuList = ({ "data-testid": dataTestId, className, children, isMulti = fa
|
|
|
6372
6399
|
setInternalSelectedItems(newSelectedItems);
|
|
6373
6400
|
}
|
|
6374
6401
|
}, [isMulti, selectedItems, onSelectionChange]);
|
|
6375
|
-
return (jsxRuntime.jsx("div", { className: cvaMenu({ className, limitWidth: true }), "data-testid": dataTestId ? `${dataTestId}-menu-list` : "menu-list", onClick: args.onClick, ref: ref, role: "list", tabIndex: 0, children: jsxRuntime.jsx("div", { className: cvaMenuList(), children: childrenArr.map((menuItem, index) => {
|
|
6402
|
+
return (jsxRuntime.jsx("div", { className: cvaMenu({ className, limitWidth: true }), "data-testid": dataTestId ? `${dataTestId}-menu-list` : "menu-list", onClick: args.onClick, ref: ref, role: "list", style: style, tabIndex: 0, children: jsxRuntime.jsx("div", { className: cvaMenuList(), children: childrenArr.map((menuItem, index) => {
|
|
6376
6403
|
if (react.isValidElement(menuItem)) {
|
|
6377
6404
|
const isSelected = (selectedItems.includes(menuItem.props.id ?? `${index}`) || menuItem.props.selected) ?? false;
|
|
6378
6405
|
return react.cloneElement(menuItem, {
|
|
@@ -6448,10 +6475,10 @@ const MoreMenu = ({ className, "data-testid": dataTestId, popoverProps, iconProp
|
|
|
6448
6475
|
size: "medium",
|
|
6449
6476
|
square: true,
|
|
6450
6477
|
variant: "secondary",
|
|
6451
|
-
}, customButton, customPortalId, children, ref, }) => {
|
|
6478
|
+
}, customButton, customPortalId, children, style, ref, }) => {
|
|
6452
6479
|
const actionMenuRef = react.useRef(null);
|
|
6453
6480
|
const mergedRef = useMergeRefs([actionMenuRef, ref]);
|
|
6454
|
-
return (jsxRuntime.jsx("div", { className: cvaMoreMenu({ className }), "data-testid": dataTestId ? dataTestId : undefined, ref: mergedRef, children: jsxRuntime.jsxs(Popover, { placement: "bottom-end", ...popoverProps, children: [jsxRuntime.jsx(PopoverTrigger, { children: customButton ?? (jsxRuntime.jsx(IconButton, { "data-testid": "more-menu-icon", ...iconButtonProps, icon: jsxRuntime.jsx(Icon, { name: "EllipsisHorizontal", ...iconProps }) })) }), jsxRuntime.jsx(PopoverContent, { portalId: customPortalId, children: close => (typeof children === "function" ? children(close) : children) })] }) }));
|
|
6481
|
+
return (jsxRuntime.jsx("div", { className: cvaMoreMenu({ className }), "data-testid": dataTestId ? dataTestId : undefined, ref: mergedRef, style: style, children: jsxRuntime.jsxs(Popover, { placement: "bottom-end", ...popoverProps, children: [jsxRuntime.jsx(PopoverTrigger, { children: customButton ?? (jsxRuntime.jsx(IconButton, { "data-testid": "more-menu-icon", ...iconButtonProps, icon: jsxRuntime.jsx(Icon, { name: "EllipsisHorizontal", ...iconProps }) })) }), jsxRuntime.jsx(PopoverContent, { portalId: customPortalId, children: close => (typeof children === "function" ? children(close) : children) })] }) }));
|
|
6455
6482
|
};
|
|
6456
6483
|
|
|
6457
6484
|
const cvaNotice = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
|
@@ -6589,8 +6616,8 @@ const cvaPageContent = cssClassVarianceUtilities.cvaMerge(["overflow-auto", "pag
|
|
|
6589
6616
|
* @param {PageProps} props - The props for the Page component
|
|
6590
6617
|
* @returns {ReactElement} Page component
|
|
6591
6618
|
*/
|
|
6592
|
-
const Page = ({ layout, className, children, "data-testid": dataTestId, ref }) => {
|
|
6593
|
-
return (jsxRuntime.jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId ? dataTestId : "page", ref: ref, children: children }));
|
|
6619
|
+
const Page = ({ layout, className, children, "data-testid": dataTestId, style, ref, }) => {
|
|
6620
|
+
return (jsxRuntime.jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId ? dataTestId : "page", ref: ref, style: style, children: children }));
|
|
6594
6621
|
};
|
|
6595
6622
|
|
|
6596
6623
|
/**
|
|
@@ -6623,8 +6650,8 @@ const Page = ({ layout, className, children, "data-testid": dataTestId, ref }) =
|
|
|
6623
6650
|
* @param {PageContentProps} props - The props for the PageContent component
|
|
6624
6651
|
* @returns {ReactElement} PageContent component
|
|
6625
6652
|
*/
|
|
6626
|
-
const PageContent = ({ className, children, "data-testid": dataTestId, layout, ref, }) => {
|
|
6627
|
-
return (jsxRuntime.jsx("div", { className: cvaPageContent({ className, layout }), "data-testid": dataTestId ? dataTestId : "page-content", ref: ref, children: children }));
|
|
6653
|
+
const PageContent = ({ className, children, "data-testid": dataTestId, layout, style, ref, }) => {
|
|
6654
|
+
return (jsxRuntime.jsx("div", { className: cvaPageContent({ className, layout }), "data-testid": dataTestId ? dataTestId : "page-content", ref: ref, style: style, children: children }));
|
|
6628
6655
|
};
|
|
6629
6656
|
|
|
6630
6657
|
/**
|
|
@@ -6709,7 +6736,7 @@ const cvaSkeletonContainer = cssClassVarianceUtilities.cvaMerge(["flex", "flex-c
|
|
|
6709
6736
|
* <SkeletonLines variant="preset" preset="title-paragraph" />
|
|
6710
6737
|
*/
|
|
6711
6738
|
const SkeletonLines = react.memo((props) => {
|
|
6712
|
-
const { className, "data-testid": dataTestId, ref } = props;
|
|
6739
|
+
const { className, "data-testid": dataTestId, style, ref } = props;
|
|
6713
6740
|
// Generate line configs based on variant
|
|
6714
6741
|
let lineConfigs;
|
|
6715
6742
|
if (props.variant === "preset") {
|
|
@@ -6730,24 +6757,27 @@ const SkeletonLines = react.memo((props) => {
|
|
|
6730
6757
|
}));
|
|
6731
6758
|
}
|
|
6732
6759
|
const lineCount = lineConfigs.length;
|
|
6733
|
-
return (jsxRuntime.jsx("div", { "aria-label": `Loading ${lineCount} ${lineCount === 1 ? "item" : "items"}`, className: cvaSkeletonContainer({ className }), "data-testid": dataTestId, "data-variant": props.variant, ref: ref, role: "status", ...(props.variant === "preset" && { "data-preset": props.preset }), children: lineConfigs.map((config, index) => (jsxRuntime.jsx(SkeletonLabel, { className: config.className, "data-testid": dataTestId ? `${dataTestId}-${index}` : undefined, flexibleWidth: config.flexibleWidth ?? true, textSize: config.textSize ?? "text-base", width: config.width ?? "100%" }, index))) }));
|
|
6760
|
+
return (jsxRuntime.jsx("div", { "aria-label": `Loading ${lineCount} ${lineCount === 1 ? "item" : "items"}`, className: cvaSkeletonContainer({ className }), "data-testid": dataTestId, "data-variant": props.variant, ref: ref, role: "status", style: style, ...(props.variant === "preset" && { "data-preset": props.preset }), children: lineConfigs.map((config, index) => (jsxRuntime.jsx(SkeletonLabel, { className: config.className, "data-testid": dataTestId ? `${dataTestId}-${index}` : undefined, flexibleWidth: config.flexibleWidth ?? true, textSize: config.textSize ?? "text-base", width: config.width ?? "100%" }, index))) }));
|
|
6734
6761
|
});
|
|
6735
6762
|
SkeletonLines.displayName = "SkeletonLines";
|
|
6736
6763
|
|
|
6737
|
-
const LoadingContent = () => (jsxRuntime.jsx(
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6764
|
+
const LoadingContent = () => (jsxRuntime.jsx(SkeletonLines, { "data-testid": "kpi-card-loading-content", lines: [
|
|
6765
|
+
{ textSize: "text-xs", width: 50, flexibleWidth: false },
|
|
6766
|
+
{ textSize: "text-lg", width: 40, flexibleWidth: false },
|
|
6767
|
+
], variant: "custom" }));
|
|
6741
6768
|
/**
|
|
6742
6769
|
* Renders KPI metrics in the PageHeader component.
|
|
6743
6770
|
*
|
|
6744
6771
|
* @param {object} props - The props for the PageHeaderKpiMetrics component
|
|
6745
6772
|
* @param {Array<PageHeaderKpiMetricsType>} props.kpiMetrics - The KPI metrics to render
|
|
6773
|
+
* @param {string} [props.className] - Additional class names for the metrics row
|
|
6774
|
+
* @param {string} [props."data-testid"] - Test id for the metrics row
|
|
6775
|
+
* @param {import("react").CSSProperties} [props.style] - Inline styles for the metrics row
|
|
6746
6776
|
* @param [props.ref] - Ref forwarded to the root element
|
|
6747
6777
|
* @returns {ReactElement} PageHeaderKpiMetrics component
|
|
6748
6778
|
*/
|
|
6749
|
-
const PageHeaderKpiMetrics = ({ kpiMetrics, ref, }) => {
|
|
6750
|
-
return (jsxRuntime.jsx("div", { className: "hidden items-center gap-4 md:flex", ref: ref, children: kpiMetrics
|
|
6779
|
+
const PageHeaderKpiMetrics = ({ kpiMetrics, className, "data-testid": dataTestId, style, ref, }) => {
|
|
6780
|
+
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("hidden items-center gap-4 md:flex", className), "data-testid": dataTestId, ref: ref, style: style, children: kpiMetrics
|
|
6751
6781
|
.filter(kpi => kpi.hidden === false || kpi.hidden === undefined)
|
|
6752
6782
|
.map((kpi, index) => {
|
|
6753
6783
|
if (kpi.loading === true) {
|
|
@@ -6764,16 +6794,16 @@ const PageHeaderKpiMetrics = ({ kpiMetrics, ref, }) => {
|
|
|
6764
6794
|
* @returns {ReactElement} ActionRenderer component
|
|
6765
6795
|
*/
|
|
6766
6796
|
function ActionRenderer({ action, isMenuItem = false, externalOnClick }) {
|
|
6767
|
-
const { to, tooltipLabel, prefixIconName, disabled, actionText, actionCallback, "data-testid": dataTestId, target, variant, } = action;
|
|
6797
|
+
const { to, tooltipLabel, prefixIconName, disabled, actionText, actionCallback, "data-testid": dataTestId, target, style, variant, } = action;
|
|
6768
6798
|
// This component handles all the "wrapping" logic for Link/Tooltip
|
|
6769
6799
|
// The "content" is either a Button or a MenuItem, depending on `isMenuItem`
|
|
6770
6800
|
const content = isMenuItem ? (jsxRuntime.jsx(MenuItem, { "data-testid": dataTestId, disabled: disabled, label: actionText, onClick: e => {
|
|
6771
6801
|
actionCallback?.(e);
|
|
6772
6802
|
externalOnClick?.();
|
|
6773
|
-
}, prefix: prefixIconName ? jsxRuntime.jsx(Icon, { name: prefixIconName, size: "medium" }) : null, variant: variant === "secondary-danger" ? "danger" : "primary" })) : (jsxRuntime.jsx(Button, { "data-testid": dataTestId, disabled: disabled, onClick: e => {
|
|
6803
|
+
}, prefix: prefixIconName ? jsxRuntime.jsx(Icon, { name: prefixIconName, size: "medium" }) : null, style: style, variant: variant === "secondary-danger" ? "danger" : "primary" })) : (jsxRuntime.jsx(Button, { "data-testid": dataTestId, disabled: disabled, onClick: e => {
|
|
6774
6804
|
actionCallback?.(e);
|
|
6775
6805
|
externalOnClick?.();
|
|
6776
|
-
}, prefix: prefixIconName ? jsxRuntime.jsx(Icon, { name: prefixIconName, size: "small" }) : undefined, size: "small", variant: variant, children: actionText }));
|
|
6806
|
+
}, prefix: prefixIconName ? jsxRuntime.jsx(Icon, { name: prefixIconName, size: "small" }) : undefined, size: "small", style: style, variant: variant, children: actionText }));
|
|
6777
6807
|
// Wrap `content` with Tooltip
|
|
6778
6808
|
const wrappedWithTooltip = tooltipLabel ? (jsxRuntime.jsx(Tooltip, { label: tooltipLabel, children: jsxRuntime.jsx("span", { className: "block", children: content }) })) : (content);
|
|
6779
6809
|
// Finally, wrap with Link if `to` is provided
|
|
@@ -6889,12 +6919,13 @@ const cvaPageHeaderHeading = cssClassVarianceUtilities.cvaMerge(["text-neutral-9
|
|
|
6889
6919
|
* @param {string} props.title - The title of the page header
|
|
6890
6920
|
* @param {string} props.className - The class name of the page header title
|
|
6891
6921
|
* @param {string} [props."data-testid"] - The data test id of the page header title
|
|
6922
|
+
* @param {import("react").CSSProperties} [props.style] - Inline styles for the title wrapper
|
|
6892
6923
|
* @param [props.ref] - Ref forwarded to the root element
|
|
6893
6924
|
* @returns {ReactElement} PageHeaderTitle component
|
|
6894
6925
|
*/
|
|
6895
|
-
const PageHeaderTitle = ({ title, "data-testid": dataTestId, className, ref: forwardedRef, }) => {
|
|
6926
|
+
const PageHeaderTitle = ({ title, "data-testid": dataTestId, className, style, ref: forwardedRef, }) => {
|
|
6896
6927
|
const { ref, isTextTruncated } = useIsTextTruncated();
|
|
6897
|
-
return (jsxRuntime.jsx("div", { className: "flex flex-row items-center", ref: forwardedRef, children: jsxRuntime.jsx(Tooltip, { disabled: !isTextTruncated, label: title, placement: "top", children: jsxRuntime.jsx("div", { className: "min-w-16 grid", children: jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading({ className }), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, ref: ref, children: title }) }) }) }));
|
|
6928
|
+
return (jsxRuntime.jsx("div", { className: "flex flex-row items-center", ref: forwardedRef, style: style, children: jsxRuntime.jsx(Tooltip, { disabled: !isTextTruncated, label: title, placement: "top", children: jsxRuntime.jsx("div", { className: "min-w-16 grid", children: jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading({ className }), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, ref: ref, children: title }) }) }) }));
|
|
6898
6929
|
};
|
|
6899
6930
|
|
|
6900
6931
|
/**
|
|
@@ -6950,7 +6981,7 @@ const PageHeaderTitle = ({ title, "data-testid": dataTestId, className, ref: for
|
|
|
6950
6981
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
6951
6982
|
* @returns {ReactElement} PageHeader component
|
|
6952
6983
|
*/
|
|
6953
|
-
const PageHeader = ({ className, "data-testid": dataTestId, showLoading = false, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon = "QuestionMarkCircle", tagTooltipLabel, ref, ...discriminatedProps }) => {
|
|
6984
|
+
const PageHeader = ({ className, "data-testid": dataTestId, showLoading = false, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon = "QuestionMarkCircle", tagTooltipLabel, style, ref, ...discriminatedProps }) => {
|
|
6954
6985
|
const tagRenderer = react.useMemo(() => {
|
|
6955
6986
|
if (tagLabel === undefined || tagLabel === "" || showLoading) {
|
|
6956
6987
|
return null;
|
|
@@ -6961,14 +6992,14 @@ const PageHeader = ({ className, "data-testid": dataTestId, showLoading = false,
|
|
|
6961
6992
|
return (jsxRuntime.jsxs("div", { className: cvaPageHeaderContainer({
|
|
6962
6993
|
className,
|
|
6963
6994
|
withBorder: tabsList === undefined,
|
|
6964
|
-
}), "data-testid": dataTestId, ref: ref, 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: "small", square: true, variant: "ghost-neutral" }) })) : undefined, typeof title === "string" ? jsxRuntime.jsx(PageHeaderTitle, { "data-testid": 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, { "data-testid": dataTestId ? `${dataTestId}-description-tooltip` : undefined, iconProps: {
|
|
6995
|
+
}), "data-testid": dataTestId, ref: ref, style: style, 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: "small", square: true, variant: "ghost-neutral" }) })) : undefined, typeof title === "string" ? jsxRuntime.jsx(PageHeaderTitle, { "data-testid": 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, { "data-testid": dataTestId ? `${dataTestId}-description-tooltip` : undefined, iconProps: {
|
|
6965
6996
|
name: descriptionIcon,
|
|
6966
6997
|
"data-testid": "page-header-description-icon",
|
|
6967
6998
|
}, label: description, placement: "bottom" })) : undefined, tagRenderer] })) : null, jsxRuntime.jsxs("div", { className: "ml-auto flex gap-2", children: [discriminatedProps.accessoryType === "kpi-metrics" ? (jsxRuntime.jsx(PageHeaderKpiMetrics, { kpiMetrics: discriminatedProps.kpiMetrics })) : null, discriminatedProps.accessoryType === "actions" ? (Array.isArray(discriminatedProps.secondaryActions) ? (jsxRuntime.jsx(PageHeaderSecondaryActions, { actions: discriminatedProps.secondaryActions, groupActions: discriminatedProps.groupSecondaryActions ?? false, hasPrimaryAction: !!discriminatedProps.primaryAction })) : discriminatedProps.secondaryActions !== null && discriminatedProps.secondaryActions !== undefined ? (discriminatedProps.secondaryActions) : null) : null, discriminatedProps.accessoryType === "actions" &&
|
|
6968
6999
|
discriminatedProps.primaryAction !== undefined &&
|
|
6969
7000
|
(discriminatedProps.primaryAction.hidden === false ||
|
|
6970
7001
|
discriminatedProps.primaryAction.hidden === undefined) ? (jsxRuntime.jsx(Tooltip, { disabled: discriminatedProps.primaryAction.tooltipLabel === undefined ||
|
|
6971
|
-
discriminatedProps.primaryAction.tooltipLabel === "", label: discriminatedProps.primaryAction.tooltipLabel, children: jsxRuntime.jsx(Button, { "data-testid": discriminatedProps.primaryAction["data-testid"], disabled: discriminatedProps.primaryAction.disabled, loading: discriminatedProps.primaryAction.loading, onClick: () => discriminatedProps.primaryAction?.actionCallback?.(), prefix: discriminatedProps.primaryAction.prefixIconName !== undefined ? (jsxRuntime.jsx(Icon, { name: discriminatedProps.primaryAction.prefixIconName, size: "small" })) : undefined, size: "small", variant: discriminatedProps.primaryAction.variant, children: discriminatedProps.primaryAction.actionText }) })) : null] })] }), tabsList] }));
|
|
7002
|
+
discriminatedProps.primaryAction.tooltipLabel === "", label: discriminatedProps.primaryAction.tooltipLabel, children: jsxRuntime.jsx(Button, { "data-testid": discriminatedProps.primaryAction["data-testid"], disabled: discriminatedProps.primaryAction.disabled, loading: discriminatedProps.primaryAction.loading, onClick: () => discriminatedProps.primaryAction?.actionCallback?.(), prefix: discriminatedProps.primaryAction.prefixIconName !== undefined ? (jsxRuntime.jsx(Icon, { name: discriminatedProps.primaryAction.prefixIconName, size: "small" })) : undefined, size: "small", style: discriminatedProps.primaryAction.style, variant: discriminatedProps.primaryAction.variant, children: discriminatedProps.primaryAction.actionText }) })) : null] })] }), tabsList] }));
|
|
6972
7003
|
};
|
|
6973
7004
|
|
|
6974
7005
|
const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
|
@@ -7009,7 +7040,7 @@ const cvaPaginationText = cssClassVarianceUtilities.cvaMerge("whitespace-nowrap"
|
|
|
7009
7040
|
* @param {PaginationProps} props - The props for the Pagination component
|
|
7010
7041
|
* @returns {ReactElement} Pagination component
|
|
7011
7042
|
*/
|
|
7012
|
-
const Pagination = ({ previousPage, nextPage, canPreviousPage = false, canNextPage = false, pageCount, pageIndex, loading = false, className, "data-testid": dataTestId, getTranslatedCount, onPageChange, cursorBase = false, ref, }) => {
|
|
7043
|
+
const Pagination = ({ previousPage, nextPage, canPreviousPage = false, canNextPage = false, pageCount, pageIndex, loading = false, className, "data-testid": dataTestId, style, getTranslatedCount, onPageChange, cursorBase = false, ref, }) => {
|
|
7013
7044
|
const [page, setPage] = react.useState(pageIndex);
|
|
7014
7045
|
const [currentPage, setCurrentPage] = react.useState(String(pageIndex !== undefined ? pageIndex + 1 : 1));
|
|
7015
7046
|
if (!loading && pageCount === undefined) {
|
|
@@ -7052,9 +7083,9 @@ const Pagination = ({ previousPage, nextPage, canPreviousPage = false, canNextPa
|
|
|
7052
7083
|
onPageChange?.({ from, to, description });
|
|
7053
7084
|
}, [page, onPageChange, previousPage, nextPage]);
|
|
7054
7085
|
if (loading) {
|
|
7055
|
-
return (jsxRuntime.jsx("div", { className: cvaPagination({ className }), ref: ref, children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: 150 }) }));
|
|
7086
|
+
return (jsxRuntime.jsx("div", { className: cvaPagination({ className }), ref: ref, style: style, children: jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: 150 }) }));
|
|
7056
7087
|
}
|
|
7057
|
-
return (jsxRuntime.jsxs("div", { className: cvaPagination({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx(IconButton, { "data-testid": "prev-page", disabled: cursorBase ? !canPreviousPage || false : page !== undefined && page <= 0, icon: jsxRuntime.jsx(Icon, { name: "ChevronLeft", size: "small" }), onClick: () => handlePageChange("prev"), size: "small", variant: "ghost-neutral" }), !cursorBase && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: cvaPaginationText(), "data-testid": "current-page", children: currentPage }), jsxRuntime.jsx("div", { className: cvaPaginationText(), "data-testid": "page-count", children: pageCount !== null && pageCount !== undefined && getTranslatedCount ? getTranslatedCount(pageCount) : null })] })), jsxRuntime.jsx(IconButton, { "data-testid": "next-page", disabled: cursorBase
|
|
7088
|
+
return (jsxRuntime.jsxs("div", { className: cvaPagination({ className }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx(IconButton, { "data-testid": "prev-page", disabled: cursorBase ? !canPreviousPage || false : page !== undefined && page <= 0, icon: jsxRuntime.jsx(Icon, { name: "ChevronLeft", size: "small" }), onClick: () => handlePageChange("prev"), size: "small", variant: "ghost-neutral" }), !cursorBase && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: cvaPaginationText(), "data-testid": "current-page", children: currentPage }), jsxRuntime.jsx("div", { className: cvaPaginationText(), "data-testid": "page-count", children: pageCount !== null && pageCount !== undefined && getTranslatedCount ? getTranslatedCount(pageCount) : null })] })), jsxRuntime.jsx(IconButton, { "data-testid": "next-page", disabled: cursorBase
|
|
7058
7089
|
? !canNextPage || false
|
|
7059
7090
|
: page !== undefined && pageCount !== undefined && pageCount !== null && page >= pageCount - 1, icon: jsxRuntime.jsx(Icon, { name: "ChevronRight", size: "small" }), onClick: () => handlePageChange("next"), size: "small", variant: "ghost-neutral" })] }));
|
|
7060
7091
|
};
|
|
@@ -7085,7 +7116,7 @@ const STROKE_WIDTH_THRESHOLD = 32;
|
|
|
7085
7116
|
* @param {PolygonProps} props - The props for the Polygon component
|
|
7086
7117
|
* @returns {ReactElement} Polygon component
|
|
7087
7118
|
*/
|
|
7088
|
-
const Polygon = ({ points, size, color = "black", opaque = true, className, "data-testid": dataTestId, ref, }) => {
|
|
7119
|
+
const Polygon = ({ points, size, color = "black", opaque = true, className, "data-testid": dataTestId, style, ref, }) => {
|
|
7089
7120
|
// Calculate the bounds of the points
|
|
7090
7121
|
const minX = Math.min(...points.map(coord => coord[0]));
|
|
7091
7122
|
const maxX = Math.max(...points.map(coord => coord[0]));
|
|
@@ -7102,7 +7133,7 @@ const Polygon = ({ points, size, color = "black", opaque = true, className, "dat
|
|
|
7102
7133
|
size: sizeToNormalizeAgainst,
|
|
7103
7134
|
})}`)
|
|
7104
7135
|
.join(" ");
|
|
7105
|
-
return (jsxRuntime.jsx("svg", { className: className, "data-testid": dataTestId, height: size, ref: ref, style: { width: `${size}px`, height: `${size}px` }, viewBox: `0 0 ${size} ${size}`, width: size, xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("polygon", { points: normalizedPoints, style: {
|
|
7136
|
+
return (jsxRuntime.jsx("svg", { className: className, "data-testid": dataTestId, height: size, ref: ref, style: mergeDomStyles({ width: `${size}px`, height: `${size}px` }, style), viewBox: `0 0 ${size} ${size}`, width: size, xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("polygon", { points: normalizedPoints, style: {
|
|
7106
7137
|
fill: color,
|
|
7107
7138
|
fillOpacity: opaque ? 0.2 : undefined,
|
|
7108
7139
|
stroke: color,
|
|
@@ -7149,8 +7180,8 @@ const normalize = ({ value, min, max, size }) => ((value - min) / (max - min)) *
|
|
|
7149
7180
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
7150
7181
|
* @returns {ReactElement} PopoverTitle component
|
|
7151
7182
|
*/
|
|
7152
|
-
const PopoverTitle = ({ children, action, divider = false, className, "data-testid": dataTestId, ref, }) => {
|
|
7153
|
-
return (jsxRuntime.jsxs("div", { className: cvaPopoverTitleContainer({ divider, className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx(Text, { className: cvaPopoverTitleText(), size: "small", subtle: true, type: "div", uppercase: true, weight: "bold", children: children }), action] }));
|
|
7183
|
+
const PopoverTitle = ({ children, action, divider = false, className, "data-testid": dataTestId, style, ref, }) => {
|
|
7184
|
+
return (jsxRuntime.jsxs("div", { className: cvaPopoverTitleContainer({ divider, className }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx(Text, { className: cvaPopoverTitleText(), size: "small", subtle: true, type: "div", uppercase: true, weight: "bold", children: children }), action] }));
|
|
7154
7185
|
};
|
|
7155
7186
|
|
|
7156
7187
|
const cvaPreferenceCard = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -7314,14 +7345,14 @@ const preferenceCardGrid = createGrid()
|
|
|
7314
7345
|
* @param {PreferenceCardProps} props - The props for the PreferenceCard component
|
|
7315
7346
|
* @returns {ReactNode} PreferenceCard component
|
|
7316
7347
|
*/
|
|
7317
|
-
const PreferenceCard = ({ title, description, icon, input, titleTag, cardTag, disabled = false, className, "data-testid": dataTestId, children, ref: forwardedRef, }) => {
|
|
7348
|
+
const PreferenceCard = ({ title, description, icon, input, titleTag, cardTag, disabled = false, className, "data-testid": dataTestId, style, children, ref: forwardedRef, }) => {
|
|
7318
7349
|
const { ref: measureRef, geometry } = useMeasure();
|
|
7319
7350
|
const ref = useMergeRefs([measureRef, forwardedRef]);
|
|
7320
7351
|
const gridAreas = useGridAreas(preferenceCardGrid);
|
|
7321
7352
|
return (jsxRuntime.jsxs("div", { className: cvaPreferenceCard({
|
|
7322
7353
|
disabled,
|
|
7323
7354
|
className,
|
|
7324
|
-
}), "data-testid": dataTestId, ref: ref, children: [input ? (jsxRuntime.jsx("label", { className: tailwindMerge.twMerge(cvaInputContainer({
|
|
7355
|
+
}), "data-testid": dataTestId, ref: ref, style: style, children: [input ? (jsxRuntime.jsx("label", { className: tailwindMerge.twMerge(cvaInputContainer({
|
|
7325
7356
|
itemPlacement: geometry && geometry.height < CENTER_INPUT_HEIGHT_THRESHOLD ? "center" : "start",
|
|
7326
7357
|
}), cvaInteractableItem({
|
|
7327
7358
|
disabled,
|
|
@@ -7386,7 +7417,7 @@ const getRandomWidth = (min, max) => {
|
|
|
7386
7417
|
* @param {PreferenceCardSkeletonProps} props - The props for the PreferenceCardSkeleton component
|
|
7387
7418
|
* @returns {ReactElement} PreferenceCardSkeleton component
|
|
7388
7419
|
*/
|
|
7389
|
-
const PreferenceCardSkeleton = ({ hasIcon = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasIcon, hasTitleTag = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasTitleTag, hasCardTag = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasCardTag, hasInput = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasInput, ref, }) => {
|
|
7420
|
+
const PreferenceCardSkeleton = ({ hasIcon = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasIcon, hasTitleTag = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasTitleTag, hasCardTag = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasCardTag, hasInput = DEFAULT_SKELETON_PREFERENCE_CARD_PROPS.hasInput, className, "data-testid": dataTestId, style, ref, }) => {
|
|
7390
7421
|
const gridAreas = useGridAreas(preferenceCardGrid);
|
|
7391
7422
|
// Generate stable random widths once and never change them
|
|
7392
7423
|
const lineWidths = react.useMemo(() => {
|
|
@@ -7395,7 +7426,7 @@ const PreferenceCardSkeleton = ({ hasIcon = DEFAULT_SKELETON_PREFERENCE_CARD_PRO
|
|
|
7395
7426
|
description: getRandomWidth(160, 240),
|
|
7396
7427
|
};
|
|
7397
7428
|
}, []);
|
|
7398
|
-
return (jsxRuntime.jsxs("div", { className: cvaPreferenceCard(), ref: ref, children: [hasInput ? (jsxRuntime.jsx("div", { className: cvaInputContainer({ itemPlacement: "center" }), children: jsxRuntime.jsx(SkeletonBlock, { height: 20, width: 20 }) })) : null, jsxRuntime.jsx("div", { className: cvaContentWrapper(), children: jsxRuntime.jsx(GridAreas, { ...gridAreas, className: cvaContentContainer({ itemPlacement: "center" }), children: slots => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasIcon ? (jsxRuntime.jsx("div", { ...slots.icon, children: jsxRuntime.jsx(SkeletonBlock, { className: cvaIconBackground({ disabled: false }), height: 32, width: 32 }) })) : null, jsxRuntime.jsxs("div", { ...slots.information, className: "min-w-0 flex-1", children: [jsxRuntime.jsx("div", { className: "grid min-w-0 grid-cols-[1fr_auto] items-center gap-2", children: jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: lineWidths.title }), hasTitleTag ? jsxRuntime.jsx(TagSkeleton, { size: "small" }) : null] }) }), jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: lineWidths.description })] }), hasCardTag ? (jsxRuntime.jsx("div", { ...slots.cardTag, className: "justify-self-end", children: jsxRuntime.jsx(TagSkeleton, { size: "medium" }) })) : null] })) }) })] }));
|
|
7429
|
+
return (jsxRuntime.jsxs("div", { className: cvaPreferenceCard({ className }), "data-testid": dataTestId, ref: ref, style: style, children: [hasInput ? (jsxRuntime.jsx("div", { className: cvaInputContainer({ itemPlacement: "center" }), children: jsxRuntime.jsx(SkeletonBlock, { height: 20, width: 20 }) })) : null, jsxRuntime.jsx("div", { className: cvaContentWrapper(), children: jsxRuntime.jsx(GridAreas, { ...gridAreas, className: cvaContentContainer({ itemPlacement: "center" }), children: slots => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasIcon ? (jsxRuntime.jsx("div", { ...slots.icon, children: jsxRuntime.jsx(SkeletonBlock, { className: cvaIconBackground({ disabled: false }), height: 32, width: 32 }) })) : null, jsxRuntime.jsxs("div", { ...slots.information, className: "min-w-0 flex-1", children: [jsxRuntime.jsx("div", { className: "grid min-w-0 grid-cols-[1fr_auto] items-center gap-2", children: jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [jsxRuntime.jsx(SkeletonLabel, { textSize: "text-sm", width: lineWidths.title }), hasTitleTag ? jsxRuntime.jsx(TagSkeleton, { size: "small" }) : null] }) }), jsxRuntime.jsx(SkeletonLabel, { textSize: "text-xs", width: lineWidths.description })] }), hasCardTag ? (jsxRuntime.jsx("div", { ...slots.cardTag, className: "justify-self-end", children: jsxRuntime.jsx(TagSkeleton, { size: "medium" }) })) : null] })) }) })] }));
|
|
7399
7430
|
};
|
|
7400
7431
|
/**
|
|
7401
7432
|
* Simple tag skeleton for use within PreferenceCardSkeleton.
|
|
@@ -7524,8 +7555,8 @@ const cvaSpacer = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
7524
7555
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
7525
7556
|
* @returns {ReactElement} Spacer component
|
|
7526
7557
|
*/
|
|
7527
|
-
const Spacer = ({ size = "medium", border = false, "data-testid": dataTestId, className, ref, }) => {
|
|
7528
|
-
return jsxRuntime.jsx("div", { className: cvaSpacer({ className, border, size }), "data-testid": dataTestId, ref: ref });
|
|
7558
|
+
const Spacer = ({ size = "medium", border = false, "data-testid": dataTestId, className, style, ref, }) => {
|
|
7559
|
+
return jsxRuntime.jsx("div", { className: cvaSpacer({ className, border, size }), "data-testid": dataTestId, ref: ref, style: style });
|
|
7529
7560
|
};
|
|
7530
7561
|
|
|
7531
7562
|
/**
|
|
@@ -7554,8 +7585,8 @@ const Spacer = ({ size = "medium", border = false, "data-testid": dataTestId, cl
|
|
|
7554
7585
|
* @param {SectionHeaderProps} props - The props for the SectionHeader component
|
|
7555
7586
|
* @returns {ReactElement} SectionHeader component
|
|
7556
7587
|
*/
|
|
7557
|
-
const SectionHeader = ({ title, subtitle, "data-testid": dataTestId, addons, ref, }) => {
|
|
7558
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col", ref: ref, 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, { "data-testid": 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" })] }));
|
|
7588
|
+
const SectionHeader = ({ title, subtitle, "data-testid": dataTestId, addons, style, ref, }) => {
|
|
7589
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col", ref: ref, style: style, 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, { "data-testid": 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" })] }));
|
|
7559
7590
|
};
|
|
7560
7591
|
|
|
7561
7592
|
/**
|
|
@@ -9139,7 +9170,7 @@ const useSheetMotionOverflow = ({ panelEl, isDragging, scrollAreaEl, separatorEl
|
|
|
9139
9170
|
* CSS transitions on transform; the component stays mounted during the
|
|
9140
9171
|
* close animation and unmounts after the transition completes.
|
|
9141
9172
|
*/
|
|
9142
|
-
const Sheet = ({ isOpen, state, snap, onGeometryChange, onSnap, onClickHandle, onCloseGesture, floatingUi, ref, anchor = "center", snapping = true, resizable = true, variant = "default", trapFocus = true, container, dockedContent, persistentContent, className, "data-testid": dataTestId, onCloseComplete, entryAnimation = "subsequent", children, }) => {
|
|
9173
|
+
const Sheet = ({ isOpen, state, snap, onGeometryChange, onSnap, onClickHandle, onCloseGesture, floatingUi, ref, anchor = "center", snapping = true, resizable = true, variant = "default", trapFocus = true, container, dockedContent, persistentContent, className, style, "data-testid": dataTestId, onCloseComplete, entryAnimation = "subsequent", children, }) => {
|
|
9143
9174
|
const isFirstRender = useIsFirstRender();
|
|
9144
9175
|
const skipEntryAnimation = entryAnimation === "never" || (entryAnimation === "subsequent" && isFirstRender);
|
|
9145
9176
|
const effectiveSnapping = resizable && snapping;
|
|
@@ -9245,7 +9276,7 @@ const Sheet = ({ isOpen, state, snap, onGeometryChange, onSnap, onClickHandle, o
|
|
|
9245
9276
|
onLostPointerCapture: gestures.onLostPointerCapture,
|
|
9246
9277
|
}
|
|
9247
9278
|
: {};
|
|
9248
|
-
const panel = (jsxRuntime.jsxs(Card, { ...(shouldTrapFocus === true ? { "aria-modal": true, role: "dialog" } : {}), ...(floatingUi?.getFloatingProps() ?? {}), className: cvaSheetPanel({ anchor, variant, className }), "data-testid": dataTestId, onTransitionEnd: handleTransitionEnd, ref: panelRefWithFloating, style: getSheetPanelStyle({
|
|
9279
|
+
const panel = (jsxRuntime.jsxs(Card, { ...(shouldTrapFocus === true ? { "aria-modal": true, role: "dialog" } : {}), ...(floatingUi?.getFloatingProps() ?? {}), className: cvaSheetPanel({ anchor, variant, className }), "data-testid": dataTestId, onTransitionEnd: handleTransitionEnd, ref: panelRefWithFloating, style: mergeDomStyles(getSheetPanelStyle({
|
|
9249
9280
|
autoHeight: state.sizingMode === "fit" && !fitHeightMeasured,
|
|
9250
9281
|
closePhase: animState.closePhase,
|
|
9251
9282
|
isDragging: gestures.isDragging,
|
|
@@ -9254,7 +9285,7 @@ const Sheet = ({ isOpen, state, snap, onGeometryChange, onSnap, onClickHandle, o
|
|
|
9254
9285
|
snapHeight: snapHeightCss,
|
|
9255
9286
|
suppressTransition: skipEntryAnimation && animState.visuallyOpen,
|
|
9256
9287
|
variant,
|
|
9257
|
-
}), children: [resizable ? (jsxRuntime.jsx(SheetHandle, { "data-testid": dataTestId !== undefined ? `${dataTestId}-handle` : undefined, isDragging: gestures.isDragging, onClick: handleClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ...gestureHandlers })) : null, jsxRuntime.jsx("div", { className: "h-px shrink-0 bg-neutral-200 opacity-0 transition-opacity duration-200", ref: setSeparatorEl }), jsxRuntime.jsxs("div", { className: cvaSheetScrollArea({ fillHeight: state.sizingMode !== "fit" }), "data-sheet-scroll-area": true, ref: setScrollAreaEl, children: [persistentContent, state.sizingMode === "docked" ? dockedContent : children] })] }));
|
|
9288
|
+
}), style), children: [resizable ? (jsxRuntime.jsx(SheetHandle, { "data-testid": dataTestId !== undefined ? `${dataTestId}-handle` : undefined, isDragging: gestures.isDragging, onClick: handleClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ...gestureHandlers })) : null, jsxRuntime.jsx("div", { className: "h-px shrink-0 bg-neutral-200 opacity-0 transition-opacity duration-200", ref: setSeparatorEl }), jsxRuntime.jsxs("div", { className: cvaSheetScrollArea({ fillHeight: state.sizingMode !== "fit" }), "data-sheet-scroll-area": true, ref: setScrollAreaEl, children: [persistentContent, state.sizingMode === "docked" ? dockedContent : children] })] }));
|
|
9258
9289
|
return (jsxRuntime.jsx(Portal, { root: container, children: jsxRuntime.jsxs("div", { className: cvaSheetContainer({
|
|
9259
9290
|
docked: state.sizingMode === "docked",
|
|
9260
9291
|
}), "data-testid": dataTestId !== undefined ? `${dataTestId}-container` : undefined, ref: containerRef, children: [jsxRuntime.jsx(SheetOverlay, { "data-testid": dataTestId !== undefined ? `${dataTestId}-overlay` : undefined, visible: showOverlay }), shouldTrapFocus === true ? (jsxRuntime.jsx(react$1.FloatingFocusManager, { context: floatingUi.context, children: panel })) : (panel)] }) }));
|
|
@@ -9705,7 +9736,7 @@ const useOverflowItems = ({ threshold = 1, childUniqueIdentifierAttribute = "id"
|
|
|
9705
9736
|
* @param {SidebarProps} props - The props for the Sidebar component
|
|
9706
9737
|
* @returns {ReactElement} Sidebar component
|
|
9707
9738
|
*/
|
|
9708
|
-
const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", className, "data-testid": dataTestId = "sidebar", moreMenuProps, menuListProps, overflowThreshold, ref, }) => {
|
|
9739
|
+
const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", className, "data-testid": dataTestId = "sidebar", moreMenuProps, menuListProps, overflowThreshold, style, ref, }) => {
|
|
9709
9740
|
const { overflowContainerRef, itemOverflowMap } = useOverflowItems({
|
|
9710
9741
|
children,
|
|
9711
9742
|
childUniqueIdentifierAttribute: "id",
|
|
@@ -9718,7 +9749,7 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
9718
9749
|
}
|
|
9719
9750
|
return "visible";
|
|
9720
9751
|
};
|
|
9721
|
-
return (jsxRuntime.jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("div", { className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid": `${dataTestId}-child-container`, ref: overflowContainerRef, children: react.Children.map(children, child => {
|
|
9752
|
+
return (jsxRuntime.jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsx("div", { className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid": `${dataTestId}-child-container`, ref: overflowContainerRef, children: react.Children.map(children, child => {
|
|
9722
9753
|
return react.cloneElement(child, {
|
|
9723
9754
|
className: tailwindMerge.twMerge(child.props.className, itemVisibilityClassName(child.props.id)),
|
|
9724
9755
|
});
|
|
@@ -10151,7 +10182,7 @@ const cvaToggleItemContent = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
10151
10182
|
* @param {ToggleGroupProps} props - The props for the ToggleGroup component
|
|
10152
10183
|
* @returns {ReactElement} ToggleGroup component
|
|
10153
10184
|
*/
|
|
10154
|
-
const ToggleGroup = ({ list, selected, setSelected, onChange, disabled = false, size = "medium", isIconOnly = false, className, "data-testid": dataTestId, ref, }) => {
|
|
10185
|
+
const ToggleGroup = ({ list, selected, setSelected, onChange, disabled = false, size = "medium", isIconOnly = false, className, "data-testid": dataTestId, style, ref, }) => {
|
|
10155
10186
|
const [isMounted, setIsMounted] = react.useState(false);
|
|
10156
10187
|
const [slidingLeft, setSlidingLeft] = react.useState(0);
|
|
10157
10188
|
const [slidingWidth, setSlidingWidth] = react.useState(0);
|
|
@@ -10172,27 +10203,26 @@ const ToggleGroup = ({ list, selected, setSelected, onChange, disabled = false,
|
|
|
10172
10203
|
setSlidingLeft(left);
|
|
10173
10204
|
setSlidingWidth(width);
|
|
10174
10205
|
}, [validIndex]);
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
{
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
}, children: list.map((item, index) => (jsxRuntime.jsx(ToggleItem, { className: item.className, "data-testid": item["data-testid"], disabled: disabled, iconName: item.iconName, isIconOnly: isIconOnly, onClick: () => {
|
|
10206
|
+
const slidingIndicatorStyle = {
|
|
10207
|
+
"--sliding-left": `${slidingLeft}px`,
|
|
10208
|
+
"--sliding-width": `${slidingWidth}px`,
|
|
10209
|
+
"--transition-duration": "200ms",
|
|
10210
|
+
};
|
|
10211
|
+
return (jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(cvaToggleGroup({ className }), cvaToggleGroupWithSlidingBackground({ isMounted })), "data-testid": dataTestId, ref: ref, style: mergeDomStyles(style, slidingIndicatorStyle), children: list.map((item, index) => (jsxRuntime.jsx(ToggleItem, { className: item.className, "data-testid": item["data-testid"], disabled: disabled, iconName: item.iconName, isIconOnly: isIconOnly, onClick: () => {
|
|
10182
10212
|
setSelected(item.id);
|
|
10183
10213
|
onChange?.(item.id);
|
|
10184
|
-
}, ref: el => (buttonRefs.current[index] = el), selected: selected === item.id, size: size, text: item.text, title: item.title, tooltip: item.tooltip }, item.id))) }));
|
|
10214
|
+
}, ref: el => (buttonRefs.current[index] = el), selected: selected === item.id, size: size, style: item.style, text: item.text, title: item.title, tooltip: item.tooltip }, item.id))) }));
|
|
10185
10215
|
};
|
|
10186
|
-
const ToggleItem = ({ title, onClick, disabled, isIconOnly, iconName = undefined, size, className, selected, text, tooltip, "data-testid": dataTestId, ref, }) => {
|
|
10216
|
+
const ToggleItem = ({ title, onClick, disabled, isIconOnly, iconName = undefined, size, className, selected, text, tooltip, "data-testid": dataTestId, style, ref, }) => {
|
|
10187
10217
|
return isIconOnly ? (jsxRuntime.jsx(Tooltip, { label: tooltip?.content || title, placement: tooltip?.placement || "top", children: jsxRuntime.jsx(ToggleButton, { className: cvaToggleItem({
|
|
10188
10218
|
className,
|
|
10189
10219
|
selected,
|
|
10190
10220
|
disabled,
|
|
10191
|
-
}), "data-testid": 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({
|
|
10221
|
+
}), "data-testid": 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, style: style, 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({
|
|
10192
10222
|
className,
|
|
10193
10223
|
selected,
|
|
10194
10224
|
disabled,
|
|
10195
|
-
}), "data-testid": dataTestId, disabled: disabled, iconPrefix: 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, children: jsxRuntime.jsx("span", { className: cvaToggleItemText({ maxWidth: text?.maxWidth, selected, disabled }), children: title }) }) }));
|
|
10225
|
+
}), "data-testid": dataTestId, disabled: disabled, iconPrefix: iconName ? (jsxRuntime.jsx(Icon, { className: cvaToggleItemContent({ selected, disabled }), name: iconName, size: size === "large" ? "medium" : "small" })) : null, isIconOnly: isIconOnly, onClick: onClick, ref: ref, size: size, style: style, title: title, children: jsxRuntime.jsx("span", { className: cvaToggleItemText({ maxWidth: text?.maxWidth, selected, disabled }), children: title }) }) }));
|
|
10196
10226
|
};
|
|
10197
10227
|
const ToggleButton = ({ title, size, children, "data-testid": dataTestId, className, icon, iconPrefix, isIconOnly, ...rest }) => {
|
|
10198
10228
|
const sizeClasses = {
|
|
@@ -10269,13 +10299,13 @@ const getValueTextVariant = (size, sum, segments, total) => {
|
|
|
10269
10299
|
* SegmentedValueBar displays multiple colored segments on a bar to visualize values relative to a total.
|
|
10270
10300
|
* Supports optional tooltips per segment, showing value and optionally a label.
|
|
10271
10301
|
*/
|
|
10272
|
-
const SegmentedValueBar = ({ segments, total, size = "small", showValue = false, displayValue, unit, valueColor, showTooltip = false, tooltipUnit, valueWidth, className, "data-testid": dataTestId, }) => {
|
|
10302
|
+
const SegmentedValueBar = ({ segments, total, size = "small", showValue = false, displayValue, unit, valueColor, showTooltip = false, tooltipUnit, valueWidth, className, "data-testid": dataTestId, style, }) => {
|
|
10273
10303
|
const computedSegments = computeSegments(segments, total);
|
|
10274
10304
|
const sum = total > 0 ? computeSum(segments) : 0;
|
|
10275
10305
|
const valueText = formatValue(displayValue ?? sum, unit);
|
|
10276
10306
|
const canShowValue = showValue && size !== "extraSmall";
|
|
10277
10307
|
const valueTextClassName = cvaSegmentedValueBarText({ size: getValueTextVariant(size, sum, segments, total) });
|
|
10278
|
-
return (jsxRuntime.jsxs("span", { className: valueBarContainerClassName, "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { "aria-label": valueText, className: cvaSegmentedValueBar({ className, size }), "data-testid": dataTestId ? `${dataTestId}-track` : undefined, children: computedSegments.map((segment, index) => {
|
|
10308
|
+
return (jsxRuntime.jsxs("span", { className: valueBarContainerClassName, "data-testid": dataTestId, style: style, children: [jsxRuntime.jsx("div", { "aria-label": valueText, className: cvaSegmentedValueBar({ className, size }), "data-testid": dataTestId ? `${dataTestId}-track` : undefined, children: computedSegments.map((segment, index) => {
|
|
10279
10309
|
const tooltipLabel = segment.label
|
|
10280
10310
|
? `${segment.label}: ${formatValue(segment.value, tooltipUnit ?? unit)}`
|
|
10281
10311
|
: formatValue(segment.value, tooltipUnit ?? unit);
|
|
@@ -11014,6 +11044,7 @@ const MAX_URL_LENGTH = 5000;
|
|
|
11014
11044
|
const useSearchParamSync = ({ key, enabled = true, onExternalChange, replace: replaceOption, }) => {
|
|
11015
11045
|
const navigate = reactRouter.useNavigate();
|
|
11016
11046
|
const location = reactRouter.useLocation();
|
|
11047
|
+
const router = reactRouter.useRouter();
|
|
11017
11048
|
const search = reactRouter.useSearch({ strict: false, shouldThrow: false });
|
|
11018
11049
|
const lastWrittenRef = react.useRef(undefined);
|
|
11019
11050
|
const onExternalChangeRef = react.useRef(onExternalChange);
|
|
@@ -11071,6 +11102,9 @@ const useSearchParamSync = ({ key, enabled = true, onExternalChange, replace: re
|
|
|
11071
11102
|
return;
|
|
11072
11103
|
}
|
|
11073
11104
|
requestAnimationFrame(() => {
|
|
11105
|
+
if (router.state.status === "pending") {
|
|
11106
|
+
return;
|
|
11107
|
+
}
|
|
11074
11108
|
const shouldReplace = options?.replace ?? replaceOption ?? !Boolean(currentSearchValue);
|
|
11075
11109
|
void navigate({
|
|
11076
11110
|
to: ".",
|
|
@@ -11086,7 +11120,7 @@ const useSearchParamSync = ({ key, enabled = true, onExternalChange, replace: re
|
|
|
11086
11120
|
replace: shouldReplace,
|
|
11087
11121
|
});
|
|
11088
11122
|
});
|
|
11089
|
-
}, [enabled, navigate, key, replaceOption, location.hash, getUrlLengthWithSearchParam, currentSearchValue]);
|
|
11123
|
+
}, [enabled, navigate, key, replaceOption, location.hash, getUrlLengthWithSearchParam, currentSearchValue, router.state.status]);
|
|
11090
11124
|
return react.useMemo(() => ({ searchValue: currentSearchValue, updateSearchParam }), [currentSearchValue, updateSearchParam]);
|
|
11091
11125
|
};
|
|
11092
11126
|
|