"use client"; import { field, type FieldVariantProps } from "@seed-design/css/recipes/field"; import { fieldLabel, type FieldLabelVariantProps } from "@seed-design/css/recipes/field-label"; import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive"; import { RadioGroup as RadioGroupPrimitive } from "@seed-design/react-radio-group"; import type * as React from "react"; import { forwardRef } from "react"; import clsx from "clsx"; import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext"; import { InternalIcon } from "../private/Icon"; const { withProvider, withContext } = createSlotRecipeContext(field); const { withContext: withLabelContext, withProvider: withLabelProvider, useClassNames: useLabelClassNames, } = createSlotRecipeContext(fieldLabel); //////////////////////////////////////////////////////////////////////////////////// export interface RadioGroupFieldRootProps extends FieldVariantProps, RadioGroupPrimitive.RootProps {} export const RadioGroupFieldRoot = withProvider( RadioGroupPrimitive.Root, "root", ); //////////////////////////////////////////////////////////////////////////////////// export interface RadioGroupFieldHeaderProps extends PrimitiveProps, React.HTMLAttributes {} export const RadioGroupFieldHeader = withContext( Primitive.div, "header", ); export interface RadioGroupFieldLabelProps extends FieldLabelVariantProps, RadioGroupPrimitive.LabelProps {} export const RadioGroupFieldLabel = withLabelProvider( RadioGroupPrimitive.Label, "root", ); export interface RadioGroupFieldIndicatorTextProps extends PrimitiveProps, React.HTMLAttributes {} export const RadioGroupFieldIndicatorText = withLabelContext< HTMLSpanElement, RadioGroupFieldIndicatorTextProps >(Primitive.span, "indicatorText"); export interface RadioGroupFieldRequiredIndicatorProps extends React.SVGProps {} export const RadioGroupFieldRequiredIndicator = forwardRef< SVGSVGElement, RadioGroupFieldRequiredIndicatorProps >(({ className, ...props }, ref) => { const { indicatorIcon } = useLabelClassNames(); return ( } ref={ref} {...props} /> ); }); RadioGroupFieldRequiredIndicator.displayName = "RadioGroupFieldRequiredIndicator"; //////////////////////////////////////////////////////////////////////////////////// export interface RadioGroupFieldFooterProps extends PrimitiveProps, React.HTMLAttributes {} export const RadioGroupFieldFooter = withContext( Primitive.div, "footer", ); export interface RadioGroupFieldDescriptionProps extends RadioGroupPrimitive.DescriptionProps {} export const RadioGroupFieldDescription = withContext< HTMLSpanElement, RadioGroupFieldDescriptionProps >(RadioGroupPrimitive.Description, "description"); export interface RadioGroupFieldErrorMessageProps extends RadioGroupPrimitive.ErrorMessageProps {} export const RadioGroupFieldErrorMessage = withContext< HTMLDivElement, RadioGroupFieldErrorMessageProps >(RadioGroupPrimitive.ErrorMessage, "errorMessage");