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

feat(Icon): adding disabled prop to Icon#12

Merged
bmdalex merged 1 commit intomasterfrom
feat/icon-disabled-prop
Jul 25, 2018
Merged

feat(Icon): adding disabled prop to Icon#12
bmdalex merged 1 commit intomasterfrom
feat/icon-disabled-prop

Conversation

@bmdalex
Copy link
Collaborator

@bmdalex bmdalex commented Jul 25, 2018

Icon (disabled prop)

This PR will introduce possibility to specify disabled icons
Based on react-old/pull/113 which is now closed

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

disabled

disabled property will disable icons by manipulating color and opacity CSS styles

screen shot 2018-07-25 at 19 56 44

<Icon disabled color="red" name="users" size="big" />

renders

<i class="ui-icon"></i>

@codecov
Copy link

codecov bot commented Jul 25, 2018

Codecov Report

Merging #12 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   84.24%   84.28%   +0.03%     
==========================================
  Files          58       59       +1     
  Lines         787      789       +2     
  Branches      167      159       -8     
==========================================
+ Hits          663      665       +2     
  Misses        120      120              
  Partials        4        4
Impacted Files Coverage Δ
src/components/Icon/iconRules.ts 90.9% <100%> (+0.43%) ⬆️
src/styles/customCSS.ts 100% <100%> (ø)
src/components/Icon/Icon.tsx 100% <100%> (ø) ⬆️

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 66f3d1b...0033f55. Read the comment docs.

@bmdalex bmdalex force-pushed the feat/icon-disabled-prop branch 2 times, most recently from 52d8c3d to d7e2ea5 Compare July 25, 2018 14:58
Copy link
Member

Choose a reason for hiding this comment

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

Let's also have a non-colored disabled icon here for completeness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

Copy link
Member

Choose a reason for hiding this comment

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

Opacity is good as it appears disabled, however, it will still take user interaction. Let's set pointerEvents: 'none' to prevent user interaction.

Then, let's leave the color as the default. This helps it fit in on any background. Imagine disabling a red icon on a gray background. It would disappear if made gray.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

{
  opacity: 0.45,
  cursor: 'not-allowed',
}

as per discussion we had in #14

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Address comments and merge 👍

@bmdalex bmdalex force-pushed the feat/icon-disabled-prop branch from d7e2ea5 to 0033f55 Compare July 25, 2018 18:00
@bmdalex bmdalex merged commit 4d2d0a8 into master Jul 25, 2018
@bmdalex bmdalex deleted the feat/icon-disabled-prop branch July 25, 2018 18:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants