import { clsx } from 'clsx'; import { Children, ElementType } from 'react'; import { buildTypographyOverrides, getResponsiveBase, mapResponsiveSizeToTypography, type Responsive, } from '../../styles'; import { Box, BoxProps } from '../box'; import { skeletonRecipe, SkeletonVariants } from './skeleton.css'; export type SkeletonProps = Omit< SkeletonVariants, 'withChildren' | 'size' > & BoxProps & { size?: Responsive>; }; export function Skeleton({ children, className, type = 'text', radius = 'small', size, tone, ...props }: SkeletonProps) { const withChildren = Children.count(children) > 0; const baseSize = getResponsiveBase(size) ?? 'md'; const typographySize = mapResponsiveSizeToTypography(size); const typographyOverrides = type === 'text' ? buildTypographyOverrides({ variant: 'body', size: typographySize }) : undefined; return ( {children} ); }