Skip to content

Commit 81ef281

Browse files
committed
Update shadcn components & apply lint and format rules
1 parent f54bf12 commit 81ef281

26 files changed

+571
-538
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ build
33
coverage
44

55
app/frontend/routes
6-
app/frontend/components/ui

app/frontend/components/ui/avatar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
22

3-
import type * as React from "react"
43
import * as AvatarPrimitive from "@radix-ui/react-avatar"
4+
import type * as React from "react"
55

66
import { cn } from "@/lib/utils"
77

@@ -14,7 +14,7 @@ function Avatar({
1414
data-slot="avatar"
1515
className={cn(
1616
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
17-
className
17+
className,
1818
)}
1919
{...props}
2020
/>
@@ -43,7 +43,7 @@ function AvatarFallback({
4343
data-slot="avatar-fallback"
4444
className={cn(
4545
"bg-muted flex size-full items-center justify-center rounded-full",
46-
className
46+
className,
4747
)}
4848
{...props}
4949
/>

app/frontend/components/ui/badge.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type * as React from "react"
21
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
2+
import { type VariantProps, cva } from "class-variance-authority"
3+
import type * as React from "react"
44

55
import { cn } from "@/lib/utils"
66

@@ -14,15 +14,15 @@ const badgeVariants = cva(
1414
secondary:
1515
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1616
destructive:
17-
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
17+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70",
1818
outline:
1919
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
2020
},
2121
},
2222
defaultVariants: {
2323
variant: "default",
2424
},
25-
}
25+
},
2626
)
2727

