From da9f79141a28cb2ccff202d569015b8e96d82614 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 2 May 2025 09:56:00 +0100 Subject: [PATCH] Canon - Refactor TextField to use Field Signed-off-by: James Brooks --- .../src/components/TextField/TextField.tsx | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/packages/canon/src/components/TextField/TextField.tsx b/packages/canon/src/components/TextField/TextField.tsx index db56463c3a..132d6ab1c6 100644 --- a/packages/canon/src/components/TextField/TextField.tsx +++ b/packages/canon/src/components/TextField/TextField.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { useId, forwardRef } from 'react'; -import { Input } from '@base-ui-components/react/input'; +import { Field } from '@base-ui-components/react/field'; +import { forwardRef } from 'react'; import { useResponsiveValue } from '../../hooks/useResponsiveValue'; import clsx from 'clsx'; @@ -39,56 +39,41 @@ export const TextField = forwardRef( // Get the responsive value for the variant const responsiveSize = useResponsiveValue(size); - // Generate unique IDs for accessibility - const inputId = useId(); - const descriptionId = useId(); - const errorId = useId(); - return ( -
{label && ( - + )} - {description && ( -

+ {description} -

+ )} {error && ( - + )} -
+ ); }, );