/**
* WordPress's Card, CardHeader and CardBody. Each part wraps its content in a
* plain element that carries the layout, because WordPress styles the parts
* with CSS-in-JS injected after the app's stylesheet, which would outrank
* utility classes set on them directly. components.css (.wtofe-card) sets
* the frame itself.
*/
import type { ComponentPropsWithoutRef } from 'react';
import { Card as WPCard, CardBody as WPCardBody, CardHeader as WPCardHeader } from '@wordpress/components';
import { cn } from '@/lib/utils';
function Card( { className, ...props }: ComponentPropsWithoutRef<'div'> ) {
return ;
}
function CardHeader( { className, children, ...props }: ComponentPropsWithoutRef<'div'> ) {
return (
{ /* Title and description stack; a CardAction gets a column on the right. */ }
{ children }
);
}
function CardTitle( { className, ...props }: ComponentPropsWithoutRef<'h2'> ) {
return
;
}
function CardDescription( { className, ...props }: ComponentPropsWithoutRef<'p'> ) {
return ;
}
/** Buttons on the right of the header. */
function CardAction( { className, ...props }: ComponentPropsWithoutRef<'div'> ) {
return ;
}
function CardContent( { className, children, ...props }: ComponentPropsWithoutRef<'div'> ) {
return (
{ children }
);
}
export { Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent };