MCPcopy Create free account
hub / github.com/Innei/Pastel / FormExamples

Function FormExamples

docs/src/components/Examples/FormExamples.tsx:19–535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17import { Textarea } from '../ui/Textarea'
18
19export function FormExamples() {
20 const [selectedPlan, setSelectedPlan] = useState<string>('')
21
22 const [isDragOver, setIsDragOver] = useState(false)
23
24 const plans = [
25 { id: 'free', name: 'Free', price: '$0/month', popular: false },
26 { id: 'pro', name: 'Pro', price: '$10/month', popular: true },
27 { id: 'team', name: 'Team', price: '$25/month', popular: false },
28 { id: 'enterprise', name: 'Enterprise', price: 'Custom', popular: false },
29 ]
30
31 const handleDragOver = (e: React.DragEvent) => {
32 e.preventDefault()
33 setIsDragOver(true)
34 }
35
36 const handleDragLeave = (e: React.DragEvent) => {
37 e.preventDefault()
38 setIsDragOver(false)
39 }
40
41 const handleDrop = (e: React.DragEvent) => {
42 e.preventDefault()
43 setIsDragOver(false)
44 // Handle file drop logic here
45 }
46
47 return (
48 <div className="card p-8 space-y-12">
49 {/* Header Section - Improved hierarchy */}
50 <div className="text-center space-y-3">
51 <h4 className="heading-3 text-foreground">Form Elements</h4>
52 <p className="text-text-secondary text-base leading-relaxed max-w-2xl mx-auto">
53 Clean, accessible forms designed for great user experiences
54 </p>
55 <div className="w-16 h-0.5 bg-gradient-to-r from-accent/50 to-accent mx-auto rounded-full" />
56 </div>
57
58 <div className="space-y-12">
59 {/* Basic Form Elements - Enhanced layout and spacing */}
60 <m.div
61 animate={{ opacity: 1, y: 0 }}
62 className="space-y-6"
63 initial={{ opacity: 0, y: 20 }}
64 transition={softSpringPreset}
65 >
66 <div className="flex items-center gap-3">
67 <h5 className="heading-4 text-foreground">Basic Elements</h5>
68 <div className="flex-1 h-px bg-border" />
69 </div>
70
71 <div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
72 {/* Left Column */}
73 <div className="space-y-6">
74 <div className="space-y-2">
75 <Label className="flex items-center gap-2 ml-3" htmlFor="name">
76 Your Name

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected