Skip to content

Commit

Permalink
Merge pull request #4 from yun-cheng/feat/ui-card
Browse files Browse the repository at this point in the history
feat(UI): add Card component
  • Loading branch information
yun-cheng authored Apr 28, 2024
2 parents d77ce8d + c19aab8 commit daffb9b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/components/ui/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as React from 'react'
import cn from 'utils/cn'

const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
'rounded-lg bg-white text-xs text-grayish-blue shadow-card',
className
)}
{...props}
/>
))
Card.displayName = 'Card'

const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
))
CardContent.displayName = 'CardContent'

const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn('flex items-center p-6 pt-0', className)}
{...props}
/>
))
CardFooter.displayName = 'CardFooter'

export { Card, CardContent, CardFooter }
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const config = {
circles: 'url("/img/circles.svg")',
background: 'url("/img/background.svg")'
},
boxShadow: {
card: '0 20px 30px -5px rgba(127, 137, 185, 0.15)'
},
keyframes: {
'accordion-down': {
from: { height: '0' },
Expand Down

0 comments on commit daffb9b

Please sign in to comment.