UNPKG

@ark-ui/vue

Version:

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

28 lines (25 loc) 1.08 kB
import { defineComponent, createBlock, createCommentVNode, unref, openBlock, mergeProps, withCtx, renderSlot } from 'vue'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { usePresenceContext } from '../presence/use-presence-context.js'; import { useFloatingPanelContext } from './use-floating-panel-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "floating-panel-positioner", props: { asChild: { type: Boolean } }, setup(__props) { const floatingPanel = useFloatingPanelContext(); const presence = usePresenceContext(); useForwardExpose(); return (_ctx, _cache) => { return !unref(presence).unmounted ? (openBlock(), createBlock(unref(ark).div, mergeProps({ key: 0 }, unref(floatingPanel).getPositionerProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"])) : createCommentVNode("", true); }; } }); export { _sfc_main as default };