@ark-ui/react
Version:
A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.
28 lines (23 loc) • 1.18 kB
JavaScript
'use client';
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const jsxRuntime = require('react/jsx-runtime');
const react$1 = require('@zag-js/react');
const react = require('react');
const composeRefs = require('../../utils/compose-refs.cjs');
const renderStrategy = require('../../utils/render-strategy.cjs');
const factory = require('../factory.cjs');
const usePresence = require('../presence/use-presence.cjs');
const useDrawerContext = require('./use-drawer-context.cjs');
const DrawerBackdrop = react.forwardRef((props, ref) => {
const drawer = useDrawerContext.useDrawerContext();
const renderStrategyProps = renderStrategy.useRenderStrategyPropsContext();
const presence = usePresence.usePresence({ ...renderStrategyProps, present: drawer.open });
const mergedProps = react$1.mergeProps(drawer.getBackdropProps(), presence.getPresenceProps(), props);
if (presence.unmounted) {
return null;
}
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref: composeRefs.composeRefs(presence.ref, ref) });
});
DrawerBackdrop.displayName = "DrawerBackdrop";
exports.DrawerBackdrop = DrawerBackdrop;