From 57044c8011e16f92079f2f7d4291ef5b2d6d7fc0 Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 4 Oct 2024 20:56:28 -0700 Subject: [PATCH 1/4] format repo --- components.json | 2 +- fake-snippets-api/lib/db/db-client.ts | 28 ++++++-- fake-snippets-api/routes/api/snippets/get.ts | 4 +- .../tests/fixtures/get-test-server.ts | 2 +- src/components/HeaderDropdown.tsx | 10 +-- src/components/ViewSnippetSidebar.tsx | 3 +- src/components/ui/accordion.tsx | 2 +- src/components/ui/alert-dialog.tsx | 10 +-- src/components/ui/alert.tsx | 2 +- src/components/ui/avatar.tsx | 4 +- src/components/ui/badge.tsx | 2 +- src/components/ui/breadcrumb.tsx | 7 +- src/components/ui/button.tsx | 7 +- src/components/ui/card.tsx | 2 +- src/components/ui/carousel.tsx | 16 ++--- src/components/ui/checkbox.tsx | 2 +- src/components/ui/command.tsx | 10 +-- src/components/ui/context-menu.tsx | 16 ++--- src/components/ui/dialog.tsx | 10 +-- src/components/ui/drawer.tsx | 4 +- src/components/ui/dropdown-menu.tsx | 14 ++-- src/components/ui/form.tsx | 18 +++-- src/components/ui/hover-card.tsx | 2 +- src/components/ui/input-otp.tsx | 4 +- src/components/ui/input.tsx | 4 +- src/components/ui/label.tsx | 2 +- src/components/ui/menubar.tsx | 24 +++---- src/components/ui/navigation-menu.tsx | 15 ++-- src/components/ui/pagination.tsx | 2 +- src/components/ui/popover.tsx | 2 +- src/components/ui/progress.tsx | 2 +- src/components/ui/radio-group.tsx | 2 +- src/components/ui/resizable.tsx | 4 +- src/components/ui/scroll-area.tsx | 2 +- src/components/ui/select.tsx | 12 ++-- src/components/ui/separator.tsx | 6 +- src/components/ui/sheet.tsx | 13 ++-- src/components/ui/skeleton.tsx | 5 +- src/components/ui/slider.tsx | 2 +- src/components/ui/sonner.tsx | 3 +- src/components/ui/switch.tsx | 4 +- src/components/ui/table.tsx | 8 +-- src/components/ui/tabs.tsx | 6 +- src/components/ui/textarea.tsx | 4 +- src/components/ui/toast.tsx | 11 +-- src/components/ui/toggle-group.tsx | 2 +- src/components/ui/toggle.tsx | 2 +- src/components/ui/tooltip.tsx | 2 +- src/hooks/use-toast.ts | 9 +-- src/index.css | 10 ++- tailwind.config.js | 69 +++++++++---------- tsconfig.json | 4 +- 52 files changed, 222 insertions(+), 190 deletions(-) diff --git a/components.json b/components.json index b1d6016..c1be836 100644 --- a/components.json +++ b/components.json @@ -17,4 +17,4 @@ "lib": "@/lib", "hooks": "@/hooks" } -} \ No newline at end of file +} diff --git a/fake-snippets-api/lib/db/db-client.ts b/fake-snippets-api/lib/db/db-client.ts index e4ece85..26172b7 100644 --- a/fake-snippets-api/lib/db/db-client.ts +++ b/fake-snippets-api/lib/db/db-client.ts @@ -2,7 +2,14 @@ import { createStore, type StoreApi } from "zustand/vanilla" import { immer } from "zustand/middleware/immer" import { hoist, type HoistedStoreApi } from "zustand-hoist" -import { databaseSchema, Snippet, Session, LoginPage, Account, type DatabaseSchema } from "./schema.ts" +import { + databaseSchema, + Snippet, + Session, + LoginPage, + Account, + type DatabaseSchema, +} from "./schema.ts" import { combine } from "zustand/middleware" export const createDatabase = () => { @@ -89,12 +96,16 @@ const initializer = combine(databaseSchema.parse({}), (set, get) => ({ })) return newSession }, - getSessions: ({ account_id, is_cli_session }: { account_id: string, is_cli_session?: boolean }): Session[] => { + getSessions: ({ + account_id, + is_cli_session, + }: { account_id: string; is_cli_session?: boolean }): Session[] => { const state = get() return state.sessions.filter( - (session) => - session.account_id === account_id && - (is_cli_session === undefined || session.is_cli_session === is_cli_session) + (session) => + session.account_id === account_id && + (is_cli_session === undefined || + session.is_cli_session === is_cli_session), ) }, createLoginPage: (): LoginPage => { @@ -115,10 +126,13 @@ const initializer = combine(databaseSchema.parse({}), (set, get) => ({ const state = get() return state.loginPages.find((lp) => lp.login_page_id === login_page_id) }, - updateLoginPage: (login_page_id: string, updates: Partial): void => { + updateLoginPage: ( + login_page_id: string, + updates: Partial, + ): void => { set((state) => ({ loginPages: state.loginPages.map((lp) => - lp.login_page_id === login_page_id ? { ...lp, ...updates } : lp + lp.login_page_id === login_page_id ? { ...lp, ...updates } : lp, ), })) }, diff --git a/fake-snippets-api/routes/api/snippets/get.ts b/fake-snippets-api/routes/api/snippets/get.ts index 8101822..dcf994e 100644 --- a/fake-snippets-api/routes/api/snippets/get.ts +++ b/fake-snippets-api/routes/api/snippets/get.ts @@ -14,7 +14,9 @@ export default withRouteSpec({ jsonBody: z.any().optional(), jsonResponse: z.object({ ok: z.boolean(), - snippet: snippetSchema.extend({ snippet_type: z.enum(["board", "package", "model", "footprint"]) }), + snippet: snippetSchema.extend({ + snippet_type: z.enum(["board", "package", "model", "footprint"]), + }), }), })(async (req, ctx) => { const { snippet_id, name, owner_name, unscoped_name } = req.commonParams diff --git a/fake-snippets-api/tests/fixtures/get-test-server.ts b/fake-snippets-api/tests/fixtures/get-test-server.ts index 7fdd3b5..631eb14 100644 --- a/fake-snippets-api/tests/fixtures/get-test-server.ts +++ b/fake-snippets-api/tests/fixtures/get-test-server.ts @@ -27,7 +27,7 @@ export const getTestServer = async (): Promise => { }) afterEach(async () => { - if (server && typeof server.stop === 'function') { + if (server && typeof server.stop === "function") { await server.stop() } // Here you might want to add logic to drop the test database diff --git a/src/components/HeaderDropdown.tsx b/src/components/HeaderDropdown.tsx index 74aac1d..9dd4945 100644 --- a/src/components/HeaderDropdown.tsx +++ b/src/components/HeaderDropdown.tsx @@ -1,11 +1,11 @@ -import { Button } from "@/components/ui/button"; +import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { ChevronDown } from "lucide-react"; +} from "@/components/ui/dropdown-menu" +import { ChevronDown } from "lucide-react" export default function HeaderDropdown() { const blankTemplates = [ @@ -17,7 +17,7 @@ export default function HeaderDropdown() { }, { name: "Blank 3D Model", type: "model", badgeColor: "bg-purple-500 " }, { name: "Blank Footprint", type: "footprint", badgeColor: "bg-pink-500 " }, - ]; + ] return ( @@ -46,5 +46,5 @@ export default function HeaderDropdown() { ))} - ); + ) } diff --git a/src/components/ViewSnippetSidebar.tsx b/src/components/ViewSnippetSidebar.tsx index a9e8ba8..df5f50d 100644 --- a/src/components/ViewSnippetSidebar.tsx +++ b/src/components/ViewSnippetSidebar.tsx @@ -79,7 +79,8 @@ export default function ViewSnippetSidebar({
Copy import code
- import CircuitModule from "@tsci/{snippet?.owner_name}.{snippet?.unscoped_name}" + import CircuitModule from "@tsci/{snippet?.owner_name}. + {snippet?.unscoped_name}"
diff --git a/src/components/ui/accordion.tsx b/src/components/ui/accordion.tsx index bb62ff1..766b3b8 100644 --- a/src/components/ui/accordion.tsx +++ b/src/components/ui/accordion.tsx @@ -27,7 +27,7 @@ const AccordionTrigger = React.forwardRef< ref={ref} className={cn( "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", - className + className, )} {...props} > diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx index b2fd860..e1dcc10 100644 --- a/src/components/ui/alert-dialog.tsx +++ b/src/components/ui/alert-dialog.tsx @@ -17,7 +17,7 @@ const AlertDialogOverlay = React.forwardRef< @@ -50,7 +50,7 @@ const AlertDialogHeader = ({
@@ -64,7 +64,7 @@ const AlertDialogFooter = ({
@@ -117,7 +117,7 @@ const AlertDialogCancel = React.forwardRef< className={cn( buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", - className + className, )} {...props} /> diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx index 5befe61..8391247 100644 --- a/src/components/ui/alert.tsx +++ b/src/components/ui/alert.tsx @@ -16,7 +16,7 @@ const alertVariants = cva( defaultVariants: { variant: "default", }, - } + }, ) const Alert = React.forwardRef< diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx index 14bcc11..c2bece7 100644 --- a/src/components/ui/avatar.tsx +++ b/src/components/ui/avatar.tsx @@ -11,7 +11,7 @@ const Avatar = React.forwardRef< ref={ref} className={cn( "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", - className + className, )} {...props} /> @@ -38,7 +38,7 @@ const AvatarFallback = React.forwardRef< ref={ref} className={cn( "flex h-full w-full items-center justify-center rounded-full bg-slate-100 dark:bg-slate-800", - className + className, )} {...props} /> diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index da6c375..86a4023 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -20,7 +20,7 @@ const badgeVariants = cva( defaultVariants: { variant: "default", }, - } + }, ) export interface BadgeProps diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx index e9d9041..820da51 100644 --- a/src/components/ui/breadcrumb.tsx +++ b/src/components/ui/breadcrumb.tsx @@ -20,7 +20,7 @@ const BreadcrumbList = React.forwardRef< ref={ref} className={cn( "flex flex-wrap items-center gap-1.5 break-words text-sm text-slate-500 sm:gap-2.5 dark:text-slate-400", - className + className, )} {...props} /> @@ -50,7 +50,10 @@ const BreadcrumbLink = React.forwardRef< return ( ) diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 05f50c1..e16d158 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -17,7 +17,8 @@ const buttonVariants = cva( "border border-slate-200 bg-white shadow-sm hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50", secondary: "bg-slate-100 text-slate-900 shadow-sm hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80", - ghost: "hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50", + ghost: + "hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50", link: "text-slate-900 underline-offset-4 hover:underline dark:text-slate-50", }, size: { @@ -31,7 +32,7 @@ const buttonVariants = cva( variant: "default", size: "default", }, - } + }, ) export interface ButtonProps @@ -50,7 +51,7 @@ const Button = React.forwardRef( {...props} /> ) - } + }, ) Button.displayName = "Button" diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index fefb39c..fa3c8f8 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -10,7 +10,7 @@ const Card = React.forwardRef< ref={ref} className={cn( "rounded-xl border border-slate-200 bg-white text-slate-950 shadow dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> diff --git a/src/components/ui/carousel.tsx b/src/components/ui/carousel.tsx index d794479..59ed2c5 100644 --- a/src/components/ui/carousel.tsx +++ b/src/components/ui/carousel.tsx @@ -54,14 +54,14 @@ const Carousel = React.forwardRef< children, ...props }, - ref + ref, ) => { const [carouselRef, api] = useEmblaCarousel( { ...opts, axis: orientation === "horizontal" ? "x" : "y", }, - plugins + plugins, ) const [canScrollPrev, setCanScrollPrev] = React.useState(false) const [canScrollNext, setCanScrollNext] = React.useState(false) @@ -93,7 +93,7 @@ const Carousel = React.forwardRef< scrollNext() } }, - [scrollPrev, scrollNext] + [scrollPrev, scrollNext], ) React.useEffect(() => { @@ -144,7 +144,7 @@ const Carousel = React.forwardRef<
) - } + }, ) Carousel.displayName = "Carousel" @@ -161,7 +161,7 @@ const CarouselContent = React.forwardRef< className={cn( "flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", - className + className, )} {...props} /> @@ -184,7 +184,7 @@ const CarouselItem = React.forwardRef< className={cn( "min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", - className + className, )} {...props} /> @@ -208,7 +208,7 @@ const CarouselPrevious = React.forwardRef< orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", - className + className, )} disabled={!canScrollPrev} onClick={scrollPrev} @@ -237,7 +237,7 @@ const CarouselNext = React.forwardRef< orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", - className + className, )} disabled={!canScrollNext} onClick={scrollNext} diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index e74d826..5259585 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -12,7 +12,7 @@ const Checkbox = React.forwardRef< ref={ref} className={cn( "peer h-4 w-4 shrink-0 rounded-sm border border-slate-200 border-slate-900 shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-slate-950 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=checked]:text-slate-50 dark:border-slate-800 dark:border-slate-50 dark:focus-visible:ring-slate-300 dark:data-[state=checked]:bg-slate-50 dark:data-[state=checked]:text-slate-900", - className + className, )} {...props} > diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx index 732b671..15a970d 100644 --- a/src/components/ui/command.tsx +++ b/src/components/ui/command.tsx @@ -14,7 +14,7 @@ const Command = React.forwardRef< ref={ref} className={cn( "flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> @@ -45,7 +45,7 @@ const CommandInput = React.forwardRef< ref={ref} className={cn( "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400", - className + className, )} {...props} /> @@ -88,7 +88,7 @@ const CommandGroup = React.forwardRef< ref={ref} className={cn( "overflow-hidden p-1 text-slate-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:text-slate-50 dark:[&_[cmdk-group-heading]]:text-slate-400", - className + className, )} {...props} /> @@ -116,7 +116,7 @@ const CommandItem = React.forwardRef< ref={ref} className={cn( "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-slate-100 data-[selected=true]:text-slate-900 data-[disabled=true]:opacity-50 dark:data-[selected=true]:bg-slate-800 dark:data-[selected=true]:text-slate-50", - className + className, )} {...props} /> @@ -132,7 +132,7 @@ const CommandShortcut = ({ diff --git a/src/components/ui/context-menu.tsx b/src/components/ui/context-menu.tsx index 2e9bd1e..13e4c6f 100644 --- a/src/components/ui/context-menu.tsx +++ b/src/components/ui/context-menu.tsx @@ -31,7 +31,7 @@ const ContextMenuSubTrigger = React.forwardRef< className={cn( "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50", inset && "pl-8", - className + className, )} {...props} > @@ -49,7 +49,7 @@ const ContextMenuSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> @@ -65,7 +65,7 @@ const ContextMenuContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> @@ -84,7 +84,7 @@ const ContextMenuItem = React.forwardRef< className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", inset && "pl-8", - className + className, )} {...props} /> @@ -99,7 +99,7 @@ const ContextMenuCheckboxItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} checked={checked} {...props} @@ -123,7 +123,7 @@ const ContextMenuRadioItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} {...props} > @@ -148,7 +148,7 @@ const ContextMenuLabel = React.forwardRef< className={cn( "px-2 py-1.5 text-sm font-semibold text-slate-950 dark:text-slate-50", inset && "pl-8", - className + className, )} {...props} /> @@ -175,7 +175,7 @@ const ContextMenuShortcut = ({ diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 47ffe55..7c1346d 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -20,7 +20,7 @@ const DialogOverlay = React.forwardRef< ref={ref} className={cn( "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 + className, )} {...props} /> @@ -37,7 +37,7 @@ const DialogContent = React.forwardRef< ref={ref} className={cn( "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-200 bg-white 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 dark:border-slate-800 dark:bg-slate-950", - className + className, )} {...props} > @@ -58,7 +58,7 @@ const DialogHeader = ({
@@ -72,7 +72,7 @@ const DialogFooter = ({
@@ -87,7 +87,7 @@ const DialogTitle = React.forwardRef< ref={ref} className={cn( "text-lg font-semibold leading-none tracking-tight", - className + className, )} {...props} /> diff --git a/src/components/ui/drawer.tsx b/src/components/ui/drawer.tsx index c7e2530..e93c509 100644 --- a/src/components/ui/drawer.tsx +++ b/src/components/ui/drawer.tsx @@ -42,7 +42,7 @@ const DrawerContent = React.forwardRef< ref={ref} className={cn( "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-950", - className + className, )} {...props} > @@ -83,7 +83,7 @@ const DrawerTitle = React.forwardRef< ref={ref} className={cn( "text-lg font-semibold leading-none tracking-tight", - className + className, )} {...props} /> diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx index 6978065..c60589d 100644 --- a/src/components/ui/dropdown-menu.tsx +++ b/src/components/ui/dropdown-menu.tsx @@ -31,7 +31,7 @@ const DropdownMenuSubTrigger = React.forwardRef< className={cn( "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100 dark:focus:bg-slate-800 dark:data-[state=open]:bg-slate-800", inset && "pl-8", - className + className, )} {...props} > @@ -50,7 +50,7 @@ const DropdownMenuSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> @@ -69,7 +69,7 @@ const DropdownMenuContent = React.forwardRef< className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", "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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> @@ -88,7 +88,7 @@ const DropdownMenuItem = React.forwardRef< className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", inset && "pl-8", - className + className, )} {...props} /> @@ -103,7 +103,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} checked={checked} {...props} @@ -127,7 +127,7 @@ const DropdownMenuRadioItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} {...props} > @@ -152,7 +152,7 @@ const DropdownMenuLabel = React.forwardRef< className={cn( "px-2 py-1.5 text-sm font-semibold", inset && "pl-8", - className + className, )} {...props} /> diff --git a/src/components/ui/form.tsx b/src/components/ui/form.tsx index 2f8040c..f33ce6f 100644 --- a/src/components/ui/form.tsx +++ b/src/components/ui/form.tsx @@ -17,18 +17,18 @@ const Form = FormProvider type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, > = { name: TName } const FormFieldContext = React.createContext( - {} as FormFieldContextValue + {} as FormFieldContextValue, ) const FormField = < TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, >({ ...props }: ControllerProps) => { @@ -67,7 +67,7 @@ type FormItemContextValue = { } const FormItemContext = React.createContext( - {} as FormItemContextValue + {} as FormItemContextValue, ) const FormItem = React.forwardRef< @@ -133,7 +133,10 @@ const FormDescription = React.forwardRef<

) @@ -155,7 +158,10 @@ const FormMessage = React.forwardRef<

{body} diff --git a/src/components/ui/hover-card.tsx b/src/components/ui/hover-card.tsx index cc1dc5e..e159b14 100644 --- a/src/components/ui/hover-card.tsx +++ b/src/components/ui/hover-card.tsx @@ -17,7 +17,7 @@ const HoverCardContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 w-64 rounded-md border border-slate-200 bg-white p-4 text-slate-950 shadow-md outline-none 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> diff --git a/src/components/ui/input-otp.tsx b/src/components/ui/input-otp.tsx index eb0db04..94469c6 100644 --- a/src/components/ui/input-otp.tsx +++ b/src/components/ui/input-otp.tsx @@ -12,7 +12,7 @@ const InputOTP = React.forwardRef< ref={ref} containerClassName={cn( "flex items-center gap-2 has-[:disabled]:opacity-50", - containerClassName + containerClassName, )} className={cn("disabled:cursor-not-allowed", className)} {...props} @@ -41,7 +41,7 @@ const InputOTPSlot = React.forwardRef< className={cn( "relative flex h-9 w-9 items-center justify-center border-y border-r border-slate-200 text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-slate-800", isActive && "z-10 ring-1 ring-slate-950 dark:ring-slate-300", - className + className, )} {...props} > diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx index 18679d0..2358d49 100644 --- a/src/components/ui/input.tsx +++ b/src/components/ui/input.tsx @@ -12,13 +12,13 @@ const Input = React.forwardRef( type={type} className={cn( "flex h-9 w-full rounded-md border border-slate-200 bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-slate-950 placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-slate-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:file:text-slate-50 dark:placeholder:text-slate-400 dark:focus-visible:ring-slate-300", - className + className, )} ref={ref} {...props} /> ) - } + }, ) Input.displayName = "Input" diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx index 683faa7..f1e8dbe 100644 --- a/src/components/ui/label.tsx +++ b/src/components/ui/label.tsx @@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", ) const Label = React.forwardRef< diff --git a/src/components/ui/menubar.tsx b/src/components/ui/menubar.tsx index 49f3d57..1a94b15 100644 --- a/src/components/ui/menubar.tsx +++ b/src/components/ui/menubar.tsx @@ -26,7 +26,7 @@ const Menubar = React.forwardRef< ref={ref} className={cn( "flex h-9 items-center space-x-1 rounded-md border border-slate-200 bg-white p-1 shadow-sm dark:border-slate-800 dark:bg-slate-950", - className + className, )} {...props} /> @@ -41,7 +41,7 @@ const MenubarTrigger = React.forwardRef< ref={ref} className={cn( "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50", - className + className, )} {...props} /> @@ -59,7 +59,7 @@ const MenubarSubTrigger = React.forwardRef< className={cn( "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50", inset && "pl-8", - className + className, )} {...props} > @@ -77,7 +77,7 @@ const MenubarSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50", - className + className, )} {...props} /> @@ -90,7 +90,7 @@ const MenubarContent = React.forwardRef< >( ( { className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, - ref + ref, ) => ( - ) + ), ) MenubarContent.displayName = MenubarPrimitive.Content.displayName @@ -120,7 +120,7 @@ const MenubarItem = React.forwardRef< className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", inset && "pl-8", - className + className, )} {...props} /> @@ -135,7 +135,7 @@ const MenubarCheckboxItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} checked={checked} {...props} @@ -158,7 +158,7 @@ const MenubarRadioItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50", - className + className, )} {...props} > @@ -183,7 +183,7 @@ const MenubarLabel = React.forwardRef< className={cn( "px-2 py-1.5 text-sm font-semibold", inset && "pl-8", - className + className, )} {...props} /> @@ -210,7 +210,7 @@ const MenubarShortcut = ({ diff --git a/src/components/ui/navigation-menu.tsx b/src/components/ui/navigation-menu.tsx index b0fd983..bb7d12c 100644 --- a/src/components/ui/navigation-menu.tsx +++ b/src/components/ui/navigation-menu.tsx @@ -13,7 +13,7 @@ const NavigationMenu = React.forwardRef< ref={ref} className={cn( "relative z-10 flex max-w-max flex-1 items-center justify-center", - className + className, )} {...props} > @@ -31,7 +31,7 @@ const NavigationMenuList = React.forwardRef< ref={ref} className={cn( "group flex flex-1 list-none items-center justify-center space-x-1", - className + className, )} {...props} /> @@ -41,7 +41,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName const NavigationMenuItem = NavigationMenuPrimitive.Item const navigationMenuTriggerStyle = cva( - "group inline-flex h-9 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium transition-colors hover:bg-slate-100 hover:text-slate-900 focus:bg-slate-100 focus:text-slate-900 focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-slate-100/50 data-[state=open]:bg-slate-100/50 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[active]:bg-slate-800/50 dark:data-[state=open]:bg-slate-800/50" + "group inline-flex h-9 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium transition-colors hover:bg-slate-100 hover:text-slate-900 focus:bg-slate-100 focus:text-slate-900 focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-slate-100/50 data-[state=open]:bg-slate-100/50 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[active]:bg-slate-800/50 dark:data-[state=open]:bg-slate-800/50", ) const NavigationMenuTrigger = React.forwardRef< @@ -53,7 +53,8 @@ const NavigationMenuTrigger = React.forwardRef< className={cn(navigationMenuTriggerStyle(), "group", className)} {...props} > - {children}{""} + {children} + {""}

@@ -106,7 +106,10 @@ const SheetTitle = React.forwardRef< >(({ className, ...props }, ref) => ( )) diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx index 102228a..0cdc647 100644 --- a/src/components/ui/skeleton.tsx +++ b/src/components/ui/skeleton.tsx @@ -6,7 +6,10 @@ function Skeleton({ }: React.HTMLAttributes) { return (
) diff --git a/src/components/ui/slider.tsx b/src/components/ui/slider.tsx index 399bdd0..976dad8 100644 --- a/src/components/ui/slider.tsx +++ b/src/components/ui/slider.tsx @@ -11,7 +11,7 @@ const Slider = React.forwardRef< ref={ref} className={cn( "relative flex w-full touch-none select-none items-center", - className + className, )} {...props} > diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx index 3b3a2cb..b3451d6 100644 --- a/src/components/ui/sonner.tsx +++ b/src/components/ui/sonner.tsx @@ -14,7 +14,8 @@ const Toaster = ({ ...props }: ToasterProps) => { classNames: { toast: "group toast group-[.toaster]:bg-white group-[.toaster]:text-slate-950 group-[.toaster]:border-slate-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-slate-950 dark:group-[.toaster]:text-slate-50 dark:group-[.toaster]:border-slate-800", - description: "group-[.toast]:text-slate-500 dark:group-[.toast]:text-slate-400", + description: + "group-[.toast]:text-slate-500 dark:group-[.toast]:text-slate-400", actionButton: "group-[.toast]:bg-slate-900 group-[.toast]:text-slate-50 dark:group-[.toast]:bg-slate-50 dark:group-[.toast]:text-slate-900", cancelButton: diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsx index 6dfbf70..a266874 100644 --- a/src/components/ui/switch.tsx +++ b/src/components/ui/switch.tsx @@ -10,14 +10,14 @@ const Switch = React.forwardRef< diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx index 4b17789..0c827d7 100644 --- a/src/components/ui/table.tsx +++ b/src/components/ui/table.tsx @@ -44,7 +44,7 @@ const TableFooter = React.forwardRef< ref={ref} className={cn( "border-t bg-slate-100/50 font-medium [&>tr]:last:border-b-0 dark:bg-slate-800/50", - className + className, )} {...props} /> @@ -59,7 +59,7 @@ const TableRow = React.forwardRef< ref={ref} className={cn( "border-b transition-colors hover:bg-slate-100/50 data-[state=selected]:bg-slate-100 dark:hover:bg-slate-800/50 dark:data-[state=selected]:bg-slate-800", - className + className, )} {...props} /> @@ -74,7 +74,7 @@ const TableHead = React.forwardRef< ref={ref} className={cn( "h-10 px-2 text-left align-middle font-medium text-slate-500 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] dark:text-slate-400", - className + className, )} {...props} /> @@ -89,7 +89,7 @@ const TableCell = React.forwardRef< ref={ref} className={cn( "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", - className + className, )} {...props} /> diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx index cd93b28..9b4caaa 100644 --- a/src/components/ui/tabs.tsx +++ b/src/components/ui/tabs.tsx @@ -13,7 +13,7 @@ const TabsList = React.forwardRef< ref={ref} className={cn( "inline-flex h-9 items-center justify-center rounded-lg bg-slate-100 p-1 text-slate-500 dark:bg-slate-800 dark:text-slate-400", - className + className, )} {...props} /> @@ -28,7 +28,7 @@ const TabsTrigger = React.forwardRef< ref={ref} className={cn( "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-slate-950 data-[state=active]:shadow dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=active]:bg-slate-950 dark:data-[state=active]:text-slate-50", - className + className, )} {...props} /> @@ -43,7 +43,7 @@ const TabsContent = React.forwardRef< ref={ref} className={cn( "mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300", - className + className, )} {...props} /> diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx index e198f20..be33349 100644 --- a/src/components/ui/textarea.tsx +++ b/src/components/ui/textarea.tsx @@ -11,13 +11,13 @@ const Textarea = React.forwardRef(