@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
41 lines (38 loc) • 1.57 kB
JavaScript
import { defineComponent, computed, createBlock, createCommentVNode, unref, openBlock, mergeProps as mergeProps$1, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { useBottomSheetContext } from './use-bottom-sheet-context.js';
import '@zag-js/core';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
import { usePresenceContext } from '../presence/use-presence-context.js';
import { mergeProps } from '@zag-js/vue';
import { createSplitProps } from '../create-split-props.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "bottom-sheet-content",
props: {
asChild: { type: Boolean },
draggable: { type: Boolean, default: true }
},
setup(__props) {
const props = __props;
const [contentProps, localProps] = createSplitProps()(props, ["draggable"]);
const bottomSheet = useBottomSheetContext();
const presence = usePresenceContext();
const mergedProps = computed(
() => mergeProps(
bottomSheet.value.getContentProps({ draggable: true, ...contentProps }),
presence.value.presenceProps,
localProps
)
);
useForwardExpose();
return (_ctx, _cache) => {
return !unref(presence).unmounted ? (openBlock(), createBlock(unref(ark).div, mergeProps$1({ key: 0 }, mergedProps.value, { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"])) : createCommentVNode("", true);
};
}
});
export { _sfc_main as default };