@trackunit/react-components 0.1.175 → 0.1.176
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 +165 -152
- package/index.esm.js +165 -153
- package/package.json +1 -1
- package/src/common/PackageNameStoryComponent.d.ts +12 -0
- package/src/components/Alert/Alert.d.ts +1 -1
- package/src/components/Badge/Badge.d.ts +1 -1
- package/src/components/Card/Card.d.ts +1 -1
- package/src/components/Card/CardFooter.d.ts +1 -1
- package/src/components/Card/CardHeader.d.ts +1 -1
- package/src/components/Collapse/Collapse.d.ts +1 -1
- package/src/components/CopyableText/CopyableText.d.ts +1 -1
- package/src/components/DayPicker/DayPicker.d.ts +1 -1
- package/src/components/DayPicker/DayPickerPopover.d.ts +1 -1
- package/src/components/DayPicker/DayRangePicker.d.ts +1 -1
- package/src/components/Drawer/Drawer.d.ts +1 -1
- package/src/components/EmptyState/EmptyState.d.ts +1 -1
- package/src/components/ExternalLink/ExternalLink.d.ts +1 -1
- package/src/components/Heading/Heading.d.ts +1 -1
- package/src/components/Icon/Icon.d.ts +1 -1
- package/src/components/Indicator/Indicator.d.ts +1 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +1 -1
- package/src/components/Menu/MenuList/MenuList.d.ts +1 -1
- package/src/components/Modal/Modal.d.ts +1 -0
- package/src/components/Modal/ModalBackdrop.d.ts +1 -1
- package/src/components/Modal/useModal.d.ts +1 -1
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/Pagination/Pagination.d.ts +1 -1
- package/src/components/Popover/Popover.d.ts +1 -1
- package/src/components/Popover/PopoverTitle.d.ts +1 -1
- package/src/components/Prompt/Prompt.d.ts +1 -1
- package/src/components/SectionHeader/SectionHeader.d.ts +1 -1
- package/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/src/components/SkeletonLines/SkeletonLines.d.ts +1 -0
- package/src/components/Spacer/Spacer.d.ts +1 -1
- package/src/components/Spinner/Spinner.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +1 -1
- package/src/components/Text/Text.d.ts +1 -1
- package/src/components/Timeline/Timeline.d.ts +1 -1
- package/src/components/Tip/Tip.d.ts +1 -1
- package/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/src/components/ValueBar/ValueBar.d.ts +1 -1
- package/src/components/ValueBar/ValueBarHelper.d.ts +4 -4
- package/src/components/buttons/BackToTopButton/BackToTopButton.d.ts +1 -1
- package/src/components/buttons/Button/Button.d.ts +1 -1
- package/src/components/buttons/IconButton/IconButton.d.ts +3 -0
- package/src/components/buttons/StarButton/StarButton.d.ts +1 -1
- package/src/index.d.ts +1 -0
|
@@ -26,7 +26,7 @@ export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDi
|
|
|
26
26
|
/**
|
|
27
27
|
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
28
28
|
* To get the most out of the Card, use it in combination with the CardHeader, CardBody and CardFooter.
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
* @param {CardProps} props - The props for the Card component
|
|
31
31
|
* @returns {JSX.Element} Card component
|
|
32
32
|
*/
|
|
@@ -18,7 +18,7 @@ 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
23
|
* @returns {JSX.Element} CardFooter component
|
|
24
24
|
*/
|
|
@@ -25,7 +25,7 @@ export interface CollapseProps extends CommonProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* The Collapse component is used to condense non-important information.
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
30
30
|
* @returns {JSX.Element} Collapse component
|
|
31
31
|
*/
|
|
@@ -14,7 +14,7 @@ export interface CopyableTextProps extends CommonProps {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
* @param {CopyableTextProps} props - The props for the CopyableText component
|
|
19
19
|
* @returns {JSX.Element} CopyableText component
|
|
20
20
|
*/
|
|
@@ -25,7 +25,7 @@ export interface DayPickerProps extends CommonProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* The DayPicker component is used when the user needs to select a date.
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
* @param {DayPickerProps} props - The props for the DayPicker component
|
|
30
30
|
* @returns {JSX.Element} DayPicker component
|
|
31
31
|
*/
|
|
@@ -15,7 +15,7 @@ export interface DayPickerPopoverProps extends CommonProps {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* The DayPickerPopover component returns a button which when clicked shows the daypicker.
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
* @param {DayPickerPopoverProps} props - The props for the DayPickerPopover component
|
|
20
20
|
* @returns {JSX.Element} DayPickerPopover component
|
|
21
21
|
*/
|
|
@@ -26,7 +26,7 @@ export interface DayRangePickerProps extends CommonProps {
|
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* The DayRangePicker component should be used when the user needs to select a range of dates.
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
* @param {DayRangePickerProps} props - The props for the DayRangePicker component
|
|
31
31
|
* @returns {JSX.Element} DayRangePicker component
|
|
32
32
|
*/
|
|
@@ -25,7 +25,7 @@ export interface DrawerProps extends CommonProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* The drawer provides a slideover which can be used to provide access to different locations in the application.
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
* @param {DrawerProps} props - The props for the Drawer component
|
|
30
30
|
* @returns {JSX.Element} Drawer component
|
|
31
31
|
*/
|
|
@@ -14,7 +14,7 @@ export interface EmptyStateProps extends CommonProps {
|
|
|
14
14
|
* Component representing an empty state.
|
|
15
15
|
* Use this component when there is no data to display or when an error occurs.
|
|
16
16
|
*
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
* @param {EmptyStateProps} props props
|
|
19
19
|
* @returns {JSX.Element} component
|
|
20
20
|
* @example
|
|
@@ -25,7 +25,7 @@ export interface ExternalLinkProps extends CommonProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* The external link component is used to link to an external page outside the Trackunit Manager.
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
30
30
|
* @returns {JSX.Element} External Link component
|
|
31
31
|
*/
|
|
@@ -21,7 +21,7 @@ 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
26
|
* @returns {JSX.Element} Heading component
|
|
27
27
|
*/
|
|
@@ -298,7 +298,7 @@ export interface IconProps extends CommonProps {
|
|
|
298
298
|
* - The Icon component is used to display an Icon.
|
|
299
299
|
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
300
300
|
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
301
|
-
|
|
301
|
+
|
|
302
302
|
* @param {IconProps} props - The props for the Icon component
|
|
303
303
|
* @returns {JSX.Element} Icon component
|
|
304
304
|
*/
|
|
@@ -35,7 +35,7 @@ export interface IndicatorProps extends CommonProps {
|
|
|
35
35
|
* _**Do use** indicators to communicate essential aspects of the state of an asset._
|
|
36
36
|
*
|
|
37
37
|
* _**Do not use** indicators for non-essential information, or to communicate information unrelated to the state of an asset._
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
* @param {IndicatorProps} props - The props for the Indicator component
|
|
40
40
|
* @returns {JSX.Element} Indicator component
|
|
41
41
|
*/
|
|
@@ -56,7 +56,7 @@ export interface MenuItemProps extends CommonProps {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
61
61
|
* @returns {JSX.Element} MenuItem component
|
|
62
62
|
*/
|
|
@@ -26,5 +26,6 @@ export interface ModalProps extends CommonProps {
|
|
|
26
26
|
* - Modals are used to present critical information or request user input needed to complete a user's workflow.
|
|
27
27
|
* - Modals interrupt a user's workflow by design.
|
|
28
28
|
* - The modal component provides a foundation for creating dialogs, lightboxes, etc.
|
|
29
|
+
|
|
29
30
|
*/
|
|
30
31
|
export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -45,7 +45,7 @@ export interface PageHeaderProps extends CommonProps {
|
|
|
45
45
|
* Pageheader component is used to display a page header.
|
|
46
46
|
*
|
|
47
47
|
* PageHeader can be used to highlight the page topic, display important information about the page, and carry the action items related to the current page.
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
50
50
|
* @returns {JSX.Element} PageHeader component
|
|
51
51
|
*/
|
|
@@ -55,7 +55,7 @@ export interface IPaginationProps {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
* @param {IPaginationProps} props - The props for the Pagination component
|
|
60
60
|
* @returns {JSX.Element} Pagination component
|
|
61
61
|
*/
|
|
@@ -68,7 +68,7 @@ export declare const usePopoverContext: () => {
|
|
|
68
68
|
*
|
|
69
69
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
70
70
|
*
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
* @param {PopoverProps} props The props for the popover
|
|
73
73
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
74
74
|
*/
|
|
@@ -16,7 +16,7 @@ export interface SectionHeaderProps extends CommonProps {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
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
21
|
* @returns {JSX.Element} SectionHeader component
|
|
22
22
|
*/
|
|
@@ -50,7 +50,7 @@ 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
55
|
* @returns {JSX.Element} Sidebar component
|
|
56
56
|
*/
|
|
@@ -20,6 +20,7 @@ export interface SkeletonLinesProps extends CommonProps {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Display placeholder lines before the data gets loaded to reduce load-time frustration.
|
|
23
|
+
|
|
23
24
|
*/
|
|
24
25
|
export declare const SkeletonLines: import("react").MemoExoticComponent<({ margin, lines, height, width, className, dataTestId }: SkeletonLinesProps) => JSX.Element>;
|
|
25
26
|
export default SkeletonLines;
|
|
@@ -13,7 +13,7 @@ export interface SpacerProps extends CommonProps {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* The Spacer component is used for adding a bit of space in the ui.
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
18
18
|
* @returns {JSX.Element} Spacer component
|
|
19
19
|
*/
|
|
@@ -31,7 +31,7 @@ export interface SpinnerProps extends CommonProps {
|
|
|
31
31
|
* Use a spinner component for any action that cannot be performed instantly and will only require a short time (between 1 to 5 seconds) to process.
|
|
32
32
|
*
|
|
33
33
|
* Use when retrieving or refreshing small data amounts, such as status.
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
36
36
|
* @returns {JSX.Element} Spinner component
|
|
37
37
|
*/
|
|
@@ -37,7 +37,7 @@ export interface TagProps extends CommonProps {
|
|
|
37
37
|
* The tag is also used in multiselect components to show selected options.
|
|
38
38
|
*
|
|
39
39
|
* **Do:** Use short labels for easy scanning.
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
* @param {TagProps} props - The props for the tag component
|
|
42
42
|
* @returns {JSX.Element} tag component
|
|
43
43
|
*/
|
|
@@ -55,7 +55,7 @@ export interface TextProps extends CommonProps {
|
|
|
55
55
|
* ### When to use
|
|
56
56
|
*
|
|
57
57
|
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
* @param {TextProps} props - The props for the Text component
|
|
60
60
|
* @returns {JSX.Element} Text component
|
|
61
61
|
*/
|
|
@@ -8,7 +8,7 @@ export interface TimelineProps extends CommonProps {
|
|
|
8
8
|
* - with an indicator (dot)
|
|
9
9
|
* - a header (next to the dot)
|
|
10
10
|
* - and a body.
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
* @param {TimelineProps} props - The props for the Timeline component
|
|
13
13
|
* @returns {JSX.Element} Timeline component
|
|
14
14
|
*/
|
|
@@ -19,7 +19,7 @@ export interface TipProps extends CommonProps, Pick<TooltipProps, "placement" |
|
|
|
19
19
|
/**
|
|
20
20
|
* The Tip component is used to show helpful tips or contextual information to the users.
|
|
21
21
|
* The tip can optionally be rendered as an anchor tag, which redirects to users to an external link on click.
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
* @param {TipProps} props - The props for the Tip component
|
|
24
24
|
* @returns {JSX.Element} Tip component
|
|
25
25
|
*/
|
|
@@ -30,7 +30,7 @@ export interface TooltipProps extends CommonProps {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* The Tooltip component is used to show helpful tips or contextual information to the users.
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
35
35
|
* @returns {JSX.Element} Tooltip component
|
|
36
36
|
*/
|
|
@@ -39,7 +39,7 @@ export interface ValueBarProps extends CommonProps {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* ValueBar component is used to display value on a colorful bar within provided range.
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
44
44
|
* @returns {JSX.Element} ValueBar component
|
|
45
45
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LevelColors } from "./ValueBarTypes";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get normalized score in range 0-1 used by the ValueBar
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
* @param {number} value - value for which score should be returned
|
|
6
6
|
* @param {number} min - min range value
|
|
7
7
|
* @param {number} max - max range value
|
|
@@ -10,14 +10,14 @@ import { LevelColors } from "./ValueBarTypes";
|
|
|
10
10
|
export declare const getScore: (value: number, min: number, max: number) => number;
|
|
11
11
|
/**
|
|
12
12
|
* Helper function to get default color used by the ValueBar
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
* @param {number} score - score number for which color should be returned
|
|
15
15
|
* @returns {string} color value
|
|
16
16
|
*/
|
|
17
17
|
export declare const getDefaultFillColor: (score: number) => string;
|
|
18
18
|
/**
|
|
19
19
|
* Helper function to get custom color used by the ValueBar
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
* @param {number} score - score number for which color should be returned
|
|
22
22
|
* @param {LevelColors} levelColors - custom colors and levels definitions
|
|
23
23
|
* @returns {string} color value
|
|
@@ -25,7 +25,7 @@ export declare const getDefaultFillColor: (score: number) => string;
|
|
|
25
25
|
export declare const getFillColor: (score: number, levelColors: LevelColors) => string;
|
|
26
26
|
/**
|
|
27
27
|
* Helper function to get color used by the ValueBar
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
* @param {number} value - value for which color should be returned
|
|
30
30
|
* @param {number} min - min range value
|
|
31
31
|
* @param {number} max - max range value
|
|
@@ -9,6 +9,6 @@ export interface BackToTopProps extends CommonProps {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* BackToTopButton appears at the bottom-right corner of the screen when the user scrolls down the page. When clicked, the page scrolls smoothly to the top.
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
*/
|
|
14
14
|
export declare const BackToTopButton: ({ color, size, dataTestId, className }: BackToTopProps) => JSX.Element;
|
|
@@ -17,4 +17,7 @@ export interface IconButtonProps extends ButtonCommonProps {
|
|
|
17
17
|
*/
|
|
18
18
|
size?: Size;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The IconButton is used for a button with an icon.
|
|
22
|
+
*/
|
|
20
23
|
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|