Spaces:
Runtime error
Runtime error
Hanzo Dev commited on
Commit ·
01cdbec
1
Parent(s): 85d883c
Replace @hanzo /ui with local UI components for React 19 compatibility
Browse filesFiles changed (3)
- components/ui/button.tsxAdded+35
- components/ui/card.tsxAdded+66
- lib/utils.tsAdded+6
1234567891011121314151617181920212223242526272829303132333435import * as React from 'react'import { cn } from '@/lib/utils'
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { variant?: 'default' | 'outline' | 'ghost' size?: 'default' | 'sm' | 'lg'}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( ({ className, variant = 'default', size = 'default', ...props }, ref) => { return ( <button className={cn( 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', { 'bg-primary text-primary-foreground hover:bg-primary/90': variant === 'default', 'border border-input bg-background hover:bg-accent hover:text-accent-foreground': variant === 'outline', 'hover:bg-accent hover:text-accent-foreground': variant === 'ghost', }, { 'h-10 px-4 py-2': size === 'default', 'h-9 rounded-md px-3': size === 'sm', 'h-11 rounded-md px-8': size === 'lg', }, className )} ref={ref} {...props} /> ) })Button.displayName = 'Button'
export { Button }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import * as React from 'react'import { cn } from '@/lib/utils'
const Card = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn( 'rounded-lg border bg-card text-card-foreground shadow-sm', className )} {...props} />))Card.displayName = 'Card'
const CardHeader = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />))CardHeader.displayName = 'CardHeader'
const CardTitle = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => ( <h3 ref={ref} className={cn( 'text-2xl font-semibold leading-none tracking-tight', className )} {...props} />))CardTitle.displayName = 'CardTitle'
const CardDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => ( <p ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />))CardDescription.displayName = 'CardDescription'
const CardContent = React.forwardRef< HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => ( <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />))CardContent.displayName = 'CardContent'
export { Card, CardContent, CardDescription, CardHeader, CardTitle }123456import { clsx, type ClassValue } from 'clsx'import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs))}components/ui/button.tsxAdded+35
components/ui/card.tsxAdded+66
lib/utils.tsAdded+6