Skip to content

Commit

Permalink
feat(components): use smaller icons (#604)
Browse files Browse the repository at this point in the history
* resize icons to 16px in sumup-oss/icons@fc3d721

* update to @sumup-oss/icons v1 🚀

* update sizes and spacings to accommodate the new icon dimensions
  • Loading branch information
connor-baer authored Jun 4, 2020
1 parent 6625699 commit 67fc95c
Show file tree
Hide file tree
Showing 30 changed files with 1,396 additions and 1,101 deletions.
9 changes: 7 additions & 2 deletions .storybook/components/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ const Size = styled.p`
font-style: italic;
`;

const iconStyles = color => theme => css`
const iconStyles = (color, size) => theme => css`
height: 3rem;
width: auto;
max-width: 6rem;
padding: ${size === 'small' ? '0.5rem' : '0'};
color: ${theme.colors[color]};
background-color: ${color === 'white'
? theme.colors.n900
Expand Down Expand Up @@ -170,7 +171,11 @@ const Icons = () => {
const Icon = iconComponents[componentName];
return (
<Wrapper key={id}>
<Icon id={id} size={icon.size} css={iconStyles(color)} />
<Icon
id={id}
size={icon.size}
css={iconStyles(color, icon.size)}
/>
<Label htmlFor="id">
{icon.name}
{size === 'all' && <Size>{icon.size}</Size>}
Expand Down
5 changes: 3 additions & 2 deletions docs/advanced/icons.story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { Meta, Icons } from '../../.storybook/components';

The icons used throughout Circuit UI come from [SumUp's icon library](https://github.com/sumup-oss/icons). The [`@sumup/icons`](https://www.npmjs.com/package/@sumup/icons) package is a required peer dependency of [`@sumup/circuit-ui`](https://www.npmjs.com/package/@sumup/circuit-ui). You can install the package by running the following command in your project:

```bash
```sh
# With yarn:
yarn add @sumup/icons
# Or if you prefer npm:
# With npm:
npm install @sumup/icons
```

Expand Down
4 changes: 2 additions & 2 deletions docs/introduction/getting-started.story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Circuit UI relies on some mandatory peer dependencies, namely [@sumup/icons](htt

```bash
# With yarn:
yarn add @sumup/icons react react-dom @emotion/core @emotion/styled emotion-theming
yarn add @sumup/design-tokens @sumup/icons react react-dom @emotion/core @emotion/styled emotion-theming
# With npm:
npm install @sumup/icons react react-dom @emotion/core @emotion/styled emotion-theming
npm install @sumup/design-tokens @sumup/icons react react-dom @emotion/core @emotion/styled emotion-theming
```

### Configuring the theme
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@storybook/source-loader": "^5.2.4",
"@sumup/design-tokens": "^1.0.0-alpha.2",
"@sumup/foundry": "^2.1.0",
"@sumup/icons": "^1.0.0-canary.7",
"@sumup/icons": "^1.0.0",
"@sumup/intl": "^1.0.0",
"@svgr/webpack": "^4.3.3",
"@testing-library/dom": "^6.5.0",
Expand Down
Loading

0 comments on commit 67fc95c

Please sign in to comment.