@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
31 lines (28 loc) • 1.23 kB
JavaScript
import { defineComponent, useAttrs, computed, createBlock, openBlock, unref, mergeProps as mergeProps$1, withCtx, renderSlot } from 'vue';
import { mergeProps } from '@zag-js/vue';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
import { ark } from '../factory.js';
import { useNavigationMenuContext } from './use-navigation-menu-context.js';
import { useNavigationMenuItemPropsContext } from './use-navigation-menu-item-props-context.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "navigation-menu-item-indicator",
props: {
asChild: { type: Boolean }
},
setup(__props) {
const attrs = useAttrs();
const api = useNavigationMenuContext();
const itemProps = useNavigationMenuItemPropsContext();
const mergedProps = computed(() => mergeProps({ ...attrs }, api.value.getItemIndicatorProps(itemProps?.value)));
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps$1(mergedProps.value, { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };