import { forwardRef, type FieldsetHTMLAttributes, type ForwardedRef, type HTMLAttributes, } from 'react' import { getFieldsetProps, getLegendProps, splitClassNameProp, } from '@pluralsight/headless-styles' import type { FieldsetOptions, LegendOptions, } from '@pluralsight/headless-styles/types' import { useFormControl } from '../context/FormControl.tsx' //
interface FieldsetProps extends FieldsetOptions, FieldsetHTMLAttributes {} function FieldsetEl( props: FieldsetProps, forwardedRef: ForwardedRef ) { const { disabled } = useFormControl() const pandoProps = getFieldsetProps({ classNames: splitClassNameProp(props.className), }) return (
) } // interface LegendProps extends LegendOptions, HTMLAttributes {} function LegendEl( props: LegendProps, forwardedRef: ForwardedRef ) { const pandoProps = getLegendProps({ classNames: splitClassNameProp(props.className), }) return } // exports export const Fieldset = forwardRef( FieldsetEl ) export const Legend = forwardRef(LegendEl)