File tree Expand file tree Collapse file tree 4 files changed +72
-6
lines changed
app/(sink)/demo/components Expand file tree Collapse file tree 4 files changed +72
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 TabsTrigger ,
1212 TabsTriggerList ,
1313} from "@/packages/ui" ;
14+ import { Card } from "@/packages/ui/Cards/Card" ;
1415import React from "react" ;
1516
1617export default function page ( ) {
@@ -67,6 +68,21 @@ export default function page() {
6768 </ Accordion . Item >
6869 </ Accordion >
6970 </ div >
71+
72+ < div >
73+ < Card >
74+ < Card . Header >
75+ < Card . Title > Card Title</ Card . Title >
76+ < Card . Description > Card Description</ Card . Description >
77+ </ Card . Header >
78+ </ Card >
79+ < Accordion type = "single" collapsible >
80+ < Accordion . Item value = "item-1" >
81+ < Accordion . Header > Head...</ Accordion . Header >
82+ < Accordion . Content > Content...</ Accordion . Content >
83+ </ Accordion . Item >
84+ </ Accordion >
85+ </ div >
7086 </ div >
7187 ) ;
7288}
Original file line number Diff line number Diff line change 1+ import { cn } from "@/lib/utils" ;
2+ import { HTMLAttributes } from "react" ;
3+ import { H3 } from "../Typography" ;
4+
5+ interface ICardProps extends HTMLAttributes < HTMLDivElement > {
6+ className ?: string ;
7+ }
8+
9+ const Card = ( { className, ...props } : ICardProps ) => {
10+ return (
11+ < div
12+ className = { cn (
13+ "inline-block border-2 border-black shadow-md cursor-pointer transition-all hover:shadow-xs" ,
14+ className
15+ ) }
16+ { ...props }
17+ />
18+ ) ;
19+ } ;
20+
21+ const CardHeader = ( { className, ...props } : ICardProps ) => {
22+ return (
23+ < div
24+ className = { cn ( "flex flex-col justify-start p-4" , className ) }
25+ { ...props }
26+ />
27+ ) ;
28+ } ;
29+
30+ const CardTitle = ( { className, ...props } : ICardProps ) => {
31+ return < H3 className = { cn ( "mb-2" , className ) } { ...props } /> ;
32+ } ;
33+
34+ const CardDescription = ( { className, ...props } : ICardProps ) => (
35+ < p className = { cn ( "text-muted" , className ) } { ...props } />
36+ ) ;
37+
38+ const CardComponent = Object . assign ( Card , {
39+ Header : CardHeader ,
40+ Title : CardTitle ,
41+ Description : CardDescription ,
42+ } ) ;
43+
44+ export { CardComponent as Card } ;
Original file line number Diff line number Diff line change 1+ export * from "./Card" ;
12export * from "./BasicCard" ;
23export * from "./ProductCard" ;
Original file line number Diff line number Diff line change 1+ import { Card } from "@/packages/ui" ;
2+
13export default function BasicCard ( ) {
24 return (
3- < div className = "inline-block border-2 border-black p-4 shadow-md cursor-pointer transition-all hover:shadow-xs" >
4- < h4 className = "font-head text-2xl font-medium mb-1" >
5- This is card Title
6- </ h4 >
7- < p > This is card description.</ p >
8- </ div >
5+ < Card >
6+ < Card . Header >
7+ < Card . Title > This is Card Title</ Card . Title >
8+ < Card . Description >
9+ I can not find what to write here.. so imagine I wrote some good
10+ stuff.
11+ </ Card . Description >
12+ </ Card . Header >
13+ </ Card >
914 ) ;
1015}
You can’t perform that action at this time.
0 commit comments