@trackunit/react-components 0.0.36
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 +36 -0
- package/common/CommonProps.d.ts +17 -0
- package/common/StorybookProps.d.ts +6 -0
- package/common/index.d.ts +3 -0
- package/common/useContainerProps.d.ts +8 -0
- package/components/NumberField/NumberField.d.ts +15 -0
- package/components/NumberInput/NumberInput.d.ts +12 -0
- package/components/TextInput/TextInput.d.ts +12 -0
- package/components/alert/Alert.d.ts +69 -0
- package/components/alert/index.d.ts +1 -0
- package/components/badge/Badge.d.ts +74 -0
- package/components/badge/index.d.ts +1 -0
- package/components/baseInput/BaseInput.d.ts +82 -0
- package/components/baseInput/index.d.ts +1 -0
- package/components/buttons/button/Button.d.ts +55 -0
- package/components/buttons/icon-button/IconButton.d.ts +33 -0
- package/components/buttons/index.d.ts +4 -0
- package/components/buttons/shared/ButtonProps.d.ts +61 -0
- package/components/buttons/shared/helpers.d.ts +9 -0
- package/components/buttons/star-button/StarButton.d.ts +7 -0
- package/components/card/Card.d.ts +33 -0
- package/components/card/CardBody.d.ts +21 -0
- package/components/card/CardFooter.d.ts +16 -0
- package/components/card/CardHeader.d.ts +39 -0
- package/components/card/DensityContainer.d.ts +36 -0
- package/components/card/index.d.ts +5 -0
- package/components/chart/Chart.d.ts +105 -0
- package/components/chart/index.d.ts +1 -0
- package/components/checkbox/CheckIcon.d.ts +4 -0
- package/components/checkbox/Checkbox.d.ts +53 -0
- package/components/checkbox/IndeterminateIcon.d.ts +4 -0
- package/components/checkbox/index.d.ts +1 -0
- package/components/collapse/Collapse.d.ts +33 -0
- package/components/collapse/index.d.ts +1 -0
- package/components/copyableText/CopyableText.d.ts +8 -0
- package/components/copyableText/index.d.ts +1 -0
- package/components/dateField/DateField.d.ts +46 -0
- package/components/dateField/index.d.ts +1 -0
- package/components/dayPicker/DayPicker.d.ts +9 -0
- package/components/dayPicker/DayPickerPopover.d.ts +16 -0
- package/components/dayPicker/DayRangePicker.d.ts +11 -0
- package/components/dayPicker/index.d.ts +21 -0
- package/components/dayPicker/useLocale.d.ts +2 -0
- package/components/drawer/Drawer.d.ts +32 -0
- package/components/drawer/index.d.ts +1 -0
- package/components/formGroup/FormGroup.d.ts +42 -0
- package/components/heading/Heading.d.ts +34 -0
- package/components/heading/index.d.ts +1 -0
- package/components/icon/Icon.d.ts +49 -0
- package/components/index.d.ts +37 -0
- package/components/indicator/Indicator.d.ts +34 -0
- package/components/indicator/index.d.ts +1 -0
- package/components/label/Label.d.ts +33 -0
- package/components/label/index.d.ts +1 -0
- package/components/legendItem/LegendItem.d.ts +11 -0
- package/components/legendItem/index.d.ts +1 -0
- package/components/menu/MenuButton.d.ts +7 -0
- package/components/menu/MenuItem.d.ts +9 -0
- package/components/menu/MenuList.d.ts +11 -0
- package/components/menu/index.d.ts +3 -0
- package/components/modal/Modal.d.ts +42 -0
- package/components/modal/ModalBackdrop.d.ts +7 -0
- package/components/modal/index.d.ts +3 -0
- package/components/modal/useModal.d.ts +15 -0
- package/components/multiRowTableCell/MultiRowTableCell.d.ts +30 -0
- package/components/multiRowTableCell/index.d.ts +1 -0
- package/components/pageHeading/PageHeading.d.ts +9 -0
- package/components/pageHeading/index.d.ts +1 -0
- package/components/popover/AnimatedPopover.d.ts +15 -0
- package/components/popover/PopoverList.d.ts +6 -0
- package/components/popover/PopoverListItem.d.ts +16 -0
- package/components/popover/PopoverTitle.d.ts +8 -0
- package/components/popover/index.d.ts +5 -0
- package/components/popover/usePopover.d.ts +24 -0
- package/components/prompt/Prompt.d.ts +10 -0
- package/components/prompt/index.d.ts +1 -0
- package/components/radioGroup/RadioGroup.d.ts +14 -0
- package/components/radioGroup/RadioGroupContext.d.ts +10 -0
- package/components/radioGroup/RadioItem.d.ts +8 -0
- package/components/radioGroup/index.d.ts +2 -0
- package/components/select/CreatableSelect.d.ts +4 -0
- package/components/select/FieldContainer.d.ts +14 -0
- package/components/select/Select.d.ts +4 -0
- package/components/select/index.d.ts +3 -0
- package/components/select/shared.d.ts +83 -0
- package/components/skeletonLines/SkeletonLines.d.ts +41 -0
- package/components/skeletonLines/index.d.ts +1 -0
- package/components/spacer/Spacer.d.ts +21 -0
- package/components/spacer/index.d.ts +1 -0
- package/components/spinner/Spinner.d.ts +24 -0
- package/components/spinner/index.d.ts +1 -0
- package/components/text/Text.d.ts +79 -0
- package/components/text/index.d.ts +1 -0
- package/components/textArea/TextArea.d.ts +25 -0
- package/components/textArea/index.d.ts +1 -0
- package/components/textField/TextField.d.ts +23 -0
- package/components/textField/TextLenghtIndicator.d.ts +6 -0
- package/components/textField/index.d.ts +1 -0
- package/components/theme/DefaultTheme.d.ts +2 -0
- package/components/theme/index.d.ts +1 -0
- package/components/tip/Tip.d.ts +13 -0
- package/components/tip/index.d.ts +1 -0
- package/components/toggle/Toggle.d.ts +15 -0
- package/components/toggle/index.d.ts +1 -0
- package/components/tooltip/Tooltip.d.ts +69 -0
- package/components/tooltip/index.d.ts +1 -0
- package/constants/colors.d.ts +65 -0
- package/constants/index.d.ts +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/useDebounce.d.ts +1 -0
- package/hooks/useLocalStorage.d.ts +2 -0
- package/hooks/useTimeout.d.ts +9 -0
- package/index.d.ts +5 -0
- package/index.js +3829 -0
- package/layout/helper/MinTopFullContentLayout.d.ts +12 -0
- package/layout/index.d.ts +7 -0
- package/layout/responsive/FilterListMapLayout.d.ts +19 -0
- package/layout/responsive/FullWidthRepeatingLayout.d.ts +16 -0
- package/layout/responsive/GridArea.d.ts +12 -0
- package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +26 -0
- package/layout/responsive/TitleNavContentLayout.d.ts +6 -0
- package/layout/responsive/TwoColumnLayout.d.ts +6 -0
- package/package.json +32 -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,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormGroupProps } from "../formGroup/FormGroup";
|
|
3
|
+
import { TextInputProps } from "../TextInput/TextInput";
|
|
4
|
+
declare type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
|
|
5
|
+
export interface TextFieldProps extends TextInputProps, FormGroupExposedProps {
|
|
6
|
+
/**
|
|
7
|
+
* Set the Maximal length of the value for the input.
|
|
8
|
+
* Adds a TextLenghtIndicator to the right of the helpText.
|
|
9
|
+
*
|
|
10
|
+
* @type number
|
|
11
|
+
* @memberof TextFieldProps
|
|
12
|
+
*/
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
/**
|
|
15
|
+
* If a value is set, the field is rendered in its invalid state.
|
|
16
|
+
*
|
|
17
|
+
* @type string
|
|
18
|
+
* @memberof TextFieldProps
|
|
19
|
+
*/
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TextField";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DefaultTheme";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common";
|
|
3
|
+
import { IIconProps } from "../icon/Icon";
|
|
4
|
+
import { TooltipProps } from "../tooltip";
|
|
5
|
+
export interface TipProps extends CommonProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
iconProps?: Partial<IIconProps>;
|
|
8
|
+
tooltipProps?: Partial<TooltipProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare const Tip: {
|
|
11
|
+
({ children, iconProps, tooltipProps, dataTestId, ...rest }: TipProps): JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tip";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export declare type ToggleSize = "small" | "default";
|
|
4
|
+
export interface ToggleProps extends CommonProps {
|
|
5
|
+
id: string;
|
|
6
|
+
toggled: boolean;
|
|
7
|
+
onChange: (toggled: boolean, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: ToggleSize;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
14
|
+
}
|
|
15
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Toggle";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PopoverPlacement } from "../popover";
|
|
3
|
+
import { TextType } from "../text";
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
/**
|
|
6
|
+
* The text to be displayed in the tooltip.
|
|
7
|
+
*
|
|
8
|
+
* @type {(string | React.ReactNode)}
|
|
9
|
+
* @memberof TooltipProps
|
|
10
|
+
*/
|
|
11
|
+
label: string | React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Where the tooltip should be placed.
|
|
14
|
+
*
|
|
15
|
+
* @type {PopoverPlacement}
|
|
16
|
+
* @memberof TooltipProps
|
|
17
|
+
*/
|
|
18
|
+
placement?: PopoverPlacement;
|
|
19
|
+
/**
|
|
20
|
+
* Child nodes
|
|
21
|
+
*
|
|
22
|
+
* @type React.ReactNode
|
|
23
|
+
* @memberof TooltipProps
|
|
24
|
+
*/
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Id of test component.
|
|
28
|
+
*
|
|
29
|
+
* @type string
|
|
30
|
+
* @memberof TooltipProps
|
|
31
|
+
*/
|
|
32
|
+
dataTestId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the tooltip is disabled or not.
|
|
35
|
+
*
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof TooltipProps
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* To select either "light" or "dark" mode.
|
|
42
|
+
*
|
|
43
|
+
* @type {("light" | "dark")}
|
|
44
|
+
* @memberof TooltipProps
|
|
45
|
+
*/
|
|
46
|
+
mode?: "light" | "dark";
|
|
47
|
+
/**
|
|
48
|
+
* Offset value of the tooltip.
|
|
49
|
+
*
|
|
50
|
+
* @type {[number, number]}
|
|
51
|
+
* @memberof TooltipProps
|
|
52
|
+
*/
|
|
53
|
+
offset?: [number, number];
|
|
54
|
+
/**
|
|
55
|
+
* Additional classes to the component.
|
|
56
|
+
*
|
|
57
|
+
* @type string
|
|
58
|
+
* @memberof TooltipProps
|
|
59
|
+
*/
|
|
60
|
+
className?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Type of content.
|
|
63
|
+
*
|
|
64
|
+
* @type {TextType}
|
|
65
|
+
* @memberof TooltipProps
|
|
66
|
+
*/
|
|
67
|
+
contentTextType?: TextType;
|
|
68
|
+
}
|
|
69
|
+
export declare const Tooltip: ({ label, placement, children, dataTestId, disabled, mode, offset, className, contentTextType, }: TooltipProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tooltip";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ? A collection of all the types and tokens related to the named colors in the default theme.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The general color palette
|
|
6
|
+
* Should be available in most if not all colored components
|
|
7
|
+
*/
|
|
8
|
+
export declare const generalColors: {
|
|
9
|
+
readonly PRIMARY: "primary";
|
|
10
|
+
readonly ACCENT: "accent";
|
|
11
|
+
readonly NEUTRAL: "neutral";
|
|
12
|
+
};
|
|
13
|
+
export declare type GeneralColors = typeof colors[keyof typeof generalColors];
|
|
14
|
+
/**
|
|
15
|
+
* The intent color palette
|
|
16
|
+
* Should be available for most colored components such as "Button", "Alert", "Indicator", "Badge"
|
|
17
|
+
*/
|
|
18
|
+
export declare const intentColors: {
|
|
19
|
+
readonly INFO: "info";
|
|
20
|
+
readonly SUCCESS: "success";
|
|
21
|
+
readonly WARNING: "warning";
|
|
22
|
+
readonly DANGER: "danger";
|
|
23
|
+
};
|
|
24
|
+
export declare type IntentColors = typeof colors[keyof typeof intentColors];
|
|
25
|
+
/**
|
|
26
|
+
* The Criticality color palette
|
|
27
|
+
* Should be available in any component that could be used to display the criticality of an asset or event
|
|
28
|
+
*/
|
|
29
|
+
export declare const criticalityColors: {
|
|
30
|
+
readonly GOOD: "good";
|
|
31
|
+
readonly LOW: "low";
|
|
32
|
+
readonly CRITICAL: "critical";
|
|
33
|
+
};
|
|
34
|
+
export declare type CriticalityColors = typeof colors[keyof typeof criticalityColors];
|
|
35
|
+
/**
|
|
36
|
+
* The Activity color palette
|
|
37
|
+
* Should be available in any component that could be used to display the Activity state of an asset
|
|
38
|
+
*/
|
|
39
|
+
export declare const activityColors: {
|
|
40
|
+
readonly WORKING: "working";
|
|
41
|
+
readonly IDLE: "idle";
|
|
42
|
+
readonly STOPPED: "stopped";
|
|
43
|
+
readonly UNKNOWN: "unknown";
|
|
44
|
+
};
|
|
45
|
+
export declare type ActivityColors = typeof colors[keyof typeof activityColors];
|
|
46
|
+
/**
|
|
47
|
+
* The full color palette
|
|
48
|
+
*/
|
|
49
|
+
export declare const colors: {
|
|
50
|
+
readonly WORKING: "working";
|
|
51
|
+
readonly IDLE: "idle";
|
|
52
|
+
readonly STOPPED: "stopped";
|
|
53
|
+
readonly UNKNOWN: "unknown";
|
|
54
|
+
readonly GOOD: "good";
|
|
55
|
+
readonly LOW: "low";
|
|
56
|
+
readonly CRITICAL: "critical";
|
|
57
|
+
readonly INFO: "info";
|
|
58
|
+
readonly SUCCESS: "success";
|
|
59
|
+
readonly WARNING: "warning";
|
|
60
|
+
readonly DANGER: "danger";
|
|
61
|
+
readonly PRIMARY: "primary";
|
|
62
|
+
readonly ACCENT: "accent";
|
|
63
|
+
readonly NEUTRAL: "neutral";
|
|
64
|
+
};
|
|
65
|
+
export declare type Colors = typeof colors[keyof typeof colors];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./colors";
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDebounce: <T>(value: T, delay?: number) => T;
|