13 lines
606 B
TypeScript
13 lines
606 B
TypeScript
import type { InputHTMLAttributes } from 'react'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const heights: Record<string, string> = {
|
|
sm: 'h-[var(--ui-height-sm)] text-[length:var(--ui-font-sm)] px-[var(--ui-px-sm)]',
|
|
md: 'h-[var(--ui-height-md)] text-[length:var(--ui-font-md)] px-[var(--ui-px-md)]',
|
|
lg: 'h-[var(--ui-height-lg)] text-[length:var(--ui-font-lg)] px-[var(--ui-px-lg)]',
|
|
}
|
|
|
|
export function Input({ className, size = 'md', ...props }: InputHTMLAttributes<HTMLInputElement> & { size?: 'sm' | 'md' | 'lg' }) {
|
|
return <input {...props} className={cn('ui-control', heights[size], className)} />
|
|
}
|