-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): Add Card Cell and hideColumns property (#368)
- Loading branch information
1 parent
7598bd7
commit c81b0bc
Showing
9 changed files
with
157 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/lib/components/table/components/TableCell/CTACell/CTACell.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.narrow { | ||
height: 40px; | ||
padding: 8px!important; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/lib/components/table/components/TableCell/CardCell/CardCell.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { DentalPlusIcon, PlaneIcon } from '../../../../icon'; | ||
import { CardCell } from './CardCell'; | ||
|
||
const story = { | ||
title: 'JSX/Table/Cells', | ||
component: CardCell, | ||
argTypes: {}, | ||
args: { | ||
title: 'Dental add-on', | ||
description: 'Get your dental cleanings and additional treatments covered for just 10.90€ a month.', | ||
icon: <DentalPlusIcon size={24} noMargin />, | ||
href: 'https://example.com', | ||
}, | ||
}; | ||
|
||
export const CardCellStory = ({ | ||
title, | ||
description, | ||
icon, | ||
href, | ||
}: React.ComponentProps<typeof CardCell>) => ( | ||
<div className="p48 d-flex fd-column gap16 bg-white"> | ||
<CardCell | ||
title={title} | ||
description={description} | ||
icon={icon} | ||
href={href} | ||
/> | ||
</div> | ||
); | ||
|
||
CardCellStory.storyName = 'CardCell'; | ||
|
||
export default story; |
33 changes: 33 additions & 0 deletions
33
src/lib/components/table/components/TableCell/CardCell/CardCell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ReactNode } from 'react'; | ||
import { Card } from '../../../../cards/card'; | ||
|
||
export type CardCellProps = { | ||
title: ReactNode; | ||
description?: ReactNode; | ||
icon?: ReactNode; | ||
onClick?: () => void; | ||
href: string; | ||
cellId?: string; | ||
}; | ||
export const CardCell = ({ | ||
title, | ||
description, | ||
icon, | ||
onClick, | ||
href, | ||
}: CardCellProps) => { | ||
return ( | ||
<div className="ta-left"> | ||
<Card | ||
title={title} | ||
description={description} | ||
density='balanced' | ||
icon={icon} | ||
onClick={onClick} | ||
{...(href && { href, as: 'a' })} | ||
actionIcon={null} | ||
showActionIcon={false} | ||
/> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters