Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
| placement: ChildPlacement, | ||
| columns: string = '1fr 1fr 1fr min-content', | ||
| ): FC<{ children: ReactNode }> { | ||
| return ({ children }) => { |
There was a problem hiding this comment.
note: no longer need these inline styles as our "real" Table component takes care of all this.
| /** Simple factory that returns a component that renders valid table DOM hierarchy around its children */ | ||
| export function buildTableWrapper(placement: ChildPlacement): FC<{ children: ReactNode }> { | ||
| export function buildTableWrapper( | ||
| placement: ChildPlacement, |
There was a problem hiding this comment.
note: added a new columns option to this factory so that some stories can build a table wrapper with specifically sized columns.
| @@ -172,12 +172,13 @@ export const Overflow: Story = { | |||
| ), | |||
| }, | |||
| decorators: [ | |||
There was a problem hiding this comment.
note: switch around how the truncation was happening, so we're more correctly demonstrating the behaviour of the body cell, rather than the intermediate div. The div now wraps the whole table, so it's not interfering with layout concerns.
| justifyContent: 'end', | ||
| justifySelf: 'end', | ||
| }, | ||
| decorators: [ |
There was a problem hiding this comment.
note: same deal as above.
| @@ -228,15 +229,16 @@ export const EmptyCells: Story = { | |||
| export const Alignment: Story = { | |||
| args: { | |||
| ...DoubleLineLayout.args, | |||
There was a problem hiding this comment.
note: because we switched to using justify-items, we now use justify-self to uniquely justify the content of cells
| align-items: center; | ||
| justify-content: inherit; | ||
|
|
||
| ${font('sm', 'regular')} |
There was a problem hiding this comment.
note: matching the adjustment made to the header cell.
| padding: var(--spacing-2); | ||
|
|
||
| overflow: hidden; | ||
|
|
There was a problem hiding this comment.
note: when a custom justification is applied to a cell, that cell and its descendants will have the overridden value for the new CSS variable.
| @@ -86,7 +86,7 @@ function buildRows(type: 'single-line' | 'double-line') { | |||
| return ( | |||
| <> | |||
| <TableBodyRow> | |||
There was a problem hiding this comment.
note: scouting some TS errors here... scope is no longer accepted (its auto-applied; see #723)
| @@ -91,7 +91,7 @@ export const Clipping: Story = { | |||
| }, | |||
| decorators: [ | |||
| (Story) => ( | |||
There was a problem hiding this comment.
note: small scout to make the clipping more obvious
| @@ -79,6 +81,39 @@ export const Sortable: Story = { | |||
| decorators: [useTableDecorator('header-cell')], | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
note: added a new story showing truncation for a header cell...though ideally header cells will never truncate.
c2df0e1 to
43e8bcb
Compare
| padding: var(--spacing-2); | ||
|
|
||
| ${font('2xs', 'bold')} | ||
| color: var(--colour-text-secondary); |
There was a problem hiding this comment.
note: th elements in the table's head come with user-agent styles for text-align. We use the new CSS variable set by the table to override this default style so that it matches the chosen justification.
| @@ -16,7 +17,7 @@ interface TableRowMoreActionsButtonProps extends Omit<ButtonHTMLAttributes<HTMLB | |||
| * is preferred when the button should still be focusable while it's disabled; for example, to allow | |||
| * a tooltip to be displayed that explains why the button is disabled. | |||
| */ | |||
There was a problem hiding this comment.
note: small scout to make these props optional
| @@ -67,6 +68,7 @@ export function TableRowMoreActionsButton({ | |||
| className={cx(elTableRowMoreActionsButton, className)} | |||
| disabled={disabled} | |||
| onClick={handleClick} | |||
There was a problem hiding this comment.
note: small scout to pin the more actions trigger button to be a button, never a submit.
43e8bcb to
4f55f9e
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
Context
@reapit/elements/lab/table, but these don't facilitate the level of nuance required by the DS. For example:td,trand so on, but we may need the flexibility of using them in a div-based DOM structure instead.@reapit/elements/core/table.TableRowPrimaryAction#715, feat: Add newTableCellPrimaryData#716, feat: Add newTableCellDoubleLineLayout#717, feat: Add newTableBodyCell#718, feat: Add newTableBodyRow#719, feat: Add newTableBody#720 and feat: Add newTableRowMoreActions#721.TableCellSortButton#725, feat: Add newTableHeaderCell#726, feat: Add newTableHeaderRow#727, feat: Add newTableHead#728.This PR
Table. This component ties all the other atoms together, defining the CSS grid layout that the rows/columns align to.justify-itemsand a CSS variable that other table atoms reference.