feat(ui): add size system (sm/md/lg) + compact mode + remove collapsed dot
Build and Deploy / build-and-push (push) Successful in 53s

This commit is contained in:
2026-07-26 20:14:42 +08:00
parent 29319ee2d3
commit a9024ff6f8
11 changed files with 137 additions and 29 deletions
+8 -2
View File
@@ -1,6 +1,12 @@
import type { TextareaHTMLAttributes } from 'react'
import { cn } from '@/lib/utils'
export function Textarea({ className, ...props }: TextareaHTMLAttributes<HTMLTextAreaElement>) {
return <textarea {...props} className={cn('ui-control min-h-24 resize-y px-3 py-2', className)} />
const sizes: Record<string, string> = {
sm: 'text-[length:var(--ui-font-sm)] px-[var(--ui-px-sm)] py-1.5 min-h-16',
md: 'text-[length:var(--ui-font-md)] px-[var(--ui-px-md)] py-2 min-h-24',
lg: 'text-[length:var(--ui-font-lg)] px-[var(--ui-px-lg)] py-2.5 min-h-32',
}
export function Textarea({ className, size = 'md', ...props }: TextareaHTMLAttributes<HTMLTextAreaElement> & { size?: 'sm' | 'md' | 'lg' }) {
return <textarea {...props} className={cn('ui-control resize-y', sizes[size], className)} />
}