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.15 kB
import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { useStepsContext } from './use-steps-context.js'; import { StepsItemProvider } from './use-steps-item-context.js'; import { StepsItemPropsProvider } from './use-steps-item-props-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "steps-item", props: { index: {}, asChild: { type: Boolean } }, setup(__props) { const props = __props; const steps = useStepsContext(); const itemState = computed(() => steps.value.getItemState(props)); StepsItemPropsProvider(props); StepsItemProvider(itemState); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(steps).getItemProps(props), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };