@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,11 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export const title: string;
|
|
3
|
-
export { Page as component };
|
|
4
|
-
export namespace parameters {
|
|
5
|
-
const layout: string;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export default _default;
|
|
9
|
-
export const LoggedOut: any;
|
|
10
|
-
export const LoggedIn: any;
|
|
11
|
-
import { Page } from "./Page";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
12
|
-
import { Page } from './Page';
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Example/Page',
|
|
15
|
-
component: Page,
|
|
16
|
-
parameters: {
|
|
17
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
18
|
-
layout: 'fullscreen',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
const Template = (args) => React.createElement(Page, Object.assign({}, args));
|
|
22
|
-
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
23
|
-
export const LoggedOut = Template.bind({});
|
|
24
|
-
export const LoggedIn = Template.bind({});
|
|
25
|
-
LoggedIn.play = ({ canvasElement }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const canvas = within(canvasElement);
|
|
27
|
-
const loginButton = yield canvas.getByRole('button', { name: /Log in/i });
|
|
28
|
-
yield userEvent.click(loginButton);
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=Page.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Page.stories.js","sourceRoot":"","sources":["../../src/stories/Page.stories.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,mFAAmF;QACnF,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAC,IAAI,oBAAK,IAAI,EAAI,CAAC;AAE9C,qGAAqG;AACrG,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,GAAG,CAAO,EAAE,aAAa,EAAE,EAAE,EAAE;IAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1E,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/comments</title><g id="illustration/comments" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Path" fill="#96D07C" d="M2.52730803,17.9196415 C2.44329744,17.9745167 2.36370847,18.000488 2.29303375,18.000488 C2.1197031,18.000488 2,17.8443588 2,17.5752855 L2,4 C2,1.790861 3.790861,3.23296945e-13 6,3.23296945e-13 L33.9995117,3.23296945e-13 C36.2086507,3.23296945e-13 37.9995117,1.790861 37.9995117,4 L37.9995117,9.999512 C37.9995117,12.208651 36.2086507,13.999512 33.9995117,13.999512 L8,13.999512 C7.83499225,13.999512 7.6723181,13.9895206 7.51254954,13.9701099 L2.52730803,17.9196415 Z"/><path id="Path" fill="#73E1E0" d="M7.51066,44.9703679 L2.52730803,47.9186655 C2.44329744,47.9735407 2.36370847,47.999512 2.29303375,47.999512 C2.1197031,47.999512 2,47.8433828 2,47.5743095 L2,35 C2,32.790861 3.790861,31 6,31 L26,31 C28.209139,31 30,32.790861 30,35 L30,41 C30,43.209139 28.209139,45 26,45 L8,45 C7.8343417,45 7.67103544,44.9899297 7.51066,44.9703679 Z"/><path id="Path" fill="#FFD476" d="M46,19.5 L46,33.0747975 C46,33.3438708 45.8802969,33.5 45.7069663,33.5 C45.6362915,33.5 45.5567026,33.4740287 45.472692,33.4191535 L40.4887103,29.4704446 C40.3285371,29.489956 40.1654415,29.5 40,29.5 L18,29.5 C15.790861,29.5 14,27.709139 14,25.5 L14,19.5 C14,17.290861 15.790861,15.5 18,15.5 L42,15.5 C44.209139,15.5 46,17.290861 46,19.5 Z"/></g></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/direction</title><g id="illustration/direction" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#FFD476" d="M23.4917015,33.6030641 L2.93840258,31.4321033 C2.38917316,31.3740904 1.99096346,30.8818233 2.04897631,30.3325939 C2.0747515,30.0885705 2.18934861,29.8625419 2.37095722,29.6975265 L34.2609105,0.721285325 C34.6696614,0.349881049 35.3021022,0.38015648 35.6735064,0.788907393 C35.9232621,1.06377731 36.0001133,1.45442096 35.8730901,1.80341447 L24.5364357,32.9506164 C24.3793473,33.3822133 23.9484565,33.6513092 23.4917015,33.6030641 L23.4917015,33.6030641 Z"/><path id="Combined-Shape-Copy" fill="#FFC445" d="M24.3163597,33.2881029 C24.0306575,33.0138462 23.9337246,32.5968232 24.069176,32.2246735 L35.091923,1.9399251 C35.2266075,1.56988243 35.5659249,1.31333613 35.9586669,1.28460955 C36.5094802,1.24432106 36.9886628,1.65818318 37.0289513,2.20899647 L40.2437557,46.1609256 C40.2644355,46.4436546 40.1641446,46.7218752 39.9678293,46.9263833 C39.5853672,47.3248067 38.9523344,47.3377458 38.5539111,46.9552837 L24.3163597,33.2881029 L24.3163597,33.2881029 Z"/></g></svg>
|
package/src/stories/Button.jsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import './button.css';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Primary UI component for user interaction
|
|
7
|
-
*/
|
|
8
|
-
export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
|
|
9
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
10
|
-
return (
|
|
11
|
-
<button
|
|
12
|
-
type="button"
|
|
13
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
14
|
-
style={backgroundColor && { backgroundColor }}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
{label}
|
|
18
|
-
</button>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
Button.propTypes = {
|
|
23
|
-
/**
|
|
24
|
-
* Is this the principal call to action on the page?
|
|
25
|
-
*/
|
|
26
|
-
primary: PropTypes.bool,
|
|
27
|
-
/**
|
|
28
|
-
* What background color to use
|
|
29
|
-
*/
|
|
30
|
-
backgroundColor: PropTypes.string,
|
|
31
|
-
/**
|
|
32
|
-
* How large should the button be?
|
|
33
|
-
*/
|
|
34
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
35
|
-
/**
|
|
36
|
-
* Button contents
|
|
37
|
-
*/
|
|
38
|
-
label: PropTypes.string.isRequired,
|
|
39
|
-
/**
|
|
40
|
-
* Optional click handler
|
|
41
|
-
*/
|
|
42
|
-
onClick: PropTypes.func,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Button.defaultProps = {
|
|
46
|
-
backgroundColor: null,
|
|
47
|
-
primary: false,
|
|
48
|
-
size: 'medium',
|
|
49
|
-
onClick: undefined,
|
|
50
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
|
|
5
|
-
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
10
|
-
argTypes: {
|
|
11
|
-
backgroundColor: { control: 'color' },
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
-
const Template = (args) => <Button {...args} />;
|
|
17
|
-
|
|
18
|
-
export const Primary = Template.bind({});
|
|
19
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
20
|
-
Primary.args = {
|
|
21
|
-
primary: true,
|
|
22
|
-
label: 'Button',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Secondary = Template.bind({});
|
|
26
|
-
Secondary.args = {
|
|
27
|
-
label: 'Button',
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Large = Template.bind({});
|
|
31
|
-
Large.args = {
|
|
32
|
-
size: 'large',
|
|
33
|
-
label: 'Button',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Small = Template.bind({});
|
|
37
|
-
Small.args = {
|
|
38
|
-
size: 'small',
|
|
39
|
-
label: 'Button',
|
|
40
|
-
};
|
package/src/stories/Header.jsx
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import { Button } from './Button';
|
|
5
|
-
import './header.css';
|
|
6
|
-
|
|
7
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
|
|
8
|
-
<header>
|
|
9
|
-
<div className="wrapper">
|
|
10
|
-
<div>
|
|
11
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
-
<g fill="none" fillRule="evenodd">
|
|
13
|
-
<path
|
|
14
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
15
|
-
fill="#FFF"
|
|
16
|
-
/>
|
|
17
|
-
<path
|
|
18
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
19
|
-
fill="#555AB9"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
23
|
-
fill="#91BAF8"
|
|
24
|
-
/>
|
|
25
|
-
</g>
|
|
26
|
-
</svg>
|
|
27
|
-
<h1>Acme</h1>
|
|
28
|
-
</div>
|
|
29
|
-
<div>
|
|
30
|
-
{user ? (
|
|
31
|
-
<>
|
|
32
|
-
<span className="welcome">
|
|
33
|
-
Welcome, <b>{user.name}</b>!
|
|
34
|
-
</span>
|
|
35
|
-
<Button size="small" onClick={onLogout} label="Log out" />
|
|
36
|
-
</>
|
|
37
|
-
) : (
|
|
38
|
-
<>
|
|
39
|
-
<Button size="small" onClick={onLogin} label="Log in" />
|
|
40
|
-
<Button primary size="small" onClick={onCreateAccount} label="Sign up" />
|
|
41
|
-
</>
|
|
42
|
-
)}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</header>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
Header.propTypes = {
|
|
49
|
-
user: PropTypes.shape({}),
|
|
50
|
-
onLogin: PropTypes.func.isRequired,
|
|
51
|
-
onLogout: PropTypes.func.isRequired,
|
|
52
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
Header.defaultProps = {
|
|
56
|
-
user: null,
|
|
57
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Header',
|
|
7
|
-
component: Header,
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = (args) => <Header {...args} />;
|
|
15
|
-
|
|
16
|
-
export const LoggedIn = Template.bind({});
|
|
17
|
-
LoggedIn.args = {
|
|
18
|
-
user: {
|
|
19
|
-
name: 'Jane Doe',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const LoggedOut = Template.bind({});
|
|
24
|
-
LoggedOut.args = {};
|
package/src/stories/Page.jsx
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header';
|
|
4
|
-
import './page.css';
|
|
5
|
-
|
|
6
|
-
export const Page = () => {
|
|
7
|
-
const [user, setUser] = React.useState();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<article>
|
|
11
|
-
<Header
|
|
12
|
-
user={user}
|
|
13
|
-
onLogin={() => setUser({ name: 'Jane Doe' })}
|
|
14
|
-
onLogout={() => setUser(undefined)}
|
|
15
|
-
onCreateAccount={() => setUser({ name: 'Jane Doe' })}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<section>
|
|
19
|
-
<h2>Pages in Storybook</h2>
|
|
20
|
-
<p>
|
|
21
|
-
We recommend building UIs with a{' '}
|
|
22
|
-
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
23
|
-
<strong>component-driven</strong>
|
|
24
|
-
</a>{' '}
|
|
25
|
-
process starting with atomic components and ending with pages.
|
|
26
|
-
</p>
|
|
27
|
-
<p>
|
|
28
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
29
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page
|
|
30
|
-
data in Storybook:
|
|
31
|
-
</p>
|
|
32
|
-
<ul>
|
|
33
|
-
<li>
|
|
34
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
35
|
-
"args" of child component stories
|
|
36
|
-
</li>
|
|
37
|
-
<li>
|
|
38
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
39
|
-
using Storybook.
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
<p>
|
|
43
|
-
Get a guided tutorial on component-driven development at{' '}
|
|
44
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
45
|
-
Storybook tutorials
|
|
46
|
-
</a>
|
|
47
|
-
. Read more in the{' '}
|
|
48
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">
|
|
49
|
-
docs
|
|
50
|
-
</a>
|
|
51
|
-
.
|
|
52
|
-
</p>
|
|
53
|
-
<div className="tip-wrapper">
|
|
54
|
-
<span className="tip">Tip</span> Adjust the width of the canvas with the{' '}
|
|
55
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<g fill="none" fillRule="evenodd">
|
|
57
|
-
<path
|
|
58
|
-
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"
|
|
59
|
-
id="a"
|
|
60
|
-
fill="#999"
|
|
61
|
-
/>
|
|
62
|
-
</g>
|
|
63
|
-
</svg>
|
|
64
|
-
Viewports addon in the toolbar
|
|
65
|
-
</div>
|
|
66
|
-
</section>
|
|
67
|
-
</article>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
3
|
-
|
|
4
|
-
import { Page } from './Page';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Page',
|
|
8
|
-
component: Page,
|
|
9
|
-
parameters: {
|
|
10
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const Template = (args) => <Page {...args} />;
|
|
16
|
-
|
|
17
|
-
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
18
|
-
export const LoggedOut = Template.bind({});
|
|
19
|
-
|
|
20
|
-
export const LoggedIn = Template.bind({});
|
|
21
|
-
LoggedIn.play = async ({ canvasElement }) => {
|
|
22
|
-
const canvas = within(canvasElement);
|
|
23
|
-
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
|
|
24
|
-
await userEvent.click(loginButton);
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/comments</title><g id="illustration/comments" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Path" fill="#96D07C" d="M2.52730803,17.9196415 C2.44329744,17.9745167 2.36370847,18.000488 2.29303375,18.000488 C2.1197031,18.000488 2,17.8443588 2,17.5752855 L2,4 C2,1.790861 3.790861,3.23296945e-13 6,3.23296945e-13 L33.9995117,3.23296945e-13 C36.2086507,3.23296945e-13 37.9995117,1.790861 37.9995117,4 L37.9995117,9.999512 C37.9995117,12.208651 36.2086507,13.999512 33.9995117,13.999512 L8,13.999512 C7.83499225,13.999512 7.6723181,13.9895206 7.51254954,13.9701099 L2.52730803,17.9196415 Z"/><path id="Path" fill="#73E1E0" d="M7.51066,44.9703679 L2.52730803,47.9186655 C2.44329744,47.9735407 2.36370847,47.999512 2.29303375,47.999512 C2.1197031,47.999512 2,47.8433828 2,47.5743095 L2,35 C2,32.790861 3.790861,31 6,31 L26,31 C28.209139,31 30,32.790861 30,35 L30,41 C30,43.209139 28.209139,45 26,45 L8,45 C7.8343417,45 7.67103544,44.9899297 7.51066,44.9703679 Z"/><path id="Path" fill="#FFD476" d="M46,19.5 L46,33.0747975 C46,33.3438708 45.8802969,33.5 45.7069663,33.5 C45.6362915,33.5 45.5567026,33.4740287 45.472692,33.4191535 L40.4887103,29.4704446 C40.3285371,29.489956 40.1654415,29.5 40,29.5 L18,29.5 C15.790861,29.5 14,27.709139 14,25.5 L14,19.5 C14,17.290861 15.790861,15.5 18,15.5 L42,15.5 C44.209139,15.5 46,17.290861 46,19.5 Z"/></g></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/direction</title><g id="illustration/direction" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#FFD476" d="M23.4917015,33.6030641 L2.93840258,31.4321033 C2.38917316,31.3740904 1.99096346,30.8818233 2.04897631,30.3325939 C2.0747515,30.0885705 2.18934861,29.8625419 2.37095722,29.6975265 L34.2609105,0.721285325 C34.6696614,0.349881049 35.3021022,0.38015648 35.6735064,0.788907393 C35.9232621,1.06377731 36.0001133,1.45442096 35.8730901,1.80341447 L24.5364357,32.9506164 C24.3793473,33.3822133 23.9484565,33.6513092 23.4917015,33.6030641 L23.4917015,33.6030641 Z"/><path id="Combined-Shape-Copy" fill="#FFC445" d="M24.3163597,33.2881029 C24.0306575,33.0138462 23.9337246,32.5968232 24.069176,32.2246735 L35.091923,1.9399251 C35.2266075,1.56988243 35.5659249,1.31333613 35.9586669,1.28460955 C36.5094802,1.24432106 36.9886628,1.65818318 37.0289513,2.20899647 L40.2437557,46.1609256 C40.2644355,46.4436546 40.1641446,46.7218752 39.9678293,46.9263833 C39.5853672,47.3248067 38.9523344,47.3377458 38.5539111,46.9552837 L24.3163597,33.2881029 L24.3163597,33.2881029 Z"/></g></svg>
|
package/src/stories/button.css
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.storybook-button {
|
|
2
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
-
font-weight: 700;
|
|
4
|
-
border: 0;
|
|
5
|
-
border-radius: 3em;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
display: inline-block;
|
|
8
|
-
line-height: 1;
|
|
9
|
-
}
|
|
10
|
-
.storybook-button--primary {
|
|
11
|
-
color: white;
|
|
12
|
-
background-color: #1ea7fd;
|
|
13
|
-
}
|
|
14
|
-
.storybook-button--secondary {
|
|
15
|
-
color: #333;
|
|
16
|
-
background-color: transparent;
|
|
17
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
18
|
-
}
|
|
19
|
-
.storybook-button--small {
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
padding: 10px 16px;
|
|
22
|
-
}
|
|
23
|
-
.storybook-button--medium {
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
padding: 11px 20px;
|
|
26
|
-
}
|
|
27
|
-
.storybook-button--large {
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
padding: 12px 24px;
|
|
30
|
-
}
|
package/src/stories/header.css
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.wrapper {
|
|
2
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
4
|
-
padding: 15px 20px;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
svg {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
vertical-align: top;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
h1 {
|
|
16
|
-
font-weight: 900;
|
|
17
|
-
font-size: 20px;
|
|
18
|
-
line-height: 1;
|
|
19
|
-
margin: 6px 0 6px 10px;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
vertical-align: top;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
button + button {
|
|
25
|
-
margin-left: 10px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.welcome {
|
|
29
|
-
color: #333;
|
|
30
|
-
font-size: 14px;
|
|
31
|
-
margin-right: 10px;
|
|
32
|
-
}
|
package/src/stories/page.css
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
section {
|
|
2
|
-
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
-
font-size: 14px;
|
|
4
|
-
line-height: 24px;
|
|
5
|
-
padding: 48px 20px;
|
|
6
|
-
margin: 0 auto;
|
|
7
|
-
max-width: 600px;
|
|
8
|
-
color: #333;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
section h2 {
|
|
12
|
-
font-weight: 900;
|
|
13
|
-
font-size: 32px;
|
|
14
|
-
line-height: 1;
|
|
15
|
-
margin: 0 0 4px;
|
|
16
|
-
display: inline-block;
|
|
17
|
-
vertical-align: top;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
section p {
|
|
21
|
-
margin: 1em 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
section a {
|
|
25
|
-
text-decoration: none;
|
|
26
|
-
color: #1ea7fd;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
section ul {
|
|
30
|
-
padding-left: 30px;
|
|
31
|
-
margin: 1em 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
section li {
|
|
35
|
-
margin-bottom: 8px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
section .tip {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
border-radius: 1em;
|
|
41
|
-
font-size: 11px;
|
|
42
|
-
line-height: 12px;
|
|
43
|
-
font-weight: 700;
|
|
44
|
-
background: #e7fdd8;
|
|
45
|
-
color: #66bf3c;
|
|
46
|
-
padding: 4px 12px;
|
|
47
|
-
margin-right: 10px;
|
|
48
|
-
vertical-align: top;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
section .tip-wrapper {
|
|
52
|
-
font-size: 13px;
|
|
53
|
-
line-height: 20px;
|
|
54
|
-
margin-top: 40px;
|
|
55
|
-
margin-bottom: 40px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
section .tip-wrapper svg {
|
|
59
|
-
display: inline-block;
|
|
60
|
-
height: 12px;
|
|
61
|
-
width: 12px;
|
|
62
|
-
margin-right: 4px;
|
|
63
|
-
vertical-align: top;
|
|
64
|
-
margin-top: 3px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
section .tip-wrapper svg path {
|
|
68
|
-
fill: #1ea7fd;
|
|
69
|
-
}
|