Skip to content

Normalize styled system and default props. Add Text component.#114

Merged
designmatty merged 21 commits intomasterfrom
feature/sml/normalize-styled-system-and-default-props
Dec 13, 2018
Merged

Normalize styled system and default props. Add Text component.#114
designmatty merged 21 commits intomasterfrom
feature/sml/normalize-styled-system-and-default-props

Conversation

@lederer
Copy link
Copy Markdown
Contributor

@lederer lederer commented Dec 5, 2018

Overview

Update all existing components to use styled-system, to use defaultProps for default props, and to extend the Box component when appropriate.

  • Note defaultProps for space props should be defined for each side individually (pt, pb, pl, pr, mt, mb, ml, mr). Don't use shortcuts (px, py, p, mx, my, m) even if the values are the same.

  • Header size is now handled via the as prop (eg, <Header as="h4">) instead of via utility properties on Header (eg, <Header.h4>) that used styled-component's now-likely-to-be-deprecated withComponent().

Also some additions, deletions, renames:

  • Added a Text component. Renders as <p>, so should be no problem using the as prop. Closes New Component: Text #36.

  • ProgressBar deleted (was rudimentary).

  • PlainProgressBar renamed to ProgressBar.

  • typeSystem deleted from theme, now that all references have been changed to styled-system-friendly fontSizes

Also misc fixes:

  • ...foo.PropTypes -> ...foo.propTypes (case fix)
  • Removed superfluous semi-colons from styled-system function references in styled-component definitions (eg, ${color}; -> ${color})
  • Added a Default column to all docz props tables
  • Changed true/false to yes/no in docz props table Required cols, to distinguish from boolean props in adjacent Default cols

Breaking changes: There are likely very many breaking changes throughout this PR. I can detail them individually if necessary, but it seems like that would be wasted work at this early stage when only an earlier version of it has been rudimentarily deployed.

Checklist

  • Relevant documentation pages have been created or updated
  • Description of PR is in an appropriate section of the changelog and grouped with similar changes if possible

Are there any of the following in this PR?

  • Changes to the prop names or types of existing components
  • Changes in intended behavior of existing component props
  • Changes in the theme file's structure
  • A required version bump to a non-dev dependency of the project

If one of the above is checked...

  • information or guidance around needed changes for consumers of this library has been added to the changelog under Upgrade Instructions

Demo

image

Closes #36

Copy link
Copy Markdown
Contributor

@alkamin alkamin left a comment

Choose a reason for hiding this comment

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

Things are getting exciting.

Copy link
Copy Markdown
Contributor

@designmatty designmatty left a comment

Choose a reason for hiding this comment

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

I noticed borderColor wasn't working on NavBar. I pushed up a fix.

@designmatty designmatty merged commit 8cc40cc into master Dec 13, 2018
@designmatty designmatty deleted the feature/sml/normalize-styled-system-and-default-props branch December 13, 2018 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

New Component: Text

5 participants