From b2cb6c089c9704e5edbbbde7625939a7d7a68696 Mon Sep 17 00:00:00 2001 From: aidanCQ Date: Mon, 30 Sep 2024 15:22:51 +0100 Subject: [PATCH] fix(): More colour improvements. --- src/shadcn/ui/alert-dialog.tsx | 2 +- src/shadcn/ui/drawer.tsx | 61 +++++++++++++++++++--------------- src/shadcn/ui/sheet.tsx | 56 +++++++++++++++---------------- src/tokens.css | 16 ++++----- 4 files changed, 71 insertions(+), 64 deletions(-) diff --git a/src/shadcn/ui/alert-dialog.tsx b/src/shadcn/ui/alert-dialog.tsx index e989674..1200387 100644 --- a/src/shadcn/ui/alert-dialog.tsx +++ b/src/shadcn/ui/alert-dialog.tsx @@ -36,7 +36,7 @@ const AlertDialogContent = React.forwardRef< -) -Drawer.displayName = "Drawer" +); +Drawer.displayName = "Drawer"; -const DrawerTrigger = DrawerPrimitive.Trigger +const DrawerTrigger = DrawerPrimitive.Trigger; -const DrawerPortal = DrawerPrimitive.Portal +const DrawerPortal = DrawerPrimitive.Portal; -const DrawerClose = DrawerPrimitive.Close +const DrawerClose = DrawerPrimitive.Close; const DrawerOverlay = React.forwardRef< React.ElementRef, @@ -28,11 +28,11 @@ const DrawerOverlay = React.forwardRef< >(({ className, ...props }, ref) => ( -)) -DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName +)); +DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName; const DrawerContent = React.forwardRef< React.ElementRef, @@ -48,12 +48,12 @@ const DrawerContent = React.forwardRef< )} {...props} > -
+
{children} -)) -DrawerContent.displayName = "DrawerContent" +)); +DrawerContent.displayName = "DrawerContent"; const DrawerHeader = ({ className, @@ -63,8 +63,8 @@ const DrawerHeader = ({ className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...props} /> -) -DrawerHeader.displayName = "DrawerHeader" +); +DrawerHeader.displayName = "DrawerHeader"; const DrawerFooter = ({ className, @@ -74,8 +74,8 @@ const DrawerFooter = ({ className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} /> -) -DrawerFooter.displayName = "DrawerFooter" +); +DrawerFooter.displayName = "DrawerFooter"; const DrawerTitle = React.forwardRef< React.ElementRef, @@ -89,8 +89,8 @@ const DrawerTitle = React.forwardRef< )} {...props} /> -)) -DrawerTitle.displayName = DrawerPrimitive.Title.displayName +)); +DrawerTitle.displayName = DrawerPrimitive.Title.displayName; const DrawerDescription = React.forwardRef< React.ElementRef, @@ -101,11 +101,18 @@ const DrawerDescription = React.forwardRef< className={cn("text-sm text-muted-foreground", className)} {...props} /> -)) -DrawerDescription.displayName = DrawerPrimitive.Description.displayName +)); +DrawerDescription.displayName = DrawerPrimitive.Description.displayName; export { - Drawer, DrawerClose, - DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger -} - + Drawer, + DrawerClose, + DrawerContent, + DrawerDescription, + DrawerFooter, + DrawerHeader, + DrawerOverlay, + DrawerPortal, + DrawerTitle, + DrawerTrigger, +}; diff --git a/src/shadcn/ui/sheet.tsx b/src/shadcn/ui/sheet.tsx index e5eed5b..46e7654 100644 --- a/src/shadcn/ui/sheet.tsx +++ b/src/shadcn/ui/sheet.tsx @@ -1,19 +1,19 @@ -"use client" +"use client"; -import * as React from "react" -import * as SheetPrimitive from "@radix-ui/react-dialog" -import { Cross2Icon } from "@radix-ui/react-icons" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import * as SheetPrimitive from "@radix-ui/react-dialog"; +import { Cross2Icon } from "@radix-ui/react-icons"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "src/utils" +import { cn } from "src/utils"; -const Sheet = SheetPrimitive.Root +const Sheet = SheetPrimitive.Root; -const SheetTrigger = SheetPrimitive.Trigger +const SheetTrigger = SheetPrimitive.Trigger; -const SheetClose = SheetPrimitive.Close +const SheetClose = SheetPrimitive.Close; -const SheetPortal = SheetPrimitive.Portal +const SheetPortal = SheetPrimitive.Portal; const SheetOverlay = React.forwardRef< React.ElementRef, @@ -21,14 +21,14 @@ const SheetOverlay = React.forwardRef< >(({ className, ...props }, ref) => ( -)) -SheetOverlay.displayName = SheetPrimitive.Overlay.displayName +)); +SheetOverlay.displayName = SheetPrimitive.Overlay.displayName; const sheetVariants = cva( "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", @@ -47,7 +47,7 @@ const sheetVariants = cva( side: "right", }, } -) +); interface SheetContentProps extends React.ComponentPropsWithoutRef, @@ -65,14 +65,14 @@ const SheetContent = React.forwardRef< {...props} > {children} - - - Close + + + Close -)) -SheetContent.displayName = SheetPrimitive.Content.displayName +)); +SheetContent.displayName = SheetPrimitive.Content.displayName; const SheetHeader = ({ className, @@ -85,8 +85,8 @@ const SheetHeader = ({ )} {...props} /> -) -SheetHeader.displayName = "SheetHeader" +); +SheetHeader.displayName = "SheetHeader"; const SheetFooter = ({ className, @@ -99,8 +99,8 @@ const SheetFooter = ({ )} {...props} /> -) -SheetFooter.displayName = "SheetFooter" +); +SheetFooter.displayName = "SheetFooter"; const SheetTitle = React.forwardRef< React.ElementRef, @@ -111,8 +111,8 @@ const SheetTitle = React.forwardRef< className={cn("text-lg font-semibold text-foreground", className)} {...props} /> -)) -SheetTitle.displayName = SheetPrimitive.Title.displayName +)); +SheetTitle.displayName = SheetPrimitive.Title.displayName; const SheetDescription = React.forwardRef< React.ElementRef, @@ -123,8 +123,8 @@ const SheetDescription = React.forwardRef< className={cn("text-sm text-muted-foreground", className)} {...props} /> -)) -SheetDescription.displayName = SheetPrimitive.Description.displayName +)); +SheetDescription.displayName = SheetPrimitive.Description.displayName; export { Sheet, @@ -137,4 +137,4 @@ export { SheetFooter, SheetTitle, SheetDescription, -} +}; diff --git a/src/tokens.css b/src/tokens.css index 0a86ce5..27b2815 100644 --- a/src/tokens.css +++ b/src/tokens.css @@ -37,16 +37,16 @@ :root [data-theme="dark"] { color-scheme: dark; - --background-sunk: 240 10% 10%; - --background: 240 3.7% 12.9%; + --background-sunk: 240 10% 6%; + --background: 240 3.7% 12%; --foreground: 0 0% 100%; - --card: 240 3.7% 12.9%; + --card: 240 3.7% 12%; --card-foreground: 0 0% 100%; - --popover: 240 3.7% 12.9%; + --popover: 240 3.7% 12%; --popover-foreground: 0 0% 100%; --primary: 0 0% 100%; - --primary-foreground: 240 3.7% 12.9%; - --secondary: 240 3.7% 12.9%; + --primary-foreground: 240 3.7% 12%; + --secondary: 240 3.7% 12%; --secondary-foreground: 0 0% 100%; --muted: 240 5.3% 26.1%; --muted-foreground: 240 4.9% 83.9%; @@ -54,8 +54,8 @@ --accent-foreground: 0 0% 98%; --destructive: 0 62.8% 30.6%; --destructive-foreground: 0 0% 100%; - --border: 240 5.3% 26.1%; - --input: 240 5.2% 22.9%; + --border: 240 5.3% 17.9%; + --input: 240 5.2% 20.9%; --ring: 240 5.9% 90%; --chart-1: 220 70% 50%; --chart-2: 160 60% 45%;