Skip to content

Commit

Permalink
fix(): colour test
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Sep 26, 2024
1 parent 63be835 commit b60e80c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
26 changes: 13 additions & 13 deletions src/shadcn/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "src/utils"
import { cn } from "src/utils";

const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
"bg-primary text-primary-foreground shadow-sm hover:bg-primary/80",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
Expand All @@ -32,26 +32,26 @@ const buttonVariants = cva(
size: "default",
},
}
)
);

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
);
}
)
Button.displayName = "Button"
);
Button.displayName = "Button";

export { Button, buttonVariants }
export { Button, buttonVariants };
14 changes: 7 additions & 7 deletions src/shadcn/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"
import * as React from "react";

import { cn } from "src/utils"
import { cn } from "src/utils";

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
Expand All @@ -11,15 +11,15 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
)
);
}
)
Input.displayName = "Input"
);
Input.displayName = "Input";

export { Input }
export { Input };
22 changes: 11 additions & 11 deletions src/tokens.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--background: 0 0% 97%;
--foreground: 240 5.9% 10%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--card-foreground: 240 5.9% 10%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--popover-foreground: 240 5.9% 10%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
Expand All @@ -29,23 +29,23 @@
:root [data-theme="dark"] {
--background: 240 10% 3.9%;
--foreground: 0 0% 98%;
--card: 240 10% 3.9%;
--card: 240 10% 8%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover: 240 5.9% 10%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 240 3.7% 15.9%;
--secondary: 240 5.9% 10%;
--secondary-foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted: 240 5.9% 10%;
--muted-foreground: 240 5% 64.9%;
--accent: 240 3.7% 15.9%;
--accent: 240 5.9% 10%
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
--input: 240 5.3% 26.1%;
--ring: 240 3.7% 15.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
Expand Down
32 changes: 16 additions & 16 deletions stories/shadcn/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ import {

const CardDemo = () => {
return (
<Card className="w-[350px]">
<Card className='w-[350px]'>
<CardHeader>
<CardTitle>Create project</CardTitle>
<CardDescription>Deploy your new project in one-click.</CardDescription>
</CardHeader>
<CardContent>
<form>
<div className="grid w-full items-center gap-4">
<div className="flex flex-col space-y-1.5">
<Label htmlFor="name">Name</Label>
<Input id="name" placeholder="Name of your project" />
<div className='grid w-full items-center gap-4'>
<div className='flex flex-col space-y-1.5'>
<Label htmlFor='name'>Name</Label>
<Input id='name' placeholder='Name of your project' />
</div>
<div className="flex flex-col space-y-1.5">
<Label htmlFor="framework">Framework</Label>
<div className='flex flex-col space-y-1.5'>
<Label htmlFor='framework'>Framework</Label>
<Select>
<SelectTrigger id="framework">
<SelectValue placeholder="Select" />
<SelectTrigger id='framework'>
<SelectValue placeholder='Select' />
</SelectTrigger>
<SelectContent position="popper">
<SelectItem value="next">Next.js</SelectItem>
<SelectItem value="sveltekit">SvelteKit</SelectItem>
<SelectItem value="astro">Astro</SelectItem>
<SelectItem value="nuxt">Nuxt.js</SelectItem>
<SelectContent position='popper'>
<SelectItem value='next'>Next.js</SelectItem>
<SelectItem value='sveltekit'>SvelteKit</SelectItem>
<SelectItem value='astro'>Astro</SelectItem>
<SelectItem value='nuxt'>Nuxt.js</SelectItem>
</SelectContent>
</Select>
</div>
</div>
</form>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline">Cancel</Button>
<CardFooter className='flex justify-between'>
<Button variant='secondary'>Cancel</Button>
<Button>Deploy</Button>
</CardFooter>
</Card>
Expand Down

0 comments on commit b60e80c

Please sign in to comment.