UNPKG

@ark-ui/vue

Version:

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

33 lines (30 loc) 1.02 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useAvatar } from './use-avatar.js'; import { AvatarProvider } from './use-avatar-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "avatar-root", props: { id: {}, ids: {}, asChild: { type: Boolean } }, emits: ["statusChange"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const avatar = useAvatar(props, emits); AvatarProvider(avatar); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(avatar).getRootProps(), { "as-child": __props.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };