UNPKG

@ark-ui/vue

Version:

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

34 lines (31 loc) 1.24 kB
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from 'vue'; import { ark } from '../factory.js'; import { carouselAnatomy } from './carousel.anatomy.js'; import { useCarouselContext } from './use-carousel-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "carousel-autoplay-indicator", props: { fallback: {}, asChild: { type: Boolean } }, setup(__props) { const parts = carouselAnatomy.build(); const carousel = useCarouselContext(); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).span, mergeProps(unref(parts).autoplayIndicator.attrs, { "as-child": __props.asChild }), { default: withCtx(() => [ unref(carousel).isPlaying ? renderSlot(_ctx.$slots, "default", { key: 0 }) : renderSlot(_ctx.$slots, "fallback", { key: 1, fallback: __props.fallback }, () => [ createTextVNode(toDisplayString(__props.fallback), 1) ]) ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };