From 09dba4ce5c77d0832cb45519e5e2c8ebaa6731a9 Mon Sep 17 00:00:00 2001 From: shlyamster <25763635+shlyamster@users.noreply.github.com> Date: Sun, 8 Dec 2024 17:06:05 +0400 Subject: [PATCH 1/4] fix: ReactElement type --- packages/core/system-rsc/src/extend-variants.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/system-rsc/src/extend-variants.d.ts b/packages/core/system-rsc/src/extend-variants.d.ts index 3ef30a7bee..65568b7e8d 100644 --- a/packages/core/system-rsc/src/extend-variants.d.ts +++ b/packages/core/system-rsc/src/extend-variants.d.ts @@ -91,7 +91,7 @@ export type ExtendVariants = { }, opts?: Options, ): ForwardRefRenderFunction< - ReactElement, + ReactElement, { [key in keyof CP | keyof V]?: | (key extends keyof CP ? CP[key] : never) From 77c5ac446cf0d4a7ea4713dde2c851a96c3b46ff Mon Sep 17 00:00:00 2001 From: shlyamster <25763635+shlyamster@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:03:35 +0400 Subject: [PATCH 2/4] fix: extendVariants forwardRef return type --- .../core/system-rsc/src/extend-variants.d.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/system-rsc/src/extend-variants.d.ts b/packages/core/system-rsc/src/extend-variants.d.ts index 65568b7e8d..d4f1a80e17 100644 --- a/packages/core/system-rsc/src/extend-variants.d.ts +++ b/packages/core/system-rsc/src/extend-variants.d.ts @@ -1,5 +1,11 @@ import type {ClassValue, StringToBoolean, OmitUndefined, ClassProp} from "tailwind-variants"; -import type {ForwardRefRenderFunction, JSXElementConstructor, ReactElement} from "react"; +import type { + ForwardRefExoticComponent, + JSXElementConstructor, + PropsWithoutRef, + ReactElement, + RefAttributes, +} from "react"; type SlotsClassValue = { [K in keyof S]?: ClassValue; @@ -90,13 +96,13 @@ export type ExtendVariants = { slots?: S; }, opts?: Options, - ): ForwardRefRenderFunction< - ReactElement, - { + ): ForwardRefExoticComponent< + PropsWithoutRef<{ [key in keyof CP | keyof V]?: | (key extends keyof CP ? CP[key] : never) | (key extends keyof V ? StringToBoolean : never); - } + }> & + RefAttributes >; }; From f88b039d24e08ffaa4db2da35cf75baa47a27e4c Mon Sep 17 00:00:00 2001 From: shlyamster <25763635+shlyamster@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:28:07 +0400 Subject: [PATCH 3/4] feat: add changeset --- .changeset/twelve-ducks-thank.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twelve-ducks-thank.md diff --git a/.changeset/twelve-ducks-thank.md b/.changeset/twelve-ducks-thank.md new file mode 100644 index 0000000000..9d968a3a67 --- /dev/null +++ b/.changeset/twelve-ducks-thank.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/system-rsc": minor +--- + +Fix data type returned by the extendVariants function (#4269) From 53a16f2581086768d8fbe62fd762850641b5e669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=D3=84=D5=A1?= Date: Mon, 9 Dec 2024 22:42:44 +0800 Subject: [PATCH 4/4] chore(changeset): change to patch --- .changeset/twelve-ducks-thank.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/twelve-ducks-thank.md b/.changeset/twelve-ducks-thank.md index 9d968a3a67..ad8ba259a3 100644 --- a/.changeset/twelve-ducks-thank.md +++ b/.changeset/twelve-ducks-thank.md @@ -1,5 +1,5 @@ --- -"@nextui-org/system-rsc": minor +"@nextui-org/system-rsc": patch --- Fix data type returned by the extendVariants function (#4269)