@trackunit/react-components 1.4.23 → 1.4.28
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 +89 -75
- package/index.esm.js +89 -75
- package/package.json +8 -8
- package/src/components/Alert/Alert.d.ts +2 -2
- package/src/components/Badge/Badge.d.ts +1 -1
- package/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/src/components/Card/Card.d.ts +2 -2
- package/src/components/Card/CardBody.d.ts +1 -1
- package/src/components/Card/CardFooter.d.ts +2 -2
- package/src/components/Card/CardHeader.d.ts +2 -2
- package/src/components/Collapse/Collapse.d.ts +1 -1
- package/src/components/CopyableText/CopyableText.d.ts +1 -1
- package/src/components/EmptyValue/EmptyValue.d.ts +3 -2
- package/src/components/ExternalLink/ExternalLink.d.ts +5 -4
- package/src/components/Heading/Heading.d.ts +4 -4
- package/src/components/Icon/Icon.d.ts +1 -1
- package/src/components/Indicator/Indicator.d.ts +4 -3
- package/src/components/KPICard/KPICard.d.ts +3 -3
- package/src/components/Menu/MenuItem/MenuItem.d.ts +6 -5
- package/src/components/Menu/MenuList/MenuList.d.ts +4 -3
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +1 -1
- package/src/components/Notice/Notice.d.ts +4 -3
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/Pagination/Pagination.d.ts +1 -1
- package/src/components/Polygon/Polygon.d.ts +1 -1
- package/src/components/Popover/Popover.d.ts +1 -1
- package/src/components/Popover/PopoverContent.d.ts +9 -2
- package/src/components/Popover/PopoverTitle.d.ts +2 -2
- package/src/components/Popover/PopoverTrigger.d.ts +14 -4
- package/src/components/Popover/PopoverTypes.d.ts +6 -4
- package/src/components/SectionHeader/SectionHeader.d.ts +3 -3
- package/src/components/Sidebar/Sidebar.d.ts +2 -2
- package/src/components/Sidebar/useOverflowItems.d.ts +1 -1
- package/src/components/Spacer/Spacer.d.ts +1 -1
- package/src/components/Spinner/Spinner.d.ts +1 -1
- package/src/components/Tabs/Tab.d.ts +1 -1
- package/src/components/Tabs/TabContent.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +11 -4
- package/src/components/Text/Text.d.ts +11 -4
- package/src/components/ToggleGroup/ToggleGroup.d.ts +1 -1
- package/src/components/Tooltip/Tooltip.d.ts +3 -3
- package/src/components/ValueBar/ValueBar.d.ts +1 -1
- package/src/components/ValueBar/ValueBarHelper.d.ts +1 -1
- package/src/components/VirtualizedList/VirtualizedList.d.ts +3 -2
- package/src/components/Widget/WidgetBody.d.ts +1 -1
- package/src/components/buttons/Button/Button.d.ts +10 -3
- package/src/components/buttons/IconButton/IconButton.d.ts +12 -2
- package/src/components/buttons/StarButton/StarButton.d.ts +2 -2
- package/src/hooks/useClickOutside.d.ts +1 -1
- package/src/hooks/useContainerBreakpoints.d.ts +1 -1
- package/src/hooks/useElevatedReducer.d.ts +2 -2
- package/src/hooks/useGeometry.d.ts +1 -1
- package/src/hooks/useIsTextTruncated.d.ts +3 -3
- package/src/hooks/useIsTextWrapping.d.ts +1 -1
- package/src/hooks/useScrollDetection.d.ts +1 -1
- package/src/hooks/useSelfUpdatingRef.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
4
|
var sharedUtils = require('@trackunit/shared-utils');
|
|
6
5
|
var uiDesignTokens = require('@trackunit/ui-design-tokens');
|
|
7
6
|
var uiIcons = require('@trackunit/ui-icons');
|
|
@@ -9,6 +8,7 @@ var IconSpriteMicro = require('@trackunit/ui-icons/icons-sprite-micro.svg');
|
|
|
9
8
|
var IconSpriteMini = require('@trackunit/ui-icons/icons-sprite-mini.svg');
|
|
10
9
|
var IconSpriteOutline = require('@trackunit/ui-icons/icons-sprite-outline.svg');
|
|
11
10
|
var IconSpriteSolid = require('@trackunit/ui-icons/icons-sprite-solid.svg');
|
|
11
|
+
var react = require('react');
|
|
12
12
|
var stringTs = require('string-ts');
|
|
13
13
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
14
14
|
var reactSlot = require('@radix-ui/react-slot');
|
|
@@ -132,7 +132,7 @@ const isSafari = () => {
|
|
|
132
132
|
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
133
133
|
*
|
|
134
134
|
* @param {IconProps} props - The props for the Icon component
|
|
135
|
-
* @returns {
|
|
135
|
+
* @returns {ReactElement} Icon component
|
|
136
136
|
*/
|
|
137
137
|
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, ariaLabel, fontSize, ariaLabelledBy, ariaDescribedBy, }) => {
|
|
138
138
|
const useTagRef = react.useRef(null);
|
|
@@ -240,15 +240,15 @@ const cvaTagIcon = cssClassVarianceUtilities.cvaMerge(["cursor-pointer", "transi
|
|
|
240
240
|
* The tag is also used in multiselect components to show selected options.
|
|
241
241
|
*
|
|
242
242
|
* **Do:** Use short labels for easy scanning.
|
|
243
|
-
|
|
243
|
+
*
|
|
244
244
|
* @param {TagProps} props - The props for the tag component
|
|
245
|
-
* @returns {
|
|
245
|
+
* @returns {ReactElement} tag component
|
|
246
246
|
*/
|
|
247
|
-
const Tag =
|
|
247
|
+
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false, ref, }) => {
|
|
248
248
|
return (jsxRuntime.jsxs("span", { className: cvaTag({ className, size, color, layout: onClose ? "withIcon" : "default" }), "data-testid": dataTestId, ref: ref, children: [children, Boolean(onClose) && !disabled ? (
|
|
249
249
|
// a fix for multiselect deselecting tags working together with fade out animation
|
|
250
250
|
jsxRuntime.jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsxRuntime.jsx(Icon, { className: cvaTagIcon(), dataTestId: dataTestId + "Icon", name: "XCircle", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, type: "solid" }) })) : null] }));
|
|
251
|
-
}
|
|
251
|
+
};
|
|
252
252
|
Tag.displayName = "Tag";
|
|
253
253
|
|
|
254
254
|
/**
|
|
@@ -357,11 +357,11 @@ const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relati
|
|
|
357
357
|
* ### When to use
|
|
358
358
|
*
|
|
359
359
|
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
360
|
-
|
|
360
|
+
*
|
|
361
361
|
* @param {TextProps} props - The props for the Text component
|
|
362
|
-
* @returns {
|
|
362
|
+
* @returns {ReactElement} Text component
|
|
363
363
|
*/
|
|
364
|
-
const Text =
|
|
364
|
+
const Text = ({ children, type = "p", size = "medium", align = "left", weight = "normal", underline = false, inverted = false, subtle = false, italicize = false, uppercase = false, disabled = false, className, dataTestId, ref, ...rest }) => {
|
|
365
365
|
return react.createElement(type, {
|
|
366
366
|
ref,
|
|
367
367
|
className: cvaText({
|
|
@@ -379,7 +379,7 @@ const Text = react.forwardRef(({ children, type = "p", size = "medium", align =
|
|
|
379
379
|
"data-testid": dataTestId,
|
|
380
380
|
...rest,
|
|
381
381
|
}, children);
|
|
382
|
-
}
|
|
382
|
+
};
|
|
383
383
|
Text.displayName = "Text";
|
|
384
384
|
|
|
385
385
|
const cvaSpinner = cssClassVarianceUtilities.cvaMerge(["bg-transparent", "rounded-full", "border-2", "border-solid", "inline-block", "animate-spin", "cursor-wait"], {
|
|
@@ -431,7 +431,7 @@ const cvaSpinnerLabel = cssClassVarianceUtilities.cvaMerge(["self-center", "text
|
|
|
431
431
|
* Use when retrieving or refreshing small data amounts, such as status.
|
|
432
432
|
|
|
433
433
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
434
|
-
* @returns {
|
|
434
|
+
* @returns {ReactElement} Spinner component
|
|
435
435
|
*/
|
|
436
436
|
const Spinner = ({ mode = "light", size = "medium", centering = "centered", className, containerClassName, dataTestId = "spinner", label, }) => {
|
|
437
437
|
return (jsxRuntime.jsx("div", { className: cvaSpinnerContainer({ centering, className: containerClassName }), 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] }) }));
|
|
@@ -701,9 +701,9 @@ const cvaIconButton = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
701
701
|
* Do not use buttons as navigational elements. Instead, use [Links](https://www.notion.so/Links-49638788b6c042698b40b94a318361f1?pvs=21) when the desired action is to take the user to a new page.
|
|
702
702
|
*
|
|
703
703
|
* @param {ButtonProps} props - The props for the Button component
|
|
704
|
-
* @returns {
|
|
704
|
+
* @returns {ReactElement} Button component
|
|
705
705
|
*/
|
|
706
|
-
const Button =
|
|
706
|
+
const Button = ({ onClick, children, loading, disabled, className, fullWidth = false, prefix, suffix, variant = "primary", type = "button", size = "medium", square = false, dataTestId, title, role, tabIndex, asChild = false, circular, ref, ...rest }) => {
|
|
707
707
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
708
708
|
const sharedCompProps = {
|
|
709
709
|
ref,
|
|
@@ -722,24 +722,27 @@ const Button = react.forwardRef(({ onClick, children, loading, disabled, classNa
|
|
|
722
722
|
type,
|
|
723
723
|
};
|
|
724
724
|
return (jsxRuntime.jsxs(Comp, { ...sharedCompProps, ...(asChild ? {} : buttonSpecificProps), children: [loading ? (jsxRuntime.jsx(Spinner, { centering: "vertically", className: cvaButtonSpinner({ variant }), containerClassName: cvaButtonSpinnerContainer(), size: "small" })) : null, prefix && !loading ? jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: prefix }) : null, jsxRuntime.jsx(reactSlot.Slottable, { children: children }), suffix && !loading ? jsxRuntime.jsx("div", { className: cvaButtonPrefixSuffix({ size, variant }), children: suffix }) : null] }));
|
|
725
|
-
}
|
|
725
|
+
};
|
|
726
726
|
Button.displayName = "Button";
|
|
727
727
|
|
|
728
728
|
/**
|
|
729
729
|
* Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. The Icon Button is a version of the standard Button component without the text label.
|
|
730
730
|
*/
|
|
731
|
-
|
|
731
|
+
/**
|
|
732
|
+
*
|
|
733
|
+
*/
|
|
734
|
+
const IconButton = ({ icon, size = "medium", square = true, loading, disabled, className, ref, ...rest }) => {
|
|
732
735
|
return (jsxRuntime.jsx(Button, { className: cvaIconButton({ size: size, className }), disabled: disabled || loading, loading: loading,
|
|
733
736
|
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
734
737
|
prefix: !loading ? icon : undefined, ref: ref, size: size, square: square, ...rest }));
|
|
735
|
-
}
|
|
738
|
+
};
|
|
736
739
|
IconButton.displayName = "IconButton";
|
|
737
740
|
|
|
738
741
|
/**
|
|
739
742
|
* The StarButton component is used for favorite actions or similar.
|
|
740
|
-
|
|
743
|
+
*
|
|
741
744
|
* @param {StarButtonProps} props - The props for the StarButton component
|
|
742
|
-
* @returns {
|
|
745
|
+
* @returns {ReactElement} StarButton component
|
|
743
746
|
*/
|
|
744
747
|
const StarButton = ({ starred, onClick }) => {
|
|
745
748
|
return (jsxRuntime.jsx("div", { "data-test-id": "starred-filter", onClick: onClick, children: jsxRuntime.jsx(Icon, { color: starred ? "primary" : "neutral", name: "Star", size: "medium" }) }));
|
|
@@ -773,9 +776,9 @@ const cvaAlertIconContainer = cssClassVarianceUtilities.cvaMerge(["self-start",
|
|
|
773
776
|
|
|
774
777
|
/**
|
|
775
778
|
* The Alert component should be used to inform the user of important information.
|
|
776
|
-
|
|
779
|
+
*
|
|
777
780
|
* @param {AlertProps} props - The props for the Alert component
|
|
778
|
-
* @returns {
|
|
781
|
+
* @returns {ReactElement} Alert component
|
|
779
782
|
*/
|
|
780
783
|
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, }) => {
|
|
781
784
|
const ref = react.useRef(null);
|
|
@@ -840,7 +843,7 @@ const cvaBadge = cssClassVarianceUtilities.cvaMerge([
|
|
|
840
843
|
* The Badge component is used to display a notification badge with an optional number value.
|
|
841
844
|
|
|
842
845
|
* @param {BadgeProps} props - The props for the Badge component
|
|
843
|
-
* @returns {
|
|
846
|
+
* @returns {ReactElement} Badge component
|
|
844
847
|
*/
|
|
845
848
|
const Badge = ({ color = "primary", className, count, max, hideZero = false, dataTestId }) => {
|
|
846
849
|
if (hideZero && count === 0) {
|
|
@@ -983,7 +986,7 @@ const useContainerBreakpoints = (ref) => {
|
|
|
983
986
|
*/
|
|
984
987
|
const useTimeout = ({ onTimeout, duration }) => {
|
|
985
988
|
const ready = react.useRef(false);
|
|
986
|
-
const timeout = react.useRef();
|
|
989
|
+
const timeout = react.useRef(null);
|
|
987
990
|
const callback = react.useRef(onTimeout);
|
|
988
991
|
const startTimeout = react.useCallback(() => {
|
|
989
992
|
ready.current = false;
|
|
@@ -1269,7 +1272,7 @@ const useIsFullscreen = () => {
|
|
|
1269
1272
|
* @param {string} [text] - (Optional) Text used to trigger a re-check of truncation,
|
|
1270
1273
|
* especially if the text is dynamic (such as an input's value).
|
|
1271
1274
|
* @returns {{
|
|
1272
|
-
* ref:
|
|
1275
|
+
* ref: Ref<TElement | null>;
|
|
1273
1276
|
* isTooltipVisible: boolean;
|
|
1274
1277
|
* }} An object with:
|
|
1275
1278
|
* - `ref`: a ref to attach to the element you want to observe for truncation.
|
|
@@ -1355,9 +1358,9 @@ const useScrollDetection = (elementRef) => {
|
|
|
1355
1358
|
const [isAtTop, setIsAtTop] = react.useState(true);
|
|
1356
1359
|
const [isAtBottom, setIsAtBottom] = react.useState(false);
|
|
1357
1360
|
const [scrollPosition, setScrollPosition] = react.useState({ top: 0, bottom: 0 });
|
|
1358
|
-
const observerRef = react.useRef();
|
|
1361
|
+
const observerRef = react.useRef(null);
|
|
1359
1362
|
const checkScrollable = react.useCallback(() => {
|
|
1360
|
-
const element = elementRef
|
|
1363
|
+
const element = elementRef?.current;
|
|
1361
1364
|
if (!element) {
|
|
1362
1365
|
return;
|
|
1363
1366
|
}
|
|
@@ -1365,7 +1368,7 @@ const useScrollDetection = (elementRef) => {
|
|
|
1365
1368
|
setIsScrollable(hasOverflow);
|
|
1366
1369
|
}, [elementRef]);
|
|
1367
1370
|
const checkScrollPosition = react.useCallback(() => {
|
|
1368
|
-
const element = elementRef
|
|
1371
|
+
const element = elementRef?.current;
|
|
1369
1372
|
if (!element) {
|
|
1370
1373
|
return;
|
|
1371
1374
|
}
|
|
@@ -1376,7 +1379,7 @@ const useScrollDetection = (elementRef) => {
|
|
|
1376
1379
|
}, [elementRef]);
|
|
1377
1380
|
const debouncedCheckScrollPosition = usehooksTs.useDebounceCallback(checkScrollPosition, SCROLL_DEBOUNCE_TIME);
|
|
1378
1381
|
react.useEffect(() => {
|
|
1379
|
-
const element = elementRef
|
|
1382
|
+
const element = elementRef?.current;
|
|
1380
1383
|
if (!element) {
|
|
1381
1384
|
return;
|
|
1382
1385
|
}
|
|
@@ -1591,7 +1594,7 @@ const useBreadcrumbItemsToRender = (breadcrumbItems) => {
|
|
|
1591
1594
|
* Avoid using breadcrumbs to indicate forthcoming steps. For processes with sequential steps, use a wizard flow instead.
|
|
1592
1595
|
*
|
|
1593
1596
|
* @param {BreadcrumbProps} props - The props for the Breadcrumb component
|
|
1594
|
-
* @returns {
|
|
1597
|
+
* @returns {ReactElement} Breadcrumb component
|
|
1595
1598
|
*/
|
|
1596
1599
|
const Breadcrumb = ({ className, dataTestId, breadcrumbItems, back }) => {
|
|
1597
1600
|
const breadCrumbItemsToJSX = useBreadcrumbItemsToRender(breadcrumbItems);
|
|
@@ -1713,9 +1716,9 @@ const ROLE_CARD = "region";
|
|
|
1713
1716
|
/**
|
|
1714
1717
|
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
1715
1718
|
* To get the most out of the Card, use it in combination with the CardHeader, CardBody and CardFooter.
|
|
1716
|
-
|
|
1719
|
+
*
|
|
1717
1720
|
* @param {CardProps} props - The props for the Card component
|
|
1718
|
-
* @returns {
|
|
1721
|
+
* @returns {ReactElement} Card component
|
|
1719
1722
|
*/
|
|
1720
1723
|
const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, dataTestId, ...rest }) => {
|
|
1721
1724
|
return (jsxRuntime.jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, role: ROLE_CARD, ...rest, children: children }));
|
|
@@ -1727,7 +1730,7 @@ const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeav
|
|
|
1727
1730
|
* @summary For applying padding and gap to a Card.
|
|
1728
1731
|
* @description The padding must live here, and not on the Card itself, as to not inset the scrollbar in case of overflow
|
|
1729
1732
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
1730
|
-
* @returns {
|
|
1733
|
+
* @returns {ReactElement} CardBody component
|
|
1731
1734
|
*/
|
|
1732
1735
|
const CardBody = ({ density = "auto", children, dataTestId, className, direction, disableGap, id, }) => {
|
|
1733
1736
|
return (jsxRuntime.jsx("div", { className: cvaCardBodyDensityContainer({ density, disableGap, className, direction }), "data-testid": dataTestId, id: id, children: children }));
|
|
@@ -1737,9 +1740,9 @@ const CardBody = ({ density = "auto", children, dataTestId, className, direction
|
|
|
1737
1740
|
* A simple footer intended to use with Cards and Modals.
|
|
1738
1741
|
* Currently only intended to contain Buttons.
|
|
1739
1742
|
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
1740
|
-
|
|
1743
|
+
*
|
|
1741
1744
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
1742
|
-
* @returns {
|
|
1745
|
+
* @returns {ReactElement} CardFooter component
|
|
1743
1746
|
*/
|
|
1744
1747
|
const CardFooter = ({ dataTestId, className, children, density, hideSeparator = false }) => {
|
|
1745
1748
|
return (jsxRuntime.jsx("div", { className: cvaCardFooterDensityContainer({
|
|
@@ -1782,9 +1785,9 @@ const cvaHeading = cssClassVarianceUtilities.cvaMerge(["m-0", "leading-normal",
|
|
|
1782
1785
|
|
|
1783
1786
|
/**
|
|
1784
1787
|
* The Heading is used for a heading of a section (h1,h2,h3,h4).
|
|
1785
|
-
|
|
1788
|
+
*
|
|
1786
1789
|
* @param {HeadingProps} props - The props for the Heading component
|
|
1787
|
-
* @returns {
|
|
1790
|
+
* @returns {ReactElement} Heading component
|
|
1788
1791
|
*/
|
|
1789
1792
|
const Heading = ({ variant = "primary", inverted = false, subtle = false, className, dataTestId, ...rest }) => {
|
|
1790
1793
|
const semanticType = {
|
|
@@ -1802,9 +1805,9 @@ const Heading = ({ variant = "primary", inverted = false, subtle = false, classN
|
|
|
1802
1805
|
|
|
1803
1806
|
/**
|
|
1804
1807
|
* Header for Cards and Modals.
|
|
1805
|
-
|
|
1808
|
+
*
|
|
1806
1809
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
1807
|
-
* @returns {
|
|
1810
|
+
* @returns {ReactElement} CardHeader component
|
|
1808
1811
|
*/
|
|
1809
1812
|
const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose, dataTestId, className, children, accessories, actions, density, hideSeparator = false, }) => {
|
|
1810
1813
|
return (jsxRuntime.jsx("div", { className: cvaCardHeaderDensityContainer({
|
|
@@ -1886,7 +1889,7 @@ const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge(["transition-transform
|
|
|
1886
1889
|
* - To creating hierarchy levels by nesting them within each other.
|
|
1887
1890
|
*
|
|
1888
1891
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
1889
|
-
* @returns {
|
|
1892
|
+
* @returns {ReactElement} Collapse component
|
|
1890
1893
|
*/
|
|
1891
1894
|
const Collapse = ({ id, initialExpanded = false, onToggle, label, children, className, headerClassName, headerAddon, dataTestId, animate = true, extraPadding = true, }) => {
|
|
1892
1895
|
const LABEL_ID = sharedUtils.uuidv4();
|
|
@@ -1960,7 +1963,7 @@ const cvaCopyableText = cssClassVarianceUtilities.cvaMerge([
|
|
|
1960
1963
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
1961
1964
|
|
|
1962
1965
|
* @param {CopyableTextProps} props - The props for the CopyableText component
|
|
1963
|
-
* @returns {
|
|
1966
|
+
* @returns {ReactElement} CopyableText component
|
|
1964
1967
|
*/
|
|
1965
1968
|
const CopyableText = ({ text, alternativeText, dataTestId, className }) => {
|
|
1966
1969
|
const value = alternativeText ?? text ?? "";
|
|
@@ -2110,7 +2113,7 @@ const cvaEmptyValue = cssClassVarianceUtilities.cvaMerge(["text-gray-400"]);
|
|
|
2110
2113
|
* Show intentionality in empty values in the UI
|
|
2111
2114
|
*
|
|
2112
2115
|
* @param {EmptyValueProps} props - The props for the EmptyValue component
|
|
2113
|
-
* @returns {
|
|
2116
|
+
* @returns {ReactElement} EmptyValue component
|
|
2114
2117
|
*/
|
|
2115
2118
|
const EmptyValue = ({ className, dataTestId }) => {
|
|
2116
2119
|
return (jsxRuntime.jsx("div", { className: cvaEmptyValue({ className }), "data-testid": dataTestId, children: "-" }));
|
|
@@ -2122,7 +2125,7 @@ const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "text-p
|
|
|
2122
2125
|
* The external link component is used to link to an external page outside the Trackunit Manager.
|
|
2123
2126
|
|
|
2124
2127
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
2125
|
-
* @returns {
|
|
2128
|
+
* @returns {ReactElement} External Link component
|
|
2126
2129
|
*/
|
|
2127
2130
|
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, dataTestId, onClick, }) => {
|
|
2128
2131
|
return (jsxRuntime.jsx("a", { className: cvaExternalLink({ className }), "data-testid": dataTestId, href: href, onClick: onClick, rel: rel, target: target, title: title, children: children }));
|
|
@@ -2288,6 +2291,7 @@ const usePopover = ({ initialOpen = false, placement = "bottom", isModal, isOpen
|
|
|
2288
2291
|
const resolvedDismissal = typeof dismissal === "function" ? dismissal(DEFAULT_DISMISSAL) : dismissal;
|
|
2289
2292
|
const clickInteraction = react$1.useClick(popoverContext, {
|
|
2290
2293
|
enabled: resolvedActivation.click,
|
|
2294
|
+
keyboardHandlers: resolvedActivation.keyboardHandlers,
|
|
2291
2295
|
});
|
|
2292
2296
|
const dismissInteraction = react$1.useDismiss(popoverContext, resolvedDismissal);
|
|
2293
2297
|
const hoverInteraction = react$1.useHover(popoverContext, {
|
|
@@ -2346,7 +2350,7 @@ const usePopoverContext = () => {
|
|
|
2346
2350
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
2347
2351
|
*
|
|
2348
2352
|
* @param {PopoverProps} props The props for the popover
|
|
2349
|
-
* @returns {
|
|
2353
|
+
* @returns {ReactElement} A Popover Context Provider containing the children
|
|
2350
2354
|
*/
|
|
2351
2355
|
const Popover = ({ children, isModal = false, ...restOptions }) => {
|
|
2352
2356
|
const popover = usePopover({ isModal, ...restOptions });
|
|
@@ -2393,7 +2397,10 @@ const cvaPopoverTitleContainer = cssClassVarianceUtilities.cvaMerge(["flex", "it
|
|
|
2393
2397
|
});
|
|
2394
2398
|
const cvaPopoverTitleText = cssClassVarianceUtilities.cvaMerge(["flex-1", "text-neutral-500"]);
|
|
2395
2399
|
|
|
2396
|
-
|
|
2400
|
+
/**
|
|
2401
|
+
*
|
|
2402
|
+
*/
|
|
2403
|
+
const PopoverContent = function PopoverContent({ className, dataTestId, children, portalId, ref: propRef, ...props }) {
|
|
2397
2404
|
const { context: floatingContext, customProps, ...context } = usePopoverContext();
|
|
2398
2405
|
const ref = react$1.useMergeRefs([context.refs.setFloating, propRef]);
|
|
2399
2406
|
return (jsxRuntime.jsx(Portal, { id: portalId, children: context.isOpen ? (jsxRuntime.jsx(react$1.FloatingFocusManager, { closeOnFocusOut: false, context: floatingContext, guards: true, modal: context.isModal, order: ["reference", "content"], returnFocus: true, children: jsxRuntime.jsx("div", { "aria-describedby": context.descriptionId, "aria-labelledby": context.labelId, className: cvaPopoverContainer({ className: className ?? customProps.className }), "data-testid": dataTestId ?? customProps.dataTestId ?? "popover-content", ref: ref, style: {
|
|
@@ -2403,23 +2410,27 @@ const PopoverContent = react.forwardRef(function PopoverContent({ className, dat
|
|
|
2403
2410
|
width: "max-content",
|
|
2404
2411
|
...props.style,
|
|
2405
2412
|
}, ...context.getFloatingProps(props), children: typeof children === "function" ? children(() => context.setIsOpen(false)) : children }) })) : null }));
|
|
2406
|
-
}
|
|
2413
|
+
};
|
|
2407
2414
|
|
|
2408
2415
|
/**
|
|
2409
2416
|
* The PopoverTitle component.
|
|
2410
|
-
|
|
2417
|
+
*
|
|
2411
2418
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
2412
|
-
* @returns {
|
|
2419
|
+
* @returns {ReactElement} PopoverTitle component
|
|
2413
2420
|
*/
|
|
2414
2421
|
const PopoverTitle = ({ children, action, divider = false, className, dataTestId }) => {
|
|
2415
2422
|
return (jsxRuntime.jsxs("div", { className: cvaPopoverTitleContainer({ divider, className }), "data-testid": dataTestId, children: [jsxRuntime.jsx(Text, { className: cvaPopoverTitleText(), size: "small", subtle: true, type: "div", uppercase: true, weight: "bold", children: children }), action] }));
|
|
2416
2423
|
};
|
|
2417
2424
|
|
|
2418
|
-
|
|
2425
|
+
/**
|
|
2426
|
+
* The PopoverTrigger component is used to trigger the popover.
|
|
2427
|
+
*
|
|
2428
|
+
* @param {PopoverTriggerProps} props - The props for the PopoverTrigger component
|
|
2429
|
+
* @returns {ReactElement} PopoverTrigger component
|
|
2430
|
+
*/
|
|
2431
|
+
const PopoverTrigger = function PopoverTrigger({ children, renderButton, ref: propRef, ...props }) {
|
|
2419
2432
|
const context = usePopoverContext();
|
|
2420
|
-
|
|
2421
|
-
const childrenRef = children.ref;
|
|
2422
|
-
const ref = react$1.useMergeRefs([context.refs.setReference, propRef, childrenRef]);
|
|
2433
|
+
const ref = react$1.useMergeRefs([context.refs.setReference, propRef]);
|
|
2423
2434
|
if (!renderButton && react.isValidElement(children)) {
|
|
2424
2435
|
return react.cloneElement(children, context.getReferenceProps({
|
|
2425
2436
|
ref,
|
|
@@ -2428,10 +2439,8 @@ const PopoverTrigger = react.forwardRef(function PopoverTrigger({ children, rend
|
|
|
2428
2439
|
"data-state": context.isOpen ? "open" : "closed",
|
|
2429
2440
|
}));
|
|
2430
2441
|
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
}
|
|
2434
|
-
});
|
|
2442
|
+
return (jsxRuntime.jsx(Button, { "data-state": context.isOpen ? "open" : "closed", ref: ref, type: "button", ...context.getReferenceProps(props), children: children }));
|
|
2443
|
+
};
|
|
2435
2444
|
|
|
2436
2445
|
const cvaTooltipContainer = cssClassVarianceUtilities.cvaMerge(["flex", "leading-5"]);
|
|
2437
2446
|
const cvaTooltipIcon = cssClassVarianceUtilities.cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
|
|
@@ -2488,7 +2497,7 @@ const cvaTooltipPopoverContent = cssClassVarianceUtilities.cvaMerge(["max-w-sm",
|
|
|
2488
2497
|
/**
|
|
2489
2498
|
*
|
|
2490
2499
|
* @description Adding Tooltip Arrow
|
|
2491
|
-
* @returns {
|
|
2500
|
+
* @returns {ReactElement} Tooltip floating Arrow
|
|
2492
2501
|
*/
|
|
2493
2502
|
const FloatingArrowContainer = ({ arrowRef, mode = "dark", }) => {
|
|
2494
2503
|
const { context: floatingContext } = usePopoverContext();
|
|
@@ -2504,7 +2513,7 @@ const FloatingArrowContainer = ({ arrowRef, mode = "dark", }) => {
|
|
|
2504
2513
|
* **Do not use** tooltips to include information that is necessary for the user to complete their task. Use helper text that is always visible and accessible for vital information.
|
|
2505
2514
|
*
|
|
2506
2515
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
2507
|
-
* @returns {
|
|
2516
|
+
* @returns {ReactElement} Tooltip component
|
|
2508
2517
|
*/
|
|
2509
2518
|
const Tooltip = ({ children, dataTestId = "tool-tip", disabled, className, label, placement = "auto", mode = "dark", iconProps, id, }) => {
|
|
2510
2519
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
@@ -2659,7 +2668,7 @@ const cvaIndicatorIconBackground = cssClassVarianceUtilities.cvaMerge(["rounded-
|
|
|
2659
2668
|
* _**Do not use** indicators for non-essential information, or to communicate information unrelated to the state of an asset._
|
|
2660
2669
|
|
|
2661
2670
|
* @param {IndicatorProps} props - The props for the Indicator component
|
|
2662
|
-
* @returns {
|
|
2671
|
+
* @returns {ReactElement} Indicator component
|
|
2663
2672
|
*/
|
|
2664
2673
|
const Indicator = ({ dataTestId, icon, label, color = "unknown", withBackground = true, withLabel = true, ping = false, size, className, ...rest }) => {
|
|
2665
2674
|
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxRuntime.jsxs("div", { "aria-label": label, className: cvaIndicator(), "data-testid": dataTestId, ...rest, children: [jsxRuntime.jsxs("div", { className: cvaIndicatorIconBackground({ color, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background", children: [ping ? (jsxRuntime.jsx("div", { className: cvaIndicatorPing({ color }), "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping" })) : null, icon] }), label !== undefined && withLabel ? (jsxRuntime.jsx("div", { className: cvaIndicatorLabel({ size }), "data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label", children: label })) : null] }) }));
|
|
@@ -2726,7 +2735,7 @@ const LoadingContent$1 = () => (jsxRuntime.jsx("div", { className: "flex flex-ro
|
|
|
2726
2735
|
* The KPICard component is used to display KPIs.
|
|
2727
2736
|
*
|
|
2728
2737
|
* @param {KPICardProps} props - The props for the KPICard component
|
|
2729
|
-
* @returns {
|
|
2738
|
+
* @returns {ReactElement} KPICard component
|
|
2730
2739
|
*/
|
|
2731
2740
|
const KPICard = ({ asChild = false, title, value, loading, unit, className, dataTestId, tooltipLabel, isActive, variant = "default", trend, onClick, ...rest }) => {
|
|
2732
2741
|
const Comp = asChild ? reactSlot.Slot : "div";
|
|
@@ -2933,7 +2942,7 @@ const cvaMenuItemSuffix = cssClassVarianceUtilities.cvaMerge(["text-secondary-40
|
|
|
2933
2942
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
2934
2943
|
*
|
|
2935
2944
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
2936
|
-
* @returns {
|
|
2945
|
+
* @returns {ReactElement} MenuItem component
|
|
2937
2946
|
*/
|
|
2938
2947
|
const MenuItem = ({ className, dataTestId, label, children, selected, prefix, suffix, disabled, onClick, stopPropagation = true, id, tabIndex, optionLabelDescription, fieldSize = "medium", variant = "primary", }) => {
|
|
2939
2948
|
/* Handle tab navigation */
|
|
@@ -2965,7 +2974,7 @@ const MenuItem = ({ className, dataTestId, label, children, selected, prefix, su
|
|
|
2965
2974
|
* - Don’t use the MenuList to display single or multi-select items within form components. For dropdowns within select components, use SelectDropdown (component not available yet).
|
|
2966
2975
|
*
|
|
2967
2976
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
2968
|
-
* @returns {
|
|
2977
|
+
* @returns {ReactElement} MenuList component
|
|
2969
2978
|
*/
|
|
2970
2979
|
const MenuList = ({ dataTestId, className, children, withStickyHeader = false, isMulti = false, selectedItems: controlledSelectedItems, onSelectionChange, ...args }) => {
|
|
2971
2980
|
const childrenArr = react.Children.toArray(children);
|
|
@@ -3016,7 +3025,7 @@ const cvaMoreMenu = cssClassVarianceUtilities.cvaMerge(["p-0"]);
|
|
|
3016
3025
|
* Advice: fill it with MenuList
|
|
3017
3026
|
*
|
|
3018
3027
|
* @param {MoreMenuProps} props - The props for the MoreMenu component
|
|
3019
|
-
* @returns {
|
|
3028
|
+
* @returns {ReactElement} MoreMenu component
|
|
3020
3029
|
*/
|
|
3021
3030
|
const MoreMenu = ({ className, dataTestId, popoverProps, iconProps = {
|
|
3022
3031
|
size: "medium",
|
|
@@ -3087,7 +3096,7 @@ const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items
|
|
|
3087
3096
|
* _**Do not use** notices for essential information (use `<Alert/>` instead), or to communicate information related to the state of an asset (use `<Indicator/>` instead)._
|
|
3088
3097
|
|
|
3089
3098
|
* @param {NoticeProps} props - The props for the Notice component
|
|
3090
|
-
* @returns {
|
|
3099
|
+
* @returns {ReactElement} Notice component
|
|
3091
3100
|
*/
|
|
3092
3101
|
const Notice = ({ dataTestId, icon, label, color = "neutral", withLabel = true, className, tooltipLabel = label, withTooltip = false, size = "medium", ...rest }) => {
|
|
3093
3102
|
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: !withTooltip, label: tooltipLabel, placement: "bottom", children: jsxRuntime.jsxs("div", { "aria-label": label, className: cvaNotice(), "data-testid": dataTestId, ...rest, children: [jsxRuntime.jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label !== undefined && withLabel ? (jsxRuntime.jsx("div", { className: cvaNoticeLabel({ color, size }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] }) }));
|
|
@@ -3218,7 +3227,7 @@ const PageHeaderTitle = ({ title, dataTestId }) => {
|
|
|
3218
3227
|
* Tabs can be added to the PageHeader to allow users to navigate between different sections of the page.
|
|
3219
3228
|
*
|
|
3220
3229
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
3221
|
-
* @returns {
|
|
3230
|
+
* @returns {ReactElement} PageHeader component
|
|
3222
3231
|
*/
|
|
3223
3232
|
const PageHeader = ({ className, dataTestId, secondaryActions, showLoading, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon, kpiMetrics, tagTooltipLabel, primaryAction, }) => {
|
|
3224
3233
|
const tagRenderer = react.useMemo(() => {
|
|
@@ -3244,7 +3253,7 @@ const cvaPaginationText = cssClassVarianceUtilities.cvaMerge("whitespace-nowrap"
|
|
|
3244
3253
|
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
3245
3254
|
|
|
3246
3255
|
* @param {PaginationProps} props - The props for the Pagination component
|
|
3247
|
-
* @returns {
|
|
3256
|
+
* @returns {ReactElement} Pagination component
|
|
3248
3257
|
*/
|
|
3249
3258
|
const Pagination = ({ previousPage, nextPage, canPreviousPage, canNextPage, pageCount, pageIndex, loading, className, dataTestId, getTranslatedCount, onPageChange, cursorBase, }) => {
|
|
3250
3259
|
const [page, setPage] = react.useState(pageIndex);
|
|
@@ -3293,7 +3302,7 @@ const STROKE_WIDTH_THRESHOLD = 32;
|
|
|
3293
3302
|
* Draws an svg Polygon from a set of points.
|
|
3294
3303
|
*
|
|
3295
3304
|
* @param { PolygonProps} props - The props for the Polygon component
|
|
3296
|
-
* @returns {
|
|
3305
|
+
* @returns {ReactElement} Polygon component
|
|
3297
3306
|
*/
|
|
3298
3307
|
const Polygon = ({ points, size, color = "black", opaque = true, className, dataTestId }) => {
|
|
3299
3308
|
// Calculate the bounds of the points
|
|
@@ -3305,7 +3314,12 @@ const Polygon = ({ points, size, color = "black", opaque = true, className, data
|
|
|
3305
3314
|
const sizeToNormalizeAgainst = size - strokeWidth * 2; // because strole is centered, so will be clipped on the outside otherwise
|
|
3306
3315
|
// Normalize the points to fit within the viewBox
|
|
3307
3316
|
const normalizedPoints = points
|
|
3308
|
-
.map(([x, y]) => `${normalize({ value: x, min: minX, max: maxX, size: sizeToNormalizeAgainst })},${normalize({
|
|
3317
|
+
.map(([x, y]) => `${normalize({ value: x, min: minX, max: maxX, size: sizeToNormalizeAgainst })},${normalize({
|
|
3318
|
+
value: y,
|
|
3319
|
+
min: minY,
|
|
3320
|
+
max: maxY,
|
|
3321
|
+
size: sizeToNormalizeAgainst,
|
|
3322
|
+
})}`)
|
|
3309
3323
|
.join(" ");
|
|
3310
3324
|
return (jsxRuntime.jsx("svg", { className: className, "data-testid": dataTestId, height: size, 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: {
|
|
3311
3325
|
fill: color,
|
|
@@ -3380,7 +3394,7 @@ const cvaSpacer = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
3380
3394
|
* The Spacer component is used for adding a bit of space in the ui.
|
|
3381
3395
|
|
|
3382
3396
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
3383
|
-
* @returns {
|
|
3397
|
+
* @returns {ReactElement} Spacer component
|
|
3384
3398
|
*/
|
|
3385
3399
|
const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
3386
3400
|
return jsxRuntime.jsx("div", { className: cvaSpacer({ className, border, size }), "data-testid": dataTestId });
|
|
@@ -3390,7 +3404,7 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
|
3390
3404
|
* The SectionHeader component is used on sections to set the section title.
|
|
3391
3405
|
|
|
3392
3406
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
3393
|
-
* @returns {
|
|
3407
|
+
* @returns {ReactElement} SectionHeader component
|
|
3394
3408
|
*/
|
|
3395
3409
|
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
3396
3410
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(reactHelmetAsync.Helmet, { title: title }) }), jsxRuntime.jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxRuntime.jsxs("div", { className: "flex grow flex-col gap-2", children: [jsxRuntime.jsx(Heading, { dataTestId: dataTestId, variant: "secondary", children: title }), subtitle ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subtitle })) : null] }), addons ? jsxRuntime.jsx("div", { className: "flex gap-2", children: addons }) : null] }), jsxRuntime.jsx(Spacer, { size: "small" })] }));
|
|
@@ -3471,9 +3485,9 @@ const useOverflowItems = ({ threshold = 1, childUniqueIdentifierAttribute = "id"
|
|
|
3471
3485
|
* - **_The sidebar is just a wrapper. You are responsible for styling the children._**
|
|
3472
3486
|
*
|
|
3473
3487
|
* When using this component make sure to add `setupIntersectionObserver();` to your jest.setup.ts file.
|
|
3474
|
-
|
|
3488
|
+
*
|
|
3475
3489
|
* @param {SidebarProps} props - The props for the Sidebar component
|
|
3476
|
-
* @returns {
|
|
3490
|
+
* @returns {ReactElement} Sidebar component
|
|
3477
3491
|
*/
|
|
3478
3492
|
const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", className, dataTestId = "sidebar", moreMenuProps, menuListProps, overflowThreshold, }) => {
|
|
3479
3493
|
const { overflowContainerRef, itemOverflowMap } = useOverflowItems({
|
|
@@ -3617,7 +3631,7 @@ const cvaToggleItemText = cssClassVarianceUtilities.cvaMerge(["text-ellipsis", "
|
|
|
3617
3631
|
* Toggle Group allows users to toggle between two or more closely related options, and immediately apply that selection.
|
|
3618
3632
|
*
|
|
3619
3633
|
* @param {ToggleGroupProps} props - The props for the ToggleGroup component
|
|
3620
|
-
* @returns {
|
|
3634
|
+
* @returns {ReactElement} ToggleGroup component
|
|
3621
3635
|
*/
|
|
3622
3636
|
const ToggleGroup = ({ list, selected, setSelected, onChange, disabled = false, size = "medium", isIconOnly = false, className, dataTestId, }) => {
|
|
3623
3637
|
return (jsxRuntime.jsx("div", { className: cvaToggleGroup(), "data-testid": dataTestId, children: list.map((item, index) => (jsxRuntime.jsx(ToggleItem, { className: tailwindMerge.twMerge(className, index === 0 ? ["rounded-l-md", "border-l"] : "", index === list.length - 1 ? ["rounded-r-md", "border-r"] : ""), dataTestId: item.dataTestId, disabled: disabled, iconName: item.iconName, isIconOnly: isIconOnly, onClick: () => {
|
|
@@ -3727,7 +3741,7 @@ const getFillColor = (score, levelColors) => {
|
|
|
3727
3741
|
* @param {number} min - min range value
|
|
3728
3742
|
* @param {number} max - max range value
|
|
3729
3743
|
* @param {LevelColors} levelColors - level colors used to coloring the bar
|
|
3730
|
-
* @returns {
|
|
3744
|
+
* @returns {ReactElement} ValueBar component
|
|
3731
3745
|
*/
|
|
3732
3746
|
const getValueBarColorByValue = (value, min, max, levelColors) => {
|
|
3733
3747
|
const score = getScore(value, min, max);
|
|
@@ -3738,7 +3752,7 @@ const getValueBarColorByValue = (value, min, max, levelColors) => {
|
|
|
3738
3752
|
* ValueBar component is used to display value on a colorful bar within provided range.
|
|
3739
3753
|
|
|
3740
3754
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
3741
|
-
* @returns {
|
|
3755
|
+
* @returns {ReactElement} ValueBar component
|
|
3742
3756
|
*/
|
|
3743
3757
|
const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors, valueColor, showValue, className, dataTestId, zeroScoreAllowed, }) => {
|
|
3744
3758
|
const score = getScore(value, min, max, zeroScoreAllowed);
|
|
@@ -3770,7 +3784,7 @@ const cvaVirtualizedListItem = cssClassVarianceUtilities.cvaMerge(["absolute", "
|
|
|
3770
3784
|
* @property {number} [rowHeight="40"] - The estimated height of each row in the list.
|
|
3771
3785
|
* @property {RelayPagination | undefined} pagination - Pagination configuration for the list.
|
|
3772
3786
|
* @property {separator} [separator="line"] - The separator style between items in the list.
|
|
3773
|
-
* @property {(index: number) =>
|
|
3787
|
+
* @property {(index: number) =>ReactElement} children - A function that takes an index and returns the JSX element to be rendered at said index.
|
|
3774
3788
|
* @property {loadingIndicator} [loadingIndicator="spinner"] - The type of loading indicator in the list.
|
|
3775
3789
|
* @property {skeletonLinesHeight} [skeletonLinesHeight="2rem"] - The height of the skeleton lines.
|
|
3776
3790
|
*/
|
|
@@ -3837,7 +3851,7 @@ const cvaWidgetBodyDensityContainer = cssClassVarianceUtilities.cvaMerge([
|
|
|
3837
3851
|
* @summary For applying padding and gap to a Widget.
|
|
3838
3852
|
* @description The padding must live here, and not on the Widget itself, as to not inset the scrollbar in case of overflow
|
|
3839
3853
|
* @param {WidgetBodyProps} props - The props for the WidgetBody component
|
|
3840
|
-
* @returns {
|
|
3854
|
+
* @returns {ReactElement} WidgetBody component
|
|
3841
3855
|
*/
|
|
3842
3856
|
const WidgetBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
|
|
3843
3857
|
return (jsxRuntime.jsx("div", { className: cvaWidgetBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, children: children }));
|