Files
fn_registry/frontend/functions/ui/radio_group.tsx
T
egutierrez 2d108c295a refactor: migrate frontend from shadcn/Tailwind to Mantine v9
Reescribe todos los componentes UI para usar Mantine v9 en lugar de shadcn/Tailwind.
Elimina cn(), CVA, components.json, theme_provider custom y globals.css con Tailwind.
Añade 25+ componentes nuevos (AppShell, AuthForm, DatePickerInput, Dropzone, etc.)
y MantineProvider como wrapper estándar del sistema de temas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 23:46:44 +02:00

57 lines
1.3 KiB
TypeScript

import * as React from "react"
import { Radio } from "@mantine/core"
interface RadioGroupProps {
value?: string
defaultValue?: string
onValueChange?: (value: string) => void
disabled?: boolean
orientation?: "horizontal" | "vertical"
className?: string
children?: React.ReactNode
}
function RadioGroup({ className, value, defaultValue, onValueChange, orientation, children, ...props }: RadioGroupProps) {
return (
<Radio.Group
data-slot="radio-group"
value={value}
defaultValue={defaultValue}
onChange={(val) => onValueChange?.(val)}
className={className}
{...props}
>
<div style={{ display: 'flex', flexDirection: orientation === 'horizontal' ? 'row' : 'column', gap: 'var(--mantine-spacing-sm)' }}>
{children}
</div>
</Radio.Group>
)
}
interface RadioGroupItemProps {
value: string
label?: string
disabled?: boolean
className?: string
labelClassName?: string
id?: string
}
function RadioGroupItem({ className, label, id, disabled, value, ...props }: RadioGroupItemProps) {
return (
<Radio
id={id}
data-slot="radio-group-item"
value={value}
label={label}
disabled={disabled}
className={className}
size="sm"
{...props}
/>
)
}
export { RadioGroup, RadioGroupItem }
export type { RadioGroupItemProps }