@storybook/react-vite 9.0.0-alpha.1 → 9.0.0-alpha.10

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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from '@storybook/react';
1
2
  export { __definePreview as definePreview } from '@storybook/react';
2
3
  import { StorybookConfig as StorybookConfig$1, TypescriptOptions as TypescriptOptions$1, CompatibleString } from 'storybook/internal/types';
3
4
  import { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var index_exports={};__export(index_exports,{definePreview:()=>import_react.__definePreview});module.exports=__toCommonJS(index_exports);var import_react=require("@storybook/react");0&&(module.exports={definePreview});
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default"));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var index_exports={};__export(index_exports,{definePreview:()=>import_react.__definePreview});module.exports=__toCommonJS(index_exports);__reExport(index_exports,require("@storybook/react"),module.exports);var import_react=require("@storybook/react");0&&(module.exports={definePreview,...require("@storybook/react")});
package/dist/index.mjs CHANGED
@@ -1 +1,2 @@
1
+ export * from '@storybook/react';
1
2
  export { __definePreview as definePreview } from '@storybook/react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-vite",
3
- "version": "9.0.0-alpha.1",
3
+ "version": "9.0.0-alpha.10",
4
4
  "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -56,6 +56,7 @@
56
56
  },
57
57
  "files": [
58
58
  "dist/**/*",
59
+ "template/**/*",
59
60
  "README.md",
60
61
  "*.js",
61
62
  "*.d.ts",
@@ -68,8 +69,8 @@
68
69
  "dependencies": {
69
70
  "@joshwooding/vite-plugin-react-docgen-typescript": "0.5.0",
70
71
  "@rollup/pluginutils": "^5.0.2",
71
- "@storybook/builder-vite": "9.0.0-alpha.1",
72
- "@storybook/react": "9.0.0-alpha.1",
72
+ "@storybook/builder-vite": "9.0.0-alpha.10",
73
+ "@storybook/react": "9.0.0-alpha.10",
73
74
  "find-up": "^5.0.0",
74
75
  "magic-string": "^0.30.0",
75
76
  "react-docgen": "^7.0.0",
@@ -82,17 +83,11 @@
82
83
  "vite": "^4.0.0"
83
84
  },
84
85
  "peerDependencies": {
85
- "@storybook/test": "9.0.0-alpha.1",
86
86
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
87
87
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
88
- "storybook": "^9.0.0-alpha.1",
88
+ "storybook": "^9.0.0-alpha.10",
89
89
  "vite": "^4.0.0 || ^5.0.0 || ^6.0.0"
90
90
  },
91
- "peerDependenciesMeta": {
92
- "@storybook/test": {
93
- "optional": true
94
- }
95
- },
96
91
  "engines": {
97
92
  "node": ">=18.0.0"
98
93
  },
@@ -0,0 +1,5 @@
1
+ {
2
+ "rules": {
3
+ "import/extensions": "off"
4
+ }
5
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ import PropTypes from 'prop-types';
4
+
5
+ import './button.css';
6
+
7
+ /** Primary UI component for user interaction */
8
+ export const Button = ({
9
+ primary = false,
10
+ backgroundColor = null,
11
+ size = 'medium',
12
+ label,
13
+ ...props
14
+ }) => {
15
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
16
+ return (
17
+ <button
18
+ type="button"
19
+ className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
20
+ style={backgroundColor && { backgroundColor }}
21
+ {...props}
22
+ >
23
+ {label}
24
+ </button>
25
+ );
26
+ };
27
+
28
+ Button.propTypes = {
29
+ /** Is this the principal call to action on the page? */
30
+ primary: PropTypes.bool,
31
+ /** What background color to use */
32
+ backgroundColor: PropTypes.string,
33
+ /** How large should the button be? */
34
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
35
+ /** Button contents */
36
+ label: PropTypes.string.isRequired,
37
+ /** Optional click handler */
38
+ onClick: PropTypes.func,
39
+ };
@@ -0,0 +1,49 @@
1
+ import { fn } from 'storybook/test';
2
+
3
+ import { Button } from './Button';
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
6
+ export default {
7
+ title: 'Example/Button',
8
+ component: Button,
9
+ parameters: {
10
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
+ layout: 'centered',
12
+ },
13
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
14
+ tags: ['autodocs'],
15
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
+ argTypes: {
17
+ backgroundColor: { control: 'color' },
18
+ },
19
+ // 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
20
+ args: { onClick: fn() },
21
+ };
22
+
23
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
24
+ export const Primary = {
25
+ args: {
26
+ primary: true,
27
+ label: 'Button',
28
+ },
29
+ };
30
+
31
+ export const Secondary = {
32
+ args: {
33
+ label: 'Button',
34
+ },
35
+ };
36
+
37
+ export const Large = {
38
+ args: {
39
+ size: 'large',
40
+ label: 'Button',
41
+ },
42
+ };
43
+
44
+ export const Small = {
45
+ args: {
46
+ size: 'small',
47
+ label: 'Button',
48
+ },
49
+ };
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+
3
+ import PropTypes from 'prop-types';
4
+
5
+ import { Button } from './Button';
6
+ import './header.css';
7
+
8
+ export const Header = ({ user = null, onLogin, onLogout, onCreateAccount }) => (
9
+ <header>
10
+ <div className="storybook-header">
11
+ <div>
12
+ <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
13
+ <g fill="none" fillRule="evenodd">
14
+ <path
15
+ d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
16
+ fill="#FFF"
17
+ />
18
+ <path
19
+ d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
20
+ fill="#555AB9"
21
+ />
22
+ <path
23
+ d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
24
+ fill="#91BAF8"
25
+ />
26
+ </g>
27
+ </svg>
28
+ <h1>Acme</h1>
29
+ </div>
30
+ <div>
31
+ {user ? (
32
+ <>
33
+ <span className="welcome">
34
+ Welcome, <b>{user.name}</b>!
35
+ </span>
36
+ <Button size="small" onClick={onLogout} label="Log out" />
37
+ </>
38
+ ) : (
39
+ <>
40
+ <Button size="small" onClick={onLogin} label="Log in" />
41
+ <Button primary size="small" onClick={onCreateAccount} label="Sign up" />
42
+ </>
43
+ )}
44
+ </div>
45
+ </div>
46
+ </header>
47
+ );
48
+
49
+ Header.propTypes = {
50
+ user: PropTypes.shape({
51
+ name: PropTypes.string.isRequired,
52
+ }),
53
+ onLogin: PropTypes.func.isRequired,
54
+ onLogout: PropTypes.func.isRequired,
55
+ onCreateAccount: PropTypes.func.isRequired,
56
+ };
@@ -0,0 +1,29 @@
1
+ import { fn } from 'storybook/test';
2
+
3
+ import { Header } from './Header';
4
+
5
+ export default {
6
+ title: 'Example/Header',
7
+ component: Header,
8
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
9
+ tags: ['autodocs'],
10
+ parameters: {
11
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
12
+ layout: 'fullscreen',
13
+ },
14
+ args: {
15
+ onLogin: fn(),
16
+ onLogout: fn(),
17
+ onCreateAccount: fn(),
18
+ },
19
+ };
20
+
21
+ export const LoggedIn = {
22
+ args: {
23
+ user: {
24
+ name: 'Jane Doe',
25
+ },
26
+ },
27
+ };
28
+
29
+ export const LoggedOut = {};
@@ -0,0 +1,69 @@
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
+ };
@@ -0,0 +1,28 @@
1
+ import { expect, userEvent, within } 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 component testing: https://storybook.js.org/docs/writing-tests/component-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
+ };
@@ -0,0 +1,54 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { fn } from 'storybook/test';
4
+
5
+ import { Button } from './Button';
6
+
7
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
8
+ const meta = {
9
+ title: 'Example/Button',
10
+ component: Button,
11
+ parameters: {
12
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13
+ layout: 'centered',
14
+ },
15
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
16
+ tags: ['autodocs'],
17
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
18
+ argTypes: {
19
+ backgroundColor: { control: 'color' },
20
+ },
21
+ // 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
22
+ args: { onClick: fn() },
23
+ } satisfies Meta<typeof Button>;
24
+
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+
28
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
+ export const Primary: Story = {
30
+ args: {
31
+ primary: true,
32
+ label: 'Button',
33
+ },
34
+ };
35
+
36
+ export const Secondary: Story = {
37
+ args: {
38
+ label: 'Button',
39
+ },
40
+ };
41
+
42
+ export const Large: Story = {
43
+ args: {
44
+ size: 'large',
45
+ label: 'Button',
46
+ },
47
+ };
48
+
49
+ export const Small: Story = {
50
+ args: {
51
+ size: 'small',
52
+ label: 'Button',
53
+ },
54
+ };
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+
3
+ import './button.css';
4
+
5
+ export interface ButtonProps {
6
+ /** Is this the principal call to action on the page? */
7
+ primary?: boolean;
8
+ /** What background color to use */
9
+ backgroundColor?: string;
10
+ /** How large should the button be? */
11
+ size?: 'small' | 'medium' | 'large';
12
+ /** Button contents */
13
+ label: string;
14
+ /** Optional click handler */
15
+ onClick?: () => void;
16
+ }
17
+
18
+ /** Primary UI component for user interaction */
19
+ export const Button = ({
20
+ primary = false,
21
+ size = 'medium',
22
+ backgroundColor,
23
+ label,
24
+ ...props
25
+ }: ButtonProps) => {
26
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
27
+ return (
28
+ <button
29
+ type="button"
30
+ className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
31
+ style={{ backgroundColor }}
32
+ {...props}
33
+ >
34
+ {label}
35
+ </button>
36
+ );
37
+ };
@@ -0,0 +1,34 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { fn } from 'storybook/test';
4
+
5
+ import { Header } from './Header';
6
+
7
+ const meta = {
8
+ title: 'Example/Header',
9
+ component: Header,
10
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
11
+ tags: ['autodocs'],
12
+ parameters: {
13
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
14
+ layout: 'fullscreen',
15
+ },
16
+ args: {
17
+ onLogin: fn(),
18
+ onLogout: fn(),
19
+ onCreateAccount: fn(),
20
+ },
21
+ } satisfies Meta<typeof Header>;
22
+
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ export const LoggedIn: Story = {
27
+ args: {
28
+ user: {
29
+ name: 'Jane Doe',
30
+ },
31
+ },
32
+ };
33
+
34
+ export const LoggedOut: Story = {};
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+
3
+ import { Button } from './Button';
4
+ import './header.css';
5
+
6
+ type User = {
7
+ name: string;
8
+ };
9
+
10
+ export interface HeaderProps {
11
+ user?: User;
12
+ onLogin?: () => void;
13
+ onLogout?: () => void;
14
+ onCreateAccount?: () => void;
15
+ }
16
+
17
+ export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => (
18
+ <header>
19
+ <div className="storybook-header">
20
+ <div>
21
+ <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
22
+ <g fill="none" fillRule="evenodd">
23
+ <path
24
+ d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
25
+ fill="#FFF"
26
+ />
27
+ <path
28
+ d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
29
+ fill="#555AB9"
30
+ />
31
+ <path
32
+ d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
33
+ fill="#91BAF8"
34
+ />
35
+ </g>
36
+ </svg>
37
+ <h1>Acme</h1>
38
+ </div>
39
+ <div>
40
+ {user ? (
41
+ <>
42
+ <span className="welcome">
43
+ Welcome, <b>{user.name}</b>!
44
+ </span>
45
+ <Button size="small" onClick={onLogout} label="Log out" />
46
+ </>
47
+ ) : (
48
+ <>
49
+ <Button size="small" onClick={onLogin} label="Log in" />
50
+ <Button primary size="small" onClick={onCreateAccount} label="Sign up" />
51
+ </>
52
+ )}
53
+ </div>
54
+ </div>
55
+ </header>
56
+ );
@@ -0,0 +1,33 @@
1
+ import { expect, userEvent, within } from '@storybook/test';
2
+
3
+ import type { Meta, StoryObj } from '@storybook/react-vite';
4
+
5
+ import { Page } from './Page';
6
+
7
+ const meta = {
8
+ title: 'Example/Page',
9
+ component: Page,
10
+ parameters: {
11
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
12
+ layout: 'fullscreen',
13
+ },
14
+ } satisfies Meta<typeof Page>;
15
+
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+
19
+ export const LoggedOut: Story = {};
20
+
21
+ // More on component testing: https://storybook.js.org/docs/writing-tests/component-testing
22
+ export const LoggedIn: Story = {
23
+ play: async ({ canvasElement }) => {
24
+ const canvas = within(canvasElement);
25
+ const loginButton = canvas.getByRole('button', { name: /Log in/i });
26
+ await expect(loginButton).toBeInTheDocument();
27
+ await userEvent.click(loginButton);
28
+ await expect(loginButton).not.toBeInTheDocument();
29
+
30
+ const logoutButton = canvas.getByRole('button', { name: /Log out/i });
31
+ await expect(logoutButton).toBeInTheDocument();
32
+ },
33
+ };
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+
3
+ import { Header } from './Header';
4
+ import './page.css';
5
+
6
+ type User = {
7
+ name: string;
8
+ };
9
+
10
+ export const Page: React.FC = () => {
11
+ const [user, setUser] = React.useState<User>();
12
+
13
+ return (
14
+ <article>
15
+ <Header
16
+ user={user}
17
+ onLogin={() => setUser({ name: 'Jane Doe' })}
18
+ onLogout={() => setUser(undefined)}
19
+ onCreateAccount={() => setUser({ name: 'Jane Doe' })}
20
+ />
21
+
22
+ <section className="storybook-page">
23
+ <h2>Pages in Storybook</h2>
24
+ <p>
25
+ We recommend building UIs with a{' '}
26
+ <a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
27
+ <strong>component-driven</strong>
28
+ </a>{' '}
29
+ process starting with atomic components and ending with pages.
30
+ </p>
31
+ <p>
32
+ Render pages with mock data. This makes it easy to build and review page states without
33
+ needing to navigate to them in your app. Here are some handy patterns for managing page
34
+ data in Storybook:
35
+ </p>
36
+ <ul>
37
+ <li>
38
+ Use a higher-level connected component. Storybook helps you compose such data from the
39
+ "args" of child component stories
40
+ </li>
41
+ <li>
42
+ Assemble data in the page component from your services. You can mock these services out
43
+ using Storybook.
44
+ </li>
45
+ </ul>
46
+ <p>
47
+ Get a guided tutorial on component-driven development at{' '}
48
+ <a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
49
+ Storybook tutorials
50
+ </a>
51
+ . Read more in the{' '}
52
+ <a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">
53
+ docs
54
+ </a>
55
+ .
56
+ </p>
57
+ <div className="tip-wrapper">
58
+ <span className="tip">Tip</span> Adjust the width of the canvas with the{' '}
59
+ <svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
60
+ <g fill="none" fillRule="evenodd">
61
+ <path
62
+ 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"
63
+ id="a"
64
+ fill="#999"
65
+ />
66
+ </g>
67
+ </svg>
68
+ Viewports addon in the toolbar
69
+ </div>
70
+ </section>
71
+ </article>
72
+ );
73
+ };