@trackunit/react-components 0.0.46 → 0.0.49

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 CHANGED
@@ -1,36 +1,18 @@
1
- # React components
1
+ # Trackunit React Components
2
+ The `@trackunit/react-components` package is the home of Trackunits public UI library.
2
3
 
3
- The React Components library should be the home for reuseable React components in the manager.
4
- This library is (going to be) exposed publibly and should therfore be treated accordingly.
4
+ This library is exposed publicly for use in the the Trackunit [Iris App SDK](https://www.npmjs.com/package/@trackunit/iris-app).
5
5
 
6
- ### Component generation command example
7
- `yarn nx workspace-generator react-component MyTestComponent --directory=components --project=react-components --no-interactive`
6
+ To browse all avaliable components visit our [Public Storybook](https://developers.trackunit.com/page/ui-components).
8
7
 
9
- ## Rules for this library
10
- _Not all current components lives up the these standards but any new component should_
11
- _We are working on updating all existing components_
8
+ For more info and a full guide on Iris App SDK Development, please visit our [Developer Hub](https://developers.trackunit.com/).
12
9
 
13
- All Components in this lib:
14
- - Must be exposed in our storybook.
15
- - Must have sufficient test coverage.
16
- - Must extend CommonProps (Have ClassName and DataTestId).
17
- - Must expose their styles in a .css file using @apply and be exposed in our css-components library.
18
- - Should be reviewed by @patr2275.
19
- - May only depend on other Buildable, Publishable and visibility:public tagged libs.
10
+ ## Development
11
+ At this point this library is only developed by Trackunit Employees.
12
+ For development related information see the [development readme](https://github.com/Trackunit/manager/blob/master/libs/react/components/DEVELOPMENT.md).
20
13
 
21
- ## Stories for components
14
+ ## Trackunit
15
+ This package was developed by Trackunit ApS.
16
+ Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
22
17
 
23
- **Component.stories.tsx**
24
- Used for holding the code for the individual stories and configuring the story parameters.
25
- Keeping these in the .tsx file allows for Typescript and auto completion.
26
-
27
- Prefixing a story with Hidden removes it form the sidebar navigation, but they can still be referenced in the docs mdx.
28
-
29
- **Component.docs.mdx**
30
- Handles the layout of the docs page shown in storybook.
31
- References stories from the tsx file.
32
-
33
- ## TODO:
34
- 1. Update Introduction and Fundamentals documentation.
35
- 2. Enable docs autogen to generate props and controls from typescript and jsdocs.
36
- 3. Update stories on existing components and move them away from Legacy Components.
18
+ ![The Trackunit logo](https://trackunit.com/wp-content/uploads/2022/03/top-logo.svg)
@@ -51,5 +51,9 @@ export interface ButtonProps extends ButtonCommonProps {
51
51
  * @memberof ButtonProps
52
52
  */
53
53
  renderAs?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
54
+ /**
55
+ * The Id of the form to submit, for button type submit
56
+ */
57
+ form?: string;
54
58
  }
55
59
  export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
package/index.js CHANGED
@@ -85,7 +85,7 @@ const Spinner = ({
85
85
  "$centered": centered,
86
86
  className: containerClassName
87
87
  }, {
88
- children: jsx(StyledSpinner, {
88
+ children: jsx(StyledSpinner$1, {
89
89
  "$size": size,
90
90
  "$mode": mode,
91
91
  role: "spinbutton",
@@ -111,7 +111,7 @@ const getSpinnerStyles = () => ({
111
111
  }
112
112
  };
113
113
 
114
- const StyledSpinner = tw.span`
114
+ const StyledSpinner$1 = tw.span`
115
115
  spinner
116
116
  ${p => p.$mode === "dark" ? tws`spinner--dark` : null}
117
117
  ${getSpinnerStyles()}
@@ -199,7 +199,7 @@ const Button = React.forwardRef((_a, ref) => {
199
199
  "data-testid": dataTestId,
200
200
  ref: ref
201
201
  }, rest, {
202
- children: [loading && jsx(Spinner, {
202
+ children: [loading && jsx(StyledSpinner, {
203
203
  centered: true
204
204
  }), prefix, children, suffix]
205
205
  }));
@@ -211,6 +211,9 @@ const StyledButton$1 = tw.button`
211
211
  ${getStyles()}
212
212
  ${getPadding()}
213
213
  `;
214
+ const StyledSpinner = tw(Spinner)`
215
+ button__spinner
216
+ `;
214
217
  Button.displayName = "Button";
215
218
 
216
219
  const IconButton = React.forwardRef((_a, ref) => {
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.46",
3
+ "version": "0.0.49",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "@trackunit/css-core": "0.0.38",
8
- "@trackunit/tailwind-styled-components": "0.0.36",
7
+ "@trackunit/css-core": "0.0.39",
8
+ "@trackunit/tailwind-styled-components": "0.0.37",
9
9
  "react": "17.0.1",
10
- "@trackunit/ui-design-tokens": "0.0.35",
10
+ "@trackunit/ui-design-tokens": "0.0.36",
11
11
  "echarts-for-react": "^3.0.2",
12
12
  "uuid": "^8.3.2",
13
13
  "@react-spring/web": "^9.4.4",
14
14
  "react-use": "^17.3.2",
15
15
  "react-day-picker": "^8.0.3",
16
16
  "date-fns": "^2.28.0",
17
- "@trackunit/ui-icons": "0.0.35",
17
+ "@trackunit/ui-icons": "0.0.36",
18
18
  "react-useportal": "^1.0.16",
19
19
  "react-helmet": "^6.1.0",
20
20
  "@popperjs/core": "^2.11.4",