@oussemasahbeni/keycloakify-login-shadcn 250004.0.8 → 250004.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/keycloak-theme/components/ui/alert.tsx +69 -61
- package/keycloak-theme/components/ui/button.tsx +44 -38
- package/keycloak-theme/components/ui/card.tsx +60 -45
- package/keycloak-theme/components/ui/checkbox.tsx +24 -22
- package/keycloak-theme/components/ui/dropdown-menu.tsx +231 -176
- package/keycloak-theme/components/ui/field.tsx +51 -48
- package/keycloak-theme/components/ui/input-otp.tsx +56 -49
- package/keycloak-theme/components/ui/input.tsx +18 -21
- package/keycloak-theme/components/ui/label.tsx +19 -20
- package/keycloak-theme/components/ui/radio-group.tsx +27 -25
- package/keycloak-theme/components/ui/select.tsx +160 -121
- package/keycloak-theme/components/ui/separator.tsx +23 -23
- package/keycloak-theme/components/ui/tooltip.tsx +54 -24
- package/keycloak-theme/login/KcPage.tsx +0 -1
- package/keycloak-theme/login/components/Template/Template.tsx +2 -2
- package/keycloak-theme/login/index.css +3 -20
- package/keycloak-theme/login/pages/login/Form.tsx +49 -51
- package/keycloak-theme/login/pages/login/SocialProviders.tsx +9 -4
- package/keycloak-theme/login/pages/login/providers/github.svg +4 -3
- package/keycloak-theme/login/pages/login/providers/x.svg +4 -3
- package/keycloak-theme/login/pages/login/useProviderLogos.tsx +2 -3
- package/keycloak-theme/login/styleLevelCustomization.tsx +1 -0
- package/package.json +1 -1
|
@@ -1,81 +1,89 @@
|
|
|
1
|
+
import { cn } from "@/components/lib/utils";
|
|
1
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
3
|
import { AlertTriangle, Info, XCircle } from "lucide-react";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { MdCheckCircle } from "react-icons/md";
|
|
5
6
|
|
|
6
|
-
import { cn } from "@/components/lib/utils";
|
|
7
|
-
|
|
8
7
|
const alertVariants = cva(
|
|
9
|
-
"relative w-full rounded-lg border
|
|
8
|
+
"relative w-full rounded-lg border px-5 py-4 text-sm flex items-center gap-4 transition-all",
|
|
10
9
|
{
|
|
11
10
|
variants: {
|
|
12
11
|
variant: {
|
|
13
12
|
info: "bg-card text-card-foreground",
|
|
14
|
-
|
|
15
|
-
warning:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950/50 dark:text-green-300 [&>svg]:text-green-800 dark:[&>svg]:text-green-300"
|
|
19
|
-
}
|
|
13
|
+
success: "bg-emerald-50/50 border-emerald-200 text-emerald-900 dark:bg-emerald-500/5 dark:border-emerald-500/20 dark:text-emerald-400",
|
|
14
|
+
warning: "bg-amber-50/50 border-amber-200 text-amber-900 dark:bg-amber-500/5 dark:border-amber-500/20 dark:text-amber-400",
|
|
15
|
+
error: "bg-destructive/5 border-destructive/20 text-destructive",
|
|
16
|
+
},
|
|
20
17
|
},
|
|
21
18
|
defaultVariants: {
|
|
22
|
-
variant: "info"
|
|
23
|
-
}
|
|
19
|
+
variant: "info",
|
|
20
|
+
},
|
|
24
21
|
}
|
|
25
22
|
);
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
24
|
+
interface AlertProps
|
|
25
|
+
extends React.ComponentProps<"div">,
|
|
26
|
+
VariantProps<typeof alertVariants> {
|
|
27
|
+
showIcon?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function Alert({
|
|
31
|
+
className,
|
|
32
|
+
variant = "info",
|
|
33
|
+
showIcon = true,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: AlertProps) {
|
|
37
|
+
const Icon = {
|
|
38
|
+
info: Info,
|
|
39
|
+
error: XCircle,
|
|
40
|
+
warning: AlertTriangle,
|
|
41
|
+
success: MdCheckCircle,
|
|
42
|
+
}[variant as string] || Info;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
data-slot="alert"
|
|
47
|
+
role="alert"
|
|
48
|
+
className={cn(alertVariants({ variant }), className)}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{showIcon && <Icon className="size-5 shrink-0" data-slot="alert-icon" />}
|
|
52
|
+
{/* We use a div wrapper for children to ensure Title and Description stack vertically */}
|
|
53
|
+
<div className="flex flex-col gap-0.5 flex-1">
|
|
54
|
+
{children}
|
|
55
|
+
</div>
|
|
52
56
|
</div>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Alert.displayName = "Alert";
|
|
57
|
+
);
|
|
58
|
+
}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
data-slot="alert-title"
|
|
64
|
+
className={cn(
|
|
65
|
+
"font-medium leading-none tracking-tight",
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
function AlertDescription({
|
|
74
|
+
className,
|
|
75
|
+
...props
|
|
76
|
+
}: React.ComponentProps<"div">) {
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-slot="alert-description"
|
|
80
|
+
className={cn(
|
|
81
|
+
"text-muted-foreground text-sm [&_p]:leading-relaxed",
|
|
82
|
+
className
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
80
88
|
|
|
81
89
|
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -1,56 +1,62 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import * as React from "react"
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
4
5
|
|
|
5
|
-
import { cn } from "@/components/lib/utils";
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
13
|
destructive:
|
|
14
|
-
"bg-destructive text-destructive-
|
|
14
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
15
15
|
outline:
|
|
16
|
-
"border
|
|
16
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
17
17
|
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground
|
|
19
|
-
ghost:
|
|
20
|
-
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost:
|
|
20
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
22
|
},
|
|
22
23
|
size: {
|
|
23
|
-
default: "h-9 px-4 py-2",
|
|
24
|
-
sm: "h-8 rounded-md px-3
|
|
25
|
-
lg: "h-10 rounded-md px-
|
|
26
|
-
icon: "
|
|
27
|
-
|
|
24
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
25
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
26
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
27
|
+
icon: "size-9",
|
|
28
|
+
"icon-sm": "size-8",
|
|
29
|
+
"icon-lg": "size-10",
|
|
30
|
+
},
|
|
28
31
|
},
|
|
29
32
|
defaultVariants: {
|
|
30
33
|
variant: "default",
|
|
31
|
-
size: "default"
|
|
32
|
-
}
|
|
34
|
+
size: "default",
|
|
35
|
+
},
|
|
33
36
|
}
|
|
34
|
-
)
|
|
37
|
+
)
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
function Button({
|
|
40
|
+
className,
|
|
41
|
+
variant = "default",
|
|
42
|
+
size = "default",
|
|
43
|
+
asChild = false,
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<"button"> &
|
|
46
|
+
VariantProps<typeof buttonVariants> & {
|
|
47
|
+
asChild?: boolean
|
|
48
|
+
}) {
|
|
49
|
+
const Comp = asChild ? Slot : "button"
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
Button.displayName = "Button";
|
|
51
|
+
return (
|
|
52
|
+
<Comp
|
|
53
|
+
data-slot="button"
|
|
54
|
+
data-variant={variant}
|
|
55
|
+
data-size={size}
|
|
56
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
55
61
|
|
|
56
|
-
export { Button, buttonVariants }
|
|
62
|
+
export { Button, buttonVariants }
|
|
@@ -1,72 +1,87 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
7
|
<div
|
|
8
|
-
|
|
8
|
+
data-slot="card"
|
|
9
9
|
className={cn(
|
|
10
|
-
"
|
|
10
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
15
|
)
|
|
16
|
-
|
|
17
|
-
Card.displayName = "Card";
|
|
16
|
+
}
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
21
20
|
<div
|
|
22
|
-
|
|
23
|
-
className={cn(
|
|
21
|
+
data-slot="card-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="card-title"
|
|
35
|
+
className={cn("leading-none font-semibold", className)}
|
|
24
36
|
{...props}
|
|
25
37
|
/>
|
|
26
38
|
)
|
|
27
|
-
|
|
28
|
-
CardHeader.displayName = "CardHeader";
|
|
39
|
+
}
|
|
29
40
|
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return (
|
|
32
43
|
<div
|
|
33
|
-
|
|
34
|
-
className={cn("
|
|
44
|
+
data-slot="card-description"
|
|
45
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
35
46
|
{...props}
|
|
36
47
|
/>
|
|
37
48
|
)
|
|
38
|
-
|
|
39
|
-
CardTitle.displayName = "CardTitle";
|
|
49
|
+
}
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-slot="card-action"
|
|
55
|
+
className={cn(
|
|
56
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
52
63
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
data-slot="card-content"
|
|
68
|
+
className={cn("px-6", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
60
73
|
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return (
|
|
63
76
|
<div
|
|
64
|
-
|
|
65
|
-
className={cn("flex items-center
|
|
77
|
+
data-slot="card-footer"
|
|
78
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
66
79
|
{...props}
|
|
67
80
|
/>
|
|
68
81
|
)
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle
|
|
86
|
+
}
|
|
71
87
|
|
|
72
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
2
|
-
import {
|
|
3
|
-
import * as React from "react"
|
|
1
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
2
|
+
import { CheckIcon } from "lucide-react"
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function Checkbox({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
11
|
+
return (
|
|
11
12
|
<CheckboxPrimitive.Root
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
data-slot="checkbox"
|
|
14
|
+
className={cn(
|
|
15
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-sm border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
18
19
|
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
<CheckboxPrimitive.Indicator
|
|
21
|
+
data-slot="checkbox-indicator"
|
|
22
|
+
className="grid place-content-center text-current transition-none"
|
|
23
|
+
>
|
|
24
|
+
<CheckIcon className="size-3.5" />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
24
26
|
</CheckboxPrimitive.Root>
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
+
)
|
|
28
|
+
}
|
|
27
29
|
|
|
28
|
-
export { Checkbox }
|
|
30
|
+
export { Checkbox }
|