From 69f0a59fe830705eeae173b5b952b72d06368272 Mon Sep 17 00:00:00 2001 From: Marcus Reinhardt Date: Thu, 14 Dec 2023 12:37:38 +0100 Subject: [PATCH] format & lint --- packages/ui/src/components/ui/accordion.tsx | 2 +- packages/ui/src/components/ui/alert.tsx | 5 +++-- packages/ui/src/components/ui/badge.tsx | 5 +++-- packages/ui/src/components/ui/button.tsx | 7 ++++--- packages/ui/src/components/ui/command.tsx | 16 ++++++++-------- packages/ui/src/components/ui/dialog.tsx | 10 +++++----- packages/ui/src/components/ui/dropdown-menu.tsx | 14 +++++++------- packages/ui/src/components/ui/popover.tsx | 2 +- packages/ui/src/components/ui/scroll-area.tsx | 2 +- packages/ui/src/components/ui/sheet.tsx | 11 ++++++----- packages/ui/src/components/ui/table.tsx | 6 +++--- packages/ui/src/components/ui/tabs.tsx | 6 +++--- pnpm-lock.yaml | 3 +++ 13 files changed, 48 insertions(+), 41 deletions(-) diff --git a/packages/ui/src/components/ui/accordion.tsx b/packages/ui/src/components/ui/accordion.tsx index 39a7833..4c80276 100644 --- a/packages/ui/src/components/ui/accordion.tsx +++ b/packages/ui/src/components/ui/accordion.tsx @@ -29,7 +29,7 @@ const AccordionTrigger = React.forwardRef< ref={ref} className={cn( "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", - className + className, )} {...props} > diff --git a/packages/ui/src/components/ui/alert.tsx b/packages/ui/src/components/ui/alert.tsx index 6944551..ebaf265 100644 --- a/packages/ui/src/components/ui/alert.tsx +++ b/packages/ui/src/components/ui/alert.tsx @@ -1,5 +1,6 @@ import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" import { cn } from "@acme/helpers" @@ -16,7 +17,7 @@ const alertVariants = cva( defaultVariants: { variant: "default", }, - } + }, ) const Alert = React.forwardRef< diff --git a/packages/ui/src/components/ui/badge.tsx b/packages/ui/src/components/ui/badge.tsx index 7dea6d3..bf4ad90 100644 --- a/packages/ui/src/components/ui/badge.tsx +++ b/packages/ui/src/components/ui/badge.tsx @@ -1,5 +1,6 @@ import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" import { cn } from "@acme/helpers" @@ -20,7 +21,7 @@ const badgeVariants = cva( defaultVariants: { variant: "default", }, - } + }, ) export interface BadgeProps diff --git a/packages/ui/src/components/ui/button.tsx b/packages/ui/src/components/ui/button.tsx index ed37f5a..eb8a705 100644 --- a/packages/ui/src/components/ui/button.tsx +++ b/packages/ui/src/components/ui/button.tsx @@ -1,6 +1,7 @@ import * as React from "react" +import type { VariantProps } from "class-variance-authority" import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" import { cn } from "@acme/helpers" @@ -30,7 +31,7 @@ const buttonVariants = cva( variant: "default", size: "default", }, - } + }, ) export interface ButtonProps @@ -49,7 +50,7 @@ const Button = React.forwardRef( {...props} /> ) - } + }, ) Button.displayName = "Button" diff --git a/packages/ui/src/components/ui/command.tsx b/packages/ui/src/components/ui/command.tsx index af692e5..9c0a4f2 100644 --- a/packages/ui/src/components/ui/command.tsx +++ b/packages/ui/src/components/ui/command.tsx @@ -1,12 +1,12 @@ "use client" import * as React from "react" -import { type DialogProps } from "@radix-ui/react-dialog" +import { Dialog, DialogContent } from "@/components/ui/dialog" +import type {DialogProps} from "@radix-ui/react-dialog"; import { Command as CommandPrimitive } from "cmdk" import { Search } from "lucide-react" import { cn } from "@acme/helpers" -import { Dialog, DialogContent } from "@/components/ui/dialog" const Command = React.forwardRef< React.ElementRef, @@ -16,14 +16,14 @@ const Command = React.forwardRef< ref={ref} className={cn( "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", - className + className, )} {...props} /> )) Command.displayName = CommandPrimitive.displayName -interface CommandDialogProps extends DialogProps {} +type CommandDialogProps = DialogProps const CommandDialog = ({ children, ...props }: CommandDialogProps) => { return ( @@ -47,7 +47,7 @@ const CommandInput = React.forwardRef< ref={ref} className={cn( "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 + className, )} {...props} /> @@ -90,7 +90,7 @@ const CommandGroup = React.forwardRef< ref={ref} className={cn( "overflow-hidden p-1 text-foreground [&_[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-muted-foreground", - className + className, )} {...props} /> @@ -118,7 +118,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 aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} {...props} /> @@ -134,7 +134,7 @@ const CommandShortcut = ({ diff --git a/packages/ui/src/components/ui/dialog.tsx b/packages/ui/src/components/ui/dialog.tsx index 6754319..cf1906a 100644 --- a/packages/ui/src/components/ui/dialog.tsx +++ b/packages/ui/src/components/ui/dialog.tsx @@ -22,7 +22,7 @@ const DialogOverlay = React.forwardRef< ref={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 + className, )} {...props} /> @@ -39,7 +39,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 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 + className, )} {...props} > @@ -60,7 +60,7 @@ const DialogHeader = ({
@@ -74,7 +74,7 @@ const DialogFooter = ({
@@ -89,7 +89,7 @@ const DialogTitle = React.forwardRef< ref={ref} className={cn( "text-lg font-semibold leading-none tracking-tight", - className + className, )} {...props} /> diff --git a/packages/ui/src/components/ui/dropdown-menu.tsx b/packages/ui/src/components/ui/dropdown-menu.tsx index 524d436..caee0c9 100644 --- a/packages/ui/src/components/ui/dropdown-menu.tsx +++ b/packages/ui/src/components/ui/dropdown-menu.tsx @@ -29,7 +29,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-accent data-[state=open]:bg-accent", inset && "pl-8", - className + className, )} {...props} > @@ -48,7 +48,7 @@ const DropdownMenuSubContent = React.forwardRef< ref={ref} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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", - className + className, )} {...props} /> @@ -66,7 +66,7 @@ const DropdownMenuContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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", - className + className, )} {...props} /> @@ -85,7 +85,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-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", - className + className, )} {...props} /> @@ -100,7 +100,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-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} checked={checked} {...props} @@ -124,7 +124,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-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - className + className, )} {...props} > @@ -149,7 +149,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/packages/ui/src/components/ui/popover.tsx b/packages/ui/src/components/ui/popover.tsx index bb53d16..16d38d8 100644 --- a/packages/ui/src/components/ui/popover.tsx +++ b/packages/ui/src/components/ui/popover.tsx @@ -20,7 +20,7 @@ const PopoverContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground 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", - className + className, )} {...props} /> diff --git a/packages/ui/src/components/ui/scroll-area.tsx b/packages/ui/src/components/ui/scroll-area.tsx index d44186e..c997379 100644 --- a/packages/ui/src/components/ui/scroll-area.tsx +++ b/packages/ui/src/components/ui/scroll-area.tsx @@ -36,7 +36,7 @@ const ScrollBar = React.forwardRef< "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", - className + className, )} {...props} > diff --git a/packages/ui/src/components/ui/sheet.tsx b/packages/ui/src/components/ui/sheet.tsx index 39a6e1b..3eb103f 100644 --- a/packages/ui/src/components/ui/sheet.tsx +++ b/packages/ui/src/components/ui/sheet.tsx @@ -1,8 +1,9 @@ "use client" import * as React from "react" +import type { VariantProps } from "class-variance-authority" import * as SheetPrimitive from "@radix-ui/react-dialog" -import { cva, type VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" import { X } from "lucide-react" import { cn } from "@acme/helpers" @@ -22,7 +23,7 @@ const SheetOverlay = React.forwardRef< @@ -95,7 +96,7 @@ const SheetFooter = ({
diff --git a/packages/ui/src/components/ui/table.tsx b/packages/ui/src/components/ui/table.tsx index 1d15c0c..292287a 100644 --- a/packages/ui/src/components/ui/table.tsx +++ b/packages/ui/src/components/ui/table.tsx @@ -44,7 +44,7 @@ const TableFooter = React.forwardRef< ref={ref} className={cn( "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", - className + className, )} {...props} /> @@ -59,7 +59,7 @@ const TableRow = React.forwardRef< ref={ref} className={cn( "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", - className + className, )} {...props} /> @@ -74,7 +74,7 @@ const TableHead = React.forwardRef< ref={ref} className={cn( "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", - className + className, )} {...props} /> diff --git a/packages/ui/src/components/ui/tabs.tsx b/packages/ui/src/components/ui/tabs.tsx index 0adf565..613622f 100644 --- a/packages/ui/src/components/ui/tabs.tsx +++ b/packages/ui/src/components/ui/tabs.tsx @@ -15,7 +15,7 @@ const TabsList = React.forwardRef< ref={ref} className={cn( "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", - className + className, )} {...props} /> @@ -30,7 +30,7 @@ const TabsTrigger = React.forwardRef< ref={ref} className={cn( "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", - className + className, )} {...props} /> @@ -45,7 +45,7 @@ const TabsContent = React.forwardRef< ref={ref} className={cn( "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", - className + className, )} {...props} /> diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf6fc0c..ebd2d58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -270,6 +270,9 @@ importers: '@sindresorhus/slugify': specifier: 2.2.1 version: 2.2.1 + react: + specifier: 18.2.0 + version: 18.2.0 devDependencies: '@acme/eslint-config': specifier: workspace:*