@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.
- package/.eslintignore +1 -0
- package/.eslintrc.js +66 -80
- package/.storybook/main.js +6 -6
- package/.storybook/preview.js +3 -1
- package/.storybook/variables.css +9 -0
- package/README.md +95 -8
- package/dist/App.d.ts +2 -2
- package/dist/App.js +12 -10
- package/dist/App.js.map +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.js +4 -1
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/items.d.ts +2 -2
- package/dist/items.js +1 -1
- package/dist/stories/atoms/Button.d.ts +7 -0
- package/dist/stories/atoms/Button.js +58 -0
- package/dist/stories/atoms/Button.js.map +1 -0
- package/dist/stories/atoms/Button.stories.d.ts +14 -0
- package/dist/stories/atoms/Button.stories.js +27 -0
- package/dist/stories/atoms/Button.stories.js.map +1 -0
- package/package.json +17 -9
- package/src/App.js +5 -2
- package/src/components.jsx +5 -1
- package/src/custom.d.ts +13 -13
- package/src/items.jsx +1 -1
- package/src/stories/Introduction.stories.mdx +21 -52
- package/src/stories/atoms/Button.stories.tsx +37 -0
- package/src/stories/atoms/Button.tsx +74 -0
- package/tsconfig.json +24 -23
- package/workflows/package-release-1.yml +31 -0
- package/workflows/package-release.yml +22 -22
- package/dist/stories/Button.d.ts +0 -27
- package/dist/stories/Button.js +0 -51
- package/dist/stories/Button.js.map +0 -1
- package/dist/stories/Button.stories.d.ts +0 -15
- package/dist/stories/Button.stories.js +0 -34
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/Header.d.ts +0 -19
- package/dist/stories/Header.js +0 -31
- package/dist/stories/Header.js.map +0 -1
- package/dist/stories/Header.stories.d.ts +0 -11
- package/dist/stories/Header.stories.js +0 -20
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/Page.d.ts +0 -1
- package/dist/stories/Page.js +0 -38
- package/dist/stories/Page.js.map +0 -1
- package/dist/stories/Page.stories.d.ts +0 -11
- package/dist/stories/Page.stories.js +0 -30
- package/dist/stories/Page.stories.js.map +0 -1
- package/dist/stories/assets/comments.svg +0 -1
- package/dist/stories/assets/direction.svg +0 -1
- package/src/stories/Button.jsx +0 -50
- package/src/stories/Button.stories.jsx +0 -40
- package/src/stories/Header.jsx +0 -57
- package/src/stories/Header.stories.jsx +0 -24
- package/src/stories/Page.jsx +0 -69
- package/src/stories/Page.stories.jsx +0 -25
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- 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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'no-
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'react/
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'no-
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'no-
|
|
47
|
-
'
|
|
48
|
-
'no-
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
};
|
package/.storybook/main.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
2
|
+
stories: [
|
|
3
3
|
"../src/**/*.stories.mdx",
|
|
4
4
|
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
|
5
5
|
],
|
|
6
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
framework: "@storybook/react",
|
|
13
|
+
core: {
|
|
14
|
+
builder: "@storybook/builder-webpack5"
|
|
15
15
|
}
|
|
16
|
-
}
|
|
16
|
+
};
|
package/.storybook/preview.js
CHANGED
package/README.md
CHANGED
|
@@ -1,15 +1,102 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UI-Shared
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This repo was created to help organize components across the UT ecosystem; following specific design rules:
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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":"
|
|
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"}
|
package/dist/components.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/components.js
CHANGED
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,
|
|
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:
|
|
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,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.
|
|
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
|
-
"@
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
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": "
|
|
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
|
|
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"
|
package/src/components.jsx
CHANGED
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');
|