docs(modal): update

This commit is contained in:
Benjamin Canac
2024-08-23 13:26:20 +02:00
parent 4b641f7c23
commit 60f2b0d8fb
15 changed files with 540 additions and 26 deletions

View File

@@ -20,6 +20,10 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
description?: string
/** The content of the drawer. */
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
/**
* Render an overlay behind the drawer.
* @defaultValue true
*/
overlay?: boolean
/**
* Render the drawer in a portal.

View File

@@ -15,8 +15,20 @@ export interface ModalProps extends DialogRootProps {
description?: string
/** The content of the modal. */
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
/**
* Render an overlay behind the modal.
* @defaultValue true
*/
overlay?: boolean
/**
* Animate the modal when opening or closing.
* @defaultValue true
*/
transition?: boolean
/**
* When `true`, the modal will take up the full screen.
* @defaultValue false
*/
fullscreen?: boolean
/**
* Render the modal in a portal.
@@ -34,7 +46,10 @@ export interface ModalProps extends DialogRootProps {
* @defaultValue appConfig.ui.icons.close
*/
closeIcon?: string
/** When `true`, the modal will not close when clicking outside. */
/**
* When `true`, the modal will not close when clicking outside.
* @defaultValue false
*/
preventClose?: boolean
class?: any
ui?: Partial<typeof modal.slots>
@@ -65,7 +80,8 @@ const props = withDefaults(defineProps<ModalProps>(), {
close: true,
portal: true,
overlay: true,
transition: true
transition: true,
modal: true
})
const emits = defineEmits<ModalEmits>()
const slots = defineSlots<ModalSlots>()

View File

@@ -18,12 +18,12 @@ export interface SlideoverProps extends DialogRootProps {
/** The content of the slideover. */
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
/**
* Display an overlay behind the slideover.
* Render an overlay behind the slideover.
* @defaultValue true
*/
overlay?: boolean
/**
* Open & close the slideover with a transition.
* Animate the slideover when opening or closing.
* @defaultValue true
*/
transition?: boolean
@@ -44,7 +44,10 @@ export interface SlideoverProps extends DialogRootProps {
* @defaultValue appConfig.ui.icons.close
*/
closeIcon?: string
/** When `true`, the slideover will not close when clicking outside. */
/**
* When `true`, the slideover will not close when clicking outside.
* @defaultValue false
*/
preventClose?: boolean
class?: any
ui?: Partial<typeof slideover.slots>
@@ -76,6 +79,7 @@ const props = withDefaults(defineProps<SlideoverProps>(), {
portal: true,
overlay: true,
transition: true,
modal: true,
side: 'right'
})
const emits = defineEmits<SlideoverEmits>()