turash/bugulma/frontend/components/ui/Card.tsx
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- Remove nested git repository from bugulma/frontend/.git
- Add all frontend files to main repository tracking
- Convert from separate frontend/backend repos to unified monorepo
- Preserve all frontend code and development history as tracked files
- Eliminate nested repository complexity for simpler development workflow

This creates a proper monorepo structure with frontend and backend
coexisting in the same repository for easier development and deployment.
2025-11-25 06:02:57 +01:00

47 lines
1.4 KiB
TypeScript

import React from 'react';
import { cva, type VariantProps } from 'class-variance-authority';
import { clsx } from 'clsx';
import { componentVariants, themeColors } from '@/lib/theme';
const cardVariants = cva(
`rounded-lg border ${themeColors.background.card} ${themeColors.text.default} shadow-md transition-all`,
{
variants: {
variant: {
default: '',
interactive: componentVariants.card.interactive,
},
},
defaultVariants: {
variant: 'default',
},
}
);
export interface CardProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof cardVariants> {
as?: React.ElementType;
}
const Card = React.forwardRef<HTMLDivElement, CardProps>(
({ className, variant, as: Comp = 'div', ...props }, ref) => {
return <Comp ref={ref} className={clsx(cardVariants({ variant, className }))} {...props} />;
}
);
Card.displayName = 'Card';
export const CardHeader = ({ children, className = '' }: React.HTMLAttributes<HTMLDivElement>) => (
<div className={`flex flex-col space-y-1.5 p-6 ${className}`}>{children}</div>
);
export const CardTitle = ({ children, className = '' }: React.HTMLAttributes<HTMLDivElement>) => (
<h3 className={`text-xl font-semibold ${className}`}>{children}</h3>
);
export const CardContent = ({ children, className = '' }: React.HTMLAttributes<HTMLDivElement>) => (
<div className={`p-6 pt-0 ${className}`}>{children}</div>
);
export { Card, cardVariants };