From f5cf049fe02319df44cc038aa86d1f3fe1087c65 Mon Sep 17 00:00:00 2001 From: JUDIT GRESKOVITS Date: Fri, 21 Jul 2017 11:02:28 +0100 Subject: [PATCH] feat(ui-toolkit, cp-frontend): Add button states to bin --- .../src/containers/deployment-groups/list.js | 11 +---- packages/ui-toolkit/src/icon-button/index.js | 43 ++++++++++++------- .../ui-toolkit/src/icons/svg/icon_bin.svg | 6 +-- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/packages/cp-frontend/src/containers/deployment-groups/list.js b/packages/cp-frontend/src/containers/deployment-groups/list.js index c2b53dc1..ced9b16a 100644 --- a/packages/cp-frontend/src/containers/deployment-groups/list.js +++ b/packages/cp-frontend/src/containers/deployment-groups/list.js @@ -87,22 +87,13 @@ const StyledCreateLink = styled(StyledLink)` display: flex; `; -const DeleteButtonContainer = styled.div` - position: absolute; - right: 0; - bottom: 0; -`; - const StyledIconButton = styled(IconButton)` position: absolute; right: 0; bottom: 0; border: none; - &:hover { - background-color: ${props => props.theme.white}; - } - + &:hover, &:active, &:active:hover, &:active:focus { diff --git a/packages/ui-toolkit/src/icon-button/index.js b/packages/ui-toolkit/src/icon-button/index.js index 102a3961..beb44a9d 100644 --- a/packages/ui-toolkit/src/icon-button/index.js +++ b/packages/ui-toolkit/src/icon-button/index.js @@ -24,6 +24,10 @@ const style = css` min-width: 0; cursor: pointer; + > svg { + fill: ${props => props.theme.secondary}; + } + &:focus { outline: 0; background-color: ${props => props.theme.white}; @@ -35,6 +39,11 @@ const style = css` border-color: ${props => props.theme.grey}; } + &:focus, + &:hover > svg { + fill: ${props => props.theme.secondaryHover}; + } + &:active, &:active:hover, &:active:focus { @@ -43,6 +52,12 @@ const style = css` border-color: ${props => props.theme.grey}; } + &:active, + &:active:hover, + &:active:focus > svg { + fill: ${props => props.theme.secondaryActive}; + } + &[disabled] { cursor: not-allowed; pointer-events: none; @@ -50,22 +65,26 @@ const style = css` background-color: ${props => props.theme.disabled}; border-color: ${props => props.theme.grey}; - &:focus { - background-color: ${props => props.theme.disabled}; - border-color: ${props => props.theme.grey}; - } - - &:hover { - background-color: ${props => props.theme.disabled}; - border-color: ${props => props.theme.disabled}; + > svg { + fill: ${props => props.theme.grey}; } + &:focus, + &:hover, &:active, &:active:hover, &:active:focus { background-color: ${props => props.theme.disabled}; border-color: ${props => props.theme.disabled}; } + + &:focus, + &:hover, + &:active, + &:active:hover, + &:active:focus > svg { + fill: ${props => props.theme.grey}; + } } `; @@ -83,10 +102,6 @@ const StyledLink = styled(Link)` ${style} `; -const StyledDiv = styled.div` - height: ${remcalc(16)}; -`; - /** * @example ./usage.md */ @@ -103,9 +118,7 @@ const IconButton = props => { return ( - - {children} - + {children} ); }; diff --git a/packages/ui-toolkit/src/icons/svg/icon_bin.svg b/packages/ui-toolkit/src/icons/svg/icon_bin.svg index dc6ed75e..6ad024c2 100644 --- a/packages/ui-toolkit/src/icons/svg/icon_bin.svg +++ b/packages/ui-toolkit/src/icons/svg/icon_bin.svg @@ -4,9 +4,9 @@ icon: delete Created with Sketch. - - + + - \ No newline at end of file +