From dea2d48df090b4baeefb7af40162e06b1cf0afea Mon Sep 17 00:00:00 2001 From: Rowell Heria Date: Mon, 20 Jan 2025 18:15:21 +0000 Subject: [PATCH] fix(nhsuk-frontend-react): pass table cell role to variations --- .changeset/flat-cobras-sparkle.md | 5 +++++ .../components/content-presentation/table/Table.stories.tsx | 2 +- .../src/components/content-presentation/table/Table.tsx | 1 + .../table/__snapshots__/Table.spec.tsx.snap | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/flat-cobras-sparkle.md diff --git a/.changeset/flat-cobras-sparkle.md b/.changeset/flat-cobras-sparkle.md new file mode 100644 index 00000000..d89389ca --- /dev/null +++ b/.changeset/flat-cobras-sparkle.md @@ -0,0 +1,5 @@ +--- +"nhsuk-frontend-react": patch +--- + +fix(nhsuk-frontend-react): pass table cell role to variations diff --git a/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.stories.tsx b/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.stories.tsx index e2255725..6f1098e0 100644 --- a/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.stories.tsx +++ b/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.stories.tsx @@ -119,7 +119,7 @@ export const ThreeColumnWithFirstCellAsHeader: Story = { - + 3-month £31.25 £32.05 diff --git a/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.tsx b/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.tsx index 620ca04d..dd8f8fba 100644 --- a/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.tsx +++ b/packages/nhsuk-frontend-react/src/components/content-presentation/table/Table.tsx @@ -242,6 +242,7 @@ const TableCell = ({ } : { as: 'td', + role, ...(cellClassNames && { className: cellClassNames }), }; diff --git a/packages/nhsuk-frontend-react/src/components/content-presentation/table/__snapshots__/Table.spec.tsx.snap b/packages/nhsuk-frontend-react/src/components/content-presentation/table/__snapshots__/Table.spec.tsx.snap index 0256ccd8..d8cd02c6 100644 --- a/packages/nhsuk-frontend-react/src/components/content-presentation/table/__snapshots__/Table.spec.tsx.snap +++ b/packages/nhsuk-frontend-react/src/components/content-presentation/table/__snapshots__/Table.spec.tsx.snap @@ -221,7 +221,7 @@ exports[`should render a three column table with the first cell as a header 1`] >