-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
6,287 additions
and
228 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
stories: ['../packages/ui/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
typescript: { | ||
check: false, | ||
checkOptions: {}, | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
shouldExtractLiteralValuesFromEnum: true, | ||
propFilter: prop => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true), | ||
}, | ||
}, | ||
}; |
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,10 @@ | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} |
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
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,119 +1,119 @@ | ||
const _typography = { | ||
letterSpacings: { | ||
tighter: '-0.02em', | ||
tight: '-0.01em', | ||
normal: '0', | ||
wide: '0.025em', | ||
wider: '0.05em', | ||
widest: '0.1em', | ||
}, | ||
lineHeights: { | ||
normal: 'normal', | ||
none: '1', | ||
shorter: '1.333', | ||
short: '1.4', | ||
base: '1.5', | ||
tall: '1.625', | ||
taller: '2', | ||
}, | ||
fontWeights: { | ||
hairline: 100, | ||
thin: 200, | ||
light: 300, | ||
normal: 400, | ||
medium: 500, | ||
semibold: 600, | ||
bold: 700, | ||
extrabold: 800, | ||
black: 900, | ||
}, | ||
fonts: { | ||
heading: | ||
'"Open Sauce", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', | ||
body: | ||
'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', | ||
mono: 'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace', | ||
}, | ||
fontSizes: [ | ||
'12px', | ||
'14px', | ||
'16px', | ||
'20px', | ||
'24px', | ||
'28px', | ||
'32px', | ||
'36px', | ||
'48px', | ||
'64px', | ||
'96px', | ||
'128px', | ||
], | ||
letterSpacings: { | ||
tighter: '-0.02em', | ||
tight: '-0.01em', | ||
normal: '0', | ||
wide: '0.025em', | ||
wider: '0.05em', | ||
widest: '0.1em', | ||
}, | ||
lineHeights: { | ||
normal: 'normal', | ||
none: '1', | ||
shorter: '1.333', | ||
short: '1.4', | ||
base: '1.5', | ||
tall: '1.625', | ||
taller: '2', | ||
}, | ||
fontWeights: { | ||
hairline: 100, | ||
thin: 200, | ||
light: 300, | ||
normal: 400, | ||
medium: 500, | ||
semibold: 600, | ||
bold: 700, | ||
extrabold: 800, | ||
black: 900, | ||
}, | ||
fonts: { | ||
heading: | ||
'"Open Sauce", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', | ||
body: | ||
'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', | ||
mono: 'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace', | ||
}, | ||
fontSizes: [ | ||
'12px', | ||
'14px', | ||
'16px', | ||
'20px', | ||
'24px', | ||
'28px', | ||
'32px', | ||
'36px', | ||
'48px', | ||
'64px', | ||
'96px', | ||
'128px', | ||
], | ||
}; | ||
|
||
const displayLarge = { | ||
fontWeight: _typography.fontWeights.semibold, | ||
fontSize: _typography.fontSizes[4], | ||
lineHeight: _typography.lineHeights.shorter, // 1.333 | ||
letterSpacing: '-0.02em', | ||
fontWeight: _typography.fontWeights.semibold, | ||
fontSize: _typography.fontSizes[4], | ||
lineHeight: _typography.lineHeights.shorter, // 1.333 | ||
letterSpacing: '-0.02em', | ||
}; | ||
const displaySmall = { | ||
fontWeight: _typography.fontWeights.medium, | ||
fontSize: _typography.fontSizes[3], | ||
lineHeight: _typography.lineHeights.short, // 1.4 | ||
letterSpacing: '-0.02em', | ||
fontWeight: _typography.fontWeights.medium, | ||
fontSize: _typography.fontSizes[3], | ||
lineHeight: _typography.lineHeights.short, // 1.4 | ||
letterSpacing: '-0.02em', | ||
}; | ||
const bodyLarge = { | ||
fontWeight: _typography.fontWeights.normal, | ||
fontSize: _typography.fontSizes[2], | ||
lineHeight: _typography.lineHeights.base, // 1.5 (24) | ||
letterSpacing: '-0.01em', | ||
fontWeight: _typography.fontWeights.normal, | ||
fontSize: _typography.fontSizes[2], | ||
lineHeight: _typography.lineHeights.base, // 1.5 (24) | ||
letterSpacing: '-0.01em', | ||
}; | ||
const bodyLargeMedium = { | ||
...bodyLarge, | ||
fontWeight: _typography.fontWeights.medium, | ||
...bodyLarge, | ||
fontWeight: _typography.fontWeights.medium, | ||
}; | ||
const bodySmall = { | ||
fontWeight: _typography.fontWeights.normal, | ||
fontSize: _typography.fontSizes[1], | ||
lineHeight: _typography.lineHeights.short, // 1.4 (19.6) | ||
letterSpacing: '-0.01em', | ||
fontWeight: _typography.fontWeights.normal, | ||
fontSize: _typography.fontSizes[1], | ||
lineHeight: _typography.lineHeights.short, // 1.4 (19.6) | ||
letterSpacing: '-0.01em', | ||
}; | ||
const bodySmallMedium = { | ||
...bodySmall, | ||
fontWeight: _typography.fontWeights.medium, | ||
...bodySmall, | ||
fontWeight: _typography.fontWeights.medium, | ||
}; | ||
const caption = { | ||
fontSize: _typography.fontSizes[0], | ||
lineHeight: _typography.lineHeights.shorter, // 1.333 (16) | ||
letterSpacing: '0.00em', | ||
fontSize: _typography.fontSizes[0], | ||
lineHeight: _typography.lineHeights.shorter, // 1.333 (16) | ||
letterSpacing: '0.00em', | ||
}; | ||
const captionMedium = { | ||
...bodySmall, | ||
fontWeight: _typography.fontWeights.medium, | ||
...bodySmall, | ||
fontWeight: _typography.fontWeights.medium, | ||
}; | ||
|
||
export const textStyles = { | ||
display: { | ||
large: displayLarge, | ||
small: displaySmall, | ||
}, | ||
body: { | ||
large: { | ||
...bodyLarge, | ||
medium: bodyLargeMedium, | ||
}, | ||
small: { | ||
...bodySmall, | ||
medium: bodySmallMedium, | ||
}, | ||
display: { | ||
large: displayLarge, | ||
small: displaySmall, | ||
}, | ||
body: { | ||
large: { | ||
...bodyLarge, | ||
medium: bodyLargeMedium, | ||
}, | ||
caption: { | ||
...caption, | ||
medium: captionMedium, | ||
small: { | ||
...bodySmall, | ||
medium: bodySmallMedium, | ||
}, | ||
}, | ||
caption: { | ||
...caption, | ||
medium: captionMedium, | ||
}, | ||
} as const; | ||
|
||
export const typography = { | ||
..._typography, | ||
textStyles, | ||
..._typography, | ||
textStyles, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import { Story, Meta } from '@storybook/react'; | ||
|
||
import { Button } from './index'; | ||
import type { ButtonProps } from './types'; | ||
|
||
export default { | ||
title: 'Example/Button', | ||
component: Button, | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
} as Meta; | ||
|
||
const Template: Story<ButtonProps> = args => <Button {...args} />; | ||
|
||
// ButtonModes | ||
export const Primary = Template.bind({}); | ||
Primary.args = { | ||
mode: 'primary', | ||
}; | ||
|
||
export const Secondary = Template.bind({}); | ||
Secondary.args = { | ||
mode: 'secondary', | ||
}; | ||
|
||
export const Tertiary = Template.bind({}); | ||
Secondary.args = { | ||
mode: 'tertiary', | ||
}; | ||
|
||
// ButtonVariants | ||
export const Link = Template.bind({}); | ||
Link.args = { | ||
variant: 'link', | ||
}; | ||
|
||
export const Solid = Template.bind({}); | ||
Solid.args = { | ||
variant: 'solid', | ||
}; | ||
|
||
// ButtonSizes | ||
export const Large = Template.bind({}); | ||
Large.args = { | ||
size: 'lg', | ||
}; | ||
|
||
export const Medium = Template.bind({}); | ||
Medium.args = { | ||
size: 'md', | ||
}; | ||
|
||
export const Small = Template.bind({}); | ||
Small.args = { | ||
size: 'sm', | ||
}; |
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,3 +1,4 @@ | ||
/** @jsxRuntime classic */ | ||
/** @jsx jsx */ | ||
import { css } from '@emotion/react'; | ||
|
||
|
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
Oops, something went wrong.