UNPKG

@ark-ui/vue

Version:

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

45 lines (42 loc) 1.4 kB
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useToggleGroup } from './use-toggle-group.js'; import { ToggleGroupProvider } from './use-toggle-group-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "toggle-group-root", props: /* @__PURE__ */ mergeDefaults({ defaultValue: {}, deselectable: { type: Boolean }, disabled: { type: Boolean }, id: {}, ids: {}, loopFocus: { type: Boolean }, modelValue: {}, multiple: { type: Boolean }, orientation: {}, rovingFocus: { type: Boolean }, asChild: { type: Boolean } }, { disabled: void 0, deselectable: void 0, loopFocus: void 0, multiple: void 0, rovingFocus: void 0 }), emits: ["valueChange", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const toggleGroup = useToggleGroup(props, emits); ToggleGroupProvider(toggleGroup); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(toggleGroup).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };