@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
35 lines (32 loc) • 1.12 kB
JavaScript
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useFieldset } from './use-fieldset.js';
import { FieldsetProvider } from './use-fieldset-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "fieldset-root",
props: /* @__PURE__ */ mergeDefaults({
disabled: { type: [Boolean, String] },
id: {},
invalid: { type: Boolean },
asChild: { type: Boolean }
}, {
disabled: void 0,
invalid: void 0
}),
setup(__props) {
const props = __props;
const fieldset = useFieldset(props);
FieldsetProvider(fieldset);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).fieldset, mergeProps(unref(fieldset).getRootProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };