From d2c955ae267d36f946a1514508495ca2b3b10cbc Mon Sep 17 00:00:00 2001 From: Mykola Harmash Date: Mon, 19 Aug 2024 16:38:42 +0200 Subject: [PATCH] [Observability Onboarding] Add ARIA labels to option containers on the main screen --- .../onboarding_flow_form.tsx | 81 +++++++++++-------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/onboarding_flow_form/onboarding_flow_form.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/onboarding_flow_form/onboarding_flow_form.tsx index f926e4d1d88ee..aff760745eb6f 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/onboarding_flow_form/onboarding_flow_form.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/onboarding_flow_form/onboarding_flow_form.tsx @@ -92,6 +92,8 @@ export const OnboardingFlowForm: FunctionComponent = () => { const customMargin = useCustomMargin(); const radioGroupId = useGeneratedHtmlId({ prefix: 'onboardingCategory' }); + const categorySelectorTitleId = useGeneratedHtmlId(); + const packageListTitleId = useGeneratedHtmlId(); const [searchParams, setSearchParams] = useSearchParams(); @@ -138,6 +140,7 @@ export const OnboardingFlowForm: FunctionComponent = () => { return ( { )} /> - + {options.map((option) => ( { - {option.label} - - - {option.description} - - {(option.logos || option.showIntegrationsBadge) && ( - <> - - - {option.logos?.map((logo) => ( - - - - ))} - {option.showIntegrationsBadge && ( - - - - )} - - - )} - - } + label={{option.label}} checked={option.id === searchParams.get('category')} /** * onKeyDown and onKeyUp handlers disable @@ -211,15 +191,45 @@ export const OnboardingFlowForm: FunctionComponent = () => { ); } }} - /> + > + + {option.description} + + {(option.logos || option.showIntegrationsBadge) && ( + <> + + + {option.logos?.map((logo) => ( + + + + ))} + {option.showIntegrationsBadge && ( + + + + )} + + + )} + ))} {/* Hiding element instead of not rending these elements in order to preload available packages on page load */} -