11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3+ import styled from 'styled-components' ;
4+ import { remSize , prop } from '../theme' ;
35import SortArrowUp from '../images/sort-arrow-up.svg' ;
46import SortArrowDown from '../images/sort-arrow-down.svg' ;
57import Github from '../images/github.svg' ;
68import Google from '../images/google.svg' ;
79import Plus from '../images/plus-icon.svg' ;
810import Close from '../images/close.svg' ;
11+ import Exit from '../images/exit.svg' ;
912import DropdownArrow from '../images/down-filled-triangle.svg' ;
1013
1114// HOC that adds the right web accessibility props
@@ -15,16 +18,33 @@ import DropdownArrow from '../images/down-filled-triangle.svg';
1518// Need to add size to these - like small icon, medium icon, large icon. etc.
1619function withLabel ( SvgComponent ) {
1720 const Icon = ( props ) => {
21+ const StyledIcon = styled ( SvgComponent ) `
22+ &&& {
23+ color: ${ prop ( 'Icon.default' ) } ;
24+ & g, & path, & polygon {
25+ opacity: 1;
26+ fill: ${ prop ( 'Icon.default' ) } ;
27+ }
28+ &:hover {
29+ color: ${ prop ( 'Icon.hover' ) } ;
30+ & g, & path, & polygon {
31+ opacity: 1;
32+ fill: ${ prop ( 'Icon.hover' ) } ;
33+ }
34+ }
35+ }
36+ ` ;
37+
1838 const { 'aria-label' : ariaLabel } = props ;
1939 if ( ariaLabel ) {
20- return ( < SvgComponent
40+ return ( < StyledIcon
2141 { ...props }
2242 aria-label = { ariaLabel }
2343 role = "img"
2444 focusable = "false"
2545 /> ) ;
2646 }
27- return ( < SvgComponent
47+ return ( < StyledIcon
2848 { ...props }
2949 aria-hidden
3050 focusable = "false"
@@ -48,4 +68,5 @@ export const GithubIcon = withLabel(Github);
4868export const GoogleIcon = withLabel ( Google ) ;
4969export const PlusIcon = withLabel ( Plus ) ;
5070export const CloseIcon = withLabel ( Close ) ;
71+ export const ExitIcon = withLabel ( Exit ) ;
5172export const DropdownArrowIcon = withLabel ( DropdownArrow ) ;
0 commit comments