@@ -13,7 +13,13 @@ import {
1313} from "@/components/ui/dialog" ;
1414import { useIsMobile } from "@/hooks/use-mobile" ;
1515import { cn } from "@/lib/utils" ;
16- import { Drawer , DrawerContent , DrawerDescription , DrawerHeader , DrawerTitle } from "./drawer" ;
16+ import {
17+ Drawer ,
18+ DrawerContent ,
19+ DrawerDescription ,
20+ DrawerHeader ,
21+ DrawerTitle ,
22+ } from "./drawer" ;
1723
1824function Command ( { className, ...props } : React . ComponentProps < typeof CommandPrimitive > ) {
1925 return (
@@ -47,7 +53,10 @@ function CommandDialog({
4753 < DialogTitle > { title } </ DialogTitle >
4854 < DialogDescription > { description } </ DialogDescription >
4955 </ DialogHeader >
50- < DialogContent className = { cn ( "overflow-hidden p-0" , className ) } showCloseButton = { showCloseButton } >
56+ < DialogContent
57+ className = { cn ( "overflow-hidden p-0" , className ) }
58+ showCloseButton = { showCloseButton }
59+ >
5160 < Command className = "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5" >
5261 { children }
5362 </ Command >
@@ -60,10 +69,12 @@ function CommandResponsiveDialog({
6069 title = "Command Palette" ,
6170 description = "Search for a command to run..." ,
6271 children,
72+ shouldFilter = true ,
6373 ...props
6474} : React . ComponentProps < typeof Dialog > & {
6575 title ?: string ;
6676 description ?: string ;
77+ shouldFilter ?: boolean ;
6778} ) {
6879 const isMobile = useIsMobile ( ) ;
6980
@@ -75,7 +86,10 @@ function CommandResponsiveDialog({
7586 < DrawerTitle > { title } </ DrawerTitle >
7687 < DrawerDescription > { description } </ DrawerDescription >
7788 </ DrawerHeader >
78- < Command className = "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5" >
89+ < Command
90+ shouldFilter = { shouldFilter }
91+ className = "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
92+ >
7993 { children }
8094 </ Command >
8195 </ DrawerContent >
@@ -90,17 +104,26 @@ function CommandResponsiveDialog({
90104 < DialogDescription > { description } </ DialogDescription >
91105 </ DialogHeader >
92106 < DialogContent className = "overflow-hidden p-0" >
93- < Command className = "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5" >
107+ < Command
108+ shouldFilter = { shouldFilter }
109+ className = "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
110+ >
94111 { children }
95112 </ Command >
96113 </ DialogContent >
97114 </ Dialog >
98115 ) ;
99116}
100117
101- function CommandInput ( { className, ...props } : React . ComponentProps < typeof CommandPrimitive . Input > ) {
118+ function CommandInput ( {
119+ className,
120+ ...props
121+ } : React . ComponentProps < typeof CommandPrimitive . Input > ) {
102122 return (
103- < div data-slot = "command-input-wrapper" className = "flex h-9 items-center gap-2 border-b px-3" >
123+ < div
124+ data-slot = "command-input-wrapper"
125+ className = "flex h-9 items-center gap-2 border-b px-3"
126+ >
104127 < SearchIcon className = "size-4 shrink-0 opacity-50" />
105128 < CommandPrimitive . Input
106129 data-slot = "command-input"
@@ -114,23 +137,36 @@ function CommandInput({ className, ...props }: React.ComponentProps<typeof Comma
114137 ) ;
115138}
116139
117- function CommandList ( { className, ...props } : React . ComponentProps < typeof CommandPrimitive . List > ) {
140+ function CommandList ( {
141+ className,
142+ ...props
143+ } : React . ComponentProps < typeof CommandPrimitive . List > ) {
118144 return (
119145 < CommandPrimitive . List
120146 data-slot = "command-list"
121- className = { cn ( "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto" , className ) }
147+ className = { cn (
148+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto" ,
149+ className
150+ ) }
122151 { ...props }
123152 />
124153 ) ;
125154}
126155
127156function CommandEmpty ( { ...props } : React . ComponentProps < typeof CommandPrimitive . Empty > ) {
128157 return (
129- < CommandPrimitive . Empty data-slot = "command-empty" className = "py-6 text-center text-sm" { ...props } />
158+ < CommandPrimitive . Empty
159+ data-slot = "command-empty"
160+ className = "py-6 text-center text-sm"
161+ { ...props }
162+ />
130163 ) ;
131164}
132165
133- function CommandGroup ( { className, ...props } : React . ComponentProps < typeof CommandPrimitive . Group > ) {
166+ function CommandGroup ( {
167+ className,
168+ ...props
169+ } : React . ComponentProps < typeof CommandPrimitive . Group > ) {
134170 return (
135171 < CommandPrimitive . Group
136172 data-slot = "command-group"
@@ -156,7 +192,10 @@ function CommandSeparator({
156192 ) ;
157193}
158194
159- function CommandItem ( { className, ...props } : React . ComponentProps < typeof CommandPrimitive . Item > ) {
195+ function CommandItem ( {
196+ className,
197+ ...props
198+ } : React . ComponentProps < typeof CommandPrimitive . Item > ) {
160199 return (
161200 < CommandPrimitive . Item
162201 data-slot = "command-item"
0 commit comments