@tern-secure/nextjs 3.3.5 → 3.4.1
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/dist/cjs/app-router/client/TernSecureProvider.js +33 -0
- package/dist/cjs/app-router/client/TernSecureProvider.js.map +1 -0
- package/dist/cjs/app-router/client/actions.js +180 -0
- package/dist/cjs/app-router/client/actions.js.map +1 -0
- package/dist/cjs/app-router/route-handler/internal-route.js +45 -0
- package/dist/cjs/app-router/route-handler/internal-route.js.map +1 -0
- package/dist/cjs/app-router/server/auth.js +71 -0
- package/dist/cjs/app-router/server/auth.js.map +1 -0
- package/dist/cjs/app-router/server/index.js +42 -0
- package/dist/cjs/app-router/server/index.js.map +1 -0
- package/dist/cjs/app-router/server/sessionTernSecure.js +159 -0
- package/dist/cjs/app-router/server/sessionTernSecure.js.map +1 -0
- package/dist/cjs/app-router/server/ternSecureMiddleware.js +50 -0
- package/dist/cjs/app-router/server/ternSecureMiddleware.js.map +1 -0
- package/dist/cjs/boundary/TernSecureClientProvider.js +107 -0
- package/dist/cjs/boundary/TernSecureClientProvider.js.map +1 -0
- package/dist/cjs/boundary/TernSecureCtx.js +49 -0
- package/dist/cjs/boundary/TernSecureCtx.js.map +1 -0
- package/dist/cjs/boundary/hooks/useAuth.js +51 -0
- package/dist/cjs/boundary/hooks/useAuth.js.map +1 -0
- package/dist/cjs/boundary/hooks/useSignUp.js +40 -0
- package/dist/cjs/boundary/hooks/useSignUp.js.map +1 -0
- package/dist/cjs/boundary/hooks/useUser.js +44 -0
- package/dist/cjs/boundary/hooks/useUser.js.map +1 -0
- package/dist/cjs/components/background.js +65 -0
- package/dist/cjs/components/background.js.map +1 -0
- package/dist/cjs/components/sign-in.js +242 -0
- package/dist/cjs/components/sign-in.js.map +1 -0
- package/dist/cjs/components/sign-out.js +69 -0
- package/dist/cjs/components/sign-out.js.map +1 -0
- package/dist/cjs/components/sign-up.js +328 -0
- package/dist/cjs/components/sign-up.js.map +1 -0
- package/dist/cjs/components/ui/alert.js +88 -0
- package/dist/cjs/components/ui/alert.js.map +1 -0
- package/dist/cjs/components/ui/button.js +84 -0
- package/dist/cjs/components/ui/button.js.map +1 -0
- package/dist/cjs/components/ui/card.js +101 -0
- package/dist/cjs/components/ui/card.js.map +1 -0
- package/dist/cjs/components/ui/input.js +58 -0
- package/dist/cjs/components/ui/input.js.map +1 -0
- package/dist/cjs/components/ui/label.js +55 -0
- package/dist/cjs/components/ui/label.js.map +1 -0
- package/dist/cjs/components/ui/separator.js +59 -0
- package/dist/cjs/components/ui/separator.js.map +1 -0
- package/dist/cjs/components/verify.js +195 -0
- package/dist/cjs/components/verify.js.map +1 -0
- package/dist/cjs/errors.js +41 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/index.js +59 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/utils.d.js +17 -0
- package/dist/cjs/lib/utils.d.js.map +1 -0
- package/dist/cjs/lib/utils.js +33 -0
- package/dist/cjs/lib/utils.js.map +1 -0
- package/dist/cjs/types.js +17 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/admin-init.js +57 -0
- package/dist/cjs/utils/admin-init.js.map +1 -0
- package/dist/cjs/utils/client-init.js +49 -0
- package/dist/cjs/utils/client-init.js.map +1 -0
- package/dist/cjs/utils/config.js +113 -0
- package/dist/cjs/utils/config.js.map +1 -0
- package/dist/cjs/utils/construct.js +63 -0
- package/dist/cjs/utils/construct.js.map +1 -0
- package/dist/cjs/utils/create-styles.js +149 -0
- package/dist/cjs/utils/create-styles.js.map +1 -0
- package/dist/esm/app-router/client/TernSecureProvider.js +9 -0
- package/dist/esm/app-router/client/TernSecureProvider.js.map +1 -0
- package/dist/esm/app-router/client/actions.js +151 -0
- package/dist/esm/app-router/client/actions.js.map +1 -0
- package/dist/esm/app-router/route-handler/internal-route.js +20 -0
- package/dist/esm/app-router/route-handler/internal-route.js.map +1 -0
- package/dist/esm/app-router/server/auth.js +47 -0
- package/dist/esm/app-router/server/auth.js.map +1 -0
- package/dist/esm/app-router/server/index.js +13 -0
- package/dist/esm/app-router/server/index.js.map +1 -0
- package/dist/esm/app-router/server/sessionTernSecure.js +129 -0
- package/dist/esm/app-router/server/sessionTernSecure.js.map +1 -0
- package/dist/esm/app-router/server/ternSecureMiddleware.js +26 -0
- package/dist/esm/app-router/server/ternSecureMiddleware.js.map +1 -0
- package/dist/esm/boundary/TernSecureClientProvider.js +83 -0
- package/dist/esm/boundary/TernSecureClientProvider.js.map +1 -0
- package/dist/esm/boundary/TernSecureCtx.js +23 -0
- package/dist/esm/boundary/TernSecureCtx.js.map +1 -0
- package/dist/esm/boundary/hooks/useAuth.js +27 -0
- package/dist/esm/boundary/hooks/useAuth.js.map +1 -0
- package/dist/esm/boundary/hooks/useSignUp.js +16 -0
- package/dist/esm/boundary/hooks/useSignUp.js.map +1 -0
- package/dist/esm/boundary/hooks/useUser.js +20 -0
- package/dist/esm/boundary/hooks/useUser.js.map +1 -0
- package/dist/esm/components/background.js +41 -0
- package/dist/esm/components/background.js.map +1 -0
- package/dist/esm/components/sign-in.js +218 -0
- package/dist/esm/components/sign-in.js.map +1 -0
- package/dist/esm/components/sign-out.js +45 -0
- package/dist/esm/components/sign-out.js.map +1 -0
- package/dist/esm/components/sign-up.js +294 -0
- package/dist/esm/components/sign-up.js.map +1 -0
- package/dist/esm/components/ui/alert.js +52 -0
- package/dist/esm/components/ui/alert.js.map +1 -0
- package/dist/esm/components/ui/button.js +49 -0
- package/dist/esm/components/ui/button.js.map +1 -0
- package/dist/esm/components/ui/card.js +62 -0
- package/dist/esm/components/ui/card.js.map +1 -0
- package/dist/esm/components/ui/input.js +24 -0
- package/dist/esm/components/ui/input.js.map +1 -0
- package/dist/esm/components/ui/label.js +21 -0
- package/dist/esm/components/ui/label.js.map +1 -0
- package/dist/esm/components/ui/separator.js +25 -0
- package/dist/esm/components/ui/separator.js.map +1 -0
- package/dist/esm/components/verify.js +161 -0
- package/dist/esm/components/verify.js.map +1 -0
- package/dist/esm/errors.js +16 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/index.js +24 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/utils.d.js +1 -0
- package/dist/esm/lib/utils.d.js.map +1 -0
- package/dist/esm/lib/utils.js +9 -0
- package/dist/esm/lib/utils.js.map +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/admin-init.js +22 -0
- package/dist/esm/utils/admin-init.js.map +1 -0
- package/dist/esm/utils/client-init.js +22 -0
- package/dist/esm/utils/client-init.js.map +1 -0
- package/dist/esm/utils/config.js +84 -0
- package/dist/esm/utils/config.js.map +1 -0
- package/dist/esm/utils/construct.js +37 -0
- package/dist/esm/utils/construct.js.map +1 -0
- package/dist/esm/utils/create-styles.js +123 -0
- package/dist/esm/utils/create-styles.js.map +1 -0
- package/dist/types/app-router/client/TernSecureProvider.d.ts +26 -0
- package/dist/types/app-router/client/TernSecureProvider.d.ts.map +1 -0
- package/dist/types/app-router/client/actions.d.ts +49 -0
- package/dist/types/app-router/client/actions.d.ts.map +1 -0
- package/dist/types/app-router/route-handler/internal-route.d.ts +9 -0
- package/dist/types/app-router/route-handler/internal-route.d.ts.map +1 -0
- package/dist/types/app-router/server/auth.d.ts +7 -0
- package/dist/types/app-router/server/auth.d.ts.map +1 -0
- package/dist/types/app-router/server/index.d.ts +5 -0
- package/dist/types/app-router/server/index.d.ts.map +1 -0
- package/dist/types/app-router/server/sessionTernSecure.d.ts +37 -0
- package/dist/types/app-router/server/sessionTernSecure.d.ts.map +1 -0
- package/dist/types/app-router/server/ternSecureMiddleware.d.ts +7 -0
- package/dist/types/app-router/server/ternSecureMiddleware.d.ts.map +1 -0
- package/dist/types/boundary/TernSecureClientProvider.d.ts +11 -0
- package/dist/types/boundary/TernSecureClientProvider.d.ts.map +1 -0
- package/dist/types/boundary/TernSecureCtx.d.ts +17 -0
- package/dist/types/boundary/TernSecureCtx.d.ts.map +1 -0
- package/dist/types/boundary/hooks/useAuth.d.ts +11 -0
- package/dist/types/boundary/hooks/useAuth.d.ts.map +1 -0
- package/dist/types/boundary/hooks/useSignUp.d.ts +5 -0
- package/dist/types/boundary/hooks/useSignUp.d.ts.map +1 -0
- package/dist/types/boundary/hooks/useUser.d.ts +7 -0
- package/dist/types/boundary/hooks/useUser.d.ts.map +1 -0
- package/dist/types/components/background.d.ts +2 -0
- package/dist/types/components/background.d.ts.map +1 -0
- package/dist/types/components/sign-in.d.ts +18 -0
- package/dist/types/components/sign-in.d.ts.map +1 -0
- package/dist/types/components/sign-out.d.ts +10 -0
- package/dist/types/components/sign-out.d.ts.map +1 -0
- package/dist/types/components/sign-up.d.ts +7 -0
- package/dist/types/components/sign-up.d.ts.map +1 -0
- package/dist/types/components/ui/alert.d.ts +9 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +12 -0
- package/dist/types/components/ui/button.d.ts.map +1 -0
- package/dist/types/components/ui/card.d.ts +9 -0
- package/dist/types/components/ui/card.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +4 -0
- package/dist/types/components/ui/input.d.ts.map +1 -0
- package/dist/types/components/ui/label.d.ts +6 -0
- package/dist/types/components/ui/label.d.ts.map +1 -0
- package/dist/types/components/ui/separator.d.ts +5 -0
- package/dist/types/components/ui/separator.d.ts.map +1 -0
- package/dist/types/components/verify.d.ts +2 -0
- package/dist/types/components/verify.d.ts.map +1 -0
- package/dist/types/errors.d.ts +9 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +3 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/types.d.ts +63 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/admin-init.d.ts +4 -0
- package/dist/types/utils/admin-init.d.ts.map +1 -0
- package/dist/types/utils/client-init.d.ts +5 -0
- package/dist/types/utils/client-init.d.ts.map +1 -0
- package/dist/types/utils/config.d.ts +35 -0
- package/dist/types/utils/config.d.ts.map +1 -0
- package/dist/types/utils/construct.d.ts +22 -0
- package/dist/types/utils/construct.d.ts.map +1 -0
- package/dist/types/utils/create-styles.d.ts +99 -0
- package/dist/types/utils/create-styles.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useRouter, usePathname } from "next/navigation";
|
|
5
|
+
import Link from "next/link";
|
|
6
|
+
import { Eye, EyeOff, Check, X, Loader2 } from "lucide-react";
|
|
7
|
+
import { Button } from "./ui/button";
|
|
8
|
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter } from "./ui/card";
|
|
9
|
+
import { Input } from "./ui/input";
|
|
10
|
+
import { Label } from "./ui/label";
|
|
11
|
+
import { Alert, AlertDescription } from "./ui/alert";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { AuthBackground } from "./background";
|
|
14
|
+
import { Separator } from "./ui/separator";
|
|
15
|
+
import { createUser, signInWithRedirectGoogle, signInWithMicrosoft } from "../app-router/client/actions";
|
|
16
|
+
import { useSignUp } from "../boundary/hooks/useSignUp";
|
|
17
|
+
import { handleInternalRoute } from "../app-router/route-handler/internal-route";
|
|
18
|
+
function SignUp({
|
|
19
|
+
redirectUrl,
|
|
20
|
+
onError,
|
|
21
|
+
onSuccess
|
|
22
|
+
}) {
|
|
23
|
+
const pathname = usePathname();
|
|
24
|
+
const InternalComponent = handleInternalRoute(pathname);
|
|
25
|
+
if (InternalComponent) {
|
|
26
|
+
return /* @__PURE__ */ jsx(InternalComponent, {});
|
|
27
|
+
}
|
|
28
|
+
const { setEmail: setContextEmail } = useSignUp();
|
|
29
|
+
const [formData, setFormData] = useState({
|
|
30
|
+
name: "",
|
|
31
|
+
email: "",
|
|
32
|
+
password: "",
|
|
33
|
+
confirmPassword: ""
|
|
34
|
+
});
|
|
35
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
36
|
+
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
|
37
|
+
const [isLoading, setLoading] = useState(false);
|
|
38
|
+
const [error, setError] = useState("");
|
|
39
|
+
const [passwordFocused, setPasswordFocused] = useState(false);
|
|
40
|
+
const router = useRouter();
|
|
41
|
+
const passwordRequirements = [
|
|
42
|
+
{
|
|
43
|
+
text: "At least 8 characters long",
|
|
44
|
+
satisfied: formData.password.length >= 8
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
text: "Contains at least one uppercase letter",
|
|
48
|
+
satisfied: /[A-Z]/.test(formData.password)
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
text: "Contains at least one lowercase letter",
|
|
52
|
+
satisfied: /[a-z]/.test(formData.password)
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
text: "Contains at least one number",
|
|
56
|
+
satisfied: /\d/.test(formData.password)
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: "Contains at least one special character",
|
|
60
|
+
satisfied: /[!@#$%^&*(),.?":{}|<>]/.test(formData.password)
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
text: "Passwords match",
|
|
64
|
+
satisfied: formData.password === formData.confirmPassword && formData.password !== ""
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
const handleInputChange = (e) => {
|
|
68
|
+
const { name, value } = e.target;
|
|
69
|
+
setFormData((prev) => ({
|
|
70
|
+
...prev,
|
|
71
|
+
[name]: value
|
|
72
|
+
}));
|
|
73
|
+
};
|
|
74
|
+
const isFormValid = () => {
|
|
75
|
+
return formData.email.length > 0 && passwordRequirements.every((req) => req.satisfied);
|
|
76
|
+
};
|
|
77
|
+
const handleSubmit = async (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
if (!isFormValid()) return;
|
|
80
|
+
setLoading(true);
|
|
81
|
+
try {
|
|
82
|
+
const result = await createUser(formData.email, formData.password);
|
|
83
|
+
if (result.success) {
|
|
84
|
+
setContextEmail(formData.email);
|
|
85
|
+
onSuccess == null ? void 0 : onSuccess();
|
|
86
|
+
router.push(`sign-up/verify`);
|
|
87
|
+
}
|
|
88
|
+
} catch (error2) {
|
|
89
|
+
const errorMessage = error2 instanceof Error ? error2.message : "Failed to sign in";
|
|
90
|
+
setError(errorMessage);
|
|
91
|
+
onError == null ? void 0 : onError(error2 instanceof Error ? error2 : new Error("Failed to create account"));
|
|
92
|
+
} finally {
|
|
93
|
+
setLoading(false);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const handleSocialSignIn = async (provider) => {
|
|
97
|
+
setLoading(true);
|
|
98
|
+
try {
|
|
99
|
+
const currentUrl = new URL(window.location.href);
|
|
100
|
+
currentUrl.searchParams.set("signInRedirect", "true");
|
|
101
|
+
window.history.replaceState({}, "", currentUrl.toString());
|
|
102
|
+
const result = provider === "google" ? await signInWithRedirectGoogle() : await signInWithMicrosoft();
|
|
103
|
+
if (!result.success) {
|
|
104
|
+
throw new Error(result.error);
|
|
105
|
+
}
|
|
106
|
+
} catch (err) {
|
|
107
|
+
const errorMessage = err instanceof Error ? err.message : `Failed to sign in with ${provider}`;
|
|
108
|
+
setError(errorMessage);
|
|
109
|
+
const newUrl = new URL(window.location.href);
|
|
110
|
+
newUrl.searchParams.delete("signInRedirect");
|
|
111
|
+
window.history.replaceState({}, "", newUrl.toString());
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-screen items-center justify-center", children: [
|
|
115
|
+
/* @__PURE__ */ jsx(AuthBackground, {}),
|
|
116
|
+
/* @__PURE__ */ jsxs(Card, { className: "w-full max-w-md mx-auto mt-8", children: [
|
|
117
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "space-y-1 text-center", children: [
|
|
118
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-2xl font-bold", children: "Create an account" }),
|
|
119
|
+
/* @__PURE__ */ jsx(CardDescription, { children: "Enter your information below to create your account" })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, children: [
|
|
122
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
|
|
123
|
+
error && /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: error }) }),
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email" }),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
Input,
|
|
128
|
+
{
|
|
129
|
+
id: "email",
|
|
130
|
+
name: "email",
|
|
131
|
+
type: "email",
|
|
132
|
+
placeholder: "name@example.com",
|
|
133
|
+
value: formData.email,
|
|
134
|
+
onChange: handleInputChange,
|
|
135
|
+
required: true,
|
|
136
|
+
disabled: isLoading
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
141
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "password", children: "Password" }),
|
|
142
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Input,
|
|
145
|
+
{
|
|
146
|
+
id: "password",
|
|
147
|
+
name: "password",
|
|
148
|
+
type: showPassword ? "text" : "password",
|
|
149
|
+
value: formData.password,
|
|
150
|
+
onChange: handleInputChange,
|
|
151
|
+
onFocus: () => setPasswordFocused(true),
|
|
152
|
+
onBlur: () => setPasswordFocused(false),
|
|
153
|
+
required: true,
|
|
154
|
+
disabled: isLoading
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsxs(
|
|
158
|
+
Button,
|
|
159
|
+
{
|
|
160
|
+
type: "button",
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "icon",
|
|
163
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
164
|
+
onClick: () => setShowPassword(!showPassword),
|
|
165
|
+
children: [
|
|
166
|
+
showPassword ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" }),
|
|
167
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: showPassword ? "Hide password" : "Show password" })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] })
|
|
172
|
+
] }),
|
|
173
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
174
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "confirmPassword", children: "Confirm Password" }),
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
Input,
|
|
178
|
+
{
|
|
179
|
+
id: "confirmPassword",
|
|
180
|
+
name: "confirmPassword",
|
|
181
|
+
type: showConfirmPassword ? "text" : "password",
|
|
182
|
+
value: formData.confirmPassword,
|
|
183
|
+
onChange: handleInputChange,
|
|
184
|
+
required: true,
|
|
185
|
+
disabled: isLoading
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ jsxs(
|
|
189
|
+
Button,
|
|
190
|
+
{
|
|
191
|
+
type: "button",
|
|
192
|
+
variant: "ghost",
|
|
193
|
+
size: "icon",
|
|
194
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2",
|
|
195
|
+
onClick: () => setShowConfirmPassword(!showConfirmPassword),
|
|
196
|
+
children: [
|
|
197
|
+
showConfirmPassword ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" }),
|
|
198
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: showConfirmPassword ? "Hide password" : "Show password" })
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] })
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ jsx(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: cn(
|
|
208
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
209
|
+
"p-4 transition-all duration-200",
|
|
210
|
+
passwordFocused ? "opacity-100" : "opacity-70"
|
|
211
|
+
),
|
|
212
|
+
children: /* @__PURE__ */ jsx("div", { className: "grid gap-2 text-sm", children: passwordRequirements.map((requirement, index) => /* @__PURE__ */ jsxs(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
className: cn(
|
|
216
|
+
"flex items-center gap-2",
|
|
217
|
+
requirement.satisfied ? "text-green-500" : "text-muted-foreground"
|
|
218
|
+
),
|
|
219
|
+
children: [
|
|
220
|
+
requirement.satisfied ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ jsx(X, { className: "h-4 w-4 shrink-0" }),
|
|
221
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: requirement.text })
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
index
|
|
225
|
+
)) })
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ jsxs(CardFooter, { className: "flex flex-col space-y-4", children: [
|
|
230
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", disabled: !isFormValid() || isLoading, children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
231
|
+
/* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
232
|
+
"Creating account..."
|
|
233
|
+
] }) : "Create account" }),
|
|
234
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground text-center", children: [
|
|
235
|
+
"Already have an account?",
|
|
236
|
+
" ",
|
|
237
|
+
/* @__PURE__ */ jsx(Link, { href: "/sign-in", className: "text-primary underline-offset-4 transition-colors hover:underline", children: "Sign in" }),
|
|
238
|
+
" or sign up with email"
|
|
239
|
+
] })
|
|
240
|
+
] })
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-4 px-6" }),
|
|
243
|
+
/* @__PURE__ */ jsxs("div", { className: "px-6 pb-4", children: [
|
|
244
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
245
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsx(Separator, { className: "w-full" }) }),
|
|
246
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ jsx("span", { className: "bg-background px-2 text-muted-foreground", children: "Or continue with" }) })
|
|
247
|
+
] }),
|
|
248
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4 mt-4", children: [
|
|
249
|
+
/* @__PURE__ */ jsxs(
|
|
250
|
+
Button,
|
|
251
|
+
{
|
|
252
|
+
variant: "outline",
|
|
253
|
+
disabled: isLoading,
|
|
254
|
+
onClick: () => handleSocialSignIn("google"),
|
|
255
|
+
className: "flex items-center justify-center",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
258
|
+
/* @__PURE__ */ jsx("path", { d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z", fill: "#4285F4" }),
|
|
259
|
+
/* @__PURE__ */ jsx("path", { d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z", fill: "#34A853" }),
|
|
260
|
+
/* @__PURE__ */ jsx("path", { d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z", fill: "#FBBC05" }),
|
|
261
|
+
/* @__PURE__ */ jsx("path", { d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z", fill: "#EA4335" })
|
|
262
|
+
] }),
|
|
263
|
+
"Google"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ jsxs(
|
|
268
|
+
Button,
|
|
269
|
+
{
|
|
270
|
+
variant: "outline",
|
|
271
|
+
disabled: isLoading,
|
|
272
|
+
onClick: () => handleSocialSignIn("microsoft"),
|
|
273
|
+
className: "flex items-center justify-center",
|
|
274
|
+
children: [
|
|
275
|
+
/* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 23 23", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
276
|
+
/* @__PURE__ */ jsx("path", { fill: "#f3f3f3", d: "M0 0h23v23H0z" }),
|
|
277
|
+
/* @__PURE__ */ jsx("path", { fill: "#f35325", d: "M1 1h10v10H1z" }),
|
|
278
|
+
/* @__PURE__ */ jsx("path", { fill: "#81bc06", d: "M12 1h10v10H12z" }),
|
|
279
|
+
/* @__PURE__ */ jsx("path", { fill: "#05a6f0", d: "M1 12h10v10H1z" }),
|
|
280
|
+
/* @__PURE__ */ jsx("path", { fill: "#ffba08", d: "M12 12h10v10H12z" })
|
|
281
|
+
] }),
|
|
282
|
+
"Microsoft"
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
] })
|
|
287
|
+
] })
|
|
288
|
+
] })
|
|
289
|
+
] });
|
|
290
|
+
}
|
|
291
|
+
export {
|
|
292
|
+
SignUp
|
|
293
|
+
};
|
|
294
|
+
//# sourceMappingURL=sign-up.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/sign-up.tsx"],"sourcesContent":["\"use client\"\n\nimport { useState } from \"react\"\nimport { useRouter, usePathname } from 'next/navigation'\nimport Link from \"next/link\"\nimport { Eye, EyeOff, Check, X, Loader2 } from \"lucide-react\"\nimport { Button } from \"./ui/button\"\nimport { Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter } from \"./ui/card\"\nimport { Input } from \"./ui/input\"\nimport { Label } from \"./ui/label\"\nimport { Alert, AlertDescription } from \"./ui/alert\"\nimport { cn } from \"../lib/utils\"\nimport { AuthBackground } from \"./background\"\nimport { Separator } from \"./ui/separator\"\nimport { createUser, signInWithRedirectGoogle, signInWithMicrosoft } from '../app-router/client/actions'\nimport { useSignUp } from '../boundary/hooks/useSignUp'\nimport { handleInternalRoute } from '../app-router/route-handler/internal-route'\n\nexport interface SignUpProps {\n redirectUrl?: string\n onError?: (error: Error) => void\n onSuccess?: () => void\n}\n\ninterface PasswordRequirement {\n text: string\n satisfied: boolean\n}\n\nexport function SignUp({\n redirectUrl, \n onError,\n onSuccess,\n }: SignUpProps) {\n const pathname = usePathname()\n const InternalComponent = handleInternalRoute(pathname)\n\n if (InternalComponent) {\n return <InternalComponent />\n }\n\n const { setEmail: setContextEmail } = useSignUp()\n const [formData, setFormData] = useState({\n name: \"\",\n email: \"\",\n password: \"\",\n confirmPassword: \"\",\n })\n const [showPassword, setShowPassword] = useState(false)\n const [showConfirmPassword, setShowConfirmPassword] = useState(false)\n const [isLoading, setLoading] = useState(false)\n const [error, setError] = useState(\"\")\n const [passwordFocused, setPasswordFocused] = useState(false)\n const router = useRouter()\n\n const passwordRequirements: PasswordRequirement[] = [\n {\n text: \"At least 8 characters long\",\n satisfied: formData.password.length >= 8,\n },\n {\n text: \"Contains at least one uppercase letter\",\n satisfied: /[A-Z]/.test(formData.password),\n },\n {\n text: \"Contains at least one lowercase letter\",\n satisfied: /[a-z]/.test(formData.password),\n },\n {\n text: \"Contains at least one number\",\n satisfied: /\\d/.test(formData.password),\n },\n {\n text: \"Contains at least one special character\",\n satisfied: /[!@#$%^&*(),.?\":{}|<>]/.test(formData.password),\n },\n {\n text: \"Passwords match\",\n satisfied: formData.password === formData.confirmPassword && formData.password !== \"\",\n },\n ]\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const { name, value } = e.target\n setFormData((prev) => ({\n ...prev,\n [name]: value,\n }))\n }\n\n const isFormValid = () => {\n return formData.email.length > 0 && passwordRequirements.every((req) => req.satisfied)\n }\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault()\n if (!isFormValid()) return\n\n setLoading(true)\n try {\n const result = await createUser(formData.email, formData.password)\n if(result.success) {\n setContextEmail(formData.email)\n\n onSuccess?.()\n\n router.push(`sign-up/verify`)\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to sign in'\n setError(errorMessage)\n onError?.(error instanceof Error ? error : new Error('Failed to create account'))\n } finally {\n setLoading(false)\n }\n }\n\n\n const handleSocialSignIn = async (provider: 'google' | 'microsoft') => {\n setLoading(true)\n try {\n const currentUrl = new URL(window.location.href)\n currentUrl.searchParams.set('signInRedirect', 'true')\n window.history.replaceState({}, '', currentUrl.toString())\n\n const result = provider === 'google' ? await signInWithRedirectGoogle() : await signInWithMicrosoft()\n if (!result.success) {\n throw new Error(result.error)\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : `Failed to sign in with ${provider}`\n setError(errorMessage)\n const newUrl = new URL(window.location.href)\n newUrl.searchParams.delete('signInRedirect')\n window.history.replaceState({}, '', newUrl.toString())\n }\n }\n\n return (\n <div className=\"relative flex min-h-screen items-center justify-center\">\n <AuthBackground />\n <Card className=\"w-full max-w-md mx-auto mt-8\">\n <CardHeader className=\"space-y-1 text-center\">\n <CardTitle className=\"text-2xl font-bold\">Create an account</CardTitle>\n <CardDescription>Enter your information below to create your account</CardDescription>\n </CardHeader>\n <form onSubmit={handleSubmit}>\n <CardContent className=\"space-y-4\">\n {error && (\n <Alert variant=\"destructive\">\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n value={formData.email}\n onChange={handleInputChange}\n required\n disabled={isLoading}\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"password\">Password</Label>\n <div className=\"relative\">\n <Input\n id=\"password\"\n name=\"password\"\n type={showPassword ? \"text\" : \"password\"}\n value={formData.password}\n onChange={handleInputChange}\n onFocus={() => setPasswordFocused(true)}\n onBlur={() => setPasswordFocused(false)}\n required\n disabled={isLoading}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n onClick={() => setShowPassword(!showPassword)}\n >\n {showPassword ? <EyeOff className=\"h-4 w-4\" /> : <Eye className=\"h-4 w-4\" />}\n <span className=\"sr-only\">{showPassword ? \"Hide password\" : \"Show password\"}</span>\n </Button>\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"confirmPassword\">Confirm Password</Label>\n <div className=\"relative\">\n <Input\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n type={showConfirmPassword ? \"text\" : \"password\"}\n value={formData.confirmPassword}\n onChange={handleInputChange}\n required\n disabled={isLoading}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n onClick={() => setShowConfirmPassword(!showConfirmPassword)}\n >\n {showConfirmPassword ? <EyeOff className=\"h-4 w-4\" /> : <Eye className=\"h-4 w-4\" />}\n <span className=\"sr-only\">{showConfirmPassword ? \"Hide password\" : \"Show password\"}</span>\n </Button>\n </div>\n </div>\n\n {/* Password Requirements */}\n <div\n className={cn(\n \"rounded-lg border bg-card text-card-foreground shadow-sm\",\n \"p-4 transition-all duration-200\",\n passwordFocused ? \"opacity-100\" : \"opacity-70\",\n )}\n >\n <div className=\"grid gap-2 text-sm\">\n {passwordRequirements.map((requirement, index) => (\n <div\n key={index}\n className={cn(\n \"flex items-center gap-2\",\n requirement.satisfied ? \"text-green-500\" : \"text-muted-foreground\",\n )}\n >\n {requirement.satisfied ? (\n <Check className=\"h-4 w-4 shrink-0\" />\n ) : (\n <X className=\"h-4 w-4 shrink-0\" />\n )}\n <span className=\"text-sm\">{requirement.text}</span>\n </div>\n ))}\n </div>\n </div>\n </CardContent>\n\n <CardFooter className=\"flex flex-col space-y-4\">\n <Button type=\"submit\" className=\"w-full\" disabled={!isFormValid() || isLoading}>\n {isLoading ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Creating account...\n </>\n ) : (\n \"Create account\"\n )}\n </Button>\n <p className=\"text-sm text-muted-foreground text-center\">\n Already have an account?{\" \"}\n <Link href=\"/sign-in\" className=\"text-primary underline-offset-4 transition-colors hover:underline\">\n Sign in\n </Link> or sign up with email\n </p>\n </CardFooter>\n </form>\n <Separator className=\"my-4 px-6\" />\n <div className=\"px-6 pb-4\">\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-background px-2 text-muted-foreground\">\n Or continue with\n </span>\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-4 mt-4\">\n <Button \n variant=\"outline\" \n disabled={isLoading}\n onClick={() => handleSocialSignIn('google')} \n className=\"flex items-center justify-center\"\n >\n <svg className=\"w-5 h-5 mr-2\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\" fill=\"#4285F4\"/>\n <path d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\" fill=\"#34A853\"/>\n <path d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\" fill=\"#FBBC05\"/>\n <path d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\" fill=\"#EA4335\"/>\n </svg>\n Google\n </Button>\n <Button \n variant=\"outline\" \n disabled={isLoading}\n onClick={() => handleSocialSignIn('microsoft')} \n className=\"flex items-center justify-center\"\n >\n <svg className=\"w-5 h-5 mr-2\" viewBox=\"0 0 23 23\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#f3f3f3\" d=\"M0 0h23v23H0z\"/>\n <path fill=\"#f35325\" d=\"M1 1h10v10H1z\"/>\n <path fill=\"#81bc06\" d=\"M12 1h10v10H12z\"/>\n <path fill=\"#05a6f0\" d=\"M1 12h10v10H1z\"/>\n <path fill=\"#ffba08\" d=\"M12 12h10v10H12z\"/>\n </svg>\n Microsoft\n </Button>\n </div>\n </div>\n </Card>\n </div>\n )\n}\n"],"mappings":";AAsCW,SAsNK,UAtNL,KAwGH,YAxGG;AApCX,SAAS,gBAAgB;AACzB,SAAS,WAAW,mBAAmB;AACvC,OAAO,UAAU;AACjB,SAAS,KAAK,QAAQ,OAAO,GAAG,eAAe;AAC/C,SAAS,cAAc;AACvB,SAAS,MAAM,aAAa,YAAY,WAAW,iBAAiB,kBAAkB;AACtF,SAAS,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;AAAA,kBAChJ,oBAAC,UAAK,GAAE,yIAAwI,MAAK,WAAS;AAAA,kBAC9J,oBAAC,UAAK,GAAE,iIAAgI,MAAK,WAAS;AAAA,kBACtJ,oBAAC,UAAK,GAAE,uIAAsI,MAAK,WAAS;AAAA,mBAC9J;AAAA,gBAAM;AAAA;AAAA;AAAA,UAER;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,UAAU;AAAA,cACV,SAAS,MAAM,mBAAmB,WAAW;AAAA,cAC7C,WAAU;AAAA,cAEV;AAAA,qCAAC,SAAI,WAAU,gBAAe,SAAQ,aAAY,OAAM,8BACtD;AAAA,sCAAC,UAAK,MAAK,WAAU,GAAE,iBAAe;AAAA,kBACtC,oBAAC,UAAK,MAAK,WAAU,GAAE,iBAAe;AAAA,kBACtC,oBAAC,UAAK,MAAK,WAAU,GAAE,mBAAiB;AAAA,kBACxC,oBAAC,UAAK,MAAK,WAAU,GAAE,kBAAgB;AAAA,kBACvC,oBAAC,UAAK,MAAK,WAAU,GAAE,oBAAkB;AAAA,mBAC3C;AAAA,gBAAM;AAAA;AAAA;AAAA,UAER;AAAA,WACF;AAAA,SACF;AAAA,OACJ;AAAA,KACF;AAEJ;","names":["error"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const alertVariants = cva(
|
|
6
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-background text-foreground",
|
|
11
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "default"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
role: "alert",
|
|
24
|
+
className: cn(alertVariants({ variant }), className),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
Alert.displayName = "Alert";
|
|
29
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
30
|
+
"h5",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: cn("mb-1 font-medium leading-none tracking-tight", className),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
AlertTitle.displayName = "AlertTitle";
|
|
38
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: cn("text-sm [&_p]:leading-relaxed", className),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
AlertDescription.displayName = "AlertDescription";
|
|
47
|
+
export {
|
|
48
|
+
Alert,
|
|
49
|
+
AlertDescription,
|
|
50
|
+
AlertTitle
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n))\nAlert.displayName = \"Alert\"\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n))\nAlertTitle.displayName = \"AlertTitle\"\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n))\nAlertDescription.displayName = \"AlertDescription\"\n\nexport { Alert, AlertTitle, AlertDescription }\n"],"mappings":"AAyBE;AAzBF,YAAY,WAAW;AACvB,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MACJ;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,MAAM,QAAQ,MAAM,WAGlB,CAAC,EAAE,WAAW,SAAS,GAAG,MAAM,GAAG,QACnC;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,MAAK;AAAA,IACL,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,IAClD,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc;AAEpB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gDAAgD,SAAS;AAAA,IACtE,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAEzB,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
12
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
13
|
+
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
15
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
16
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-9 px-4 py-2",
|
|
20
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
21
|
+
lg: "h-10 rounded-md px-8",
|
|
22
|
+
icon: "h-9 w-9"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default",
|
|
27
|
+
size: "default"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const Button = React.forwardRef(
|
|
32
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
33
|
+
const Comp = asChild ? Slot : "button";
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Comp,
|
|
36
|
+
{
|
|
37
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
38
|
+
ref,
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Button.displayName = "Button";
|
|
45
|
+
export {
|
|
46
|
+
Button,
|
|
47
|
+
buttonVariants
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"],"mappings":"AA8CM;AA9CN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
ref,
|
|
8
|
+
className: cn(
|
|
9
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
10
|
+
className
|
|
11
|
+
),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
Card.displayName = "Card";
|
|
16
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
ref,
|
|
20
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
));
|
|
24
|
+
CardHeader.displayName = "CardHeader";
|
|
25
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
className: cn("font-semibold leading-none tracking-tight", className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
CardTitle.displayName = "CardTitle";
|
|
34
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
CardDescription.displayName = "CardDescription";
|
|
43
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
44
|
+
CardContent.displayName = "CardContent";
|
|
45
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
));
|
|
53
|
+
CardFooter.displayName = "CardFooter";
|
|
54
|
+
export {
|
|
55
|
+
Card,
|
|
56
|
+
CardContent,
|
|
57
|
+
CardDescription,
|
|
58
|
+
CardFooter,
|
|
59
|
+
CardHeader,
|
|
60
|
+
CardTitle
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow\",\n className\n )}\n {...props}\n />\n))\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"],"mappings":"AAQE;AARF,YAAY,WAAW;AAEvB,SAAS,UAAU;AAEnB,MAAM,OAAO,MAAM,WAGjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,KAAK,cAAc;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAEzB,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,6CAA6C,SAAS;AAAA,IACnE,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAc;AAExB,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACjE;AACD,YAAY,cAAc;AAE1B,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,8BAA8B,SAAS;AAAA,IACpD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
const Input = React.forwardRef(
|
|
5
|
+
({ className, type, ...props }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"input",
|
|
8
|
+
{
|
|
9
|
+
type,
|
|
10
|
+
className: cn(
|
|
11
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
+
className
|
|
13
|
+
),
|
|
14
|
+
ref,
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
Input.displayName = "Input";
|
|
21
|
+
export {
|
|
22
|
+
Input
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"mappings":"AAOM;AAPN,YAAY,WAAW;AAEvB,SAAS,UAAU;AAEnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAM,GAAG,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const labelVariants = cva(
|
|
7
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
8
|
+
);
|
|
9
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
+
LabelPrimitive.Root,
|
|
11
|
+
{
|
|
12
|
+
ref,
|
|
13
|
+
className: cn(labelVariants(), className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
18
|
+
export {
|
|
19
|
+
Label
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/label.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":"AAeE;AAfF,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,WAA8B;AAEvC,SAAS,UAAU;AAEnB,MAAM,gBAAgB;AAAA,EACpB;AACF;AAEA,MAAM,QAAQ,MAAM,WAIlB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,eAAe;AAAA,EAAf;AAAA,IACC;AAAA,IACA,WAAW,GAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc,eAAe,KAAK;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const Separator = React.forwardRef(
|
|
6
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
SeparatorPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
decorative,
|
|
11
|
+
orientation,
|
|
12
|
+
className: cn(
|
|
13
|
+
"shrink-0 bg-border",
|
|
14
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
|
+
export {
|
|
23
|
+
Separator
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"],"mappings":"AAaI;AAbJ,YAAY,WAAW;AACvB,YAAY,wBAAwB;AAEpC,SAAS,UAAU;AAEnB,MAAM,YAAY,MAAM;AAAA,EAItB,CACE,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GACrE,QAEA;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,mBAAmB;AAAA,QAClD;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,UAAU,cAAc,mBAAmB,KAAK;","names":[]}
|