fix: flexboxes containers

This commit is contained in:
2024-02-02 17:42:45 +04:00
parent d970f5a5b3
commit 627e33c4b7
20 changed files with 816 additions and 1128 deletions

View File

@@ -18,7 +18,7 @@ const Badge = forwardRef<SVGSVGElement, BadgeProps>(
>
{children && (
<text x={'50%'} y={'50%'}>
{children}
{parseInt(children) > 999 ? '999+' : children}
</text>
)}
</svg>

View File

@@ -0,0 +1,20 @@
import React, { forwardRef, HTMLAttributes } from 'react';
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
variant?: 'outlined' | 'filled' | 'elevated';
}
const Card = forwardRef<HTMLDivElement, CardProps>(
({ variant = 'filled', ...props }, ref) => {
const classes =
`m3 m3-card m3-card-${variant} ${props.className ?? ''}`.trimEnd();
return (
<div {...props} className={classes} ref={ref}>
{props.children}
</div>
);
},
);
export default Card;