diff --git a/e-voting-system/.backups/frontend-old/src/lib/ui/alert.jsx b/e-voting-system/.backups/frontend-old/src/lib/ui/alert.jsx new file mode 100644 index 0000000..3ea3e28 --- /dev/null +++ b/e-voting-system/.backups/frontend-old/src/lib/ui/alert.jsx @@ -0,0 +1,55 @@ +import * as React from "react" +import { cva } from "class-variance-authority" +import { cn } from "../utils" + +const alertVariants = cva( + "relative w-full rounded-lg border p-4", + { + variants: { + variant: { + default: "bg-bg-secondary text-text-primary border-text-tertiary", + destructive: + "border-danger/50 text-danger dark:border-danger [&>svg]:text-danger", + success: + "border-success/50 text-success dark:border-success [&>svg]:text-success", + warning: + "border-warning/50 text-warning dark:border-warning [&>svg]:text-warning", + info: + "border-info/50 text-info dark:border-info [&>svg]:text-info", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +const Alert = React.forwardRef(({ className, variant, ...props }, ref) => ( +
+)) +Alert.displayName = "Alert" + +const AlertTitle = React.forwardRef(({ className, ...props }, ref) => ( +
+)) +AlertTitle.displayName = "AlertTitle" + +const AlertDescription = React.forwardRef(({ className, ...props }, ref) => ( +
+)) +AlertDescription.displayName = "AlertDescription" + +export { Alert, AlertTitle, AlertDescription } diff --git a/e-voting-system/.backups/frontend-old/src/lib/ui/badge.jsx b/e-voting-system/.backups/frontend-old/src/lib/ui/badge.jsx new file mode 100644 index 0000000..9a5b65d --- /dev/null +++ b/e-voting-system/.backups/frontend-old/src/lib/ui/badge.jsx @@ -0,0 +1,41 @@ +import * as React from "react" +import { cva } from "class-variance-authority" +import { cn } from "../utils" + +const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-accent-warm focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-text-tertiary bg-bg-secondary text-text-primary hover:bg-bg-overlay-light", + secondary: + "border-text-tertiary text-text-secondary hover:bg-bg-overlay-light", + destructive: + "border-danger/50 bg-danger/10 text-danger hover:bg-danger/20", + outline: "text-text-primary border-text-tertiary", + success: + "border-success/50 bg-success/10 text-success hover:bg-success/20", + warning: + "border-warning/50 bg-warning/10 text-warning hover:bg-warning/20", + info: + "border-info/50 bg-info/10 text-info hover:bg-info/20", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Badge({ + className, + variant, + ...props +}) { + return ( +
+ ) +} + +export { Badge, badgeVariants } diff --git a/e-voting-system/.backups/frontend-old/src/lib/ui/button.jsx b/e-voting-system/.backups/frontend-old/src/lib/ui/button.jsx new file mode 100644 index 0000000..2c691df --- /dev/null +++ b/e-voting-system/.backups/frontend-old/src/lib/ui/button.jsx @@ -0,0 +1,57 @@ +import * as React from "react" +import { cva } from "class-variance-authority" +import { cn } from "../utils" + +const buttonVariants = cva( + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-bg-secondary transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-warm focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + { + variants: { + variant: { + default: + "bg-accent-warm text-white hover:bg-opacity-90 active:bg-opacity-80", + destructive: + "bg-danger text-white hover:bg-opacity-90 active:bg-opacity-80", + outline: + "border border-text-tertiary hover:bg-bg-overlay-light hover:text-text-primary", + secondary: + "bg-bg-secondary text-text-primary border border-text-tertiary hover:bg-bg-overlay-light", + ghost: + "hover:bg-bg-overlay-light hover:text-text-primary", + link: + "text-accent-warm underline-offset-4 hover:underline", + success: + "bg-success text-white hover:bg-opacity-90 active:bg-opacity-80", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3 text-xs", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +) + +const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => { + if (asChild && props.children && React.isValidElement(props.children)) { + return React.cloneElement(props.children, { + className: cn(buttonVariants({ variant, size }), props.children.props.className), + ref, + }) + } + + return ( +