Skip to content

Commit 290fdb4

Browse files
authored
Initial commit
0 parents  commit 290fdb4

27 files changed

+49121
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
build/
3+
storybook-static/

.storybook/main.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
stories: ["../src/**/*.stories.tsx"],
5+
// Add any Storybook addons you want here: https://storybook.js.org/addons/
6+
addons: [],
7+
webpackFinal: async (config) => {
8+
config.module.rules.push({
9+
test: /\.scss$/,
10+
use: ["style-loader", "css-loader", "sass-loader"],
11+
include: path.resolve(__dirname, "../")
12+
});
13+
14+
config.module.rules.push({
15+
test: /\.(ts|tsx)$/,
16+
loader: require.resolve("babel-loader"),
17+
options: {
18+
presets: [["react-app", { flow: false, typescript: true }]]
19+
}
20+
});
21+
config.resolve.extensions.push(".ts", ".tsx");
22+
23+
return config;
24+
}
25+
};

.storybook/preview.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* Read https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
3+
* for more information about the purpose of this file.
4+
*
5+
* Use preview.js for global code (such as CSS imports or JavaScript mocks)
6+
* that applies to all stories. For example, `import thirdPartyCss.css`.
7+
*
8+
* This file can have three exports:
9+
* - decorators - an array of global decorators
10+
* - parameters - an object of global parameters
11+
* - globalTypes - definition of globalTypes
12+
*/
13+
14+
/**
15+
* Decorators
16+
*
17+
* A decorator is a way to wrap a story in extra “rendering” functionality.
18+
*
19+
* Example:
20+
*
21+
* import React from 'react';
22+
* export const decorators = [(Story) => <div style={{ margin: '3em' }}><Story/></div>];
23+
*
24+
* Each story throughout the library will be wrapped in a div with a margin of 3
25+
*/
26+
27+
/**
28+
* Parameters
29+
*
30+
* Most Storybook addons are configured via a parameter-based API.
31+
* You can set global parameters in this file
32+
*
33+
* export const parameters = {
34+
* backgrounds: {
35+
* values: [
36+
* { name: 'red', value: '#f00' },
37+
* { name: 'green', value: '#0f0' },
38+
* ],
39+
* },
40+
* };
41+
*
42+
* With backgrounds, you configure the list of backgrounds that every story can render in.
43+
*/
44+
45+
/**
46+
* Global Types
47+
*
48+
* Global Types allow you to add your own toolbars by creating
49+
* globalTypes with a toolbar annotation:
50+
*
51+
* For example:
52+
*
53+
* export const globalTypes = {
54+
* theme: {
55+
* name: 'Theme',
56+
* description: 'Global theme for components',
57+
* defaultValue: 'light',
58+
* toolbar: {
59+
* icon: 'circlehollow',
60+
* // array of plain string values or MenuItem shape
61+
* items: ['light', 'dark'],
62+
* },
63+
* },
64+
* };
65+
*
66+
* Will add a new dropdown in your toolbar with options light and dark.
67+
**/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Harvey Delaney
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)