2828
function Badge({

app/frontend/components/ui/breadcrumb.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type * as React from "react"
21
import { Slot } from "@radix-ui/react-slot"
32
import { ChevronRight, MoreHorizontal } from "lucide-react"
3+
import type * as React from "react"
44

55
import { cn } from "@/lib/utils"
66

@@ -14,7 +14,7 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
1414
data-slot="breadcrumb-list"
1515
className={cn(
1616
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
17-
className
17+
className,
1818
)}
1919
{...props}
2020
/>

app/frontend/components/ui/button.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
import type * as React from "react"
21
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
2+
import { type VariantProps, cva } from "class-variance-authority"
3+
import type * as React from "react"
44

55
import { cn } from "@/lib/utils"
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
99
{
1010
variants: {
1111
variant: {
1212
default:
1313
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
1414
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
15+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1616
outline:
17-
"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
17+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1818
secondary:
1919
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
20-
ghost: "hover:bg-accent hover:text-accent-foreground",
20+
ghost:
21+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
2122
link: "text-primary underline-offset-4 hover:underline",
2223
},
2324
size: {
@@ -31,7 +32,7 @@ const buttonVariants = cva(
3132
variant: "default",
3233
size: "default",
3334
},
34-
}
35+
},
3536
)
3637

3738
function Button({

app/frontend/components/ui/card.tsx

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
88
data-slot="card"
99
className={cn(
1010
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
11-
className
11+
className,
1212
)}
1313
{...props}
1414
/>
@@ -19,7 +19,10 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
1919
return (
2020
<div
2121
data-slot="card-header"
22-
className={cn("flex flex-col gap-1.5 px-6", className)}
22+
className={cn(
23+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
24+
className,
25+
)}
2326
{...props}
2427
/>
2528
)
@@ -45,6 +48,19 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
4548
)
4649
}
4750

51+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
52+
return (
53+
<div
54+
data-slot="card-action"
55+
className={cn(
56+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
57+
className,
58+
)}
59+
{...props}
60+
/>
61+
)
62+
}
63+
4864
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
4965
return (
5066
<div
@@ -59,10 +75,18 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
5975
return (
6076
<div
6177
data-slot="card-footer"
62-
className={cn("flex items-center px-6", className)}
78+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
6379
{...props}
6480
/>
6581
)
6682
}
6783

68-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
84+
export {
85+
Card,
86+
CardHeader,
87+
CardFooter,
88+
CardTitle,
89+
CardAction,
90+
CardDescription,
91+
CardContent,
92+
}

app/frontend/components/ui/checkbox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client"
22

3-
import type * as React from "react"
43
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
54
import { CheckIcon } from "lucide-react"
5+
import type * as React from "react"
66

77
import { cn } from "@/lib/utils"
88

@@ -14,8 +14,8 @@ function Checkbox({
1414
<CheckboxPrimitive.Root
1515
data-slot="checkbox"
1616
className={cn(
17-
"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
18-
className
17+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
18+
className,
1919
)}
2020
{...props}
2121
>

app/frontend/components/ui/dialog.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type * as React from "react"
21
import * as DialogPrimitive from "@radix-ui/react-dialog"
32
import { XIcon } from "lucide-react"
3+
import type * as React from "react"
44

55
import { cn } from "@/lib/utils"
66

@@ -36,8 +36,8 @@ function DialogOverlay({
3636
<DialogPrimitive.Overlay
3737
data-slot="dialog-overlay"
3838
className={cn(
39-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",
40-
className
39+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
40+
className,
4141
)}
4242
{...props}
4343
/>
@@ -56,7 +56,7 @@ function DialogContent({
5656
data-slot="dialog-content"
5757
className={cn(
5858
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
59-
className
59+
className,
6060
)}
6161
{...props}
6262
>
@@ -86,7 +86,7 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
8686
data-slot="dialog-footer"
8787
className={cn(
8888
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
89-
className
89+
className,
9090
)}
9191
{...props}
9292
/>

app/frontend/components/ui/dropdown-menu.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client"
22

3-
import type * as React from "react"
43
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
54
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
5+
import type * as React from "react"
66

77
import { cn } from "@/lib/utils"
88

@@ -42,8 +42,8 @@ function DropdownMenuContent({
4242
data-slot="dropdown-menu-content"
4343
sideOffset={sideOffset}
4444
className={cn(
45-
"bg-popover text-popover-foreground 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 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
46-
className
45+
"bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
46+
className,
4747
)}
4848
{...props}
4949
/>
@@ -74,8 +74,8 @@ function DropdownMenuItem({
7474
data-inset={inset}
7575
data-variant={variant}
7676
className={cn(
77-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-foreground data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/40 data-[variant=destructive]:focus:text-destructive-foreground data-[variant=destructive]:*:[svg]:!text-destructive-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
78-
className
77+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
78+
className,
7979
)}
8080
{...props}
8181
/>
@@ -93,7 +93,7 @@ function DropdownMenuCheckboxItem({
9393
data-slot="dropdown-menu-checkbox-item"
9494
className={cn(
9595
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
96-
className
96+
className,
9797
)}
9898
checked={checked}
9999
{...props}
@@ -129,7 +129,7 @@ function DropdownMenuRadioItem({
129129
data-slot="dropdown-menu-radio-item"
130130
className={cn(
131131
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
132-
className
132+
className,
133133
)}
134134
{...props}
135135
>
@@ -156,7 +156,7 @@ function DropdownMenuLabel({
156156
data-inset={inset}
157157
className={cn(
158158
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
159-
className
159+
className,
160160
)}
161161
{...props}
162162
/>
@@ -185,7 +185,7 @@ function DropdownMenuShortcut({
185185
data-slot="dropdown-menu-shortcut"
186186
className={cn(
187187
"text-muted-foreground ml-auto text-xs tracking-widest",
188-
className
188+
className,
189189
)}
190190
{...props}
191191
/>
@@ -212,7 +212,7 @@ function DropdownMenuSubTrigger({
212212
data-inset={inset}
213213
className={cn(
214214
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
215-
className
215+
className,
216216
)}
217217
{...props}
218218
>
@@ -230,8 +230,8 @@ function DropdownMenuSubContent({
230230
<DropdownMenuPrimitive.SubContent
231231
data-slot="dropdown-menu-sub-content"
232232
className={cn(
233-
"bg-popover text-popover-foreground 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 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg",
234-
className
233+
"bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
234+
className,
235235
)}
236236
{...props}
237237
/>

app/frontend/components/ui/input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
88
type={type}
99
data-slot="input"
1010
className={cn(
11-
"border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
11+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1212
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
1313
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14-
className
14+
className,
1515
)}
1616
{...props}
1717
/>

0 commit comments

Comments
 (0)