@trackunit/react-components 0.0.1-alpha-59a0a75488.0
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/README.md +22 -0
- package/common/CommonProps.d.ts +12 -0
- package/common/LegacyComponentStory.d.ts +7 -0
- package/common/StorybookProps.d.ts +6 -0
- package/common/index.d.ts +3 -0
- package/common/useContainerProps.d.ts +16 -0
- package/components/ActionButton/ActionButton.d.ts +30 -0
- package/components/ActionButton/index.d.ts +1 -0
- package/components/Alert/Alert.d.ts +53 -0
- package/components/Alert/index.d.ts +1 -0
- package/components/Badge/Badge.d.ts +47 -0
- package/components/Badge/index.d.ts +1 -0
- package/components/BaseInput/BaseInput.d.ts +62 -0
- package/components/BaseInput/index.d.ts +1 -0
- package/components/Card/Card.d.ts +45 -0
- package/components/Card/CardBody.d.ts +32 -0
- package/components/Card/CardFooter.d.ts +21 -0
- package/components/Card/CardHeader.d.ts +43 -0
- package/components/Card/DensityContainer.d.ts +30 -0
- package/components/Card/index.d.ts +5 -0
- package/components/Chart/Chart.d.ts +81 -0
- package/components/Chart/index.d.ts +1 -0
- package/components/Checkbox/CheckIcon.d.ts +12 -0
- package/components/Checkbox/Checkbox.d.ts +40 -0
- package/components/Checkbox/IndeterminateIcon.d.ts +10 -0
- package/components/Checkbox/index.d.ts +1 -0
- package/components/Collapse/Collapse.d.ts +28 -0
- package/components/Collapse/index.d.ts +1 -0
- package/components/CopyableText/CopyableText.d.ts +21 -0
- package/components/CopyableText/index.d.ts +1 -0
- package/components/DateField/DateField.d.ts +19 -0
- package/components/DateInput/DateInput.d.ts +28 -0
- package/components/DayPicker/DayPicker.d.ts +28 -0
- package/components/DayPicker/DayPickerPopover.d.ts +23 -0
- package/components/DayPicker/DayRangePicker.d.ts +18 -0
- package/components/DayPicker/index.d.ts +21 -0
- package/components/DayPicker/useLocale.d.ts +8 -0
- package/components/EmailInput/EmailInput.d.ts +20 -0
- package/components/FormGroup/FormGroup.d.ts +38 -0
- package/components/Heading/Heading.d.ts +28 -0
- package/components/Heading/index.d.ts +1 -0
- package/components/Icon/Icon.d.ts +51 -0
- package/components/Indicator/Indicator.d.ts +42 -0
- package/components/Indicator/index.d.ts +1 -0
- package/components/Label/Label.d.ts +34 -0
- package/components/Label/index.d.ts +1 -0
- package/components/LegendItem/LegendItem.d.ts +17 -0
- package/components/LegendItem/index.d.ts +1 -0
- package/components/Menu/MenuItem.d.ts +58 -0
- package/components/Menu/MenuList.d.ts +34 -0
- package/components/Menu/index.d.ts +2 -0
- package/components/Modal/Modal.d.ts +32 -0
- package/components/Modal/ModalBackdrop.d.ts +13 -0
- package/components/Modal/index.d.ts +3 -0
- package/components/Modal/useModal.d.ts +21 -0
- package/components/NumberField/NumberField.d.ts +19 -0
- package/components/NumberInput/NumberInput.d.ts +12 -0
- package/components/PageHeader/PageHeader.d.ts +47 -0
- package/components/PageHeader/index.d.ts +1 -0
- package/components/Pagination/Pagination.d.ts +71 -0
- package/components/PhoneInput/PhoneInput.d.ts +20 -0
- package/components/Popover/AnimatedPopover.d.ts +43 -0
- package/components/Popover/PopoverList.d.ts +12 -0
- package/components/Popover/PopoverListItem.d.ts +30 -0
- package/components/Popover/PopoverTitle.d.ts +20 -0
- package/components/Popover/index.d.ts +5 -0
- package/components/Popover/usePopover.d.ts +42 -0
- package/components/Prompt/Prompt.d.ts +20 -0
- package/components/Prompt/index.d.ts +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +57 -0
- package/components/RadioGroup/RadioGroupContext.d.ts +11 -0
- package/components/RadioGroup/RadioItem.d.ts +24 -0
- package/components/RadioGroup/index.d.ts +2 -0
- package/components/SectionHeader/SectionHeader.d.ts +24 -0
- package/components/SectionHeader/index.d.ts +1 -0
- package/components/Select/CreatableSelect.d.ts +38 -0
- package/components/Select/FieldContainer.d.ts +20 -0
- package/components/Select/Select.d.ts +18 -0
- package/components/Select/SelectMenuItem/SelectMenuItem.d.ts +49 -0
- package/components/Select/TagWithWidth.d.ts +17 -0
- package/components/Select/TagsContainer.d.ts +45 -0
- package/components/Select/index.d.ts +7 -0
- package/components/Select/shared.d.ts +15 -0
- package/components/Select/useCustomComponents.d.ts +19 -0
- package/components/Select/useCustomStyles.d.ts +14 -0
- package/components/Select/useSelect.d.ts +143 -0
- package/components/SkeletonLines/SkeletonLines.d.ts +25 -0
- package/components/SkeletonLines/index.d.ts +1 -0
- package/components/Spacer/Spacer.d.ts +20 -0
- package/components/Spacer/index.d.ts +1 -0
- package/components/Spinner/Spinner.d.ts +37 -0
- package/components/Spinner/index.d.ts +1 -0
- package/components/Tag/Tag.d.ts +39 -0
- package/components/Tag/index.d.ts +1 -0
- package/components/Text/Text.d.ts +58 -0
- package/components/Text/index.d.ts +1 -0
- package/components/TextArea/TextArea.d.ts +30 -0
- package/components/TextArea/index.d.ts +1 -0
- package/components/TextAreaField/TextAreaField.d.ts +19 -0
- package/components/TextAreaField/index.d.ts +1 -0
- package/components/TextField/TextField.d.ts +24 -0
- package/components/TextField/TextLenghtIndicator.d.ts +19 -0
- package/components/TextField/index.d.ts +1 -0
- package/components/TextInput/TextInput.d.ts +12 -0
- package/components/Timeline/Timeline.d.ts +30 -0
- package/components/Tip/Tip.d.ts +34 -0
- package/components/Tip/index.d.ts +1 -0
- package/components/Toggle/Toggle.d.ts +57 -0
- package/components/Toggle/index.d.ts +1 -0
- package/components/Tooltip/Tooltip.d.ts +48 -0
- package/components/Tooltip/index.d.ts +1 -0
- package/components/ValueBar/ValueBar.d.ts +44 -0
- package/components/ValueBar/ValueBarHelper.d.ts +35 -0
- package/components/ValueBar/ValueBarTypes.d.ts +9 -0
- package/components/ValueBar/index.d.ts +3 -0
- package/components/buttons/Button/Button.d.ts +48 -0
- package/components/buttons/IconButton/IconButton.d.ts +25 -0
- package/components/buttons/StarButton/StarButton.d.ts +13 -0
- package/components/buttons/index.d.ts +4 -0
- package/components/buttons/shared/ButtonProps.d.ts +40 -0
- package/components/buttons/shared/helpers.d.ts +20 -0
- package/components/index.d.ts +44 -0
- package/components/theme/DefaultTheme.d.ts +2 -0
- package/components/theme/index.d.ts +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/useDebounce.d.ts +8 -0
- package/hooks/useLocalStorage.d.ts +9 -0
- package/hooks/useTimeout.d.ts +15 -0
- package/index.css +488 -0
- package/index.d.ts +4 -0
- package/index.js +5553 -0
- package/layout/helper/MinTopFullContentLayout.d.ts +18 -0
- package/layout/index.d.ts +7 -0
- package/layout/responsive/FilterListMapLayout.d.ts +22 -0
- package/layout/responsive/FullWidthRepeatingLayout.d.ts +19 -0
- package/layout/responsive/GridArea.d.ts +13 -0
- package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +30 -0
- package/layout/responsive/TitleNavContentLayout.d.ts +12 -0
- package/layout/responsive/TwoColumnLayout.d.ts +12 -0
- package/package.json +31 -0
- package/test-config/jest.setup.d.ts +1 -0
- package/test-utils/hooks.d.ts +4 -0
- package/test-utils/test-utils.d.ts +5 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export interface PageHeaderProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Text to be displayed in the header.
|
|
6
|
+
*/
|
|
7
|
+
title: string | React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The description to be displayed inside the tip.
|
|
10
|
+
*/
|
|
11
|
+
description?: string | React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The link to which user is redirected to if user clicks on the tip.
|
|
14
|
+
*/
|
|
15
|
+
link?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Additional actions to be rendered along with the header.
|
|
18
|
+
*/
|
|
19
|
+
action?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* A tag that is displayed on the side of the header.
|
|
22
|
+
* A RectNode passed into the tag will be rendered as such.
|
|
23
|
+
* A string passed into the tag will render it using the tag component.
|
|
24
|
+
*/
|
|
25
|
+
tag?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether spinner should be shown while loading the data.
|
|
28
|
+
*/
|
|
29
|
+
showLoading?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Child nodes to be displayed inside the page header.
|
|
32
|
+
*/
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* The link to the previous page which will be rendered inside an IconButton component to the left of the heading.
|
|
36
|
+
*/
|
|
37
|
+
backTo?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Pageheader component is used to display a page header.
|
|
41
|
+
*
|
|
42
|
+
* 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.
|
|
43
|
+
*
|
|
44
|
+
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
45
|
+
* @returns {JSX.Element} PageHeader component
|
|
46
|
+
*/
|
|
47
|
+
export declare const PageHeader: ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, children, }: PageHeaderProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PageHeader";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IPaginationProps {
|
|
3
|
+
/**
|
|
4
|
+
* A go to page handler
|
|
5
|
+
*/
|
|
6
|
+
gotoPage: (index: number) => void;
|
|
7
|
+
/**
|
|
8
|
+
* A go to previous page handler
|
|
9
|
+
*/
|
|
10
|
+
previousPage: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* A a go to next page handler
|
|
13
|
+
*/
|
|
14
|
+
nextPage: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* A current page index
|
|
17
|
+
*/
|
|
18
|
+
pageIndex?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Amount of pages
|
|
21
|
+
*/
|
|
22
|
+
pageCount?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* A flag to enable previous page button
|
|
25
|
+
*/
|
|
26
|
+
canPreviousPage?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A flag to enable next page button
|
|
29
|
+
*/
|
|
30
|
+
canNextPage?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A parent name
|
|
33
|
+
*/
|
|
34
|
+
parentName: string;
|
|
35
|
+
/**
|
|
36
|
+
* A event name used for logging
|
|
37
|
+
*/
|
|
38
|
+
eventName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A flag indicating loading state
|
|
41
|
+
*/
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A custom class to override styles
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/**
|
|
48
|
+
* A data test id
|
|
49
|
+
*/
|
|
50
|
+
dataTestId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* You can attach logging handler for page change
|
|
53
|
+
*/
|
|
54
|
+
logPageChange?: (eventName: string, event: EventProperties) => void;
|
|
55
|
+
/**
|
|
56
|
+
* An helper to get translation for count.
|
|
57
|
+
*/
|
|
58
|
+
getTranslatedCount: (count: number) => string;
|
|
59
|
+
/**
|
|
60
|
+
* An helper to get translation for page.
|
|
61
|
+
*/
|
|
62
|
+
getTranslatedPage: () => string;
|
|
63
|
+
}
|
|
64
|
+
export declare type EventProperties = Record<string, string | number | boolean | null | undefined | (string | number)[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
67
|
+
*
|
|
68
|
+
* @param {IPaginationProps} props - The props for the Pagination component
|
|
69
|
+
* @returns {JSX.Element} Pagination component
|
|
70
|
+
*/
|
|
71
|
+
export declare const Pagination: ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, canPreviousPage, canNextPage, loading, eventName, parentName, className, dataTestId, logPageChange, getTranslatedCount, getTranslatedPage, }: IPaginationProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common";
|
|
3
|
+
import { BaseInputProps } from "../BaseInput";
|
|
4
|
+
export interface PhoneInputProps extends BaseInputProps, CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* A flag to disable the phone button.
|
|
7
|
+
*/
|
|
8
|
+
disableAction?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A Phone Input component is used for input of the type tel.
|
|
12
|
+
*
|
|
13
|
+
* It has an ActionButton which sends an phone call to the specified number using "tel:" link.
|
|
14
|
+
*
|
|
15
|
+
* Extends props of BaseInput.
|
|
16
|
+
*
|
|
17
|
+
* A reference to the input element is provided as the `ref` prop.
|
|
18
|
+
* For specific input types make sure to use the corresponding input component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import { PopoverLifecycle } from "./usePopover";
|
|
4
|
+
export interface AnimatedPopoverProps extends CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* Controls the lifecycle of the popover.
|
|
7
|
+
*/
|
|
8
|
+
lifecycle: PopoverLifecycle;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the popover to closing state.
|
|
11
|
+
*/
|
|
12
|
+
onRequestClose: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the popover to closed state.
|
|
15
|
+
*/
|
|
16
|
+
onClosed: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Child nodes
|
|
19
|
+
*/
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The delay(in seconds) for triggering the popover state when entering it.
|
|
23
|
+
*/
|
|
24
|
+
enterDelay?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The delay(in seconds) for triggering the popover state when exiting it.
|
|
27
|
+
*/
|
|
28
|
+
exitDelay?: number;
|
|
29
|
+
/** An element to use as the portal root for the popover component */
|
|
30
|
+
bindTo?: HTMLElement;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the popover should have a backdrop or not.
|
|
33
|
+
*/
|
|
34
|
+
enableBackdrop?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The Popover component is used to display some content on top of another.
|
|
38
|
+
* Use a popover to expose a small amount of information or functionality.
|
|
39
|
+
*
|
|
40
|
+
* @param {AnimatedPopoverProps} props - The props for the Card component
|
|
41
|
+
* @returns {JSX.Element} Popover component
|
|
42
|
+
*/
|
|
43
|
+
export declare const AnimatedPopover: React.ForwardRefExoticComponent<AnimatedPopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export interface PopoverListProps extends CommonProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The PopoverList component.
|
|
8
|
+
*
|
|
9
|
+
* @param {PopoverListProps} props - The props for the PopoverList component
|
|
10
|
+
* @returns {JSX.Element} PopoverList component
|
|
11
|
+
*/
|
|
12
|
+
export declare const PopoverList: ({ className, children, dataTestId }: PopoverListProps) => JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export interface PopoverListItemProps extends CommonProps {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
/** Optional event handler for logging etc. Important: Please use the Url prop for navigation. */
|
|
8
|
+
onClick?: (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
9
|
+
/** Navigation Url for this item */
|
|
10
|
+
url?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The prefix to be displayed for the list item.
|
|
13
|
+
*/
|
|
14
|
+
prefix?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The suffix to be displayed for the list item.
|
|
17
|
+
*/
|
|
18
|
+
suffix?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The child nodes.
|
|
21
|
+
*/
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The PopoverListItem component.
|
|
26
|
+
*
|
|
27
|
+
* @param {PopoverListItemProps} props - The props for the PopoverListItem component
|
|
28
|
+
* @returns {JSX.Element} PopoverListItem component
|
|
29
|
+
*/
|
|
30
|
+
export declare const PopoverListItem: ({ selected, children, disabled, ariaLabel, url, onClick, prefix, suffix, dataTestId, }: PopoverListItemProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export interface PopoverTitleProps extends CommonProps {
|
|
4
|
+
action?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Whether there should be a divider between the title and the content.
|
|
7
|
+
*/
|
|
8
|
+
divider?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The child nodes.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The PopoverTitle component.
|
|
16
|
+
*
|
|
17
|
+
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
18
|
+
* @returns {JSX.Element} PopoverTitle component
|
|
19
|
+
*/
|
|
20
|
+
export declare const PopoverTitle: ({ children, action, divider, className, dataTestId }: PopoverTitleProps) => JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Placement } from "@popperjs/core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare type PopoverPlacement = Placement;
|
|
4
|
+
export interface UsePopoverProps<T, Y> {
|
|
5
|
+
/**
|
|
6
|
+
* Reference to the target component.
|
|
7
|
+
*/
|
|
8
|
+
targetRef: React.RefObject<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Reference to the popover component.
|
|
11
|
+
*/
|
|
12
|
+
popoverRef: React.RefObject<Y>;
|
|
13
|
+
/**
|
|
14
|
+
* Placement of the popover.
|
|
15
|
+
*/
|
|
16
|
+
placement?: PopoverPlacement;
|
|
17
|
+
/**
|
|
18
|
+
* The positional offset of the popover from the target component.
|
|
19
|
+
*/
|
|
20
|
+
offset?: [number, number];
|
|
21
|
+
}
|
|
22
|
+
export declare enum PopoverLifecycle {
|
|
23
|
+
closed = "closed",
|
|
24
|
+
open = "open",
|
|
25
|
+
closing = "closing"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The usePopover Hook.
|
|
29
|
+
*
|
|
30
|
+
* @param {UsePopoverProps} props - The props for the usePopover hook
|
|
31
|
+
* @returns {UsePopoverProps} - UsePopoverProps
|
|
32
|
+
*/
|
|
33
|
+
export declare const usePopover: <T extends HTMLElement, Y extends HTMLElement>({ targetRef, popoverRef, placement, offset, }: UsePopoverProps<T, Y>) => {
|
|
34
|
+
targetRef: React.RefObject<T>;
|
|
35
|
+
popoverRef: React.RefObject<Y>;
|
|
36
|
+
onShow: () => void;
|
|
37
|
+
onHide: () => void;
|
|
38
|
+
popoverProps: {
|
|
39
|
+
lifecycle: PopoverLifecycle;
|
|
40
|
+
onClosed: () => void;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface PromptProps {
|
|
2
|
+
when: boolean;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The usePrompt hook.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} message -
|
|
9
|
+
* @param {boolean} when -
|
|
10
|
+
* @returns {void} void
|
|
11
|
+
*/
|
|
12
|
+
export declare const usePrompt: (message: string, when?: boolean) => void;
|
|
13
|
+
/**
|
|
14
|
+
* The Prompt function.
|
|
15
|
+
*
|
|
16
|
+
* @param {PromptProps} Props -
|
|
17
|
+
* @returns {void} void
|
|
18
|
+
*/
|
|
19
|
+
export declare const Prompt: ({ when, message }: PromptProps) => null;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Prompt";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import "./RadioGroup.css";
|
|
4
|
+
export interface RadioGroupProps extends CommonProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
/**
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The id of the radio group.
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* onChange handler for the radio group.
|
|
14
|
+
*/
|
|
15
|
+
onChange: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
16
|
+
/**
|
|
17
|
+
* The value of the radio group.
|
|
18
|
+
*/
|
|
19
|
+
value: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the radio group.
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The label of the radio group.
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the radiogroup is inline or not.
|
|
30
|
+
*/
|
|
31
|
+
inline?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the radio group is disabled or not.
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A boolean flag to set invalid mode
|
|
38
|
+
* can be used for indicating errors
|
|
39
|
+
*/
|
|
40
|
+
isInvalid?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Use radio buttons when you have a group of mutually exclusive choices and only one selection from the group is allowed.
|
|
44
|
+
*
|
|
45
|
+
* Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
|
|
46
|
+
*
|
|
47
|
+
* _**Do use** Radio buttons in forms, settings, or selections in a list._
|
|
48
|
+
*
|
|
49
|
+
* _**Do not use** Radio buttons if a user can select many option from a list, use checkboxes instead of radio buttons._
|
|
50
|
+
*
|
|
51
|
+
* @param {RadioGroupProps} props - The props for the RadioGroup component
|
|
52
|
+
* @returns {JSX.Element} RadioGroup component
|
|
53
|
+
*/
|
|
54
|
+
export declare const RadioGroup: {
|
|
55
|
+
({ children, id, name, value, disabled, onChange, label, inline, className, dataTestId, isInvalid, }: RadioGroupProps): JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface RadioGroupContextProps {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
isInvalid?: boolean;
|
|
8
|
+
onChange: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const RadioGroupContext: React.Context<RadioGroupContextProps | null>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
interface RadioItemProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* The label of the radio item.
|
|
6
|
+
*/
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The value of the radio item.
|
|
10
|
+
*/
|
|
11
|
+
value: string | number;
|
|
12
|
+
/**
|
|
13
|
+
* The description of the radio item.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The RadioItem component.
|
|
19
|
+
*
|
|
20
|
+
* @param {RadioItemProps} props - The props for the RadioItem component
|
|
21
|
+
* @returns {JSX.Element} RadioItem component
|
|
22
|
+
*/
|
|
23
|
+
export declare const RadioItem: ({ label, value, dataTestId, className, description }: RadioItemProps) => JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import "./SectionHeader.css";
|
|
4
|
+
export interface SectionHeaderProps extends CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The title of the section.
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Subtitle of the section.
|
|
11
|
+
*/
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The addon could be used to tell the state of a section header.
|
|
15
|
+
*/
|
|
16
|
+
addon?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The SectionHeader component is used on sections to set the section title.
|
|
20
|
+
*
|
|
21
|
+
* @param {SectionHeaderProps} props - The props for the section header component
|
|
22
|
+
* @returns {JSX.Element} SectionHeader component
|
|
23
|
+
*/
|
|
24
|
+
export declare const SectionHeader: ({ title, subtitle, dataTestId, addon }: SectionHeaderProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SectionHeader";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GroupBase } from "react-select";
|
|
3
|
+
import { SelectProps } from "./useSelect";
|
|
4
|
+
interface CreateableSelectProps<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends SelectProps<Option, IsAsync, IsMulti, Group> {
|
|
5
|
+
/**
|
|
6
|
+
* To hide the label.
|
|
7
|
+
*/
|
|
8
|
+
hideLabel?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Description for the select component.
|
|
11
|
+
*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the component is invalid.
|
|
15
|
+
*/
|
|
16
|
+
isInvalid?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Info of the select component.
|
|
19
|
+
*/
|
|
20
|
+
info?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Error of the select component.
|
|
23
|
+
*/
|
|
24
|
+
error?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Size of the component.
|
|
27
|
+
*/
|
|
28
|
+
size?: SelectSize;
|
|
29
|
+
}
|
|
30
|
+
export declare type SelectSize = "small" | "default";
|
|
31
|
+
/**
|
|
32
|
+
* The CreatableSelect component.
|
|
33
|
+
*
|
|
34
|
+
* @param {CreateableSelectProps} props - The props for the CreatableSelect component
|
|
35
|
+
* @returns {JSX.Element} CreatableSelect component
|
|
36
|
+
*/
|
|
37
|
+
export declare const CreatableSelect: <Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: CreateableSelectProps<Option, IsAsync, IsMulti, Group>) => JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectContainerProps {
|
|
3
|
+
children: React.ReactElement;
|
|
4
|
+
label?: string;
|
|
5
|
+
hideLabel?: boolean;
|
|
6
|
+
hasError?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
error?: React.ReactNode;
|
|
10
|
+
info?: React.ReactNode;
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The SelectContainer component.
|
|
16
|
+
*
|
|
17
|
+
* @param {SelectContainerProps} props - The props for the SelectContainer component
|
|
18
|
+
* @returns {JSX.Element} SelectContainer component
|
|
19
|
+
*/
|
|
20
|
+
export declare const SelectContainer: ({ children, label, hideLabel, id, hasError, error, description, info, dataTestId, isDisabled, }: SelectContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GroupBase } from "react-select";
|
|
3
|
+
import { SelectProps } from "./useSelect";
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Selects are input components used to choose a value from a set.
|
|
11
|
+
*
|
|
12
|
+
* @param {SelectProps} props - The props for the Select component
|
|
13
|
+
* @returns {JSX.Element} Select component
|
|
14
|
+
*/
|
|
15
|
+
export declare const Select: {
|
|
16
|
+
<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: SelectProps<Option, IsAsync, IsMulti, Group>): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../../common";
|
|
3
|
+
interface SelectMenuItemProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* An string to render as a item label.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* An handler for click on element
|
|
11
|
+
*/
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
13
|
+
/**
|
|
14
|
+
* A boolean prop to set menu item to selected state
|
|
15
|
+
*/
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* A boolean prop to set menu item to focused state
|
|
19
|
+
* used for keyboard navigation
|
|
20
|
+
*/
|
|
21
|
+
focused?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A boolean prop to set menu item to disabled state
|
|
24
|
+
* used in disabled select options
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SingleSelectMenuItemProps extends SelectMenuItemProps {
|
|
29
|
+
/**
|
|
30
|
+
* An React element to render before the text in the select.
|
|
31
|
+
* This is typically used to render an icon.
|
|
32
|
+
*/
|
|
33
|
+
icon?: JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A single select menu item is a basic wrapper around Menu item designed to be used as a single value render in Select list
|
|
37
|
+
*
|
|
38
|
+
* @param {SelectMenuItemProps} props - The props for the SingleSelectMenuItem
|
|
39
|
+
* @returns {JSX.Element} SingleSelectMenuItem
|
|
40
|
+
*/
|
|
41
|
+
export declare const SingleSelectMenuItem: ({ label, icon, onClick, selected, dataTestId, focused, disabled, }: SingleSelectMenuItemProps) => JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* A multi select menu item is a basic wrapper around Menu item designed to be used as a multi value render in Select list
|
|
44
|
+
*
|
|
45
|
+
* @param {SelectMenuItemProps} props - The props for the MultiSelectMenuItem
|
|
46
|
+
* @returns {JSX.Element} multi select menu item
|
|
47
|
+
*/
|
|
48
|
+
export declare const MultiSelectMenuItem: ({ label, onClick, selected, dataTestId, focused, disabled, }: SelectMenuItemProps) => JSX.Element;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProps } from "../Tag";
|
|
3
|
+
declare type TagsPropsNoRef = Omit<TagProps, "ref">;
|
|
4
|
+
interface TagWithWidthProps extends TagsPropsNoRef {
|
|
5
|
+
onWidthKnown?: ({ width }: {
|
|
6
|
+
width: number;
|
|
7
|
+
}) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Extended Tag component with information about its own width.
|
|
11
|
+
* Used in the select component.
|
|
12
|
+
*
|
|
13
|
+
* @param {TagProps} props - The props for the tag component
|
|
14
|
+
* @returns {JSX.Element} TagWithWidth component
|
|
15
|
+
*/
|
|
16
|
+
export declare const TagWithWidth: ({ onWidthKnown, children, ...rest }: TagWithWidthProps) => JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface TagsContainerItem {
|
|
3
|
+
/**
|
|
4
|
+
* A text value to be passed to tags inside container
|
|
5
|
+
*/
|
|
6
|
+
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* OnClick handler for a tags
|
|
9
|
+
*/
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* A flag to set tags to readonly mode (without close button)
|
|
13
|
+
*/
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface TagsContainerProps {
|
|
17
|
+
/**
|
|
18
|
+
* An items to be rendered inside container if they fit available space. If they overlap then the counter will be displayed.
|
|
19
|
+
*/
|
|
20
|
+
items: TagsContainerItem[];
|
|
21
|
+
/**
|
|
22
|
+
* An css property to set a custom width for container
|
|
23
|
+
* Default behavior is to take 100% width of parent element
|
|
24
|
+
* You can provide a value with unit (pixels, percents, rem, etc)
|
|
25
|
+
*
|
|
26
|
+
* @memberof TagsContainerProps
|
|
27
|
+
*/
|
|
28
|
+
width?: string;
|
|
29
|
+
/**
|
|
30
|
+
* In case you have a gap between items then you can provide it to be used in calculation of available space,
|
|
31
|
+
* default value is 5, so if you don't need it then provide 0
|
|
32
|
+
*
|
|
33
|
+
* @memberof TagsContainerProps
|
|
34
|
+
*/
|
|
35
|
+
itemsGap?: number;
|
|
36
|
+
postFix: JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* TagsContainer component to display tags in limited space when children can't fit space it displays counter
|
|
40
|
+
*
|
|
41
|
+
* @param {TagsContainerProps} props - The props for the TagContainer
|
|
42
|
+
* @returns {JSX.Element} TagsContainer
|
|
43
|
+
*/
|
|
44
|
+
export declare const TagsContainer: ({ items, width, itemsGap, postFix }: TagsContainerProps) => JSX.Element;
|
|
45
|
+
export {};
|