UNPKG

@ark-ui/vue

Version:

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

50 lines (47 loc) 1.69 kB
import { defineComponent, mergeDefaults, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { RenderStrategyPropsProvider } from '../../utils/use-render-strategy.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { ark } from '../factory.js'; import { useTabs } from './use-tabs.js'; import { TabsProvider } from './use-tabs-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "tabs-root", props: /* @__PURE__ */ mergeDefaults({ activationMode: {}, composite: { type: Boolean }, defaultValue: {}, deselectable: { type: Boolean }, id: {}, ids: {}, loopFocus: { type: Boolean }, modelValue: {}, navigate: { type: Function }, orientation: {}, translations: {}, lazyMount: { type: Boolean }, unmountOnExit: { type: Boolean }, asChild: { type: Boolean } }, { composite: void 0, deselectable: void 0, loopFocus: void 0 }), emits: ["focusChange", "valueChange", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const tabs = useTabs(props, emits); TabsProvider(tabs); RenderStrategyPropsProvider(computed(() => ({ lazyMount: props.lazyMount, unmountOnExit: props.unmountOnExit }))); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(tabs).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };