fix(#1146): update icon button variants
This PR addresses https://github.com/GovAlta/ui-components/issues/1146 with the following changes:
- Adds
lightvariant - Updates colours for other variants from the Figma design
- Uses
darkstyling fornocolor - Uses
lightstyling forinverted - Adds transition animation to all variants, not just
coloranddark - Adds console warnings that
nocolorandinvertedare deprecated
PR checklist
- [x] I have run a build locally.
- [x] I have ran unit tests locally.
- [x] I have tested the functionality.
Testing the new variant styling...
| color | dark | nocolor | light | inverted | destructive | |
|---|---|---|---|---|---|---|
| Default | ||||||
| Hover | ||||||
| Active | ||||||
| Focus | ||||||
| Disabled |
Here's how the inverted variants look on alpha...
This PR changes their styling all to light:
I checked with @twjeffery who confirmed that there isn't a legitimate use case for any of these inverted variants, such as .destructive.inverted.
Testing the acceptance criteria
- [x] Indicate
nocolorit is deprecated - [x] Don't change icon color on focus
- [x] Border radius is
m
Light & inverted variant
Default
- [x] Icon is
greyscale/white
Hover
- [x] Icon is
greyscale/white - [x] Background is
greyscale/700
Active & focus
- [x] Icon is
greyscale/white - [x] background is
greyscale/700 - [x] Has focus border
Disabled
- [x] Icon is
greyscale/500
Dark & nocolor variant
Default
- [x] Icon is
greyscale/black
Hover
- [x] Icon is
greyscale/black - [x] Background is
greyscale/100
Active & focus
- [x] Icon is
greyscale/black - [x] Background is
greyscale/100 - [x] Has focus border
Disabled
- [x] Icon is
greyscale/500
Destructive variant
Default
- [x] Icon color is
status/emergency-dark
Hover
- [x] Icon is
status/emergency-dark - [x] Background is
status/emergency-light
Active & focus
- [x] Icon is
status/emergency-dark - [x] Background is
status/emergency-light - [x] Has focus border
Disabled
- [x] Icon is
status/emergency-dark - [x] Opacity is 50%
My local tests pass.
for angular, the error message should read goa-icon-button instead of GoAIconButton
I have a question about inverted, is this being dropped completely? means no more variant="inverted" or inverted={true} , thanks very much
@lizhuomeng71 Yes, the old inverted property does the same job as the new light variant: lighten the icon to work on dark backgrounds.
I kept the inverted property with a warning so the PR doesn't introduce a breaking change. But teams should use the light variant in future work.
for angular, the error message should read goa-icon-button instead of GoAIconButton
@lizhuomeng71 I've updated my PR to use goa-icon-button instead of GoAIconButton in the console warnings.
D'oh! I forgot to push my local changes. Now I've pushed my updated console warnings.
Issue is verified on chrome, firefox and edge, for react and angular.
:tada: This PR is included in version 1.17.0-alpha.51 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 4.17.0-alpha.25 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.21.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 4.21.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 3.0.0-alpha.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 3.0.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
