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

package.dist.components.avatar.avatar-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 { AvatarProvider } from './use-avatar-context.js';

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

export { AvatarRootProvider };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy