@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.
Files changed (143) hide show
  1. package/README.md +22 -0
  2. package/common/CommonProps.d.ts +12 -0
  3. package/common/LegacyComponentStory.d.ts +7 -0
  4. package/common/StorybookProps.d.ts +6 -0
  5. package/common/index.d.ts +3 -0
  6. package/common/useContainerProps.d.ts +16 -0
  7. package/components/ActionButton/ActionButton.d.ts +30 -0
  8. package/components/ActionButton/index.d.ts +1 -0
  9. package/components/Alert/Alert.d.ts +53 -0
  10. package/components/Alert/index.d.ts +1 -0
  11. package/components/Badge/Badge.d.ts +47 -0
  12. package/components/Badge/index.d.ts +1 -0
  13. package/components/BaseInput/BaseInput.d.ts +62 -0
  14. package/components/BaseInput/index.d.ts +1 -0
  15. package/components/Card/Card.d.ts +45 -0
  16. package/components/Card/CardBody.d.ts +32 -0
  17. package/components/Card/CardFooter.d.ts +21 -0
  18. package/components/Card/CardHeader.d.ts +43 -0
  19. package/components/Card/DensityContainer.d.ts +30 -0
  20. package/components/Card/index.d.ts +5 -0
  21. package/components/Chart/Chart.d.ts +81 -0
  22. package/components/Chart/index.d.ts +1 -0
  23. package/components/Checkbox/CheckIcon.d.ts +12 -0
  24. package/components/Checkbox/Checkbox.d.ts +40 -0
  25. package/components/Checkbox/IndeterminateIcon.d.ts +10 -0
  26. package/components/Checkbox/index.d.ts +1 -0
  27. package/components/Collapse/Collapse.d.ts +28 -0
  28. package/components/Collapse/index.d.ts +1 -0
  29. package/components/CopyableText/CopyableText.d.ts +21 -0
  30. package/components/CopyableText/index.d.ts +1 -0
  31. package/components/DateField/DateField.d.ts +19 -0
  32. package/components/DateInput/DateInput.d.ts +28 -0
  33. package/components/DayPicker/DayPicker.d.ts +28 -0
  34. package/components/DayPicker/DayPickerPopover.d.ts +23 -0
  35. package/components/DayPicker/DayRangePicker.d.ts +18 -0
  36. package/components/DayPicker/index.d.ts +21 -0
  37. package/components/DayPicker/useLocale.d.ts +8 -0
  38. package/components/EmailInput/EmailInput.d.ts +20 -0
  39. package/components/FormGroup/FormGroup.d.ts +38 -0
  40. package/components/Heading/Heading.d.ts +28 -0
  41. package/components/Heading/index.d.ts +1 -0
  42. package/components/Icon/Icon.d.ts +51 -0
  43. package/components/Indicator/Indicator.d.ts +42 -0
  44. package/components/Indicator/index.d.ts +1 -0
  45. package/components/Label/Label.d.ts +34 -0
  46. package/components/Label/index.d.ts +1 -0
  47. package/components/LegendItem/LegendItem.d.ts +17 -0
  48. package/components/LegendItem/index.d.ts +1 -0
  49. package/components/Menu/MenuItem.d.ts +58 -0
  50. package/components/Menu/MenuList.d.ts +34 -0
  51. package/components/Menu/index.d.ts +2 -0
  52. package/components/Modal/Modal.d.ts +32 -0
  53. package/components/Modal/ModalBackdrop.d.ts +13 -0
  54. package/components/Modal/index.d.ts +3 -0
  55. package/components/Modal/useModal.d.ts +21 -0
  56. package/components/NumberField/NumberField.d.ts +19 -0
  57. package/components/NumberInput/NumberInput.d.ts +12 -0
  58. package/components/PageHeader/PageHeader.d.ts +47 -0
  59. package/components/PageHeader/index.d.ts +1 -0
  60. package/components/Pagination/Pagination.d.ts +71 -0
  61. package/components/PhoneInput/PhoneInput.d.ts +20 -0
  62. package/components/Popover/AnimatedPopover.d.ts +43 -0
  63. package/components/Popover/PopoverList.d.ts +12 -0
  64. package/components/Popover/PopoverListItem.d.ts +30 -0
  65. package/components/Popover/PopoverTitle.d.ts +20 -0
  66. package/components/Popover/index.d.ts +5 -0
  67. package/components/Popover/usePopover.d.ts +42 -0
  68. package/components/Prompt/Prompt.d.ts +20 -0
  69. package/components/Prompt/index.d.ts +1 -0
  70. package/components/RadioGroup/RadioGroup.d.ts +57 -0
  71. package/components/RadioGroup/RadioGroupContext.d.ts +11 -0
  72. package/components/RadioGroup/RadioItem.d.ts +24 -0
  73. package/components/RadioGroup/index.d.ts +2 -0
  74. package/components/SectionHeader/SectionHeader.d.ts +24 -0
  75. package/components/SectionHeader/index.d.ts +1 -0
  76. package/components/Select/CreatableSelect.d.ts +38 -0
  77. package/components/Select/FieldContainer.d.ts +20 -0
  78. package/components/Select/Select.d.ts +18 -0
  79. package/components/Select/SelectMenuItem/SelectMenuItem.d.ts +49 -0
  80. package/components/Select/TagWithWidth.d.ts +17 -0
  81. package/components/Select/TagsContainer.d.ts +45 -0
  82. package/components/Select/index.d.ts +7 -0
  83. package/components/Select/shared.d.ts +15 -0
  84. package/components/Select/useCustomComponents.d.ts +19 -0
  85. package/components/Select/useCustomStyles.d.ts +14 -0
  86. package/components/Select/useSelect.d.ts +143 -0
  87. package/components/SkeletonLines/SkeletonLines.d.ts +25 -0
  88. package/components/SkeletonLines/index.d.ts +1 -0
  89. package/components/Spacer/Spacer.d.ts +20 -0
  90. package/components/Spacer/index.d.ts +1 -0
  91. package/components/Spinner/Spinner.d.ts +37 -0
  92. package/components/Spinner/index.d.ts +1 -0
  93. package/components/Tag/Tag.d.ts +39 -0
  94. package/components/Tag/index.d.ts +1 -0
  95. package/components/Text/Text.d.ts +58 -0
  96. package/components/Text/index.d.ts +1 -0
  97. package/components/TextArea/TextArea.d.ts +30 -0
  98. package/components/TextArea/index.d.ts +1 -0
  99. package/components/TextAreaField/TextAreaField.d.ts +19 -0
  100. package/components/TextAreaField/index.d.ts +1 -0
  101. package/components/TextField/TextField.d.ts +24 -0
  102. package/components/TextField/TextLenghtIndicator.d.ts +19 -0
  103. package/components/TextField/index.d.ts +1 -0
  104. package/components/TextInput/TextInput.d.ts +12 -0
  105. package/components/Timeline/Timeline.d.ts +30 -0
  106. package/components/Tip/Tip.d.ts +34 -0
  107. package/components/Tip/index.d.ts +1 -0
  108. package/components/Toggle/Toggle.d.ts +57 -0
  109. package/components/Toggle/index.d.ts +1 -0
  110. package/components/Tooltip/Tooltip.d.ts +48 -0
  111. package/components/Tooltip/index.d.ts +1 -0
  112. package/components/ValueBar/ValueBar.d.ts +44 -0
  113. package/components/ValueBar/ValueBarHelper.d.ts +35 -0
  114. package/components/ValueBar/ValueBarTypes.d.ts +9 -0
  115. package/components/ValueBar/index.d.ts +3 -0
  116. package/components/buttons/Button/Button.d.ts +48 -0
  117. package/components/buttons/IconButton/IconButton.d.ts +25 -0
  118. package/components/buttons/StarButton/StarButton.d.ts +13 -0
  119. package/components/buttons/index.d.ts +4 -0
  120. package/components/buttons/shared/ButtonProps.d.ts +40 -0
  121. package/components/buttons/shared/helpers.d.ts +20 -0
  122. package/components/index.d.ts +44 -0
  123. package/components/theme/DefaultTheme.d.ts +2 -0
  124. package/components/theme/index.d.ts +1 -0
  125. package/hooks/index.d.ts +3 -0
  126. package/hooks/useDebounce.d.ts +8 -0
  127. package/hooks/useLocalStorage.d.ts +9 -0
  128. package/hooks/useTimeout.d.ts +15 -0
  129. package/index.css +488 -0
  130. package/index.d.ts +4 -0
  131. package/index.js +5553 -0
  132. package/layout/helper/MinTopFullContentLayout.d.ts +18 -0
  133. package/layout/index.d.ts +7 -0
  134. package/layout/responsive/FilterListMapLayout.d.ts +22 -0
  135. package/layout/responsive/FullWidthRepeatingLayout.d.ts +19 -0
  136. package/layout/responsive/GridArea.d.ts +13 -0
  137. package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +30 -0
  138. package/layout/responsive/TitleNavContentLayout.d.ts +12 -0
  139. package/layout/responsive/TwoColumnLayout.d.ts +12 -0
  140. package/package.json +31 -0
  141. package/test-config/jest.setup.d.ts +1 -0
  142. package/test-utils/hooks.d.ts +4 -0
  143. 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,5 @@
1
+ export * from "./AnimatedPopover";
2
+ export * from "./PopoverList";
3
+ export * from "./PopoverListItem";
4
+ export * from "./PopoverTitle";
5
+ export * from "./usePopover";
@@ -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,2 @@
1
+ export * from "./RadioGroup";
2
+ export * from "./RadioItem";
@@ -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 {};
@@ -0,0 +1,7 @@
1
+ import ValueType from "react-select";
2
+ export * from "./CreatableSelect";
3
+ export * from "./Select";
4
+ export * from "./SelectMenuItem/SelectMenuItem";
5
+ export * from "./shared";
6
+ export * from "./useCustomComponents";
7
+ export { ValueType };