UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

52 lines (49 loc) 1.74 kB
import { defineComponent, mergeDefaults, computed, renderSlot } from 'vue'; import { RenderStrategyPropsProvider } from '../../utils/use-render-strategy.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; import { useDialog } from './use-dialog.js'; import { DialogProvider } from './use-dialog-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "dialog-root", props: /* @__PURE__ */ mergeDefaults({ "aria-label": {}, closeOnEscape: { type: Boolean }, closeOnInteractOutside: { type: Boolean }, defaultOpen: { type: Boolean }, finalFocusEl: { type: Function }, id: {}, ids: {}, initialFocusEl: { type: Function }, modal: { type: Boolean }, open: { type: Boolean }, persistentElements: {}, preventScroll: { type: Boolean }, restoreFocus: { type: Boolean }, role: {}, trapFocus: { type: Boolean }, lazyMount: { type: Boolean }, unmountOnExit: { type: Boolean } }, { closeOnEscape: void 0, closeOnInteractOutside: void 0, defaultOpen: void 0, modal: void 0, open: void 0, preventScroll: void 0, restoreFocus: void 0, trapFocus: void 0 }), emits: ["escapeKeyDown", "focusOutside", "interactOutside", "openChange", "pointerDownOutside", "update:open"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const dialog = useDialog(props, emits); DialogProvider(dialog); RenderStrategyPropsProvider(computed(() => ({ lazyMount: props.lazyMount, unmountOnExit: props.unmountOnExit }))); useForwardExpose(); return (_ctx, _cache) => { return renderSlot(_ctx.$slots, "default"); }; } }); export { _sfc_main as default };