* chore: add storybook * chore: unify FE codeabse * chore: update eslint rules * chore: harmonize the use of "subtle" color * chore: remove an extra sidebar rail * refactor: make panel items more consistent * chore: cleanups after merging new code from base * refactor: refine composables * fix: add lost import * chore: make icon style consistent * fix: don't show empty "supported" methods * refactor: solidify select items
52 lines
1.3 KiB
Vue
52 lines
1.3 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* @component AppCommandDialog
|
|
* @description A command palette wrapped in a modal dialog.
|
|
*/
|
|
import {
|
|
AppDialog,
|
|
AppDialogContent,
|
|
AppDialogDescription,
|
|
AppDialogHeader,
|
|
AppDialogTitle,
|
|
} from '@/components/base/dialog';
|
|
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
import { useForwardPropsEmits } from 'reka-ui';
|
|
import AppCommand from './AppCommand.vue';
|
|
|
|
/*
|
|
* Types & Interfaces.
|
|
*/
|
|
|
|
export interface AppCommandDialogProps extends DialogRootProps {
|
|
title?: string;
|
|
description?: string;
|
|
}
|
|
|
|
/*
|
|
* Component Setup.
|
|
*/
|
|
|
|
const props = withDefaults(defineProps<AppCommandDialogProps>(), {
|
|
title: 'Command Palette',
|
|
description: 'Search for a command to run...',
|
|
});
|
|
const emits = defineEmits<DialogRootEmits>();
|
|
|
|
const forwarded = useForwardPropsEmits(props, emits);
|
|
</script>
|
|
|
|
<template>
|
|
<AppDialog v-bind="forwarded">
|
|
<AppDialogContent class="overflow-hidden p-0">
|
|
<AppDialogHeader class="sr-only">
|
|
<AppDialogTitle>{{ title }}</AppDialogTitle>
|
|
<AppDialogDescription>{{ description }}</AppDialogDescription>
|
|
</AppDialogHeader>
|
|
<AppCommand>
|
|
<slot />
|
|
</AppCommand>
|
|
</AppDialogContent>
|
|
</AppDialog>
|
|
</template>
|