-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from domjacks/switch-to-csf
Simplified story loading as it was broken
- Loading branch information
Showing
7 changed files
with
70 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
module.exports = ['@storybook/addon-docs/react/preset']; | ||
module.exports = [ | ||
{ | ||
name: '@storybook/addon-docs/react/preset', | ||
options: { | ||
sourceLoaderOptions: null, | ||
}, | ||
}, | ||
]; |
2 changes: 1 addition & 1 deletion
2
src/components/button/stories.tsx → src/components/button/button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, { FC } from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import styled from 'styled-components'; | ||
import { Paragraph } from '../../components'; | ||
import { colors } from './colors'; | ||
|
||
interface CircleProps { | ||
color: string; | ||
} | ||
|
||
const StyledCircle = styled.div<CircleProps>` | ||
height: 100px; | ||
width: 100px; | ||
margin: 20px; | ||
border-radius: 50%; | ||
background-color: ${props => props.color}; | ||
`; | ||
|
||
const StyledParagraph = styled(Paragraph)<{ color: string }>` | ||
color: ${props => props.color}; | ||
line-height: 100px; | ||
`; | ||
|
||
const Container = styled.div<{ color?: string }>` | ||
background-color: ${props => props.color}; | ||
padding: 20px; | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
`; | ||
|
||
const Circle: FC<CircleProps> = ({ color }) => { | ||
return <StyledCircle color={color} />; | ||
}; | ||
|
||
export default { title: 'Tokens | Colors' }; | ||
|
||
export const palette = () => ( | ||
<Container> | ||
<StyledParagraph color={colors.light.body}>Light</StyledParagraph> | ||
<StyledParagraph color={colors.light.body}>Dark</StyledParagraph> | ||
|
||
<Container color={colors.light.accent}> | ||
<Circle color={colors.light.primary} /> | ||
<StyledParagraph color={colors.light.body}>Primary</StyledParagraph> | ||
<Circle color={colors.light.secondary} /> | ||
<StyledParagraph color={colors.light.body}>Secondary</StyledParagraph> | ||
<Circle color={colors.light.body} /> | ||
<StyledParagraph color={colors.light.body}>Body</StyledParagraph> | ||
</Container> | ||
|
||
<Container color={colors.dark.accent}> | ||
<Circle color={colors.dark.primary} /> | ||
<StyledParagraph color={colors.dark.body}>Primary</StyledParagraph> | ||
<Circle color={colors.dark.secondary} /> | ||
<StyledParagraph color={colors.dark.body}>Secondary</StyledParagraph> | ||
<Circle color={colors.dark.body} /> | ||
<StyledParagraph color={colors.dark.body}>Body</StyledParagraph> | ||
</Container> | ||
</Container> | ||
); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.