Skip to content

Commit bf1cf22

Browse files
committed
Update Shadcn's button and reduce size of SVGs
1 parent e4b2640 commit bf1cf22

8 files changed

+28
-15
lines changed

components.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
"config": "tailwind.config.js",
88
"css": "src/index.css",
99
"baseColor": "slate",
10-
"cssVariables": true
10+
"cssVariables": true,
11+
"prefix": ""
1112
},
1213
"aliases": {
1314
"components": "@/components",
14-
"utils": "@/lib/utils"
15-
}
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
1621
}

src/components/library/BookMetadataDialog.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export const BookMetadataDialog = ({
253253

254254
<Button variant="ghostLink" size="sm" asChild>
255255
<AboutDialogLink to="?about=the-book-id">
256-
<LucideHelpCircle size={20} />
256+
<LucideHelpCircle />
257257
</AboutDialogLink>
258258
</Button>
259259
</div>
@@ -372,7 +372,7 @@ export const BookMetadataDialog = ({
372372

373373
<Button variant="ghostLink" size="sm" asChild>
374374
<AboutDialogLink to="?about=the-book-image">
375-
<LucideHelpCircle size={20} />
375+
<LucideHelpCircle />
376376
</AboutDialogLink>
377377
</Button>
378378
</div>

src/components/library/BookPageHeader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const BookPageHeader = ({
9898
size="sm"
9999
disabled={loading}
100100
>
101-
<LucideMoreHorizontal size={20} />
101+
<LucideMoreHorizontal />
102102
</Button>
103103
</DropdownMenuTrigger>
104104
</SuccessWrapper>

src/components/library/OptionsDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const OptionsDialog = ({
132132
title="Search settings"
133133
disabled={disabled}
134134
>
135-
<LucideSettings size={20} />
135+
<LucideSettings />
136136
</Button>
137137
</DialogTrigger>
138138

src/components/library/Privacy.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ export const Privacy = () => {
2323
.
2424
</div>
2525

26-
<Button variant="ghost" size="2xs" onClick={hideBanner}>
27-
<LucideX size={12} />
26+
<Button
27+
className="[&_svg]:size-3"
28+
variant="ghost"
29+
size="2xs"
30+
onClick={hideBanner}
31+
>
32+
<LucideX />
2833
</Button>
2934
</div>
3035
)

src/components/ui/button.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ 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 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+
// Changed `[&_svg]:size` from `4` to `5`
9+
"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-5 [&_svg]:shrink-0",
910
{
1011
variants: {
1112
variant: {
@@ -18,12 +19,12 @@ const buttonVariants = cva(
1819
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
1920
ghost: "hover:bg-accent hover:text-accent-foreground",
2021
link: "text-primary underline-offset-4 hover:underline",
21-
ghostLink: "hover:bg-accent",
22+
ghostLink: "hover:bg-accent", // added
2223
},
2324
size: {
2425
default: "h-10 px-4 py-2",
25-
"2xs": "h-5 rounded-sm px-1", // added manually
26-
xs: "h-7 rounded-sm px-3", // added manually
26+
"2xs": "h-5 rounded-sm px-1", // added
27+
xs: "h-7 rounded-sm px-3", // added
2728
sm: "h-9 rounded-md px-3",
2829
lg: "h-11 rounded-md px-8",
2930
icon: "h-10 w-10",

src/components/ui/dialog.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const DialogOverlay = React.forwardRef<
1919
<DialogPrimitive.Overlay
2020
ref={ref}
2121
className={cn(
22+
// Removed backdrop-blur to fix scroll lag in Firefox on Linux and Chrome on Android
2223
"fixed inset-0 z-50 bg-background/95 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
2324
className
2425
)}
@@ -29,6 +30,7 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
2930

3031
const DialogContent = React.forwardRef<
3132
React.ElementRef<typeof DialogPrimitive.Content>,
33+
// Added `notClosable`
3234
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { notClosable?: boolean }
3335
>(({ className, notClosable, children, ...props }, ref) => (
3436
<DialogPortal>
@@ -73,7 +75,7 @@ const DialogFooter = ({
7375
}: React.HTMLAttributes<HTMLDivElement>) => (
7476
<div
7577
className={cn(
76-
// changed manually
78+
// Changed gap
7779
"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",
7880
className
7981
)}

src/components/ui/input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from "react"
33

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

6-
// added manually
6+
// Created
77
const inputVariants = cva(
88
"flex w-full rounded-md border bg-background 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",
99
{

0 commit comments

Comments
 (0)