Skip to content

Commit

Permalink
feat(icons): add CopyIcon (#235)
Browse files Browse the repository at this point in the history
* feat(icons): add CopyIcon

* feat(icons): update CopyIcon to approved design
  • Loading branch information
hharnisc authored and TheSisb committed Dec 18, 2019
1 parent c97d878 commit d51d0d2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/paste-icons/__IconList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import * as React from 'react';
import {Text} from '@twilio-paste/text';
import {Grid, StoryIcon} from './__StoryStyles';

import {CopyIcon} from './src/CopyIcon';
import {LoadingIcon} from './src/LoadingIcon';
import {PlusIcon} from './src/PlusIcon';

interface IconProps {
title?: string;
decorative?: boolean;
decorative: boolean;
size?: number;
color?: string;
}

const IconList: React.FC<IconProps> = props => (
<Grid>
<StoryIcon><LoadingIcon {...props} /><Text as="p">LoadingIcon</Text></StoryIcon>
<StoryIcon><CopyIcon {...props} /><Text as="p">CopyIcon</Text></StoryIcon>
<StoryIcon><LoadingIcon {...props} /><Text as="p">LoadingIcon</Text></StoryIcon>
<StoryIcon><PlusIcon {...props} /><Text as="p">PlusIcon</Text></StoryIcon>
</Grid>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-icons/rollup.icon-list.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const rollupIconList = ['src/LoadingIcon.tsx', 'src/PlusIcon.tsx'];
export const rollupIconList = ['src/CopyIcon.tsx', 'src/LoadingIcon.tsx', 'src/PlusIcon.tsx'];
37 changes: 37 additions & 0 deletions packages/paste-icons/src/CopyIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* This file was automatically generated with @twilio-labs/svg-to-react
*/
import * as React from 'react';
import {UID} from 'react-uid';
import {IconWrapper, IconWrapperProps} from './helpers/IconWrapper';

export interface CopyIconProps extends IconWrapperProps {
title?: string;
decorative: boolean;
}

const CopyIcon: React.FC<CopyIconProps> = ({as, size, iconColor, title, decorative}) => {
if (!decorative && title == null) {
throw new Error('[CopyIcon]: Missing a title for non-decorative icon.');
}

return (
<IconWrapper as={as} size={size} iconColor={iconColor}>
<UID>
{uid => (
<svg role="img" aria-hidden={decorative} aria-labelledby={uid} width="100%" height="100%" viewBox="0 0 24 24">
{title ? <title id={uid}>{title}</title> : null}
<path
fill="currentColor"
fillRule="evenodd"
d="M17 1a1 1 0 01.993.883L18 2v4h4a1 1 0 01.993.883L23 7v15a1 1 0 01-1 1H7a1 1 0 01-1-1v-4H2a1 1 0 01-.993-.883L1 17V2a1 1 0 01.883-.993L2 1h15zm4 7H8v13h13V8zm-5-2V3H3v13h3V7a1 1 0 01.883-.993L7 6h9z"
/>
</svg>
)}
</UID>
</IconWrapper>
);
};

CopyIcon.displayName = 'CopyIcon';
export {CopyIcon};
3 changes: 3 additions & 0 deletions packages/paste-icons/svg/CopyIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit d51d0d2

@vercel
Copy link

@vercel vercel bot commented on d51d0d2 Dec 18, 2019

Choose a reason for hiding this comment

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

Please sign in to comment.