Skip to content

Commit

Permalink
feat: Button component (#1)
Browse files Browse the repository at this point in the history
* Remove node versions that we don't support

* Add MUI and Emotion global styles support to Storybook

* Add Button component

* Change node version for github workflow
  • Loading branch information
KoltonG authored Mar 2, 2021
1 parent f866971 commit 62ab62d
Show file tree
Hide file tree
Showing 23 changed files with 768 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
node: ['14.8.0']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
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://fonts.googleapis.com/icon?family=Material+Icons|Roboto:300,400" />
<script src="https://kit.fontawesome.com/bcd6c71157.js" crossorigin="anonymous"></script>
<style>
#root {
transform: translateX(0);
}
</style>
28 changes: 28 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
import React from 'react';
import { Global, css } from '@emotion/react';
import { muiTheme, globalStyles } from '../';
import { StylesProvider, ThemeProvider as MuiThemeProvider } from '@material-ui/styles';
import { CssBaseline } from '@material-ui/core';

// https://storybook.js.org/docs/react/writing-stories/parameters#global-parameters
export const parameters = {
// https://storybook.js.org/docs/react/essentials/actions#automatically-matching-args
actions: { argTypesRegex: '^on.*' },
options: {
// Order stories in alphabetical order
storySort: (a, b) => (a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true })),
},
};

// https://storybook.js.org/docs/react/writing-stories/decorators#global-decorators
export const decorators = [
(Story) => (
// injects MUI styles first, so emotion styles will override them
<StylesProvider injectFirst>
<MuiThemeProvider theme={muiTheme}>
<Global
styles={css`
${globalStyles}
`}
/>
<CssBaseline />
<Story />
</MuiThemeProvider>
</StylesProvider>
),
];
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .storybook/static/fonts/goodsans-regular.eot
Binary file not shown.
Binary file added .storybook/static/fonts/goodsans-regular.woff
Binary file not shown.
Binary file added .storybook/static/fonts/goodsans-regular.woff2
Binary file not shown.
264 changes: 264 additions & 0 deletions package-lock.json

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

Loading

0 comments on commit 62ab62d

Please sign in to comment.