Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
feat: Add Storybook and component stories (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylealwyn authored Sep 3, 2019
1 parent d32b931 commit b9378ba
Show file tree
Hide file tree
Showing 95 changed files with 11,741 additions and 18,435 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "sappira/react"
"extends": "sappira/react",
"rules": {
"import/no-named-as-default": 0
}
}
5 changes: 5 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-storysource/register';
import '@storybook/addon-knobs/register';
52 changes: 52 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';
import { configure, addDecorator,addParameters } from '@storybook/react';
import { withA11y } from '@storybook/addon-a11y';
import { withKnobs } from '@storybook/addon-knobs';
import { createGlobalStyle } from 'styled-components';
import { ThemeProvider } from '../src';
import theme from './theme';

const GlobalStyle = createGlobalStyle`
@font-face {
font-family: "Tiempos";
font-weight: 500;
font-style: normal;
src: url(//cdn.heydoctor.com/fonts/TiemposHeadlineWeb-Semibold.woff2) format('woff2');
}
* {
font-family: "Avenir", sans-serif !important;
box-sizing: border-box;
}
h1, h2 {
font-family: "Tiempos", serif !important
}
`;

addParameters({
options: {
theme,
panelPosition: 'right'
},
});

addDecorator(withKnobs);
addDecorator(withA11y);
addDecorator(story => (
<ThemeProvider>
<>
<GlobalStyle />
{story()}
</>
</ThemeProvider>
));

// automatically import all files ending in *.stories.js
configure(
[
require.context('../src', true, /\.stories\.mdx$/),
require.context('../src', true, /\.stories\.js$/),
],
module
);
5 changes: 5 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<style>
.sidebar-subheading {
letter-spacing: 0 !important;
}
</style>
1 change: 1 addition & 0 deletions .storybook/presets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = ['@storybook/addon-docs/react/preset'];
7 changes: 7 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.8.94/css/materialdesignicons.min.css" />

<style>
.sbdocs-p {
font-size: 18px !important;
}
</style>
9 changes: 9 additions & 0 deletions .storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from '@storybook/theming';

export default create({
base: 'light',

brandTitle: 'HeyDoctor',
brandUrl: 'https://www.heydoctor.com',
brandImage: 'https://cdn.heydoctor.com/images/logos/heydoctor-wordmark-dark.svg',
});
8 changes: 0 additions & 8 deletions docs/intro.mdx

This file was deleted.

190 changes: 0 additions & 190 deletions docs/theme.mdx

This file was deleted.

30 changes: 0 additions & 30 deletions docs/wrapper.js

This file was deleted.

39 changes: 0 additions & 39 deletions doczrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
setupFilesAfterEnv: ['react-testing-library/cleanup-after-each', '<rootDir>/test/setup.js'],
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
testMatch: ['<rootDir>/src/**/*.spec.js'],
};
Loading

0 comments on commit b9378ba

Please sign in to comment.