Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Table): 行選択のアクセシビリティ改善 #1498

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/for-ui/src/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
>
{
{
Expand Down
1 change: 1 addition & 0 deletions packages/for-ui/src/radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
);

Expand Down
8 changes: 5 additions & 3 deletions packages/for-ui/src/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const Table = <T extends RowData>({
minWidth: '20px',
width: '20px',
maxWidth: '20px',
columnLabel: '一括操作する行の選択',
},
header: ({ table }) => (
<Fragment>
Expand All @@ -142,12 +143,12 @@ export const Table = <T extends RowData>({
</Fragment>
),
cell: ({ row }) => (
<TableCell as="th" scope="row">
<TableCell as="td" scope="row">
{!!onSelectRows && (
<Checkbox
label={
<Text aria-hidden={false} className={fsx(`hidden`)}>
行を選択
この行を選択
</Text>
}
className={fsx(`flex`)}
Expand All @@ -162,7 +163,7 @@ export const Table = <T extends RowData>({
<Radio
label={
<Text aria-hidden={false} className={fsx(`hidden`)}>
行を選択
この行を選択
</Text>
}
className={fsx(`flex`)}
Expand Down Expand Up @@ -210,6 +211,7 @@ export const Table = <T extends RowData>({
<TableRow key={headerGroup.id} className="table-row">
{headerGroup.headers.map((header) => (
<SortableTableCellHead
aria-label={header.column.columnDef.meta?.columnLabel}
key={header.id}
scope="col"
nextSortingOrder={header.column.getNextSortingOrder()}
Expand Down
1 change: 1 addition & 0 deletions packages/for-ui/types/react-table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ declare module '@tanstack/table-core' {
width?: string
minWidth?: string
maxWidth?: string
columnLabel?: string
}
}