@trackunit/react-components 0.0.47 → 0.0.50
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 +12 -30
- package/common/CommonProps.d.ts +0 -2
- package/common/useContainerProps.d.ts +8 -0
- package/components/NumberField/NumberField.d.ts +0 -1
- package/components/NumberInput/NumberInput.d.ts +2 -2
- package/components/TextInput/TextInput.d.ts +2 -2
- package/components/alert/Alert.d.ts +6 -7
- package/components/badge/Badge.d.ts +8 -9
- package/components/baseInput/BaseInput.d.ts +0 -8
- package/components/buttons/button/Button.d.ts +4 -6
- package/components/buttons/icon-button/IconButton.d.ts +0 -3
- package/components/buttons/shared/ButtonProps.d.ts +0 -7
- package/components/buttons/shared/helpers.d.ts +10 -0
- package/components/buttons/star-button/StarButton.d.ts +6 -0
- package/components/card/Card.d.ts +7 -3
- package/components/card/CardBody.d.ts +5 -4
- package/components/card/CardFooter.d.ts +2 -2
- package/components/card/CardHeader.d.ts +4 -13
- package/components/card/DensityContainer.d.ts +10 -11
- package/components/chart/Chart.d.ts +5 -10
- package/components/checkbox/CheckIcon.d.ts +11 -3
- package/components/checkbox/Checkbox.d.ts +0 -6
- package/components/checkbox/IndeterminateIcon.d.ts +6 -0
- package/components/collapse/Collapse.d.ts +6 -3
- package/components/copyableText/CopyableText.d.ts +6 -3
- package/components/dateField/DateField.d.ts +2 -6
- package/components/dayPicker/DayPicker.d.ts +18 -0
- package/components/dayPicker/DayPickerPopover.d.ts +6 -0
- package/components/dayPicker/DayRangePicker.d.ts +6 -0
- package/components/dayPicker/useLocale.d.ts +6 -0
- package/components/formGroup/FormGroup.d.ts +8 -6
- package/components/heading/Heading.d.ts +6 -4
- package/components/icon/Icon.d.ts +12 -10
- package/components/indicator/Indicator.d.ts +7 -5
- package/components/label/Label.d.ts +8 -4
- package/components/legendItem/LegendItem.d.ts +6 -0
- package/components/menu/MenuButton.d.ts +6 -0
- package/components/menu/MenuItem.d.ts +6 -4
- package/components/menu/MenuList.d.ts +6 -3
- package/components/modal/Modal.d.ts +0 -4
- package/components/modal/ModalBackdrop.d.ts +6 -0
- package/components/modal/useModal.d.ts +6 -0
- package/components/multiRowTableCell/MultiRowTableCell.d.ts +4 -4
- package/components/pageHeading/PageHeading.d.ts +6 -3
- package/components/popover/PopoverList.d.ts +6 -0
- package/components/popover/PopoverListItem.d.ts +6 -0
- package/components/popover/PopoverTitle.d.ts +6 -0
- package/components/popover/usePopover.d.ts +6 -0
- package/components/prompt/Prompt.d.ts +13 -3
- package/components/radioGroup/RadioGroup.d.ts +6 -8
- package/components/radioGroup/RadioItem.d.ts +6 -2
- package/components/select/CreatableSelect.d.ts +6 -0
- package/components/select/FieldContainer.d.ts +6 -0
- package/components/select/Select.d.ts +6 -0
- package/components/select/shared.d.ts +15 -9
- package/components/skeletonLines/SkeletonLines.d.ts +0 -5
- package/components/spacer/Spacer.d.ts +6 -2
- package/components/spinner/Spinner.d.ts +6 -0
- package/components/text/Text.d.ts +6 -10
- package/components/textArea/TextArea.d.ts +0 -54
- package/components/textField/TextField.d.ts +0 -2
- package/components/textField/TextLenghtIndicator.d.ts +13 -0
- package/components/tip/Tip.d.ts +8 -3
- package/components/toggle/Toggle.d.ts +0 -26
- package/components/tooltip/Tooltip.d.ts +6 -9
- package/hooks/useDebounce.d.ts +7 -0
- package/hooks/useLocalStorage.d.ts +7 -0
- package/hooks/useTimeout.d.ts +6 -0
- package/index.js +445 -39
- package/layout/helper/MinTopFullContentLayout.d.ts +6 -0
- package/layout/responsive/FilterListMapLayout.d.ts +6 -3
- package/layout/responsive/FullWidthRepeatingLayout.d.ts +8 -5
- package/layout/responsive/GridArea.d.ts +3 -1
- package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +12 -8
- package/layout/responsive/TitleNavContentLayout.d.ts +8 -2
- package/layout/responsive/TwoColumnLayout.d.ts +8 -2
- package/package.json +5 -5
package/components/tip/Tip.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common";
|
|
3
|
-
import {
|
|
3
|
+
import { IconProps } from "../icon/Icon";
|
|
4
4
|
import { TooltipProps } from "../tooltip";
|
|
5
5
|
export interface TipProps extends CommonProps {
|
|
6
6
|
/**
|
|
7
7
|
* Child nodes to render inside the tip.
|
|
8
8
|
*
|
|
9
|
-
* @type {React.ReactNode}
|
|
10
9
|
* @memberof TipProps
|
|
11
10
|
*/
|
|
12
11
|
children: React.ReactNode;
|
|
13
|
-
iconProps?: Partial<
|
|
12
|
+
iconProps?: Partial<IconProps>;
|
|
14
13
|
tooltipProps?: Partial<TooltipProps>;
|
|
15
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The Tip component is used to show helpful tips for users.
|
|
17
|
+
*
|
|
18
|
+
* @param {TipProps} props - The props for the Tip component
|
|
19
|
+
* @returns {JSX.Element} Tip component
|
|
20
|
+
*/
|
|
16
21
|
export declare const Tip: {
|
|
17
22
|
({ children, iconProps, tooltipProps, dataTestId, ...rest }: TipProps): JSX.Element;
|
|
18
23
|
displayName: string;
|
|
@@ -4,64 +4,38 @@ export declare type ToggleSize = "small" | "default";
|
|
|
4
4
|
export interface ToggleProps extends CommonProps {
|
|
5
5
|
/**
|
|
6
6
|
* ID of the toggle.
|
|
7
|
-
*
|
|
8
|
-
* @type string
|
|
9
|
-
* @memberof ToggleProps
|
|
10
7
|
*/
|
|
11
8
|
id: string;
|
|
12
9
|
/**
|
|
13
10
|
* Whether the toggle is toggled(active) or not.
|
|
14
|
-
*
|
|
15
|
-
* @type boolean
|
|
16
|
-
* @memberof ToggleProps
|
|
17
11
|
*/
|
|
18
12
|
toggled: boolean;
|
|
19
13
|
/**
|
|
20
14
|
* onChange event handler.
|
|
21
|
-
*
|
|
22
|
-
* @memberof ToggleProps
|
|
23
15
|
*/
|
|
24
16
|
onChange: (toggled: boolean, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
25
17
|
/**
|
|
26
18
|
* Whether the toggle is disabled or not.
|
|
27
|
-
*
|
|
28
|
-
* @type boolean
|
|
29
|
-
* @memberof ToggleProps
|
|
30
19
|
*/
|
|
31
20
|
disabled?: boolean;
|
|
32
21
|
/**
|
|
33
22
|
* Size of the toggle.
|
|
34
|
-
*
|
|
35
|
-
* @type "small" | "default"
|
|
36
|
-
* @memberof ToggleProps
|
|
37
23
|
*/
|
|
38
24
|
size?: ToggleSize;
|
|
39
25
|
/**
|
|
40
26
|
* Tab index specifies the keyboard tab order of the toggle relative to the other controls on the page.
|
|
41
|
-
*
|
|
42
|
-
* @type number
|
|
43
|
-
* @memberof ToggleProps
|
|
44
27
|
*/
|
|
45
28
|
tabIndex?: number;
|
|
46
29
|
/**
|
|
47
30
|
* Whether the toggle is required or not.
|
|
48
|
-
*
|
|
49
|
-
* @type boolean
|
|
50
|
-
* @memberof ToggleProps
|
|
51
31
|
*/
|
|
52
32
|
required?: boolean;
|
|
53
33
|
/**
|
|
54
34
|
* Name of the toggle.
|
|
55
|
-
*
|
|
56
|
-
* @type string
|
|
57
|
-
* @memberof ToggleProps
|
|
58
35
|
*/
|
|
59
36
|
name?: string;
|
|
60
37
|
/**
|
|
61
38
|
* onBlur event handler.
|
|
62
|
-
*
|
|
63
|
-
* @type {React.FocusEventHandler<HTMLInputElement>}
|
|
64
|
-
* @memberof ToggleProps
|
|
65
39
|
*/
|
|
66
40
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
67
41
|
}
|
|
@@ -5,65 +5,62 @@ export interface TooltipProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* The text to be displayed in the tooltip.
|
|
7
7
|
*
|
|
8
|
-
* @type {(string | React.ReactNode)}
|
|
9
8
|
* @memberof TooltipProps
|
|
10
9
|
*/
|
|
11
10
|
label: string | React.ReactNode;
|
|
12
11
|
/**
|
|
13
12
|
* Where the tooltip should be placed.
|
|
14
13
|
*
|
|
15
|
-
* @type {PopoverPlacement}
|
|
16
14
|
* @memberof TooltipProps
|
|
17
15
|
*/
|
|
18
16
|
placement?: PopoverPlacement;
|
|
19
17
|
/**
|
|
20
18
|
* Child nodes
|
|
21
19
|
*
|
|
22
|
-
* @type React.ReactNode
|
|
23
20
|
* @memberof TooltipProps
|
|
24
21
|
*/
|
|
25
22
|
children?: React.ReactNode;
|
|
26
23
|
/**
|
|
27
24
|
* Id of test component.
|
|
28
25
|
*
|
|
29
|
-
* @type string
|
|
30
26
|
* @memberof TooltipProps
|
|
31
27
|
*/
|
|
32
28
|
dataTestId?: string;
|
|
33
29
|
/**
|
|
34
30
|
* Whether the tooltip is disabled or not.
|
|
35
31
|
*
|
|
36
|
-
* @type boolean
|
|
37
32
|
* @memberof TooltipProps
|
|
38
33
|
*/
|
|
39
34
|
disabled?: boolean;
|
|
40
35
|
/**
|
|
41
36
|
* To select either "light" or "dark" mode.
|
|
42
37
|
*
|
|
43
|
-
* @type "light" | "dark"
|
|
44
38
|
* @memberof TooltipProps
|
|
45
39
|
*/
|
|
46
40
|
mode?: "light" | "dark";
|
|
47
41
|
/**
|
|
48
42
|
* Offset value of the tooltip.
|
|
49
43
|
*
|
|
50
|
-
* @type [number, number]
|
|
51
44
|
* @memberof TooltipProps
|
|
52
45
|
*/
|
|
53
46
|
offset?: [number, number];
|
|
54
47
|
/**
|
|
55
48
|
* Additional classes to the component.
|
|
56
49
|
*
|
|
57
|
-
* @type string
|
|
58
50
|
* @memberof TooltipProps
|
|
59
51
|
*/
|
|
60
52
|
className?: string;
|
|
61
53
|
/**
|
|
62
54
|
* Type of content.
|
|
63
55
|
*
|
|
64
|
-
* @type "p" | "span" | "div"
|
|
65
56
|
* @memberof TooltipProps
|
|
66
57
|
*/
|
|
67
58
|
contentTextType?: TextType;
|
|
68
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The Tooltip component.
|
|
62
|
+
*
|
|
63
|
+
* @param {TooltipProps} props - The props for the Tooltip component
|
|
64
|
+
* @returns {JSX.Element} Tooltip component
|
|
65
|
+
*/
|
|
69
66
|
export declare const Tooltip: ({ label, placement, children, dataTestId, disabled, mode, offset, className, contentTextType, }: TooltipProps) => JSX.Element;
|
package/hooks/useDebounce.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The useDebounce hook works like useState, but adds a delay where previous values will be ignored.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} value The value to set
|
|
5
|
+
* @param {number} delay The debounce time
|
|
6
|
+
* @returns {any} value The latest values received
|
|
7
|
+
*/
|
|
1
8
|
export declare const useDebounce: <T>(value: T, delay?: number) => T;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The useLocalStorage hook works like useState, but saves to localstorage.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} key - The key the values is saved under.
|
|
6
|
+
* @param {string | null | undefined} initialValue - The initial value for the state/local storage item
|
|
7
|
+
* @returns {string | null | undefined} value
|
|
8
|
+
*/
|
|
2
9
|
export declare const useLocalStorage: <TValue = string | null | undefined>(key: string, initialValue?: TValue | undefined) => [TValue | null, Dispatch<SetStateAction<TValue | null>>, () => void];
|
package/hooks/useTimeout.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ interface UseTimeoutProps {
|
|
|
2
2
|
onTimeout: () => void;
|
|
3
3
|
duration: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* The useTimeout hook.
|
|
7
|
+
*
|
|
8
|
+
* @param {UseTimeoutProps} props The props
|
|
9
|
+
* @returns {{ startTimeout: () => void; stopTimeout: () => void; }} return
|
|
10
|
+
*/
|
|
5
11
|
export declare const useTimeout: ({ onTimeout, duration }: UseTimeoutProps) => {
|
|
6
12
|
startTimeout: () => void;
|
|
7
13
|
stopTimeout: () => void;
|