From d8d7d22225f0dff712fc307bfd3388efd7a041c0 Mon Sep 17 00:00:00 2001 From: Kyle McDonald Date: Wed, 17 Jun 2026 09:08:40 -0500 Subject: [PATCH] chore(react): remove clsx dependency (KNO-13814) --- .changeset/remove-clsx-from-react.md | 5 ++ packages/react/package.json | 1 - .../guide/components/Banner/Banner.tsx | 48 ++++++++++--- .../modules/guide/components/Card/Card.tsx | 67 +++++++++++++++---- .../modules/guide/components/Modal/Modal.tsx | 50 ++++++++++---- yarn.lock | 1 - 6 files changed, 135 insertions(+), 37 deletions(-) create mode 100644 .changeset/remove-clsx-from-react.md diff --git a/.changeset/remove-clsx-from-react.md b/.changeset/remove-clsx-from-react.md new file mode 100644 index 000000000..f769b1334 --- /dev/null +++ b/.changeset/remove-clsx-from-react.md @@ -0,0 +1,5 @@ +--- +"@knocklabs/react": patch +--- + +Remove the `clsx` runtime dependency from `@knocklabs/react`. The guide components now compose `className` natively, dropping `clsx` from the package's install graph. diff --git a/packages/react/package.json b/packages/react/package.json index 89cc3a97a..1049787b9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -88,7 +88,6 @@ "@telegraph/tokens": ">=0.2.0", "@telegraph/tooltip": ">=0.2.2", "@telegraph/typography": ">=0.4.0", - "clsx": "^2.1.1", "lodash.debounce": "^4.0.8", "lucide-react": "^0.544.0" }, diff --git a/packages/react/src/modules/guide/components/Banner/Banner.tsx b/packages/react/src/modules/guide/components/Banner/Banner.tsx index bb951fbc3..54b77dba5 100644 --- a/packages/react/src/modules/guide/components/Banner/Banner.tsx +++ b/packages/react/src/modules/guide/components/Banner/Banner.tsx @@ -1,5 +1,4 @@ import { ColorMode, useGuide } from "@knocklabs/react-core"; -import clsx from "clsx"; import React from "react"; import { maybeNavigateToUrlWithDelay } from "../helpers"; @@ -13,7 +12,10 @@ const Root: React.FC< React.PropsWithChildren> > = ({ children, className, ...props }) => { return ( -
+
{children}
); @@ -24,7 +26,12 @@ const Content: React.FC< React.PropsWithChildren> > = ({ children, className, ...props }) => { return ( -
+
{children}
); @@ -35,7 +42,12 @@ const Title: React.FC< { title: string } & React.ComponentPropsWithRef<"div"> > = ({ title, className, ...props }) => { return ( -
+
{title}
); @@ -49,7 +61,9 @@ const Body: React.FC<{ body: string } & React.ComponentPropsWithRef<"div">> = ({ }) => { return (
@@ -61,7 +75,12 @@ const Actions: React.FC< React.PropsWithChildren> > = ({ children, className, ...props }) => { return ( -
+
{children}
); @@ -73,7 +92,9 @@ const PrimaryButton: React.FC< > = ({ text, action, className, ...props }) => { return ( ); @@ -128,10 +162,12 @@ const SecondaryButton: React.FC< > = ({ text, action, className, ...props }) => { return ( ); @@ -153,10 +175,12 @@ const SecondaryButton: React.FC< > = ({ text, action, className, ...props }) => { return (