2024-12-25 20:46:14 +01:00
|
|
|
<script setup lang="ts">
|
2025-06-26 22:39:02 +02:00
|
|
|
import type { DialogRootEmits, DialogRootProps } from "reka-ui";
|
|
|
|
|
import { useForwardPropsEmits } from "reka-ui";
|
2025-04-10 13:55:56 +02:00
|
|
|
import {
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogContent,
|
|
|
|
|
DialogDescription,
|
|
|
|
|
DialogHeader,
|
|
|
|
|
DialogTitle,
|
|
|
|
|
} from "@/components/ui/dialog";
|
2024-12-25 20:46:14 +01:00
|
|
|
import Command from "./Command.vue";
|
|
|
|
|
|
2025-04-10 13:55:56 +02:00
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<
|
|
|
|
|
DialogRootProps & {
|
|
|
|
|
title?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
>(),
|
|
|
|
|
{
|
|
|
|
|
title: "Command Palette",
|
|
|
|
|
description: "Search for a command to run...",
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-12-25 20:46:14 +01:00
|
|
|
const emits = defineEmits<DialogRootEmits>();
|
|
|
|
|
|
|
|
|
|
const forwarded = useForwardPropsEmits(props, emits);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog v-bind="forwarded">
|
2025-04-10 13:55:56 +02:00
|
|
|
<DialogHeader class="sr-only">
|
|
|
|
|
<DialogTitle>{{ title }}</DialogTitle>
|
|
|
|
|
<DialogDescription>{{ description }}</DialogDescription>
|
|
|
|
|
</DialogHeader>
|
|
|
|
|
<DialogContent class="overflow-hidden p-0 ">
|
|
|
|
|
<Command>
|
2024-12-25 20:46:14 +01:00
|
|
|
<slot />
|
|
|
|
|
</Command>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|