Skip to content

Commit 275a16d

Browse files
committed
fix: update storybook to display components properly
1 parent 41e27dd commit 275a16d

24 files changed

+42195
-123545
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/node_modules/**/*
22
**/dist/**/*
3+
docs
34
*.ts
45
*.tsx

.lintstagedrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"*.js": ["prettier --write", "eslint --fix", "git add"],
3-
"*.+(ts|tsx)": ["prettier --write", "tslint -c tslint.json -p tsconfig.json -t verbose --fix", "git add"]
2+
"+(.storybook|config)/*.js": ["prettier --write", "eslint --fix", "git add"],
3+
"+(__tests__|src)/*.+(ts|tsx)": ["prettier --write", "tslint -c tslint.json -p tsconfig.json -t verbose --fix", "git add"]
44
}

.storybook/config.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
const {configure} = require('@storybook/react');
2-
const {setOptions} = require('@storybook/addon-options');
1+
const {addParameters, configure} = require('@storybook/react');
32

4-
const loadStories = () => {
5-
require('../__stories__');
6-
};
7-
8-
setOptions({
9-
downPanelInRight: true,
10-
name: 'React Virtualized Tree',
11-
selectedAddonPanel: 'knobs',
3+
addParameters({
4+
options: {
5+
addonPanelInRight: true,
6+
name: 'React Virtualized Tree',
7+
selectedPanel: 'knobs',
8+
},
129
});
1310

14-
configure(loadStories, module);
11+
configure(() => require('../__stories__'), module);

__stories__/FixedSizeTree.story.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Tree, {
99

1010
document.body.style.margin = '0';
1111
document.body.style.display = 'flex';
12+
document.body.style.minHeight = '100%';
1213

1314
const root = document.getElementById('root')!;
1415
root.style.margin = '10px 0 0 10px';

__stories__/VariableSizeTree.story.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Tree, {
99

1010
document.body.style.margin = '0';
1111
document.body.style.display = 'flex';
12+
document.body.style.minHeight = '100vh';
1213

1314
const root = document.getElementById('root')!;
1415
root.style.margin = '10px 0 0 10px';

docs/favicon.ico

28 KB
Binary file not shown.

docs/iframe.html

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><base target="_parent"><style>html, body{
2-
width: 100%;
3-
height: 100%;
4-
}
5-
6-
:not(.sb-show-main) > .sb-main,
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><base target="_parent"><style>:not(.sb-show-main) > .sb-main,
72
:not(.sb-show-nopreview) > .sb-nopreview,
83
:not(.sb-show-errordisplay) > .sb-errordisplay {
94
display: none;
@@ -16,15 +11,17 @@
1611
left: 0;
1712
right: 0;
1813
padding: 20px;
19-
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
14+
font-family: "Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
2015
-webkit-font-smoothing: antialiased;
16+
overflow: auto;
2117
}
2218

2319
.sb-heading {
24-
font-size: 20px;
20+
font-size: 14px;
2521
font-weight: 600;
2622
letter-spacing: 0.2px;
2723
margin: 10px 0;
24+
padding-right: 25px;
2825
}
2926

3027
.sb-nopreview {
@@ -45,14 +42,21 @@
4542
}
4643

4744
.sb-errordisplay {
48-
background-color: rgb(187, 49, 49);
49-
color: #FFF;
45+
border: 20px solid rgb(187, 49, 49);
46+
background: #222;
47+
color: #fff;
48+
z-index: 999999;
5049
}
5150

5251
.sb-errordisplay_code {
53-
font-size: 14px;
54-
width: 100vw;
55-
overflow: auto;
52+
padding: 10px;
53+
background: #000;
54+
color: #eee;
55+
font-family: "Operator Mono", "Fira Code Retina", "Fira Code", "FiraCode-Retina", "Andale Mono", "Lucida Console", Consolas, Monaco, monospace;
56+
}
57+
58+
.sb-errordisplay pre {
59+
white-space: pre-wrap;
5660
}</style><script>/* globals window */
5761
/* eslint-disable no-underscore-dangle */
5862
try {
@@ -63,4 +67,7 @@
6367
} catch (e) {
6468
// eslint-disable-next-line no-console
6569
console.warn('unable to connect to parent frame for connecting dev tools');
66-
}</script></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><div id="error-message" class="sb-heading"></div><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><script src="runtime~main.f2ed6ddd9d54423d6874.bundle.js"></script><script src="vendors~main.f2ed6ddd9d54423d6874.bundle.js"></script><script src="main.f2ed6ddd9d54423d6874.bundle.js"></script></body></html>
70+
}</script><style>#root[hidden],
71+
#docs-root[hidden] {
72+
display: none !important;
73+
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.c34778c22b93b5b33871.bundle.js"></script><script src="vendors~main.c34778c22b93b5b33871.bundle.js"></script><script src="main.c34778c22b93b5b33871.bundle.js"></script></body></html>

docs/index.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html, body {
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html, body {
22
overflow: hidden;
33
height: 100%;
44
width: 100%;
@@ -14,4 +14,7 @@
1414
} catch (e) {
1515
// eslint-disable-next-line no-console
1616
console.warn('unable to connect to parent frame for connecting dev tools');
17-
}</script></head><body><div id="root"></div><script src="runtime~main.ba735fcc62253c47f409.bundle.js"></script><script src="vendors~main.9bfa47ef29a14e2544a9.bundle.js"></script><script src="main.b51de0b427b8cee5563e.bundle.js"></script></body></html>
17+
}</script><style>#root[hidden],
18+
#docs-root[hidden] {
19+
display: none !important;
20+
}</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['DOCS_MODE'] = false;</script><script src="runtime~main.92b37c20266bfd12acea.bundle.js"></script><script src="vendors~main.89efd9c7666afa8ce0e2.bundle.js"></script><script src="main.f6a2afd3a50f99e85a4c.bundle.js"></script></body></html>

docs/main.b51de0b427b8cee5563e.bundle.js

-12
This file was deleted.

docs/main.c34778c22b93b5b33871.bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.f2ed6ddd9d54423d6874.bundle.js

-52
This file was deleted.

docs/main.f6a2afd3a50f99e85a4c.bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.92b37c20266bfd12acea.bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.ba735fcc62253c47f409.bundle.js

-84
This file was deleted.

docs/runtime~main.c34778c22b93b5b33871.bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.f2ed6ddd9d54423d6874.bundle.js

-123
This file was deleted.

docs/sb_dll/storybook_ui-manifest.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)