Skip to content
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 paddings for last column #4677

Merged
merged 4 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/lazy-radios-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@toptal/picasso-table': patch
---

---

- make padding of the last Table Cell smaller and equal to the left padding of the first cell/column.
6 changes: 3 additions & 3 deletions packages/base/Table/src/Table/__snapshots__/test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Table renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<th
class="h-10 py-2 border-none last:pr-6 px-4 text-left"
class="h-10 py-2 border-none px-4 text-left"
>
<div
class="m-0 text-xxs text-graphite font-semibold text-align"
Expand All @@ -30,7 +30,7 @@ exports[`Table renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand All @@ -47,7 +47,7 @@ exports[`Table renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-black font-semibold text-align"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TableCell renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand Down
4 changes: 2 additions & 2 deletions packages/base/Table/src/TableCell/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ export const TableCell = forwardRef<HTMLTableCellElement, Props>(
const spacingClasses = {
narrow: '',
regular: 'px-4',
compact: 'h-6 py-[1px] last:pr-3',
compact: 'h-6 py-[1px]',
}

return (
<Component
{...rest}
ref={ref}
className={twMerge(
'h-10 px-2 py-2 border-none last:pr-6',
'h-10 px-2 py-2 border-none',
spacingClasses[spacing],
isHead && 'text-left',
className
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TableCell renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand Down Expand Up @@ -41,7 +41,7 @@ exports[`TableCell renders compact 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`TableCell renders narrow 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`TableFooter renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-black font-semibold text-align"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`TableHead renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<th
class="h-10 py-2 border-none last:pr-6 px-4 text-left"
class="h-10 py-2 border-none px-4 text-left"
>
<div
class="m-0 text-xxs text-graphite font-semibold text-align"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TableRow renders 1`] = `
class="border-0 border-solid border-b border-gray"
>
<td
class="h-10 py-2 border-none last:pr-6 px-4"
class="h-10 py-2 border-none px-4"
>
<div
class="m-0 text-sm text-graphite font-inherit text-align"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`TableSectionHead renders 1`] = `
class="border-0 min-h border-y border-solid border-gray"
>
<th
class="h-10 py-2 border-none last:pr-6 px-4 text-left"
class="h-10 py-2 border-none px-4 text-left"
colspan="100"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`TableCell sort direction is asc renders with a sort button in the right
<tbody>
<tr>
<td
class="h-10 py-2 border-none last:pr-6 px-4 group hover:bg-gray"
class="h-10 py-2 border-none px-4 group hover:bg-gray"
>
<div
class="flex items-center"
Expand Down Expand Up @@ -59,7 +59,7 @@ exports[`TableCell sort direction is desc renders with a sort button in the righ
<tbody>
<tr>
<td
class="h-10 py-2 border-none last:pr-6 px-4 group hover:bg-gray"
class="h-10 py-2 border-none px-4 group hover:bg-gray"
>
<div
class="flex items-center"
Expand Down