@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,12 @@
1
+ /// <reference types="react" />
2
+ import { CommonProps } from "../../common/CommonProps";
3
+ /**
4
+ * Pass two children. The first will be min-content and the second full height
5
+ * Useful when toy want the second child to have 100% height and be scrollable
6
+ * Example: FilterBar + Fleet List
7
+ */
8
+ interface IMinTopFullContentLayoutProps extends CommonProps {
9
+ children: React.ReactNode;
10
+ }
11
+ export declare const MinTopFullContentLayout: ({ children, className, dataTestId }: IMinTopFullContentLayoutProps) => JSX.Element;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ export * from "./helper/MinTopFullContentLayout";
2
+ export * from "./responsive/FilterListMapLayout";
3
+ export * from "./responsive/FullWidthRepeatingLayout";
4
+ export * from "./responsive/GridArea";
5
+ export * from "./responsive/IntrinsicallyResponsiveGrid";
6
+ export * from "./responsive/TitleNavContentLayout";
7
+ export * from "./responsive/TwoColumnLayout";
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Responsive layout component setting up three grid areas
4
+ * one for filtering, (result-)list and (result-map)
5
+ *
6
+ * List needs to handle its own min size - and map takes up the rest.
7
+ *
8
+ * Will be inlined to
9
+ * - filter
10
+ * - list
11
+ * - map
12
+ * on screens < mediaQuery.xxl
13
+ *
14
+ */
15
+ interface IProps {
16
+ children: React.ReactNode;
17
+ }
18
+ export declare const FilterListMapLayout: ({ children }: IProps) => JSX.Element;
19
+ export {};
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Layout component with repeating full width areas, default one height fraction each but option to use content height instead
4
+ * Row min height can optionally be set here or managed by children
5
+ * Scrolling happens if/when children's a min-height is reached
6
+ */
7
+ declare type RowSizing = "Equal" | "MinContent" | "Unmanaged";
8
+ interface IFullWidthRepeatingLayoutProps {
9
+ children: React.ReactNode;
10
+ rowSizing?: RowSizing;
11
+ rowMinHeight?: number;
12
+ dataTestId?: string;
13
+ className?: string;
14
+ }
15
+ export declare const FullWidthRepeatingLayout: ({ children, rowSizing, rowMinHeight, dataTestId, className, }: IFullWidthRepeatingLayoutProps) => JSX.Element;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { CommonProps } from "../../common/CommonProps";
3
+ interface GridAreaProps extends CommonProps {
4
+ area: string;
5
+ children: React.ReactNode;
6
+ }
7
+ /**
8
+ * Simply applies a Grid Area to the element
9
+ * @param {string} area
10
+ */
11
+ export declare const GridArea: ({ area, dataTestId, className, children }: GridAreaProps) => JSX.Element;
12
+ export {};
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { CommonProps } from "../../common/CommonProps";
3
+ declare type ColumnWidth = "slim" | "narrow" | "normal" | "wide";
4
+ declare type Space = "inherit" | "auto" | "none" | "tiny" | "mini" | "small" | "medium" | "large" | "giant" | "enormous";
5
+ declare type Occupation = "auto-fill" | "auto-fit";
6
+ interface IIntrinsicallyResponsiveGridProps extends CommonProps {
7
+ children: React.ReactNode;
8
+ occupation?: Occupation;
9
+ minColumnWidth?: ColumnWidth;
10
+ gap?: Space;
11
+ }
12
+ /**
13
+ * A grid container that has a flexible number of columns.
14
+ * Adds more columns if constraints allow it, otherwise wraps to next row
15
+ *
16
+ * @component
17
+ * @prop children - the children to be laid out,
18
+ * @prop occupation = "auto-fill" - stretch a little, till there's room for another column. Optionally set "auto-fit" to stretch children to fit entire container width,
19
+ * @prop minColumnWidth = "normal" - "small" | "normal" | "large"
20
+ * @prop gap = "auto" - the gap size between children,
21
+ * @prop dataTestId,
22
+ * @prop className ,
23
+
24
+ */
25
+ export declare const IntrinsicallyResponsiveGrid: ({ children, occupation, minColumnWidth, gap, dataTestId, className, }: IIntrinsicallyResponsiveGridProps) => JSX.Element;
26
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface IProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const TitleNavContentLayout: ({ children }: IProps) => JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface IProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const TwoColumnLayout: ({ children }: IProps) => JSX.Element;
6
+ export {};
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@trackunit/react-components",
3
+ "version": "0.0.36",
4
+ "repository": "https://github.com/Trackunit/manager",
5
+ "license": "MIT",
6
+ "dependencies": {
7
+ "@trackunit/css-core": "0.0.31",
8
+ "@trackunit/ui-design-tokens": "0.0.31",
9
+ "@trackunit/ui-icons": "0.0.31",
10
+ "@trackunit/tailwind-styled-components": "0.0.31",
11
+ "echarts": "^5.3.2",
12
+ "react": "17.0.1",
13
+ "echarts-for-react": "^3.0.2",
14
+ "uuid": "^8.3.2",
15
+ "@react-spring/web": "^9.4.4",
16
+ "react-use": "^17.3.2",
17
+ "react-day-picker": "^8.0.3",
18
+ "date-fns": "^2.28.0",
19
+ "react-useportal": "^1.0.16",
20
+ "react-helmet": "^6.1.0",
21
+ "@popperjs/core": "^2.11.4",
22
+ "history": "^5.3.0",
23
+ "react-router-dom": "^6.2.2",
24
+ "react-select": "^5.2.2",
25
+ "faker": "^5.5.3"
26
+ },
27
+ "module": "./index.js",
28
+ "main": "./index.js",
29
+ "type": "module",
30
+ "types": "./index.d.ts",
31
+ "peerDependencies": {}
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { RenderHookOptions } from "@testing-library/react-hooks";
2
+ declare const customRenderHook: <T, K>(callback: (props: T) => K, options?: RenderHookOptions<T> | undefined) => import("@testing-library/react-hooks").RenderHookResult<T, K, import("@testing-library/react-hooks").Renderer<T>>;
3
+ export * from "@testing-library/react-hooks";
4
+ export { customRenderHook as renderHook };
@@ -0,0 +1,5 @@
1
+ import { RenderOptions } from "@testing-library/react";
2
+ import * as React from "react";
3
+ declare const customRender: (ui: React.ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
4
+ export * from "@testing-library/react";
5
+ export { customRender as render };