@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
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs';
|
|
2
2
|
import Code from './assets/code-brackets.svg';
|
|
3
3
|
import Colors from './assets/colors.svg';
|
|
4
|
-
import Comments from './assets/comments.svg';
|
|
5
|
-
import Direction from './assets/direction.svg';
|
|
6
4
|
import Flow from './assets/flow.svg';
|
|
7
5
|
import Plugin from './assets/plugin.svg';
|
|
8
6
|
import Repo from './assets/repo.svg';
|
|
@@ -21,7 +19,6 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
21
19
|
line-height: 24px;
|
|
22
20
|
text-transform: uppercase;
|
|
23
21
|
margin-bottom: 12px;
|
|
24
|
-
margin-top: 40px;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
24
|
.link-list {
|
|
@@ -58,6 +55,11 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
58
55
|
align-items: flex-start;
|
|
59
56
|
}
|
|
60
57
|
|
|
58
|
+
.top-section {
|
|
59
|
+
margin-top: 52px;
|
|
60
|
+
margin-bottom: 52px;
|
|
61
|
+
}
|
|
62
|
+
|
|
61
63
|
.link-item:hover {
|
|
62
64
|
border-color: #1EA7FD50;
|
|
63
65
|
transform: translate3d(0, -3px, 0);
|
|
@@ -114,7 +116,9 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
114
116
|
`}
|
|
115
117
|
</style>
|
|
116
118
|
|
|
117
|
-
# Welcome to Storybook
|
|
119
|
+
# Welcome to Universal Tennis Storybook
|
|
120
|
+
|
|
121
|
+
This repo was created to help organize components across the UT ecosystem.
|
|
118
122
|
|
|
119
123
|
Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
120
124
|
That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
|
|
@@ -123,7 +127,17 @@ Browse example stories now by navigating to them in the sidebar.
|
|
|
123
127
|
View their code in the `stories` directory to learn how they work.
|
|
124
128
|
We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
125
129
|
|
|
126
|
-
<div className="
|
|
130
|
+
<div className="top-section">
|
|
131
|
+
<a className="link-item" href="https://bitbucket.org/universaltennis/ui-shared/src/master/" target="_blank">
|
|
132
|
+
<img src={Code} alt="code" />
|
|
133
|
+
<span>
|
|
134
|
+
<strong>UI-shared bitbucket repo</strong>
|
|
135
|
+
View code source
|
|
136
|
+
</span>
|
|
137
|
+
</a>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div className="subheading">Learn</div>
|
|
127
141
|
|
|
128
142
|
<div className="link-list">
|
|
129
143
|
<a
|
|
@@ -137,17 +151,6 @@ We recommend building UIs with a [**component-driven**](https://componentdriven.
|
|
|
137
151
|
Easy setup for TypeScript, SCSS and more.
|
|
138
152
|
</span>
|
|
139
153
|
</a>
|
|
140
|
-
<a
|
|
141
|
-
className="link-item"
|
|
142
|
-
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
143
|
-
target="_blank"
|
|
144
|
-
>
|
|
145
|
-
<img src={StackAlt} alt="Build" />
|
|
146
|
-
<span>
|
|
147
|
-
<strong>Build configuration</strong>
|
|
148
|
-
How to customize webpack and Babel
|
|
149
|
-
</span>
|
|
150
|
-
</a>
|
|
151
154
|
<a
|
|
152
155
|
className="link-item"
|
|
153
156
|
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
@@ -159,22 +162,7 @@ We recommend building UIs with a [**component-driven**](https://componentdriven.
|
|
|
159
162
|
How to load and configure CSS libraries
|
|
160
163
|
</span>
|
|
161
164
|
</a>
|
|
162
|
-
<a
|
|
163
|
-
className="link-item"
|
|
164
|
-
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
165
|
-
target="_blank"
|
|
166
|
-
>
|
|
167
|
-
<img src={Flow} alt="flow" />
|
|
168
|
-
<span>
|
|
169
|
-
<strong>Data</strong>
|
|
170
|
-
Providers and mocking for data libraries
|
|
171
|
-
</span>
|
|
172
|
-
</a>
|
|
173
|
-
</div>
|
|
174
165
|
|
|
175
|
-
<div className="subheading">Learn</div>
|
|
176
|
-
|
|
177
|
-
<div className="link-list">
|
|
178
166
|
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
|
|
179
167
|
<img src={Repo} alt="repo" />
|
|
180
168
|
<span>
|
|
@@ -182,30 +170,11 @@ We recommend building UIs with a [**component-driven**](https://componentdriven.
|
|
|
182
170
|
Configure, customize, and extend
|
|
183
171
|
</span>
|
|
184
172
|
</a>
|
|
185
|
-
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
|
|
186
|
-
<img src={Direction} alt="direction" />
|
|
187
|
-
<span>
|
|
188
|
-
<strong>In-depth guides</strong>
|
|
189
|
-
Best practices from leading teams
|
|
190
|
-
</span>
|
|
191
|
-
</a>
|
|
192
173
|
<a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
|
|
193
174
|
<img src={Code} alt="code" />
|
|
194
175
|
<span>
|
|
195
|
-
<strong>GitHub project</strong>
|
|
176
|
+
<strong>Storybook GitHub project</strong>
|
|
196
177
|
View the source and add issues
|
|
197
178
|
</span>
|
|
198
179
|
</a>
|
|
199
|
-
|
|
200
|
-
<img src={Comments} alt="comments" />
|
|
201
|
-
<span>
|
|
202
|
-
<strong>Discord chat</strong>
|
|
203
|
-
Chat with maintainers and the community
|
|
204
|
-
</span>
|
|
205
|
-
</a>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<div className="tip-wrapper">
|
|
209
|
-
<span className="tip">Tip</span>Edit the Markdown in{' '}
|
|
210
|
-
<code>stories/Introduction.stories.mdx</code>
|
|
211
|
-
</div>
|
|
180
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Button } from './Button';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
children: string;
|
|
7
|
+
category: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Atoms/Button',
|
|
12
|
+
component: Button,
|
|
13
|
+
argTypes: {
|
|
14
|
+
backgroundColor: { control: 'color' },
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function Template(args: Props) {
|
|
19
|
+
return <Button {...args} />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Primary = Template.bind({});
|
|
23
|
+
Primary.args = {
|
|
24
|
+
category: "primary",
|
|
25
|
+
children: 'Button',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Secondary = Template.bind({});
|
|
29
|
+
Secondary.args = {
|
|
30
|
+
category: "secondary",
|
|
31
|
+
children: 'Button',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Default = Template.bind({});
|
|
35
|
+
Default.args = {
|
|
36
|
+
children: 'Button',
|
|
37
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, {ReactElement} from 'react';
|
|
2
|
+
import MuiButton from '@mui/material/Button';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
|
|
5
|
+
type ButtonProps = {
|
|
6
|
+
children: string | ReactElement;
|
|
7
|
+
category?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const StyledButton = styled(MuiButton)({
|
|
11
|
+
borderRadius: '24px',
|
|
12
|
+
fontSize: '12px',
|
|
13
|
+
padding: '0 24px',
|
|
14
|
+
height: '40px',
|
|
15
|
+
whiteSpace: 'nowrap',
|
|
16
|
+
lineHeight: '39px',
|
|
17
|
+
border: '1px solid transparent'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const PrimaryButton = styled(StyledButton)({
|
|
21
|
+
backgroundColor: 'var(--black)',
|
|
22
|
+
color: 'var(--white)',
|
|
23
|
+
|
|
24
|
+
'&:hover': {
|
|
25
|
+
backgroundColor: 'var(--darkest-grey)',
|
|
26
|
+
borderColor: 'var(--darkest-grey)',
|
|
27
|
+
},
|
|
28
|
+
'&:disabled': {
|
|
29
|
+
backgroundColor: 'var(--lightest-grey)',
|
|
30
|
+
borderColor: 'var(--lightest-grey)',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const SecondaryButton = styled(StyledButton)({
|
|
35
|
+
borderColor: 'var(--black)',
|
|
36
|
+
backgroundColor: 'transparent',
|
|
37
|
+
color: 'var(--black)',
|
|
38
|
+
|
|
39
|
+
'&:hover': {
|
|
40
|
+
borderColor: 'var(--darkest-grey)',
|
|
41
|
+
},
|
|
42
|
+
'&:disabled': {
|
|
43
|
+
borderColor: 'var(--disabled)'
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export function Button({ children, category, ...props }: ButtonProps) {
|
|
48
|
+
switch (category) {
|
|
49
|
+
case 'primary':
|
|
50
|
+
return (
|
|
51
|
+
<PrimaryButton
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</PrimaryButton>
|
|
56
|
+
);
|
|
57
|
+
case 'secondary':
|
|
58
|
+
return (
|
|
59
|
+
<SecondaryButton
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</SecondaryButton>
|
|
64
|
+
);
|
|
65
|
+
default:
|
|
66
|
+
return (
|
|
67
|
+
<StyledButton
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</StyledButton>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"noImplicitThis": true,
|
|
4
|
+
"preserveConstEnums": true,
|
|
5
|
+
"strictNullChecks": true,
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"target": "es6",
|
|
11
|
+
"module": "es6",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"jsx": "react",
|
|
16
|
+
"lib": ["ES2017", "DOM"],
|
|
17
|
+
"baseUrl": "src",
|
|
18
|
+
"allowSyntheticDefaultImports": true,
|
|
19
|
+
"noImplicitAny": true
|
|
20
|
+
},
|
|
21
|
+
"exclude": [
|
|
22
|
+
"node_modules",
|
|
23
|
+
],
|
|
24
|
+
"include": ["src", "src/custom.d.ts"]
|
|
24
25
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
branches:
|
|
3
|
+
include:
|
|
4
|
+
- develop
|
|
5
|
+
|
|
6
|
+
pool:
|
|
7
|
+
vmImage: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
resources:
|
|
10
|
+
repositories:
|
|
11
|
+
- repository: Infrastructure
|
|
12
|
+
type: bitbucket
|
|
13
|
+
endpoint: ut-bitbucket
|
|
14
|
+
name: universaltennis/utr-infrastructure
|
|
15
|
+
ref: master
|
|
16
|
+
|
|
17
|
+
variables:
|
|
18
|
+
- template: /infrastructure/pipelines/shared-variables.yml@Infrastructure
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
- job: PublishNpmPackage
|
|
22
|
+
steps:
|
|
23
|
+
- template: /infrastructure/components/download-key-vault-secrets.yml@Infrastructure
|
|
24
|
+
parameters:
|
|
25
|
+
keyVaultName: $(sharedKeyVaultName)
|
|
26
|
+
- script: |
|
|
27
|
+
yarn
|
|
28
|
+
yarn run publish:npm
|
|
29
|
+
npm publish --access public
|
|
30
|
+
env:
|
|
31
|
+
NPM_TOKEN: $(NpmPublishToken)
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
name: Publish package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v3
|
|
14
|
-
- uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: 16
|
|
17
|
-
registry-url: https://npm.pkg.github.com/
|
|
18
|
-
- run: yarn
|
|
19
|
-
- run: yarn run publish:npm
|
|
20
|
-
- run: npm publish --access public
|
|
21
|
-
variables:
|
|
22
|
-
NPM_TOKEN: $NPM_TOKEN
|
|
1
|
+
name: Publish package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
- uses: actions/setup-node@v3
|
|
15
|
+
with:
|
|
16
|
+
node-version: 16
|
|
17
|
+
registry-url: https://npm.pkg.github.com/
|
|
18
|
+
- run: yarn
|
|
19
|
+
- run: yarn run publish:npm
|
|
20
|
+
- run: npm publish --access public
|
|
21
|
+
variables:
|
|
22
|
+
NPM_TOKEN: $NPM_TOKEN
|
package/dist/stories/Button.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function Button({ primary, backgroundColor, size, label, ...props }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
primary: any;
|
|
4
|
-
backgroundColor: any;
|
|
5
|
-
size: any;
|
|
6
|
-
label: any;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
export namespace Button {
|
|
9
|
-
namespace propTypes {
|
|
10
|
-
const primary: PropTypes.Requireable<boolean>;
|
|
11
|
-
const backgroundColor: PropTypes.Requireable<string>;
|
|
12
|
-
const size: PropTypes.Requireable<string>;
|
|
13
|
-
const label: PropTypes.Validator<string>;
|
|
14
|
-
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
-
}
|
|
16
|
-
namespace defaultProps {
|
|
17
|
-
const backgroundColor_1: null;
|
|
18
|
-
export { backgroundColor_1 as backgroundColor };
|
|
19
|
-
const primary_1: boolean;
|
|
20
|
-
export { primary_1 as primary };
|
|
21
|
-
const size_1: string;
|
|
22
|
-
export { size_1 as size };
|
|
23
|
-
const onClick_1: undefined;
|
|
24
|
-
export { onClick_1 as onClick };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
import PropTypes from "prop-types";
|
package/dist/stories/Button.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
14
|
-
import './button.css';
|
|
15
|
-
/**
|
|
16
|
-
* Primary UI component for user interaction
|
|
17
|
-
*/
|
|
18
|
-
export const Button = (_a) => {
|
|
19
|
-
var { primary, backgroundColor, size, label } = _a, props = __rest(_a, ["primary", "backgroundColor", "size", "label"]);
|
|
20
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
21
|
-
return (React.createElement("button", Object.assign({ type: "button", className: ['storybook-button', `storybook-button--${size}`, mode].join(' '), style: backgroundColor && { backgroundColor } }, props), label));
|
|
22
|
-
};
|
|
23
|
-
Button.propTypes = {
|
|
24
|
-
/**
|
|
25
|
-
* Is this the principal call to action on the page?
|
|
26
|
-
*/
|
|
27
|
-
primary: PropTypes.bool,
|
|
28
|
-
/**
|
|
29
|
-
* What background color to use
|
|
30
|
-
*/
|
|
31
|
-
backgroundColor: PropTypes.string,
|
|
32
|
-
/**
|
|
33
|
-
* How large should the button be?
|
|
34
|
-
*/
|
|
35
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
36
|
-
/**
|
|
37
|
-
* Button contents
|
|
38
|
-
*/
|
|
39
|
-
label: PropTypes.string.isRequired,
|
|
40
|
-
/**
|
|
41
|
-
* Optional click handler
|
|
42
|
-
*/
|
|
43
|
-
onClick: PropTypes.func,
|
|
44
|
-
};
|
|
45
|
-
Button.defaultProps = {
|
|
46
|
-
backgroundColor: null,
|
|
47
|
-
primary: false,
|
|
48
|
-
size: 'medium',
|
|
49
|
-
onClick: undefined,
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/stories/Button.jsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAmD,EAAE,EAAE;QAAvD,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,OAAY,EAAP,KAAK,cAAjD,+CAAmD,CAAF;IACtE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,6BAA6B,CAAC;IACnF,OAAO,CACL,8CACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC5E,KAAK,EAAE,eAAe,IAAI,EAAE,eAAe,EAAE,IACzC,KAAK,GAER,KAAK,CACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,SAAS,GAAG;IACjB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB;;OAEG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM;IACjC;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC,IAAI;CACxB,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG;IACpB,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,SAAS;CACnB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export const title: string;
|
|
3
|
-
export { Button as component };
|
|
4
|
-
export namespace argTypes {
|
|
5
|
-
namespace backgroundColor {
|
|
6
|
-
const control: string;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export default _default;
|
|
11
|
-
export const Primary: any;
|
|
12
|
-
export const Secondary: any;
|
|
13
|
-
export const Large: any;
|
|
14
|
-
export const Small: any;
|
|
15
|
-
import { Button } from "./Button";
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Example/Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
8
|
-
argTypes: {
|
|
9
|
-
backgroundColor: { control: 'color' },
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
|
-
const Template = (args) => React.createElement(Button, Object.assign({}, args));
|
|
14
|
-
export const Primary = Template.bind({});
|
|
15
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
16
|
-
Primary.args = {
|
|
17
|
-
primary: true,
|
|
18
|
-
label: 'Button',
|
|
19
|
-
};
|
|
20
|
-
export const Secondary = Template.bind({});
|
|
21
|
-
Secondary.args = {
|
|
22
|
-
label: 'Button',
|
|
23
|
-
};
|
|
24
|
-
export const Large = Template.bind({});
|
|
25
|
-
Large.args = {
|
|
26
|
-
size: 'large',
|
|
27
|
-
label: 'Button',
|
|
28
|
-
};
|
|
29
|
-
export const Small = Template.bind({});
|
|
30
|
-
Small.args = {
|
|
31
|
-
size: 'small',
|
|
32
|
-
label: 'Button',
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/stories/Button.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,0GAA0G;AAC1G,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,qEAAqE;IACrE,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KACtC;CACF,CAAC;AAEF,2GAA2G;AAC3G,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAC,MAAM,oBAAK,IAAI,EAAI,CAAC;AAEhD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,yEAAyE;AACzE,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACX,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,QAAQ;CAChB,CAAC"}
|
package/dist/stories/Header.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function Header({ user, onLogin, onLogout, onCreateAccount }: {
|
|
2
|
-
user: any;
|
|
3
|
-
onLogin: any;
|
|
4
|
-
onLogout: any;
|
|
5
|
-
onCreateAccount: any;
|
|
6
|
-
}): JSX.Element;
|
|
7
|
-
export namespace Header {
|
|
8
|
-
namespace propTypes {
|
|
9
|
-
const user: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
10
|
-
const onLogin: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
-
const onLogout: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
-
const onCreateAccount: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
-
}
|
|
14
|
-
namespace defaultProps {
|
|
15
|
-
const user_1: null;
|
|
16
|
-
export { user_1 as user };
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
import PropTypes from "prop-types";
|
package/dist/stories/Header.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
import './header.css';
|
|
5
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (React.createElement("header", null,
|
|
6
|
-
React.createElement("div", { className: "wrapper" },
|
|
7
|
-
React.createElement("div", null,
|
|
8
|
-
React.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
10
|
-
React.createElement("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }),
|
|
11
|
-
React.createElement("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }),
|
|
12
|
-
React.createElement("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" }))),
|
|
13
|
-
React.createElement("h1", null, "Acme")),
|
|
14
|
-
React.createElement("div", null, user ? (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement("span", { className: "welcome" },
|
|
16
|
-
"Welcome, ",
|
|
17
|
-
React.createElement("b", null, user.name),
|
|
18
|
-
"!"),
|
|
19
|
-
React.createElement(Button, { size: "small", onClick: onLogout, label: "Log out" }))) : (React.createElement(React.Fragment, null,
|
|
20
|
-
React.createElement(Button, { size: "small", onClick: onLogin, label: "Log in" }),
|
|
21
|
-
React.createElement(Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })))))));
|
|
22
|
-
Header.propTypes = {
|
|
23
|
-
user: PropTypes.shape({}),
|
|
24
|
-
onLogin: PropTypes.func.isRequired,
|
|
25
|
-
onLogout: PropTypes.func.isRequired,
|
|
26
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
27
|
-
};
|
|
28
|
-
Header.defaultProps = {
|
|
29
|
-
user: null,
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/stories/Header.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CACtE;IACE,6BAAK,SAAS,EAAC,SAAS;QACtB;YACE,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;gBAChF,2BAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS;oBAC/B,8BACE,CAAC,EAAC,mFAAmF,EACrF,IAAI,EAAC,MAAM,GACX;oBACF,8BACE,CAAC,EAAC,kEAAkE,EACpE,IAAI,EAAC,SAAS,GACd;oBACF,8BACE,CAAC,EAAC,gEAAgE,EAClE,IAAI,EAAC,SAAS,GACd,CACA,CACA;YACN,uCAAa,CACT;QACN,iCACG,IAAI,CAAC,CAAC,CAAC,CACN;YACE,8BAAM,SAAS,EAAC,SAAS;;gBACd,+BAAI,IAAI,CAAC,IAAI,CAAK;oBACtB;YACP,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,SAAS,GAAG,CACzD,CACJ,CAAC,CAAC,CAAC,CACF;YACE,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,QAAQ,GAAG;YACxD,oBAAC,MAAM,IAAC,OAAO,QAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAC,SAAS,GAAG,CACxE,CACJ,CACG,CACF,CACC,CACV,CAAC;AAEF,MAAM,CAAC,SAAS,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAClC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,eAAe,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAC3C,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG;IACpB,IAAI,EAAE,IAAI;CACX,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export const title: string;
|
|
3
|
-
export { Header as component };
|
|
4
|
-
export namespace parameters {
|
|
5
|
-
const layout: string;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export default _default;
|
|
9
|
-
export const LoggedIn: any;
|
|
10
|
-
export const LoggedOut: any;
|
|
11
|
-
import { Header } from "./Header";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
parameters: {
|
|
7
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
const Template = (args) => React.createElement(Header, Object.assign({}, args));
|
|
12
|
-
export const LoggedIn = Template.bind({});
|
|
13
|
-
LoggedIn.args = {
|
|
14
|
-
user: {
|
|
15
|
-
name: 'Jane Doe',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export const LoggedOut = Template.bind({});
|
|
19
|
-
LoggedOut.args = {};
|
|
20
|
-
//# sourceMappingURL=Header.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.stories.js","sourceRoot":"","sources":["../../src/stories/Header.stories.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,mFAAmF;QACnF,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAC,MAAM,oBAAK,IAAI,EAAI,CAAC;AAEhD,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,GAAG;IACd,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC"}
|
package/dist/stories/Page.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function Page(): JSX.Element;
|
package/dist/stories/Page.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
import './page.css';
|
|
4
|
-
export const Page = () => {
|
|
5
|
-
const [user, setUser] = React.useState();
|
|
6
|
-
return (React.createElement("article", null,
|
|
7
|
-
React.createElement(Header, { user: user, onLogin: () => setUser({ name: 'Jane Doe' }), onLogout: () => setUser(undefined), onCreateAccount: () => setUser({ name: 'Jane Doe' }) }),
|
|
8
|
-
React.createElement("section", null,
|
|
9
|
-
React.createElement("h2", null, "Pages in Storybook"),
|
|
10
|
-
React.createElement("p", null,
|
|
11
|
-
"We recommend building UIs with a",
|
|
12
|
-
' ',
|
|
13
|
-
React.createElement("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer" },
|
|
14
|
-
React.createElement("strong", null, "component-driven")),
|
|
15
|
-
' ',
|
|
16
|
-
"process starting with atomic components and ending with pages."),
|
|
17
|
-
React.createElement("p", null, "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"),
|
|
18
|
-
React.createElement("ul", null,
|
|
19
|
-
React.createElement("li", null, "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories"),
|
|
20
|
-
React.createElement("li", null, "Assemble data in the page component from your services. You can mock these services out using Storybook.")),
|
|
21
|
-
React.createElement("p", null,
|
|
22
|
-
"Get a guided tutorial on component-driven development at",
|
|
23
|
-
' ',
|
|
24
|
-
React.createElement("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer" }, "Storybook tutorials"),
|
|
25
|
-
". Read more in the",
|
|
26
|
-
' ',
|
|
27
|
-
React.createElement("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer" }, "docs"),
|
|
28
|
-
"."),
|
|
29
|
-
React.createElement("div", { className: "tip-wrapper" },
|
|
30
|
-
React.createElement("span", { className: "tip" }, "Tip"),
|
|
31
|
-
" Adjust the width of the canvas with the",
|
|
32
|
-
' ',
|
|
33
|
-
React.createElement("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
|
|
34
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
35
|
-
React.createElement("path", { d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z", id: "a", fill: "#999" }))),
|
|
36
|
-
"Viewports addon in the toolbar"))));
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=Page.js.map
|
package/dist/stories/Page.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/stories/Page.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACvB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEzC,OAAO,CACL;QACE,oBAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAClC,eAAe,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,GACpD;QAEF;YACE,qDAA2B;YAC3B;;gBACmC,GAAG;gBACpC,2BAAG,IAAI,EAAC,6BAA6B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB;oBAC7E,uDAAiC,CAC/B;gBAAC,GAAG;iFAEN;YACJ,oOAII;YACJ;gBACE,6JAGK;gBACL,2IAGK,CACF;YACL;;gBAC2D,GAAG;gBAC5D,2BAAG,IAAI,EAAC,qCAAqC,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,0BAEnF;;gBACe,GAAG;gBACtB,2BAAG,IAAI,EAAC,+BAA+B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,WAE7E;oBAEF;YACJ,6BAAK,SAAS,EAAC,aAAa;gBAC1B,8BAAM,SAAS,EAAC,KAAK,UAAW;;gBAAyC,GAAG;gBAC5E,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B;oBAChF,2BAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS;wBAC/B,8BACE,CAAC,EAAC,sOAAsO,EACxO,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,MAAM,GACX,CACA,CACA;iDAEF,CACE,CACF,CACX,CAAC;AACJ,CAAC,CAAC"}
|