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 #10 from open-source-miami/all-contributors/add-ar…
…omanarguello docs: add aromanarguello as a contributor
- Loading branch information
Showing
28 changed files
with
3,003 additions
and
2,850 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 |
---|---|---|
|
@@ -13,7 +13,8 @@ | |
"contributions": [ | ||
"infra", | ||
"test", | ||
"code" | ||
"code", | ||
"maintenance" | ||
] | ||
}, | ||
{ | ||
|
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 |
---|---|---|
|
@@ -6,4 +6,8 @@ storybook-static | |
|
||
junit.xml | ||
|
||
coverage | ||
coverage | ||
|
||
.DS_Store | ||
|
||
assets/.DS_Store |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
<h1>Typography</h1> | ||
|
||
This component is meant to wrap any text component providing it with flexible props to designate it's text attribute, font-family and padding. | ||
|
||
<!-- STORY --> | ||
|
||
<h2>Basic Usage</h2> | ||
|
||
```jsx | ||
<Typography variant="p" fontFamily="Roboto, sans-serif"> | ||
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eligendi quia | ||
distinctio ab consequuntur nisi dolores harum mollitia quam consectetur atque, | ||
obcaecati repellat enim, voluptas quibusdam. Esse itaque debitis expedita | ||
adipisci. | ||
</Typography> | ||
``` |
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,37 @@ | ||
import * as React from "react" | ||
import { storiesOf } from "@storybook/react" | ||
import Typography from "." | ||
import TypographyReadme from "./README.md" | ||
|
||
storiesOf("Typography", module) | ||
.addParameters({ | ||
readme: { | ||
content: TypographyReadme, | ||
codeTheme: "atom-dark" | ||
} | ||
}) | ||
.add("Text", () => ( | ||
<div> | ||
<Typography variant="h1" fontFamily="Notable"> | ||
H1: Heading h1 | ||
</Typography> | ||
<Typography variant="h2" fontFamily="Notable"> | ||
H2: Heading h2 | ||
</Typography> | ||
<Typography variant="h3" fontFamily="Roboto"> | ||
H3: Heading h3 | ||
</Typography> | ||
<Typography variant="h4" fontFamily="Roboto"> | ||
H4: Heading h4 | ||
</Typography> | ||
<Typography variant="h5" fontFamily="Roboto"> | ||
H5: Heading h5 | ||
</Typography> | ||
<Typography variant="h6" fontFamily="Roboto"> | ||
H6: Heading h6 | ||
</Typography> | ||
<Typography variant="p" fontFamily="Roboto"> | ||
P: Paragraph p | ||
</Typography> | ||
</div> | ||
)) |
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,6 @@ | ||
import * as React from "react" | ||
import Typography from "." | ||
|
||
it("Typography snapshot", () => { | ||
expect(<Typography variant="h1">Alex</Typography>).toMatchSnapshot() | ||
}) |
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,84 @@ | ||
import * as React from "react" | ||
import styled from "styled-components" | ||
import { | ||
fontSize, | ||
fontStyle, | ||
fontWeight, | ||
letterSpacing, | ||
lineHeight, | ||
textAlign, | ||
space, | ||
color, | ||
SpaceProps, | ||
ColorProps, | ||
FontSizeProps, | ||
FontStyleProps, | ||
FontWeightProps, | ||
LetterSpacingProps, | ||
LineHeightProps, | ||
TextAlignProps, | ||
compose, | ||
FlexProps | ||
} from "styled-system" | ||
|
||
export type Typography = FlexProps & | ||
FontSizeProps & | ||
FontStyleProps & | ||
FontWeightProps & | ||
LetterSpacingProps & | ||
LineHeightProps & | ||
TextAlignProps & | ||
SpaceProps & | ||
ColorProps | ||
|
||
interface ITypography extends Typography { | ||
/** | ||
* React children | ||
*/ | ||
children: React.ReactNode | ||
/** | ||
* Text variants | ||
*/ | ||
variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | ||
/** | ||
* Font family selection | ||
*/ | ||
fontFamily?: "Roboto" | "Notable" | ||
} | ||
|
||
const typography = compose( | ||
fontSize, | ||
fontStyle, | ||
fontWeight, | ||
letterSpacing, | ||
lineHeight, | ||
textAlign | ||
) | ||
|
||
const returnStyled = (arg: string): any => styled[arg] | ||
|
||
const Typography: React.FC<ITypography> = props => { | ||
const StyledTypography = returnStyled(props.variant)<ITypography>` | ||
${color} | ||
${typography} | ||
${space} | ||
font-family: ${(p: ITypography) => | ||
p.fontFamily === "Notable" | ||
? "Notable, sans-serif" | ||
: "Roboto, sans-serif"}; | ||
font-face: { | ||
src: @import ('/assets/fonts/Notable-Regular.ttf') | ||
} | ||
font-face: { | ||
src: @import ('/assets/fonts/Roboto-Regular.ttf') | ||
} | ||
` | ||
return ( | ||
<StyledTypography fontFamily={props.fontFamily} {...props}> | ||
{props.children} | ||
</StyledTypography> | ||
) | ||
} | ||
|
||
export default Typography |
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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Typography snapshot 1`] = ` | ||
<Typography | ||
variant="h1" | ||
> | ||
Alex | ||
</Typography> | ||
`; |
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 @@ | ||
export { default } from "./Typography" |