@@ -3,15 +3,16 @@ import * as React from 'react';
33
44import { ClerkLogo } from './clerk-logo' ;
55
6- export const Root = React . forwardRef < HTMLDivElement , React . HTMLAttributes < HTMLDivElement > > ( function Root (
7- { children, className, ...props } ,
8- forwardedRef ,
6+ export const Root = React . forwardRef ( function CardRoot (
7+ { children, className, ...props } : React . HTMLAttributes < HTMLDivElement > ,
8+ forwardedRef : React . ForwardedRef < HTMLDivElement > ,
99) {
1010 return (
1111 < div
1212 ref = { forwardedRef }
1313 { ...props }
1414 className = { cx (
15+ '[--card-body-padding:theme(spacing.10)]' ,
1516 'bg-gray-2 border-gray-a6 shadow-gray-a5 relative w-96 overflow-hidden rounded-xl border bg-clip-padding shadow-xl' ,
1617 className ,
1718 ) }
@@ -30,7 +31,7 @@ export const Content = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTM
3031 ref = { forwardedRef }
3132 { ...props }
3233 className = { cx (
33- 'bg-gray-surface shadow-gray-a3 border-gray-a6 relative -mx -px -mt-px flex flex-col gap-8 rounded-[inherit] border px-10 py-8 shadow-sm' ,
34+ 'bg-gray-surface shadow-gray-a3 border-gray-a6 relative -m -px flex flex-col gap-8 rounded-[inherit] border p-[--card-body-padding] shadow-sm' ,
3435 className ,
3536 ) }
3637 >
@@ -47,7 +48,7 @@ export const Header = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTML
4748 < div
4849 ref = { forwardedRef }
4950 { ...props }
50- className = { cx ( 'flex flex-col gap-1 text-center' , className ) }
51+ className = { cx ( 'z-1 flex flex-col gap-1 text-center' , className ) }
5152 >
5253 { children }
5354 </ div >
@@ -73,7 +74,7 @@ export const Logo = React.forwardRef(function Logo(
7374 />
7475 ) ;
7576 return (
76- < div className = 'mb-4 flex justify-center' >
77+ < div className = 'z-1 mb-4 flex justify-center' >
7778 { href ? (
7879 < a
7980 href = { href }
@@ -125,13 +126,41 @@ export const Body = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDi
125126 < div
126127 ref = { forwardedRef }
127128 { ...props }
128- className = { cx ( 'flex flex-col gap-6 rounded-lg' , className ) }
129+ className = { cx ( 'z-1 flex flex-col gap-6 rounded-lg' , className ) }
129130 >
130131 { children }
131132 </ div >
132133 ) ;
133134} ) ;
134135
136+ export const Banner = React . forwardRef ( function CardBanner (
137+ { children, className, ...props } : React . HTMLAttributes < HTMLParagraphElement > ,
138+ forwardedRef : React . ForwardedRef < HTMLParagraphElement > ,
139+ ) {
140+ return (
141+ < div className = { cx ( 'absolute inset-0 isolate' ) } >
142+ < div
143+ className = { cx (
144+ 'pointer-events-none absolute inset-0 w-full' ,
145+ // manually nudge the radius by `1px` for a snug fit
146+ 'rounded-b-[calc(theme(borderRadius.xl)-0.0625rem)]' ,
147+ '[background-image:repeating-linear-gradient(-45deg,theme(colors.orange.50),_theme(colors.orange.50)_6px,_theme(colors.orange.100/0.75)_6px,_theme(colors.orange.100/0.75)_12px)]' ,
148+ '[mask-image:linear-gradient(to_top,_black,transparent_8rem)]' ,
149+ ) }
150+ />
151+ < div className = 'absolute inset-x-0 bottom-0 z-10 flex h-[--card-body-padding] w-full items-center justify-center' >
152+ < p
153+ ref = { forwardedRef }
154+ className = { cx ( 'text-sm font-medium text-orange-500' , className ) }
155+ { ...props }
156+ >
157+ { children }
158+ </ p >
159+ </ div >
160+ </ div >
161+ ) ;
162+ } ) ;
163+
135164export const Footer = React . forwardRef ( function Footer (
136165 { branded = true , children, className, ...props } : { branded ?: boolean } & React . HTMLAttributes < HTMLDivElement > ,
137166 forwardedRef : React . ForwardedRef < HTMLDivElement > ,
0 commit comments