feat(Table): Add whitespace below Caption#2515
feat(Table): Add whitespace below Caption#2515VincentSmedinga wants to merge 8 commits intodevelopfrom
Conversation
Allow positioning the caption below the table with `side="bottom"`. Add explicit generic parameters to `forwardRef` in TableCaption so TypeScript preserves the custom `side` prop. Add an explicit type annotation to the Table compound component to ensure sub-component prop types are not lost by `Object.assign`.
There was a problem hiding this comment.
Pull request overview
This PR adds support for rendering a table caption visually below the table via a new side="bottom" prop on TableCaption, with accompanying styling and design token support, and adjusts TypeScript typing to preserve compound-component subcomponent prop types.
Changes:
- Add
side?: 'bottom'toTableCaptionand apply aams-table__caption--bottommodifier class when set. - Update table caption styling to support bottom positioning and add configurable margins via CSS variables.
- Strengthen TypeScript types for
forwardRefusage and theTablecompound component to preserve subcomponent prop types.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react/src/Table/TableCaption.tsx | Adds side="bottom" prop and modifier class; uses explicit generics on forwardRef for better prop preservation. |
| packages/react/src/Table/Table.tsx | Adds explicit compound-component typing to preserve subcomponent prop types through Object.assign. |
| packages/css/src/components/table/table.scss | Adds bottom-caption styling (caption-side: bottom) and margin handling for top vs bottom captions. |
| packages-proprietary/tokens/src/components/ams/table.tokens.json | Introduces caption margin design tokens used by the updated SCSS variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is not really useful.
RubenSibon
left a comment
There was a problem hiding this comment.
This PR's title and description does not seem to match the changes it makes. It also adds a Story. Can you adjust?
|
/chromatic test The old one is outdated. |
@Evi-2003, with the change to kick of the builds manually we do have to be alert if an existing build is out-of-date. It does add some cognitive load. It's absolutely not a major inconvenience, but still good to be aware of. |
RubenSibon
left a comment
There was a problem hiding this comment.
Adjust the test Story for Chromatic.
@RubenSibon Sure, I’ve updated the PR description. We don’t usually mention documentation changes in the changelog, so I’ve left the title alone. I’ve added a Paragraph into the Table Caption of the test story as well, so Chromatic tests both the whitespace below the caption and the accessible name of the table. |
|
/Chromatic test |
Describe the pull request
Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.
What
Why
How
n/a
Checklist
Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:
/chromatic testand verify visual regression tests passAdditional notes