feature/tauri-js-rs
mdx 446 lines 12.5 KB
Raw
1 import { Meta } from "@storybook/blocks";
2 import Image from "next/image";
3
4 import Github from "./assets/github.svg";
5 import Discord from "./assets/discord.svg";
6 import Youtube from "./assets/youtube.svg";
7 import Tutorials from "./assets/tutorials.svg";
8 import Styling from "./assets/styling.png";
9 import Context from "./assets/context.png";
10 import Assets from "./assets/assets.png";
11 import Docs from "./assets/docs.png";
12 import Share from "./assets/share.png";
13 import FigmaPlugin from "./assets/figma-plugin.png";
14 import Testing from "./assets/testing.png";
15 import Accessibility from "./assets/accessibility.png";
16 import Theming from "./assets/theming.png";
17 import AddonLibrary from "./assets/addon-library.png";
18
19 export const RightArrow = () => <svg
20 viewBox="0 0 14 14"
21 width="8px"
22 height="14px"
23 style={{
24 marginLeft: '4px',
25 display: 'inline-block',
26 shapeRendering: 'inherit',
27 verticalAlign: 'middle',
28 fill: 'currentColor',
29 'path fill': 'currentColor'
30 }}
31 >
32 <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" />
33 </svg>
34
35 <Meta title="Configure your project" />
36
37 <div className="sb-container">
38 <div className='sb-section-title'>
39 # Configure your project
40
41 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.
42 </div>
43 <div className="sb-section">
44 <div className="sb-section-item">
45 <Image
46 src={Styling}
47 alt="A wall of logos representing different styling technologies"
48 width={0}
49 height={0}
50 style={{ width: '100%', height: 'auto' }}
51 />
52 <h4 className="sb-section-item-heading">Add styling and CSS</h4>
53 <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>
54 <a
55 href="https://storybook.js.org/docs/configure/styling-and-css"
56 target="_blank"
57 >Learn more<RightArrow /></a>
58 </div>
59 <div className="sb-section-item">
60 <Image
61 width={0}
62 height={0}
63 style={{ width: '100%', height: 'auto' }}
64 src={Context}
65 alt="An abstraction representing the composition of data for a component"
66 />
67 <h4 className="sb-section-item-heading">Provide context and mocking</h4>
68 <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>
69 <a
70 href="https://storybook.js.org/docs/writing-stories/decorators#context-for-mocking"
71 target="_blank"
72 >Learn more<RightArrow /></a>
73 </div>
74 <div className="sb-section-item">
75 <Image
76 width={0}
77 height={0}
78 style={{ width: '100%', height: 'auto' }}
79 src={Assets}
80 alt="A representation of typography and image assets"
81 />
82 <div>
83 <h4 className="sb-section-item-heading">Load assets and resources</h4>
84 <p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
85 `staticDirs` configuration option to specify folders to load when
86 starting Storybook.</p>
87 <a
88 href="https://storybook.js.org/docs/configure/images-and-assets"
89 target="_blank"
90 >Learn more<RightArrow /></a>
91 </div>
92 </div>
93 </div>
94 </div>
95 <div className="sb-container">
96 <div className='sb-section-title'>
97 # Do more with Storybook
98
99 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.
100 </div>
101
102 <div className="sb-section">
103 <div className="sb-features-grid">
104 <div className="sb-grid-item">
105 <Image
106 width={0}
107 height={0}
108 style={{ width: '100%', height: 'auto' }}
109 src={Docs}
110 alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated"
111 />
112 <h4 className="sb-section-item-heading">Autodocs</h4>
113 <p className="sb-section-item-paragraph">Auto-generate living,
114 interactive reference documentation from your components and stories.</p>
115 <a
116 href="https://storybook.js.org/docs/writing-docs/autodocs"
117 target="_blank"
118 >Learn more<RightArrow /></a>
119 </div>
120 <div className="sb-grid-item">
121 <Image
122 width={0}
123 height={0}
124 style={{ width: '100%', height: 'auto' }}
125 src={Share}
126 alt="A browser window showing a Storybook being published to a chromatic.com URL"
127 />
128 <h4 className="sb-section-item-heading">Publish to Chromatic</h4>
129 <p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
130 <a
131 href="https://storybook.js.org/docs/sharing/publish-storybook#publish-storybook-with-chromatic"
132 target="_blank"
133 >Learn more<RightArrow /></a>
134 </div>
135 <div className="sb-grid-item">
136 <Image
137 width={0}
138 height={0}
139 style={{ width: '100%', height: 'auto' }}
140 src={FigmaPlugin}
141 alt="Windows showing the Storybook plugin in Figma"
142 />
143 <h4 className="sb-section-item-heading">Figma Plugin</h4>
144 <p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
145 implementation in one place.</p>
146 <a
147 href="https://storybook.js.org/docs/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
148 target="_blank"
149 >Learn more<RightArrow /></a>
150 </div>
151 <div className="sb-grid-item">
152 <Image
153 width={0}
154 height={0}
155 style={{ width: '100%', height: 'auto' }}
156 src={Testing}
157 alt="Screenshot of tests passing and failing"
158 />
159 <h4 className="sb-section-item-heading">Testing</h4>
160 <p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
161 complex.</p>
162 <a
163 href="https://storybook.js.org/docs/writing-tests"
164 target="_blank"
165 >Learn more<RightArrow /></a>
166 </div>
167 <div className="sb-grid-item">
168 <Image
169 width={0}
170 height={0}
171 style={{ width: '100%', height: 'auto' }}
172 src={Accessibility}
173 alt="Screenshot of accessibility tests passing and failing"
174 />
175 <h4 className="sb-section-item-heading">Accessibility</h4>
176 <p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
177 <a
178 href="https://storybook.js.org/docs/writing-tests/accessibility-testing"
179 target="_blank"
180 >Learn more<RightArrow /></a>
181 </div>
182 <div className="sb-grid-item">
183 <Image
184 width={0}
185 height={0}
186 style={{ width: '100%', height: 'auto' }}
187 src={Theming}
188 alt="Screenshot of Storybook in light and dark mode"
189 />
190 <h4 className="sb-section-item-heading">Theming</h4>
191 <p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
192 <a
193 href="https://storybook.js.org/docs/configure/theming"
194 target="_blank"
195 >Learn more<RightArrow /></a>
196 </div>
197 </div>
198 </div>
199 </div>
200 <div className='sb-addon'>
201 <div className='sb-addon-text'>
202 <h4>Addons</h4>
203 <p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
204 <a
205 href="https://storybook.js.org/integrations/"
206 target="_blank"
207 >Discover all addons<RightArrow /></a>
208 </div>
209 <div className='sb-addon-img'>
210 <Image
211 width={650}
212 height={347}
213 src={AddonLibrary}
214 alt="Integrate your tools with Storybook to connect workflows."
215 />
216 </div>
217 </div>
218
219 <div className="sb-section sb-socials">
220 <div className="sb-section-item">
221 <Image
222 width={32}
223 height={32}
224 layout="fixed"
225 src={Github}
226 alt="Github logo"
227 className="sb-explore-image"
228 />
229 Join our contributors building the future of UI development.
230
231 <a
232 href="https://github.com/storybookjs/storybook"
233 target="_blank"
234 >Star on GitHub<RightArrow /></a>
235 </div>
236 <div className="sb-section-item">
237 <Image
238 width={33}
239 height={32}
240 layout="fixed"
241 src={Discord}
242 alt="Discord logo"
243 className="sb-explore-image"
244 />
245 <div>
246 Get support and chat with frontend developers.
247
248 <a
249 href="https://discord.gg/storybook"
250 target="_blank"
251 >Join Discord server<RightArrow /></a>
252 </div>
253 </div>
254 <div className="sb-section-item">
255 <Image
256 width={32}
257 height={32}
258 layout="fixed"
259 src={Youtube}
260 alt="Youtube logo"
261 className="sb-explore-image"
262 />
263 <div>
264 Watch tutorials, feature previews and interviews.
265
266 <a
267 href="https://www.youtube.com/@chromaticui"
268 target="_blank"
269 >Watch on YouTube<RightArrow /></a>
270 </div>
271 </div>
272 <div className="sb-section-item">
273 <Image
274 width={33}
275 height={32}
276 layout="fixed"
277 src={Tutorials}
278 alt="A book"
279 className="sb-explore-image"
280 />
281 <p>Follow guided walkthroughs on for key workflows.</p>
282
283 <a
284 href="https://storybook.js.org/tutorials/"
285 target="_blank"
286 >Discover tutorials<RightArrow /></a>
287 </div>
288 </div>
289
290 <style>
291 {`
292 .sb-container {
293 margin-bottom: 48px;
294 }
295
296 .sb-section {
297 width: 100%;
298 display: flex;
299 flex-direction: row;
300 gap: 20px;
301 }
302
303 img {
304 object-fit: cover;
305 }
306
307 .sb-section-title {
308 margin-bottom: 32px;
309 }
310
311 .sb-section a:not(h1 a, h2 a, h3 a) {
312 font-size: 14px;
313 }
314
315 .sb-section-item, .sb-grid-item {
316 flex: 1;
317 display: flex;
318 flex-direction: column;
319 }
320
321 .sb-section-item-heading {
322 padding-top: 20px !important;
323 padding-bottom: 5px !important;
324 margin: 0 !important;
325 }
326 .sb-section-item-paragraph {
327 margin: 0;
328 padding-bottom: 10px;
329 }
330
331 .sb-chevron {
332 margin-left: 5px;
333 }
334
335 .sb-features-grid {
336 display: grid;
337 grid-template-columns: repeat(2, 1fr);
338 grid-gap: 32px 20px;
339 }
340
341 .sb-socials {
342 display: grid;
343 grid-template-columns: repeat(4, 1fr);
344 }
345
346 .sb-socials p {
347 margin-bottom: 10px;
348 }
349
350 .sb-explore-image {
351 max-height: 32px;
352 align-self: flex-start;
353 }
354
355 .sb-addon {
356 width: 100%;
357 display: flex;
358 align-items: center;
359 position: relative;
360 background-color: #EEF3F8;
361 border-radius: 5px;
362 border: 1px solid rgba(0, 0, 0, 0.05);
363 background: #EEF3F8;
364 height: 180px;
365 margin-bottom: 48px;
366 overflow: hidden;
367 }
368
369 .sb-addon-text {
370 padding-left: 48px;
371 max-width: 240px;
372 }
373
374 .sb-addon-text h4 {
375 padding-top: 0px;
376 }
377
378 .sb-addon-img {
379 position: absolute;
380 left: 345px;
381 top: 0;
382 height: 100%;
383 width: 200%;
384 overflow: hidden;
385 }
386
387 .sb-addon-img img {
388 width: 650px;
389 transform: rotate(-15deg);
390 margin-left: 40px;
391 margin-top: -72px;
392 box-shadow: 0 0 1px rgba(255, 255, 255, 0);
393 backface-visibility: hidden;
394 }
395
396 @media screen and (max-width: 800px) {
397 .sb-addon-img {
398 left: 300px;
399 }
400 }
401
402 @media screen and (max-width: 600px) {
403 .sb-section {
404 flex-direction: column;
405 }
406
407 .sb-features-grid {
408 grid-template-columns: repeat(1, 1fr);
409 }
410
411 .sb-socials {
412 grid-template-columns: repeat(2, 1fr);
413 }
414
415 .sb-addon {
416 height: 280px;
417 align-items: flex-start;
418 padding-top: 32px;
419 overflow: hidden;
420 }
421
422 .sb-addon-text {
423 padding-left: 24px;
424 }
425
426 .sb-addon-img {
427 right: 0;
428 left: 0;
429 top: 130px;
430 bottom: 0;
431 overflow: hidden;
432 height: auto;
433 width: 124%;
434 }
435
436 .sb-addon-img img {
437 width: 1200px;
438 transform: rotate(-12deg);
439 margin-left: 0;
440 margin-top: 48px;
441 margin-bottom: -40px;
442 margin-left: -24px;
443 }
444 }
445 `}
446 </style>