@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.
Files changed (126) hide show
  1. package/README.md +36 -0
  2. package/common/CommonProps.d.ts +17 -0
  3. package/common/StorybookProps.d.ts +6 -0
  4. package/common/index.d.ts +3 -0
  5. package/common/useContainerProps.d.ts +8 -0
  6. package/components/NumberField/NumberField.d.ts +15 -0
  7. package/components/NumberInput/NumberInput.d.ts +12 -0
  8. package/components/TextInput/TextInput.d.ts +12 -0
  9. package/components/alert/Alert.d.ts +69 -0
  10. package/components/alert/index.d.ts +1 -0
  11. package/components/badge/Badge.d.ts +74 -0
  12. package/components/badge/index.d.ts +1 -0
  13. package/components/baseInput/BaseInput.d.ts +82 -0
  14. package/components/baseInput/index.d.ts +1 -0
  15. package/components/buttons/button/Button.d.ts +55 -0
  16. package/components/buttons/icon-button/IconButton.d.ts +33 -0
  17. package/components/buttons/index.d.ts +4 -0
  18. package/components/buttons/shared/ButtonProps.d.ts +61 -0
  19. package/components/buttons/shared/helpers.d.ts +9 -0
  20. package/components/buttons/star-button/StarButton.d.ts +7 -0
  21. package/components/card/Card.d.ts +33 -0
  22. package/components/card/CardBody.d.ts +21 -0
  23. package/components/card/CardFooter.d.ts +16 -0
  24. package/components/card/CardHeader.d.ts +39 -0
  25. package/components/card/DensityContainer.d.ts +36 -0
  26. package/components/card/index.d.ts +5 -0
  27. package/components/chart/Chart.d.ts +105 -0
  28. package/components/chart/index.d.ts +1 -0
  29. package/components/checkbox/CheckIcon.d.ts +4 -0
  30. package/components/checkbox/Checkbox.d.ts +53 -0
  31. package/components/checkbox/IndeterminateIcon.d.ts +4 -0
  32. package/components/checkbox/index.d.ts +1 -0
  33. package/components/collapse/Collapse.d.ts +33 -0
  34. package/components/collapse/index.d.ts +1 -0
  35. package/components/copyableText/CopyableText.d.ts +8 -0
  36. package/components/copyableText/index.d.ts +1 -0
  37. package/components/dateField/DateField.d.ts +46 -0
  38. package/components/dateField/index.d.ts +1 -0
  39. package/components/dayPicker/DayPicker.d.ts +9 -0
  40. package/components/dayPicker/DayPickerPopover.d.ts +16 -0
  41. package/components/dayPicker/DayRangePicker.d.ts +11 -0
  42. package/components/dayPicker/index.d.ts +21 -0
  43. package/components/dayPicker/useLocale.d.ts +2 -0
  44. package/components/drawer/Drawer.d.ts +32 -0
  45. package/components/drawer/index.d.ts +1 -0
  46. package/components/formGroup/FormGroup.d.ts +42 -0
  47. package/components/heading/Heading.d.ts +34 -0
  48. package/components/heading/index.d.ts +1 -0
  49. package/components/icon/Icon.d.ts +49 -0
  50. package/components/index.d.ts +37 -0
  51. package/components/indicator/Indicator.d.ts +34 -0
  52. package/components/indicator/index.d.ts +1 -0
  53. package/components/label/Label.d.ts +33 -0
  54. package/components/label/index.d.ts +1 -0
  55. package/components/legendItem/LegendItem.d.ts +11 -0
  56. package/components/legendItem/index.d.ts +1 -0
  57. package/components/menu/MenuButton.d.ts +7 -0
  58. package/components/menu/MenuItem.d.ts +9 -0
  59. package/components/menu/MenuList.d.ts +11 -0
  60. package/components/menu/index.d.ts +3 -0
  61. package/components/modal/Modal.d.ts +42 -0
  62. package/components/modal/ModalBackdrop.d.ts +7 -0
  63. package/components/modal/index.d.ts +3 -0
  64. package/components/modal/useModal.d.ts +15 -0
  65. package/components/multiRowTableCell/MultiRowTableCell.d.ts +30 -0
  66. package/components/multiRowTableCell/index.d.ts +1 -0
  67. package/components/pageHeading/PageHeading.d.ts +9 -0
  68. package/components/pageHeading/index.d.ts +1 -0
  69. package/components/popover/AnimatedPopover.d.ts +15 -0
  70. package/components/popover/PopoverList.d.ts +6 -0
  71. package/components/popover/PopoverListItem.d.ts +16 -0
  72. package/components/popover/PopoverTitle.d.ts +8 -0
  73. package/components/popover/index.d.ts +5 -0
  74. package/components/popover/usePopover.d.ts +24 -0
  75. package/components/prompt/Prompt.d.ts +10 -0
  76. package/components/prompt/index.d.ts +1 -0
  77. package/components/radioGroup/RadioGroup.d.ts +14 -0
  78. package/components/radioGroup/RadioGroupContext.d.ts +10 -0
  79. package/components/radioGroup/RadioItem.d.ts +8 -0
  80. package/components/radioGroup/index.d.ts +2 -0
  81. package/components/select/CreatableSelect.d.ts +4 -0
  82. package/components/select/FieldContainer.d.ts +14 -0
  83. package/components/select/Select.d.ts +4 -0
  84. package/components/select/index.d.ts +3 -0
  85. package/components/select/shared.d.ts +83 -0
  86. package/components/skeletonLines/SkeletonLines.d.ts +41 -0
  87. package/components/skeletonLines/index.d.ts +1 -0
  88. package/components/spacer/Spacer.d.ts +21 -0
  89. package/components/spacer/index.d.ts +1 -0
  90. package/components/spinner/Spinner.d.ts +24 -0
  91. package/components/spinner/index.d.ts +1 -0
  92. package/components/text/Text.d.ts +79 -0
  93. package/components/text/index.d.ts +1 -0
  94. package/components/textArea/TextArea.d.ts +25 -0
  95. package/components/textArea/index.d.ts +1 -0
  96. package/components/textField/TextField.d.ts +23 -0
  97. package/components/textField/TextLenghtIndicator.d.ts +6 -0
  98. package/components/textField/index.d.ts +1 -0
  99. package/components/theme/DefaultTheme.d.ts +2 -0
  100. package/components/theme/index.d.ts +1 -0
  101. package/components/tip/Tip.d.ts +13 -0
  102. package/components/tip/index.d.ts +1 -0
  103. package/components/toggle/Toggle.d.ts +15 -0
  104. package/components/toggle/index.d.ts +1 -0
  105. package/components/tooltip/Tooltip.d.ts +69 -0
  106. package/components/tooltip/index.d.ts +1 -0
  107. package/constants/colors.d.ts +65 -0
  108. package/constants/index.d.ts +1 -0
  109. package/hooks/index.d.ts +3 -0
  110. package/hooks/useDebounce.d.ts +1 -0
  111. package/hooks/useLocalStorage.d.ts +2 -0
  112. package/hooks/useTimeout.d.ts +9 -0
  113. package/index.d.ts +5 -0
  114. package/index.js +3829 -0
  115. package/layout/helper/MinTopFullContentLayout.d.ts +12 -0
  116. package/layout/index.d.ts +7 -0
  117. package/layout/responsive/FilterListMapLayout.d.ts +19 -0
  118. package/layout/responsive/FullWidthRepeatingLayout.d.ts +16 -0
  119. package/layout/responsive/GridArea.d.ts +12 -0
  120. package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +26 -0
  121. package/layout/responsive/TitleNavContentLayout.d.ts +6 -0
  122. package/layout/responsive/TwoColumnLayout.d.ts +6 -0
  123. package/package.json +32 -0
  124. package/test-config/jest.setup.d.ts +1 -0
  125. package/test-utils/hooks.d.ts +4 -0
  126. 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,6 @@
