feat: initialize monorepo structure with Bun and Turborepo
- Add package.json for the root with workspace configuration and scripts - Create @gruperly/config package with TypeScript configuration - Establish shared package @gruperly/shared with Zod schemas for validation - Implement group, student, and payment schemas using Zod - Set up TypeScript configuration for shared package - Document stack architecture and technical specifications in stack.md - Configure Turborepo with build, dev, lint, and typecheck tasks
This commit is contained in:
33
apps/web/src/components/ui/badge.tsx
Normal file
33
apps/web/src/components/ui/badge.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { forwardRef, type HTMLAttributes } from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
export type BadgeVariant = 'success' | 'warning' | 'danger' | 'neutral'
|
||||
|
||||
export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
||||
variant?: BadgeVariant
|
||||
}
|
||||
|
||||
const variants: Record<BadgeVariant, string> = {
|
||||
success: 'bg-success-soft text-success',
|
||||
warning: 'bg-warning-soft text-warning',
|
||||
danger: 'bg-danger-soft text-danger',
|
||||
neutral: 'bg-primary-soft text-primary',
|
||||
}
|
||||
|
||||
export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
|
||||
({ className, variant = 'neutral', ...props }, ref) => {
|
||||
return (
|
||||
<span
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',
|
||||
variants[variant],
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
Badge.displayName = 'Badge'
|
||||
Reference in New Issue
Block a user