@tern-secure/nextjs 4.2.10 → 5.0.0
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/README.md +33 -33
- package/dist/cjs/app-router/admin/index.js +5 -8
- package/dist/cjs/app-router/admin/index.js.map +1 -1
- package/dist/cjs/app-router/admin/sessionTernSecure.js +3 -6
- package/dist/cjs/app-router/admin/sessionTernSecure.js.map +1 -1
- package/dist/cjs/app-router/client/TernSecureProvider.js +10 -18
- package/dist/cjs/app-router/client/TernSecureProvider.js.map +1 -1
- package/dist/cjs/app-router/client/actions.js +1 -177
- package/dist/cjs/app-router/client/actions.js.map +1 -1
- package/dist/cjs/app-router/route-handler/internal-route.js +4 -35
- package/dist/cjs/app-router/route-handler/internal-route.js.map +1 -1
- package/dist/cjs/boundary/{hooks/useSignUp.js → components.js} +16 -16
- package/dist/cjs/boundary/components.js.map +1 -0
- package/dist/cjs/{lib/utils.js → boundary/hooks.js} +9 -11
- package/dist/cjs/boundary/hooks.js.map +1 -0
- package/dist/cjs/{boundary/TernSecureCtx.js → components/uiComponents.js} +17 -24
- package/dist/cjs/components/uiComponents.js.map +1 -0
- package/dist/cjs/errors.js +1 -0
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.js +13 -27
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/auth.js +4 -5
- package/dist/cjs/server/auth.js.map +1 -1
- package/dist/cjs/server/crypto.js.map +1 -1
- package/dist/cjs/server/ctx-store.js +1 -2
- package/dist/cjs/server/ctx-store.js.map +1 -1
- package/dist/cjs/server/edge-session.js +6 -7
- package/dist/cjs/server/edge-session.js.map +1 -1
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/cjs/server/jwt-edge.js.map +1 -1
- package/dist/cjs/server/jwt.js.map +1 -1
- package/dist/cjs/server/session-store.js +3 -1
- package/dist/cjs/server/session-store.js.map +1 -1
- package/dist/cjs/server/ternSecureMiddleware.js.map +1 -1
- package/dist/cjs/server/types.js.map +1 -1
- package/dist/cjs/server/utils.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/admin-init.js +3 -0
- package/dist/cjs/utils/admin-init.js.map +1 -1
- package/dist/cjs/utils/allNextProviderProps.js +108 -0
- package/dist/cjs/utils/allNextProviderProps.js.map +1 -0
- package/dist/cjs/utils/client-init.js +2 -47
- package/dist/cjs/utils/client-init.js.map +1 -1
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/construct.js.map +1 -1
- package/dist/cjs/utils/create-styles.js.map +1 -1
- package/dist/cjs/utils/redirect.js.map +1 -1
- package/dist/cjs/{components/ui/separator.js → utils/tern-ui-script.js} +41 -24
- package/dist/cjs/utils/tern-ui-script.js.map +1 -0
- package/dist/esm/app-router/admin/index.js +6 -4
- package/dist/esm/app-router/admin/index.js.map +1 -1
- package/dist/esm/app-router/admin/sessionTernSecure.js +3 -6
- package/dist/esm/app-router/admin/sessionTernSecure.js.map +1 -1
- package/dist/esm/app-router/client/TernSecureProvider.js +13 -19
- package/dist/esm/app-router/client/TernSecureProvider.js.map +1 -1
- package/dist/esm/app-router/client/actions.js +1 -157
- package/dist/esm/app-router/client/actions.js.map +1 -1
- package/dist/esm/app-router/route-handler/internal-route.js +5 -30
- package/dist/esm/app-router/route-handler/internal-route.js.map +1 -1
- package/dist/esm/boundary/components.js +18 -0
- package/dist/esm/boundary/components.js.map +1 -0
- package/dist/esm/boundary/hooks.js +9 -0
- package/dist/esm/boundary/hooks.js.map +1 -0
- package/dist/esm/components/uiComponents.js +21 -0
- package/dist/esm/components/uiComponents.js.map +1 -0
- package/dist/esm/errors.js +1 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.js +15 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/auth.js +4 -5
- package/dist/esm/server/auth.js.map +1 -1
- package/dist/esm/server/crypto.js.map +1 -1
- package/dist/esm/server/ctx-store.js +1 -2
- package/dist/esm/server/ctx-store.js.map +1 -1
- package/dist/esm/server/edge-session.js +6 -7
- package/dist/esm/server/edge-session.js.map +1 -1
- package/dist/esm/server/index.js.map +1 -1
- package/dist/esm/server/jwt-edge.js.map +1 -1
- package/dist/esm/server/jwt.js.map +1 -1
- package/dist/esm/server/session-store.js +3 -1
- package/dist/esm/server/session-store.js.map +1 -1
- package/dist/esm/server/ternSecureMiddleware.js.map +1 -1
- package/dist/esm/server/utils.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/admin-init.js +2 -0
- package/dist/esm/utils/admin-init.js.map +1 -1
- package/dist/esm/utils/allNextProviderProps.js +84 -0
- package/dist/esm/utils/allNextProviderProps.js.map +1 -0
- package/dist/esm/utils/client-init.js +2 -21
- package/dist/esm/utils/client-init.js.map +1 -1
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/construct.js.map +1 -1
- package/dist/esm/utils/create-styles.js.map +1 -1
- package/dist/esm/utils/redirect.js.map +1 -1
- package/dist/esm/utils/tern-ui-script.js +42 -0
- package/dist/esm/utils/tern-ui-script.js.map +1 -0
- package/dist/types/app-router/admin/index.d.ts +1 -2
- package/dist/types/app-router/admin/index.d.ts.map +1 -1
- package/dist/types/app-router/client/TernSecureProvider.d.ts +2 -14
- package/dist/types/app-router/client/TernSecureProvider.d.ts.map +1 -1
- package/dist/types/app-router/client/actions.d.ts +1 -54
- package/dist/types/app-router/client/actions.d.ts.map +1 -1
- package/dist/types/app-router/route-handler/internal-route.d.ts +1 -15
- package/dist/types/app-router/route-handler/internal-route.d.ts.map +1 -1
- package/dist/types/boundary/components.d.ts +2 -0
- package/dist/types/boundary/components.d.ts.map +1 -0
- package/dist/types/boundary/hooks.d.ts +2 -0
- package/dist/types/boundary/hooks.d.ts.map +1 -0
- package/dist/types/components/uiComponents.d.ts +6 -0
- package/dist/types/components/uiComponents.d.ts.map +1 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/server/ternSecureMiddleware.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -13
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/admin-init.d.ts +2 -1
- package/dist/types/utils/admin-init.d.ts.map +1 -1
- package/dist/types/utils/allNextProviderProps.d.ts +6 -0
- package/dist/types/utils/allNextProviderProps.d.ts.map +1 -0
- package/dist/types/utils/client-init.d.ts +1 -4
- package/dist/types/utils/client-init.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +1 -1
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/construct.d.ts.map +1 -1
- package/dist/types/utils/tern-ui-script.d.ts +8 -0
- package/dist/types/utils/tern-ui-script.d.ts.map +1 -0
- package/package.json +41 -51
- package/dist/cjs/boundary/TernSecureClientProvider.js +0 -240
- package/dist/cjs/boundary/TernSecureClientProvider.js.map +0 -1
- package/dist/cjs/boundary/TernSecureCtx.js.map +0 -1
- package/dist/cjs/boundary/hooks/useAuth.js +0 -63
- package/dist/cjs/boundary/hooks/useAuth.js.map +0 -1
- package/dist/cjs/boundary/hooks/useSignUp.js.map +0 -1
- package/dist/cjs/components/background.js +0 -65
- package/dist/cjs/components/background.js.map +0 -1
- package/dist/cjs/components/sign-in.js +0 -368
- package/dist/cjs/components/sign-in.js.map +0 -1
- package/dist/cjs/components/sign-out-button.js +0 -84
- package/dist/cjs/components/sign-out-button.js.map +0 -1
- package/dist/cjs/components/sign-out.js +0 -99
- package/dist/cjs/components/sign-out.js.map +0 -1
- package/dist/cjs/components/sign-up.js +0 -332
- package/dist/cjs/components/sign-up.js.map +0 -1
- package/dist/cjs/components/ui/alert.js +0 -88
- package/dist/cjs/components/ui/alert.js.map +0 -1
- package/dist/cjs/components/ui/button.js +0 -84
- package/dist/cjs/components/ui/button.js.map +0 -1
- package/dist/cjs/components/ui/card.js +0 -101
- package/dist/cjs/components/ui/card.js.map +0 -1
- package/dist/cjs/components/ui/input.js +0 -58
- package/dist/cjs/components/ui/input.js.map +0 -1
- package/dist/cjs/components/ui/label.js +0 -55
- package/dist/cjs/components/ui/label.js.map +0 -1
- package/dist/cjs/components/ui/separator.js.map +0 -1
- package/dist/cjs/components/verify.js +0 -195
- package/dist/cjs/components/verify.js.map +0 -1
- package/dist/cjs/lib/utils.d.js +0 -17
- package/dist/cjs/lib/utils.d.js.map +0 -1
- package/dist/cjs/lib/utils.js.map +0 -1
- package/dist/esm/boundary/TernSecureClientProvider.js +0 -216
- package/dist/esm/boundary/TernSecureClientProvider.js.map +0 -1
- package/dist/esm/boundary/TernSecureCtx.js +0 -23
- package/dist/esm/boundary/TernSecureCtx.js.map +0 -1
- package/dist/esm/boundary/hooks/useAuth.js +0 -39
- package/dist/esm/boundary/hooks/useAuth.js.map +0 -1
- package/dist/esm/boundary/hooks/useSignUp.js +0 -16
- package/dist/esm/boundary/hooks/useSignUp.js.map +0 -1
- package/dist/esm/components/background.js +0 -41
- package/dist/esm/components/background.js.map +0 -1
- package/dist/esm/components/sign-in.js +0 -344
- package/dist/esm/components/sign-in.js.map +0 -1
- package/dist/esm/components/sign-out-button.js +0 -60
- package/dist/esm/components/sign-out-button.js.map +0 -1
- package/dist/esm/components/sign-out.js +0 -65
- package/dist/esm/components/sign-out.js.map +0 -1
- package/dist/esm/components/sign-up.js +0 -298
- package/dist/esm/components/sign-up.js.map +0 -1
- package/dist/esm/components/ui/alert.js +0 -52
- package/dist/esm/components/ui/alert.js.map +0 -1
- package/dist/esm/components/ui/button.js +0 -49
- package/dist/esm/components/ui/button.js.map +0 -1
- package/dist/esm/components/ui/card.js +0 -62
- package/dist/esm/components/ui/card.js.map +0 -1
- package/dist/esm/components/ui/input.js +0 -24
- package/dist/esm/components/ui/input.js.map +0 -1
- package/dist/esm/components/ui/label.js +0 -21
- package/dist/esm/components/ui/label.js.map +0 -1
- package/dist/esm/components/ui/separator.js +0 -25
- package/dist/esm/components/ui/separator.js.map +0 -1
- package/dist/esm/components/verify.js +0 -161
- package/dist/esm/components/verify.js.map +0 -1
- package/dist/esm/lib/utils.d.js +0 -1
- package/dist/esm/lib/utils.d.js.map +0 -1
- package/dist/esm/lib/utils.js +0 -9
- package/dist/esm/lib/utils.js.map +0 -1
- package/dist/types/boundary/TernSecureClientProvider.d.ts +0 -27
- package/dist/types/boundary/TernSecureClientProvider.d.ts.map +0 -1
- package/dist/types/boundary/TernSecureCtx.d.ts +0 -11
- package/dist/types/boundary/TernSecureCtx.d.ts.map +0 -1
- package/dist/types/boundary/hooks/useAuth.d.ts +0 -15
- package/dist/types/boundary/hooks/useAuth.d.ts.map +0 -1
- package/dist/types/boundary/hooks/useSignUp.d.ts +0 -5
- package/dist/types/boundary/hooks/useSignUp.d.ts.map +0 -1
- package/dist/types/components/background.d.ts +0 -2
- package/dist/types/components/background.d.ts.map +0 -1
- package/dist/types/components/sign-in.d.ts +0 -18
- package/dist/types/components/sign-in.d.ts.map +0 -1
- package/dist/types/components/sign-out-button.d.ts +0 -14
- package/dist/types/components/sign-out-button.d.ts.map +0 -1
- package/dist/types/components/sign-out.d.ts +0 -12
- package/dist/types/components/sign-out.d.ts.map +0 -1
- package/dist/types/components/sign-up.d.ts +0 -11
- package/dist/types/components/sign-up.d.ts.map +0 -1
- package/dist/types/components/ui/alert.d.ts +0 -9
- package/dist/types/components/ui/alert.d.ts.map +0 -1
- package/dist/types/components/ui/button.d.ts +0 -12
- package/dist/types/components/ui/button.d.ts.map +0 -1
- package/dist/types/components/ui/card.d.ts +0 -9
- package/dist/types/components/ui/card.d.ts.map +0 -1
- package/dist/types/components/ui/input.d.ts +0 -4
- package/dist/types/components/ui/input.d.ts.map +0 -1
- package/dist/types/components/ui/label.d.ts +0 -6
- package/dist/types/components/ui/label.d.ts.map +0 -1
- package/dist/types/components/ui/separator.d.ts +0 -5
- package/dist/types/components/ui/separator.d.ts.map +0 -1
- package/dist/types/components/verify.d.ts +0 -2
- package/dist/types/components/verify.d.ts.map +0 -1
- package/dist/types/lib/utils.d.ts +0 -3
- package/dist/types/lib/utils.d.ts.map +0 -1
- package/server/package.json +0 -5
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var sign_up_exports = {};
|
|
31
|
-
__export(sign_up_exports, {
|
|
32
|
-
SignUp: () => SignUp
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(sign_up_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
37
|
-
var import_navigation = require("next/navigation");
|
|
38
|
-
var import_link = __toESM(require("next/link"));
|
|
39
|
-
var import_lucide_react = require("lucide-react");
|
|
40
|
-
var import_button = require("./ui/button");
|
|
41
|
-
var import_card = require("./ui/card");
|
|
42
|
-
var import_input = require("./ui/input");
|
|
43
|
-
var import_label = require("./ui/label");
|
|
44
|
-
var import_alert = require("./ui/alert");
|
|
45
|
-
var import_utils = require("../lib/utils");
|
|
46
|
-
var import_background = require("./background");
|
|
47
|
-
var import_separator = require("./ui/separator");
|
|
48
|
-
var import_actions = require("../app-router/client/actions");
|
|
49
|
-
var import_useSignUp = require("../boundary/hooks/useSignUp");
|
|
50
|
-
var import_internal_route = require("../app-router/route-handler/internal-route");
|
|
51
|
-
var import_errors = require("../errors");
|
|
52
|
-
function SignUp({
|
|
53
|
-
redirectUrl,
|
|
54
|
-
onError,
|
|
55
|
-
onSuccess
|
|
56
|
-
}) {
|
|
57
|
-
const pathname = (0, import_navigation.usePathname)();
|
|
58
|
-
const InternalComponent = (0, import_internal_route.handleInternalRoute)(pathname);
|
|
59
|
-
const { setEmail: setContextEmail } = (0, import_useSignUp.useSignUp)();
|
|
60
|
-
if (InternalComponent) {
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalComponent, {});
|
|
62
|
-
}
|
|
63
|
-
const [formData, setFormData] = (0, import_react.useState)({
|
|
64
|
-
email: "",
|
|
65
|
-
password: "",
|
|
66
|
-
confirmPassword: ""
|
|
67
|
-
});
|
|
68
|
-
const [showPassword, setShowPassword] = (0, import_react.useState)(false);
|
|
69
|
-
const [showConfirmPassword, setShowConfirmPassword] = (0, import_react.useState)(false);
|
|
70
|
-
const [isLoading, setLoading] = (0, import_react.useState)(false);
|
|
71
|
-
const [error, setError] = (0, import_react.useState)(null);
|
|
72
|
-
const [passwordFocused, setPasswordFocused] = (0, import_react.useState)(false);
|
|
73
|
-
const router = (0, import_navigation.useRouter)();
|
|
74
|
-
const passwordRequirements = [
|
|
75
|
-
{
|
|
76
|
-
text: "At least 8 characters long",
|
|
77
|
-
satisfied: formData.password.length >= 8
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
text: "Contains at least one uppercase letter",
|
|
81
|
-
satisfied: /[A-Z]/.test(formData.password)
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
text: "Contains at least one lowercase letter",
|
|
85
|
-
satisfied: /[a-z]/.test(formData.password)
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
text: "Contains at least one number",
|
|
89
|
-
satisfied: /\d/.test(formData.password)
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
text: "Contains at least one special character",
|
|
93
|
-
satisfied: /[!@#$%^&*(),.?":{}|<>]/.test(formData.password)
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
text: "Passwords match",
|
|
97
|
-
satisfied: formData.password === formData.confirmPassword && formData.password !== ""
|
|
98
|
-
}
|
|
99
|
-
];
|
|
100
|
-
const handleInputChange = (e) => {
|
|
101
|
-
const { name, value } = e.target;
|
|
102
|
-
setFormData((prev) => ({
|
|
103
|
-
...prev,
|
|
104
|
-
[name]: value
|
|
105
|
-
}));
|
|
106
|
-
setError(null);
|
|
107
|
-
};
|
|
108
|
-
const isFormValid = () => {
|
|
109
|
-
return formData.email.length > 0 && passwordRequirements.every((req) => req.satisfied);
|
|
110
|
-
};
|
|
111
|
-
const handleSubmit = async (e) => {
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
if (!isFormValid()) return;
|
|
114
|
-
setLoading(true);
|
|
115
|
-
setError(null);
|
|
116
|
-
try {
|
|
117
|
-
const result = await (0, import_actions.createUser)(formData.email, formData.password);
|
|
118
|
-
if (result.success) {
|
|
119
|
-
setContextEmail(formData.email);
|
|
120
|
-
onSuccess == null ? void 0 : onSuccess();
|
|
121
|
-
router.push(`sign-up/verify`);
|
|
122
|
-
} else {
|
|
123
|
-
setError(result);
|
|
124
|
-
}
|
|
125
|
-
} catch (error2) {
|
|
126
|
-
const errorMessage = error2;
|
|
127
|
-
setError(errorMessage);
|
|
128
|
-
onError == null ? void 0 : onError(error2 instanceof Error ? error2 : new Error("Failed to create account"));
|
|
129
|
-
} finally {
|
|
130
|
-
setLoading(false);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
const handleSocialSignIn = async (provider) => {
|
|
134
|
-
setLoading(true);
|
|
135
|
-
try {
|
|
136
|
-
const currentUrl = new URL(window.location.href);
|
|
137
|
-
currentUrl.searchParams.set("signInRedirect", "true");
|
|
138
|
-
window.history.replaceState({}, "", currentUrl.toString());
|
|
139
|
-
const result = provider === "google" ? await (0, import_actions.signInWithRedirectGoogle)() : await (0, import_actions.signInWithMicrosoft)();
|
|
140
|
-
if (!result.success) {
|
|
141
|
-
throw new Error(result.error);
|
|
142
|
-
}
|
|
143
|
-
} catch (err) {
|
|
144
|
-
const errorMessage = err;
|
|
145
|
-
setError(errorMessage);
|
|
146
|
-
const newUrl = new URL(window.location.href);
|
|
147
|
-
newUrl.searchParams.delete("signInRedirect");
|
|
148
|
-
window.history.replaceState({}, "", newUrl.toString());
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative flex min-h-screen items-center justify-center", children: [
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_background.AuthBackground, {}),
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { className: "w-full max-w-md mx-auto mt-8", children: [
|
|
154
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardHeader, { className: "space-y-1 text-center", children: [
|
|
155
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardTitle, { className: "text-2xl font-bold", children: "Create an account" }),
|
|
156
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardDescription, { children: "Enter your information below to create your account" })
|
|
157
|
-
] }),
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: handleSubmit, children: [
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardContent, { className: "space-y-4", children: [
|
|
160
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.Alert, { variant: (0, import_errors.getErrorAlertVariant)(error), className: "animate-in fade-in-50", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { children: error.message }) }),
|
|
161
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
162
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "email", children: "Email" }),
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
|
-
import_input.Input,
|
|
165
|
-
{
|
|
166
|
-
id: "email",
|
|
167
|
-
name: "email",
|
|
168
|
-
type: "email",
|
|
169
|
-
placeholder: "name@example.com",
|
|
170
|
-
value: formData.email,
|
|
171
|
-
onChange: handleInputChange,
|
|
172
|
-
required: true,
|
|
173
|
-
disabled: isLoading
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 relative flex-1", children: [
|
|
178
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "password", children: "Password" }),
|
|
179
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
180
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
-
import_input.Input,
|
|
182
|
-
{
|
|
183
|
-
id: "password",
|
|
184
|
-
name: "password",
|
|
185
|
-
type: showPassword ? "text" : "password",
|
|
186
|
-
value: formData.password,
|
|
187
|
-
onChange: handleInputChange,
|
|
188
|
-
onFocus: () => setPasswordFocused(true),
|
|
189
|
-
onBlur: () => setPasswordFocused(false),
|
|
190
|
-
required: true,
|
|
191
|
-
disabled: isLoading
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
195
|
-
import_button.Button,
|
|
196
|
-
{
|
|
197
|
-
type: "button",
|
|
198
|
-
variant: "ghost",
|
|
199
|
-
size: "icon",
|
|
200
|
-
className: "absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 hover:bg-transparent",
|
|
201
|
-
onClick: () => setShowPassword(!showPassword),
|
|
202
|
-
children: [
|
|
203
|
-
showPassword ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.EyeOff, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Eye, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
|
|
204
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: showPassword ? "Hide password" : "Show password" })
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
] })
|
|
209
|
-
] }),
|
|
210
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 relative flex-1", children: [
|
|
211
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "confirmPassword", children: "Confirm Password" }),
|
|
212
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
213
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
214
|
-
import_input.Input,
|
|
215
|
-
{
|
|
216
|
-
id: "confirmPassword",
|
|
217
|
-
name: "confirmPassword",
|
|
218
|
-
type: showConfirmPassword ? "text" : "password",
|
|
219
|
-
value: formData.confirmPassword,
|
|
220
|
-
onChange: handleInputChange,
|
|
221
|
-
required: true,
|
|
222
|
-
disabled: isLoading
|
|
223
|
-
}
|
|
224
|
-
),
|
|
225
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
226
|
-
import_button.Button,
|
|
227
|
-
{
|
|
228
|
-
type: "button",
|
|
229
|
-
variant: "ghost",
|
|
230
|
-
size: "icon",
|
|
231
|
-
className: "absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 hover:bg-transparent",
|
|
232
|
-
onClick: () => setShowConfirmPassword(!showConfirmPassword),
|
|
233
|
-
children: [
|
|
234
|
-
showConfirmPassword ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.EyeOff, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Eye, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
|
|
235
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: showConfirmPassword ? "Hide password" : "Show password" })
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
] })
|
|
240
|
-
] }),
|
|
241
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
242
|
-
"div",
|
|
243
|
-
{
|
|
244
|
-
className: (0, import_utils.cn)(
|
|
245
|
-
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
246
|
-
"p-4 transition-all duration-200",
|
|
247
|
-
passwordFocused ? "opacity-100" : "opacity-70"
|
|
248
|
-
),
|
|
249
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-2 text-sm", children: passwordRequirements.map((requirement, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
250
|
-
"div",
|
|
251
|
-
{
|
|
252
|
-
className: (0, import_utils.cn)(
|
|
253
|
-
"flex items-center gap-2",
|
|
254
|
-
requirement.satisfied ? "text-green-500" : "text-muted-foreground"
|
|
255
|
-
),
|
|
256
|
-
children: [
|
|
257
|
-
requirement.satisfied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4 shrink-0" }),
|
|
258
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm", children: requirement.text })
|
|
259
|
-
]
|
|
260
|
-
},
|
|
261
|
-
index
|
|
262
|
-
)) })
|
|
263
|
-
}
|
|
264
|
-
)
|
|
265
|
-
] }),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardFooter, { className: "flex flex-col space-y-4", children: [
|
|
267
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { type: "submit", className: "w-full", disabled: !isFormValid() || isLoading, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
268
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
269
|
-
"Creating account..."
|
|
270
|
-
] }) : "Create account" }),
|
|
271
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground text-center", children: [
|
|
272
|
-
"Already have an account?",
|
|
273
|
-
" ",
|
|
274
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/sign-in", className: "text-primary underline-offset-4 transition-colors hover:underline", children: "Sign in" }),
|
|
275
|
-
" or sign up with email"
|
|
276
|
-
] })
|
|
277
|
-
] })
|
|
278
|
-
] }),
|
|
279
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { className: "my-4 px-6" }),
|
|
280
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-6 pb-4", children: [
|
|
281
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
282
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { className: "w-full" }) }),
|
|
283
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative flex justify-center text-xs uppercase", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "bg-background px-2 text-muted-foreground", children: "Or continue with" }) })
|
|
284
|
-
] }),
|
|
285
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-4 mt-4", children: [
|
|
286
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
287
|
-
import_button.Button,
|
|
288
|
-
{
|
|
289
|
-
variant: "outline",
|
|
290
|
-
disabled: isLoading,
|
|
291
|
-
onClick: () => handleSocialSignIn("google"),
|
|
292
|
-
className: "flex items-center justify-center",
|
|
293
|
-
children: [
|
|
294
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
295
|
-
/* @__PURE__ */ (0, import_jsx_runtime.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" }),
|
|
296
|
-
/* @__PURE__ */ (0, import_jsx_runtime.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" }),
|
|
297
|
-
/* @__PURE__ */ (0, import_jsx_runtime.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" }),
|
|
298
|
-
/* @__PURE__ */ (0, import_jsx_runtime.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" })
|
|
299
|
-
] }),
|
|
300
|
-
"Google"
|
|
301
|
-
]
|
|
302
|
-
}
|
|
303
|
-
),
|
|
304
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
305
|
-
import_button.Button,
|
|
306
|
-
{
|
|
307
|
-
variant: "outline",
|
|
308
|
-
disabled: isLoading,
|
|
309
|
-
onClick: () => handleSocialSignIn("microsoft"),
|
|
310
|
-
className: "flex items-center justify-center",
|
|
311
|
-
children: [
|
|
312
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className: "w-5 h-5 mr-2", viewBox: "0 0 23 23", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
313
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#f3f3f3", d: "M0 0h23v23H0z" }),
|
|
314
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#f35325", d: "M1 1h10v10H1z" }),
|
|
315
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#81bc06", d: "M12 1h10v10H12z" }),
|
|
316
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#05a6f0", d: "M1 12h10v10H1z" }),
|
|
317
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "#ffba08", d: "M12 12h10v10H12z" })
|
|
318
|
-
] }),
|
|
319
|
-
"Microsoft"
|
|
320
|
-
]
|
|
321
|
-
}
|
|
322
|
-
)
|
|
323
|
-
] })
|
|
324
|
-
] })
|
|
325
|
-
] })
|
|
326
|
-
] });
|
|
327
|
-
}
|
|
328
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
329
|
-
0 && (module.exports = {
|
|
330
|
-
SignUp
|
|
331
|
-
});
|
|
332
|
-
//# sourceMappingURL=sign-up.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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'\nimport { SignInResponse } from \"../types\"\nimport { getErrorAlertVariant, ErrorCode} from \"../errors\"\n\nexport interface SignUpProps {\n redirectUrl?: string\n onError?: (error: Error) => void\n onSuccess?: () => void\n}\n\nexport interface PasswordRequirement {\n text: string\n satisfied: boolean\n}\n\n\nexport function SignUp({\n redirectUrl, \n onError,\n onSuccess,\n }: SignUpProps) {\n const pathname = usePathname()\n const InternalComponent = handleInternalRoute(pathname)\n const { setEmail: setContextEmail } = useSignUp()\n\n if (InternalComponent) {\n return <InternalComponent />\n }\n\n \n const [formData, setFormData] = useState({\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<SignInResponse | null>(null)\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 setError(null)\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 setError(null)\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 } else {\n setError(result)\n }\n } catch (error) {\n const errorMessage = error as SignInResponse\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 as SignInResponse\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={getErrorAlertVariant(error)} className=\"animate-in fade-in-50\">\n <AlertDescription>{error.message}</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 relative flex-1\">\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 h-8 w-8 hover:bg-transparent\"\n onClick={() => setShowPassword(!showPassword)}\n >\n {showPassword ? <EyeOff className=\"h-4 w-4 text-muted-foreground hover:text-foreground\" /> : <Eye className=\"h-4 w-4 text-muted-foreground hover:text-foreground\" />}\n <span className=\"sr-only\">{showPassword ? \"Hide password\" : \"Show password\"}</span>\n </Button>\n </div>\n </div>\n\n <div className=\"space-y-2 relative flex-1\">\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 h-8 w-8 hover:bg-transparent\"\n onClick={() => setShowConfirmPassword(!showConfirmPassword)}\n >\n {showConfirmPassword ? <EyeOff className=\"h-4 w-4 text-muted-foreground hover:text-foreground\" /> : <Eye className=\"h-4 w-4 text-muted-foreground hover:text-foreground\" />}\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 f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CAA2C,8BAE3D,GACF;AAAA,WACF;AAAA,QACA,6CAAC,SAAI,WAAU,+BACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,UAAU;AAAA,cACV,SAAS,MAAM,mBAAmB,QAAQ;AAAA,cAC1C,WAAU;AAAA,cAEV;AAAA,6DAAC,SAAI,WAAU,gBAAe,SAAQ,aAAY,OAAM,8BACtD;AAAA,8DAAC,UAAK,GAAE,2HAA0H,MAAK,WAAS;AAAA,kBAChJ,4CAAC,UAAK,GAAE,yIAAwI,MAAK,WAAS;AAAA,kBAC9J,4CAAC,UAAK,GAAE,iIAAgI,MAAK,WAAS;AAAA,kBACtJ,4CAAC,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,6DAAC,SAAI,WAAU,gBAAe,SAAQ,aAAY,OAAM,8BACtD;AAAA,8DAAC,UAAK,MAAK,WAAU,GAAE,iBAAe;AAAA,kBACtC,4CAAC,UAAK,MAAK,WAAU,GAAE,iBAAe;AAAA,kBACtC,4CAAC,UAAK,MAAK,WAAU,GAAE,mBAAiB;AAAA,kBACxC,4CAAC,UAAK,MAAK,WAAU,GAAE,kBAAgB;AAAA,kBACvC,4CAAC,UAAK,MAAK,WAAU,GAAE,oBAAkB;AAAA,mBAC3C;AAAA,gBAAM;AAAA;AAAA;AAAA,UAER;AAAA,WACF;AAAA,SACF;AAAA,OACJ;AAAA,KACF;AAEJ;","names":["error","Link"]}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var alert_exports = {};
|
|
30
|
-
__export(alert_exports, {
|
|
31
|
-
Alert: () => Alert,
|
|
32
|
-
AlertDescription: () => AlertDescription,
|
|
33
|
-
AlertTitle: () => AlertTitle
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(alert_exports);
|
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var React = __toESM(require("react"));
|
|
38
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
39
|
-
var import_utils = require("../../lib/utils");
|
|
40
|
-
const alertVariants = (0, import_class_variance_authority.cva)(
|
|
41
|
-
"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",
|
|
42
|
-
{
|
|
43
|
-
variants: {
|
|
44
|
-
variant: {
|
|
45
|
-
default: "bg-background text-foreground",
|
|
46
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
variant: "default"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
ref,
|
|
58
|
-
role: "alert",
|
|
59
|
-
className: (0, import_utils.cn)(alertVariants({ variant }), className),
|
|
60
|
-
...props
|
|
61
|
-
}
|
|
62
|
-
));
|
|
63
|
-
Alert.displayName = "Alert";
|
|
64
|
-
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
-
"h5",
|
|
66
|
-
{
|
|
67
|
-
ref,
|
|
68
|
-
className: (0, import_utils.cn)("mb-1 font-medium leading-none tracking-tight", className),
|
|
69
|
-
...props
|
|
70
|
-
}
|
|
71
|
-
));
|
|
72
|
-
AlertTitle.displayName = "AlertTitle";
|
|
73
|
-
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
ref,
|
|
77
|
-
className: (0, import_utils.cn)("text-sm [&_p]:leading-relaxed", className),
|
|
78
|
-
...props
|
|
79
|
-
}
|
|
80
|
-
));
|
|
81
|
-
AlertDescription.displayName = "AlertDescription";
|
|
82
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
-
0 && (module.exports = {
|
|
84
|
-
Alert,
|
|
85
|
-
AlertDescription,
|
|
86
|
-
AlertTitle
|
|
87
|
-
});
|
|
88
|
-
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBE;AAzBF,YAAuB;AACvB,sCAAuC;AAEvC,mBAAmB;AAEnB,MAAM,oBAAgB;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,eAAW,iBAAG,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,eAAW,iBAAG,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,eAAW,iBAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;","names":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var button_exports = {};
|
|
30
|
-
__export(button_exports, {
|
|
31
|
-
Button: () => Button,
|
|
32
|
-
buttonVariants: () => buttonVariants
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(button_exports);
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var React = __toESM(require("react"));
|
|
37
|
-
var import_react_slot = require("@radix-ui/react-slot");
|
|
38
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
39
|
-
var import_utils = require("../../lib/utils");
|
|
40
|
-
const buttonVariants = (0, import_class_variance_authority.cva)(
|
|
41
|
-
"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",
|
|
42
|
-
{
|
|
43
|
-
variants: {
|
|
44
|
-
variant: {
|
|
45
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
46
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
47
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
48
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
49
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
50
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
51
|
-
},
|
|
52
|
-
size: {
|
|
53
|
-
default: "h-9 px-4 py-2",
|
|
54
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
55
|
-
lg: "h-10 rounded-md px-8",
|
|
56
|
-
icon: "h-9 w-9"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
defaultVariants: {
|
|
60
|
-
variant: "default",
|
|
61
|
-
size: "default"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
const Button = React.forwardRef(
|
|
66
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
67
|
-
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
68
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
-
Comp,
|
|
70
|
-
{
|
|
71
|
-
className: (0, import_utils.cn)(buttonVariants({ variant, size, className })),
|
|
72
|
-
ref,
|
|
73
|
-
...props
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
Button.displayName = "Button";
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
Button,
|
|
82
|
-
buttonVariants
|
|
83
|
-
});
|
|
84
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CM;AA9CN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AAEvC,mBAAmB;AAEnB,MAAM,qBAAiB;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,yBAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,iBAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|