Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export default function RootLayout({
inter.variable,
)}
>
{/* @ts-ignore error type return on build. Revert this when https://github.com/pacocoursey/next-themes/issues/279 issue has been fixed */}
<ThemeProvider
attribute="class"
defaultTheme="system"
Expand Down
59 changes: 31 additions & 28 deletions components/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@/components/ui/command'
import {
Popover,
Expand Down Expand Up @@ -107,34 +108,36 @@ export function Combobox({
placeholder={placeholder || label}
className="h-9"
/>
<CommandEmpty>{emptyMessage}</CommandEmpty>
<CommandGroup
className={cn('overflow-y-auto')}
style={{ maxHeight: maxHeight }}
>
{options.map((opt) => (
<CommandItem
key={opt.key}
value={opt.value ?? opt.label}
onSelect={() => {
if (autoClose) {
setOpen(false)
}
onSelect?.(opt)
}}
>
{opt.label}
<CheckIcon
className={cn(
'ml-auto h-4 w-4',
selected && selected.key === opt.key
? 'opacity-100'
: 'opacity-0',
)}
/>
</CommandItem>
))}
</CommandGroup>
<CommandList>
<CommandEmpty>{emptyMessage}</CommandEmpty>
<CommandGroup
className={cn('overflow-y-auto')}
style={{ maxHeight: maxHeight }}
>
{options.map((opt) => (
<CommandItem
key={opt.key}
value={opt.value ?? opt.label}
onSelect={() => {
if (autoClose) {
setOpen(false)
}
onSelect?.(opt)
}}
>
{opt.label}
<CheckIcon
className={cn(
'ml-auto h-4 w-4',
selected && selected.key === opt.key
? 'opacity-100'
: 'opacity-0',
)}
/>
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
Expand Down
9 changes: 4 additions & 5 deletions components/ui/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface CommandDialogProps extends DialogProps {}
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
return (
<Dialog {...props}>
<DialogContent className="overflow-hidden p-0">
<DialogContent className="overflow-hidden p-0 shadow-lg">
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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">
{children}
</Command>
Expand All @@ -45,7 +45,7 @@ const CommandInput = React.forwardRef<
<CommandPrimitive.Input
ref={ref}
className={cn(
'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
{...props}
Expand Down Expand Up @@ -112,14 +112,13 @@ CommandSeparator.displayName = CommandPrimitive.Separator.displayName
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, value, ...props }, ref) => (
>(({ className, ...props }, ref) => (
<CommandPrimitive.Item
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
className,
)}
value={value?.replaceAll('"', '\\"')}
{...props}
/>
))
Expand Down
Loading