New Login Page (#1504)

This commit is contained in:
Luke Vella 2025-01-21 18:07:13 +00:00 committed by GitHub
parent 655f38203a
commit f5ab25ed1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 1669 additions and 713 deletions

View file

@ -10,28 +10,27 @@ import { cn } from "./lib/utils";
const buttonVariants = cva(
cn(
"inline-flex border font-medium disabled:pointer-events-none select-none disabled:opacity-50 items-center justify-center whitespace-nowrap border",
"focus-visible:ring-offset-input-background",
"focus:shadow-none",
"focus:shadow-none focus-visible:ring-2 focus-visible:ring-ring",
),
{
variants: {
variant: {
primary:
"border-primary-700 bg-primary disabled:bg-gray-400 disabled:border-transparent text-primary-foreground shadow-sm focus:bg-primary-500",
"focus:ring-offset-1 border-primary-700 bg-primary hover:bg-primary-700 disabled:bg-gray-400 active:bg-primary-800 disabled:border-transparent text-primary-foreground shadow-sm",
destructive:
"bg-destructive shadow-sm text-destructive-foreground focus-visible:ring-offset-1 active:bg-destructive border-destructive hover:bg-destructive/90",
"focus:ring-offset-1 bg-destructive shadow-sm text-destructive-foreground active:bg-destructive border-destructive hover:bg-destructive/90",
default:
"ring-1 ring-inset ring-white/25 data-[state=open]:bg-gray-100 focus:border-gray-300 focus:bg-gray-200 hover:bg-gray-100 bg-gray-50",
"focus:ring-offset-1 hover:bg-gray-100 bg-gray-50 active:bg-gray-200",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
"focus:ring-offset-1 bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost:
"border-transparent bg-transparent text-gray-800 hover:bg-gray-100 focus:bg-gray-200",
"border-transparent bg-transparent data-[state=open]:bg-gray-500/20 text-gray-800 hover:bg-gray-500/10 active:bg-gray-500/20",
link: "underline-offset-4 border-transparent hover:underline text-primary",
},
size: {
default: "h-9 px-2.5 pr-3 gap-x-2 text-sm rounded-md",
default: "h-9 pl-2.5 pr-3 gap-x-2 text-sm rounded-md",
sm: "h-7 text-sm px-1.5 gap-x-1.5 rounded-md",
lg: "h-11 text-base gap-x-3 px-4 rounded-md",
lg: "h-12 text-base gap-x-3 px-4 rounded-md",
},
},
defaultVariants: {

View file

@ -0,0 +1,56 @@
import { useId } from "react";
import { cn } from "./lib/utils";
interface DotPatternProps {
width?: number;
height?: number;
x?: number;
y?: number;
cx?: number;
cy?: number;
cr?: number;
className?: string;
[key: string]: unknown;
}
export function DotPattern({
width = 16,
height = 16,
x = 0,
y = 0,
cx = 1,
cy = 1,
cr = 1,
className,
...props
}: DotPatternProps) {
const id = useId();
return (
<svg
aria-hidden="true"
className={cn(
"pointer-events-none absolute inset-0 h-full w-full fill-gray-300",
className,
)}
{...props}
>
<defs>
<pattern
id={id}
width={width}
height={height}
patternUnits="userSpaceOnUse"
patternContentUnits="userSpaceOnUse"
x={x}
y={y}
>
<circle id="pattern-circle" cx={cx} cy={cy} r={cr} />
</pattern>
</defs>
<rect width="100%" height="100%" strokeWidth={0} fill={`url(#${id})`} />
</svg>
);
}
export default DotPattern;

View file

@ -82,12 +82,12 @@ const FormLabel = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
>(({ className, ...props }, ref) => {
const { error, formItemId } = useFormField();
const { formItemId } = useFormField();
return (
<Label
ref={ref}
className={cn(error && "text-destructive", className)}
className={cn("text-sm font-medium", className)}
htmlFor={formItemId}
{...props}
/>

View file

@ -13,7 +13,7 @@ export type InputProps = Omit<
const inputVariants = cva(
cn(
"w-full focus-visible:border-primary-400 focus-visible:ring-offset-1 focus-visible:outline-none focus-visible:ring-primary-200 focus-visible:ring-1",
"w-full focus-visible:border-gray-300 focus:ring-ring focus:ring-2",
"border-input placeholder:text-muted-foreground h-9 rounded-md border bg-white file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50",
),
{
@ -21,7 +21,7 @@ const inputVariants = cva(
size: {
sm: "h-7 text-xs px-1",
md: "h-9 text-sm px-2",
lg: "h-12 text-lg px-3",
lg: "h-12 text-base px-3",
},
variant: {
default: "border-primary-400 focus-visible:border-primary-400",

View file

@ -8,7 +8,7 @@ import * as React from "react";
import { cn } from "./lib/utils";
const labelVariants = cva(
"text-sm text-muted-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
"text-sm text-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
);
const Label = React.forwardRef<