mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-05-01 00:54:55 +00:00
Migration complete for: - 5 atoms: Accordion, CopyButton, FileUpload, FilterInput, Image, Input, PasswordInput, Popover (8 total) - 1 molecule: BindingEditor Changes: - Deleted 9 legacy TSX files that have complete JSON equivalents - Exported BindingEditor from json-components.ts with useBindingEditor hook - Registered useBindingEditor in hooks-registry.ts - Updated all imports across codebase to use JSON-based components - Fixed build errors: schema-loader dynamic import, DataSourceGroupSection - Cleaned up component index exports Build status: ✅ PASSING - 0 TypeScript errors - All 9,408 modules transformed successfully - No blocking build warnings Next steps: - 3 organisms still need conversion: DataSourceManager, NavigationMenu, TreeListPanel - 120+ additional components have TSX versions (need individual migration) - 22 JSON components now available for use throughout the app Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
95 lines
2.5 KiB
TypeScript
95 lines
2.5 KiB
TypeScript
import {
|
|
DatePicker,
|
|
Heading,
|
|
RangeSlider,
|
|
Rating,
|
|
ResponsiveGrid,
|
|
Section,
|
|
Separator,
|
|
Spacer,
|
|
Switch,
|
|
Text,
|
|
} from '@/components/atoms'
|
|
import { FilterInput } from '@/lib/json-ui/json-components'
|
|
|
|
type FormControlsSectionContent =
|
|
(typeof import('@/data/atomic-library-showcase.json'))['sections']['formControls']
|
|
|
|
interface FormControlsSectionProps {
|
|
content: FormControlsSectionContent
|
|
switchChecked: boolean
|
|
onSwitchChange: (value: boolean) => void
|
|
selectedDate: Date | undefined
|
|
onDateChange: (value: Date | undefined) => void
|
|
filterValue: string
|
|
onFilterChange: (value: string) => void
|
|
rating: number
|
|
onRatingChange: (value: number) => void
|
|
rangeValue: [number, number]
|
|
onRangeChange: (value: [number, number]) => void
|
|
}
|
|
|
|
export function FormControlsSection({
|
|
content,
|
|
switchChecked,
|
|
onSwitchChange,
|
|
selectedDate,
|
|
onDateChange,
|
|
filterValue,
|
|
onFilterChange,
|
|
rating,
|
|
onRatingChange,
|
|
rangeValue,
|
|
onRangeChange,
|
|
}: FormControlsSectionProps) {
|
|
return (
|
|
<Section spacing="lg">
|
|
<Heading level={2}>{content.title}</Heading>
|
|
<Separator />
|
|
<ResponsiveGrid columns={2} gap="lg">
|
|
<div>
|
|
<Text variant="muted" className="mb-2">
|
|
{content.switchLabel}
|
|
</Text>
|
|
<Switch
|
|
checked={switchChecked}
|
|
onCheckedChange={onSwitchChange}
|
|
label={content.switch.label}
|
|
description={content.switch.description}
|
|
/>
|
|
</div>
|
|
|
|
<div>
|
|
<Text variant="muted" className="mb-2">
|
|
{content.datePickerLabel}
|
|
</Text>
|
|
<DatePicker value={selectedDate} onChange={onDateChange} placeholder={content.datePlaceholder} />
|
|
</div>
|
|
|
|
<div>
|
|
<Text variant="muted" className="mb-2">
|
|
{content.filterInputLabel}
|
|
</Text>
|
|
<FilterInput value={filterValue} onChange={onFilterChange} placeholder={content.filterPlaceholder} />
|
|
</div>
|
|
|
|
<div>
|
|
<Text variant="muted" className="mb-2">
|
|
{content.ratingLabel}
|
|
</Text>
|
|
<Rating value={rating} onChange={onRatingChange} />
|
|
</div>
|
|
</ResponsiveGrid>
|
|
|
|
<Spacer size="md" axis="vertical" />
|
|
|
|
<div>
|
|
<Text variant="muted" className="mb-2">
|
|
{content.rangeSliderLabel}
|
|
</Text>
|
|
<RangeSlider value={rangeValue} onChange={onRangeChange} label={content.rangeSlider.label} showValue />
|
|
</div>
|
|
</Section>
|
|
)
|
|
}
|