feat(components): handle events in content prop

This commit is contained in:
Benjamin Canac
2025-03-20 12:39:57 +01:00
parent f4c417d9ef
commit 5dec0e16e2
11 changed files with 48 additions and 39 deletions

View File

@@ -1,10 +1,11 @@
<script lang="ts">
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipArrowProps } from 'reka-ui'
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
import theme from '#build/ui/tooltip'
import { tv } from '../utils/tv'
import type { KbdProps } from '../types'
import type { EmitsToProps } from '../types/utils'
const appConfigTooltip = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
@@ -19,7 +20,7 @@ export interface TooltipProps extends TooltipRootProps {
* The content of the tooltip.
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
*/
content?: Omit<TooltipContentProps, 'as' | 'asChild'>
content?: Omit<TooltipContentProps, 'as' | 'asChild'> & Partial<EmitsToProps<TooltipContentEmits>>
/**
* Display an arrow alongside the tooltip.
* @defaultValue false