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:
42
apps/web/src/components/ui/button.tsx
Normal file
42
apps/web/src/components/ui/button.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { forwardRef, type ButtonHTMLAttributes } from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
export type ButtonVariant = 'primary' | 'ghost' | 'outline'
|
||||
export type ButtonSize = 'sm' | 'md' | 'icon'
|
||||
|
||||
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||
variant?: ButtonVariant
|
||||
size?: ButtonSize
|
||||
}
|
||||
|
||||
const variants: Record<ButtonVariant, string> = {
|
||||
primary: 'bg-accent text-white hover:bg-accent-strong',
|
||||
ghost: 'bg-transparent text-primary hover:bg-primary-soft',
|
||||
outline: 'border border-border bg-white text-primary hover:bg-primary-soft',
|
||||
}
|
||||
|
||||
const sizes: Record<ButtonSize, string> = {
|
||||
sm: 'h-8 px-3 text-sm',
|
||||
md: 'h-10 px-4 text-sm',
|
||||
icon: 'size-9',
|
||||
}
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant = 'ghost', size = 'md', type = 'button', ...props }, ref) => {
|
||||
return (
|
||||
<button
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn(
|
||||
'inline-flex items-center justify-center gap-2 rounded-xl font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
|
||||
variants[variant],
|
||||
sizes[size],
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
Button.displayName = 'Button'
|
||||
Reference in New Issue
Block a user