Skip to content

Commit 8e4cf1c

Browse files
committed
feat: Adding UDS components relevent to login screens
1 parent dd77c4c commit 8e4cf1c

File tree

14 files changed

+969
-13
lines changed

14 files changed

+969
-13
lines changed

components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

package-lock.json

Lines changed: 128 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
},
1616
"dependencies": {
1717
"@auth0/auth0-acul-js": "^0.1.0-beta.5",
18+
"@base-ui-components/react": "^1.0.0-beta.1",
19+
"class-variance-authority": "^0.7.1",
1820
"clsx": "^2.1.1",
21+
"lucide-react": "^0.525.0",
1922
"react": "^19.1.0",
2023
"react-dom": "^19.1.0",
2124
"react-hook-form": "^7.57.0",
22-
"tailwind-merge": "^3.3.0"
25+
"tailwind-merge": "^3.3.1"
2326
},
2427
"devDependencies": {
2528
"@tailwindcss/postcss": "^4.1.6",
@@ -33,6 +36,7 @@
3336
"postcss": "^8.5.3",
3437
"prettier": "3.5.3",
3538
"tailwindcss": "^4.1.6",
39+
"tw-animate-css": "^1.3.5",
3640
"typescript": "~5.8.3",
3741
"vite": "^6.3.5"
3842
},

src/components/ui/alert.tsx

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { cva, type VariantProps } from "class-variance-authority";
2+
import * as React from "react";
3+
import { cn } from "@/lib/utils";
4+
5+
const alertVariants = cva(
6+
"shadow-input-hover bg-input relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 overflow-clip rounded-3xl p-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
7+
{
8+
variants: {
9+
variant: {
10+
default: "text-foreground border-b-2 border-transparent",
11+
info: "text-info-foreground [&>svg]:text-info-foreground",
12+
success: "text-success-foreground [&>svg]:text-success-foreground",
13+
warning: "text-warning-foreground [&>svg]:text-warning-foreground",
14+
destructive:
15+
"text-destructive-foreground [&>svg]:text-destructive-foreground",
16+
},
17+
},
18+
defaultVariants: {
19+
variant: "default",
20+
},
21+
},
22+
);
23+
24+
function Alert({
25+
className,
26+
variant,
27+
...props
28+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
29+
return (
30+
<div
31+
data-slot="alert"
32+
role="alert"
33+
className={cn(alertVariants({ variant }), className)}
34+
{...props}
35+
/>
36+
);
37+
}
38+
39+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
40+
return (
41+
<div
42+
data-slot="alert-title"
43+
className={cn(
44+
"col-start-2 line-clamp-1 flex h-auto min-h-4 leading-4.5 font-medium tracking-tight",
45+
className,
46+
)}
47+
{...props}
48+
/>
49+
);
50+
}
51+
function AlertDescription({
52+
className,
53+
...props
54+
}: React.ComponentProps<"div">) {
55+
return (
56+
<div
57+
data-slot="alert-description"
58+
className={cn(
59+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
60+
className,
61+
)}
62+
{...props}
63+
/>
64+
);
65+
}
66+
67+
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
68+
return (
69+
<div
70+
className={cn(
71+
"absolute top-2 right-2 flex items-center space-x-4",
72+
className,
73+
)}
74+
{...props}
75+
/>
76+
);
77+
}
78+
79+
export { Alert, AlertTitle, AlertDescription, AlertAction };

0 commit comments

Comments
 (0)