@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
30 lines (27 loc) • 1.21 kB
JavaScript
import { defineComponent, computed, createBlock, createCommentVNode, unref, openBlock, mergeProps as mergeProps$1, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { usePopoverContext } from './use-popover-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
import { mergeProps } from '@zag-js/vue';
import { usePresenceContext } from '../presence/use-presence-context.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "popover-content",
props: {
asChild: { type: Boolean }
},
setup(__props) {
const popover = usePopoverContext();
const presence = usePresenceContext();
const mergedProps = computed(() => mergeProps(popover.value.getContentProps(), presence.value.presenceProps));
useForwardExpose();
return (_ctx, _cache) => {
return !unref(presence).unmounted ? (openBlock(), createBlock(unref(ark).div, mergeProps$1({ key: 0 }, mergedProps.value, { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"])) : createCommentVNode("", true);
};
}
});
export { _sfc_main as default };