1
+ import * as React from "react";
2
+ export interface TextLengthIndicatorProps {
3
+ length: number;
4
+ maxLength: number;
5
+ }
6
+ export declare const TextLengthIndicator: React.FC<TextLengthIndicatorProps>;
@@ -0,0 +1 @@
1
+ export * from "./TextField";
@@ -0,0 +1,2 @@
1
+ import { Tokens } from "@trackunit/ui-design-tokens";
2
+ export declare const defaultTheme: Tokens;
@@ -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";
@@ -0,0 +1,3 @@
1
+ export * from "./useDebounce";
2
+ export * from "./useLocalStorage";
3
+ export * from "./useTimeout";
@@ -0,0 +1 @@
1
+ export declare const useDebounce: <T>(value: T, delay?: number) => T;
@@ -0,0 +1,2 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ export declare const useLocalStorage: <TValue = string | null | undefined>(key: string, initialValue?: TValue | undefined) => [TValue | null, Dispatch<SetStateAction<TValue | null>>, () => void];
@@ -0,0 +1,9 @@
1
+ interface UseTimeoutProps {
2
+ onTimeout: () => void;
3
+ duration: number;
4
+ }
5
+ export declare const useTimeout: ({ onTimeout, duration }: UseTimeoutProps) => {
6
+ startTimeout: () => void;
7
+ stopTimeout: () => void;
8
+ };
9
+ export {};
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./common";
2
+ export * from "./components";
3
+ export * from "./constants";
4
+ export * from "./hooks";
5
+ export * from "./layout";