-
Notifications
You must be signed in to change notification settings - Fork 535
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
feat: add DataTable and Table to drafts #2951
Conversation
🦋 Changeset detectedLatest commit: 6a6d850 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
'@primer/react': minor | ||
--- | ||
|
||
Add DataTable, Table to drafts entrypoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering when will be the best time to start exporting new components in experimental
bundle instead of drafts
? According to the ADR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, reached out about this over in Slack to see where that work is. For this PR I'll add it to drafts
and will add it to experimental
once that gets created 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting to see this take shape!
TableContainer, | ||
TableTitle, | ||
TableSubtitle, | ||
} from '../DataTable' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
*/ | ||
|
||
export {DataTable, Table} from '../DataTable' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we export any prop types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me as part of the definition of done. To implement this, should I include props as exports for any exported component?
Closes https://github.com/github/primer/issues/1814
This PR adds
DataTable
andTable
to the drafts bundle with the following API:DataTable
Table.*
Table.Container
Table.Title
Table.Subtitle
Table
Table.Head
Table.Body
Table.Row
Table.Header
Table.Cell
The idea behind this implementation is that
DataTable
is an alternative toTable
and can slot into that position:Table
may also be used there and each part ofTable
is available under that identifier.One risk with this approach is that
Table.*
contains both descendants of aTable
and ancestors likeContainer
,Title
, orSubtitle
. The risk here would be that certain terms may be overloaded, like inTable.Header
. This would refer to a<th>
but in the context of a layout withinTable.Container
would refer to the header region of a layout.Changelog
New
Table.*
componentsChanged
interface
totype
DataTable.tsx
andTable.tsx
Table
andDataTable
to drafts entrypointrole
tags forth
,tr
,td
for usage ofdisplay: grid
for column width optionsRemoved