@universal-tennis/ui-shared 0.0.1 → 0.0.3

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 (64) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +66 -80
  3. package/.storybook/main.js +6 -6
  4. package/.storybook/preview.js +3 -1
  5. package/.storybook/variables.css +9 -0
  6. package/README.md +95 -8
  7. package/dist/App.d.ts +2 -2
  8. package/dist/App.js +12 -10
  9. package/dist/App.js.map +1 -1
  10. package/dist/components.d.ts +1 -0
  11. package/dist/components.js +4 -1
  12. package/dist/components.js.map +1 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +12 -12
  15. package/dist/items.d.ts +2 -2
  16. package/dist/items.js +1 -1
  17. package/dist/stories/atoms/Button.d.ts +7 -0
  18. package/dist/stories/atoms/Button.js +58 -0
  19. package/dist/stories/atoms/Button.js.map +1 -0
  20. package/dist/stories/atoms/Button.stories.d.ts +14 -0
  21. package/dist/stories/atoms/Button.stories.js +27 -0
  22. package/dist/stories/atoms/Button.stories.js.map +1 -0
  23. package/package.json +17 -9
  24. package/src/App.js +5 -2
  25. package/src/components.jsx +5 -1
  26. package/src/custom.d.ts +13 -13
  27. package/src/items.jsx +1 -1
  28. package/src/stories/Introduction.stories.mdx +21 -52
  29. package/src/stories/atoms/Button.stories.tsx +37 -0
  30. package/src/stories/atoms/Button.tsx +74 -0
  31. package/tsconfig.json +24 -23
  32. package/workflows/package-release-1.yml +31 -0
  33. package/workflows/package-release.yml +22 -22
  34. package/dist/stories/Button.d.ts +0 -27
  35. package/dist/stories/Button.js +0 -51
  36. package/dist/stories/Button.js.map +0 -1
  37. package/dist/stories/Button.stories.d.ts +0 -15
  38. package/dist/stories/Button.stories.js +0 -34
  39. package/dist/stories/Button.stories.js.map +0 -1
  40. package/dist/stories/Header.d.ts +0 -19
  41. package/dist/stories/Header.js +0 -31
  42. package/dist/stories/Header.js.map +0 -1
  43. package/dist/stories/Header.stories.d.ts +0 -11
  44. package/dist/stories/Header.stories.js +0 -20
  45. package/dist/stories/Header.stories.js.map +0 -1
  46. package/dist/stories/Page.d.ts +0 -1
  47. package/dist/stories/Page.js +0 -38
  48. package/dist/stories/Page.js.map +0 -1
  49. package/dist/stories/Page.stories.d.ts +0 -11
  50. package/dist/stories/Page.stories.js +0 -30
  51. package/dist/stories/Page.stories.js.map +0 -1
  52. package/dist/stories/assets/comments.svg +0 -1
  53. package/dist/stories/assets/direction.svg +0 -1
  54. package/src/stories/Button.jsx +0 -50
  55. package/src/stories/Button.stories.jsx +0 -40
  56. package/src/stories/Header.jsx +0 -57
  57. package/src/stories/Header.stories.jsx +0 -24
  58. package/src/stories/Page.jsx +0 -69
  59. package/src/stories/Page.stories.jsx +0 -25
  60. package/src/stories/assets/comments.svg +0 -1
  61. package/src/stories/assets/direction.svg +0 -1
  62. package/src/stories/button.css +0 -30
  63. package/src/stories/header.css +0 -32
  64. package/src/stories/page.css +0 -69
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ !.storybook
package/.eslintrc.js CHANGED
@@ -1,80 +1,66 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true,
5
- },
6
- extends: [
7
- 'plugin:react/recommended',
8
- 'airbnb',
9
- 'plugin:storybook/recommended',
10
- 'plugin:@typescript-eslint/recommended'
11
- ],
12
- parser: "@typescript-eslint/parser",
13
- parserOptions: {
14
- ecmaFeatures: {
15
- jsx: true,
16
- },
17
- ecmaVersion: 12,
18
- sourceType: 'module',
19
- },
20
- plugins: [
21
- 'react',
22
- '@typescript-eslint',
23
- ],
24
- rules: {
25
- 'react/prop-types': 0,
26
- radix: 0,
27
- 'no-shadow': 0,
28
- 'prefer-rest-params': 0,
29
- 'no-case-declarations': 0,
30
- 'import/extensions': 0,
31
- 'react/react-in-jsx-scope': 0,
32
- 'react/no-children-prop': 0,
33
- 'import/no-unresolved': 0,
34
- 'no-use-before-define': 0,
35
- 'import/prefer-default-export': 0,
36
- 'react/jsx-filename-extension': 0,
37
- 'react/no-array-index-key': 0,
38
- '@typescript-eslint/no-empty-function': 0,
39
- 'import/no-named-as-default': 0,
40
- 'react/jsx-indent': 0,
41
- 'object-curly-spacing': 0,
42
- 'react/jsx-props-no-spreading': 0,
43
- 'no-nested-ternary': 0,
44
- 'no-plusplus': 0,
45
- 'consistent-return': 0,
46
- 'no-param-reassign': 0,
47
- 'no-await-in-loop': 0,
48
- 'no-return-await': 0,
49
- 'import/named': 0,
50
- 'no-console': 0,
51
- 'import/no-named-as-default-member': 0,
52
- 'linebreak-style': 0,
53
- 'no-unused-vars': 0,
54
- 'react/no-unstable-nested-components': 0,
55
- 'jsx-a11y/click-events-have-key-events': 0,
56
- 'no-extraneous-dependencies': 0,
57
- 'require-default-props': 0,
58
- 'comma-dangle': 0,
59
- 'no-trailing-spaces': 0,
60
- 'react/require-default-props': 0,
61
- '@typescript-eslint/ban-ts-comment': 0,
62
- quotes: 0,
63
- },
64
- settings: {
65
- "import/resolver": {
66
- typescript: {
67
- node: {
68
- extensions: [
69
- ".js",
70
- ".ts"
71
- ],
72
- moduleDirectory: [
73
- "node_modules",
74
- "src"
75
- ]
76
- }
77
- }
78
- }
79
- }
80
- };
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true
5
+ },
6
+ extends: ['plugin:react/recommended', 'airbnb', 'plugin:storybook/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:storybook/recommended'],
7
+ parser: "@typescript-eslint/parser",
8
+ parserOptions: {
9
+ ecmaFeatures: {
10
+ jsx: true
11
+ },
12
+ ecmaVersion: 12,
13
+ sourceType: 'module'
14
+ },
15
+ plugins: ['react', '@typescript-eslint'],
16
+ rules: {
17
+ 'react/prop-types': 0,
18
+ radix: 0,
19
+ 'no-shadow': 0,
20
+ 'prefer-rest-params': 0,
21
+ 'no-case-declarations': 0,
22
+ 'import/extensions': 0,
23
+ 'react/react-in-jsx-scope': 0,
24
+ 'react/no-children-prop': 0,
25
+ 'import/no-unresolved': 0,
26
+ 'no-use-before-define': 0,
27
+ 'import/prefer-default-export': 0,
28
+ 'react/jsx-filename-extension': 0,
29
+ 'react/no-array-index-key': 0,
30
+ '@typescript-eslint/no-empty-function': 0,
31
+ 'import/no-named-as-default': 0,
32
+ 'react/jsx-indent': 0,
33
+ 'object-curly-spacing': 0,
34
+ 'react/jsx-props-no-spreading': 0,
35
+ 'no-nested-ternary': 0,
36
+ 'no-plusplus': 0,
37
+ 'consistent-return': 0,
38
+ 'no-param-reassign': 0,
39
+ 'no-await-in-loop': 0,
40
+ 'no-return-await': 0,
41
+ 'import/named': 0,
42
+ 'no-console': 0,
43
+ 'import/no-named-as-default-member': 0,
44
+ 'linebreak-style': 0,
45
+ 'no-unused-vars': 0,
46
+ 'react/no-unstable-nested-components': 0,
47
+ 'jsx-a11y/click-events-have-key-events': 0,
48
+ 'no-extraneous-dependencies': 0,
49
+ 'require-default-props': 0,
50
+ 'comma-dangle': 0,
51
+ 'no-trailing-spaces': 0,
52
+ 'react/require-default-props': 0,
53
+ '@typescript-eslint/ban-ts-comment': 0,
54
+ quotes: 0
55
+ },
56
+ settings: {
57
+ "import/resolver": {
58
+ typescript: {
59
+ node: {
60
+ extensions: [".js", ".ts"],
61
+ moduleDirectory: ["node_modules", "src"]
62
+ }
63
+ }
64
+ }
65
+ }
66
+ };
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
- "stories": [
2
+ stories: [
3
3
  "../src/**/*.stories.mdx",
4
4
  "../src/**/*.stories.@(js|jsx|ts|tsx)"
5
5
  ],
6
- "addons": [
6
+ addons: [
7
7
  "@storybook/addon-links",
8
8
  "@storybook/addon-essentials",
9
9
  "@storybook/addon-interactions",
10
10
  "@storybook/preset-create-react-app"
11
11
  ],
12
- "framework": "@storybook/react",
13
- "core": {
14
- "builder": "@storybook/builder-webpack5"
12
+ framework: "@storybook/react",
13
+ core: {
14
+ builder: "@storybook/builder-webpack5"
15
15
  }
16
- }
16
+ };
@@ -1,3 +1,5 @@
1
+ import "./variables.css";
2
+
1
3
  export const parameters = {
2
4
  actions: { argTypesRegex: "^on[A-Z].*" },
3
5
  controls: {
@@ -6,4 +8,4 @@ export const parameters = {
6
8
  date: /Date$/,
7
9
  },
8
10
  },
9
- }
11
+ };
@@ -0,0 +1,9 @@
1
+ :root {
2
+ --primary: #008ded;
3
+ --secondary: #e0004f;
4
+ --disabled: #bac6d6;
5
+ --black: #000;
6
+ --white: #fff;
7
+ --light-grey: #d7e0ea;
8
+ --darkest-grey: #3b4859;
9
+ }
package/README.md CHANGED
@@ -1,15 +1,102 @@
1
- # Getting Started with Create React App
1
+ # UI-Shared
2
2
 
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
3
+ This repo was created to help organize components across the UT ecosystem; following specific design rules:
4
4
 
5
- ## Available Scripts
5
+ **Stack:**
6
+ <br />
7
+ - React (18.2.0)
8
+ <br />
9
+ - TypeScript
10
+ <br />
11
+ - [MUI](https://mui.com/)
12
+ <br />
13
+ - Styled-Components (as part of MUI)
14
+
15
+ ## Design rules
16
+
17
+ #### Components following material and atomic design rules;
18
+
19
+
20
+ 1. Standard naming components; with primary/secondary/etc variations. Keeping variations minimal and purposeful.
21
+ <br />
22
+ <br />
23
+
24
+ **Example:**
25
+ ```
26
+ <Button type="primary" />
27
+ <Button type="secondary" />
28
+ ```
29
+ <br />
30
+ **NOT**
31
+ ```
32
+ <Button type="team-page-button" />
33
+ <Button type="home-page-button" />
34
+ ```
35
+ <br />
36
+ <br />
37
+
38
+ Buttons should be uniform across the platforms with minimal variants, not multiple buttons created for each pages.
39
+
40
+ <br />
41
+ 2. Components broken into their smallest parts, atoms, then built up from there.
42
+ <br />
43
+ <br />
44
+ **Example:**
45
+ ```
46
+ <Card> // Molecule
47
+ <Typography> // Atom
48
+ Sample Header
49
+ </Typography>
50
+ <Button> // Atom
51
+ Sample Button
52
+ </Button>
53
+ </Card>
54
+ ```
55
+ <br />
56
+ <br />
57
+ A component that uses these cards in combination with other components would be considered an organism.
6
58
 
7
- In the project directory, you can run:
59
+ <br />
60
+ 3. Components should all be "dumb" components - keeping only local state or logic specific to the component, minimizing side effects.
61
+ <br />
62
+ [Functional Programming - Side Effects](https://www.yld.io/blog/the-not-so-scary-guide-to-functional-programming/#:~:text=A%20side%20effect%20is%20when,described%20as%20having%20side%20effects.)
8
63
 
9
- ### `npm start`
64
+ <br />
65
+ 4. Common colors, BBM sizing, common functionality are standardized in the same way we write components.
66
+ <br />
67
+ <br />
68
+ **Example:**
69
+ <br />
70
+ - "Primary"/ "secondary" vs "Team-card-header-blue-color" - minimzing number of color variations.
71
+
72
+ <br />
73
+ *To read more:*
74
+ <br />
75
+ [Material design rules](https://m2.material.io/design/color/the-color-system.html)
76
+ <br />
77
+ [Atomic Design](https://bradfrost.com/blog/post/atomic-web-design/)
78
+
79
+
80
+ ## Publishing the Repo
81
+
82
+ 1. First when creating a new component, make sure to add it to the `components.jsx` file.
83
+ 2. Then Run `yarn run publish:npm` to build a optimized build for all the components, this is configured for TS.
84
+ 3. In the `package.json` file, make sure to pump to the next minor version.
85
+ 4. Finally `yarn run publish-package` to deploy this version to NPM.
86
+
87
+ It can now be accessed in another repo like this:
88
+ <br />
89
+ `import {Button} from "@universal-tennis/ui-shared";`
90
+
91
+
92
+ ## Available Scripts
10
93
 
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
94
+ ### `npm start` using npm 16.14.0
13
95
 
14
- The page will reload when you make changes.\
96
+ Runs the storybook app in localhost.
97
+ <br />
98
+ Open [http://localhost:6006](http://localhost:6006) to view storybook in your browser.
99
+ <br />
100
+ The page will reload when you make changes.
101
+ <br />
15
102
  You may also see any lint errors in the console.
package/dist/App.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export default App;
2
- declare function App(): JSX.Element;
1
+ export default App;
2
+ declare function App(): JSX.Element;
package/dist/App.js CHANGED
@@ -1,11 +1,13 @@
1
- function App() {
2
- return (React.createElement("div", { className: "App" },
3
- React.createElement("header", { className: "App-header" },
4
- React.createElement("p", null,
5
- "Edit ",
6
- React.createElement("code", null, "src/App.js"),
7
- " and save to reload."),
8
- React.createElement("a", { className: "App-link", href: "https://reactjs.org", target: "_blank", rel: "noopener noreferrer" }, "Learn React"))));
9
- }
10
- export default App;
1
+ function App() {
2
+ return (React.createElement("div", { className: "App" },
3
+ React.createElement("header", { className: "App-header" },
4
+ React.createElement("p", null,
5
+ "Edit",
6
+ ' ',
7
+ React.createElement("code", null, "src/App.js"),
8
+ ' ',
9
+ "and save to reload."),
10
+ React.createElement("a", { className: "App-link", href: "https://reactjs.org", target: "_blank", rel: "noopener noreferrer" }, "Learn React"))));
11
+ }
12
+ export default App;
11
13
  //# sourceMappingURL=App.js.map
package/dist/App.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.js"],"names":[],"mappings":"AACA,SAAS,GAAG;IACV,OAAO,CACL,6BAAK,SAAS,EAAC,KAAK;QAClB,gCAAQ,SAAS,EAAC,YAAY;YAC5B;;gBACO,+CAAuB;uCAC1B;YACJ,2BACE,SAAS,EAAC,UAAU,EACpB,IAAI,EAAC,qBAAqB,EAC1B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,kBAGvB,CACG,CACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.js"],"names":[],"mappings":"AAAA,SAAS,GAAG;IACV,OAAO,CACL,6BAAK,SAAS,EAAC,KAAK;QAClB,gCAAQ,SAAS,EAAC,YAAY;YAC5B;;gBAEP,GAAG;gBACJ,+CAAuB;gBACtB,GAAG;sCAEQ;YACJ,2BACE,SAAS,EAAC,UAAU,EACpB,IAAI,EAAC,qBAAqB,EAC1B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,kBAGvB,CACG,CACL,CACP,CAAC;AACJ,CAAC;AAED,eAAe,GAAG,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,5 @@
1
- // add components here
1
+ // ATOMS
2
+ export { default as Button } from './stories/atoms/Button';
3
+ // MOLECULES
4
+ // ORGANISMS
2
5
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,sBAAsB"}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE3D,YAAY;AACZ,aAAa"}
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import './index.css';
4
- import App from './App';
5
- import reportWebVitals from './reportWebVitals';
6
- const root = ReactDOM.createRoot(document.getElementById('root'));
7
- root.render(React.createElement(React.StrictMode, null,
8
- React.createElement(App, null)));
9
- // If you want to start measuring performance in your app, pass a function
10
- // to log results (for example: reportWebVitals(console.log))
11
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
12
- reportWebVitals();
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import './index.css';
4
+ import App from './App';
5
+ import reportWebVitals from './reportWebVitals';
6
+ const root = ReactDOM.createRoot(document.getElementById('root'));
7
+ root.render(React.createElement(React.StrictMode, null,
8
+ React.createElement(App, null)));
9
+ // If you want to start measuring performance in your app, pass a function
10
+ // to log results (for example: reportWebVitals(console.log))
11
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
12
+ reportWebVitals();
13
13
  //# sourceMappingURL=index.js.map
package/dist/items.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _exports: any;
2
- export = _exports;
1
+ declare const _exports: typeof import("./components");
2
+ export = _exports;
package/dist/items.js CHANGED
@@ -1,2 +1,2 @@
1
- module.exports = require('./components');
1
+ module.exports = require('./components');
2
2
  //# sourceMappingURL=items.js.map
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ type ButtonProps = {
3
+ children: string | ReactElement;
4
+ category?: string;
5
+ };
6
+ export declare function Button({ children, category, ...props }: ButtonProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,58 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import MuiButton from '@mui/material/Button';
14
+ import { styled } from '@mui/material/styles';
15
+ const StyledButton = styled(MuiButton)({
16
+ borderRadius: '24px',
17
+ fontSize: '12px',
18
+ padding: '0 24px',
19
+ height: '40px',
20
+ whiteSpace: 'nowrap',
21
+ lineHeight: '39px',
22
+ border: '1px solid transparent'
23
+ });
24
+ const PrimaryButton = styled(StyledButton)({
25
+ backgroundColor: 'var(--black)',
26
+ color: 'var(--white)',
27
+ '&:hover': {
28
+ backgroundColor: 'var(--darkest-grey)',
29
+ borderColor: 'var(--darkest-grey)',
30
+ },
31
+ '&:disabled': {
32
+ backgroundColor: 'var(--lightest-grey)',
33
+ borderColor: 'var(--lightest-grey)',
34
+ },
35
+ });
36
+ const SecondaryButton = styled(StyledButton)({
37
+ borderColor: 'var(--black)',
38
+ backgroundColor: 'transparent',
39
+ color: 'var(--black)',
40
+ '&:hover': {
41
+ borderColor: 'var(--darkest-grey)',
42
+ },
43
+ '&:disabled': {
44
+ borderColor: 'var(--disabled)'
45
+ },
46
+ });
47
+ export function Button(_a) {
48
+ var { children, category } = _a, props = __rest(_a, ["children", "category"]);
49
+ switch (category) {
50
+ case 'primary':
51
+ return (React.createElement(PrimaryButton, Object.assign({}, props), children));
52
+ case 'secondary':
53
+ return (React.createElement(SecondaryButton, Object.assign({}, props), children));
54
+ default:
55
+ return (React.createElement(StyledButton, Object.assign({}, props), children));
56
+ }
57
+ }
58
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/stories/atoms/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAO9C,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,uBAAuB;CAChC,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACzC,eAAe,EAAE,cAAc;IAC/B,KAAK,EAAE,cAAc;IAErB,SAAS,EAAE;QACT,eAAe,EAAE,qBAAqB;QACtC,WAAW,EAAE,qBAAqB;KACnC;IACD,YAAY,EAAE;QACZ,eAAe,EAAE,sBAAsB;QACvC,WAAW,EAAE,sBAAsB;KACpC;CACF,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3C,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,aAAa;IAC9B,KAAK,EAAE,cAAc;IAErB,SAAS,EAAE;QACT,WAAW,EAAE,qBAAqB;KACnC;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,iBAAiB;KAC/B;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,MAAM,CAAC,EAA6C;QAA7C,EAAE,QAAQ,EAAE,QAAQ,OAAyB,EAApB,KAAK,cAA9B,wBAAgC,CAAF;IACnD,QAAQ,QAAQ,EAAE;QAChB,KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,aAAa,oBACR,KAAK,GAER,QAAQ,CACK,CACjB,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,CACL,oBAAC,eAAe,oBACV,KAAK,GAER,QAAQ,CACO,CACnB,CAAC;QACJ;YACE,OAAO,CACH,oBAAC,YAAY,oBACP,KAAK,GAEV,QAAQ,CACM,CAClB,CAAC;KACL;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Button } from './Button';
2
+ declare const _default: {
3
+ title: string;
4
+ component: typeof Button;
5
+ argTypes: {
6
+ backgroundColor: {
7
+ control: string;
8
+ };
9
+ };
10
+ };
11
+ export default _default;
12
+ export declare const Primary: any;
13
+ export declare const Secondary: any;
14
+ export declare const Default: any;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { Button } from './Button';
3
+ export default {
4
+ title: 'Atoms/Button',
5
+ component: Button,
6
+ argTypes: {
7
+ backgroundColor: { control: 'color' },
8
+ },
9
+ };
10
+ function Template(args) {
11
+ return React.createElement(Button, Object.assign({}, args));
12
+ }
13
+ export const Primary = Template.bind({});
14
+ Primary.args = {
15
+ category: "primary",
16
+ children: 'Button',
17
+ };
18
+ export const Secondary = Template.bind({});
19
+ Secondary.args = {
20
+ category: "secondary",
21
+ children: 'Button',
22
+ };
23
+ export const Default = Template.bind({});
24
+ Default.args = {
25
+ children: 'Button',
26
+ };
27
+ //# sourceMappingURL=Button.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../src/stories/atoms/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KACtC;CACF,CAAC;AAEF,SAAS,QAAQ,CAAC,IAAW;IAC3B,OAAO,oBAAC,MAAM,oBAAK,IAAI,EAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,QAAQ;CACnB,CAAC"}
package/package.json CHANGED
@@ -1,28 +1,26 @@
1
1
  {
2
2
  "name": "@universal-tennis/ui-shared",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "main": "dist/items.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://universaltennis.com",
7
7
  "dependencies": {
8
- "@testing-library/jest-dom": "^5.16.5",
9
- "@testing-library/react": "^13.4.0",
10
- "@testing-library/user-event": "^13.5.0",
8
+ "@emotion/react": "^11.10.5",
9
+ "@emotion/styled": "^11.10.5",
10
+ "@mui/material": "^5.10.15",
11
11
  "copyfiles": "^2.4.1",
12
12
  "cross-env": "^7.0.3",
13
13
  "react": "^18.2.0",
14
14
  "react-dom": "^18.2.0",
15
15
  "react-scripts": "5.0.1",
16
+ "typescript": "^4.9.3",
16
17
  "web-vitals": "^2.1.4"
17
18
  },
18
19
  "scripts": {
19
- "start": "react-scripts start",
20
- "build": "react-scripts build",
21
- "test": "react-scripts test",
22
- "eject": "react-scripts eject",
23
- "storybook": "start-storybook -p 6006 -s public",
20
+ "start": "start-storybook -p 6006 -s public",
24
21
  "build-storybook": "build-storybook -s public",
25
22
  "publish:npm": "tsc && yarn copy-files",
23
+ "publish-package": "npm publish --access public",
26
24
  "copy-files": "copyfiles -u 1 src/stories/assets/*.svg src/stories/assets/*.png src/stories/assets/*.gif src/stories/assets/css/*.css dist/",
27
25
  "eslint": "npx eslint --ext .jsx,.js src --fix"
28
26
  },
@@ -65,7 +63,17 @@
65
63
  "@storybook/preset-create-react-app": "^4.1.2",
66
64
  "@storybook/react": "^6.5.13",
67
65
  "@storybook/testing-library": "^0.0.13",
66
+ "@types/babel__core": "^7.1.20",
67
+ "@types/react": "^18.0.25",
68
68
  "babel-plugin-named-exports-order": "^0.0.2",
69
+ "eslint": "^8.28.0",
70
+ "eslint-config-airbnb": "^19.0.4",
71
+ "eslint-import-resolver-typescript": "^3.5.2",
72
+ "eslint-plugin-import": "^2.25.3",
73
+ "eslint-plugin-jsx-a11y": "^6.5.1",
74
+ "eslint-plugin-react": "^7.28.0",
75
+ "eslint-plugin-react-hooks": "^4.3.0",
76
+ "eslint-plugin-storybook": "^0.6.7",
69
77
  "prop-types": "^15.8.1",
70
78
  "webpack": "^5.75.0"
71
79
  },
package/src/App.js CHANGED
@@ -1,10 +1,13 @@
1
-
2
1
  function App() {
3
2
  return (
4
3
  <div className="App">
5
4
  <header className="App-header">
6
5
  <p>
7
- Edit <code>src/App.js</code> and save to reload.
6
+ Edit
7
+ {' '}
8
+ <code>src/App.js</code>
9
+ {' '}
10
+ and save to reload.
8
11
  </p>
9
12
  <a
10
13
  className="App-link"
@@ -1 +1,5 @@
1
- // add components here
1
+ // ATOMS
2
+ export { default as Button } from './stories/atoms/Button';
3
+
4
+ // MOLECULES
5
+ // ORGANISMS
package/src/custom.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- declare module '*.jpg';
2
- declare module '*.png';
3
- declare module '*.woff2';
4
- declare module '*.woff';
5
- declare module '*.ttf';
6
-
7
- declare module '*.svg' {
8
- import React = require('react');
9
-
10
- export const ReactComponent: React.SFC<React.SVGProps<SVGSVGElement>>;
11
- const src: string;
12
- export default src;
13
- }
1
+ declare module '*.jpg';
2
+ declare module '*.png';
3
+ declare module '*.woff2';
4
+ declare module '*.woff';
5
+ declare module '*.ttf';
6
+
7
+ declare module '*.svg' {
8
+ import React = require('react');
9
+
10
+ export const ReactComponent: React.SFC<React.SVGProps<SVGSVGElement>>;
11
+ const src: string;
12
+ export default src;
13
+ }
package/src/items.jsx CHANGED
@@ -1 +1 @@
1
- module.exports = require('./components');
1
+ module.exports = require('./components');