@cencomalls/cencob2b-storybook 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build.js +12 -0
- package/package.json +23 -27
- package/src/index.tsx +9 -0
- package/tsconfig.json +13 -0
- package/.github/workflows/chromatic.yml +0 -28
- package/.github/workflows/publish.yml +0 -22
- package/.github/workflows/release.yml +0 -29
- package/.storybook/main.js +0 -25
- package/.storybook/preview.js +0 -13
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.1.1.cjs +0 -893
- package/.yarnrc.yml +0 -3
- package/stories/Button.jsx +0 -50
- package/stories/Button.stories.js +0 -48
- package/stories/Configure.mdx +0 -364
- package/stories/Header.jsx +0 -59
- package/stories/Header.stories.js +0 -28
- package/stories/Page.jsx +0 -69
- package/stories/Page.stories.js +0 -28
- package/stories/assets/accessibility.png +0 -0
- package/stories/assets/accessibility.svg +0 -5
- package/stories/assets/addon-library.png +0 -0
- package/stories/assets/assets.png +0 -0
- package/stories/assets/avif-test-image.avif +0 -0
- package/stories/assets/context.png +0 -0
- package/stories/assets/discord.svg +0 -15
- package/stories/assets/docs.png +0 -0
- package/stories/assets/figma-plugin.png +0 -0
- package/stories/assets/github.svg +0 -3
- package/stories/assets/share.png +0 -0
- package/stories/assets/styling.png +0 -0
- package/stories/assets/testing.png +0 -0
- package/stories/assets/theming.png +0 -0
- package/stories/assets/tutorials.svg +0 -12
- package/stories/assets/youtube.svg +0 -4
- package/stories/button.css +0 -30
- package/stories/header.css +0 -32
- package/stories/page.css +0 -69
- package/storybook-static/assets/Button-B7GXpXHZ.js +0 -203
- package/storybook-static/assets/Button-BfyGbg8N.css +0 -1
- package/storybook-static/assets/Button.stories-Cz4ZTIw_.js +0 -20
- package/storybook-static/assets/Color-RQJUDNI5-r4zJMVcU.js +0 -1
- package/storybook-static/assets/Configure-CZVeek8t.js +0 -173
- package/storybook-static/assets/DocsRenderer-K4EAMTCU-Do6HWQxO.js +0 -7
- package/storybook-static/assets/Header-Be6lOWYO.js +0 -1
- package/storybook-static/assets/Header-BjLH3naM.css +0 -1
- package/storybook-static/assets/Header.stories-D9E6awjx.js +0 -7
- package/storybook-static/assets/Page-B9ntr4df.css +0 -1
- package/storybook-static/assets/Page.stories-DTRxRE07.js +0 -17
- package/storybook-static/assets/WithTooltip-Y7J54OF7-U9kDFlyj.js +0 -1
- package/storybook-static/assets/accessibility-W_h2acOZ.png +0 -0
- package/storybook-static/assets/addon-library-BWUCAmyN.png +0 -0
- package/storybook-static/assets/context-C0qIqeS4.png +0 -0
- package/storybook-static/assets/docs---vsFbMi.png +0 -0
- package/storybook-static/assets/entry-preview-docs-1v-OicRc.js +0 -54
- package/storybook-static/assets/entry-preview-kGuIN3g4.js +0 -1
- package/storybook-static/assets/figma-plugin-CH2hELiO.png +0 -0
- package/storybook-static/assets/formatter-B5HCVTEV-IqGtHqtT.js +0 -58
- package/storybook-static/assets/iframe-Da46mUfp.js +0 -7
- package/storybook-static/assets/index-BBkUAzwr.js +0 -9
- package/storybook-static/assets/index-BjkNUVMH.js +0 -505
- package/storybook-static/assets/index-Bw8VTzHM.js +0 -1
- package/storybook-static/assets/index-DboEQVPH.js +0 -3
- package/storybook-static/assets/index-DrFu-skq.js +0 -6
- package/storybook-static/assets/index-PqR-_bA4.js +0 -24
- package/storybook-static/assets/index-YMbfICiA.js +0 -1
- package/storybook-static/assets/index-z5U8iC57.js +0 -1
- package/storybook-static/assets/preview-B4GcaC1c.js +0 -1
- package/storybook-static/assets/preview-BAz7FMXc.js +0 -396
- package/storybook-static/assets/preview-BQoJvzIs.js +0 -7
- package/storybook-static/assets/preview-B_0crF9I.js +0 -1
- package/storybook-static/assets/preview-BjivwLRH.js +0 -203
- package/storybook-static/assets/preview-CIRcjyVj.js +0 -1
- package/storybook-static/assets/preview-Cv3rAi2i.js +0 -7
- package/storybook-static/assets/preview-CwqMn10d.js +0 -20
- package/storybook-static/assets/preview-Db4Idchh.js +0 -1
- package/storybook-static/assets/preview-DbT1mggi.js +0 -1
- package/storybook-static/assets/react-18-B-OKcmzb.js +0 -1
- package/storybook-static/assets/share-DGA-UcQf.png +0 -0
- package/storybook-static/assets/styling-Bk6zjRzU.png +0 -0
- package/storybook-static/assets/syntaxhighlighter-JOJW2KGS-Cy7bkou7.js +0 -1
- package/storybook-static/assets/testing-cbzR9l9r.png +0 -0
- package/storybook-static/assets/theming-D6WJLNoW.png +0 -0
- package/storybook-static/favicon.svg +0 -7
- package/storybook-static/iframe.html +0 -492
- package/storybook-static/index.html +0 -167
- package/storybook-static/index.json +0 -1
- package/storybook-static/project.json +0 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -323
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-actions-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js +0 -79
- package/storybook-static/sb-addons/essentials-controls-3/manager-bundle.js.LEGAL.txt +0 -28
- package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-11/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/interactions-11/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-2/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/links-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +0 -502
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/fonts.css +0 -31
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/WithTooltip-Y7J54OF7-KHQOWZXS.js +0 -1
- package/storybook-static/sb-manager/chunk-3F3RRPB3.js +0 -347
- package/storybook-static/sb-manager/chunk-62YMTM65.js +0 -6
- package/storybook-static/sb-manager/chunk-AQBE2B7B.js +0 -183
- package/storybook-static/sb-manager/chunk-Q3RBXCN3.js +0 -231
- package/storybook-static/sb-manager/chunk-XP3HGWTR.js +0 -1
- package/storybook-static/sb-manager/chunk-YME6VNXZ.js +0 -9
- package/storybook-static/sb-manager/formatter-B5HCVTEV-7DCBOGO6.js +0 -58
- package/storybook-static/sb-manager/globals-module-info.js +0 -1
- package/storybook-static/sb-manager/globals-runtime.js +0 -1
- package/storybook-static/sb-manager/globals.js +0 -1
- package/storybook-static/sb-manager/index.js +0 -1
- package/storybook-static/sb-manager/runtime.js +0 -1
- package/storybook-static/sb-manager/syntaxhighlighter-JOJW2KGS-WAFIMSO6.js +0 -1
- package/storybook-static/sb-preview/globals.js +0 -1
- package/storybook-static/sb-preview/runtime.js +0 -128
package/.yarnrc.yml
DELETED
package/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,48 +0,0 @@
|
|
1
|
-
import { fn } from '@storybook/test';
|
2
|
-
import { Button } from './Button';
|
3
|
-
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
5
|
-
export default {
|
6
|
-
title: 'Example/Button',
|
7
|
-
component: Button,
|
8
|
-
parameters: {
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
10
|
-
layout: 'centered',
|
11
|
-
},
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
13
|
-
tags: ['autodocs'],
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
15
|
-
argTypes: {
|
16
|
-
backgroundColor: { control: 'color' },
|
17
|
-
},
|
18
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
19
|
-
args: { onClick: fn() },
|
20
|
-
};
|
21
|
-
|
22
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
23
|
-
export const Primary = {
|
24
|
-
args: {
|
25
|
-
primary: true,
|
26
|
-
label: 'Button',
|
27
|
-
},
|
28
|
-
};
|
29
|
-
|
30
|
-
export const Secondary = {
|
31
|
-
args: {
|
32
|
-
label: 'Button',
|
33
|
-
},
|
34
|
-
};
|
35
|
-
|
36
|
-
export const Large = {
|
37
|
-
args: {
|
38
|
-
size: 'large',
|
39
|
-
label: 'Button',
|
40
|
-
},
|
41
|
-
};
|
42
|
-
|
43
|
-
export const Small = {
|
44
|
-
args: {
|
45
|
-
size: 'small',
|
46
|
-
label: 'Button',
|
47
|
-
},
|
48
|
-
};
|
package/stories/Configure.mdx
DELETED
@@ -1,364 +0,0 @@
|
|
1
|
-
import { Meta } from "@storybook/blocks";
|
2
|
-
|
3
|
-
import Github from "./assets/github.svg";
|
4
|
-
import Discord from "./assets/discord.svg";
|
5
|
-
import Youtube from "./assets/youtube.svg";
|
6
|
-
import Tutorials from "./assets/tutorials.svg";
|
7
|
-
import Styling from "./assets/styling.png";
|
8
|
-
import Context from "./assets/context.png";
|
9
|
-
import Assets from "./assets/assets.png";
|
10
|
-
import Docs from "./assets/docs.png";
|
11
|
-
import Share from "./assets/share.png";
|
12
|
-
import FigmaPlugin from "./assets/figma-plugin.png";
|
13
|
-
import Testing from "./assets/testing.png";
|
14
|
-
import Accessibility from "./assets/accessibility.png";
|
15
|
-
import Theming from "./assets/theming.png";
|
16
|
-
import AddonLibrary from "./assets/addon-library.png";
|
17
|
-
|
18
|
-
export const RightArrow = () => <svg
|
19
|
-
viewBox="0 0 14 14"
|
20
|
-
width="8px"
|
21
|
-
height="14px"
|
22
|
-
style={{
|
23
|
-
marginLeft: '4px',
|
24
|
-
display: 'inline-block',
|
25
|
-
shapeRendering: 'inherit',
|
26
|
-
verticalAlign: 'middle',
|
27
|
-
fill: 'currentColor',
|
28
|
-
'path fill': 'currentColor'
|
29
|
-
}}
|
30
|
-
>
|
31
|
-
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
|
32
|
-
</svg>
|
33
|
-
|
34
|
-
<Meta title="Configure your project" />
|
35
|
-
|
36
|
-
<div className="sb-container">
|
37
|
-
<div className='sb-section-title'>
|
38
|
-
# Configure your project
|
39
|
-
|
40
|
-
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
|
41
|
-
</div>
|
42
|
-
<div className="sb-section">
|
43
|
-
<div className="sb-section-item">
|
44
|
-
<img
|
45
|
-
src={Styling}
|
46
|
-
alt="A wall of logos representing different styling technologies"
|
47
|
-
/>
|
48
|
-
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
49
|
-
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
50
|
-
<a
|
51
|
-
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
52
|
-
target="_blank"
|
53
|
-
>Learn more<RightArrow /></a>
|
54
|
-
</div>
|
55
|
-
<div className="sb-section-item">
|
56
|
-
<img
|
57
|
-
src={Context}
|
58
|
-
alt="An abstraction representing the composition of data for a component"
|
59
|
-
/>
|
60
|
-
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
61
|
-
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
62
|
-
<a
|
63
|
-
href="https://storybook.js.org/docs/react/writing-stories/decorators#context-for-mocking"
|
64
|
-
target="_blank"
|
65
|
-
>Learn more<RightArrow /></a>
|
66
|
-
</div>
|
67
|
-
<div className="sb-section-item">
|
68
|
-
<img src={Assets} alt="A representation of typography and image assets" />
|
69
|
-
<div>
|
70
|
-
<h4 className="sb-section-item-heading">Load assets and resources</h4>
|
71
|
-
<p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
|
72
|
-
`staticDirs` configuration option to specify folders to load when
|
73
|
-
starting Storybook.</p>
|
74
|
-
<a
|
75
|
-
href="https://storybook.js.org/docs/react/configure/images-and-assets"
|
76
|
-
target="_blank"
|
77
|
-
>Learn more<RightArrow /></a>
|
78
|
-
</div>
|
79
|
-
</div>
|
80
|
-
</div>
|
81
|
-
</div>
|
82
|
-
<div className="sb-container">
|
83
|
-
<div className='sb-section-title'>
|
84
|
-
# Do more with Storybook
|
85
|
-
|
86
|
-
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
|
87
|
-
</div>
|
88
|
-
|
89
|
-
<div className="sb-section">
|
90
|
-
<div className="sb-features-grid">
|
91
|
-
<div className="sb-grid-item">
|
92
|
-
<img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
|
93
|
-
<h4 className="sb-section-item-heading">Autodocs</h4>
|
94
|
-
<p className="sb-section-item-paragraph">Auto-generate living,
|
95
|
-
interactive reference documentation from your components and stories.</p>
|
96
|
-
<a
|
97
|
-
href="https://storybook.js.org/docs/react/writing-docs/autodocs"
|
98
|
-
target="_blank"
|
99
|
-
>Learn more<RightArrow /></a>
|
100
|
-
</div>
|
101
|
-
<div className="sb-grid-item">
|
102
|
-
<img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
|
103
|
-
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
104
|
-
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
105
|
-
<a
|
106
|
-
href="https://storybook.js.org/docs/react/sharing/publish-storybook#publish-storybook-with-chromatic"
|
107
|
-
target="_blank"
|
108
|
-
>Learn more<RightArrow /></a>
|
109
|
-
</div>
|
110
|
-
<div className="sb-grid-item">
|
111
|
-
<img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
|
112
|
-
<h4 className="sb-section-item-heading">Figma Plugin</h4>
|
113
|
-
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
114
|
-
implementation in one place.</p>
|
115
|
-
<a
|
116
|
-
href="https://storybook.js.org/docs/react/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
|
117
|
-
target="_blank"
|
118
|
-
>Learn more<RightArrow /></a>
|
119
|
-
</div>
|
120
|
-
<div className="sb-grid-item">
|
121
|
-
<img src={Testing} alt="Screenshot of tests passing and failing" />
|
122
|
-
<h4 className="sb-section-item-heading">Testing</h4>
|
123
|
-
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
124
|
-
complex.</p>
|
125
|
-
<a
|
126
|
-
href="https://storybook.js.org/docs/react/writing-tests"
|
127
|
-
target="_blank"
|
128
|
-
>Learn more<RightArrow /></a>
|
129
|
-
</div>
|
130
|
-
<div className="sb-grid-item">
|
131
|
-
<img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
|
132
|
-
<h4 className="sb-section-item-heading">Accessibility</h4>
|
133
|
-
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
134
|
-
<a
|
135
|
-
href="https://storybook.js.org/docs/react/writing-tests/accessibility-testing"
|
136
|
-
target="_blank"
|
137
|
-
>Learn more<RightArrow /></a>
|
138
|
-
</div>
|
139
|
-
<div className="sb-grid-item">
|
140
|
-
<img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
|
141
|
-
<h4 className="sb-section-item-heading">Theming</h4>
|
142
|
-
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
143
|
-
<a
|
144
|
-
href="https://storybook.js.org/docs/react/configure/theming"
|
145
|
-
target="_blank"
|
146
|
-
>Learn more<RightArrow /></a>
|
147
|
-
</div>
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
</div>
|
151
|
-
<div className='sb-addon'>
|
152
|
-
<div className='sb-addon-text'>
|
153
|
-
<h4>Addons</h4>
|
154
|
-
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
155
|
-
<a
|
156
|
-
href="https://storybook.js.org/integrations/"
|
157
|
-
target="_blank"
|
158
|
-
>Discover all addons<RightArrow /></a>
|
159
|
-
</div>
|
160
|
-
<div className='sb-addon-img'>
|
161
|
-
<img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
|
162
|
-
</div>
|
163
|
-
</div>
|
164
|
-
|
165
|
-
<div className="sb-section sb-socials">
|
166
|
-
<div className="sb-section-item">
|
167
|
-
<img src={Github} alt="Github logo" className="sb-explore-image"/>
|
168
|
-
Join our contributors building the future of UI development.
|
169
|
-
|
170
|
-
<a
|
171
|
-
href="https://github.com/storybookjs/storybook"
|
172
|
-
target="_blank"
|
173
|
-
>Star on GitHub<RightArrow /></a>
|
174
|
-
</div>
|
175
|
-
<div className="sb-section-item">
|
176
|
-
<img src={Discord} alt="Discord logo" className="sb-explore-image"/>
|
177
|
-
<div>
|
178
|
-
Get support and chat with frontend developers.
|
179
|
-
|
180
|
-
<a
|
181
|
-
href="https://discord.gg/storybook"
|
182
|
-
target="_blank"
|
183
|
-
>Join Discord server<RightArrow /></a>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
<div className="sb-section-item">
|
187
|
-
<img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
|
188
|
-
<div>
|
189
|
-
Watch tutorials, feature previews and interviews.
|
190
|
-
|
191
|
-
<a
|
192
|
-
href="https://www.youtube.com/@chromaticui"
|
193
|
-
target="_blank"
|
194
|
-
>Watch on YouTube<RightArrow /></a>
|
195
|
-
</div>
|
196
|
-
</div>
|
197
|
-
<div className="sb-section-item">
|
198
|
-
<img src={Tutorials} alt="A book" className="sb-explore-image"/>
|
199
|
-
<p>Follow guided walkthroughs on for key workflows.</p>
|
200
|
-
|
201
|
-
<a
|
202
|
-
href="https://storybook.js.org/tutorials/"
|
203
|
-
target="_blank"
|
204
|
-
>Discover tutorials<RightArrow /></a>
|
205
|
-
</div>
|
206
|
-
</div>
|
207
|
-
|
208
|
-
<style>
|
209
|
-
{`
|
210
|
-
.sb-container {
|
211
|
-
margin-bottom: 48px;
|
212
|
-
}
|
213
|
-
|
214
|
-
.sb-section {
|
215
|
-
width: 100%;
|
216
|
-
display: flex;
|
217
|
-
flex-direction: row;
|
218
|
-
gap: 20px;
|
219
|
-
}
|
220
|
-
|
221
|
-
img {
|
222
|
-
object-fit: cover;
|
223
|
-
}
|
224
|
-
|
225
|
-
.sb-section-title {
|
226
|
-
margin-bottom: 32px;
|
227
|
-
}
|
228
|
-
|
229
|
-
.sb-section a:not(h1 a, h2 a, h3 a) {
|
230
|
-
font-size: 14px;
|
231
|
-
}
|
232
|
-
|
233
|
-
.sb-section-item, .sb-grid-item {
|
234
|
-
flex: 1;
|
235
|
-
display: flex;
|
236
|
-
flex-direction: column;
|
237
|
-
}
|
238
|
-
|
239
|
-
.sb-section-item-heading {
|
240
|
-
padding-top: 20px !important;
|
241
|
-
padding-bottom: 5px !important;
|
242
|
-
margin: 0 !important;
|
243
|
-
}
|
244
|
-
.sb-section-item-paragraph {
|
245
|
-
margin: 0;
|
246
|
-
padding-bottom: 10px;
|
247
|
-
}
|
248
|
-
|
249
|
-
.sb-chevron {
|
250
|
-
margin-left: 5px;
|
251
|
-
}
|
252
|
-
|
253
|
-
.sb-features-grid {
|
254
|
-
display: grid;
|
255
|
-
grid-template-columns: repeat(2, 1fr);
|
256
|
-
grid-gap: 32px 20px;
|
257
|
-
}
|
258
|
-
|
259
|
-
.sb-socials {
|
260
|
-
display: grid;
|
261
|
-
grid-template-columns: repeat(4, 1fr);
|
262
|
-
}
|
263
|
-
|
264
|
-
.sb-socials p {
|
265
|
-
margin-bottom: 10px;
|
266
|
-
}
|
267
|
-
|
268
|
-
.sb-explore-image {
|
269
|
-
max-height: 32px;
|
270
|
-
align-self: flex-start;
|
271
|
-
}
|
272
|
-
|
273
|
-
.sb-addon {
|
274
|
-
width: 100%;
|
275
|
-
display: flex;
|
276
|
-
align-items: center;
|
277
|
-
position: relative;
|
278
|
-
background-color: #EEF3F8;
|
279
|
-
border-radius: 5px;
|
280
|
-
border: 1px solid rgba(0, 0, 0, 0.05);
|
281
|
-
background: #EEF3F8;
|
282
|
-
height: 180px;
|
283
|
-
margin-bottom: 48px;
|
284
|
-
overflow: hidden;
|
285
|
-
}
|
286
|
-
|
287
|
-
.sb-addon-text {
|
288
|
-
padding-left: 48px;
|
289
|
-
max-width: 240px;
|
290
|
-
}
|
291
|
-
|
292
|
-
.sb-addon-text h4 {
|
293
|
-
padding-top: 0px;
|
294
|
-
}
|
295
|
-
|
296
|
-
.sb-addon-img {
|
297
|
-
position: absolute;
|
298
|
-
left: 345px;
|
299
|
-
top: 0;
|
300
|
-
height: 100%;
|
301
|
-
width: 200%;
|
302
|
-
overflow: hidden;
|
303
|
-
}
|
304
|
-
|
305
|
-
.sb-addon-img img {
|
306
|
-
width: 650px;
|
307
|
-
transform: rotate(-15deg);
|
308
|
-
margin-left: 40px;
|
309
|
-
margin-top: -72px;
|
310
|
-
box-shadow: 0 0 1px rgba(255, 255, 255, 0);
|
311
|
-
backface-visibility: hidden;
|
312
|
-
}
|
313
|
-
|
314
|
-
@media screen and (max-width: 800px) {
|
315
|
-
.sb-addon-img {
|
316
|
-
left: 300px;
|
317
|
-
}
|
318
|
-
}
|
319
|
-
|
320
|
-
@media screen and (max-width: 600px) {
|
321
|
-
.sb-section {
|
322
|
-
flex-direction: column;
|
323
|
-
}
|
324
|
-
|
325
|
-
.sb-features-grid {
|
326
|
-
grid-template-columns: repeat(1, 1fr);
|
327
|
-
}
|
328
|
-
|
329
|
-
.sb-socials {
|
330
|
-
grid-template-columns: repeat(2, 1fr);
|
331
|
-
}
|
332
|
-
|
333
|
-
.sb-addon {
|
334
|
-
height: 280px;
|
335
|
-
align-items: flex-start;
|
336
|
-
padding-top: 32px;
|
337
|
-
overflow: hidden;
|
338
|
-
}
|
339
|
-
|
340
|
-
.sb-addon-text {
|
341
|
-
padding-left: 24px;
|
342
|
-
}
|
343
|
-
|
344
|
-
.sb-addon-img {
|
345
|
-
right: 0;
|
346
|
-
left: 0;
|
347
|
-
top: 130px;
|
348
|
-
bottom: 0;
|
349
|
-
overflow: hidden;
|
350
|
-
height: auto;
|
351
|
-
width: 124%;
|
352
|
-
}
|
353
|
-
|
354
|
-
.sb-addon-img img {
|
355
|
-
width: 1200px;
|
356
|
-
transform: rotate(-12deg);
|
357
|
-
margin-left: 0;
|
358
|
-
margin-top: 48px;
|
359
|
-
margin-bottom: -40px;
|
360
|
-
margin-left: -24px;
|
361
|
-
}
|
362
|
-
}
|
363
|
-
`}
|
364
|
-
</style>
|
package/stories/Header.jsx
DELETED
@@ -1,59 +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="storybook-header">
|
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
|
-
name: PropTypes.string.isRequired,
|
51
|
-
}),
|
52
|
-
onLogin: PropTypes.func.isRequired,
|
53
|
-
onLogout: PropTypes.func.isRequired,
|
54
|
-
onCreateAccount: PropTypes.func.isRequired,
|
55
|
-
};
|
56
|
-
|
57
|
-
Header.defaultProps = {
|
58
|
-
user: null,
|
59
|
-
};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { Header } from './Header';
|
2
|
-
import { fn } from '@storybook/test';
|
3
|
-
|
4
|
-
export default {
|
5
|
-
title: 'Example/Header',
|
6
|
-
component: Header,
|
7
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
8
|
-
tags: ['autodocs'],
|
9
|
-
parameters: {
|
10
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
11
|
-
layout: 'fullscreen',
|
12
|
-
},
|
13
|
-
args: {
|
14
|
-
onLogin: fn(),
|
15
|
-
onLogout: fn(),
|
16
|
-
onCreateAccount: fn(),
|
17
|
-
},
|
18
|
-
};
|
19
|
-
|
20
|
-
export const LoggedIn = {
|
21
|
-
args: {
|
22
|
-
user: {
|
23
|
-
name: 'Jane Doe',
|
24
|
-
},
|
25
|
-
},
|
26
|
-
};
|
27
|
-
|
28
|
-
export const LoggedOut = {};
|
package/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 className="storybook-page">
|
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
|
-
};
|
package/stories/Page.stories.js
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import { within, userEvent, expect } from '@storybook/test';
|
2
|
-
|
3
|
-
import { Page } from './Page';
|
4
|
-
|
5
|
-
export default {
|
6
|
-
title: 'Example/Page',
|
7
|
-
component: Page,
|
8
|
-
parameters: {
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
10
|
-
layout: 'fullscreen',
|
11
|
-
},
|
12
|
-
};
|
13
|
-
|
14
|
-
export const LoggedOut = {};
|
15
|
-
|
16
|
-
// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
17
|
-
export const LoggedIn = {
|
18
|
-
play: async ({ canvasElement }) => {
|
19
|
-
const canvas = within(canvasElement);
|
20
|
-
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
21
|
-
await expect(loginButton).toBeInTheDocument();
|
22
|
-
await userEvent.click(loginButton);
|
23
|
-
await expect(loginButton).not.toBeInTheDocument();
|
24
|
-
|
25
|
-
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
26
|
-
await expect(logoutButton).toBeInTheDocument();
|
27
|
-
},
|
28
|
-
};
|
Binary file
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<title>Accessibility</title>
|
3
|
-
<circle cx="24.334" cy="24" r="24" fill="#A849FF" fill-opacity="0.3"/>
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.8609 11.585C27.8609 9.59506 26.2497 7.99023 24.2519 7.99023C22.254 7.99023 20.6429 9.65925 20.6429 11.585C20.6429 13.575 22.254 15.1799 24.2519 15.1799C26.2497 15.1799 27.8609 13.575 27.8609 11.585ZM21.8922 22.6473C21.8467 23.9096 21.7901 25.4788 21.5897 26.2771C20.9853 29.0462 17.7348 36.3314 17.3325 37.2275C17.1891 37.4923 17.1077 37.7955 17.1077 38.1178C17.1077 39.1519 17.946 39.9902 18.9802 39.9902C19.6587 39.9902 20.253 39.6293 20.5814 39.0889L20.6429 38.9874L24.2841 31.22C24.2841 31.22 27.5529 37.9214 27.9238 38.6591C28.2948 39.3967 28.8709 39.9902 29.7168 39.9902C30.751 39.9902 31.5893 39.1519 31.5893 38.1178C31.5893 37.7951 31.3639 37.2265 31.3639 37.2265C30.9581 36.3258 27.698 29.0452 27.0938 26.2771C26.8975 25.4948 26.847 23.9722 26.8056 22.7236C26.7927 22.333 26.7806 21.9693 26.7653 21.6634C26.7008 21.214 27.0231 20.8289 27.4097 20.7005L35.3366 18.3253C36.3033 18.0685 36.8834 16.9773 36.6256 16.0144C36.3678 15.0515 35.2722 14.4737 34.3055 14.7305C34.3055 14.7305 26.8619 17.1057 24.2841 17.1057C21.7062 17.1057 14.456 14.7947 14.456 14.7947C13.4893 14.5379 12.3937 14.9873 12.0715 15.9502C11.7493 16.9131 12.3293 18.0044 13.3604 18.3253L21.2873 20.7005C21.674 20.8289 21.9318 21.214 21.9318 21.6634C21.9174 21.9493 21.9053 22.2857 21.8922 22.6473Z" fill="#A470D5"/>
|
5
|
-
</svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|