From deec054f6909987421f61c7c2f2c1dad2e874522 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Fri, 5 Jan 2024 12:14:47 +0900 Subject: [PATCH 1/2] Fix a11y support (WIP) --- packages/for-ui/src/checkbox/Checkbox.tsx | 1 + packages/for-ui/src/radio/Radio.tsx | 1 + packages/for-ui/src/table/Table.tsx | 11 ++++++++--- packages/for-ui/types/react-table.d.ts | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/for-ui/src/checkbox/Checkbox.tsx b/packages/for-ui/src/checkbox/Checkbox.tsx index dfdcb7f9e..1d1b21c12 100644 --- a/packages/for-ui/src/checkbox/Checkbox.tsx +++ b/packages/for-ui/src/checkbox/Checkbox.tsx @@ -21,6 +21,7 @@ const Indicator: FC<{ state: 'default' | 'checked' | 'intermediate'; disabled: b intermediate: [`bg-primary-dark-default`, disabled && `bg-primary-dark-disabled`], }[state], ])} + aria-hidden > { { diff --git a/packages/for-ui/src/radio/Radio.tsx b/packages/for-ui/src/radio/Radio.tsx index 8edd072f4..33e56b4e8 100644 --- a/packages/for-ui/src/radio/Radio.tsx +++ b/packages/for-ui/src/radio/Radio.tsx @@ -17,6 +17,7 @@ const Indicator: FC<{ checked: boolean; disabled: boolean }> = ({ checked, disab checked && `border-primary-dark-default border-6`, disabled && `border-shade-medium-disabled`, ])} + aria-hidden /> ); diff --git a/packages/for-ui/src/table/Table.tsx b/packages/for-ui/src/table/Table.tsx index 5dd9cabe6..dc307fe7e 100644 --- a/packages/for-ui/src/table/Table.tsx +++ b/packages/for-ui/src/table/Table.tsx @@ -123,11 +123,15 @@ export const Table = ({ minWidth: '20px', width: '20px', maxWidth: '20px', + columnLabel: '一括操作する行の選択', }, header: ({ table }) => ( {!!onSelectRows && ( すべての行を選択 @@ -142,12 +146,12 @@ export const Table = ({ ), cell: ({ row }) => ( - + {!!onSelectRows && ( - 行を選択 + この行を選択 } className={fsx(`flex`)} @@ -162,7 +166,7 @@ export const Table = ({ - 行を選択 + この行を選択 } className={fsx(`flex`)} @@ -210,6 +214,7 @@ export const Table = ({ {headerGroup.headers.map((header) => ( Date: Tue, 9 Jan 2024 17:32:37 +0900 Subject: [PATCH 2/2] Remove unused aria-describedby --- packages/for-ui/src/table/Table.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/for-ui/src/table/Table.tsx b/packages/for-ui/src/table/Table.tsx index dc307fe7e..85e3297f2 100644 --- a/packages/for-ui/src/table/Table.tsx +++ b/packages/for-ui/src/table/Table.tsx @@ -129,9 +129,6 @@ export const Table = ({ {!!onSelectRows && ( すべての行を選択