diff --git a/packages/canon/package.json b/packages/canon/package.json index e0febe544d..b5d2d715f6 100644 --- a/packages/canon/package.json +++ b/packages/canon/package.json @@ -66,7 +66,6 @@ "mini-css-extract-plugin": "^2.9.2", "react": "^18.0.2", "react-dom": "^18.0.2", - "react-hook-form": "^7.55.0", "react-router-dom": "^6.3.0", "storybook": "^8.6.8" }, diff --git a/packages/canon/report.api.md b/packages/canon/report.api.md index 766b40febd..c4cfbefcc2 100644 --- a/packages/canon/report.api.md +++ b/packages/canon/report.api.md @@ -1055,7 +1055,7 @@ export { Text_2 as Text }; // @public (undocumented) export const TextField: React_2.ForwardRefExoticComponent< - TextFieldProps & React_2.RefAttributes + TextFieldProps & React_2.RefAttributes >; // @public (undocumented) @@ -1063,6 +1063,7 @@ export interface TextFieldProps extends Omit, 'size'> { className?: string; description?: string; + error?: string | null; label?: string; name: string; size?: 'small' | 'medium' | Partial>; diff --git a/packages/canon/src/components/TextField/TextField.styles.css b/packages/canon/src/components/TextField/TextField.styles.css index 5ffae8aa16..899acc0034 100644 --- a/packages/canon/src/components/TextField/TextField.styles.css +++ b/packages/canon/src/components/TextField/TextField.styles.css @@ -90,8 +90,8 @@ } .canon-TextField--required { - color: var(--canon-fg-danger); - font-size: var(--canon-font-size-3); + color: var(--canon-fg-secondary); + font-size: var(--canon-font-size-2); font-weight: var(--canon-font-weight-regular); margin-left: var(--canon-space-1); } diff --git a/packages/canon/src/components/TextField/TextField.tsx b/packages/canon/src/components/TextField/TextField.tsx index 2b96bfe555..c3e1783561 100644 --- a/packages/canon/src/components/TextField/TextField.tsx +++ b/packages/canon/src/components/TextField/TextField.tsx @@ -32,7 +32,6 @@ export const TextField = forwardRef( name, error, required, - disabled, ...rest } = props; @@ -40,31 +39,18 @@ export const TextField = forwardRef( const responsiveSize = useResponsiveValue(size); // Generate unique IDs for accessibility - const inputId = `textfield-${name}`; - const descriptionId = `${inputId}-description`; - const errorId = `${inputId}-error`; + const inputId = React.useId(); + const descriptionId = React.useId(); + const errorId = React.useId(); return ( -
+
{label && ( -