From 83d9f228b3cafed302a55f5cd889f0f569ee1ce4 Mon Sep 17 00:00:00 2001 From: Pinaki Bhattacharjee Date: Thu, 14 Sep 2023 16:31:02 +0530 Subject: [PATCH] fix(theme): improve docs sidebar category caret aria-label accessibility (#9269) Co-authored-by: sebastienlorber --- .../theme/DocSidebarItem/Category/index.tsx | 31 +++++++++++++------ .../locales/ar/theme-common.json | 3 +- .../locales/base/theme-common.json | 3 +- .../locales/bn/theme-common.json | 3 +- .../locales/cs/theme-common.json | 3 +- .../locales/da/theme-common.json | 3 +- .../locales/de/theme-common.json | 3 +- .../locales/es/theme-common.json | 3 +- .../locales/fa/theme-common.json | 3 +- .../locales/fil/theme-common.json | 3 +- .../locales/fr/theme-common.json | 3 +- .../locales/he/theme-common.json | 3 +- .../locales/hi/theme-common.json | 3 +- .../locales/hu/theme-common.json | 3 +- .../locales/it/theme-common.json | 3 +- .../locales/ja/theme-common.json | 3 +- .../locales/ko/theme-common.json | 3 +- .../locales/nb/theme-common.json | 3 +- .../locales/nl/theme-common.json | 3 +- .../locales/pl/theme-common.json | 3 +- .../locales/pt-BR/theme-common.json | 3 +- .../locales/pt-PT/theme-common.json | 3 +- .../locales/ru/theme-common.json | 3 +- .../locales/sl/theme-common.json | 3 +- .../locales/sr/theme-common.json | 3 +- .../locales/sv/theme-common.json | 3 +- .../locales/tr/theme-common.json | 3 +- .../locales/uk/theme-common.json | 3 +- .../locales/vi/theme-common.json | 3 +- .../locales/zh-Hans/theme-common.json | 3 +- .../locales/zh-Hant/theme-common.json | 3 +- 31 files changed, 82 insertions(+), 39 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx index a3bb2f05d355..8890a8043d2b 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx @@ -72,23 +72,35 @@ function useCategoryHrefWithSSRFallback( } function CollapseButton({ + collapsed, categoryLabel, onClick, }: { + collapsed: boolean; categoryLabel: string; onClick: ComponentProps<'button'>['onClick']; }) { return (