UNPKG

@ark-ui/vue

Version:

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

46 lines (43 loc) 1.54 kB
import { defineComponent, mergeDefaults, createBlock, createCommentVNode, unref, openBlock, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { usePresence } from './use-presence.js'; import { PresenceProvider } from './use-presence-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "presence", props: /* @__PURE__ */ mergeDefaults({ immediate: { type: Boolean }, lazyMount: { type: Boolean }, present: { type: Boolean }, skipAnimationOnMount: { type: Boolean }, unmountOnExit: { type: Boolean }, asChild: { type: Boolean } }, { immediate: void 0, lazyMount: void 0, present: void 0, skipAnimationOnMount: void 0, unmountOnExit: void 0 }), emits: ["exitComplete"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const presence = usePresence(props, emits); PresenceProvider(presence); useForwardExpose(); return (_ctx, _cache) => { return !unref(presence).unmounted ? (openBlock(), createBlock(unref(ark).div, mergeProps({ key: 0 }, unref(presence).presenceProps, { "as-child": _ctx.asChild, "data-scope": "presence", "data-part": "root" }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"])) : createCommentVNode("", true); }; } }); export { _sfc_main as default };