@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
34 lines (31 loc) • 1.27 kB
JavaScript
import { defineComponent, createBlock, createCommentVNode, unref, openBlock, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { colorPickerAnatomy } from './color-picker.anatomy.js';
import { useColorPickerContext } from './use-color-picker-context.js';
import { ColorPickerFormatPropsProvider } from './use-color-picker-format-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "color-picker-view",
props: {
format: {},
asChild: { type: Boolean }
},
setup(__props) {
const props = __props;
const colorPicker = useColorPickerContext();
ColorPickerFormatPropsProvider(props);
useForwardExpose();
return (_ctx, _cache) => {
return unref(colorPicker).format === _ctx.format ? (openBlock(), createBlock(unref(ark).div, mergeProps({ key: 0 }, unref(colorPickerAnatomy).build().view.attrs, {
"data-format": _ctx.format,
"as-child": _ctx.asChild
}), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["data-format", "as-child"])) : createCommentVNode("", true);
};
}
});
export { _sfc_main as default };