Skip to content

Commit c6d01a4

Browse files
committed
Remove clsx
1 parent c87c813 commit c6d01a4

4 files changed

Lines changed: 18 additions & 26 deletions

File tree

amicons/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
"peerDependencies": {
5454
"react": ">=16.x"
5555
},
56-
"dependencies": {
57-
"clsx": "^2.1.1"
58-
},
5956
"devDependencies": {
6057
"@types/react": "^19.0.1",
6158
"nodemon": "3.1.14",

amicons/pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amicons/src/Amicon.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { IAmicon, aiCircleQuestion } from ".";
22
import { ComponentPropsWithoutRef } from "react";
3-
import clsx from "clsx";
43

54
interface AmiconProps {
65
icon?: IAmicon;
@@ -33,19 +32,25 @@ export default function AmiconIcon({
3332
? ({ "--ai-rotate": `${rotate}deg` } as React.CSSProperties)
3433
: {};
3534

35+
const classes = [
36+
className,
37+
"ai-icon",
38+
(!!rotate || rotate === 0) && "ai-rotate",
39+
flip === "x" && "ai-flip-x",
40+
flip === "y" && "ai-flip-y",
41+
flip === true && "ai-flip",
42+
spin === true && "ai-spin",
43+
spin === "pulse" && "ai-spin ai-spin-pulse",
44+
beat && "ai-beat",
45+
(isFallback || fade) && "ai-fade",
46+
bounce && "ai-bounce",
47+
]
48+
.filter(Boolean)
49+
.join(" ");
50+
3651
return (
3752
<span
38-
className={clsx(className, "ai-icon", {
39-
"ai-rotate": !!rotate || rotate === 0,
40-
"ai-flip-x": flip === "x",
41-
"ai-flip-y": flip === "y",
42-
"ai-flip": flip === true,
43-
"ai-spin": spin === true,
44-
"ai-spin ai-spin-pulse": spin === "pulse",
45-
"ai-beat": beat,
46-
"ai-fade": isFallback || fade,
47-
"ai-bounce": bounce,
48-
})}
53+
className={classes}
4954
style={{ ...rotateStyle, ...style }}
5055
dangerouslySetInnerHTML={{ __html: resolvedIcon.data }}
5156
{...props}

docs/src/app/Docs/pages/Changelog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Changelog() {
1212
]}
1313
changed={[
1414
'Rotate now allows you to set any numeric value rather than just `0`, `90`, `180`, or `270`.',
15-
"Amicons now only has 1 dependency as we've dropped `html-react-parser`.",
15+
"Amicons doesn't have any other dependencies anymore.",
1616
'Major enhancements to our build process and library generation. We now include source maps.'
1717
]}
1818
fixed={[

0 commit comments

Comments
 (0)