UNPKG

@ark-ui/vue

Version:

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

30 lines (27 loc) 1.06 kB
import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { CheckboxGroupContextProvider } from './use-checkbox-group-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { checkboxAnatomy } from './checkbox.anatomy.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "checkbox-group-provider", props: { value: {}, asChild: { type: Boolean } }, setup(__props) { const props = __props; const checkboxGroup = computed(() => props.value); CheckboxGroupContextProvider(checkboxGroup); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps({ role: "group" }, unref(checkboxAnatomy).build().group.attrs, { "as-child": __props.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };