Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #162 from EmaSuriano/add-storybook-docs
Browse files Browse the repository at this point in the history
docs: Add storybook docs
  • Loading branch information
EmaSuriano authored May 17, 2020
2 parents 6e0a4e8 + a03eb93 commit 91449cd
Show file tree
Hide file tree
Showing 39 changed files with 3,529 additions and 3,873 deletions.
16 changes: 0 additions & 16 deletions .github/main.workflow

This file was deleted.

10 changes: 0 additions & 10 deletions .storybook/config.js

This file was deleted.

4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
stories: ['../stories/*.stories.(js|mdx)'],
addons: ['@storybook/addon-docs'],
};
6 changes: 0 additions & 6 deletions .storybook/preview-head.html

This file was deleted.

9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { addParameters } from '@storybook/react';
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks';

addParameters({
docs: {
container: DocsContainer,
page: DocsPage,
},
});
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build]
publish = "storybook-static"
command = "yarn docs:build"

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
"test:ci": "start-server-and-test 6006",
"lint": "eslint src/**",
"start": "start-storybook -p 6006",
"storybook-build": "build-storybook"
"docs": "start-storybook --docs",
"docs:build": "build-storybook --docs"
},
"peerDependencies": {
"react": "16.x",
"styled-components": "5.x"
},
"devDependencies": {
"@storybook/addon-storyshots": "^5.0.6",
"@storybook/addon-storyshots-puppeteer": "^5.0.6",
"@storybook/react": "^5.0.6",
"@storybook/addon-docs": "^5.3.18",
"@storybook/addon-storyshots": "^5.3.18",
"@storybook/addon-storyshots-puppeteer": "^5.3.18",
"@storybook/react": "^5.3.18",
"babel-jest": "^25.1.0",
"babel-loader": "^8.0.6",
"babel-plugin-require-context-hook": "^1.0.0",
Expand Down
62 changes: 34 additions & 28 deletions stories/Cloudy.stories.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Cloudy } from '../src';
import { CenterContainer, ThemeContainer } from './utils';
import { Cloudy, WeatherThemeProvider } from '../src';
import Center from './helpers/Center';

const theme = {
cloudsColor: 'greenYellow',
backgroundColor: 'honeyDew',
sunColor: 'Orange',
raysColor: 'OrangeRed',
export default {
title: 'Cloudy',
component: Cloudy,
decorators: [storyFn => <Center>{storyFn()}</Center>],
};

storiesOf('Cloudy', module)
.add('Variations', () => (
<CenterContainer>
<Cloudy />
<Cloudy patchy />
</CenterContainer>
))
.add('Different Sizes', () => (
<CenterContainer>
<Cloudy size={0.7} />
<Cloudy />
<Cloudy size={1.3} />
</CenterContainer>
))
.add('Theming', () => (
<ThemeContainer theme={theme}>
<Cloudy />
<Cloudy patchy />
</ThemeContainer>
));
export const Variations = () => (
<>
<Cloudy />
<Cloudy patchy />
</>
);

export const DifferentSizes = () => (
<>
<Cloudy size={0.7} />
<Cloudy />
<Cloudy size={1.3} />
</>
);

export const Theming = () => {
const theme = {
cloudsColor: 'greenYellow',
sunColor: 'Orange',
raysColor: 'OrangeRed',
};

return (
<WeatherThemeProvider theme={theme}>
<Variations />
</WeatherThemeProvider>
);
};
72 changes: 38 additions & 34 deletions stories/Rain.stories.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Rain } from '../src';
import { CenterContainer, ThemeContainer } from './utils';
import { Rain, WeatherThemeProvider } from '../src';
import Center from './helpers/Center';

