File tree Expand file tree Collapse file tree 2 files changed +36
-16
lines changed Expand file tree Collapse file tree 2 files changed +36
-16
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @lg-tools/storybook ' : patch
3
+ ---
4
+
5
+ Updates README for storybook addon
Original file line number Diff line number Diff line change 1
1
# ` @lg-tools/storybook `
2
2
3
- Shared Storybook configuration for LeafyGreen repositories.
3
+ Storybook addon to share configuration in LeafyGreen repositories.
4
4
5
- ##
5
+ ## Usage
6
6
7
- Install this package, and consume it in your ` .storybook ` config files.
7
+ Install this package, and consume it in your ` .storybook/ ` config files.
8
8
9
- ``` js
9
+ ``` ts
10
10
// .storybook/main.ts
11
-
12
- import main from ' @lg-tools/storybook' ;
13
- export default main ;
11
+ export default {
12
+ addons: [' @lg-tools/storybook' ],
13
+ framework: {
14
+ name: ' @storybook/react-webpack5' ,
15
+ options: {
16
+ fastRefresh: true ,
17
+ strictMode: true ,
18
+ },
19
+ },
20
+ };
14
21
```
15
22
16
- ``` js
17
- // .storybook/manager.js
18
- import { addons } from ' @storybook/addons' ;
23
+ Most parameters ` preview.ts ` will be automatically populated by the addon. However you may want to customize certain things like section ordering:
19
24
20
- import theme from ' @lg-tools/storybook/theme' ;
21
-
22
- addons .setConfig ({
23
- name: ' LeafyGreen UI' ,
24
- theme,
25
- });
25
+ ``` js
26
+ // .storybook/preview.js
27
+ const parameters = {
28
+ options: {
29
+ storySort: {
30
+ method: ' alphabetical' ,
31
+ order: [
32
+ // ... section headers
33
+ ],
34
+ },
35
+ },
36
+ };
37
+
38
+ export default {
39
+ parameters,
40
+ };
26
41
```
You can’t perform that action at this time.
0 commit comments