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.11 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, createElementVNode, renderSlot, normalizeProps, guardReactiveProps } from 'vue'; import { ark } from '../factory.js'; import { useToastContext } from './use-toast-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "toast-root", props: { asChild: { type: Boolean } }, setup(__props) { const toast = useToastContext(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(toast).getRootProps(), { "as-child": __props.asChild }), { default: withCtx(() => [ createElementVNode("div", normalizeProps(guardReactiveProps(unref(toast).getGhostBeforeProps())), null, 16), renderSlot(_ctx.$slots, "default"), createElementVNode("div", normalizeProps(guardReactiveProps(unref(toast).getGhostAfterProps())), null, 16) ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };