|
| 1 | +import { clsx } from '@shilong/utils' |
| 2 | +import * as React from 'react' |
| 3 | +import './style.css' |
| 4 | + |
| 5 | +function Card({ className, ...props }: React.ComponentProps<'div'>) { |
| 6 | + return ( |
| 7 | + <div data-slot="sl-card" className={clsx('slCard', className)} {...props} /> |
| 8 | + ) |
| 9 | +} |
| 10 | + |
| 11 | +function CardHeader({ className, ...props }: React.ComponentProps<'div'>) { |
| 12 | + return ( |
| 13 | + <div |
| 14 | + data-slot="sl-card-header" |
| 15 | + className={clsx('slCardHeader', className)} |
| 16 | + {...props} |
| 17 | + /> |
| 18 | + ) |
| 19 | +} |
| 20 | + |
| 21 | +function CardTitle({ className, ...props }: React.ComponentProps<'div'>) { |
| 22 | + return ( |
| 23 | + <div |
| 24 | + data-slot="sl-card-title" |
| 25 | + className={clsx('slCardTitle', className)} |
| 26 | + {...props} |
| 27 | + /> |
| 28 | + ) |
| 29 | +} |
| 30 | + |
| 31 | +function CardDescription({ className, ...props }: React.ComponentProps<'div'>) { |
| 32 | + return ( |
| 33 | + <div |
| 34 | + data-slot="sl-card-description" |
| 35 | + className={clsx('slCardDescription', className)} |
| 36 | + {...props} |
| 37 | + /> |
| 38 | + ) |
| 39 | +} |
| 40 | + |
| 41 | +function CardAction({ className, ...props }: React.ComponentProps<'div'>) { |
| 42 | + return ( |
| 43 | + <div |
| 44 | + data-slot="sl-card-action" |
| 45 | + className={clsx('slCardAction', className)} |
| 46 | + {...props} |
| 47 | + /> |
| 48 | + ) |
| 49 | +} |
| 50 | + |
| 51 | +function CardContent({ className, ...props }: React.ComponentProps<'div'>) { |
| 52 | + return ( |
| 53 | + <div |
| 54 | + data-slot="sl-card-content" |
| 55 | + className={clsx('slCardContent', className)} |
| 56 | + {...props} |
| 57 | + /> |
| 58 | + ) |
| 59 | +} |
| 60 | + |
| 61 | +function CardFooter({ className, ...props }: React.ComponentProps<'div'>) { |
| 62 | + return ( |
| 63 | + <div |
| 64 | + data-slot="sl-card-footer" |
| 65 | + className={clsx('slCardFooter', className)} |
| 66 | + {...props} |
| 67 | + /> |
| 68 | + ) |
| 69 | +} |
| 70 | + |
| 71 | +export { |
| 72 | + Card, |
| 73 | + CardHeader, |
| 74 | + CardFooter, |
| 75 | + CardTitle, |
| 76 | + CardAction, |
| 77 | + CardDescription, |
| 78 | + CardContent, |
| 79 | +} |
0 commit comments