@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.
Files changed (56) hide show
  1. package/index.cjs.js +89 -75
  2. package/index.esm.js +89 -75
  3. package/package.json +8 -8
  4. package/src/components/Alert/Alert.d.ts +2 -2
  5. package/src/components/Badge/Badge.d.ts +1 -1
  6. package/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
  7. package/src/components/Card/Card.d.ts +2 -2
  8. package/src/components/Card/CardBody.d.ts +1 -1
  9. package/src/components/Card/CardFooter.d.ts +2 -2
  10. package/src/components/Card/CardHeader.d.ts +2 -2
  11. package/src/components/Collapse/Collapse.d.ts +1 -1
  12. package/src/components/CopyableText/CopyableText.d.ts +1 -1
  13. package/src/components/EmptyValue/EmptyValue.d.ts +3 -2
  14. package/src/components/ExternalLink/ExternalLink.d.ts +5 -4
  15. package/src/components/Heading/Heading.d.ts +4 -4
  16. package/src/components/Icon/Icon.d.ts +1 -1
  17. package/src/components/Indicator/Indicator.d.ts +4 -3
  18. package/src/components/KPICard/KPICard.d.ts +3 -3
  19. package/src/components/Menu/MenuItem/MenuItem.d.ts +6 -5
  20. package/src/components/Menu/MenuList/MenuList.d.ts +4 -3
  21. package/src/components/Menu/MoreMenu/MoreMenu.d.ts +1 -1
  22. package/src/components/Notice/Notice.d.ts +4 -3
  23. package/src/components/PageHeader/PageHeader.d.ts +1 -1
  24. package/src/components/Pagination/Pagination.d.ts +1 -1
  25. package/src/components/Polygon/Polygon.d.ts +1 -1
  26. package/src/components/Popover/Popover.d.ts +1 -1
  27. package/src/components/Popover/PopoverContent.d.ts +9 -2
  28. package/src/components/Popover/PopoverTitle.d.ts +2 -2
  29. package/src/components/Popover/PopoverTrigger.d.ts +14 -4
  30. package/src/components/Popover/PopoverTypes.d.ts +6 -4
  31. package/src/components/SectionHeader/SectionHeader.d.ts +3 -3
  32. package/src/components/Sidebar/Sidebar.d.ts +2 -2
  33. package/src/components/Sidebar/useOverflowItems.d.ts +1 -1
  34. package/src/components/Spacer/Spacer.d.ts +1 -1
  35. package/src/components/Spinner/Spinner.d.ts +1 -1
  36. package/src/components/Tabs/Tab.d.ts +1 -1
  37. package/src/components/Tabs/TabContent.d.ts +1 -1
  38. package/src/components/Tag/Tag.d.ts +11 -4
  39. package/src/components/Text/Text.d.ts +11 -4
  40. package/src/components/ToggleGroup/ToggleGroup.d.ts +1 -1
  41. package/src/components/Tooltip/Tooltip.d.ts +3 -3
  42. package/src/components/ValueBar/ValueBar.d.ts +1 -1
  43. package/src/components/ValueBar/ValueBarHelper.d.ts +1 -1
  44. package/src/components/VirtualizedList/VirtualizedList.d.ts +3 -2
  45. package/src/components/Widget/WidgetBody.d.ts +1 -1
  46. package/src/components/buttons/Button/Button.d.ts +10 -3
  47. package/src/components/buttons/IconButton/IconButton.d.ts +12 -2
  48. package/src/components/buttons/StarButton/StarButton.d.ts +2 -2
  49. package/src/hooks/useClickOutside.d.ts +1 -1
  50. package/src/hooks/useContainerBreakpoints.d.ts +1 -1
  51. package/src/hooks/useElevatedReducer.d.ts +2 -2
  52. package/src/hooks/useGeometry.d.ts +1 -1
  53. package/src/hooks/useIsTextTruncated.d.ts +3 -3
  54. package/src/hooks/useIsTextWrapping.d.ts +1 -1
  55. package/src/hooks/useScrollDetection.d.ts +1 -1
  56. 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 {JSX.Element} CardFooter component
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 {JSX.Element} CardHeader component
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 {JSX.Element} Collapse component
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 {JSX.Element} CopyableText component
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 {JSX.Element} EmptyValue component
9
+ * @returns {ReactElement} EmptyValue component
9
10
  */
10
- export declare const EmptyValue: ({ className, dataTestId }: EmptyValueProps) => JSX.Element;
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?: React.ReactNode;
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: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
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 {JSX.Element} External Link component
30
+ * @returns {ReactElement} External Link component
30
31
  */
31
- export declare const ExternalLink: ({ rel, target, href, className, children, title, dataTestId, onClick, }: ExternalLinkProps) => JSX.Element;
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 {JSX.Element} Heading component
26
+ * @returns {ReactElement} Heading component
27
27
  */
28
- export declare const Heading: ({ variant, inverted, subtle, className, dataTestId, ...rest }: HeadingProps) => JSX.Element;
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 {JSX.Element} Icon component
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?: JSX.Element;
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 {JSX.Element} Indicator component
44
+ * @returns {ReactElement} Indicator component
44
45
  */
45
- export declare const Indicator: ({ dataTestId, icon, label, color, withBackground, withLabel, ping, size, className, ...rest }: IndicatorProps) => JSX.Element;
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 {JSX.Element} KPICard component
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) => JSX.Element;
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?: React.ReactNode;
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?: React.ReactNode;
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?: React.ReactNode;
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?: React.MouseEventHandler<HTMLDivElement>;
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 {JSX.Element} MenuItem component
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: React.ReactNode;
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 {JSX.Element} MenuList component
40
+ * @returns {ReactElement} MenuList component
40
41
  */
41
- export declare const MenuList: ({ dataTestId, className, children, withStickyHeader, isMulti, selectedItems: controlledSelectedItems, onSelectionChange, ...args }: MenuListProps) => JSX.Element;
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 {JSX.Element} MoreMenu component
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: JSX.Element;
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 {JSX.Element} Notice component
42
+ * @returns {ReactElement} Notice component
42
43
  */
43
- export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, tooltipLabel, withTooltip, size, ...rest }: NoticeProps) => JSX.Element;
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 {JSX.Element} PageHeader component
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 {JSX.Element} Pagination component
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 {JSX.Element} Polygon component
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 {JSX.Element} A Popover Context Provider containing the children
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
- export declare const PopoverContent: import("react").ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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 {JSX.Element} PopoverTitle component
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
- interface PopoverTriggerProps {
2
- /** Any elements that when clicked should open the popover */
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
- export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLProps<HTMLElement> & PopoverTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
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?: React.HTMLProps<Element>) => Record<string, unknown>;
78
- getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
79
- getItemProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
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 {JSX.Element} SectionHeader component
21
+ * @returns {ReactElement} SectionHeader component
22
22
  */
23
- export declare const SectionHeader: ({ title, subtitle, dataTestId, addons }: SectionHeaderProps) => JSX.Element;
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 {JSX.Element} Sidebar component
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").MutableRefObject<HTMLDivElement | null>;
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 {JSX.Element} Spacer component
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 {JSX.Element} Spinner component
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 {};
@@ -21,7 +21,7 @@ export interface TabProps extends TabsTriggerProps {
21
21
  /**
22
22
  * A JSX element to be rendered as a suffix to the tab content.
23
23
  */
24
- suffix?: JSX.Element;
24
+ suffix?: ReactElement;
25
25
  /**
26
26
  * The name of the icon associated with the tab.
27
27
  */
@@ -5,7 +5,7 @@ export interface TabContentProps extends TabsContentProps {
5
5
  className?: string;
6
6
  dataTestId?: string;
7
7
  children?: ReactNode;
8
- suffix?: JSX.Element;
8
+ suffix?: ReactNode;
9
9
  iconName?: IconName;
10
10
  }
11
11
  /**
@@ -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 {JSX.Element} tag component
46
+ * @returns {ReactElement} tag component
43
47
  */
44
- export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLElement>>;
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 {JSX.Element} Text component
72
+ * @returns {ReactElement} Text component
69
73
  */
70
- export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>>;
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 {JSX.Element} ToggleGroup component
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 {JSX.Element} Tooltip component
46
+ * @returns {ReactElement} Tooltip component
47
47
  */
48
- export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, iconProps, id, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
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 {JSX.Element} ValueBar component
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 {JSX.Element} ValueBar component
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) => JSX.Element | null;
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) => JSX.Element} children - A function that takes an index and returns the JSX element to be rendered at said index.
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 {JSX.Element} WidgetBody component
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 {JSX.Element} Button component
52
+ * @returns {ReactElement} Button component
49
53
  */
50
- export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
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
+ };