Skip to content

Commit

Permalink
feat(icons): add new list with search icon (#1774)
Browse files Browse the repository at this point in the history
* feat(icons): add new list with search icon

* chore: update changeset

* fix(icons/vrt): use single packages instead of preset

Co-authored-by: Nicola Molinari <[email protected]>
  • Loading branch information
stephsprinkle and emmenko authored Feb 10, 2021
1 parent f9e34a8 commit 49d7b6a
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-snails-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/icons': minor
---

feat(icons): add new list with search icon
144 changes: 144 additions & 0 deletions packages/components/icons/src/generated/ListWithSearch.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/components/icons/src/generated/index.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions packages/components/icons/src/icons.visualroute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import styled from '@emotion/styled';
import { Switch, Route } from 'react-router-dom';
import { ThemeProvider } from '@emotion/react';
import * as UIKit from '@commercetools-frontend/ui-kit';
import * as icons from '@commercetools-uikit/icons';
import Text from '@commercetools-uikit/text';
import { Suite, Spec } from '../../../../test/percy';

const IconList = styled.div`
Expand All @@ -26,9 +27,7 @@ const IconContainer = styled.div`
width: ${(props) => (props.big ? '50px' : '25px')};
`;

const icons = Object.keys(UIKit)
.filter((thing) => thing.endsWith('Icon'))
.sort();
const allIconNames = Object.keys(icons).sort();

const sizes = ['small', 'medium', 'big', 'scale'];

Expand All @@ -46,13 +45,13 @@ const colors = [
export const routePath = '/icons';

const renderIcon = (iconName, color, size) => {
const Icon = UIKit[iconName];
const Icon = icons[iconName];
return (
<IconItem key={iconName}>
<IconContainer big={size === 'scale'}>
<Icon color={color} size={size} />
</IconContainer>
<UIKit.Text.Body>{iconName}</UIKit.Text.Body>
<Text.Body>{iconName}</Text.Body>
</IconItem>
);
};
Expand All @@ -73,7 +72,9 @@ export const component = ({ themes }) => (
omitPropsList
>
<IconList>
{icons.map((iconName) => renderIcon(iconName, color, size))}
{allIconNames.map((iconName) =>
renderIcon(iconName, color, size)
)}
</IconList>
</Spec>
))}
Expand Down
16 changes: 16 additions & 0 deletions packages/components/icons/src/svg/list-with-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions transforms/v10/icons/icon-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const iconNames = [
'InfoIcon',
'InformationIcon',
'ListIcon',
'ListWithSearchIcon',
'LogoutIcon',
'MailIcon',
'MinimizeIcon',
Expand Down

1 comment on commit 49d7b6a

@vercel
Copy link

@vercel vercel bot commented on 49d7b6a Feb 10, 2021

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.