From 442983219aa3d1730805729bdc289b112c1acb4a Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Wed, 26 Jun 2024 11:56:44 +0200 Subject: [PATCH 1/2] Use the headless ui form components for accessibility --- .../objects/[id]/(provenance)/add-form.tsx | 253 ++++++++++-------- .../[id]/local-contexts-notices/form.tsx | 48 ++-- .../objects/[id]/user-enrichment-form.tsx | 65 +++-- .../components/form/checkbox-with-label.tsx | 24 +- apps/researcher/src/components/form/input.tsx | 7 +- .../researcher/src/components/form/layout.tsx | 7 +- .../src/components/form/motivation-input.tsx | 33 ++- .../src/components/form/textarea.tsx | 3 +- 8 files changed, 250 insertions(+), 190 deletions(-) diff --git a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx index fc256c0cf..a1ef947d1 100644 --- a/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx +++ b/apps/researcher/src/app/[locale]/objects/[id]/(provenance)/add-form.tsx @@ -1,6 +1,13 @@ 'use client'; -import {Tab} from '@headlessui/react'; +import { + Field, + Tab, + TabGroup, + TabList, + TabPanel, + TabPanels, +} from '@headlessui/react'; import {useLocale, useTranslations} from 'next-intl'; import {Fragment, ReactNode, useMemo, useState} from 'react'; import classNames from 'classnames'; @@ -231,12 +238,12 @@ export default function AddProvenanceForm({ )} - - + - - + +
- + - - + + - - + + + + - - - + + + + + @@ -291,82 +304,92 @@ export default function AddProvenanceForm({ {t('nextButton')} - + - + - {text}, - })} - description={t('transferredFromDescription')} - /> - + + {text}, + })} + description={t('transferredFromDescription')} + /> + + - {text}, - })} - description={t('transferredToDescription')} - /> - + + {text}, + })} + description={t('transferredToDescription')} + /> + + - - + + + + - - - + + + + + - - - + + + + + @@ -379,27 +402,31 @@ export default function AddProvenanceForm({ {t('nextButton')} - + - + - - + + + + - -