mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 11:47:55 +01:00
chore(Slideover): use variants to type side prop
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { tv } from 'tailwind-variants'
|
import { tv, type VariantProps } from 'tailwind-variants'
|
||||||
import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix-vue'
|
import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix-vue'
|
||||||
import type { AppConfig } from '@nuxt/schema'
|
import type { AppConfig } from '@nuxt/schema'
|
||||||
import _appConfig from '#build/app.config'
|
import _appConfig from '#build/app.config'
|
||||||
@@ -10,13 +10,15 @@ const appConfig = _appConfig as AppConfig & { ui: { slideover: Partial<typeof th
|
|||||||
|
|
||||||
const slideover = tv({ extend: tv(theme), ...(appConfig.ui?.slideover || {}) })
|
const slideover = tv({ extend: tv(theme), ...(appConfig.ui?.slideover || {}) })
|
||||||
|
|
||||||
|
type SlideoverVariants = VariantProps<typeof slideover>
|
||||||
|
|
||||||
export interface SlideoverProps extends DialogRootProps {
|
export interface SlideoverProps extends DialogRootProps {
|
||||||
title?: string
|
title?: string
|
||||||
description?: string
|
description?: string
|
||||||
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
content?: Omit<DialogContentProps, 'asChild' | 'forceMount'>
|
||||||
overlay?: boolean
|
overlay?: boolean
|
||||||
transition?: boolean
|
transition?: boolean
|
||||||
side?: 'left' | 'right' | 'top' | 'bottom'
|
side?: SlideoverVariants['side']
|
||||||
preventClose?: boolean
|
preventClose?: boolean
|
||||||
portal?: boolean
|
portal?: boolean
|
||||||
close?: ButtonProps | null
|
close?: ButtonProps | null
|
||||||
|
|||||||
Reference in New Issue
Block a user