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(Text) Create universal Text component #54

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

mlampedx
Copy link
Contributor

What: Create a universal text component, implementing the FXO design system requirements.

Why: In order to avoid creating many one-off text components in the future, which may or may not align with the FXO design system requirements.

How: Create a universal text component, implementing the FXO design system requirements.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

Happy to discuss modifications to the API that would make this component more performant/easier to use!

@mlampedx mlampedx requested a review from ooHmartY July 18, 2018 20:53
- Prop: children
Type: node
Default:
Notes: Render as the Button's children
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@@ -34,65 +81,233 @@ const str = "Better is together";
<Container>
<Row style={fontSizeRowStyle}>
<Column medium={2} >12 px</Column>
<Column medium={6} style={{fontSize: "12px"}}>{str}</Column>
<Column medium={6} style={{fontSize: "12px"}}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably shouldn't force a font size since we are showcasing that <Text size=.. renders the requested size. Some for all others below.

Copy link
Contributor Author

@mlampedx mlampedx Jul 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I will convert these styles over to the size prop for all applicable specimens.

"text--primary": !!primary || (!secondary && !disabled),
"text--secondary": !!secondary,
"text--disabled": !!disabled
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also accept a className prop in case there is a need for additional classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

TextBase.propTypes = {
tag: PropTypes.oneOf(["div", "span", "p"]),
variant: PropTypes.oneOf(["accent", "dark", "light"]),
accent: PropTypes.oneOf([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use Object.keys(theme.colors)

Copy link
Contributor Author

@mlampedx mlampedx Jul 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I combed through the FXO style guide and ensured I only included colors that were designated as approved for text. There are a bunch of background colors in there I'd like to omit.

"summerSky",
"turquoise"
]),
size: PropTypes.oneOf(["uno", "hecto", "kilo", "giga", "tera"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we can also use Object.keys(theme.typography.size)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I combed through the FXO style guide and ensured I only included font-sizes that were designated as approved for text. There are a couple header font-sizes in there I'd like to omit.

secondary: PropTypes.bool,
disabled: PropTypes.bool,
children: PropTypes.node.isRequired
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to be able to determine font weights from Object.keys(theme.typography.weight)

Copy link
Contributor Author

@mlampedx mlampedx Jul 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this up by adding regular and semiBold weights as valid props

@codecov
Copy link

codecov bot commented Jul 19, 2018

Codecov Report

Merging #54 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   99.63%   99.65%   +0.01%     
==========================================
  Files          86       89       +3     
  Lines         552      574      +22     
  Branches       89       95       +6     
==========================================
+ Hits          550      572      +22     
  Misses          2        2
Impacted Files Coverage Δ
src/theme/colors.js 100% <ø> (ø) ⬆️
src/theme/typography.js 100% <ø> (ø) ⬆️
src/components/Text/Base.js 100% <100%> (ø)
src/utils/typography.js 100% <100%> (ø)
src/components/Text/Base.styles.js 100% <100%> (ø)
src/components/BottomSheet/index.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c256d3...3f02dd7. Read the comment docs.

@ooHmartY ooHmartY merged commit b5cff55 into ticketmaster:master Jul 19, 2018
@tm-github-bot
Copy link
Collaborator

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants