All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.components.fieldset.fieldset-root.js Maven / Gradle / Ivy

Go to download

A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.

The newest version!
'use client';
import { jsx } from 'react/jsx-runtime';
import { mergeProps } from '@zag-js/react';
import { forwardRef } from 'react';
import { composeRefs } from '../../utils/compose-refs.js';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { useFieldset } from './use-fieldset.js';
import { FieldsetProvider } from './use-fieldset-context.js';

const FieldsetRoot = forwardRef((props, ref) => {
  const [useFieldsetProps, localProps] = createSplitProps()(props, [
    "id",
    "disabled",
    "invalid"
  ]);
  const fieldset = useFieldset(useFieldsetProps);
  const mergedProps = mergeProps(fieldset.getRootProps(), localProps);
  return /* @__PURE__ */ jsx(FieldsetProvider, { value: fieldset, children: /* @__PURE__ */ jsx(ark.fieldset, { ...mergedProps, ref: composeRefs(ref, fieldset.refs.rootRef) }) });
});
FieldsetRoot.displayName = "FieldsetRoot";

export { FieldsetRoot };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy