-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix(Table): Reconfigured the table CSS to better allow for content within a table to overlay the container, such as dropdowns. #1621
Conversation
🦋 Changeset detectedLatest commit: 201ddf5 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 |
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.
- hasSquareCorners is broken in this example: https://storybook-preview-1621--upbeat-sinoussi-f675aa.netlify.app/?path=/story/table--square-corners&args=hasSquareCorners:false
- This breaks the square corners if the dropdown item is in the last row:
<Table maxWidth={500} {...args}>
<TableHead>
<TableRow>
<TableHeaderCell>Column</TableHeaderCell>
<TableHeaderCell>Column</TableHeaderCell>
<TableHeaderCell>Column</TableHeaderCell>
<TableHeaderCell>Column</TableHeaderCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>
<Dropdown isInverse={args.isInverse}>
<DropdownButton>Basic Dropdown</DropdownButton>
<DropdownContent>
<DropdownMenuItem>Menu item 1</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
</DropdownContent>
</Dropdown>
</TableCell>
</TableRow>
<TableRow>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>
<Select
labelText="Select Example"
items={[
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Green', value: 'green' },
{ label: 'Yellow', value: 'yellow' },
]}
isInverse={args.isInverse}
/>
</TableCell>
</TableRow>
<TableRow>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell>
<Combobox
isMulti
labelText="ComboBox Example"
defaultItems={[
{ label: 'Pink', value: 'pink' },
{ label: 'Orange', value: 'orange' },
{ label: 'Purple', value: 'purple' },
]}
isInverse={args.isInverse}
/>
</TableCell>
</TableRow> <TableRow>
<TableCell><Dropdown isInverse={args.isInverse}>
<DropdownButton>Basic Dropdown</DropdownButton>
<DropdownContent>
<DropdownMenuItem>Menu item 1</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
<DropdownMenuItem>Menu item number two</DropdownMenuItem>
</DropdownContent>
</Dropdown></TableCell>
<TableCell>Lorem ipsum dolor sit amet consectetur</TableCell>
<TableCell><Select
labelText="Select Example"
items={[
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Green', value: 'green' },
{ label: 'Yellow', value: 'yellow' },
]}
isInverse={args.isInverse}
/></TableCell>
<TableCell>
<Combobox
isMulti
labelText="ComboBox Example"
defaultItems={[
{ label: 'Pink', value: 'pink' },
{ label: 'Orange', value: 'orange' },
{ label: 'Purple', value: 'purple' },
]}
isInverse={args.isInverse}
/>
</TableCell>
</TableRow>
</TableBody>
</Table>
border-radius: ${props => (props.hasSquareCorners ? '0' : '0 0 0 8px')}; | ||
} | ||
td:last-child { | ||
border-radius: ${props => (props.hasSquareCorners ? '0' : '0 0 8px 0')}; |
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.
We should use our border radius variable
&:first-child { | ||
border-radius: ${props => (props.hasSquareCorners ? '0' : '8px 0 0 0')}; | ||
} | ||
&:last-child { | ||
border-radius: ${props => (props.hasSquareCorners ? '0' : '0 8px 0 0')}; | ||
} |
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.
We should use our border radius variable
'border-radius', | ||
magma.spaceScale.spacing03 | ||
`${magma.spaceScale.spacing03} 0 0 0`, |
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.
We should use magma.borderRadius
instead of the spaceScale
Issue: # 1556
What I did
Table
container.Screenshots:
Checklist
How to test