🔀 merge from origin/develop
This commit is contained in:
commit
123c2b0006
4 changed files with 37 additions and 22 deletions
|
@ -1,18 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { select } from '@storybook/addon-knobs';
|
|
||||||
|
|
||||||
import * as icons from './icons';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Common/Icons',
|
|
||||||
component: icons
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AllIcons = () => {
|
|
||||||
const names = Object.keys(icons);
|
|
||||||
|
|
||||||
const SelectedIcon = icons[select('name', names, names[0])];
|
|
||||||
return (
|
|
||||||
<SelectedIcon />
|
|
||||||
);
|
|
||||||
};
|
|
|
@ -1,11 +1,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { remSize, prop } from '../theme';
|
||||||
import SortArrowUp from '../images/sort-arrow-up.svg';
|
import SortArrowUp from '../images/sort-arrow-up.svg';
|
||||||
import SortArrowDown from '../images/sort-arrow-down.svg';
|
import SortArrowDown from '../images/sort-arrow-down.svg';
|
||||||
import Github from '../images/github.svg';
|
import Github from '../images/github.svg';
|
||||||
import Google from '../images/google.svg';
|
import Google from '../images/google.svg';
|
||||||
import Plus from '../images/plus-icon.svg';
|
import Plus from '../images/plus-icon.svg';
|
||||||
import Close from '../images/close.svg';
|
import Close from '../images/close.svg';
|
||||||
|
import Exit from '../images/exit.svg';
|
||||||
import DropdownArrow from '../images/down-filled-triangle.svg';
|
import DropdownArrow from '../images/down-filled-triangle.svg';
|
||||||
|
|
||||||
// HOC that adds the right web accessibility props
|
// HOC that adds the right web accessibility props
|
||||||
|
@ -15,16 +18,33 @@ import DropdownArrow from '../images/down-filled-triangle.svg';
|
||||||
// Need to add size to these - like small icon, medium icon, large icon. etc.
|
// Need to add size to these - like small icon, medium icon, large icon. etc.
|
||||||
function withLabel(SvgComponent) {
|
function withLabel(SvgComponent) {
|
||||||
const Icon = (props) => {
|
const Icon = (props) => {
|
||||||
|
const StyledIcon = styled(SvgComponent)`
|
||||||
|
&&& {
|
||||||
|
color: ${prop('Icon.default')};
|
||||||
|
& g, & path, & polygon {
|
||||||
|
opacity: 1;
|
||||||
|
fill: ${prop('Icon.default')};
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
color: ${prop('Icon.hover')};
|
||||||
|
& g, & path, & polygon {
|
||||||
|
opacity: 1;
|
||||||
|
fill: ${prop('Icon.hover')};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const { 'aria-label': ariaLabel } = props;
|
const { 'aria-label': ariaLabel } = props;
|
||||||
if (ariaLabel) {
|
if (ariaLabel) {
|
||||||
return (<SvgComponent
|
return (<StyledIcon
|
||||||
{...props}
|
{...props}
|
||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
role="img"
|
role="img"
|
||||||
focusable="false"
|
focusable="false"
|
||||||
/>);
|
/>);
|
||||||
}
|
}
|
||||||
return (<SvgComponent
|
return (<StyledIcon
|
||||||
{...props}
|
{...props}
|
||||||
aria-hidden
|
aria-hidden
|
||||||
focusable="false"
|
focusable="false"
|
||||||
|
@ -48,4 +68,5 @@ export const GithubIcon = withLabel(Github);
|
||||||
export const GoogleIcon = withLabel(Google);
|
export const GoogleIcon = withLabel(Google);
|
||||||
export const PlusIcon = withLabel(Plus);
|
export const PlusIcon = withLabel(Plus);
|
||||||
export const CloseIcon = withLabel(Close);
|
export const CloseIcon = withLabel(Close);
|
||||||
|
export const ExitIcon = withLabel(Exit);
|
||||||
export const DropdownArrowIcon = withLabel(DropdownArrow);
|
export const DropdownArrowIcon = withLabel(DropdownArrow);
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { getHTMLFile } from '../reducers/files';
|
||||||
// Local Imports
|
// Local Imports
|
||||||
import Editor from '../components/Editor';
|
import Editor from '../components/Editor';
|
||||||
import { prop, remSize } from '../../../theme';
|
import { prop, remSize } from '../../../theme';
|
||||||
import { CloseIcon } from '../../../common/Icons';
|
import { ExitIcon } from '../../../common/icons';
|
||||||
|
|
||||||
import PreferencesIcon from '../../../images/preferences.svg';
|
import PreferencesIcon from '../../../images/preferences.svg';
|
||||||
import PlayIcon from '../../../images/triangle-arrow-right.svg';
|
import PlayIcon from '../../../images/triangle-arrow-right.svg';
|
||||||
|
@ -63,7 +63,7 @@ const IDEViewMobile = (props) => {
|
||||||
<Screen>
|
<Screen>
|
||||||
<Header>
|
<Header>
|
||||||
<IconLinkWrapper to="/" aria-label="Return to original editor">
|
<IconLinkWrapper to="/" aria-label="Return to original editor">
|
||||||
<CloseIcon viewBox="20 21 60 60" />
|
<ExitIcon />
|
||||||
</IconLinkWrapper>
|
</IconLinkWrapper>
|
||||||
<div>
|
<div>
|
||||||
<h2>{project.name}</h2>
|
<h2>{project.name}</h2>
|
||||||
|
|
|
@ -85,6 +85,10 @@ export default {
|
||||||
border: grays.middleLight,
|
border: grays.middleLight,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Icon: {
|
||||||
|
default: grays.middleGray,
|
||||||
|
hover: grays.darker
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[Theme.dark]: {
|
[Theme.dark]: {
|
||||||
colors,
|
colors,
|
||||||
|
@ -113,6 +117,10 @@ export default {
|
||||||
border: grays.middleDark,
|
border: grays.middleDark,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Icon: {
|
||||||
|
default: grays.middleLight,
|
||||||
|
hover: grays.lightest
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[Theme.contrast]: {
|
[Theme.contrast]: {
|
||||||
colors,
|
colors,
|
||||||
|
@ -141,5 +149,9 @@ export default {
|
||||||
border: grays.middleDark,
|
border: grays.middleDark,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Icon: {
|
||||||
|
default: grays.mediumLight,
|
||||||
|
hover: colors.yellow
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue