Skip to content

Commit

Permalink
fix: update storybook to display components properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Lodin committed Dec 4, 2019
1 parent 41e27dd commit 275a16d
Show file tree
Hide file tree
Showing 24 changed files with 42,195 additions and 123,545 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/node_modules/**/*
**/dist/**/*
docs
*.ts
*.tsx
4 changes: 2 additions & 2 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.js": ["prettier --write", "eslint --fix", "git add"],
"*.+(ts|tsx)": ["prettier --write", "tslint -c tslint.json -p tsconfig.json -t verbose --fix", "git add"]
"+(.storybook|config)/*.js": ["prettier --write", "eslint --fix", "git add"],
"+(__tests__|src)/*.+(ts|tsx)": ["prettier --write", "tslint -c tslint.json -p tsconfig.json -t verbose --fix", "git add"]
}
19 changes: 8 additions & 11 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
const {configure} = require('@storybook/react');
const {setOptions} = require('@storybook/addon-options');
const {addParameters, configure} = require('@storybook/react');

const loadStories = () => {
require('../__stories__');
};

setOptions({
downPanelInRight: true,
name: 'React Virtualized Tree',
selectedAddonPanel: 'knobs',
addParameters({
options: {
addonPanelInRight: true,
name: 'React Virtualized Tree',
selectedPanel: 'knobs',
},
});

configure(loadStories, module);
configure(() => require('../__stories__'), module);
1 change: 1 addition & 0 deletions __stories__/FixedSizeTree.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Tree, {

document.body.style.margin = '0';
document.body.style.display = 'flex';
document.body.style.minHeight = '100%';

const root = document.getElementById('root')!;
root.style.margin = '10px 0 0 10px';
Expand Down
1 change: 1 addition & 0 deletions __stories__/VariableSizeTree.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Tree, {

document.body.style.margin = '0';
document.body.style.display = 'flex';
document.body.style.minHeight = '100vh';

const root = document.getElementById('root')!;
root.style.margin = '10px 0 0 10px';
Expand Down
Binary file modified docs/favicon.ico
Binary file not shown.
35 changes: 21 additions & 14 deletions docs/iframe.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<!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{
width: 100%;
height: 100%;
}

:not(.sb-show-main) > .sb-main,
<!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,
:not(.sb-show-nopreview) > .sb-nopreview,
:not(.sb-show-errordisplay) > .sb-errordisplay {
display: none;
Expand All @@ -16,15 +11,17 @@
left: 0;
right: 0;
padding: 20px;
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
font-family: "Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
overflow: auto;
}

.sb-heading {
font-size: 20px;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.2px;
margin: 10px 0;
padding-right: 25px;
}

.sb-nopreview {
Expand All @@ -45,14 +42,21 @@
}

.sb-errordisplay {
background-color: rgb(187, 49, 49);
color: #FFF;
border: 20px solid rgb(187, 49, 49);
background: #222;
color: #fff;
z-index: 999999;
}

.sb-errordisplay_code {
font-size: 14px;
width: 100vw;
overflow: auto;
padding: 10px;
background: #000;
color: #eee;
font-family: "Operator Mono", "Fira Code Retina", "Fira Code", "FiraCode-Retina", "Andale Mono", "Lucida Console", Consolas, Monaco, monospace;
}

.sb-errordisplay pre {
white-space: pre-wrap;
}</style><script>/* globals window */
/* eslint-disable no-underscore-dangle */
try {
Expand All @@ -63,4 +67,7 @@
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to parent frame for connecting dev tools');
}</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>
}</script><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</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>
7 changes: 5 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html, body {
<!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 {
overflow: hidden;
height: 100%;
width: 100%;
Expand All @@ -14,4 +14,7 @@
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to parent frame for connecting dev tools');
}</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>
}</script><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</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>
12 changes: 0 additions & 12 deletions docs/main.b51de0b427b8cee5563e.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/main.c34778c22b93b5b33871.bundle.js

Large diffs are not rendered by default.

52 changes: 0 additions & 52 deletions docs/main.f2ed6ddd9d54423d6874.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/main.f6a2afd3a50f99e85a4c.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/runtime~main.92b37c20266bfd12acea.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 0 additions & 84 deletions docs/runtime~main.ba735fcc62253c47f409.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/runtime~main.c34778c22b93b5b33871.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 0 additions & 123 deletions docs/runtime~main.f2ed6ddd9d54423d6874.bundle.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sb_dll/storybook_ui-manifest.json

Large diffs are not rendered by default.

Loading

0 comments on commit 275a16d

Please sign in to comment.