Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(Button): add size prop #1716

Merged
merged 10 commits into from
Jul 25, 2019
Merged

feat(Button): add size prop #1716

merged 10 commits into from
Jul 25, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Jul 24, 2019

Fixes #1376.
Fixes #1671.

BREAKING CHANGES

  • paddingLeftRightValue was renamed to padding.

Changes

This PR adds a new size prop and styles for size=small.

I also made a small refactor to use p & v pattern.

@vercel vercel bot temporarily deployed to staging July 24, 2019 13:04 Inactive
@codecov
Copy link

codecov bot commented Jul 24, 2019

Codecov Report

Merging #1716 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1716      +/-   ##
==========================================
- Coverage   70.97%   70.95%   -0.02%     
==========================================
  Files         860      860              
  Lines        7142     7144       +2     
  Branches     2072     2056      -16     
==========================================
  Hits         5069     5069              
- Misses       2067     2069       +2     
  Partials        6        6
Impacted Files Coverage Δ
packages/react/src/components/Button/Button.tsx 80% <ø> (ø) ⬆️
.../themes/teams/components/Button/buttonVariables.ts 0% <ø> (ø) ⬆️
...src/themes/teams/components/Button/buttonStyles.ts 3.22% <0%> (-0.23%) ⬇️

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 a76f2ee...11e5a67. Read the comment docs.

@layershifter
Copy link
Member Author

@codepretty can you please check these changes? 🙏

fontWeight: v.contentFontWeight,

...(p.size === 'small' && {
fontSize: v.sizeSmallFontSize,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this need to have a line-height set for the small size and one for the default (medium) size to ensure that no descender are cut off...
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding the medium line-height as a default will also fix this - #1376

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, applied 👍

@@ -24,6 +24,11 @@ const Variations = () => (
description="A button can be shown in form of a text to indicate some less-pronounced actions."
examplePath="components/Button/Variations/ButtonExampleText"
/>
<ComponentExample
title="Size"
description="A button can have assorted sizes."
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to consolidate the description of the size in the components' examples. We have different for Avatar, Text, Button.. :\

minWidth: height,
...(p.circular &&
!p.text && {
minWidth: v.height,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, shouldn't this be updated depending on the size? It seems like a special case..

Copy link
Member Author

Choose a reason for hiding this comment

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

image

      <Button size="small" circular />
      <Button circular />

Yep, it should

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Updated 👍

@delete-merged-branch delete-merged-branch bot deleted the feat/button-size branch July 25, 2019 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button size prop or small/large variations Button text is cut off in the bottom
4 participants