@trackunit/react-components 1.17.16 → 1.17.20
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 +182 -170
- package/index.esm.js +183 -171
- package/package.json +5 -5
- package/src/common/Refable.d.ts +5 -0
- package/src/components/Alert/Alert.d.ts +3 -2
- package/src/components/Badge/Badge.d.ts +3 -2
- package/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/src/components/Breadcrumb/utils/types.d.ts +2 -1
- package/src/components/Card/Card.d.ts +7 -3
- package/src/components/Card/CardBody.d.ts +3 -2
- package/src/components/Card/CardFooter.d.ts +3 -2
- package/src/components/Card/CardHeader.d.ts +3 -2
- package/src/components/Collapse/Collapse.d.ts +3 -2
- package/src/components/CopyableText/CopyableText.d.ts +3 -2
- package/src/components/DetailsList/DetailsList.d.ts +4 -2
- package/src/components/EmptyState/EmptyState.d.ts +2 -1
- package/src/components/EmptyValue/EmptyValue.d.ts +2 -1
- package/src/components/ExternalLink/ExternalLink.d.ts +3 -2
- package/src/components/Heading/Heading.d.ts +3 -2
- package/src/components/HorizontalOverflowScroller/HorizontalOverflowScroller.d.ts +4 -2
- package/src/components/Icon/Icon.d.ts +4 -9
- package/src/components/Indicator/Indicator.d.ts +3 -2
- package/src/components/KPI/KPI.d.ts +3 -2
- package/src/components/KPI/KPISkeleton.d.ts +3 -2
- package/src/components/KPICard/KPICard.d.ts +3 -2
- package/src/components/KPICard/KPICardSkeleton.d.ts +3 -2
- package/src/components/KPICard/components/TrendIndicator/TrendIndicator.d.ts +3 -2
- package/src/components/KPICard/components/TrendIndicators.d.ts +3 -2
- package/src/components/Menu/MenuItem/MenuItem.d.ts +3 -2
- package/src/components/Menu/MenuList/MenuList.d.ts +3 -2
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +3 -2
- package/src/components/Notice/Notice.d.ts +3 -2
- package/src/components/Page/Page.d.ts +3 -2
- package/src/components/Page/PageContent.d.ts +3 -2
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/PageHeader/components/PageHeaderKpiMetrics.d.ts +4 -2
- package/src/components/PageHeader/components/PageHeaderTitle.d.ts +4 -2
- package/src/components/PageHeader/types.d.ts +2 -1
- package/src/components/Pagination/Pagination.d.ts +3 -2
- package/src/components/Polygon/Polygon.d.ts +3 -2
- package/src/components/Popover/PopoverTitle.d.ts +3 -2
- package/src/components/PreferenceCard/PreferenceCard.d.ts +3 -2
- package/src/components/PreferenceCard/PreferenceCardSkeleton.d.ts +3 -2
- package/src/components/SectionHeader/SectionHeader.d.ts +3 -2
- package/src/components/Sidebar/Sidebar.d.ts +3 -2
- package/src/components/Skeleton/SkeletonBlock/SkeletonBlock.d.ts +2 -1
- package/src/components/Skeleton/SkeletonLabel/SkeletonLabel.d.ts +2 -1
- package/src/components/SkeletonLines/SkeletonLines.d.ts +4 -3
- package/src/components/Spacer/Spacer.d.ts +3 -2
- package/src/components/Spinner/Spinner.d.ts +3 -2
- package/src/components/Tabs/Tab.d.ts +3 -2
- package/src/components/Tabs/TabContent.d.ts +3 -2
- package/src/components/Tabs/TabList.d.ts +3 -2
- package/src/components/Tabs/Tabs.d.ts +3 -2
- package/src/components/ToggleGroup/ToggleGroup.d.ts +3 -2
- package/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/src/components/ValueBar/ValueBar.d.ts +3 -2
- package/src/components/ZStack/ZStack.d.ts +3 -2
- package/src/components/buttons/StarButton/StarButton.d.ts +3 -2
- package/src/index.d.ts +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../../common/CommonProps";
|
|
3
|
-
|
|
3
|
+
import { Refable } from "../../../common/Refable";
|
|
4
|
+
interface PageHeaderTitleProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* The title of the page header
|
|
6
7
|
*/
|
|
@@ -13,7 +14,8 @@ interface PageHeaderTitleProps extends CommonProps {
|
|
|
13
14
|
* @param {string} props.title - The title of the page header
|
|
14
15
|
* @param {string} props.className - The class name of the page header title
|
|
15
16
|
* @param {string} [props."data-testid"] - The data test id of the page header title
|
|
17
|
+
* @param [props.ref] - Ref forwarded to the root element
|
|
16
18
|
* @returns {ReactElement} PageHeaderTitle component
|
|
17
19
|
*/
|
|
18
|
-
export declare const PageHeaderTitle: ({ title, "data-testid": dataTestId, className, }: PageHeaderTitleProps) => ReactElement;
|
|
20
|
+
export declare const PageHeaderTitle: ({ title, "data-testid": dataTestId, className, ref: forwardedRef, }: PageHeaderTitleProps) => ReactElement;
|
|
19
21
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IconName } from "@trackunit/ui-icons";
|
|
2
2
|
import { MouseEvent, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
+
import { Refable } from "../../common/Refable";
|
|
4
5
|
import { ButtonVariant } from "../buttons/shared/ButtonProps";
|
|
5
6
|
import { TabListProps } from "../Tabs/TabList";
|
|
6
7
|
import { TagColors } from "../Tag/Tag";
|
|
@@ -28,7 +29,7 @@ export type PageHeaderSecondaryActionType = PageHeaderActionType & {
|
|
|
28
29
|
export type PageHeaderPrimaryActionType = PageHeaderActionType & {
|
|
29
30
|
variant: Extract<ButtonVariant, "primary" | "primary-danger" | "secondary">;
|
|
30
31
|
};
|
|
31
|
-
interface BasePageHeaderProps extends CommonProps {
|
|
32
|
+
interface BasePageHeaderProps extends CommonProps, Refable<HTMLDivElement> {
|
|
32
33
|
/**
|
|
33
34
|
* Main title of the page.
|
|
34
35
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
-
|
|
2
|
+
import { Refable } from "../../common/Refable";
|
|
3
|
+
export interface PaginationProps extends Refable<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* A go to previous page handler
|
|
5
6
|
*/
|
|
@@ -59,4 +60,4 @@ export interface PaginationProps {
|
|
|
59
60
|
* @param {PaginationProps} props - The props for the Pagination component
|
|
60
61
|
* @returns {ReactElement} Pagination component
|
|
61
62
|
*/
|
|
62
|
-
export declare const Pagination: ({ previousPage, nextPage, canPreviousPage, canNextPage, pageCount, pageIndex, loading, className, "data-testid": dataTestId, getTranslatedCount, onPageChange, cursorBase, }: PaginationProps) => ReactElement;
|
|
63
|
+
export declare const Pagination: ({ previousPage, nextPage, canPreviousPage, canNextPage, pageCount, pageIndex, loading, className, "data-testid": dataTestId, getTranslatedCount, onPageChange, cursorBase, ref, }: PaginationProps) => ReactElement;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
type Point = [number, number];
|
|
4
|
-
export interface PolygonProps extends CommonProps {
|
|
5
|
+
export interface PolygonProps extends CommonProps, Refable<SVGSVGElement> {
|
|
5
6
|
points: Array<Point>;
|
|
6
7
|
size: number;
|
|
7
8
|
color?: "white" | "black";
|
|
@@ -13,5 +14,5 @@ export interface PolygonProps extends CommonProps {
|
|
|
13
14
|
* @param { PolygonProps} props - The props for the Polygon component
|
|
14
15
|
* @returns {ReactElement} Polygon component
|
|
15
16
|
*/
|
|
16
|
-
export declare const Polygon: ({ points, size, color, opaque, className, "data-testid": dataTestId, }: PolygonProps) => ReactElement;
|
|
17
|
+
export declare const Polygon: ({ points, size, color, opaque, className, "data-testid": dataTestId, ref, }: PolygonProps) => ReactElement;
|
|
17
18
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
4
|
+
export interface PopoverTitleProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
5
|
action?: ReactNode;
|
|
5
6
|
/**
|
|
6
7
|
* Whether there should be a divider between the title and the content.
|
|
@@ -17,4 +18,4 @@ export interface PopoverTitleProps extends CommonProps {
|
|
|
17
18
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
18
19
|
* @returns {ReactElement} PopoverTitle component
|
|
19
20
|
*/
|
|
20
|
-
export declare const PopoverTitle: ({ children, action, divider, className, "data-testid": dataTestId, }: PopoverTitleProps) => ReactElement;
|
|
21
|
+
export declare const PopoverTitle: ({ children, action, divider, className, "data-testid": dataTestId, ref, }: PopoverTitleProps) => ReactElement;
|
|
@@ -3,6 +3,7 @@ import { MappedOmit } from "@trackunit/shared-utils";
|
|
|
3
3
|
import { IconName } from "@trackunit/ui-icons";
|
|
4
4
|
import { ReactElement, ReactNode } from "react";
|
|
5
5
|
import { CommonProps } from "../../common/CommonProps";
|
|
6
|
+
import { Refable } from "../../common/Refable";
|
|
6
7
|
import { TagProps } from "../Tag/Tag";
|
|
7
8
|
import { cvaPreferenceCard } from "./PreferenceCard.variants";
|
|
8
9
|
/**
|
|
@@ -21,7 +22,7 @@ type ImageDetails = {
|
|
|
21
22
|
alt: string;
|
|
22
23
|
containerClassName?: string;
|
|
23
24
|
};
|
|
24
|
-
export interface PreferenceCardProps extends CommonProps, MappedOmit<VariantProps<typeof cvaPreferenceCard>, "className"> {
|
|
25
|
+
export interface PreferenceCardProps extends CommonProps, Refable<HTMLDivElement>, MappedOmit<VariantProps<typeof cvaPreferenceCard>, "className"> {
|
|
25
26
|
/**
|
|
26
27
|
* The title of the preference card
|
|
27
28
|
*/
|
|
@@ -66,5 +67,5 @@ export interface PreferenceCardProps extends CommonProps, MappedOmit<VariantProp
|
|
|
66
67
|
* with various states and visual treatments.
|
|
67
68
|
* It is recommended to be primarily used as an input component, as it supports checkboxes, radio buttons and toggles.
|
|
68
69
|
*/
|
|
69
|
-
export declare const PreferenceCard: ({ title, description, icon, input, titleTag, cardTag, disabled, className, "data-testid": dataTestId, children, }: PreferenceCardProps) => ReactNode;
|
|
70
|
+
export declare const PreferenceCard: ({ title, description, icon, input, titleTag, cardTag, disabled, className, "data-testid": dataTestId, children, ref: forwardedRef, }: PreferenceCardProps) => ReactNode;
|
|
70
71
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
+
import { Refable } from "../../common/Refable";
|
|
2
3
|
/**
|
|
3
4
|
* Default property values for PreferenceCardSkeleton component.
|
|
4
5
|
*/
|
|
@@ -8,7 +9,7 @@ export declare const DEFAULT_SKELETON_PREFERENCE_CARD_PROPS: {
|
|
|
8
9
|
readonly hasCardTag: false;
|
|
9
10
|
readonly hasInput: false;
|
|
10
11
|
};
|
|
11
|
-
export interface PreferenceCardSkeletonProps {
|
|
12
|
+
export interface PreferenceCardSkeletonProps extends Refable<HTMLDivElement> {
|
|
12
13
|
/** Whether to show an icon skeleton */
|
|
13
14
|
hasIcon?: boolean;
|
|
14
15
|
/** Whether to show a title tag skeleton (inline with title) */
|
|
@@ -22,4 +23,4 @@ export interface PreferenceCardSkeletonProps {
|
|
|
22
23
|
* Skeleton loading indicator that mimics the PreferenceCard component structure.
|
|
23
24
|
* Uses the same grid layout, spacing, and visual hierarchy as PreferenceCard.
|
|
24
25
|
*/
|
|
25
|
-
export declare const PreferenceCardSkeleton: ({ hasIcon, hasTitleTag, hasCardTag, hasInput, }: PreferenceCardSkeletonProps) => ReactElement;
|
|
26
|
+
export declare const PreferenceCardSkeleton: ({ hasIcon, hasTitleTag, hasCardTag, hasInput, ref, }: PreferenceCardSkeletonProps) => ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
4
|
+
export interface SectionHeaderProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* The title of the section.
|
|
6
7
|
*/
|
|
@@ -20,4 +21,4 @@ export interface SectionHeaderProps extends CommonProps {
|
|
|
20
21
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
21
22
|
* @returns {ReactElement} SectionHeader component
|
|
22
23
|
*/
|
|
23
|
-
export declare const SectionHeader: ({ title, subtitle, "data-testid": dataTestId, addons, }: SectionHeaderProps) => ReactElement;
|
|
24
|
+
export declare const SectionHeader: ({ title, subtitle, "data-testid": dataTestId, addons, ref, }: SectionHeaderProps) => ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, MouseEventHandler, ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { MenuList } from "../Menu/MenuList/MenuList";
|
|
4
5
|
import { MoreMenu } from "../Menu/MoreMenu/MoreMenu";
|
|
5
6
|
export interface SidebarItemProps extends CommonProps {
|
|
@@ -12,7 +13,7 @@ export interface SidebarItemProps extends CommonProps {
|
|
|
12
13
|
onClick?: MouseEventHandler<HTMLElement>;
|
|
13
14
|
}
|
|
14
15
|
export type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
15
|
-
export interface SidebarProps extends CommonProps {
|
|
16
|
+
export interface SidebarProps extends CommonProps, Refable<HTMLDivElement> {
|
|
16
17
|
/**
|
|
17
18
|
* The breakpoint at which the menu will go from Horizontal to vertical stacked
|
|
18
19
|
*
|
|
@@ -76,4 +77,4 @@ export interface SidebarProps extends CommonProps {
|
|
|
76
77
|
* @param {SidebarProps} props - The props for the Sidebar component
|
|
77
78
|
* @returns {ReactElement} Sidebar component
|
|
78
79
|
*/
|
|
79
|
-
export declare const Sidebar: ({ childContainerClassName, children, breakpoint, className, "data-testid": dataTestId, moreMenuProps, menuListProps, overflowThreshold, }: SidebarProps) => ReactElement;
|
|
80
|
+
export declare const Sidebar: ({ childContainerClassName, children, breakpoint, className, "data-testid": dataTestId, moreMenuProps, menuListProps, overflowThreshold, ref, }: SidebarProps) => ReactElement;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StringWithAutocompleteOptions } from "@trackunit/shared-utils";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { CommonProps } from "../../../common/CommonProps";
|
|
4
|
+
import { Refable } from "../../../common/Refable";
|
|
4
5
|
import { CSSLength } from "../Skeleton.helpers";
|
|
5
|
-
export type SkeletonBlockProps = CommonProps & {
|
|
6
|
+
export type SkeletonBlockProps = CommonProps & Refable<HTMLDivElement> & {
|
|
6
7
|
/**
|
|
7
8
|
* The height of the skeleton.
|
|
8
9
|
*
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StringWithAutocompleteOptions } from "@trackunit/shared-utils";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { CommonProps } from "../../../common/CommonProps";
|
|
4
|
+
import { Refable } from "../../../common/Refable";
|
|
4
5
|
import { CSSLength, TextSizeKey } from "../Skeleton.helpers";
|
|
5
|
-
export type SkeletonLabelProps = CommonProps & {
|
|
6
|
+
export type SkeletonLabelProps = CommonProps & Refable<HTMLDivElement> & {
|
|
6
7
|
/**
|
|
7
8
|
* The text size to match, using text size keys.
|
|
8
9
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StringWithAutocompleteOptions } from "@trackunit/shared-utils";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { CSSLength, TextSizeKey } from "../Skeleton/Skeleton.helpers";
|
|
4
5
|
/**
|
|
5
6
|
* Preset configurations for common skeleton patterns.
|
|
@@ -50,7 +51,7 @@ export type SkeletonLineConfig = BaseSkeletonLineConfig & {
|
|
|
50
51
|
*
|
|
51
52
|
* Use this for displaying multiple identical skeleton lines.
|
|
52
53
|
*/
|
|
53
|
-
export type UniformSkeletonLinesProps = CommonProps & BaseSkeletonLineConfig & {
|
|
54
|
+
export type UniformSkeletonLinesProps = CommonProps & Refable<HTMLDivElement> & BaseSkeletonLineConfig & {
|
|
54
55
|
/**
|
|
55
56
|
* Visual variant: "uniform" (default)
|
|
56
57
|
*
|
|
@@ -73,7 +74,7 @@ export type UniformSkeletonLinesProps = CommonProps & BaseSkeletonLineConfig & {
|
|
|
73
74
|
*
|
|
74
75
|
* Use this for displaying skeleton lines with per-line configuration (varying widths, textSize (height), etc.).
|
|
75
76
|
*/
|
|
76
|
-
type CustomSkeletonLinesProps = CommonProps & {
|
|
77
|
+
type CustomSkeletonLinesProps = CommonProps & Refable<HTMLDivElement> & {
|
|
77
78
|
/**
|
|
78
79
|
* Visual variant: "custom"
|
|
79
80
|
*
|
|
@@ -92,7 +93,7 @@ type CustomSkeletonLinesProps = CommonProps & {
|
|
|
92
93
|
*
|
|
93
94
|
* Use this for common skeleton patterns with predefined configurations.
|
|
94
95
|
*/
|
|
95
|
-
type PresetSkeletonLinesProps = CommonProps & {
|
|
96
|
+
type PresetSkeletonLinesProps = CommonProps & Refable<HTMLDivElement> & {
|
|
96
97
|
/**
|
|
97
98
|
* Visual variant: "preset"
|
|
98
99
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { Size } from "../../common/Size";
|
|
4
|
-
export interface SpacerProps extends CommonProps {
|
|
5
|
+
export interface SpacerProps extends CommonProps, Refable<HTMLDivElement> {
|
|
5
6
|
/**
|
|
6
7
|
* The minimum height of the spacer. Defaults to 1px.
|
|
7
8
|
* Possible values are "normal"(8px), and "large" (32px).
|
|
@@ -29,4 +30,4 @@ export interface SpacerProps extends CommonProps {
|
|
|
29
30
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
30
31
|
* @returns {ReactElement} Spacer component
|
|
31
32
|
*/
|
|
32
|
-
export declare const Spacer: ({ size, border, "data-testid": dataTestId, className, }: SpacerProps) => ReactElement;
|
|
33
|
+
export declare const Spacer: ({ size, border, "data-testid": dataTestId, className, ref, }: SpacerProps) => ReactElement;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { Size } from "../../common/Size";
|
|
4
5
|
type Centering = "horizontally" | "vertically" | "centered";
|
|
5
|
-
export interface SpinnerProps extends CommonProps {
|
|
6
|
+
export interface SpinnerProps extends CommonProps, Refable<HTMLDivElement> {
|
|
6
7
|
/**
|
|
7
8
|
* Defines the size of the spinner.
|
|
8
9
|
*/
|
|
@@ -40,5 +41,5 @@ export interface SpinnerProps extends CommonProps {
|
|
|
40
41
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
41
42
|
* @returns {ReactElement} Spinner component
|
|
42
43
|
*/
|
|
43
|
-
export declare const Spinner: ({ mode, size, centering, className, containerClassName, "data-testid": dataTestId, label, }: SpinnerProps) => ReactElement;
|
|
44
|
+
export declare const Spinner: ({ mode, size, centering, className, containerClassName, "data-testid": dataTestId, label, ref, }: SpinnerProps) => ReactElement;
|
|
44
45
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TabsTriggerProps } from "@radix-ui/react-tabs";
|
|
2
2
|
import { IconName } from "@trackunit/ui-icons";
|
|
3
3
|
import { ReactElement, ReactNode } from "react";
|
|
4
|
+
import { Refable } from "../../common/Refable";
|
|
4
5
|
export interface TabChildProps {
|
|
5
6
|
children?: ReactNode;
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export interface TabProps extends TabsTriggerProps {
|
|
9
|
+
export interface TabProps extends TabsTriggerProps, Refable<HTMLButtonElement> {
|
|
9
10
|
/**
|
|
10
11
|
* Specifies whether the tab should occupy the full width of its container.
|
|
11
12
|
*/
|
|
@@ -43,4 +44,4 @@ export interface TabProps extends TabsTriggerProps {
|
|
|
43
44
|
* Wrapper for radix tab component.
|
|
44
45
|
* We add a custom implementation of the asChild prop to make it easy to make the child element look like other tabs.
|
|
45
46
|
*/
|
|
46
|
-
export declare const Tab: ({ value, isFullWidth, iconName, "data-testid": dataTestId, className, children, suffix, asChild, appendTabStylesToChildIfAsChild, ...rest }: TabProps) => ReactElement;
|
|
47
|
+
export declare const Tab: ({ value, isFullWidth, iconName, "data-testid": dataTestId, className, children, suffix, asChild, appendTabStylesToChildIfAsChild, ref, ...rest }: TabProps) => ReactElement;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TabsContentProps } from "@radix-ui/react-tabs";
|
|
2
2
|
import { IconName } from "@trackunit/ui-icons";
|
|
3
3
|
import { ReactElement, ReactNode } from "react";
|
|
4
|
-
|
|
4
|
+
import { Refable } from "../../common/Refable";
|
|
5
|
+
export interface TabContentProps extends TabsContentProps, Refable<HTMLDivElement> {
|
|
5
6
|
className?: string;
|
|
6
7
|
"data-testid"?: string;
|
|
7
8
|
children?: ReactNode;
|
|
@@ -11,4 +12,4 @@ export interface TabContentProps extends TabsContentProps {
|
|
|
11
12
|
/**
|
|
12
13
|
* Wrapper for radix tab content component.
|
|
13
14
|
*/
|
|
14
|
-
export declare const TabContent: ({ className, "data-testid": dataTestId, children, ...rest }: TabContentProps) => ReactElement;
|
|
15
|
+
export declare const TabContent: ({ className, "data-testid": dataTestId, children, ref, ...rest }: TabContentProps) => ReactElement;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TabsListProps } from "@radix-ui/react-tabs";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { TabContentProps } from "./TabContent";
|
|
4
|
-
export interface TabListProps extends TabsListProps {
|
|
5
|
+
export interface TabListProps extends TabsListProps, Refable<HTMLDivElement> {
|
|
5
6
|
/**
|
|
6
7
|
* The child elements to be displayed within the Tabs component.
|
|
7
8
|
*/
|
|
@@ -24,4 +25,4 @@ export interface TabListProps extends TabsListProps {
|
|
|
24
25
|
/**
|
|
25
26
|
* Wrapper for radix tab list component.
|
|
26
27
|
*/
|
|
27
|
-
export declare const TabList: ({ className, "data-testid": dataTestId, children, autoScrollToActive, ...rest }: TabListProps) => ReactElement;
|
|
28
|
+
export declare const TabList: ({ className, "data-testid": dataTestId, children, autoScrollToActive, ref, ...rest }: TabListProps) => ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TabsProps as TabsRootProps } from "@radix-ui/react-tabs";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
4
|
+
export interface TabsProps extends TabsRootProps, Refable<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* If set to true, forces the content of all tabs to render even if not selected.
|
|
6
7
|
*/
|
|
@@ -58,4 +59,4 @@ export interface TabsProps extends TabsRootProps {
|
|
|
58
59
|
* );
|
|
59
60
|
* ```
|
|
60
61
|
*/
|
|
61
|
-
export declare const Tabs: ({ children, forceRender, className, "data-testid": dataTestId, fullWidth, ...rest }: TabsProps) => ReactElement;
|
|
62
|
+
export declare const Tabs: ({ children, forceRender, className, "data-testid": dataTestId, fullWidth, ref, ...rest }: TabsProps) => ReactElement;
|
|
@@ -3,6 +3,7 @@ import { MappedOmit } from "@trackunit/shared-utils";
|
|
|
3
3
|
import { IconName } from "@trackunit/ui-icons";
|
|
4
4
|
import { Dispatch, MouseEventHandler, ReactElement, SetStateAction } from "react";
|
|
5
5
|
import { CommonProps } from "../../common/CommonProps";
|
|
6
|
+
import { Refable } from "../../common/Refable";
|
|
6
7
|
import { TooltipPlacement } from "../Tooltip/Tooltip";
|
|
7
8
|
import { cvaToggleGroup } from "./ToggleGroup.variants";
|
|
8
9
|
export interface BasicToggleGroupListProps<TSelectedId extends string = string> extends CommonProps {
|
|
@@ -38,7 +39,7 @@ export interface BasicToggleGroupListProps<TSelectedId extends string = string>
|
|
|
38
39
|
placement?: TooltipPlacement;
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
export type ToggleGroupProps<TSelectedId extends string = string> = CommonProps & MappedOmit<VariantProps<typeof cvaToggleGroup>, "className"> & {
|
|
42
|
+
export type ToggleGroupProps<TSelectedId extends string = string> = CommonProps & Refable<HTMLDivElement> & MappedOmit<VariantProps<typeof cvaToggleGroup>, "className"> & {
|
|
42
43
|
list: ReadonlyArray<BasicToggleGroupListProps<TSelectedId>>;
|
|
43
44
|
/**
|
|
44
45
|
* Instead of onClick, we now use onChange to return the selected value
|
|
@@ -62,7 +63,7 @@ export type ToggleGroupProps<TSelectedId extends string = string> = CommonProps
|
|
|
62
63
|
* @param {ToggleGroupProps} props - The props for the ToggleGroup component
|
|
63
64
|
* @returns {ReactElement} ToggleGroup component
|
|
64
65
|
*/
|
|
65
|
-
export declare const ToggleGroup: <TSelectedId extends string = string>({ list, selected, setSelected, onChange, disabled, size, isIconOnly, className, "data-testid": dataTestId, }: ToggleGroupProps<TSelectedId>) => ReactElement;
|
|
66
|
+
export declare const ToggleGroup: <TSelectedId extends string = string>({ list, selected, setSelected, onChange, disabled, size, isIconOnly, className, "data-testid": dataTestId, ref, }: ToggleGroupProps<TSelectedId>) => ReactElement;
|
|
66
67
|
export interface ToggleItemProps extends CommonProps, MappedOmit<BasicToggleGroupListProps<string>, "id"> {
|
|
67
68
|
title: string;
|
|
68
69
|
text?: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
3
4
|
import { Size } from "../../common/Size";
|
|
4
5
|
import { LevelColors } from "./ValueBarTypes";
|
|
5
6
|
type ValueBarSize = Extract<Size, "small" | "large"> | "extraSmall";
|
|
6
|
-
export interface ValueBarProps extends CommonProps {
|
|
7
|
+
export interface ValueBarProps extends CommonProps, Refable<HTMLSpanElement> {
|
|
7
8
|
/**
|
|
8
9
|
* Value to display.
|
|
9
10
|
*/
|
|
@@ -49,5 +50,5 @@ export interface ValueBarProps extends CommonProps {
|
|
|
49
50
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
50
51
|
* @returns {ReactElement} ValueBar component
|
|
51
52
|
*/
|
|
52
|
-
export declare const ValueBar: ({ value, min, max, unit, size, levelColors, valueColor, showValue, className, "data-testid": dataTestId, zeroScoreAllowed, }: ValueBarProps) => ReactElement;
|
|
53
|
+
export declare const ValueBar: ({ value, min, max, unit, size, levelColors, valueColor, showValue, className, "data-testid": dataTestId, zeroScoreAllowed, ref, }: ValueBarProps) => ReactElement;
|
|
53
54
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
|
|
3
|
+
import { Refable } from "../../common/Refable";
|
|
4
|
+
export type ZStackProps = CommonProps & Refable<HTMLDivElement> & {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
@@ -10,4 +11,4 @@ export type ZStackProps = CommonProps & {
|
|
|
10
11
|
* @param { ZStackProps} props - The props for the ZStack component
|
|
11
12
|
* @returns {Element} ZStack component
|
|
12
13
|
*/
|
|
13
|
-
export declare const ZStack: ({ children, className, "data-testid": dataTestId }: ZStackProps) => ReactElement;
|
|
14
|
+
export declare const ZStack: ({ children, className, "data-testid": dataTestId, ref }: ZStackProps) => ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactElement } from "react";
|
|
2
|
-
|
|
2
|
+
import { Refable } from "../../../common/Refable";
|
|
3
|
+
interface StarButtonProps extends Refable<HTMLDivElement> {
|
|
3
4
|
starred: boolean;
|
|
4
5
|
onClick: MouseEventHandler<HTMLDivElement>;
|
|
5
6
|
}
|
|
@@ -9,5 +10,5 @@ interface StarButtonProps {
|
|
|
9
10
|
* @param {StarButtonProps} props - The props for the StarButton component
|
|
10
11
|
* @returns {ReactElement} StarButton component
|
|
11
12
|
*/
|
|
12
|
-
export declare const StarButton: ({ starred, onClick }: StarButtonProps) => ReactElement;
|
|
13
|
+
export declare const StarButton: ({ starred, onClick, ref }: StarButtonProps) => ReactElement;
|
|
13
14
|
export {};
|
package/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./common/AllOrNone";
|
|
|
2
2
|
export * from "./common/AriaProps";
|
|
3
3
|
export * from "./common/CommonProps";
|
|
4
4
|
export * from "./common/PackageNameStoryComponent";
|
|
5
|
+
export * from "./common/Refable";
|
|
5
6
|
export * from "./common/Size";
|
|
6
7
|
export * from "./common/StorybookProps";
|
|
7
8
|
export * from "./common/Styleable";
|