Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
feat: added radius feature to Card
Browse files Browse the repository at this point in the history
fers4t committed Jan 8, 2023
1 parent e70125c commit 959b144
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/card-UNFINISHED/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react'
import { shadowVariants } from '../../utils/types'
import { RadiusVariants, shadowVariants } from '../../utils/types'
import { Title } from '../title/Title'

export const Card = React.forwardRef<HTMLDivElement, CardProps>(
(props, ref) => {
const { children, bordered, shadow, title, className, ...rest } = props
const { children, bordered, shadow, radius, title, className, ...rest } =
props

return (
<div
@@ -14,6 +15,7 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
} ${bordered ? '' : '!outline-none'}`}
style={{
...rest.style,
borderRadius: radius ? `var(--da-vinci-radius-${radius})` : 'none',
boxShadow: shadow ? `var(--da-vinci-shadow-${shadow})` : 'none',
}}
{...rest}
@@ -27,6 +29,7 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(

Card.defaultProps = {
bordered: true,
radius: 'medium',
}

/**
@@ -46,6 +49,7 @@ export interface CardProps {
cover?: React.ReactNode
header?: React.ReactNode
headerLine?: boolean
radius?: RadiusVariants
shadow?: shadowVariants // ✅
style?: React.CSSProperties // ✅
title?: string // ✅

0 comments on commit 959b144

Please sign in to comment.