Skip to content

Conversation

gabrielwallin
Copy link
Contributor

This pull request introduces a new, accessible table component system to the React package, providing a set of composable table primitives with built-in horizontal scrolling, keyboard navigation, and WCAG compliance. The changes include the implementation of the table components, their export from the package, and comprehensive Storybook stories demonstrating usage and features.

We use the same composition as in other grunnmuren-components, where the user "builds their own table", and the children are the cells.

Uses the same scrolling and responsiveness as Tabs!

Screen.Recording.2025-09-29.at.13.37.31.mov

@gabrielwallin gabrielwallin requested a review from a team as a code owner September 29, 2025 11:40
Copy link

changeset-bot bot commented Sep 29, 2025

⚠️ No Changeset found

Latest commit: 4eb2575

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@oscarcarlstrom oscarcarlstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi kanskje burde legge til støtte for table <caption>? https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/caption

<ChevronRight className="mt-0.25 h-6 w-full text-black " />
</div>
}
<ScrollButton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skulle inte detta vara en egen PR?

});

// Context for sharing table variant with child components
const TableContext = createContext<{ variant: 'default' | 'zebra' }>({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi behöver inte Context här, det kommer bara att dra ner performance. Vi kan lösa det med ett data-attribut och tailwind istället. Ska funka med group-data-*.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh smart

type TableColumnProps as UNSAFE_TableColumnProps,
type TableHeaderProps as UNSAFE_TableHeaderProps,
type TableProps as UNSAFE_TableProps,
type TableRowProps as UNSAFE_TableRowProps,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi må lage en enkel TableCaption her og som vi kan eksportere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants