@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
|
@@ -18,8 +18,8 @@ export interface CardFooterProps extends CommonProps {
|
|
|
18
18
|
* A simple footer intended to use with Cards and Modals.
|
|
19
19
|
* Currently only intended to contain Buttons.
|
|
20
20
|
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
21
|
-
|
|
21
|
+
*
|
|
22
22
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {ReactElement} CardFooter component
|
|
24
24
|
*/
|
|
25
25
|
export declare const CardFooter: ({ dataTestId, className, children, density, hideSeparator }: CardFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -40,8 +40,8 @@ export interface CardHeaderProps extends CommonProps {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Header for Cards and Modals.
|
|
43
|
-
|
|
43
|
+
*
|
|
44
44
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
45
|
-
* @returns {
|
|
45
|
+
* @returns {ReactElement} CardHeader component
|
|
46
46
|
*/
|
|
47
47
|
export declare const CardHeader: ({ heading, headingVariant, subHeading, onClose, dataTestId, className, children, accessories, actions, density, hideSeparator, }: CardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -48,6 +48,6 @@ export interface CollapseProps extends CommonProps {
|
|
|
48
48
|
* - To creating hierarchy levels by nesting them within each other.
|
|
49
49
|
*
|
|
50
50
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
51
|
-
* @returns {
|
|
51
|
+
* @returns {ReactElement} Collapse component
|
|
52
52
|
*/
|
|
53
53
|
export declare const Collapse: ({ id, initialExpanded, onToggle, label, children, className, headerClassName, headerAddon, dataTestId, animate, extraPadding, }: CollapseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,6 @@ export interface CopyableTextProps extends CommonProps {
|
|
|
15
15
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
16
16
|
|
|
17
17
|
* @param {CopyableTextProps} props - The props for the CopyableText component
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {ReactElement} CopyableText component
|
|
19
19
|
*/
|
|
20
20
|
export declare const CopyableText: ({ text, alternativeText, dataTestId, className }: CopyableTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
1
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
2
3
|
export interface EmptyValueProps extends CommonProps {
|
|
3
4
|
}
|
|
@@ -5,6 +6,6 @@ export interface EmptyValueProps extends CommonProps {
|
|
|
5
6
|
* Show intentionality in empty values in the UI
|
|
6
7
|
*
|
|
7
8
|
* @param {EmptyValueProps} props - The props for the EmptyValue component
|
|
8
|
-
* @returns {
|
|
9
|
+
* @returns {ReactElement} EmptyValue component
|
|
9
10
|
*/
|
|
10
|
-
export declare const EmptyValue: ({ className, dataTestId }: EmptyValueProps) =>
|
|
11
|
+
export declare const EmptyValue: ({ className, dataTestId }: EmptyValueProps) => ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEvent, ReactElement, ReactNode } from "react";
|
|
1
2
|
import { CommonProps } from "../../common";
|
|
2
3
|
export interface ExternalLinkProps extends CommonProps {
|
|
3
4
|
/**
|
|
@@ -7,7 +8,7 @@ export interface ExternalLinkProps extends CommonProps {
|
|
|
7
8
|
/**
|
|
8
9
|
* Child elements.
|
|
9
10
|
*/
|
|
10
|
-
children?:
|
|
11
|
+
children?: ReactNode;
|
|
11
12
|
/**
|
|
12
13
|
* The text to display on the URL. Defaults to the url itself.
|
|
13
14
|
*/
|
|
@@ -20,12 +21,12 @@ export interface ExternalLinkProps extends CommonProps {
|
|
|
20
21
|
* Used to specify the relationship between the link and the current document. Defaults to "noreferrer".
|
|
21
22
|
*/
|
|
22
23
|
rel?: string;
|
|
23
|
-
onClick?: (event:
|
|
24
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) => void;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* The external link component is used to link to an external page outside the Trackunit Manager.
|
|
27
28
|
|
|
28
29
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
29
|
-
* @returns {
|
|
30
|
+
* @returns {ReactElement} External Link component
|
|
30
31
|
*/
|
|
31
|
-
export declare const ExternalLink: ({ rel, target, href, className, children, title, dataTestId, onClick, }: ExternalLinkProps) =>
|
|
32
|
+
export declare const ExternalLink: ({ rel, target, href, className, children, title, dataTestId, onClick, }: ExternalLinkProps) => ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
3
|
export type HeadingVariant = "primary" | "secondary" | "tertiary" | "subtitle";
|
|
4
4
|
export interface HeadingProps extends CommonProps {
|
|
@@ -21,8 +21,8 @@ export interface HeadingProps extends CommonProps {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* The Heading is used for a heading of a section (h1,h2,h3,h4).
|
|
24
|
-
|
|
24
|
+
*
|
|
25
25
|
* @param {HeadingProps} props - The props for the Heading component
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {ReactElement} Heading component
|
|
27
27
|
*/
|
|
28
|
-
export declare const Heading: ({ variant, inverted, subtle, className, dataTestId, ...rest }: HeadingProps) =>
|
|
28
|
+
export declare const Heading: ({ variant, inverted, subtle, className, dataTestId, ...rest }: HeadingProps) => ReactElement;
|
|
@@ -485,7 +485,7 @@ export type IconProps = DiscriminatedIconProps & CommonProps & AriaProps & {
|
|
|
485
485
|
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
486
486
|
*
|
|
487
487
|
* @param {IconProps} props - The props for the Icon component
|
|
488
|
-
* @returns {
|
|
488
|
+
* @returns {ReactElement} Icon component
|
|
489
489
|
*/
|
|
490
490
|
export declare const Icon: ({ name, size, className, dataTestId, color, onClick, type, style, forwardedRef, ariaLabel, fontSize, ariaLabelledBy, ariaDescribedBy, }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
491
491
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ActivityColors, CriticalityColors, GeneralColors, IntentColors, RentalStatusColors, SitesColors, UtilizationColors } from "@trackunit/ui-design-tokens";
|
|
2
|
+
import { ReactElement } from "react";
|
|
2
3
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
4
|
export interface IndicatorProps extends CommonProps {
|
|
4
5
|
/**
|
|
5
6
|
* The icon to be rendered inside the indicator component
|
|
6
7
|
*/
|
|
7
|
-
icon?:
|
|
8
|
+
icon?: ReactElement;
|
|
8
9
|
/**
|
|
9
10
|
* A color token used to style the icon and the icon background
|
|
10
11
|
*/
|
|
@@ -40,6 +41,6 @@ export interface IndicatorProps extends CommonProps {
|
|
|
40
41
|
* _**Do not use** indicators for non-essential information, or to communicate information unrelated to the state of an asset._
|
|
41
42
|
|
|
42
43
|
* @param {IndicatorProps} props - The props for the Indicator component
|
|
43
|
-
* @returns {
|
|
44
|
+
* @returns {ReactElement} Indicator component
|
|
44
45
|
*/
|
|
45
|
-
export declare const Indicator: ({ dataTestId, icon, label, color, withBackground, withLabel, ping, size, className, ...rest }: IndicatorProps) =>
|
|
46
|
+
export declare const Indicator: ({ dataTestId, icon, label, color, withBackground, withLabel, ping, size, className, ...rest }: IndicatorProps) => ReactElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common";
|
|
3
3
|
export interface KPICardProps extends CommonProps {
|
|
4
4
|
/**
|
|
@@ -78,6 +78,6 @@ export interface KPICardProps extends CommonProps {
|
|
|
78
78
|
* The KPICard component is used to display KPIs.
|
|
79
79
|
*
|
|
80
80
|
* @param {KPICardProps} props - The props for the KPICard component
|
|
81
|
-
* @returns {
|
|
81
|
+
* @returns {ReactElement} KPICard component
|
|
82
82
|
*/
|
|
83
|
-
export declare const KPICard: ({ asChild, title, value, loading, unit, className, dataTestId, tooltipLabel, isActive, variant, trend, onClick, ...rest }: KPICardProps) =>
|
|
83
|
+
export declare const KPICard: ({ asChild, title, value, loading, unit, className, dataTestId, tooltipLabel, isActive, variant, trend, onClick, ...rest }: KPICardProps) => ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from "react";
|
|
1
2
|
import { VariantProps } from "@trackunit/css-class-variance-utilities";
|
|
2
3
|
import { CommonProps } from "../../../common";
|
|
3
4
|
import { cvaMenuItemStyle } from "./MenuItem.variants";
|
|
@@ -15,19 +16,19 @@ export interface MenuItemProps extends CommonProps {
|
|
|
15
16
|
* The children element is a custom element that can be used to override the label.
|
|
16
17
|
* If you use this prop, the label prop will be ignored.
|
|
17
18
|
*/
|
|
18
|
-
children?:
|
|
19
|
+
children?: ReactNode;
|
|
19
20
|
/**
|
|
20
21
|
* An React element to render before the label.
|
|
21
22
|
* This is typically used to render an icon.
|
|
22
23
|
*
|
|
23
24
|
*/
|
|
24
|
-
prefix?:
|
|
25
|
+
prefix?: ReactNode;
|
|
25
26
|
/**
|
|
26
27
|
* An React element to render after the label.
|
|
27
28
|
* This is typically used to render an icon.
|
|
28
29
|
*
|
|
29
30
|
*/
|
|
30
|
-
suffix?:
|
|
31
|
+
suffix?: ReactNode;
|
|
31
32
|
/**
|
|
32
33
|
* An boolean flag to turn on/off selected state
|
|
33
34
|
* This is typically used highlight that item is selected
|
|
@@ -40,7 +41,7 @@ export interface MenuItemProps extends CommonProps {
|
|
|
40
41
|
*
|
|
41
42
|
* @memberof MenuItemProps
|
|
42
43
|
*/
|
|
43
|
-
onClick?:
|
|
44
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
44
45
|
/**
|
|
45
46
|
* A boolean prop to set menu item to disabled state
|
|
46
47
|
* used in disabled select options
|
|
@@ -75,6 +76,6 @@ export interface MenuItemProps extends CommonProps {
|
|
|
75
76
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
76
77
|
*
|
|
77
78
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
78
|
-
* @returns {
|
|
79
|
+
* @returns {ReactElement} MenuItem component
|
|
79
80
|
*/
|
|
80
81
|
export declare const MenuItem: ({ className, dataTestId, label, children, selected, prefix, suffix, disabled, onClick, stopPropagation, id, tabIndex, optionLabelDescription, fieldSize, variant, }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
1
2
|
import { CommonProps } from "../../../common";
|
|
2
3
|
export interface MenuListProps extends CommonProps {
|
|
3
4
|
/**
|
|
4
5
|
* List of menu items to be rendered.
|
|
5
6
|
*/
|
|
6
|
-
children:
|
|
7
|
+
children: ReactNode;
|
|
7
8
|
/**
|
|
8
9
|
* When enabled the menu list padding will be removed, and a grid will be applied to keep the first column "sticky".
|
|
9
10
|
*
|
|
@@ -36,6 +37,6 @@ export interface MenuListProps extends CommonProps {
|
|
|
36
37
|
* - 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).
|
|
37
38
|
*
|
|
38
39
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
39
|
-
* @returns {
|
|
40
|
+
* @returns {ReactElement} MenuList component
|
|
40
41
|
*/
|
|
41
|
-
export declare const MenuList: ({ dataTestId, className, children, withStickyHeader, isMulti, selectedItems: controlledSelectedItems, onSelectionChange, ...args }: MenuListProps) =>
|
|
42
|
+
export declare const MenuList: ({ dataTestId, className, children, withStickyHeader, isMulti, selectedItems: controlledSelectedItems, onSelectionChange, ...args }: MenuListProps) => ReactElement;
|
|
@@ -20,7 +20,7 @@ export interface MoreMenuProps extends CommonProps {
|
|
|
20
20
|
* Advice: fill it with MenuList
|
|
21
21
|
*
|
|
22
22
|
* @param {MoreMenuProps} props - The props for the MoreMenu component
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {ReactElement} MoreMenu component
|
|
24
24
|
*/
|
|
25
25
|
export declare const MoreMenu: ({ className, dataTestId, popoverProps, iconProps, iconButtonProps, customButton, customPortalId, children, }: MoreMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CriticalityColors, GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
|
|
2
|
+
import { ReactElement } from "react";
|
|
2
3
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
4
|
export interface NoticeProps extends CommonProps {
|
|
4
5
|
/**
|
|
5
6
|
* The icon to be rendered inside the indicator component
|
|
6
7
|
*/
|
|
7
|
-
icon:
|
|
8
|
+
icon: ReactElement;
|
|
8
9
|
/**
|
|
9
10
|
* A color token used to style the icon and the icon background
|
|
10
11
|
*/
|
|
@@ -38,6 +39,6 @@ export interface NoticeProps extends CommonProps {
|
|
|
38
39
|
* _**Do not use** notices for essential information (use `<Alert/>` instead), or to communicate information related to the state of an asset (use `<Indicator/>` instead)._
|
|
39
40
|
|
|
40
41
|
* @param {NoticeProps} props - The props for the Notice component
|
|
41
|
-
* @returns {
|
|
42
|
+
* @returns {ReactElement} Notice component
|
|
42
43
|
*/
|
|
43
|
-
export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, tooltipLabel, withTooltip, size, ...rest }: NoticeProps) =>
|
|
44
|
+
export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, tooltipLabel, withTooltip, size, ...rest }: NoticeProps) => ReactElement;
|
|
@@ -8,6 +8,6 @@ import { PageHeaderProps } from "./types";
|
|
|
8
8
|
* Tabs can be added to the PageHeader to allow users to navigate between different sections of the page.
|
|
9
9
|
*
|
|
10
10
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
11
|
-
* @returns {
|
|
11
|
+
* @returns {ReactElement} PageHeader component
|
|
12
12
|
*/
|
|
13
13
|
export declare const PageHeader: ({ className, dataTestId, secondaryActions, showLoading, description, title, tagLabel, backTo, tagColor, tabsList, descriptionIcon, kpiMetrics, tagTooltipLabel, primaryAction, }: PageHeaderProps) => ReactElement;
|
|
@@ -56,6 +56,6 @@ export interface PaginationProps {
|
|
|
56
56
|
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
57
57
|
|
|
58
58
|
* @param {PaginationProps} props - The props for the Pagination component
|
|
59
|
-
* @returns {
|
|
59
|
+
* @returns {ReactElement} Pagination component
|
|
60
60
|
*/
|
|
61
61
|
export declare const Pagination: ({ previousPage, nextPage, canPreviousPage, canNextPage, pageCount, pageIndex, loading, className, dataTestId, getTranslatedCount, onPageChange, cursorBase, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ export interface PolygonProps extends CommonProps {
|
|
|
10
10
|
* Draws an svg Polygon from a set of points.
|
|
11
11
|
*
|
|
12
12
|
* @param { PolygonProps} props - The props for the Polygon component
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {ReactElement} Polygon component
|
|
14
14
|
*/
|
|
15
15
|
export declare const Polygon: ({ points, size, color, opaque, className, dataTestId }: PolygonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -23,7 +23,7 @@ type ModalCallback = {
|
|
|
23
23
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
24
24
|
*
|
|
25
25
|
* @param {PopoverProps} props The props for the popover
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {ReactElement} A Popover Context Provider containing the children
|
|
27
27
|
*/
|
|
28
28
|
export declare const Popover: ({ children, isModal, ...restOptions }: {
|
|
29
29
|
children: React.ReactNode | ((modal: ModalCallback) => React.ReactNode);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLProps, ReactNode } from "react";
|
|
1
|
+
import { HTMLProps, ReactNode, Ref } from "react";
|
|
2
2
|
import { CommonProps } from "../../common";
|
|
3
3
|
export type PopoverContentChildren = ((close: () => void) => ReactNode) | ReactNode;
|
|
4
4
|
export interface PopoverContentProps extends Omit<HTMLProps<HTMLDivElement>, "children">, CommonProps {
|
|
@@ -7,5 +7,12 @@ export interface PopoverContentProps extends Omit<HTMLProps<HTMLDivElement>, "ch
|
|
|
7
7
|
* Custom dom id to use for portalling the popover content
|
|
8
8
|
*/
|
|
9
9
|
portalId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A ref for the component
|
|
12
|
+
*/
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
14
|
}
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare const PopoverContent: ({ className, dataTestId, children, portalId, ref: propRef, ...props }: PopoverContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,8 +13,8 @@ export interface PopoverTitleProps extends CommonProps {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* The PopoverTitle component.
|
|
16
|
-
|
|
16
|
+
*
|
|
17
17
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {ReactElement} PopoverTitle component
|
|
19
19
|
*/
|
|
20
20
|
export declare const PopoverTitle: ({ children, action, divider, className, dataTestId }: PopoverTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
children: React.ReactNode;
|
|
1
|
+
import { HTMLProps, ReactNode, Ref } from "react";
|
|
2
|
+
interface PopoverTriggerProps extends HTMLProps<HTMLElement> {
|
|
4
3
|
/**
|
|
5
4
|
* When enabled the trigger will be rendered as a button
|
|
6
5
|
* note that not all elements are valid children of a button
|
|
7
6
|
*/
|
|
7
|
+
children: ReactNode;
|
|
8
8
|
renderButton?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A ref for the component
|
|
11
|
+
*/
|
|
12
|
+
ref?: Ref<HTMLElement>;
|
|
9
13
|
}
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The PopoverTrigger component is used to trigger the popover.
|
|
16
|
+
*
|
|
17
|
+
* @param {PopoverTriggerProps} props - The props for the PopoverTrigger component
|
|
18
|
+
* @returns {ReactElement} PopoverTrigger component
|
|
19
|
+
*/
|
|
20
|
+
export declare const PopoverTrigger: ({ children, renderButton, ref: propRef, ...props }: PopoverTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
21
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExtendedRefs, ReferenceType, UseDismissProps, UseFloatingReturn } from "@floating-ui/react";
|
|
2
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { Dispatch, HTMLProps, SetStateAction } from "react";
|
|
3
3
|
import { CommonProps } from "../../common";
|
|
4
4
|
export type PopoverActivation = {
|
|
5
5
|
click?: boolean;
|
|
@@ -74,7 +74,9 @@ export type UsePopoverType = {
|
|
|
74
74
|
x: number;
|
|
75
75
|
y: number;
|
|
76
76
|
refs: ExtendedRefsType;
|
|
77
|
-
getReferenceProps: (userProps?:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
getReferenceProps: (userProps?: HTMLProps<Element> & {
|
|
78
|
+
"data-state"?: "open" | "closed";
|
|
79
|
+
}) => Record<string, unknown>;
|
|
80
|
+
getFloatingProps: (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
81
|
+
getItemProps: (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
80
82
|
} & FloatingType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
3
|
export interface SectionHeaderProps extends CommonProps {
|
|
4
4
|
/**
|
|
@@ -18,6 +18,6 @@ export interface SectionHeaderProps extends CommonProps {
|
|
|
18
18
|
* The SectionHeader component is used on sections to set the section title.
|
|
19
19
|
|
|
20
20
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {ReactElement} SectionHeader component
|
|
22
22
|
*/
|
|
23
|
-
export declare const SectionHeader: ({ title, subtitle, dataTestId, addons }: SectionHeaderProps) =>
|
|
23
|
+
export declare const SectionHeader: ({ title, subtitle, dataTestId, addons }: SectionHeaderProps) => ReactElement;
|
|
@@ -50,8 +50,8 @@ export interface SidebarProps extends CommonProps {
|
|
|
50
50
|
* - **_The sidebar is just a wrapper. You are responsible for styling the children._**
|
|
51
51
|
*
|
|
52
52
|
* When using this component make sure to add `setupIntersectionObserver();` to your jest.setup.ts file.
|
|
53
|
-
|
|
53
|
+
*
|
|
54
54
|
* @param {SidebarProps} props - The props for the Sidebar component
|
|
55
|
-
* @returns {
|
|
55
|
+
* @returns {ReactElement} Sidebar component
|
|
56
56
|
*/
|
|
57
57
|
export declare const Sidebar: ({ childContainerClassName, children, breakpoint, className, dataTestId, moreMenuProps, menuListProps, overflowThreshold, }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -34,6 +34,6 @@ export type OverflowMap = {
|
|
|
34
34
|
* @returns {object} The overflow items and the ref to the container.
|
|
35
35
|
*/
|
|
36
36
|
export declare const useOverflowItems: ({ threshold, childUniqueIdentifierAttribute, children, }: OverflowItemsOptions) => {
|
|
37
|
-
overflowContainerRef: import("react").
|
|
37
|
+
overflowContainerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
38
38
|
itemOverflowMap: OverflowMap;
|
|
39
39
|
};
|
|
@@ -14,6 +14,6 @@ export interface SpacerProps extends CommonProps {
|
|
|
14
14
|
* The Spacer component is used for adding a bit of space in the ui.
|
|
15
15
|
|
|
16
16
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {ReactElement} Spacer component
|
|
18
18
|
*/
|
|
19
19
|
export declare const Spacer: ({ size, border, dataTestId, className }: SpacerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,7 +37,7 @@ export interface SpinnerProps extends CommonProps {
|
|
|
37
37
|
* Use when retrieving or refreshing small data amounts, such as status.
|
|
38
38
|
|
|
39
39
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
40
|
-
* @returns {
|
|
40
|
+
* @returns {ReactElement} Spinner component
|
|
41
41
|
*/
|
|
42
42
|
export declare const Spinner: ({ mode, size, centering, className, containerClassName, dataTestId, label, }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActivityColors, CriticalityColors, GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
|
|
2
|
-
import { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
import { MouseEventHandler, ReactNode, Ref } from "react";
|
|
3
3
|
import { CommonProps, Size } from "../../common";
|
|
4
4
|
export type TagSize = Extract<Size, "small" | "medium">;
|
|
5
5
|
export type TagColors = IntentColors | GeneralColors | CriticalityColors | ActivityColors;
|
|
@@ -28,6 +28,10 @@ export interface TagProps extends CommonProps {
|
|
|
28
28
|
* Is the tag disabled.
|
|
29
29
|
*/
|
|
30
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A ref for the component
|
|
33
|
+
*/
|
|
34
|
+
ref?: Ref<HTMLElement>;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* The tag component is used to categorize elements in the ui.
|
|
@@ -37,8 +41,11 @@ export interface TagProps extends CommonProps {
|
|
|
37
41
|
* The tag is also used in multiselect components to show selected options.
|
|
38
42
|
*
|
|
39
43
|
* **Do:** Use short labels for easy scanning.
|
|
40
|
-
|
|
44
|
+
*
|
|
41
45
|
* @param {TagProps} props - The props for the tag component
|
|
42
|
-
* @returns {
|
|
46
|
+
* @returns {ReactElement} tag component
|
|
43
47
|
*/
|
|
44
|
-
export declare const Tag:
|
|
48
|
+
export declare const Tag: {
|
|
49
|
+
({ className, dataTestId, children, size, onClose, color, disabled, ref, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
import { CommonProps, Size } from "../../common";
|
|
3
3
|
export type TextType = "p" | "span" | "div";
|
|
4
4
|
export type TextAlign = "left" | "center" | "right";
|
|
@@ -52,6 +52,10 @@ export interface TextProps extends CommonProps {
|
|
|
52
52
|
* Ihe id of the html element
|
|
53
53
|
*/
|
|
54
54
|
id?: string;
|
|
55
|
+
/**
|
|
56
|
+
* A ref for the component
|
|
57
|
+
*/
|
|
58
|
+
ref?: Ref<HTMLElement>;
|
|
55
59
|
/**
|
|
56
60
|
* The title of the html element
|
|
57
61
|
*/
|
|
@@ -63,8 +67,11 @@ export interface TextProps extends CommonProps {
|
|
|
63
67
|
* ### When to use
|
|
64
68
|
*
|
|
65
69
|
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
66
|
-
|
|
70
|
+
*
|
|
67
71
|
* @param {TextProps} props - The props for the Text component
|
|
68
|
-
* @returns {
|
|
72
|
+
* @returns {ReactElement} Text component
|
|
69
73
|
*/
|
|
70
|
-
export declare const Text:
|
|
74
|
+
export declare const Text: {
|
|
75
|
+
({ children, type, size, align, weight, underline, inverted, subtle, italicize, uppercase, disabled, className, dataTestId, ref, ...rest }: TextProps): ReactElement;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
@@ -60,7 +60,7 @@ export type ToggleGroupProps<TSelectedId extends string = string> = CommonProps
|
|
|
60
60
|
* Toggle Group allows users to toggle between two or more closely related options, and immediately apply that selection.
|
|
61
61
|
*
|
|
62
62
|
* @param {ToggleGroupProps} props - The props for the ToggleGroup component
|
|
63
|
-
* @returns {
|
|
63
|
+
* @returns {ReactElement} ToggleGroup component
|
|
64
64
|
*/
|
|
65
65
|
export declare const ToggleGroup: <TSelectedId extends string = string>({ list, selected, setSelected, onChange, disabled, size, isIconOnly, className, dataTestId, }: ToggleGroupProps<TSelectedId>) => import("react/jsx-runtime").JSX.Element;
|
|
66
66
|
export interface ToggleItemProps extends CommonProps, MappedOmit<BasicToggleGroupListProps<string>, "id"> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Placement } from "@floating-ui/react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { CommonProps } from "../../common";
|
|
4
4
|
import { IconProps } from "../Icon/Icon";
|
|
5
5
|
export type TooltipPlacement = Placement | "auto";
|
|
@@ -43,6 +43,6 @@ export interface TooltipProps extends CommonProps {
|
|
|
43
43
|
* **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.
|
|
44
44
|
*
|
|
45
45
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
46
|
-
* @returns {
|
|
46
|
+
* @returns {ReactElement} Tooltip component
|
|
47
47
|
*/
|
|
48
|
-
export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, iconProps, id, }: TooltipProps) =>
|
|
48
|
+
export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, iconProps, id, }: TooltipProps) => ReactElement;
|
|
@@ -45,7 +45,7 @@ export interface ValueBarProps extends CommonProps {
|
|
|
45
45
|
* ValueBar component is used to display value on a colorful bar within provided range.
|
|
46
46
|
|
|
47
47
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
48
|
-
* @returns {
|
|
48
|
+
* @returns {ReactElement} ValueBar component
|
|
49
49
|
*/
|
|
50
50
|
export declare const ValueBar: ({ value, min, max, unit, size, levelColors, valueColor, showValue, className, dataTestId, zeroScoreAllowed, }: ValueBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
export {};
|
|
@@ -32,6 +32,6 @@ export declare const getFillColor: (score: number, levelColors: LevelColors) =>
|
|
|
32
32
|
* @param {number} min - min range value
|
|
33
33
|
* @param {number} max - max range value
|
|
34
34
|
* @param {LevelColors} levelColors - level colors used to coloring the bar
|
|
35
|
-
* @returns {
|
|
35
|
+
* @returns {ReactElement} ValueBar component
|
|
36
36
|
*/
|
|
37
37
|
export declare const getValueBarColorByValue: (value: number, min: number, max: number, levelColors: LevelColors) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from "@trackunit/css-class-variance-utilities";
|
|
2
2
|
import { RelayPagination } from "@trackunit/react-table-pagination";
|
|
3
|
+
import { ReactElement } from "react";
|
|
3
4
|
import { CommonProps } from "../../common/CommonProps";
|
|
4
5
|
import { cvaVirtualizedListItem } from "./VirtualizedList.variants";
|
|
5
6
|
type Separator = NonNullable<VariantProps<typeof cvaVirtualizedListItem>["separator"]>;
|
|
@@ -8,7 +9,7 @@ export interface VirtualizedListProps extends CommonProps {
|
|
|
8
9
|
count: number;
|
|
9
10
|
rowHeight?: number;
|
|
10
11
|
pagination?: RelayPagination;
|
|
11
|
-
children: (index: number) =>
|
|
12
|
+
children: (index: number) => ReactElement | null;
|
|
12
13
|
separator?: Separator;
|
|
13
14
|
loadingIndicator?: LoadingIndicator;
|
|
14
15
|
skeletonLinesHeight?: string;
|
|
@@ -21,7 +22,7 @@ export interface VirtualizedListProps extends CommonProps {
|
|
|
21
22
|
* @property {number} [rowHeight="40"] - The estimated height of each row in the list.
|
|
22
23
|
* @property {RelayPagination | undefined} pagination - Pagination configuration for the list.
|
|
23
24
|
* @property {separator} [separator="line"] - The separator style between items in the list.
|
|
24
|
-
* @property {(index: number) =>
|
|
25
|
+
* @property {(index: number) =>ReactElement} children - A function that takes an index and returns the JSX element to be rendered at said index.
|
|
25
26
|
* @property {loadingIndicator} [loadingIndicator="spinner"] - The type of loading indicator in the list.
|
|
26
27
|
* @property {skeletonLinesHeight} [skeletonLinesHeight="2rem"] - The height of the skeleton lines.
|
|
27
28
|
*/
|
|
@@ -20,6 +20,6 @@ export interface WidgetBodyProps extends CommonProps {
|
|
|
20
20
|
* @summary For applying padding and gap to a Widget.
|
|
21
21
|
* @description The padding must live here, and not on the Widget itself, as to not inset the scrollbar in case of overflow
|
|
22
22
|
* @param {WidgetBodyProps} props - The props for the WidgetBody component
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {ReactElement} WidgetBody component
|
|
24
24
|
*/
|
|
25
25
|
export declare const WidgetBody: ({ density, children, dataTestId, className, disableGap }: WidgetBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent, ReactNode } from "react";
|
|
1
|
+
import { MouseEvent, ReactNode, Ref } from "react";
|
|
2
2
|
import { ButtonCommonProps, ButtonType } from "../shared/ButtonProps";
|
|
3
3
|
export interface ButtonProps extends ButtonCommonProps {
|
|
4
4
|
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
@@ -34,6 +34,10 @@ export interface ButtonProps extends ButtonCommonProps {
|
|
|
34
34
|
* The name of the button
|
|
35
35
|
*/
|
|
36
36
|
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* A ref for the component
|
|
39
|
+
*/
|
|
40
|
+
ref?: Ref<HTMLButtonElement>;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* 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. Button labels express what action will occur when the user interacts with it.
|
|
@@ -45,6 +49,9 @@ export interface ButtonProps extends ButtonCommonProps {
|
|
|
45
49
|
* 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.
|
|
46
50
|
*
|
|
47
51
|
* @param {ButtonProps} props - The props for the Button component
|
|
48
|
-
* @returns {
|
|
52
|
+
* @returns {ReactElement} Button component
|
|
49
53
|
*/
|
|
50
|
-
export declare const Button:
|
|
54
|
+
export declare const Button: {
|
|
55
|
+
({ onClick, children, loading, disabled, className, fullWidth, prefix, suffix, variant, type, size, square, dataTestId, title, role, tabIndex, asChild, circular, ref, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|