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

feat(Button): add text variant #177

Merged
merged 10 commits into from
Sep 6, 2018
Merged

feat(Button): add text variant #177

merged 10 commits into from
Sep 6, 2018

Conversation

mnajdova
Copy link
Contributor

@mnajdova mnajdova commented Sep 3, 2018

Button

Adding text variant to the button, that will display the button without any background and border.

TODO

  • Conformance test
  • Minimal doc site example
  • Stardust base theme
  • Teams Light theme
  • Teams Dark theme
  • Teams Contrast theme
  • Confirm RTL usage
  • W3 accessibility check
  • Stardust accessibility check
  • Update glossary props table
  • Update the CHANGELOG.md

API Proposal

text: boolean

image

A button can be formatted to show only text in order to indicate some less-pronounced actions.

<Button text icon="book" content="Default" iconPosition="before" />
<button class="ui-button ..." aria-disabled="false">
  <span class="ui-icon ..." aria-hidden="true"></span>
  <span class="q r s">Default</span>
</button>

At this moment, the styles of the buttons containing the text prop, are just reducing the background and border, and on hover are altering the color of the text to be the brand color. We may need to change this, as the current text color of the primary button is white, which is maybe not the most appropriate one. Once the API is approved, we can agree on colors used for the default, primary and secondary variations of the text button.

@codecov
Copy link

codecov bot commented Sep 3, 2018

Codecov Report

Merging #177 into master will decrease coverage by 0.59%.
The diff coverage is 19.04%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #177     +/-   ##
=========================================
- Coverage   67.69%   67.09%   -0.6%     
=========================================
  Files         103      101      -2     
  Lines        1461     1395     -66     
  Branches      299      279     -20     
=========================================
- Hits          989      936     -53     
+ Misses        468      456     -12     
+ Partials        4        3      -1
Impacted Files Coverage Δ
.../themes/teams/components/Button/buttonVariables.ts 66.66% <ø> (ø) ⬆️
src/themes/teams/components/Button/buttonStyles.ts 8.51% <0%> (-2.92%) ⬇️
src/components/Button/Button.tsx 94.73% <100%> (-0.82%) ⬇️
src/components/Layout/Layout.tsx 88% <0%> (-6%) ⬇️
src/components/Image/Image.tsx 100% <0%> (ø) ⬆️
src/themes/teams/componentVariables.ts 100% <0%> (ø) ⬆️
src/components/Button/index.ts 100% <0%> (ø) ⬆️
src/themes/teams/components/Layout/layoutStyles.ts 10.81% <0%> (ø) ⬆️
... and 7 more

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 b3467c4...fb02d3c. Read the comment docs.

@miroslavstastny
Copy link
Member

Shorthand vs Children API examples render differently

@mnajdova
Copy link
Contributor Author

mnajdova commented Sep 4, 2018

Thanks for the catch @miroslavstastny, it is fixed now.

# Conflicts:
#	CHANGELOG.md
@mnajdova mnajdova added the RFC label Sep 4, 2018
# Conflicts:
#	CHANGELOG.md
#	src/components/Button/Button.tsx
#	src/themes/teams/components/Button/buttonStyles.ts
Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

I am fine with the API proposal. I would like to see a use case for the text button in order to be able to discuss it's styling aspects - I am not sure if you want to keep the same button dimensions (height and padding).

@@ -19,6 +19,11 @@ const Variations = () => (
description="A button can be circular and formatted to show different levels of emphasis."
examplePath="components/Button/Variations/ButtonExampleEmphasisCircular"
/>
<ComponentExample
title="Text"
description="A button can be shown in form of a text to indicate some less-pronounced actions"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit's nit: just for the sake of consistency, lets put dot at the end of description :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not a nit, is valid thing to be fixed as this is shown in our docs page :)


return Icon.create(icon, {
defaultProps: {
xSpacing: !content ? 'none' : iconPosition === 'after' ? 'before' : 'after',
variables: {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@mnajdova
Copy link
Contributor Author

mnajdova commented Sep 6, 2018

Thanks for the updates @kuzhelov, will update the branch and merge it.

manajdov added 2 commits September 6, 2018 19:35
# Conflicts:
#	CHANGELOG.md
#	src/themes/teams/components/Button/buttonStyles.ts
-fixed console errors in the buttons examples
@mnajdova mnajdova merged commit 9b21eea into master Sep 6, 2018
@kuzhelov kuzhelov deleted the feat/button-text branch November 19, 2018 16:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants