diff --git a/README.md b/README.md index d9ab059..79eb111 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ - **Version 2.2 (breaking changes from 2.1.x)** - - 2.2.13: - - Updated Textarea and all Input components to allow aria-label. - - Updated Select components. - 2.2.12: Updated Select components to WCAG with aria-label and role. - 2.2.11: Updated Primary and Secondary topnav to NLDS. - 2.2.10: Added z-index to tooltip. diff --git a/package.json b/package.json index 3256455..77db6a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@conduction/components", - "version": "2.2.13", + "version": "2.2.12", "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)", "main": "lib/index.js", "scripts": { diff --git a/src/components/formFields/input.tsx b/src/components/formFields/input.tsx index ed63a51..8485e6e 100644 --- a/src/components/formFields/input.tsx +++ b/src/components/formFields/input.tsx @@ -5,7 +5,6 @@ import { ErrorMessage } from "./errorMessage/ErrorMessage"; export interface IInputProps { name: string; - ariaLabel?: string; disabled?: boolean; defaultValue?: string; icon?: JSX.Element; @@ -21,7 +20,6 @@ export const InputPassword: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => { return ( <> @@ -30,7 +28,6 @@ export const InputPassword: React.FC = ({ {...{ disabled, placeholder }} {...register(name, { ...validation })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -47,7 +44,6 @@ export const InputText: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => ( <> = ({ {...{ defaultValue, disabled, placeholder, icon }} {...register(name, { ...validation })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -71,7 +66,6 @@ export const InputEmail: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => ( <> = ({ {...{ defaultValue, disabled, placeholder, icon }} {...register(name, { ...validation })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -96,7 +89,6 @@ export const InputURL: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => ( <> = ({ {...{ defaultValue, disabled, placeholder, icon }} {...register(name, { ...validation })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -120,7 +111,6 @@ export const InputNumber: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => ( <> = ({ {...{ defaultValue, disabled, placeholder, icon }} {...register(name, { ...validation, valueAsNumber: true })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -144,7 +133,6 @@ export const InputFloat: React.FC = ({ placeholder, errors, hideErrorMessage, - ariaLabel, }) => ( <> = ({ {...{ disabled, placeholder, icon, defaultValue }} {...register(name, { ...validation, valueAsNumber: true })} invalid={errors[name]} - aria-label={ariaLabel} /> {errors[name] && !hideErrorMessage && } @@ -170,13 +157,11 @@ export const InputFile: React.FC ( ); diff --git a/src/components/formFields/select/select.tsx b/src/components/formFields/select/select.tsx index 41cf75f..9646eb7 100644 --- a/src/components/formFields/select/select.tsx +++ b/src/components/formFields/select/select.tsx @@ -145,7 +145,7 @@ export const SelectCreate = ({ element.setAttribute("role", "presentation"); } }); - document.querySelectorAll('[class*="a11yText"]').forEach((element: any) => { + document.querySelectorAll('[class*="a11yText-A11yText"]').forEach((element: any) => { if (element.role !== "presentation") { element.setAttribute("role", "presentation"); } diff --git a/src/components/formFields/textarea.tsx b/src/components/formFields/textarea.tsx index f6aea00..4f3ea5d 100644 --- a/src/components/formFields/textarea.tsx +++ b/src/components/formFields/textarea.tsx @@ -4,7 +4,6 @@ import { Textarea as UtrechtTextarea } from "@utrecht/component-library-react/di export interface ITextAreaProps { name: string; - ariaLabel?: string; disabled?: boolean; defaultValue?: string; hideErrorMessage?: boolean; @@ -18,15 +17,9 @@ export const Textarea = ({ disabled, defaultValue, hideErrorMessage, - ariaLabel, }: ITextAreaProps & IReactHookFormProps): JSX.Element => ( <> - + {errors[name] && !hideErrorMessage && } );