UNPKG

@ark-ui/vue

Version:

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

28 lines (25 loc) 981 B
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { useListboxContext } from './use-listbox-context.js'; import { useListboxItemPropsContext } from './use-listbox-item-props-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "listbox-item-text", props: { asChild: { type: Boolean } }, setup(__props) { const listbox = useListboxContext(); const ItemProps = useListboxItemPropsContext(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(listbox).getItemTextProps(unref(ItemProps)), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };