@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
36 lines (33 loc) • 1.14 kB
JavaScript
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useClipboard } from './use-clipboard.js';
import { ClipboardProvider } from './use-clipboard-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "clipboard-root",
props: {
defaultValue: {},
id: {},
ids: {},
modelValue: {},
timeout: {},
asChild: { type: Boolean }
},
emits: ["statusChange", "valueChange", "update:modelValue"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const clipboard = useClipboard(props, emits);
ClipboardProvider(clipboard);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(unref(clipboard).getRootProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };