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

package.dist.components.dialog.dialog-root.cjs Maven / Gradle / Ivy

'use client';
'use strict';

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const jsxRuntime = require('react/jsx-runtime');
const react = require('@zag-js/react');
const renderStrategy = require('../../utils/render-strategy.cjs');
const splitPresenceProps = require('../presence/split-presence-props.cjs');
const usePresence = require('../presence/use-presence.cjs');
const usePresenceContext = require('../presence/use-presence-context.cjs');
const useDialog = require('./use-dialog.cjs');
const useDialogContext = require('./use-dialog-context.cjs');

const DialogRoot = (props) => {
  const [presenceProps, { children, ...localProps }] = splitPresenceProps.splitPresenceProps(props);
  const [renderStrategyProps] = renderStrategy.splitRenderStrategyProps(presenceProps);
  const dialog = useDialog.useDialog(localProps);
  const presence = usePresence.usePresence(react.mergeProps({ present: dialog.open }, presenceProps));
  return /* @__PURE__ */ jsxRuntime.jsx(useDialogContext.DialogProvider, { value: dialog, children: /* @__PURE__ */ jsxRuntime.jsx(renderStrategy.RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsxRuntime.jsx(usePresenceContext.PresenceProvider, { value: presence, children }) }) });
};

exports.DialogRoot = DialogRoot;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy