import { Label } from '@components/common/ui/Label.js'; import { Separator } from '@components/common/ui/Separator.js'; import { cn } from '@evershop/evershop/lib/util/cn'; import { cva, type VariantProps } from 'class-variance-authority'; import React, { useMemo } from 'react'; function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) { return (
[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col', className )} {...props} /> ); } function FieldLegend({ className, variant = 'legend', ...props }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) { return ( ); } function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) { return (
[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col', className )} {...props} /> ); } const fieldVariants = cva( 'data-[invalid=true]:text-destructive gap-3 group/field flex w-full', { variants: { orientation: { vertical: 'flex-col [&>*]:w-full [&>.sr-only]:w-auto', horizontal: 'flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px', responsive: 'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px' } }, defaultVariants: { orientation: 'vertical' } } ); function Field({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps) { return (
); } function FieldContent({ className, ...props }: React.ComponentProps<'div'>) { return (
); } function FieldLabel({ className, ...props }: React.ComponentProps) { return (