UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix: update command bar bug
Dillion Verma5f3e4eef55db
diff --git a/components/command-menu.tsx b/components/command-menu.tsxindex cc9b7b08..f654c3d8 100644--- a/components/command-menu.tsx+++ b/components/command-menu.tsx@@ -2,7 +2,7 @@import * as React from "react";import { useRouter } from "next/navigation";-import { DialogProps } from "@radix-ui/react-alert-dialog";+import { type DialogProps } from "@radix-ui/react-dialog";import {CircleIcon,FileIcon,diff --git a/components/ui/command.tsx b/components/ui/command.tsxindex b993343c..b0d2b756 100644--- a/components/ui/command.tsx+++ b/components/ui/command.tsx@@ -1,7 +1,7 @@"use client";import * as React from "react";-import { DialogProps } from "@radix-ui/react-dialog";+import { type DialogProps } from "@radix-ui/react-dialog";import { MagnifyingGlassIcon } from "@radix-ui/react-icons";import { Command as CommandPrimitive } from "cmdk";@@ -117,7 +117,7 @@ const CommandItem = React.forwardRef<<CommandPrimitive.Itemref={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 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",className,)}{...props}@@ -145,11 +145,11 @@ CommandShortcut.displayName = "CommandShortcut";export {Command,CommandDialog,- CommandInput,- CommandList,CommandEmpty,CommandGroup,+ CommandInput,CommandItem,- CommandShortcut,+ CommandList,CommandSeparator,+ CommandShortcut,};diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsxindex fd04fd23..95b0d38a 100644--- a/components/ui/dialog.tsx+++ b/components/ui/dialog.tsx@@ -1,14 +1,18 @@-import * as React from "react";-import * as DialogPrimitive from "@radix-ui/react-dialog";-import { Cross2Icon } from "@radix-ui/react-icons";+"use client"-import { cn } from "@/lib/utils";+import * as React from "react"+import * as DialogPrimitive from "@radix-ui/react-dialog"+import { Cross2Icon } from "@radix-ui/react-icons"-const Dialog = DialogPrimitive.Root;+import { cn } from "@/lib/utils"-const DialogTrigger = DialogPrimitive.Trigger;+const Dialog = DialogPrimitive.Root-const DialogPortal = DialogPrimitive.Portal;+const DialogTrigger = DialogPrimitive.Trigger++const DialogPortal = DialogPrimitive.Portal++const DialogClose = DialogPrimitive.Closeconst DialogOverlay = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Overlay>,@@ -17,13 +21,13 @@ const DialogOverlay = React.forwardRef<<DialogPrimitive.Overlayref={ref}className={cn(- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",- className,+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",+ className)}{...props}/>-));-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;+))+DialogOverlay.displayName = DialogPrimitive.Overlay.displayNameconst DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>,@@ -34,20 +38,20 @@ const DialogContent = React.forwardRef<<DialogPrimitive.Contentref={ref}className={cn(- "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",- className,+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",+ className)}{...props}>{children}<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">- <Cross2Icon className="size-4" />+ <Cross2Icon className="h-4 w-4" /><span className="sr-only">Close</span></DialogPrimitive.Close></DialogPrimitive.Content></DialogPortal>-));-DialogContent.displayName = DialogPrimitive.Content.displayName;+))+DialogContent.displayName = DialogPrimitive.Content.displayNameconst DialogHeader = ({className,@@ -56,12 +60,12 @@ const DialogHeader = ({<divclassName={cn("flex flex-col space-y-1.5 text-center sm:text-left",- className,+ className)}{...props}/>-);-DialogHeader.displayName = "DialogHeader";+)+DialogHeader.displayName = "DialogHeader"const DialogFooter = ({className,@@ -70,12 +74,12 @@ const DialogFooter = ({<divclassName={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",- className,+ className)}{...props}/>-);-DialogFooter.displayName = "DialogFooter";+)+DialogFooter.displayName = "DialogFooter"const DialogTitle = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Title>,@@ -85,12 +89,12 @@ const DialogTitle = React.forwardRef<ref={ref}className={cn("text-lg font-semibold leading-none tracking-tight",- className,+ className)}{...props}/>-));-DialogTitle.displayName = DialogPrimitive.Title.displayName;+))+DialogTitle.displayName = DialogPrimitive.Title.displayNameconst DialogDescription = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Description>,@@ -101,17 +105,18 @@ const DialogDescription = React.forwardRef<className={cn("text-sm text-muted-foreground", className)}{...props}/>-));-DialogDescription.displayName = DialogPrimitive.Description.displayName;+))+DialogDescription.displayName = DialogPrimitive.Description.displayNameexport {Dialog,+ DialogPortal,+ DialogOverlay,+ DialogTrigger,+ DialogClose,DialogContent,- DialogDescription,- DialogFooter,DialogHeader,- DialogOverlay,- DialogPortal,+ DialogFooter,DialogTitle,- DialogTrigger,-};+ DialogDescription,+}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex bfbe4db9..85be91e5 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -11069,7 +11069,7 @@ snapshots:eslint: 8.55.0eslint-import-resolver-node: 0.3.9eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])eslint-plugin-jsx-a11y: 6.8.0([email protected])eslint-plugin-react: 7.33.2([email protected])eslint-plugin-react-hooks: 4.6.0([email protected])@@ -11097,7 +11097,7 @@ snapshots:enhanced-resolve: 5.15.1eslint: 8.55.0eslint-module-utils: 2.8.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])+ eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])fast-glob: 3.3.2get-tsconfig: 4.7.5is-core-module: 2.13.1@@ -11119,7 +11119,7 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected]):+ [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]):dependencies:array-includes: 3.1.7array.prototype.findlastindex: 1.2.4