Skip to content

Commit d0d7d0f

Browse files
authored
Merge pull request #3694 from udecode/refactor/remove-icons
Remove icons
2 parents c217b6b + 4e967a1 commit d0d7d0f

20 files changed

+292
-368
lines changed

apps/www/content/docs/components/changelog.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver
1111

1212
## October 2024 #15
1313

14-
### October 27 #15.6
14+
### October 31 #15.6
1515

1616
- Fixed and modified some styles in emoji and color picker
17+
- Remove `Icons` file dependency. All icons are now imported from `lucide-react`.
1718

1819
### October 26 #15.5
1920

apps/www/content/docs/components/installation/manual.mdx

+2-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Add the following dependencies to your project:
1919
npm install @udecode/cn tailwindcss-animate class-variance-authority tailwind-merge lucide-react
2020
```
2121

22+
We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
23+
2224
### Configure tailwind.config.js
2325

2426
Here's what demo `tailwind.config.js` looks like:
@@ -37,14 +39,6 @@ Add the following to your `styles/globals.css` file. You can learn more about us
3739
open
3840
/>
3941

40-
### Add icons
41-
42-
Add the icons you'll use in `components/icons.tsx`:
43-
44-
<ComponentSource src="../../templates/plate-playground-template/src/components/icons.tsx" />
45-
46-
We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
47-
4842
### Add components
4943

5044
You can now start adding components to your project.

apps/www/content/docs/components/installation/next.mdx

-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ Which color would you like to use as base color? › Slate
3535
Do you want to use CSS variables for colors? › no / yes
3636
```
3737

38-
### Add icons
39-
40-
Add the icons you'll use in `components/icons.tsx`:
41-
42-
<ComponentSource src="../../templates/plate-playground-template/src/components/icons.tsx" />
43-
44-
We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
45-
4638
### Add components
4739

4840
You can now start adding components to your project.

apps/www/content/docs/components/installation/vite.mdx

-8
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ Which color would you like to use as base color? › Slate
109109
Do you want to use CSS variables for colors? › no / yes
110110
```
111111

112-
### Add icons
113-
114-
Add the icons you'll use in `components/icons.tsx`:
115-
116-
<ComponentSource src="../../templates/plate-playground-template/src/components/icons.tsx" />
117-
118-
We use icons from [Lucide](https://lucide.dev). You can use any icon library you want.
119-
120112
### Add components
121113

122114
You can now start adding components to your project.

apps/www/src/components/icons.tsx

-207
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22

33
import type { IconProps } from '@radix-ui/react-icons/dist/types';
44

5-
import { cva } from 'class-variance-authority';
65
import {
76
type LucideIcon,
87
type LucideProps,
@@ -101,96 +100,6 @@ import {
101100

102101
export type Icon = LucideIcon;
103102

104-
const borderAll = (props: LucideProps) => (
105-
<svg
106-
fill="currentColor"
107-
focusable="false"
108-
height="48"
109-
role="img"
110-
viewBox="0 0 24 24"
111-
width="48"
112-
xmlns="http://www.w3.org/2000/svg"
113-
{...props}
114-
>
115-
<path d="M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6zm10 13h5a1 1 0 0 0 1-1v-5h-6v6zm-2-6H5v5a1 1 0 0 0 1 1h5v-6zm2-2h6V6a1 1 0 0 0-1-1h-5v6zm-2-6H6a1 1 0 0 0-1 1v5h6V5z" />
116-
</svg>
117-
);
118-
119-
const borderBottom = (props: LucideProps) => (
120-
<svg
121-
fill="currentColor"
122-
focusable="false"
123-
height="48"
124-
role="img"
125-
viewBox="0 0 24 24"
126-
width="48"
127-
xmlns="http://www.w3.org/2000/svg"
128-
{...props}
129-
>
130-
<path d="M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm-2 7a1 1 0 1 1 2 0 1 1 0 0 0 1 1h12a1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm17-8a1 1 0 0 0-1 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1-1zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3z" />
131-
</svg>
132-
);
133-
134-
const borderLeft = (props: LucideProps) => (
135-
<svg
136-
fill="currentColor"
137-
focusable="false"
138-
height="48"
139-
role="img"
140-
viewBox="0 0 24 24"
141-
width="48"
142-
xmlns="http://www.w3.org/2000/svg"
143-
{...props}
144-
>
145-
<path d="M6 21a1 1 0 1 0 0-2 1 1 0 0 1-1-1V6a1 1 0 0 1 1-1 1 1 0 0 0 0-2 3 3 0 0 0-3 3v12a3 3 0 0 0 3 3zm7-16a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm6 6a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm4-17a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zm-1 17a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" />
146-
</svg>
147-
);
148-
149-
const borderNone = (props: LucideProps) => (
150-
<svg
151-
fill="currentColor"
152-
focusable="false"
153-
height="48"
154-
role="img"
155-
viewBox="0 0 24 24"
156-
width="48"
157-
xmlns="http://www.w3.org/2000/svg"
158-
{...props}
159-
>
160-
<path d="M14 4a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-9 7a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-6 10a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zM7 20a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3z" />
161-
</svg>
162-
);
163-
164-
const borderRight = (props: LucideProps) => (
165-
<svg
166-
fill="currentColor"
167-
focusable="false"
168-
height="48"
169-
role="img"
170-
viewBox="0 0 24 24"
171-
width="48"
172-
xmlns="http://www.w3.org/2000/svg"
173-
{...props}
174-
>
175-
<path d="M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm9 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zM6 3a1 1 0 0 1 0 2 1 1 0 0 0-1 1 1 1 0 0 1-2 0 3 3 0 0 1 3-3zm1 17a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1V6a1 1 0 0 0-1-1 1 1 0 1 1 0-2 3 3 0 0 1 3 3v12a3 3 0 0 1-3 3z" />
176-
</svg>
177-
);
178-
179-
const borderTop = (props: LucideProps) => (
180-
<svg
181-
fill="currentColor"
182-
focusable="false"
183-
height="48"
184-
role="img"
185-
viewBox="0 0 24 24"
186-
width="48"
187-
xmlns="http://www.w3.org/2000/svg"
188-
{...props}
189-
>
190-
<path d="M3 6a1 1 0 0 0 2 0 1 1 0 0 1 1-1h12a1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3zm2 5a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-8 1a1 1 0 1 0 0-2 1 1 0 0 1-1-1 1 1 0 1 0-2 0 3 3 0 0 0 3 3zm11-1a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" />
191-
</svg>
192-
);
193-
194103
const discord = (props: LucideProps) => (
195104
<svg
196105
fill="none"
@@ -271,96 +180,6 @@ const yarn = (props: LucideProps) => (
271180
</svg>
272181
);
273182

274-
export const DoubleColumnOutlined = (props: LucideProps) => (
275-
<svg
276-
fill="none"
277-
height="16"
278-
viewBox="0 0 16 16"
279-
width="16"
280-
xmlns="http://www.w3.org/2000/svg"
281-
{...props}
282-
>
283-
<path
284-
clipRule="evenodd"
285-
d="M8.5 3H13V13H8.5V3ZM7.5 2H8.5H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H8.5H7.5H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H7.5ZM7.5 13H3L3 3H7.5V13Z"
286-
fill="#595E6F"
287-
fillRule="evenodd"
288-
/>
289-
</svg>
290-
);
291-
292-
export const ThreeColumnOutlined = (props: LucideProps) => (
293-
<svg
294-
fill="none"
295-
height="16"
296-
viewBox="0 0 16 16"
297-
width="16"
298-
xmlns="http://www.w3.org/2000/svg"
299-
{...props}
300-
>
301-
<path
302-
clipRule="evenodd"
303-
d="M9.25 3H6.75V13H9.25V3ZM9.25 2H6.75H5.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H5.75H6.75H9.25H10.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H10.25H9.25ZM10.25 3V13H13V3H10.25ZM3 13H5.75V3H3L3 13Z"
304-
fill="#4C5161"
305-
fillRule="evenodd"
306-
/>
307-
</svg>
308-
);
309-
310-
export const RightSideDoubleColumnOutlined = (props: LucideProps) => (
311-
<svg
312-
fill="none"
313-
height="16"
314-
viewBox="0 0 16 16"
315-
width="16"
316-
xmlns="http://www.w3.org/2000/svg"
317-
{...props}
318-
>
319-
<path
320-
clipRule="evenodd"
321-
d="M11.25 3H13V13H11.25V3ZM10.25 2H11.25H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H11.25H10.25H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H10.25ZM10.25 13H3L3 3H10.25V13Z"
322-
fill="#595E6F"
323-
fillRule="evenodd"
324-
/>
325-
</svg>
326-
);
327-
328-
export const LeftSideDoubleColumnOutlined = (props: LucideProps) => (
329-
<svg
330-
fill="none"
331-
height="16"
332-
viewBox="0 0 16 16"
333-
width="16"
334-
xmlns="http://www.w3.org/2000/svg"
335-
{...props}
336-
>
337-
<path
338-
clipRule="evenodd"
339-
d="M5.75 3H13V13H5.75V3ZM4.75 2H5.75H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H5.75H4.75H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H4.75ZM4.75 13H3L3 3H4.75V13Z"
340-
fill="#595E6F"
341-
fillRule="evenodd"
342-
/>
343-
</svg>
344-
);
345-
346-
export const DoubleSideDoubleColumnOutlined = (props: LucideProps) => (
347-
<svg
348-
fill="none"
349-
height="16"
350-
viewBox="0 0 16 16"
351-
width="16"
352-
xmlns="http://www.w3.org/2000/svg"
353-
{...props}
354-
>
355-
<path
356-
clipRule="evenodd"
357-
d="M10.25 3H5.75V13H10.25V3ZM10.25 2H5.75H4.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H4.75H5.75H10.25H11.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H11.25H10.25ZM11.25 3V13H13V3H11.25ZM3 13H4.75V3H3L3 13Z"
358-
fill="#595E6F"
359-
fillRule="evenodd"
360-
/>
361-
</svg>
362-
);
363-
364183
const LayoutIcon = (props: LucideProps) => (
365184
<svg
366185
fill="currentColor"
@@ -388,7 +207,6 @@ const LayoutIcon = (props: LucideProps) => (
388207
);
389208

390209
export const Icons = {
391-
LayoutIcon,
392210
add: Plus,
393211
ai: Sparkles,
394212
alignCenter: AlignCenter,
@@ -403,12 +221,6 @@ export const Icons = {
403221
bg: PaintBucket,
404222
blockquote: Quote,
405223
bold: Bold,
406-
borderAll,
407-
borderBottom,
408-
borderLeft,
409-
borderNone,
410-
borderRight,
411-
borderTop,
412224
check: Check,
413225
chevronDown: ChevronDown,
414226
chevronLeft: ChevronLeft,
@@ -433,8 +245,6 @@ export const Icons = {
433245
dependency: Link,
434246
discord,
435247
done: Check,
436-
doubleColumn: DoubleColumnOutlined,
437-
doubleSideDoubleColumn: DoubleSideDoubleColumnOutlined,
438248
download: DownloadIcon,
439249
downloadCloud: DownloadCloud,
440250
dragHandle: GripVertical,
@@ -460,7 +270,6 @@ export const Icons = {
460270
italic: Italic,
461271
kbd: Keyboard,
462272
laptop: Laptop,
463-
leftSideDoubleColumn: LeftSideDoubleColumnOutlined,
464273
lineHeight: WrapText,
465274
link: Link2,
466275
makeLonger: ListPlus,
@@ -480,7 +289,6 @@ export const Icons = {
480289
radix,
481290
react,
482291
refresh: RotateCcw,
483-
rightSideDoubleColumn: RightSideDoubleColumnOutlined,
484292
row: RectangleHorizontal,
485293
search: Search,
486294
settings: Settings,
@@ -497,7 +305,6 @@ export const Icons = {
497305
table: Table,
498306
tailwind,
499307
text: Text,
500-
threeColumn: ThreeColumnOutlined,
501308
todo: Square,
502309
translate: Languages,
503310
trash: Trash,
@@ -520,17 +327,3 @@ export const Icons = {
520327
viewing: Eye,
521328
yarn,
522329
};
523-
524-
export const iconVariants = cva('', {
525-
defaultVariants: {},
526-
variants: {
527-
size: {
528-
md: 'mr-2 size-6',
529-
sm: 'mr-2 size-4',
530-
},
531-
variant: {
532-
menuItem: 'mr-2 size-5',
533-
toolbar: 'size-5',
534-
},
535-
},
536-
});

0 commit comments

Comments
 (0)