Skip to content

Commit b817bcb

Browse files
committed
feat(ClearIcon): add component
1 parent bc28fc3 commit b817bcb

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

.changeset/light-chairs-kick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": minor
3+
---
4+
5+
Rename ClearIcon -> TrashIcon. Add a new ClearIcon.

src/components/actions/CommandMenu/CommandMenu.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import React, { useState } from 'react';
1414
import { expect, findByRole, userEvent, waitFor, within } from 'storybook/test';
1515

16-
import { ClearIcon, EditIcon } from '../../../icons';
16+
import { EditIcon, TrashIcon } from '../../../icons';
1717
import { tasty } from '../../../tasty';
1818
import { Card } from '../../content/Card/Card';
1919
import { HotKeys } from '../../content/HotKeys';
@@ -412,7 +412,7 @@ export const ItemsWithActions = (props) => {
412412
onPress={() => handleItemAction('file1', 'edit')}
413413
/>
414414
<ItemAction
415-
icon={<ClearIcon />}
415+
icon={<TrashIcon />}
416416
aria-label="Delete"
417417
onPress={() => handleItemAction('file1', 'delete')}
418418
/>
@@ -433,7 +433,7 @@ export const ItemsWithActions = (props) => {
433433
onPress={() => handleItemAction('file2', 'edit')}
434434
/>
435435
<ItemAction
436-
icon={<ClearIcon />}
436+
icon={<TrashIcon />}
437437
aria-label="Delete"
438438
onPress={() => handleItemAction('file2', 'delete')}
439439
/>
@@ -454,7 +454,7 @@ export const ItemsWithActions = (props) => {
454454
onPress={() => handleItemAction('file3', 'edit')}
455455
/>
456456
<ItemAction
457-
icon={<ClearIcon />}
457+
icon={<TrashIcon />}
458458
aria-label="Delete"
459459
onPress={() => handleItemAction('file3', 'delete')}
460460
/>

src/components/actions/Menu/Menu.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { expect, findByRole, userEvent, waitFor, within } from 'storybook/test';
1414

1515
import {
1616
CheckIcon,
17-
ClearIcon,
1817
CloseCircleIcon,
1918
CloseIcon,
2019
CopyIcon,
@@ -23,6 +22,7 @@ import {
2322
Icon,
2423
MoreIcon,
2524
PlusIcon,
25+
TrashIcon,
2626
} from '../../../icons';
2727
import {
2828
Alert,
@@ -1995,7 +1995,7 @@ export const ItemsWithActions = (props) => {
19951995
onPress={() => handleItemAction('file1', 'edit')}
19961996
/>
19971997
<ItemAction
1998-
icon={<ClearIcon />}
1998+
icon={<TrashIcon />}
19991999
tooltip="Delete"
20002000
onPress={() => handleItemAction('file1', 'delete')}
20012001
/>
@@ -2016,7 +2016,7 @@ export const ItemsWithActions = (props) => {
20162016
onPress={() => handleItemAction('file2', 'edit')}
20172017
/>
20182018
<Menu.Item.Action
2019-
icon={<ClearIcon />}
2019+
icon={<TrashIcon />}
20202020
tooltip="Delete"
20212021
theme="danger"
20222022
onPress={() => handleItemAction('file2', 'delete')}
@@ -2038,7 +2038,7 @@ export const ItemsWithActions = (props) => {
20382038
onPress={() => handleItemAction('file3', 'edit')}
20392039
/>
20402040
<ItemAction
2041-
icon={<ClearIcon />}
2041+
icon={<TrashIcon />}
20422042
tooltip="Delete"
20432043
theme="success"
20442044
onPress={() => handleItemAction('file3', 'delete')}

src/icons/ClearIcon.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
import { IconTrash } from '@tabler/icons-react';
2-
31
import { wrapIcon } from './wrap-icon';
42

5-
export const ClearIcon = wrapIcon('ClearIcon', <IconTrash />);
3+
export const ClearIcon = wrapIcon(
4+
'ClearIcon',
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
width="24"
8+
height="24"
9+
fill="none"
10+
viewBox="0 0 24 24"
11+
>
12+
<path
13+
stroke="currentColor"
14+
strokeLinecap="round"
15+
strokeLinejoin="round"
16+
strokeWidth="1.5"
17+
d="M18.615 13 21 22H3l2.385-9M9 17v4.5m6-4.5v4.5m6-8.5H3V8h7V2h4v6h7z"
18+
/>
19+
</svg>,
20+
);

src/icons/TrashIcon.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { IconTrash } from '@tabler/icons-react';
2+
3+
import { wrapIcon } from './wrap-icon';
4+
5+
export const TrashIcon = wrapIcon('TrashIcon', <IconTrash />);

src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export { ThunderboltCrossedIcon } from './ThunderboltCrossedIcon';
111111
export { ThunderboltFilledIcon } from './ThunderboltFilledIcon';
112112
export { ThunderboltIcon } from './ThunderboltIcon';
113113
export { TimeIcon } from './TimeIcon';
114+
export { TrashIcon } from './TrashIcon';
114115
export { UnlockIcon } from './UnlockIcon';
115116
export { UpIcon } from './UpIcon';
116117
export { UserGroupIcon } from './UserGroupIcon';

0 commit comments

Comments
 (0)