|
| 1 | +import { Meta } from '@storybook/addon-docs'; |
| 2 | +import Code from './assets/code-brackets.svg'; |
| 3 | +import Colors from './assets/colors.svg'; |
| 4 | +import Comments from './assets/comments.svg'; |
| 5 | +import Direction from './assets/direction.svg'; |
| 6 | +import Flow from './assets/flow.svg'; |
| 7 | +import Plugin from './assets/plugin.svg'; |
| 8 | +import Repo from './assets/repo.svg'; |
| 9 | +import StackAlt from './assets/stackalt.svg'; |
| 10 | + |
| 11 | +<Meta title="Example/Introduction" /> |
| 12 | + |
| 13 | +<style>{` |
| 14 | + .subheading { |
| 15 | + --mediumdark: '#999999'; |
| 16 | + font-weight: 900; |
| 17 | + font-size: 13px; |
| 18 | + color: #999; |
| 19 | + letter-spacing: 6px; |
| 20 | + line-height: 24px; |
| 21 | + text-transform: uppercase; |
| 22 | + margin-bottom: 12px; |
| 23 | + margin-top: 40px; |
| 24 | + } |
| 25 | +
|
| 26 | + .link-list { |
| 27 | + display: grid; |
| 28 | + grid-template-columns: 1fr; |
| 29 | + grid-template-rows: 1fr 1fr; |
| 30 | + row-gap: 10px; |
| 31 | + } |
| 32 | +
|
| 33 | + @media (min-width: 620px) { |
| 34 | + .link-list { |
| 35 | + row-gap: 20px; |
| 36 | + column-gap: 20px; |
| 37 | + grid-template-columns: 1fr 1fr; |
| 38 | + } |
| 39 | + } |
| 40 | +
|
| 41 | + @media all and (-ms-high-contrast:none) { |
| 42 | + .link-list { |
| 43 | + display: -ms-grid; |
| 44 | + -ms-grid-columns: 1fr 1fr; |
| 45 | + -ms-grid-rows: 1fr 1fr; |
| 46 | + } |
| 47 | + } |
| 48 | +
|
| 49 | + .link-item { |
| 50 | + display: block; |
| 51 | + padding: 20px 30px 20px 15px; |
| 52 | + border: 1px solid #00000010; |
| 53 | + border-radius: 5px; |
| 54 | + transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out; |
| 55 | + color: #333333; |
| 56 | + display: flex; |
| 57 | + align-items: flex-start; |
| 58 | + } |
| 59 | +
|
| 60 | + .link-item:hover { |
| 61 | + border-color: #1EA7FD50; |
| 62 | + transform: translate3d(0, -3px, 0); |
| 63 | + box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0; |
| 64 | + } |
| 65 | +
|
| 66 | + .link-item:active { |
| 67 | + border-color: #1EA7FD; |
| 68 | + transform: translate3d(0, 0, 0); |
| 69 | + } |
| 70 | +
|
| 71 | + .link-item strong { |
| 72 | + font-weight: 700; |
| 73 | + display: block; |
| 74 | + margin-bottom: 2px; |
| 75 | + } |
| 76 | +
|
| 77 | + .link-item img { |
| 78 | + height: 40px; |
| 79 | + width: 40px; |
| 80 | + margin-right: 15px; |
| 81 | + flex: none; |
| 82 | + } |
| 83 | +
|
| 84 | + .link-item span { |
| 85 | + font-size: 14px; |
| 86 | + line-height: 20px; |
| 87 | + } |
| 88 | +
|
| 89 | + .tip { |
| 90 | + display: inline-block; |
| 91 | + border-radius: 1em; |
| 92 | + font-size: 11px; |
| 93 | + line-height: 12px; |
| 94 | + font-weight: 700; |
| 95 | + background: #E7FDD8; |
| 96 | + color: #66BF3C; |
| 97 | + padding: 4px 12px; |
| 98 | + margin-right: 10px; |
| 99 | + vertical-align: top; |
| 100 | + } |
| 101 | +
|
| 102 | + .tip-wrapper { |
| 103 | + font-size: 13px; |
| 104 | + line-height: 20px; |
| 105 | + margin-top: 40px; |
| 106 | + margin-bottom: 40px; |
| 107 | + } |
| 108 | +
|
| 109 | + .tip-wrapper code { |
| 110 | + font-size: 12px; |
| 111 | + display: inline-block; |
| 112 | + } |
| 113 | +`}</style> |
| 114 | + |
| 115 | +# Welcome to Storybook |
| 116 | + |
| 117 | +Storybook helps you build UI components in isolation from your app's business logic, data, and context. |
| 118 | +That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. |
| 119 | + |
| 120 | +Browse example stories now by navigating to them in the sidebar. |
| 121 | +View their code in the `src/stories` directory to learn how they work. |
| 122 | +We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. |
| 123 | + |
| 124 | +<div className="subheading">Configure</div> |
| 125 | + |
| 126 | +<div className="link-list"> |
| 127 | + <a |
| 128 | + className="link-item" |
| 129 | + href="https://storybook.js.org/docs/react/addons/addon-types" |
| 130 | + target="_blank" |
| 131 | + > |
| 132 | + <img src={Plugin} alt="plugin" /> |
| 133 | + <span> |
| 134 | + <strong>Presets for popular tools</strong> |
| 135 | + Easy setup for TypeScript, SCSS and more. |
| 136 | + </span> |
| 137 | + </a> |
| 138 | + <a |
| 139 | + className="link-item" |
| 140 | + href="https://storybook.js.org/docs/react/configure/webpack" |
| 141 | + target="_blank" |
| 142 | + > |
| 143 | + <img src={StackAlt} alt="Build" /> |
| 144 | + <span> |
| 145 | + <strong>Build configuration</strong> |
| 146 | + How to customize webpack and Babel |
| 147 | + </span> |
| 148 | + </a> |
| 149 | + <a |
| 150 | + className="link-item" |
| 151 | + href="https://storybook.js.org/docs/react/configure/styling-and-css" |
| 152 | + target="_blank" |
| 153 | + > |
| 154 | + <img src={Colors} alt="colors" /> |
| 155 | + <span> |
| 156 | + <strong>Styling</strong> |
| 157 | + How to load and configure CSS libraries |
| 158 | + </span> |
| 159 | + </a> |
| 160 | + <a |
| 161 | + className="link-item" |
| 162 | + href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack" |
| 163 | + target="_blank" |
| 164 | + > |
| 165 | + <img src={Flow} alt="flow" /> |
| 166 | + <span> |
| 167 | + <strong>Data</strong> |
| 168 | + Providers and mocking for data libraries |
| 169 | + </span> |
| 170 | + </a> |
| 171 | +</div> |
| 172 | + |
| 173 | +<div className="subheading">Learn</div> |
| 174 | + |
| 175 | +<div className="link-list"> |
| 176 | + <a className="link-item" href="https://storybook.js.org/docs" target="_blank"> |
| 177 | + <img src={Repo} alt="repo" /> |
| 178 | + <span> |
| 179 | + <strong>Storybook documentation</strong> |
| 180 | + Configure, customize, and extend |
| 181 | + </span> |
| 182 | + </a> |
| 183 | + <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank"> |
| 184 | + <img src={Direction} alt="direction" /> |
| 185 | + <span> |
| 186 | + <strong>In-depth guides</strong> |
| 187 | + Best practices from leading teams |
| 188 | + </span> |
| 189 | + </a> |
| 190 | + <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank"> |
| 191 | + <img src={Code} alt="code" /> |
| 192 | + <span> |
| 193 | + <strong>GitHub project</strong> |
| 194 | + View the source and add issues |
| 195 | + </span> |
| 196 | + </a> |
| 197 | + <a className="link-item" href="https://discord.gg/storybook" target="_blank"> |
| 198 | + <img src={Comments} alt="comments" /> |
| 199 | + <span> |
| 200 | + <strong>Discord chat</strong> |
| 201 | + Chat with maintainers and the community |
| 202 | + </span> |
| 203 | + </a> |
| 204 | +</div> |
| 205 | + |
| 206 | +<div className="tip-wrapper"> |
| 207 | + <span className="tip">Tip</span>Edit the Markdown in{' '} |
| 208 | + <code>src/stories/Introduction.stories.mdx</code> |
| 209 | +</div> |
0 commit comments