Skip to content

Commit 88cbca7

Browse files
committed
feat: add title tooltip to modal
1 parent c51444f commit 88cbca7

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

resources/js/components/cedar-ui/modal/BaseModal.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<script setup lang="ts">
22
import { useModalStore } from '@/stores/ModalStore';
33
import { ButtonCorner } from '@/components/cedar-ui/button';
4+
import { HoverCard } from '@/components/cedar-ui/hover-card';
45
56
const modalStore = useModalStore();
67
</script>
78

89
<template>
910
<section v-if="!modalStore.props?.hideHeader" class="flex flex-wrap items-center gap-2">
10-
<h3 ref="modalTitle" id="modalTitle" class="flex-1 scroll-mt-16 text-xl font-semibold sm:scroll-mt-12">
11-
<slot name="title">
12-
{{ modalStore.props?.title ?? 'Modal Title' }}
13-
</slot>
14-
</h3>
11+
<HoverCard class="flex-1 scroll-mt-16 sm:scroll-mt-12" :content="modalStore.props.titleTooltip">
12+
<template #trigger>
13+
<h3 ref="modalTitle" id="modalTitle" class="text-xl font-semibold">
14+
<slot name="title">
15+
{{ modalStore.props?.title ?? 'Modal Title' }}
16+
</slot>
17+
</h3>
18+
</template>
19+
</HoverCard>
1520
<ButtonCorner @click="modalStore.close" class="static! m-0!" />
1621
<p class="text-foreground-2 w-full text-sm" v-if="$slots.description" id="modalDescription">
1722
<slot name="description"> </slot>

0 commit comments

Comments
 (0)