-
+
@@ -59,6 +60,7 @@ import type { Group, Command } from '../../types/command-palette'
import Icon from '../elements/Icon.vue'
import Button from '../elements/Button.vue'
import CommandPaletteGroup from './CommandPaletteGroup.vue'
+import $ui from '#build/ui'
const props = defineProps({
modelValue: {
@@ -85,13 +87,13 @@ const props = defineProps({
type: Array as PropType,
default: () => []
},
- closeIcon: {
- type: String,
- default: null
- },
inputIcon: {
type: String,
- default: 'heroicons-outline:search'
+ default: () => $ui.commandPalette.input.icon.name
+ },
+ inputCloseIcon: {
+ type: String,
+ default: () => $ui.commandPalette.input.close.icon.name
},
inputPlaceholder: {
type: String,
@@ -99,7 +101,7 @@ const props = defineProps({
},
emptyIcon: {
type: String,
- default: 'heroicons-outline:search'
+ default: () => $ui.commandPalette.empty.icon.name
},
groupAttribute: {
type: String,
diff --git a/src/runtime/presets/default.ts b/src/runtime/presets/default.ts
index c74f5a43..aba2639b 100644
--- a/src/runtime/presets/default.ts
+++ b/src/runtime/presets/default.ts
@@ -566,6 +566,30 @@ export default function defaultPreset (variantColors: string[]) {
}
}
+ const commandPalette = {
+ wrapper: 'flex flex-col flex-1 min-h-0 divide-y divide-gray-100 dark:divide-gray-800',
+ input: {
+ base: 'w-full h-12 pr-4 placeholder-gray-400 dark:placeholder-gray-500 bg-transparent border-0 pl-[3.25rem] u-text-gray-900 focus:ring-0 sm:text-sm',
+ icon: {
+ base: 'pointer-events-none absolute top-3.5 left-5 h-5 w-5 u-text-gray-400',
+ name: 'heroicons-outline:search'
+ },
+ close: {
+ base: 'absolute right-2',
+ variant: 'transparent',
+ size: 'md',
+ icon: {
+ name: ''
+ }
+ }
+ },
+ empty: {
+ icon: {
+ name: 'heroicons-outline:search'
+ }
+ }
+ }
+
return {
card,
modal,
@@ -591,7 +615,8 @@ export default function defaultPreset (variantColors: string[]) {
notification,
tooltip,
popover,
- contextMenu
+ contextMenu,
+ commandPalette
}
}