@tern-secure/nextjs 1.9.9 → 2.0.2
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { signInWithEmail } from '../app-router/client';
|
|
5
|
+
import '../styles/global.css';
|
|
5
6
|
export function SignIn({ onSuccess, onError, redirectUrl, className = '', customStyles = {} }) {
|
|
6
7
|
const [email, setEmail] = useState('');
|
|
7
8
|
const [password, setPassword] = useState('');
|
|
@@ -31,7 +32,7 @@ export function SignIn({ onSuccess, onError, redirectUrl, className = '', custom
|
|
|
31
32
|
form: 'space-y-4',
|
|
32
33
|
label: 'block text-sm font-medium text-gray-700',
|
|
33
34
|
input: 'mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary',
|
|
34
|
-
button: 'w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-
|
|
35
|
+
button: 'w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:opacity-50',
|
|
35
36
|
errorText: 'text-red-500 text-sm'
|
|
36
37
|
};
|
|
37
38
|
const styles = {
|
|
@@ -41,14 +42,19 @@ export function SignIn({ onSuccess, onError, redirectUrl, className = '', custom
|
|
|
41
42
|
button: customStyles.button || defaultStyles.button,
|
|
42
43
|
errorText: customStyles.errorText || defaultStyles.errorText
|
|
43
44
|
};
|
|
44
|
-
return (React.createElement("
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
React.createElement("
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
return (React.createElement("div", { className: "flex min-h-full flex-1 flex-col justify-center py-12 sm:px-6 lg:px-8" },
|
|
46
|
+
React.createElement("div", { className: "sm:mx-auto sm:w-full sm:max-w-md" },
|
|
47
|
+
React.createElement("h2", { className: `mt-6 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900}` }, "Sign in to your account")),
|
|
48
|
+
React.createElement("div", { className: "mt-10 sm:mx-auto sm:w-full sm:max-w-[480px]" },
|
|
49
|
+
React.createElement("div", { className: "px-6 py-12 shadow sm:rounded-lg sm:px-12 " },
|
|
50
|
+
React.createElement("form", { onSubmit: handleSubmit, className: `${styles.form} ${className}`, role: "form", "aria-label": "Sign in form" },
|
|
51
|
+
error && (React.createElement("div", { className: styles.errorText, role: "alert", "aria-live": "polite" }, error)),
|
|
52
|
+
React.createElement("div", null,
|
|
53
|
+
React.createElement("label", { htmlFor: "email", className: styles.label }, "Email"),
|
|
54
|
+
React.createElement("input", { id: "email", type: "email", value: email, onChange: (e) => setEmail(e.target.value), placeholder: "Enter your email", required: true, className: styles.input, disabled: loading, "aria-required": "true", "aria-invalid": !!error })),
|
|
55
|
+
React.createElement("div", null,
|
|
56
|
+
React.createElement("label", { htmlFor: "password", className: styles.label }, "Password"),
|
|
57
|
+
React.createElement("input", { id: "password", type: "password", value: password, onChange: (e) => setPassword(e.target.value), placeholder: "Enter your password", required: true, className: styles.input, disabled: loading, "aria-required": "true", "aria-invalid": !!error })),
|
|
58
|
+
React.createElement("button", { type: "submit", disabled: loading, className: styles.button, "data-testid": "sign-in-submit" }, loading ? 'Signing in...' : 'Sign in'))))));
|
|
53
59
|
}
|
|
54
60
|
//# sourceMappingURL=sign-in.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../../src/components/sign-in.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sB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;wBACE,+BAAO,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,MAAM,CAAC,KAAK,YAEtC;wBACR,+BACE,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,WAAW,EAAC,kBAAkB,EAC9B,QAAQ,QACR,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,QAAQ,EAAE,OAAO,mBACH,MAAM,kBACN,CAAC,CAAC,KAAK,GACrB,CACE;oBACN;wBACE,+BAAO,OAAO,EAAC,UAAU,EAAC,SAAS,EAAE,MAAM,CAAC,KAAK,eAEzC;wBACR,+BACE,EAAE,EAAC,UAAU,EACb,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,WAAW,EAAC,qBAAqB,EACjC,QAAQ,QACR,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,QAAQ,EAAE,OAAO,mBACH,MAAM,kBACN,CAAC,CAAC,KAAK,GACrB,CACE;oBACN,gCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,MAAM,CAAC,MAAM,iBACZ,gBAAgB,IAE3B,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAC/B,CACJ,CACD,CACA,CACA,CACP,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tern-secure/nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@types/react": "^18.3.12",
|
|
41
41
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
42
42
|
"@typescript-eslint/parser": "^8.15.0",
|
|
43
|
+
"autoprefixer": "^10.4.20",
|
|
43
44
|
"eslint": "^9.15.0",
|
|
44
45
|
"firebase": "^11.0.2",
|
|
45
46
|
"firebase-admin": "^13.0.1",
|
|
@@ -47,24 +48,29 @@
|
|
|
47
48
|
"jest": "^29.7.0",
|
|
48
49
|
"jest-environment-jsdom": "^29.7.0",
|
|
49
50
|
"next": "^15.0.3",
|
|
51
|
+
"postcss": "^8.4.49",
|
|
52
|
+
"postcss-cli": "^11.0.0",
|
|
50
53
|
"prettier": "^3.3.3",
|
|
51
54
|
"react": "^18.3.1",
|
|
52
55
|
"react-dom": "^18.3.1",
|
|
53
56
|
"rollup": "^4.27.4",
|
|
54
57
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
58
|
+
"tailwindcss": "^3.4.15",
|
|
55
59
|
"ts-jest": "^29.2.5",
|
|
56
60
|
"ts-node": "^10.9.2",
|
|
57
61
|
"typescript": "^5.7.2"
|
|
58
62
|
},
|
|
59
63
|
"types": "./dist/index.d.ts",
|
|
60
64
|
"files": [
|
|
61
|
-
"dist"
|
|
65
|
+
"dist",
|
|
66
|
+
"styles"
|
|
62
67
|
],
|
|
63
68
|
"peerDependencies": {
|
|
64
69
|
"firebase": "^10.0.0",
|
|
65
70
|
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
66
71
|
"react": "^18 || ^19.0.0-0",
|
|
67
|
-
"react-dom": "^18 || ^19.0.0-0"
|
|
72
|
+
"react-dom": "^18 || ^19.0.0-0",
|
|
73
|
+
"tailwindcss": "^3.4.15"
|
|
68
74
|
},
|
|
69
75
|
"exports": {
|
|
70
76
|
".": {
|