@molecule/app-auth-modal-react 3.0.0 → 4.0.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/README.md +5 -5
- package/dist/AuthModal.d.ts.map +1 -1
- package/dist/AuthModal.js +4 -4
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-
|
|
6
|
+
Generated: 2026-11-13T16:12:32.351Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-auth-modal-react
|
|
@@ -264,12 +264,12 @@ const DEFAULT_UPGRADE_PATHS: readonly string[]
|
|
|
264
264
|
|
|
265
265
|
Peer dependencies:
|
|
266
266
|
|
|
267
|
-
- `@molecule/app-auth-shell-react` ^
|
|
267
|
+
- `@molecule/app-auth-shell-react` ^4.0.0
|
|
268
268
|
- `@molecule/app-i18n` ^1.0.1
|
|
269
|
-
- `@molecule/app-oauth-buttons-react` ^
|
|
270
|
-
- `@molecule/app-react` ^
|
|
269
|
+
- `@molecule/app-oauth-buttons-react` ^4.0.0
|
|
270
|
+
- `@molecule/app-react` ^4.4.0
|
|
271
271
|
- `@molecule/app-ui` ^1.0.1
|
|
272
|
-
- `@molecule/app-ui-react` ^
|
|
272
|
+
- `@molecule/app-ui-react` ^4.0.0
|
|
273
273
|
- `react` ^18.0.0 || ^19.0.0
|
|
274
274
|
|
|
275
275
|
### Runtime Dependencies
|
package/dist/AuthModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthModal.d.ts","sourceRoot":"","sources":["../src/AuthModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"AuthModal.d.ts","sourceRoot":"","sources":["../src/AuthModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAA;AAYrE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAI9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AA0CvD,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAA;IACb,4DAA4D;IAC5D,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,aAAa,CAAA;IAC3B;;;OAGG;IACH,WAAW,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,OAAO,EACP,WAAsB,EACtB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAoB,GACrB,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAqQ9B;yBA9Qe,SAAS"}
|
package/dist/AuthModal.js
CHANGED
|
@@ -19,9 +19,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
19
19
|
*/
|
|
20
20
|
import { useEffect, useState } from 'react';
|
|
21
21
|
import { useAuthFormState } from '@molecule/app-auth-shell-react';
|
|
22
|
-
import { t } from '@molecule/app-i18n';
|
|
23
22
|
import { OAuthButtons, OAuthDivider } from '@molecule/app-oauth-buttons-react';
|
|
24
|
-
import { useAuth, useAuthClient, useI18nError, useLogin, useSignup } from '@molecule/app-react';
|
|
23
|
+
import { useAuth, useAuthClient, useI18nError, useLogin, useSignup, useTranslation, } from '@molecule/app-react';
|
|
25
24
|
import { useOAuth } from '@molecule/app-react';
|
|
26
25
|
import { getClassMap } from '@molecule/app-ui';
|
|
27
26
|
import { Button, Icon, Modal } from '@molecule/app-ui-react';
|
|
@@ -67,6 +66,7 @@ function useTouchFirstViewport() {
|
|
|
67
66
|
* @returns The modal element (renders nothing when closed).
|
|
68
67
|
*/
|
|
69
68
|
export function AuthModal({ open, onClose, initialMode = 'signup', oauthConfig, onBeforeAuth, onAuthenticated, captchaSlot, captchaSolved = true, }) {
|
|
69
|
+
const { t } = useTranslation();
|
|
70
70
|
const cm = getClassMap();
|
|
71
71
|
const isTouchFirst = useTouchFirstViewport();
|
|
72
72
|
const [mode, setMode] = useState(initialMode);
|
|
@@ -169,7 +169,7 @@ export function AuthModal({ open, onClose, initialMode = 'signup', oauthConfig,
|
|
|
169
169
|
textAlign: 'center',
|
|
170
170
|
}, children: [_jsx(Icon, { name: "check-circle", size: 44, className: cm.textSuccess, "aria-hidden": "true" }), _jsx("div", { style: { fontSize: 17, fontWeight: 600 }, children: isSignup
|
|
171
171
|
? t('auth.modal.signedUp', undefined, { defaultValue: 'Signed up!' })
|
|
172
|
-
: t('auth.modal.loggedIn', undefined, { defaultValue: 'Logged in!' }) }), who && (_jsx("div", { className: cm.textMuted, style: { fontSize: 13 }, children: t('auth.modal.loggedInAs', { who }, { defaultValue:
|
|
172
|
+
: t('auth.modal.loggedIn', undefined, { defaultValue: 'Logged in!' }) }), who && (_jsx("div", { className: cm.textMuted, style: { fontSize: 13 }, children: t('auth.modal.loggedInAs', { who }, { defaultValue: 'Logged in as {{who}}' }) }))] }));
|
|
173
173
|
})()) : (_jsxs(_Fragment, { children: [_jsx("div", { className: cm.textMuted, style: { marginBottom: 12, fontSize: 13, lineHeight: 1.45 }, children: isSignup
|
|
174
174
|
? t('auth.modal.signupBlurb', undefined, {
|
|
175
175
|
defaultValue: 'Sign up to keep your work.',
|
|
@@ -179,7 +179,7 @@ export function AuthModal({ open, onClose, initialMode = 'signup', oauthConfig,
|
|
|
179
179
|
}) }), _jsxs("form", { onSubmit: (e) => void handleSubmit(e), style: { display: 'grid', gap: 10 }, children: [isSignup && (_jsx("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), autoComplete: "name", "data-mol-id": "auth-modal-name", placeholder: t('auth.signup.name', undefined, {
|
|
180
180
|
defaultValue: 'Name (optional)',
|
|
181
181
|
}), style: fieldStyle })), _jsx("input", { type: "email", value: email, onChange: (e) => setField('email', e.target.value), autoComplete: "email", autoFocus: true, required: true, "data-mol-id": "auth-modal-email", placeholder: t('auth.login.email', undefined, { defaultValue: 'Email' }), style: fieldStyle }), _jsx("input", { type: "password", value: password, onChange: (e) => setPassword(e.target.value), autoComplete: isSignup ? 'new-password' : 'current-password', required: true, "data-mol-id": "auth-modal-password", placeholder: t('auth.login.password', undefined, { defaultValue: 'Password' }), style: fieldStyle }), !isSignup && (_jsx("input", { type: "text", inputMode: "numeric", value: twoFactorToken, onChange: (e) => setTwoFactorToken(e.target.value), autoComplete: "one-time-code", "data-mol-id": "auth-modal-2fa", placeholder: t('auth.login.twoFactor', undefined, {
|
|
182
|
-
defaultValue: '
|
|
182
|
+
defaultValue: 'Two-Factor Token (If enabled)',
|
|
183
183
|
}), style: fieldStyle })), isSignup && captchaSlot && (_jsx("div", { "data-mol-id": "auth-modal-captcha", style: { display: 'grid', marginTop: 2 }, children: captchaSlot })), _jsx(Button, { type: "submit", size: "lg", color: "success", disabled: busy || (isSignup && !captchaSolved), "data-mol-id": "auth-modal-submit", style: { width: '100%', marginTop: 2 }, children: busy
|
|
184
184
|
? t('auth.modal.working', undefined, { defaultValue: 'Just a moment…' })
|
|
185
185
|
: isSignup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-auth-modal-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "In-app login / signup modal + click-interceptor + popup OAuth — authenticate and upgrade without ever navigating away or losing work",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-auth-modal-react",
|
|
6
6
|
"type": "module",
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
"directory": "packages/app/features/auth-modal-react"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@molecule/app-auth-shell-react": "^
|
|
40
|
+
"@molecule/app-auth-shell-react": "^4.0.0",
|
|
41
41
|
"@molecule/app-i18n": "^1.0.1",
|
|
42
|
-
"@molecule/app-oauth-buttons-react": "^
|
|
43
|
-
"@molecule/app-react": "^
|
|
42
|
+
"@molecule/app-oauth-buttons-react": "^4.0.0",
|
|
43
|
+
"@molecule/app-react": "^4.4.0",
|
|
44
44
|
"@molecule/app-ui": "^1.0.1",
|
|
45
|
-
"@molecule/app-ui-react": "^
|
|
45
|
+
"@molecule/app-ui-react": "^4.0.0",
|
|
46
46
|
"react": "^18.0.0 || ^19.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@molecule/app-auth-shell-react": "
|
|
50
|
-
"@molecule/app-i18n": "1.
|
|
51
|
-
"@molecule/app-oauth-buttons-react": "
|
|
52
|
-
"@molecule/app-react": "
|
|
53
|
-
"@molecule/app-ui": "1.3.
|
|
54
|
-
"@molecule/app-ui-react": "
|
|
49
|
+
"@molecule/app-auth-shell-react": "4.0.1",
|
|
50
|
+
"@molecule/app-i18n": "1.2.0",
|
|
51
|
+
"@molecule/app-oauth-buttons-react": "4.0.0",
|
|
52
|
+
"@molecule/app-react": "4.5.0",
|
|
53
|
+
"@molecule/app-ui": "1.3.11",
|
|
54
|
+
"@molecule/app-ui-react": "4.1.2",
|
|
55
55
|
"@testing-library/react": "16.3.3",
|
|
56
56
|
"@types/node": "26.6.5",
|
|
57
57
|
"@types/react": "19.3.0",
|