const theme = {
cloudsColor: 'MidnightBlue',
dropsColor: 'white',
boltColor: 'lightBlue',
backgroundColor: 'Lavender',
sunColor: 'Orange',
raysColor: 'OrangeRed',
export default {
title: 'Rain',
component: Rain,
decorators: [storyFn => <Center>{storyFn()}</Center>],
};

storiesOf('Rain', module)
.add('Variations', () => (
<CenterContainer>
<Rain />
<Rain patchy />
<Rain lighting />
<Rain lighting patchy />
</CenterContainer>
))
.add('Different Sizes', () => (
<CenterContainer>
<Rain size={0.7} />
<Rain />
<Rain size={1.3} />
</CenterContainer>
))
.add('Theming', () => (
<ThemeContainer theme={theme}>
<Rain />
<Rain patchy />
<Rain lighting />
<Rain lighting patchy />
</ThemeContainer>
));
export const Variations = () => (
<>
<Rain />
<Rain patchy />
<Rain lighting />
<Rain lighting patchy />
</>
);

export const DifferentSizes = () => (
<>
<Rain size={0.7} />
<Rain />
<Rain size={1.3} />
</>
);

export const Theming = () => {
const theme = {
cloudsColor: 'MidnightBlue',
dropsColor: 'white',
boltColor: 'lightBlue',
sunColor: 'Orange',
raysColor: 'OrangeRed',
};

return (
<WeatherThemeProvider theme={theme}>
<Variations />
</WeatherThemeProvider>
);
};
64 changes: 35 additions & 29 deletions stories/Snow.stories.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Snow } from '../src';
import { CenterContainer, ThemeContainer } from './utils';
import { Snow, WeatherThemeProvider } from '../src';
import Center from './helpers/Center';

const theme = {
cloudsColor: 'RoyalBlue ',
snowColor: 'SeaGreen ',
backgroundColor: 'PaleGoldenRod',
sunColor: 'Purple',
raysColor: 'RebeccaPurple',
export default {
title: 'Snow',
component: Snow,
decorators: [storyFn => <Center>{storyFn()}</Center>],
};

storiesOf('Snow', module)
.add('Variations', () => (
<CenterContainer>
<Snow />
<Snow patchy />
</CenterContainer>
))
.add('Different Sizes', () => (
<CenterContainer>
<Snow size={0.7} />
<Snow />
<Snow size={1.3} />
</CenterContainer>
))
.add('Theming', () => (
<ThemeContainer theme={theme}>
<Snow />
<Snow patchy />
</ThemeContainer>
));
export const Variations = () => (
<>
<Snow />
<Snow patchy />
</>
);

export const DifferentSizes = () => (
<>
<Snow size={0.7} />
<Snow />
<Snow size={1.3} />
</>
);

export const Theming = () => {
const theme = {
cloudsColor: 'RoyalBlue ',
snowColor: 'SeaGreen ',
sunColor: 'Purple',
raysColor: 'RebeccaPurple',
};

return (
<WeatherThemeProvider theme={theme}>
<Variations />
</WeatherThemeProvider>
);
};
57 changes: 32 additions & 25 deletions stories/Sunny.stories.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
import React from 'react';
import { Sunny } from '../src';
import { storiesOf } from '@storybook/react';
import { CenterContainer, ThemeContainer } from './utils';
import { Sunny, WeatherThemeProvider } from '../src';
import Center from './helpers/Center';

const theme = {
sunColor: 'SkyBlue',
raysColor: 'SlateBlue',
backgroundColor: 'peachPuff',
export default {
title: 'Sunny',
component: Sunny,
decorators: [storyFn => <Center>{storyFn()}</Center>],
};

storiesOf('Sunny', module)
.add('Variations', () => (
<CenterContainer>
<Sunny />
</CenterContainer>
))
.add('Different Sizes', () => (
<CenterContainer>
<Sunny size={0.7} />
<Sunny />
<Sunny size={1.3} />
</CenterContainer>
))
.add('Theming', () => (
<ThemeContainer theme={theme}>
<Sunny />
</ThemeContainer>
));
export const Variations = () => (
<>
<Sunny />
</>
);

export const DifferentSizes = () => (
<>
<Sunny size={0.7} />
<Sunny />
<Sunny size={1.3} />
</>
);

export const Theming = () => {
const theme = {
sunColor: 'SkyBlue',
raysColor: 'SlateBlue',
};

return (
<WeatherThemeProvider theme={theme}>
<Variations />
</WeatherThemeProvider>
);
};
10 changes: 10 additions & 0 deletions stories/helpers/Center.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from 'styled-components';

const Center = styled.div`
text-align: center;
display: flex;
justify-content: center;
align-items: center;
`;

export default Center;
Loading

0 comments on commit 91449cd

Please sign in to comment.