Skip to content

Commit c9b989d

Browse files
committed
chore: upgrade shadcn components
1 parent fbfeffa commit c9b989d

File tree

17 files changed

+1782
-786
lines changed

17 files changed

+1782
-786
lines changed

apps/web/app/globals.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
--ring: 0 0% 3.9%;
3434

3535
--radius: 0.5rem;
36+
37+
--chart-1: 12 76% 61%;
38+
39+
--chart-2: 173 58% 39%;
40+
41+
--chart-3: 197 37% 24%;
42+
43+
--chart-4: 43 74% 66%;
44+
45+
--chart-5: 27 87% 67%;
3646
}
3747

3848
.dark {
@@ -54,15 +64,20 @@
5464
--muted: 0 0% 14.9%;
5565
--muted-foreground: 0 0% 63.9%;
5666

57-
--accent: 217.2 32.6% 17.5%;
58-
--accent-foreground: 210 40% 98%;
67+
--accent: 0 0% 14.9%;
68+
--accent-foreground: 0 0% 98%;
5969

6070
--destructive: 0 62.8% 30.6%;
6171
--destructive-foreground: 0 0% 98%;
6272

6373
--border: 0 0% 14.9%;
6474
--input: 0 0% 14.9%;
6575
--ring: 0 0% 83.1%;
76+
--chart-1: 220 70% 50%;
77+
--chart-2: 160 60% 45%;
78+
--chart-3: 30 80% 55%;
79+
--chart-4: 280 65% 60%;
80+
--chart-5: 340 75% 55%;
6681
}
6782
}
6883

apps/web/components.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
},
1313
"aliases": {
1414
"components": "@/components",
15-
"utils": "@/lib/utils"
16-
}
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
1721
}

apps/web/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
55
import { cn } from "@/lib/utils"
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
99
{
1010
variants: {
1111
variant: {

apps/web/components/ui/calendar.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-unused-vars */
21
"use client"
32

43
import * as React from "react"
@@ -47,16 +46,20 @@ function Calendar({
4746
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
4847
day_today: "bg-accent text-accent-foreground",
4948
day_outside:
50-
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
49+
"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
5150
day_disabled: "text-muted-foreground opacity-50",
5251
day_range_middle:
5352
"aria-selected:bg-accent aria-selected:text-accent-foreground",
5453
day_hidden: "invisible",
5554
...classNames,
5655
}}
5756
components={{
58-
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
59-
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
57+
IconLeft: ({ className, ...props }) => (
58+
<ChevronLeft className={cn("h-4 w-4", className)} {...props} />
59+
),
60+
IconRight: ({ className, ...props }) => (
61+
<ChevronRight className={cn("h-4 w-4", className)} {...props} />
62+
),
6063
}}
6164
{...props}
6265
/>

apps/web/components/ui/card.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ const CardHeader = React.forwardRef<
3030
CardHeader.displayName = "CardHeader"
3131

3232
const CardTitle = React.forwardRef<
33-
HTMLParagraphElement,
34-
React.HTMLAttributes<HTMLHeadingElement>
33+
HTMLDivElement,
34+
React.HTMLAttributes<HTMLDivElement>
3535
>(({ className, ...props }, ref) => (
36-
<h3
36+
<div
3737
ref={ref}
3838
className={cn(
3939
"text-2xl font-semibold leading-none tracking-tight",
@@ -45,10 +45,10 @@ const CardTitle = React.forwardRef<
4545
CardTitle.displayName = "CardTitle"
4646

4747
const CardDescription = React.forwardRef<
48-
HTMLParagraphElement,
49-
React.HTMLAttributes<HTMLParagraphElement>
48+
HTMLDivElement,
49+
React.HTMLAttributes<HTMLDivElement>
5050
>(({ className, ...props }, ref) => (
51-
<p
51+
<div
5252
ref={ref}
5353
className={cn("text-sm text-muted-foreground", className)}
5454
{...props}

apps/web/components/ui/command.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ const Command = React.forwardRef<
2323
))
2424
Command.displayName = CommandPrimitive.displayName
2525

26-
interface CommandDialogProps extends DialogProps {}
27-
28-
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
26+
const CommandDialog = ({ children, ...props }: DialogProps) => {
2927
return (
3028
<Dialog {...props}>
3129
<DialogContent className="overflow-hidden p-0 shadow-lg">
@@ -117,7 +115,7 @@ const CommandItem = React.forwardRef<
117115
<CommandPrimitive.Item
118116
ref={ref}
119117
className={cn(
120-
"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",
118+
"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",
121119
className
122120
)}
123121
{...props}

apps/web/components/ui/dropdown-menu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ const DropdownMenuSubTrigger = React.forwardRef<
2727
<DropdownMenuPrimitive.SubTrigger
2828
ref={ref}
2929
className={cn(
30-
"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",
30+
"flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
3131
inset && "pl-8",
3232
className
3333
)}
3434
{...props}
3535
>
3636
{children}
37-
<ChevronRight className="ml-auto h-4 w-4" />
37+
<ChevronRight className="ml-auto" />
3838
</DropdownMenuPrimitive.SubTrigger>
3939
))
4040
DropdownMenuSubTrigger.displayName =
@@ -83,7 +83,7 @@ const DropdownMenuItem = React.forwardRef<
8383
<DropdownMenuPrimitive.Item
8484
ref={ref}
8585
className={cn(
86-
"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",
86+
"relative flex cursor-default select-none items-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8787
inset && "pl-8",
8888
className
8989
)}

apps/web/components/ui/form.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client"
2+
13
import * as React from "react"
24
import * as LabelPrimitive from "@radix-ui/react-label"
35
import { Slot } from "@radix-ui/react-slot"

apps/web/components/ui/input.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ import * as React from "react"
22

33
import { cn } from "@/lib/utils"
44

5-
export interface InputProps
6-
extends React.InputHTMLAttributes<HTMLInputElement> {}
7-
8-
const Input = React.forwardRef<HTMLInputElement, InputProps>(
5+
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
96
({ className, type, ...props }, ref) => {
107
return (
118
<input
129
type={type}
1310
className={cn(
14-
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
11+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1512
className
1613
)}
1714
ref={ref}

apps/web/components/ui/textarea.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@ import * as React from "react"
22

33
import { cn } from "@/lib/utils"
44

5-
export interface TextareaProps
6-
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
7-
8-
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
9-
({ className, ...props }, ref) => {
10-
return (
11-
<textarea
12-
className={cn(
13-
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
14-
className
15-
)}
16-
ref={ref}
17-
{...props}
18-
/>
19-
)
20-
}
21-
)
5+
const Textarea = React.forwardRef<
6+
HTMLTextAreaElement,
7+
React.ComponentProps<"textarea">
8+
>(({ className, ...props }, ref) => {
9+
return (
10+
<textarea
11+
className={cn(
12+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
13+
className
14+
)}
15+
ref={ref}
16+
{...props}
17+
/>
18+
)
19+
})
2220
Textarea.displayName = "Textarea"
2321

2422
export { Textarea }

0 commit comments

Comments
 (0)