Skip to content

Commit

Permalink
Text: Add Uppercase component ✨ (#1062)
Browse files Browse the repository at this point in the history
Text: Add Uppercase component ✨
  • Loading branch information
gregorylegarec authored Jun 25, 2019
2 parents 95c93b3 + 3163d84 commit ba84205
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
8 changes: 8 additions & 0 deletions react/Text/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ const { Bold } = require('./index');
<Bold>This a bold text</Bold>
```

#### Uppercase test

```
const { Uppercase } = require('./index');
<Uppercase>This is an uppercase text</Uppercase>
```

#### Note text

```
Expand Down
10 changes: 10 additions & 0 deletions react/Text/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export const SubTitle = ({ className, ...restProps }) => (
export const Bold = ({ className, ...restProps }) => (
<BaseText className={cx(styles['u-title-h4'], className)} {...restProps} />
)
export const Uppercase = ({ className, ...restProps }) => (
<BaseText className={cx(styles['u-uppercase'], className)} {...restProps} />
)
export const Caption = ({ className, ...restProps }) => (
<BaseText className={cx(styles['u-caption'], className)} {...restProps} />
)
Expand Down Expand Up @@ -66,6 +69,9 @@ Bold.propTypes = {
Caption.propTypes = {
...commonProps
}
Uppercase.propTypes = {
...commonProps
}

// Default Props
const commonDefaultProps = {
Expand All @@ -92,4 +98,8 @@ Caption.defaultProps = {
...commonDefaultProps
}

Uppercase.defaultProps = {
...commonDefaultProps
}

export default Text
4 changes: 3 additions & 1 deletion react/Text/styles.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
.u-text
@extend $text

.u-uppercase
@extend $uppercase

.u-caption
@extend $caption

6 changes: 6 additions & 0 deletions react/__snapshots__/examples.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,12 @@ exports[`Text should render examples: Text 5`] = `
`;
exports[`Text should render examples: Text 6`] = `
"<div>
<div class=\\"styles__u-uppercase___aobU-\\">This is an uppercase text</div>
</div>"
`;
exports[`Text should render examples: Text 7`] = `
"<div>
<div class=\\"styles__u-caption___1VRxy\\">This a note text</div>
</div>"
Expand Down
3 changes: 2 additions & 1 deletion react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export {
Title,
SubTitle,
Bold,
Caption
Caption,
Upppercase
} from './Text'
export { default as Empty } from './Empty'
export { default as ContextHeader } from './ContextHeader'
Expand Down
3 changes: 3 additions & 0 deletions stylus/generic/typography.styl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ $caption
line-height 1.2
color var(--coolGrey)

$uppercase
text-transform uppercase

/*------------------------------------*\
Link
\*------------------------------------*/
Expand Down

0 comments on commit ba84205

Please sign in to comment.