chore(deps): update vaul-vue

This commit is contained in:
Benjamin Canac
2025-03-20 17:40:31 +01:00
parent 70f469b868
commit f401766e26
13 changed files with 184 additions and 250 deletions

View File

@@ -11,7 +11,7 @@ const appConfigDrawer = _appConfig as AppConfig & { ui: { drawer: Partial<typeof
const drawer = tv({ extend: tv(theme), ...(appConfigDrawer.ui?.drawer || {}) })
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'direction' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'shouldScaleBackground' | 'setBackgroundColorOnScale' | 'scrollLockTimeout' | 'fixed' | 'dismissible' | 'modal' | 'open' | 'defaultOpen' | 'nested' | 'direction' | 'noBodyStyles' | 'handleOnly' | 'preventScrollRestoration' | 'snapPoints'> {
/**
* The element or component this component should render as.
* @defaultValue 'div'
@@ -42,10 +42,9 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
*/
portal?: boolean
/**
* When `false`, the drawer will not close when clicking outside or pressing escape.
* @defaultValue true
* Index of a `snapPoint` from which the overlay fade should be applied. Defaults to the last snap point.
*/
dismissible?: boolean
fadeFromIndex?: any
class?: any
ui?: Partial<typeof drawer.slots>
}
@@ -54,7 +53,6 @@ export interface DrawerEmits extends DrawerRootEmits {}
export interface DrawerSlots {
default(props?: {}): any
handle(props?: {}): any
content(props?: {}): any
header(props?: {}): any
title(props?: {}): any
@@ -67,19 +65,21 @@ export interface DrawerSlots {
<script setup lang="ts">
import { computed, toRef } from 'vue'
import { useForwardPropsEmits } from 'reka-ui'
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription } from 'vaul-vue'
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription, DrawerHandle } from 'vaul-vue'
import { reactivePick } from '@vueuse/core'
const props = withDefaults(defineProps<DrawerProps>(), {
direction: 'bottom',
portal: true,
overlay: true,
handle: true
handle: true,
modal: true,
dismissible: true
})
const emits = defineEmits<DrawerEmits>()
const slots = defineSlots<DrawerSlots>()
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'defaultOpen', 'dismissible', 'fadeFromIndex', 'fixed', 'modal', 'nested', 'direction', 'open', 'scrollLockTimeout', 'shouldScaleBackground', 'snapPoints'), emits)
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'shouldScaleBackground', 'setBackgroundColorOnScale', 'scrollLockTimeout', 'fixed', 'dismissible', 'modal', 'open', 'defaultOpen', 'nested', 'direction', 'noBodyStyles', 'handleOnly', 'preventScrollRestoration', 'snapPoints', 'fadeFromIndex'), emits)
const contentProps = toRef(() => props.content)
const contentEvents = {
closeAutoFocus: (e: Event) => e.preventDefault()
@@ -101,9 +101,7 @@ const ui = computed(() => drawer({
<DrawerOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
<DrawerContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
<slot name="handle">
<div v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
</slot>
<DrawerHandle v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
<slot name="content">
<div :class="ui.container({ class: props.ui?.container })">