Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate Heading to TypeScript #594

Merged
merged 2 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/components/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const Icons = () => {
) : (
group('category', activeIcons).map(({ category, items }) => (
<Category key={category}>
<Heading as="h3" size={Heading.GIGA}>
<Heading as="h3" size="giga">
{category}
</Heading>
<List>
Expand Down
2 changes: 1 addition & 1 deletion .storybook/components/Teaser.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Wrapper = styled(Card)(
const Teaser = ({ title, children, ...props }) => (
<ThemeProvider theme={light}>
<Wrapper shadow={Card.DOUBLE}>
<Heading as="h2" size={Heading.GIGA}>
<Heading as="h2" size="giga">
{title}
</Heading>

Expand Down
6 changes: 3 additions & 3 deletions .storybook/util/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ const subHeadingStyles = theme => css`
export const components = {
h1: withThemeProvider(Heading, {
as: 'h1',
size: Heading.ZETTA,
size: 'zetta',
css: headingStyles
}),
h2: withThemeProvider(Heading, {
as: 'h2',
size: Heading.PETA,
size: 'peta',
css: headingStyles
}),
h3: withThemeProvider(Heading, {
as: 'h3',
size: Heading.GIGA,
size: 'giga',
css: headingStyles
}),
h4: withThemeProvider(SubHeading, {
Expand Down
14 changes: 7 additions & 7 deletions docs/advanced/theme.story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ Avoid using `theme.typography` directly in your styles, rather use the specializ
#### Headings

<Preview>
<Type size={Heading.ZETTA} component={Heading} name="headings" />
<Type size={Heading.EXA} component={Heading} name="headings" />
<Type size={Heading.PETA} component={Heading} name="headings" />
<Type size={Heading.TERA} component={Heading} name="headings" />
<Type size={Heading.GIGA} component={Heading} name="headings" />
<Type size={Heading.MEGA} component={Heading} name="headings" />
<Type size={Heading.KILO} component={Heading} name="headings" />
<Type size="zetta" component={Heading} name="headings" />
<Type size="exa" component={Heading} name="headings" />
<Type size="peta" component={Heading} name="headings" />
<Type size="tera" component={Heading} name="headings" />
<Type size="giga" component={Heading} name="headings" />
<Type size="mega" component={Heading} name="headings" />
<Type size="kilo" component={Heading} name="headings" />
</Preview>

#### Subheading
Expand Down
23 changes: 11 additions & 12 deletions scripts/static-styles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
ButtonGroup,
Card,
Checkbox,
Heading,
Hr,
Image,
Input,
Expand Down Expand Up @@ -147,17 +146,17 @@ export default {
getComponentInfo(Checkbox),
// TODO: Make React DocGen work with TypeScript
// getComponentInfo(Hamburger),
getComponentInfo(Heading, {
size: [
Heading.KILO,
Heading.MEGA,
Heading.GIGA,
Heading.TERA,
Heading.PETA,
Heading.EXA,
Heading.ZETTA
]
}),
// getComponentInfo(Heading, {
// size: [
// "kilo",
// "mega",
// "giga",
// "tera",
// "peta",
// "exa",
// "zetta"
// ]
// }),
{ name: 'hr', component: Hr },
{ name: 'image', component: Image },
getComponentInfo(Input, {
Expand Down
Loading