diff --git a/docs/app/components/content/examples/slideover/SlideoverProgrammaticExample.vue b/docs/app/components/content/examples/slideover/SlideoverProgrammaticExample.vue
index f68d3385..3a526f1e 100644
--- a/docs/app/components/content/examples/slideover/SlideoverProgrammaticExample.vue
+++ b/docs/app/components/content/examples/slideover/SlideoverProgrammaticExample.vue
@@ -4,20 +4,37 @@ import { LazySlideoverExample } from '#components'
const count = ref(0)
const toast = useToast()
-const slideover = useSlideover()
+const overlay = useOverlay()
-function open() {
- count.value++
+const slideover = overlay.create(LazySlideoverExample, {
+ props: {
+ count: count.value
+ }
+})
- slideover.open(LazySlideoverExample, {
- title: 'Slideover',
- count: count.value,
- onSuccess() {
- toast.add({
- title: 'Success !',
- id: 'modal-success'
- })
- }
+async function open() {
+ const shouldIncrement = await slideover.open()
+
+ if (shouldIncrement) {
+ count.value++
+
+ toast.add({
+ title: `Success: ${shouldIncrement}`,
+ color: 'success',
+ id: 'slideover-success'
+ })
+
+ // Update the count
+ slideover.patch({
+ count: count.value
+ })
+ return
+ }
+
+ toast.add({
+ title: `Dismissed: ${shouldIncrement}`,
+ color: 'error',
+ id: 'slideover-dismiss'
})
}
diff --git a/docs/content/1.getting-started/2.installation/1.nuxt.md b/docs/content/1.getting-started/2.installation/1.nuxt.md
index 061482f2..4382685a 100644
--- a/docs/content/1.getting-started/2.installation/1.nuxt.md
+++ b/docs/content/1.getting-started/2.installation/1.nuxt.md
@@ -102,7 +102,7 @@ It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.
```
::note{to="/components/app"}
-The `App` component provides global configurations and is required for **Toast** and **Tooltip** components to work.
+The `App` component provides global configurations and is required for **Toast**, **Tooltip** components to work as well as **Programmatic Overlays**.
::
::
diff --git a/docs/content/1.getting-started/2.installation/2.vue.md b/docs/content/1.getting-started/2.installation/2.vue.md
index f16b91b2..b2dfa88d 100644
--- a/docs/content/1.getting-started/2.installation/2.vue.md
+++ b/docs/content/1.getting-started/2.installation/2.vue.md
@@ -161,7 +161,7 @@ It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.
```
::note{to="/components/app"}
-The `App` component provides global configurations and is required for **Toast** and **Tooltip** components to work.
+The `App` component provides global configurations and is required for **Toast**, **Tooltip** components to work as well as **Programmatic Overlays**.
::
::
diff --git a/docs/content/2.composables/use-modal.md b/docs/content/2.composables/use-modal.md
deleted file mode 100644
index df5a7acc..00000000
--- a/docs/content/2.composables/use-modal.md
+++ /dev/null
@@ -1,114 +0,0 @@
----
-title: useModal
-description: 'A composable to programmatically control a Modal component.'
----
-
-## Usage
-
-Use the auto-imported `useModal` composable to programmatically control a [Modal](/components/modal) component.
-
-```vue
-
-```
-
-- The `useModal` composable is created using `createSharedComposable`, ensuring that the same modal state is shared across your entire application.
-
-::tip{to="/components/modal"}
-Learn how to customize the appearance and behavior of modals in the **Modal** component documentation.
-::
-
-## API
-
-### `open(component: Component, props?: ModalProps & ComponentProps)`
-
-Opens a modal with the specified component and props.
-
-- Parameters:
- - `component`: The Vue component to render inside the modal.
- - `props`: An optional object of props to pass to both the Modal and the rendered component.
-
-```vue
-
-```
-
-### `close()`
-
-Closes the currently open modal.
-
-```vue
-
-```
-
-### `reset()`
-
-Resets the modal state to its default values.
-
-```vue
-
-```
-
-### `patch(props: Partial>)`
-
-Updates the props of the currently open modal.
-
-```vue
-
-```
-
-## Example
-
-Here's a complete example of how to use the `useModal` composable:
-
-```vue
-
-
-
-
-
-
-
-
-
-```
-
-In this example, we're using the `useModal` composable to control a modal. We can open it with a specific component and props, close it, and update its props.
diff --git a/docs/content/2.composables/use-overlay.md b/docs/content/2.composables/use-overlay.md
new file mode 100644
index 00000000..ab4e3aab
--- /dev/null
+++ b/docs/content/2.composables/use-overlay.md
@@ -0,0 +1,166 @@
+---
+title: useOverlay
+description: "A composable to programmatically control overlays."
+---
+
+## Usage
+
+Use the auto-imported `useOverlay` composable to programmatically control [Modal](/components/modal) and [Slideover](/components/slideover) components.
+
+```vue
+
+```
+
+- The `useOverlay` composable is created using `createSharedComposable`, ensuring that the same overlay state is shared across your entire application.
+
+::note
+In order to return a value from the overlay, the `overlay.open()` can be awaited. In order for this to work, however, the **overlay component must emit a `close` event**. See example below for details.
+::
+
+## API
+
+### `create(component: T, options: OverlayOptions): OverlayInstance`
+
+Creates an overlay, and returns its instance
+
+- Parameters:
+ - `component`: The overlay component
+ - `options` The overlay options
+ - `defaultOpen?: boolean` Opens the overlay immediately after being created `default: false`
+ - `props?: ComponentProps`: An optional object of props to pass to the rendered component.
+ - `destroyOnClose?: boolean` Removes the overlay from memory when closed `default: false`
+
+### `open(id: symbol, props?: ComponentProps): Promise`
+
+Opens the overlay using its `id`
+
+- Parameters:
+ - `id`: The identifier of the overlay
+ - `props`: An optional object of props to pass to the rendered component.
+
+### `close(id: symbol, value?: any): void`
+
+Close an overlay using its `id`
+
+- Parameters:
+ - `id`: The identifier of the overlay
+ - `value`: A value to resolve the overlay promise with
+
+### `patch(id: symbol, props: ComponentProps): void`
+
+Update an overlay using its `id`
+
+- Parameters:
+ - `id`: The identifier of the overlay
+ - `props`: An object of props to update on the rendered component.
+
+### `unmount(id: symbol): void`
+
+Removes the overlay from the DOM using its `id`
+
+- Parameters:
+ - `id`: The identifier of the overlay
+
+### `overlays: Overlay[]`
+
+In-memory list of overlays that were created
+
+## Overlay Instance API
+
+### `open(props?: ComponentProps): Promise`
+
+Opens the overlay
+
+- Parameters:
+ - `props`: An optional object of props to pass to the rendered component.
+
+```vue
+
+```
+
+### `close(value?: any): void`
+
+Close the overlay
+
+- Parameters:
+ - `value`: A value to resolve the overlay promise with
+
+### `patch(props: ComponentProps)`
+
+Updates the props of the overlay.
+
+- Parameters:
+ - `props`: An object of props to update on the rendered component.
+
+```vue
+
+```
+
+## Example
+
+Here's a complete example of how to use the `useOverlay` composable:
+
+```vue
+
+
+
+
+
+
+
+```
+
+In this example, we're using the `useOverlay` composable to control multiple modals and slideovers.
diff --git a/docs/content/2.composables/use-slideover.md b/docs/content/2.composables/use-slideover.md
deleted file mode 100644
index 2b18aaa7..00000000
--- a/docs/content/2.composables/use-slideover.md
+++ /dev/null
@@ -1,114 +0,0 @@
----
-title: useSlideover
-description: 'A composable to programmatically control a Slideover component.'
----
-
-## Usage
-
-Use the auto-imported `useSlideover` composable to programmatically control a [Slideover](/components/slideover) component.
-
-```vue
-
-```
-
-- The `useSlideover` composable is created using `createSharedComposable`, ensuring that the same slideover state is shared across your entire application.
-
-::tip{to="/components/slideover"}
-Learn how to customize the appearance and behavior of slideovers in the **Slideover** component documentation.
-::
-
-## API
-
-### `open(component: Component, props?: SlideoverProps & ComponentProps)`
-
-Opens a slideover with the specified component and props.
-
-- Parameters:
- - `component`: The Vue component to render inside the slideover.
- - `props`: An optional object of props to pass to both the Slideover and the rendered component.
-
-````vue
-
-````
-
-### `close(): Promise`
-
-Closes the currently open slideover.
-
-````vue
-
-````
-
-### `reset()`
-
-Resets the slideover state to its default values.
-
-````vue
-
-````
-
-### `patch(props: Partial>)`
-
-Updates the props of the currently open slideover.
-
-````vue
-
-````
-
-## Example
-
-Here's a complete example of how to use the `useSlideover` composable:
-
-````vue
-
-
-
-
-
-
-
-
-
-````
-
-In this example, we're using the `useSlideover` composable to control a slideover. We can open it with a specific component and props, close it, and update its props.
diff --git a/docs/content/3.components/modal.md b/docs/content/3.components/modal.md
index 37f348d9..65315927 100644
--- a/docs/content/3.components/modal.md
+++ b/docs/content/3.components/modal.md
@@ -305,21 +305,26 @@ slots:
### Programmatic usage
-You can use the [`useModal`](/composables/use-modal) composable to open a Modal programatically.
+You can use the [`useOverlay`](/composables/use-overlay) composable to open a Modal programatically.
::warning
-Make sure to wrap your app with the [`App`](/components/app) component which uses the [`ModalProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/ModalProvider.vue) component.
+Make sure to wrap your app with the [`App`](/components/app) component which uses the [`OverlayProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/OverlayProvider.vue) component.
::
First, create a modal component that will be opened programatically:
::component-example
---
+prettier: true
name: 'modal-example'
preview: false
---
::
+::note
+We are emitting a `close` event when the modal is closed or dismissed here. You can emit any data through the `close` event, however, the event must be emitted in order to capture the return value.
+::
+
Then, use it in your app:
::component-example
diff --git a/docs/content/3.components/slideover.md b/docs/content/3.components/slideover.md
index a1b76910..047f08ed 100644
--- a/docs/content/3.components/slideover.md
+++ b/docs/content/3.components/slideover.md
@@ -304,21 +304,26 @@ slots:
### Programmatic usage
-You can use the [`useSlideover`](/composables/use-slideover) composable to open a Slideover programatically.
+You can use the [`useOverlay`](/composables/use-overlay) composable to open a Slideover programatically.
::warning
-Make sure to wrap your app with the [`App`](/components/app) component which uses the [`SlideoverProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/SlideoverProvider.vue) component.
+Make sure to wrap your app with the [`App`](/components/app) component which uses the [`OverlayProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/OverlayProvider.vue) component.
::
First, create a slideover component that will be opened programatically:
::component-example
---
+prettier: true
name: 'slideover-example'
preview: false
---
::
+::note
+We are emitting a `close` event when the slideover is closed or dismissed here. You can emit any data through the `close` event, however, the event must be emitted in order to capture the return value.
+::
+
Then, use it in your app:
::component-example
diff --git a/playground/app/components/ModalExample.vue b/playground/app/components/ModalExample.vue
index bc2256f9..fd239963 100644
--- a/playground/app/components/ModalExample.vue
+++ b/playground/app/components/ModalExample.vue
@@ -1,15 +1,15 @@
-
+
diff --git a/playground/app/components/SlideoverExample.vue b/playground/app/components/SlideoverExample.vue
index 0c298949..48606458 100644
--- a/playground/app/components/SlideoverExample.vue
+++ b/playground/app/components/SlideoverExample.vue
@@ -1,9 +1,9 @@
@@ -13,7 +13,7 @@ defineProps<{
-
+
diff --git a/playground/app/pages/components/modal.vue b/playground/app/pages/components/modal.vue
index a1195993..0ac4a794 100644
--- a/playground/app/pages/components/modal.vue
+++ b/playground/app/pages/components/modal.vue
@@ -5,16 +5,18 @@ const LazyModalExample = defineAsyncComponent(() => import('../../components/Mod
const open = ref(false)
const count = ref(0)
+const overlay = useOverlay()
-const modal = useModal()
+const modal = overlay.create(LazyModalExample, {
+ props: {
+ count: count.value
+ }
+})
function openModal() {
count.value++
- modal.open(LazyModalExample, {
- description: 'And you can even provide a description!',
- count: count.value
- })
+ modal.open({ count: count.value })
}
diff --git a/playground/app/pages/components/slideover.vue b/playground/app/pages/components/slideover.vue
index 3fc79848..c14e196c 100644
--- a/playground/app/pages/components/slideover.vue
+++ b/playground/app/pages/components/slideover.vue
@@ -5,16 +5,18 @@ const LazySlideoverExample = defineAsyncComponent(() => import('../../components
const open = ref(false)
const count = ref(0)
+const overlay = useOverlay()
-const slideover = useSlideover()
+const slideover = overlay.create(LazySlideoverExample, {
+ props: {
+ count: count.value
+ }
+})
function openSlideover() {
count.value++
- slideover.open(LazySlideoverExample, {
- title: 'Slideover',
- count: count.value
- })
+ slideover.open({ count: count.value })
}
diff --git a/src/module.ts b/src/module.ts
index 9168ec4a..cf84046f 100644
--- a/src/module.ts
+++ b/src/module.ts
@@ -113,8 +113,6 @@ export default defineNuxtModule({
}
addPlugin({ src: resolve('./runtime/plugins/colors') })
- addPlugin({ src: resolve('./runtime/plugins/modal') })
- addPlugin({ src: resolve('./runtime/plugins/slideover') })
addComponentsDir({
path: resolve('./runtime/components'),
diff --git a/src/runtime/components/App.vue b/src/runtime/components/App.vue
index 51e58d2e..d9dc090d 100644
--- a/src/runtime/components/App.vue
+++ b/src/runtime/components/App.vue
@@ -26,8 +26,7 @@ import { toRef, useId, provide } from 'vue'
import { ConfigProvider, TooltipProvider, useForwardProps } from 'reka-ui'
import { reactivePick } from '@vueuse/core'
import UToaster from './Toaster.vue'
-import UModalProvider from './ModalProvider.vue'
-import USlideoverProvider from './SlideoverProvider.vue'
+import UOverlayProvider from './OverlayProvider.vue'
const props = defineProps()
defineSlots()
@@ -48,8 +47,7 @@ provide(localeContextInjectionKey, locale)
-
-
+
diff --git a/src/runtime/components/Modal.vue b/src/runtime/components/Modal.vue
index c6ca5a3f..ada37dd3 100644
--- a/src/runtime/components/Modal.vue
+++ b/src/runtime/components/Modal.vue
@@ -56,7 +56,9 @@ export interface ModalProps extends DialogRootProps {
ui?: Partial
}
-export interface ModalEmits extends DialogRootEmits {}
+export interface ModalEmits extends DialogRootEmits {
+ 'after:leave': []
+}
export interface ModalSlots {
default(props: { open: boolean }): any
@@ -126,7 +128,7 @@ const ui = computed(() => modal({
-
+
diff --git a/src/runtime/components/ModalProvider.vue b/src/runtime/components/ModalProvider.vue
deleted file mode 100644
index 69799d52..00000000
--- a/src/runtime/components/ModalProvider.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
diff --git a/src/runtime/components/OverlayProvider.vue b/src/runtime/components/OverlayProvider.vue
new file mode 100644
index 00000000..868bc2d4
--- /dev/null
+++ b/src/runtime/components/OverlayProvider.vue
@@ -0,0 +1,26 @@
+
+
+
+ onClose(overlay.id, value)"
+ @after:leave="onAfterLeave(overlay.id)"
+ />
+
diff --git a/src/runtime/components/Slideover.vue b/src/runtime/components/Slideover.vue
index b06526aa..f935e1e8 100644
--- a/src/runtime/components/Slideover.vue
+++ b/src/runtime/components/Slideover.vue
@@ -55,7 +55,9 @@ export interface SlideoverProps extends DialogRootProps {
ui?: Partial
}
-export interface SlideoverEmits extends DialogRootEmits {}
+export interface SlideoverEmits extends DialogRootEmits {
+ 'after:leave': []
+}
export interface SlideoverSlots {
default(props: { open: boolean }): any
@@ -126,7 +128,7 @@ const ui = computed(() => slideover({
-
+
diff --git a/src/runtime/components/SlideoverProvider.vue b/src/runtime/components/SlideoverProvider.vue
deleted file mode 100644
index 8b0eafd5..00000000
--- a/src/runtime/components/SlideoverProvider.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
diff --git a/src/runtime/composables/useModal.ts b/src/runtime/composables/useModal.ts
deleted file mode 100644
index d0fd8ac8..00000000
--- a/src/runtime/composables/useModal.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { ref, inject } from 'vue'
-import type { ShallowRef, Component, InjectionKey } from 'vue'
-import type { ComponentProps } from 'vue-component-type-helpers'
-import { createSharedComposable } from '@vueuse/core'
-import type { ModalProps } from '../types'
-
-export interface ModalState {
- component: Component | string
- props: ModalProps
-}
-
-export const modalInjectionKey: InjectionKey> = Symbol('nuxt-ui.modal')
-
-function _useModal() {
- const modalState = inject(modalInjectionKey)
-
- const isOpen = ref(false)
-
- function open(component: T, props?: ModalProps & ComponentProps) {
- if (!modalState) {
- throw new Error('useModal() is called without provider')
- }
-
- modalState.value = {
- component,
- props: props ?? {}
- }
-
- isOpen.value = true
- }
-
- async function close() {
- if (!modalState) return
-
- isOpen.value = false
- }
-
- function reset() {
- if (!modalState) return
-
- modalState.value = {
- component: 'div',
- props: {}
- }
- }
-
- /**
- * Allows updating the modal props
- */
- function patch>(props: Partial>) {
- if (!modalState) return
-
- modalState.value = {
- ...modalState.value,
- props: {
- ...modalState.value.props,
- ...props
- }
- }
- }
-
- return {
- open,
- close,
- reset,
- patch,
- isOpen
- }
-}
-
-export const useModal = createSharedComposable(_useModal)
diff --git a/src/runtime/composables/useOverlay.ts b/src/runtime/composables/useOverlay.ts
new file mode 100644
index 00000000..784e586f
--- /dev/null
+++ b/src/runtime/composables/useOverlay.ts
@@ -0,0 +1,118 @@
+import type { Component } from 'vue'
+import { createSharedComposable } from '@vueuse/core'
+import type { ComponentProps } from 'vue-component-type-helpers'
+
+export type OverlayOptions> = {
+ defaultOpen?: boolean
+ props?: OverlayAttrs
+ destroyOnClose?: boolean
+}
+
+type ManagedOverlayOptionsPrivate = {
+ component?: T
+ id: symbol
+ isMounted: boolean
+ modelValue: boolean
+ resolvePromise?: (value: unknown) => void
+}
+export type Overlay = OverlayOptions & ManagedOverlayOptionsPrivate
+
+interface OverlayInstance {
+ open: (props?: ComponentProps) => Promise
+ close: (value?: any) => void
+ patch: (props: Partial>) => void
+}
+
+function _useOverlay() {
+ const overlays = shallowReactive([])
+
+ const create = (component: T, _options?: OverlayOptions>): OverlayInstance => {
+ const { props: props, defaultOpen, destroyOnClose } = _options || {}
+
+ const options = reactive({
+ id: Symbol(import.meta.dev ? 'useOverlay' : ''),
+ modelValue: !!defaultOpen,
+ component: markRaw(component!),
+ isMounted: !!defaultOpen,
+ destroyOnClose: !!destroyOnClose,
+ props: props || {}
+ })
+
+ overlays.push(options)
+
+ return {
+ open: (props?: ComponentProps) => open(options.id, props),
+ close: value => close(options.id, value),
+ patch: (props: Partial>) => patch(options.id, props)
+ }
+ }
+
+ const open = (id: symbol, props?: ComponentProps): Promise => {
+ const overlay = getOverlay(id)
+
+ // If props are provided, update the overlay's props
+ if (props) {
+ patch(overlay.id, props)
+ }
+
+ overlay.modelValue = true
+ overlay.isMounted = true
+
+ // Return a new promise that will be resolved when close is called
+ return new Promise((resolve) => {
+ overlay.resolvePromise = resolve
+ })
+ }
+
+ const close = (id: symbol, value?: any): void => {
+ const overlay = getOverlay(id)
+
+ overlay.modelValue = false
+
+ // Resolve the promise if it exists
+ if (overlay.resolvePromise) {
+ overlay.resolvePromise(value)
+ overlay.resolvePromise = undefined
+ }
+ }
+
+ const unMount = (id: symbol): void => {
+ const overlay = getOverlay(id)
+
+ overlay.isMounted = false
+
+ if (overlay.destroyOnClose) {
+ const index = overlays.findIndex(overlay => overlay.id === id)
+ overlays.splice(index, 1)
+ }
+ }
+
+ const patch = (id: symbol, props: Partial>): void => {
+ const overlay = getOverlay(id)
+
+ Object.entries(props!).forEach(([key, value]) => {
+ (overlay.props as any)[key] = value
+ })
+ }
+
+ const getOverlay = (id: symbol): Overlay => {
+ const overlay = overlays.find(overlay => overlay.id === id)
+
+ if (!overlay) {
+ throw new Error('Overlay not found')
+ }
+
+ return overlay
+ }
+
+ return {
+ overlays,
+ open,
+ close,
+ create,
+ patch,
+ unMount
+ }
+}
+
+export const useOverlay = createSharedComposable(_useOverlay)
diff --git a/src/runtime/composables/useSlideover.ts b/src/runtime/composables/useSlideover.ts
deleted file mode 100644
index 97122d98..00000000
--- a/src/runtime/composables/useSlideover.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { ref, inject } from 'vue'
-import type { ShallowRef, Component, InjectionKey } from 'vue'
-import type { ComponentProps } from 'vue-component-type-helpers'
-import { createSharedComposable } from '@vueuse/core'
-import type { SlideoverProps } from '../types'
-
-export interface SlideoverState {
- component: Component | string
- props: SlideoverProps
-}
-
-export const slideoverInjectionKey: InjectionKey> = Symbol('nuxt-ui.slideover')
-
-function _useSlideover() {
- const slideoverState = inject(slideoverInjectionKey)
-
- const isOpen = ref(false)
-
- function open(component: T, props?: SlideoverProps & ComponentProps) {
- if (!slideoverState) {
- throw new Error('useSlideover() is called without provider')
- }
-
- slideoverState.value = {
- component,
- props: props ?? {}
- }
-
- isOpen.value = true
- }
-
- async function close() {
- if (!slideoverState) return
-
- isOpen.value = false
- }
-
- function reset() {
- if (!slideoverState) return
-
- slideoverState.value = {
- component: 'div',
- props: {}
- }
- }
-
- /**
- * Allows updating the slideover props
- */
- function patch>(props: Partial>) {
- if (!slideoverState) return
-
- slideoverState.value = {
- ...slideoverState.value,
- props: {
- ...slideoverState.value.props,
- ...props
- }
- }
- }
-
- return {
- open,
- close,
- reset,
- patch,
- isOpen
- }
-}
-
-export const useSlideover = createSharedComposable(_useSlideover)
diff --git a/src/runtime/plugins/modal.ts b/src/runtime/plugins/modal.ts
deleted file mode 100644
index 1cb3fdd2..00000000
--- a/src/runtime/plugins/modal.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { shallowRef } from 'vue'
-import { defineNuxtPlugin } from '#imports'
-// FIXME: https://github.com/nuxt/module-builder/issues/141#issuecomment-2078248248
-import type {} from '#app'
-import { modalInjectionKey, type ModalState } from '../composables/useModal'
-
-export default defineNuxtPlugin((nuxtApp) => {
- const modalState = shallowRef({
- component: 'div',
- props: {}
- })
- nuxtApp.vueApp.provide(modalInjectionKey, modalState)
-})
diff --git a/src/runtime/plugins/slideover.ts b/src/runtime/plugins/slideover.ts
deleted file mode 100644
index 41078f2f..00000000
--- a/src/runtime/plugins/slideover.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { shallowRef } from 'vue'
-import { defineNuxtPlugin } from '#imports'
-// FIXME: https://github.com/nuxt/module-builder/issues/141#issuecomment-2078248248
-import type {} from '#app'
-import { slideoverInjectionKey, type SlideoverState } from '../composables/useSlideover'
-
-export default defineNuxtPlugin((nuxtApp) => {
- const slideoverState = shallowRef({
- component: 'div',
- props: {}
- })
-
- nuxtApp.vueApp.provide(slideoverInjectionKey, slideoverState)
-})