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

package.dist.components.editable.editable-root-provider.js Maven / Gradle / Ivy

'use client';
import { jsx } from 'react/jsx-runtime';
import { mergeProps } from '@zag-js/react';
import { forwardRef } from 'react';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { EditableProvider } from './use-editable-context.js';

const EditableRootProvider = forwardRef(
  (props, ref) => {
    const [{ value: editable }, localProps] = createSplitProps()(props, [
      "value"
    ]);
    const mergedProps = mergeProps(editable.getRootProps(), localProps);
    return /* @__PURE__ */ jsx(EditableProvider, { value: editable, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
  }
);
EditableRootProvider.displayName = "EditableRootProvider";

export { EditableRootProvider };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy