@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
33 lines (30 loc) • 1.22 kB
JavaScript
import { defineComponent, 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 { ColorPickerProvider } from './use-color-picker-context.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "color-picker-root-provider",
props: {
value: {},
lazyMount: { type: Boolean },
unmountOnExit: { type: Boolean },
asChild: { type: Boolean }
},
setup(__props) {
const props = __props;
const colorPicker = computed(() => props.value);
ColorPickerProvider(colorPicker);
RenderStrategyPropsProvider(computed(() => ({ lazyMount: props.lazyMount, unmountOnExit: props.unmountOnExit })));
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(colorPicker.value.getRootProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };