@trackunit/react-components 0.1.117 → 0.1.124
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 +39061 -2457
- package/index.js +39057 -2457
- package/package.json +9 -8
- package/src/common/CommonProps.d.ts +12 -12
- package/src/common/StorybookProps.d.ts +6 -6
- package/src/common/index.d.ts +3 -3
- package/src/common/useContainerProps.d.ts +16 -16
- package/src/components/Alert/Alert.d.ts +53 -53
- package/src/components/Alert/Alert.variants.d.ts +18 -18
- package/src/components/Alert/index.d.ts +1 -1
- package/src/components/Badge/Badge.d.ts +38 -38
- package/src/components/Badge/Badge.variants.d.ts +3 -3
- package/src/components/Badge/index.d.ts +1 -1
- package/src/components/Card/Card.d.ts +39 -39
- package/src/components/Card/Card.variants.d.ts +13 -13
- package/src/components/Card/CardBody.d.ts +25 -25
- package/src/components/Card/CardFooter.d.ts +25 -25
- package/src/components/Card/CardHeader.d.ts +47 -47
- package/src/components/Card/DensityContainer.d.ts +30 -30
- package/src/components/Card/index.d.ts +5 -5
- package/src/components/Clickable/Clickable.variants.d.ts +3 -3
- package/src/components/Collapse/Collapse.d.ts +28 -28
- package/src/components/Collapse/Collapse.variants.d.ts +8 -8
- package/src/components/Collapse/index.d.ts +1 -1
- package/src/components/CopyableText/CopyableText.d.ts +21 -21
- package/src/components/CopyableText/CopyableText.variants.d.ts +3 -3
- package/src/components/CopyableText/index.d.ts +1 -1
- package/src/components/DayPicker/DayPicker.d.ts +32 -32
- package/src/components/DayPicker/DayPickerPopover.d.ts +22 -22
- package/src/components/DayPicker/DayRangePicker.d.ts +33 -33
- package/src/components/DayPicker/index.d.ts +21 -21
- package/src/components/DayPicker/useLocale.d.ts +8 -8
- package/src/components/Drawer/Drawer.d.ts +32 -32
- package/src/components/Drawer/Drawer.variants.d.ts +4 -4
- package/src/components/ExternalLink/ExternalLink.d.ts +31 -31
- package/src/components/Heading/Heading.d.ts +28 -28
- package/src/components/Heading/Heading.variants.d.ts +5 -5
- package/src/components/Heading/index.d.ts +1 -1
- package/src/components/Icon/Icon.d.ts +52 -52
- package/src/components/Icon/Icon.variants.d.ts +8 -8
- package/src/components/Indicator/Indicator.d.ts +42 -42
- package/src/components/Indicator/Indicator.variants.d.ts +10 -10
- package/src/components/Indicator/index.d.ts +1 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +57 -65
- package/src/components/Menu/MenuItem/MenuItem.variants.d.ts +12 -0
- package/src/components/Menu/MenuList/MenuList.d.ts +29 -36
- package/src/components/Menu/MenuList/MenuList.variants.d.ts +4 -0
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +24 -24
- package/src/components/Menu/MoreMenu/MoreMenu.variants.d.ts +1 -0
- package/src/components/Menu/index.d.ts +3 -3
- package/src/components/Modal/Modal.d.ts +30 -30
- package/src/components/Modal/Modal.variants.d.ts +5 -0
- package/src/components/Modal/ModalBackdrop.d.ts +13 -13
- package/src/components/Modal/index.d.ts +3 -3
- package/src/components/Modal/useModal.d.ts +21 -21
- package/src/components/PageHeader/PageHeader.d.ts +47 -47
- package/src/components/PageHeader/PageHeader.variants.d.ts +5 -5
- package/src/components/PageHeader/index.d.ts +1 -1
- package/src/components/Pagination/Pagination.d.ts +62 -62
- package/src/components/Pagination/Pagination.variants.d.ts +2 -2
- package/src/components/Popover/Popover.d.ts +72 -72
- package/src/components/Popover/Popover.variants.d.ts +5 -5
- package/src/components/Popover/PopoverContent.d.ts +7 -7
- package/src/components/Popover/PopoverTitle.d.ts +20 -20
- package/src/components/Popover/PopoverTrigger.d.ts +12 -12
- package/src/components/Popover/PopoverTypes.d.ts +33 -33
- package/src/components/Popover/index.d.ts +5 -5
- package/src/components/Popover/usePopover.d.ts +56 -56
- package/src/components/Prompt/Prompt.d.ts +20 -20
- package/src/components/Prompt/index.d.ts +1 -1
- package/src/components/SectionHeader/SectionHeader.d.ts +23 -23
- package/src/components/SectionHeader/index.d.ts +1 -1
- package/src/components/Sidebar/Sidebar.d.ts +57 -57
- package/src/components/Sidebar/Sidebar.variants.d.ts +4 -4
- package/src/components/Sidebar/useOverflowItems.d.ts +39 -39
- package/src/components/SkeletonLines/SkeletonLines.d.ts +25 -25
- package/src/components/SkeletonLines/SkeletonLines.variants.d.ts +1 -1
- package/src/components/SkeletonLines/index.d.ts +1 -1
- package/src/components/Spacer/Spacer.d.ts +20 -20
- package/src/components/Spacer/Spacer.variants.d.ts +4 -4
- package/src/components/Spacer/index.d.ts +1 -1
- package/src/components/Spinner/Spinner.d.ts +39 -39
- package/src/components/Spinner/Spinner.variants.d.ts +7 -7
- package/src/components/Spinner/index.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +40 -40
- package/src/components/Tag/Tag.variants.d.ts +7 -7
- package/src/components/Tag/index.d.ts +1 -1
- package/src/components/Text/Text.d.ts +58 -58
- package/src/components/Text/Text.variants.d.ts +9 -0
- package/src/components/Text/index.d.ts +1 -1
- package/src/components/Timeline/Timeline.d.ts +33 -33
- package/src/components/Timeline/Timeline.variants.d.ts +3 -3
- package/src/components/Tip/Tip.d.ts +26 -26
- package/src/components/Tip/Tip.variants.d.ts +4 -4
- package/src/components/Tip/index.d.ts +1 -1
- package/src/components/Tooltip/Tooltip.d.ts +37 -37
- package/src/components/Tooltip/Tooltip.variants.d.ts +6 -6
- package/src/components/Tooltip/index.d.ts +1 -1
- package/src/components/ValueBar/ValueBar.d.ts +44 -44
- package/src/components/ValueBar/ValueBar.variants.d.ts +9 -9
- package/src/components/ValueBar/ValueBarHelper.d.ts +35 -35
- package/src/components/ValueBar/ValueBarTypes.d.ts +9 -9
- package/src/components/ValueBar/index.d.ts +3 -3
- package/src/components/buttons/BackToTopButton/BackToTopButton.d.ts +14 -14
- package/src/components/buttons/BackToTopButton/BackToTopButton.variants.d.ts +3 -3
- package/src/components/buttons/Button/Button.d.ts +44 -44
- package/src/components/buttons/IconButton/IconButton.d.ts +20 -20
- package/src/components/buttons/StarButton/StarButton.d.ts +13 -13
- package/src/components/buttons/index.d.ts +4 -4
- package/src/components/buttons/shared/Button.variants.d.ts +13 -13
- package/src/components/buttons/shared/ButtonProps.d.ts +48 -48
- package/src/components/index.d.ts +30 -30
- package/src/hooks/index.d.ts +9 -9
- package/src/hooks/localStorage/initLocalStorageState.d.ts +9 -0
- package/src/hooks/localStorage/types.d.ts +27 -0
- package/src/hooks/localStorage/useLocalStorage.d.ts +10 -0
- package/src/hooks/localStorage/useLocalStorageEffect.d.ts +11 -0
- package/src/hooks/localStorage/useLocalStorageReducer.d.ts +13 -0
- package/src/hooks/localStorage/validateState.d.ts +13 -0
- package/src/hooks/useClickOutside.d.ts +12 -12
- package/src/hooks/useDebounce.d.ts +13 -13
- package/src/hooks/useDevicePixelRatio.d.ts +37 -37
- package/src/hooks/useHover.d.ts +24 -24
- package/src/hooks/useIsFirstRender.d.ts +6 -6
- package/src/hooks/useResize.d.ts +10 -10
- package/src/hooks/useTimeout.d.ts +11 -11
- package/src/index.d.ts +8 -7
- package/src/layout/helper/MinTopFullContentLayout.d.ts +18 -18
- package/src/layout/index.d.ts +6 -6
- package/src/layout/responsive/FilterListMapLayout.d.ts +15 -22
- package/src/layout/responsive/FullWidthRepeatingLayout.d.ts +19 -19
- package/src/layout/responsive/GridArea.d.ts +13 -13
- package/src/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +32 -32
- package/src/layout/responsive/TitleNavContentLayout.d.ts +28 -28
- package/src/test-utils/hooks.d.ts +4 -4
- package/src/test-utils/test-utils.d.ts +5 -5
- package/src/hooks/useLocalStorage.d.ts +0 -9
- package/src/hooks/useLocalStorageReducer.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.124",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,19 +8,20 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "0.22.2",
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "0.0.
|
|
12
|
-
"@trackunit/css-core": "0.0.
|
|
13
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
14
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
15
|
-
"@trackunit/ui-icons": "0.0.
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "0.0.6",
|
|
12
|
+
"@trackunit/css-core": "0.0.88",
|
|
13
|
+
"@trackunit/tailwind-styled-components": "0.0.58",
|
|
14
|
+
"@trackunit/ui-design-tokens": "0.0.72",
|
|
15
|
+
"@trackunit/ui-icons": "0.0.69",
|
|
16
16
|
"date-fns": "2.29.3",
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"react": "18.2.0",
|
|
19
19
|
"react-day-picker": "8.7.1",
|
|
20
20
|
"react-helmet-async": "1.3.0",
|
|
21
|
-
"react-router-dom": "6.
|
|
21
|
+
"react-router-dom": "6.11.2",
|
|
22
22
|
"react-use": "17.4.0",
|
|
23
|
-
"react-useportal": "1.0.17"
|
|
23
|
+
"react-useportal": "1.0.17",
|
|
24
|
+
"zod": "3.14.1"
|
|
24
25
|
},
|
|
25
26
|
"module": "./index.js",
|
|
26
27
|
"main": "./index.cjs",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface CommonProps {
|
|
2
|
-
/**
|
|
3
|
-
* A custom class name to be attached to root element
|
|
4
|
-
*/
|
|
5
|
-
className?: string;
|
|
6
|
-
/**
|
|
7
|
-
* A id that can be used in tests to get the component
|
|
8
|
-
*/
|
|
9
|
-
dataTestId?: string;
|
|
10
|
-
}
|
|
11
|
-
export type Density = "none" | "compact" | "comfortable" | "spacious" | "auto";
|
|
12
|
-
export type Size = "small" | "medium" | "large";
|
|
1
|
+
export interface CommonProps {
|
|
2
|
+
/**
|
|
3
|
+
* A custom class name to be attached to root element
|
|
4
|
+
*/
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* A id that can be used in tests to get the component
|
|
8
|
+
*/
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
}
|
|
11
|
+
export type Density = "none" | "compact" | "comfortable" | "spacious" | "auto";
|
|
12
|
+
export type Size = "small" | "medium" | "large";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const docs: {
|
|
2
|
-
source: {
|
|
3
|
-
type: string;
|
|
4
|
-
excludeDecorators: boolean;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
export declare const docs: {
|
|
2
|
+
source: {
|
|
3
|
+
type: string;
|
|
4
|
+
excludeDecorators: boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
package/src/common/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./CommonProps";
|
|
2
|
-
export * from "./StorybookProps";
|
|
3
|
-
export * from "./useContainerProps";
|
|
1
|
+
export * from "./CommonProps";
|
|
2
|
+
export * from "./StorybookProps";
|
|
3
|
+
export * from "./useContainerProps";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export interface UseContainerProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
dataTestId?: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Utility for common props on containers.
|
|
7
|
-
*
|
|
8
|
-
* @param {UseContainerProps} ContainerProps - Props for the utility
|
|
9
|
-
* @param {string} ContainerProps.className - Optional custom className
|
|
10
|
-
* @param {string} ContainerProps.dataTestId - Optional custom data-TestId
|
|
11
|
-
* @returns {UseContainerProps} - Object with undefined values removed
|
|
12
|
-
*/
|
|
13
|
-
export declare const useContainerProps: ({ className, dataTestId }: UseContainerProps) => {
|
|
14
|
-
className: string | undefined;
|
|
15
|
-
"data-testid": string | undefined;
|
|
16
|
-
};
|
|
1
|
+
export interface UseContainerProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
dataTestId?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Utility for common props on containers.
|
|
7
|
+
*
|
|
8
|
+
* @param {UseContainerProps} ContainerProps - Props for the utility
|
|
9
|
+
* @param {string} ContainerProps.className - Optional custom className
|
|
10
|
+
* @param {string} ContainerProps.dataTestId - Optional custom data-TestId
|
|
11
|
+
* @returns {UseContainerProps} - Object with undefined values removed
|
|
12
|
+
*/
|
|
13
|
+
export declare const useContainerProps: ({ className, dataTestId }: UseContainerProps) => {
|
|
14
|
+
className: string | undefined;
|
|
15
|
+
"data-testid": string | undefined;
|
|
16
|
+
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { IntentColors } from "@trackunit/ui-design-tokens";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
-
export type AlertActionType = "primary" | "secondary";
|
|
5
|
-
export type AlertAction = {
|
|
6
|
-
label: string;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export interface AlertProps extends CommonProps {
|
|
11
|
-
/**
|
|
12
|
-
* Child nodes.
|
|
13
|
-
*/
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Color of the alert component.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
color?: IntentColors;
|
|
20
|
-
/**
|
|
21
|
-
* Title of the alert component.
|
|
22
|
-
*/
|
|
23
|
-
title?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Action to be performed on clicking the primary button.
|
|
26
|
-
*/
|
|
27
|
-
primaryAction?: AlertAction;
|
|
28
|
-
/**
|
|
29
|
-
* Action to be performed on clicking the secondary button.
|
|
30
|
-
*/
|
|
31
|
-
secondaryAction?: AlertAction;
|
|
32
|
-
/**
|
|
33
|
-
* OnClose Event.
|
|
34
|
-
*/
|
|
35
|
-
onClose?: () => void;
|
|
36
|
-
/**
|
|
37
|
-
* Whether the contents should be displayed inline or not.
|
|
38
|
-
*/
|
|
39
|
-
inline?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* A prop to enable autoscroll to alert element
|
|
42
|
-
*
|
|
43
|
-
* could be used for displaying errors on long scrollable forms
|
|
44
|
-
*/
|
|
45
|
-
autoScroll?: boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The Alert component should be used to inform the user of important information.
|
|
49
|
-
*
|
|
50
|
-
* @param {AlertProps} props - The props for the Alert component
|
|
51
|
-
* @returns {JSX.Element} Alert component
|
|
52
|
-
*/
|
|
53
|
-
export declare const Alert: ({ color, title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, inline, }: AlertProps) => JSX.Element;
|
|
1
|
+
import { IntentColors } from "@trackunit/ui-design-tokens";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
+
export type AlertActionType = "primary" | "secondary";
|
|
5
|
+
export type AlertAction = {
|
|
6
|
+
label: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface AlertProps extends CommonProps {
|
|
11
|
+
/**
|
|
12
|
+
* Child nodes.
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Color of the alert component.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
color?: IntentColors;
|
|
20
|
+
/**
|
|
21
|
+
* Title of the alert component.
|
|
22
|
+
*/
|
|
23
|
+
title?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Action to be performed on clicking the primary button.
|
|
26
|
+
*/
|
|
27
|
+
primaryAction?: AlertAction;
|
|
28
|
+
/**
|
|
29
|
+
* Action to be performed on clicking the secondary button.
|
|
30
|
+
*/
|
|
31
|
+
secondaryAction?: AlertAction;
|
|
32
|
+
/**
|
|
33
|
+
* OnClose Event.
|
|
34
|
+
*/
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the contents should be displayed inline or not.
|
|
38
|
+
*/
|
|
39
|
+
inline?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* A prop to enable autoscroll to alert element
|
|
42
|
+
*
|
|
43
|
+
* could be used for displaying errors on long scrollable forms
|
|
44
|
+
*/
|
|
45
|
+
autoScroll?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The Alert component should be used to inform the user of important information.
|
|
49
|
+
*
|
|
50
|
+
* @param {AlertProps} props - The props for the Alert component
|
|
51
|
+
* @returns {JSX.Element} Alert component
|
|
52
|
+
*/
|
|
53
|
+
export declare const Alert: ({ color, title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, inline, }: AlertProps) => JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const cvaAlert: (props?: ({
|
|
2
|
-
color?: "danger" | "warning" | "success" | "info" | null | undefined;
|
|
3
|
-
layout?: "default" | "inline" | null | undefined;
|
|
4
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
-
export declare const cvaAlertDetails: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
-
export declare const cvaAlertContentBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
|
-
export declare const cvaAlertRightAligned: (props?: ({
|
|
8
|
-
layout?: "default" | "inline" | null | undefined;
|
|
9
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
-
export declare const cvaAlertContent: (props?: ({
|
|
11
|
-
layout?: "default" | "inline" | null | undefined;
|
|
12
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
|
-
export declare const cvaAlertCloseButtonContainer: (props?: ({
|
|
14
|
-
layout?: "default" | "inline" | null | undefined;
|
|
15
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
16
|
-
export declare const cvaAlertIconContainer: (props?: ({
|
|
17
|
-
layout?: "default" | "inline" | null | undefined;
|
|
18
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
1
|
+
export declare const cvaAlert: (props?: ({
|
|
2
|
+
color?: "danger" | "warning" | "success" | "info" | null | undefined;
|
|
3
|
+
layout?: "default" | "inline" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaAlertDetails: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const cvaAlertContentBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
|
+
export declare const cvaAlertRightAligned: (props?: ({
|
|
8
|
+
layout?: "default" | "inline" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const cvaAlertContent: (props?: ({
|
|
11
|
+
layout?: "default" | "inline" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
|
+
export declare const cvaAlertCloseButtonContainer: (props?: ({
|
|
14
|
+
layout?: "default" | "inline" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
16
|
+
export declare const cvaAlertIconContainer: (props?: ({
|
|
17
|
+
layout?: "default" | "inline" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Alert";
|
|
1
|
+
export * from "./Alert";
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ThemeColors } from "@trackunit/ui-design-tokens";
|
|
3
|
-
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
-
type BadgeColors = Extract<ThemeColors, "primary" | "danger">;
|
|
5
|
-
interface BaseBadgeProps extends CommonProps {
|
|
6
|
-
/**
|
|
7
|
-
* The color of the badge.
|
|
8
|
-
*/
|
|
9
|
-
color?: BadgeColors;
|
|
10
|
-
/**
|
|
11
|
-
* Custom classNames can be added to make adjustments where needed.
|
|
12
|
-
* Example: Set a maximum width of the badge by adding the className "max-w-[your-max-width]" or similar tailwind max-w class.
|
|
13
|
-
* This will make the badge truncate the text if it is too long.
|
|
14
|
-
*/
|
|
15
|
-
className?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The count to be displayed on the badge.
|
|
18
|
-
*/
|
|
19
|
-
count?: number;
|
|
20
|
-
/**
|
|
21
|
-
* The max value to be displayed in the badge.
|
|
22
|
-
* Any value above this will be appended with a +.
|
|
23
|
-
*/
|
|
24
|
-
max?: number;
|
|
25
|
-
/**
|
|
26
|
-
* If enabled the badge is shown even if the count is 0.
|
|
27
|
-
*/
|
|
28
|
-
hideZero?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export type BadgeProps = BaseBadgeProps;
|
|
31
|
-
/**
|
|
32
|
-
* The Badge component is used to display a notification badge with an optional number value.
|
|
33
|
-
*
|
|
34
|
-
* @param {BadgeProps} props - The props for the Badge component
|
|
35
|
-
* @returns {JSX.Element} Badge component
|
|
36
|
-
*/
|
|
37
|
-
export declare const Badge: ({ color, className, count, max, hideZero, dataTestId, ...rest }: BadgeProps) => JSX.Element | null;
|
|
38
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ThemeColors } from "@trackunit/ui-design-tokens";
|
|
3
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
+
type BadgeColors = Extract<ThemeColors, "primary" | "danger">;
|
|
5
|
+
interface BaseBadgeProps extends CommonProps {
|
|
6
|
+
/**
|
|
7
|
+
* The color of the badge.
|
|
8
|
+
*/
|
|
9
|
+
color?: BadgeColors;
|
|
10
|
+
/**
|
|
11
|
+
* Custom classNames can be added to make adjustments where needed.
|
|
12
|
+
* Example: Set a maximum width of the badge by adding the className "max-w-[your-max-width]" or similar tailwind max-w class.
|
|
13
|
+
* This will make the badge truncate the text if it is too long.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The count to be displayed on the badge.
|
|
18
|
+
*/
|
|
19
|
+
count?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The max value to be displayed in the badge.
|
|
22
|
+
* Any value above this will be appended with a +.
|
|
23
|
+
*/
|
|
24
|
+
max?: number;
|
|
25
|
+
/**
|
|
26
|
+
* If enabled the badge is shown even if the count is 0.
|
|
27
|
+
*/
|
|
28
|
+
hideZero?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type BadgeProps = BaseBadgeProps;
|
|
31
|
+
/**
|
|
32
|
+
* The Badge component is used to display a notification badge with an optional number value.
|
|
33
|
+
*
|
|
34
|
+
* @param {BadgeProps} props - The props for the Badge component
|
|
35
|
+
* @returns {JSX.Element} Badge component
|
|
36
|
+
*/
|
|
37
|
+
export declare const Badge: ({ color, className, count, max, hideZero, dataTestId, ...rest }: BadgeProps) => JSX.Element | null;
|
|
38
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const cvaBadge: (props?: ({
|
|
2
|
-
color?: "primary" | "danger" | null | undefined;
|
|
3
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
1
|
+
export declare const cvaBadge: (props?: ({
|
|
2
|
+
color?: "primary" | "danger" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Badge";
|
|
1
|
+
export * from "./Badge";
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
export declare const ROLE_CARD = "region";
|
|
4
|
-
export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the card should have full height or not.
|
|
7
|
-
*/
|
|
8
|
-
fullHeight?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* The css grid area to place the card.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated Use tailwind based grid layouts instead.
|
|
13
|
-
*/
|
|
14
|
-
gridArea?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Children to show in the card
|
|
17
|
-
*/
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* A Click handler function
|
|
21
|
-
*/
|
|
22
|
-
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
23
|
-
/**
|
|
24
|
-
* A MouseEnter handler function
|
|
25
|
-
*/
|
|
26
|
-
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
27
|
-
/**
|
|
28
|
-
* A MouseLEave handler function
|
|
29
|
-
*/
|
|
30
|
-
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
34
|
-
* To get the most out of the Card, use it in combination with the CardHeader, CardBody and CardFooter.
|
|
35
|
-
*
|
|
36
|
-
* @param {CardProps} props - The props for the Card component
|
|
37
|
-
* @returns {JSX.Element} Card component
|
|
38
|
-
*/
|
|
39
|
-
export declare const Card: ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, dataTestId, gridArea, ...rest }: CardProps) => JSX.Element;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export declare const ROLE_CARD = "region";
|
|
4
|
+
export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the card should have full height or not.
|
|
7
|
+
*/
|
|
8
|
+
fullHeight?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The css grid area to place the card.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Use tailwind based grid layouts instead.
|
|
13
|
+
*/
|
|
14
|
+
gridArea?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Children to show in the card
|
|
17
|
+
*/
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* A Click handler function
|
|
21
|
+
*/
|
|
22
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
23
|
+
/**
|
|
24
|
+
* A MouseEnter handler function
|
|
25
|
+
*/
|
|
26
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* A MouseLEave handler function
|
|
29
|
+
*/
|
|
30
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
34
|
+
* To get the most out of the Card, use it in combination with the CardHeader, CardBody and CardFooter.
|
|
35
|
+
*
|
|
36
|
+
* @param {CardProps} props - The props for the Card component
|
|
37
|
+
* @returns {JSX.Element} Card component
|
|
38
|
+
*/
|
|
39
|
+
export declare const Card: ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, dataTestId, gridArea, ...rest }: CardProps) => JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const cvaCard: (props?: ({
|
|
2
|
-
clickable?: boolean | null | undefined;
|
|
3
|
-
fullHeight?: boolean | null | undefined;
|
|
4
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
-
export declare const cvaCardBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
-
export declare const cvaCardFooterDensityContainer: (props?: ({
|
|
7
|
-
border?: "default" | "borderless" | null | undefined;
|
|
8
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
|
-
export declare const cvaCardHeader: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
10
|
-
export declare const cvaCardHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
11
|
-
export declare const cvaCardHeaderDensityContainer: (props?: ({
|
|
12
|
-
border?: "default" | "borderless" | null | undefined;
|
|
13
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
1
|
+
export declare const cvaCard: (props?: ({
|
|
2
|
+
clickable?: boolean | null | undefined;
|
|
3
|
+
fullHeight?: boolean | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaCardBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const cvaCardFooterDensityContainer: (props?: ({
|
|
7
|
+
border?: "default" | "borderless" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const cvaCardHeader: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const cvaCardHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const cvaCardHeaderDensityContainer: (props?: ({
|
|
12
|
+
border?: "default" | "borderless" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
-
export interface CardBodyProps extends CommonProps {
|
|
4
|
-
/**
|
|
5
|
-
* Sets gap, padding and margin.
|
|
6
|
-
*/
|
|
7
|
-
density?: Density;
|
|
8
|
-
/**
|
|
9
|
-
* Set gap to be 0px (not preferable)
|
|
10
|
-
*/
|
|
11
|
-
disableGap?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Child elements to render in the body
|
|
14
|
-
*/
|
|
15
|
-
children: React.ReactNode | null;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The CardBody component should be used to inform the user of important information.
|
|
19
|
-
*
|
|
20
|
-
* @summary For applying padding and gap to a Card.
|
|
21
|
-
* @description The padding must live here, and not on the Card itself, as to not inset the scrollbar in case of overflow
|
|
22
|
-
* @param {CardBodyProps} props - The props for the CardBody component
|
|
23
|
-
* @returns {JSX.Element} CardBody component
|
|
24
|
-
*/
|
|
25
|
-
export declare const CardBody: ({ density, children, dataTestId, className, disableGap }: CardBodyProps) => JSX.Element;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
+
export interface CardBodyProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Sets gap, padding and margin.
|
|
6
|
+
*/
|
|
7
|
+
density?: Density;
|
|
8
|
+
/**
|
|
9
|
+
* Set gap to be 0px (not preferable)
|
|
10
|
+
*/
|
|
11
|
+
disableGap?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Child elements to render in the body
|
|
14
|
+
*/
|
|
15
|
+
children: React.ReactNode | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The CardBody component should be used to inform the user of important information.
|
|
19
|
+
*
|
|
20
|
+
* @summary For applying padding and gap to a Card.
|
|
21
|
+
* @description The padding must live here, and not on the Card itself, as to not inset the scrollbar in case of overflow
|
|
22
|
+
* @param {CardBodyProps} props - The props for the CardBody component
|
|
23
|
+
* @returns {JSX.Element} CardBody component
|
|
24
|
+
*/
|
|
25
|
+
export declare const CardBody: ({ density, children, dataTestId, className, disableGap }: CardBodyProps) => JSX.Element;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
-
export interface CardFooterProps extends CommonProps {
|
|
4
|
-
/**
|
|
5
|
-
* Sets gap, padding and margin.
|
|
6
|
-
*/
|
|
7
|
-
density?: Density;
|
|
8
|
-
/**
|
|
9
|
-
* Element to render in the footer
|
|
10
|
-
*/
|
|
11
|
-
children?: React.ReactNode | null;
|
|
12
|
-
/**
|
|
13
|
-
* Wether or not a seperator line should be rendered
|
|
14
|
-
*/
|
|
15
|
-
hideSeparator?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A simple footer intended to use with Cards and Modals.
|
|
19
|
-
* Currently only intended to contain Buttons.
|
|
20
|
-
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
21
|
-
*
|
|
22
|
-
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
23
|
-
* @returns {JSX.Element} CardFooter component
|
|
24
|
-
*/
|
|
25
|
-
export declare const CardFooter: ({ dataTestId, className, children, density, hideSeparator }: CardFooterProps) => JSX.Element;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
+
export interface CardFooterProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Sets gap, padding and margin.
|
|
6
|
+
*/
|
|
7
|
+
density?: Density;
|
|
8
|
+
/**
|
|
9
|
+
* Element to render in the footer
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode | null;
|
|
12
|
+
/**
|
|
13
|
+
* Wether or not a seperator line should be rendered
|
|
14
|
+
*/
|
|
15
|
+
hideSeparator?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A simple footer intended to use with Cards and Modals.
|
|
19
|
+
* Currently only intended to contain Buttons.
|
|
20
|
+
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
21
|
+
*
|
|
22
|
+
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
23
|
+
* @returns {JSX.Element} CardFooter component
|
|
24
|
+
*/
|
|
25
|
+
export declare const CardFooter: ({ dataTestId, className, children, density, hideSeparator }: CardFooterProps) => JSX.Element;
|