From 6bfc8db023114484d5124533c9ae4e2b012690a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Manuel=20Fuentes=20Trejo?= Date: Thu, 12 Feb 2026 18:44:30 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20labelAction=20prop=20?= =?UTF-8?q?to=20Select=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for rendering custom content (e.g., a button or icon) on the right side of the Select label, matching the existing Input pattern. --- lib/components/Select/Select.test.tsx | 8 ++++++++ lib/components/Select/Select.types.ts | 1 + lib/components/Select/components/Wrapper.tsx | 9 ++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/components/Select/Select.test.tsx b/lib/components/Select/Select.test.tsx index 97c8c0a0..1b0229a9 100644 --- a/lib/components/Select/Select.test.tsx +++ b/lib/components/Select/Select.test.tsx @@ -177,6 +177,14 @@ describe('Select', () => { expect(option).toBeInTheDocument(); }); + + it('should render the labelAction next to the label', () => { + setup({ + labelAction: , + }); + + expect(screen.getByText('Action')).toBeInTheDocument(); + }); }); describe('select inside a form', () => { diff --git a/lib/components/Select/Select.types.ts b/lib/components/Select/Select.types.ts index 6e29159e..acc923ec 100644 --- a/lib/components/Select/Select.types.ts +++ b/lib/components/Select/Select.types.ts @@ -88,6 +88,7 @@ export type SelectProps = VariantProps & isLoading?: boolean; isRequired?: boolean; label?: string; + labelAction?: ReactNode; labelClassName?: string; labelWrapperClassName?: string; listClassName?: string; diff --git a/lib/components/Select/components/Wrapper.tsx b/lib/components/Select/components/Wrapper.tsx index e23ff24e..750647fb 100644 --- a/lib/components/Select/components/Wrapper.tsx +++ b/lib/components/Select/components/Wrapper.tsx @@ -46,6 +46,7 @@ export const Wrapper: ForwardRefExoticComponent< isLoading, isRequired, label, + labelAction, labelClassName, labelWrapperClassName, listClassName, @@ -135,7 +136,12 @@ export const Wrapper: ForwardRefExoticComponent< data-theme={theme} > {label ? ( -
+
+ {labelAction}
) : null}