@atlasauth/react 0.4.1 → 0.5.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/CHANGELOG.md +196 -0
- package/dist/AtlasProvider.d.ts +48 -7
- package/dist/AtlasProvider.js +115 -22
- package/dist/AtlasProvider.js.map +1 -1
- package/dist/api-keys.d.ts +63 -0
- package/dist/api-keys.js +227 -0
- package/dist/api-keys.js.map +1 -0
- package/dist/appearance.d.ts +25 -0
- package/dist/appearance.js +56 -1
- package/dist/appearance.js.map +1 -1
- package/dist/captcha.d.ts +43 -0
- package/dist/captcha.js +109 -0
- package/dist/captcha.js.map +1 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +4 -1
- package/dist/components.js.map +1 -1
- package/dist/contrast.d.ts +16 -0
- package/dist/contrast.js +57 -0
- package/dist/contrast.js.map +1 -0
- package/dist/flow.d.ts +17 -2
- package/dist/flow.js +88 -9
- package/dist/flow.js.map +1 -1
- package/dist/hooks.d.ts +7 -2
- package/dist/hooks.js.map +1 -1
- package/dist/i18n.js +44 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/instance-settings.d.ts +7 -0
- package/dist/instance-settings.js +12 -0
- package/dist/instance-settings.js.map +1 -0
- package/dist/sign-in.js +3 -2
- package/dist/sign-in.js.map +1 -1
- package/dist/sign-up.d.ts +13 -0
- package/dist/sign-up.js +120 -2
- package/dist/sign-up.js.map +1 -1
- package/dist/styles.d.ts +14 -2
- package/dist/styles.js +30 -13
- package/dist/styles.js.map +1 -1
- package/package.json +4 -3
package/dist/i18n.js
CHANGED
|
@@ -32,6 +32,18 @@ exports.EN_US = {
|
|
|
32
32
|
'signUp.submit': 'Continue',
|
|
33
33
|
'signUp.haveAccount': 'Already have an account?',
|
|
34
34
|
'signUp.signInLink': 'Sign in',
|
|
35
|
+
'signUp.emailLabel': 'Email address',
|
|
36
|
+
'signUp.passwordLabel': 'Password',
|
|
37
|
+
'signUp.optionalField': '{label} (optional)',
|
|
38
|
+
'signUp.selectPlaceholder': 'Select…',
|
|
39
|
+
'signUp.consentAgree': 'I agree to the',
|
|
40
|
+
'signUp.consentNotice': 'By continuing you agree to the',
|
|
41
|
+
'signUp.terms': 'Terms of Service',
|
|
42
|
+
'signUp.privacy': 'Privacy Policy',
|
|
43
|
+
'signUp.and': 'and',
|
|
44
|
+
'captcha.prompt': 'Complete the security check to continue.',
|
|
45
|
+
'captcha.required': 'Please complete the security check, then try again.',
|
|
46
|
+
'captcha.failed': "The security check didn't pass. Please try again.",
|
|
35
47
|
'mfa.title': 'Two-step verification',
|
|
36
48
|
'mfa.subtitle': 'Enter the code from your authenticator app.',
|
|
37
49
|
'mfa.codeLabel': 'Code',
|
|
@@ -81,6 +93,38 @@ exports.EN_US = {
|
|
|
81
93
|
'reverification.passwordLabel': 'Password',
|
|
82
94
|
'reverification.submit': 'Confirm',
|
|
83
95
|
'reverification.cancel': 'Cancel',
|
|
96
|
+
'apiKeys.title': 'API keys',
|
|
97
|
+
'apiKeys.subtitle': 'Keys let scripts and integrations act as you. Treat them like passwords.',
|
|
98
|
+
'apiKeys.organizationSubtitle': 'Keys let scripts and integrations act as this organization. Treat them like passwords.',
|
|
99
|
+
'apiKeys.empty': 'No API keys yet.',
|
|
100
|
+
'apiKeys.disabled': 'API keys are not available for this account.',
|
|
101
|
+
'apiKeys.create': 'Create key',
|
|
102
|
+
'apiKeys.nameLabel': 'Name',
|
|
103
|
+
'apiKeys.namePlaceholder': 'e.g. CI pipeline',
|
|
104
|
+
'apiKeys.expiresLabel': 'Expires',
|
|
105
|
+
'apiKeys.expiresNever': 'Never',
|
|
106
|
+
'apiKeys.expiresDays': 'In {days} days',
|
|
107
|
+
'apiKeys.scopesLabel': 'Scopes',
|
|
108
|
+
'apiKeys.submit': 'Create key',
|
|
109
|
+
'apiKeys.cancel': 'Cancel',
|
|
110
|
+
'apiKeys.secretTitle': 'Copy your new key',
|
|
111
|
+
'apiKeys.secretHint': 'This is the only time it will be shown. If you lose it, revoke it and create another.',
|
|
112
|
+
'apiKeys.copy': 'Copy',
|
|
113
|
+
'apiKeys.copied': 'Copied',
|
|
114
|
+
'apiKeys.done': 'Done',
|
|
115
|
+
'apiKeys.rename': 'Rename',
|
|
116
|
+
'apiKeys.save': 'Save',
|
|
117
|
+
'apiKeys.revoke': 'Revoke',
|
|
118
|
+
'apiKeys.revokeConfirm': 'Revoke this key? Anything using it will stop working.',
|
|
119
|
+
'apiKeys.revokeConfirmButton': 'Yes, revoke',
|
|
120
|
+
'apiKeys.unnamed': 'Unnamed key',
|
|
121
|
+
'apiKeys.revoked': 'Revoked',
|
|
122
|
+
'apiKeys.expired': 'Expired',
|
|
123
|
+
'apiKeys.lastUsed': 'Last used {date}',
|
|
124
|
+
'apiKeys.neverUsed': 'Never used',
|
|
125
|
+
'apiKeys.expiresOn': 'Expires {date}',
|
|
126
|
+
'apiKeys.limits': 'Limits',
|
|
127
|
+
'apiKeys.limitReached': "You've reached the maximum of {max} active keys. Revoke one to create another.",
|
|
84
128
|
'error.generic': 'Something went wrong. Please try again.',
|
|
85
129
|
'error.network': 'We could not reach the server. Check your connection.',
|
|
86
130
|
};
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AA0IH,8BAOC;AAGD,oCAEC;AAlJY,QAAA,KAAK,GAAY;IAC5B,cAAc,EAAE,SAAS;IACzB,iBAAiB,EAAE,8BAA8B;IACjD,wBAAwB,EAAE,eAAe;IACzC,sBAAsB,EAAE,UAAU;IAClC,eAAe,EAAE,UAAU;IAC3B,uBAAuB,EAAE,kBAAkB;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,uFAAuF;IAC7G,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,QAAQ;IAC1B,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,QAAQ;IAC1B,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,QAAQ;IAC1B,uBAAuB,EAAE,uDAAuD;IAChF,6BAA6B,EAAE,aAAa;IAC5C,iBAAiB,EAAE,aAAa;IAChC,iBAAiB,EAAE,SAAS;IAC5B,iBAAiB,EAAE,SAAS;IAC5B,kBAAkB,EAAE,kBAAkB;IACtC,mBAAmB,EAAE,YAAY;IACjC,mBAAmB,EAAE,gBAAgB;IACrC,gBAAgB,EAAE,QAAQ;IAC1B,sBAAsB,EAAE,gFAAgF;IAExG,eAAe,EAAE,yCAAyC;IAC1D,eAAe,EAAE,uDAAuD;CACzE,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,OAAgB,EAChB,GAAW,EACX,YAAoC,EAAE;IAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,aAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;IACnD,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC3F,CAAC;AAED,kFAAkF;AAClF,SAAgB,YAAY,CAAC,MAAe;IAC1C,OAAO,EAAE,GAAG,aAAK,EAAE,GAAG,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,4 +11,10 @@ export * from './sign-in-with-atlas';
|
|
|
11
11
|
export { checkSession, handleSilentCallback } from '@atlasauth/js';
|
|
12
12
|
export type { CheckSessionOptions, CheckSessionResult } from '@atlasauth/js';
|
|
13
13
|
export { diagnoseProvider } from '@atlasauth/js';
|
|
14
|
+
export { AtlasConfigError, SAME_ORIGIN_FRONTEND_API, SignOutError } from '@atlasauth/js';
|
|
15
|
+
export type { AtlasConfigErrorCode, SignOutOptions, SignOutResult } from '@atlasauth/js';
|
|
16
|
+
export { LOCALIZATION_KEYS, missingKeys, resolveLocale } from '@atlasauth/localizations';
|
|
17
|
+
export type { SupportedLocale } from '@atlasauth/localizations';
|
|
14
18
|
export type { ProviderDiagnosis, OverlayGeometry, Rect } from '@atlasauth/js';
|
|
19
|
+
export type { InstanceSettings, PublicSignUpField } from './instance-settings';
|
|
20
|
+
export type { CaptchaFlowKey, CaptchaWidgetMode, FlowCaptcha } from '@atlasauth/js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.diagnoseProvider = exports.handleSilentCallback = exports.checkSession = void 0;
|
|
17
|
+
exports.resolveLocale = exports.missingKeys = exports.LOCALIZATION_KEYS = exports.SignOutError = exports.SAME_ORIGIN_FRONTEND_API = exports.AtlasConfigError = exports.diagnoseProvider = exports.handleSilentCallback = exports.checkSession = void 0;
|
|
18
18
|
__exportStar(require("./appearance"), exports);
|
|
19
19
|
__exportStar(require("./styles"), exports);
|
|
20
20
|
__exportStar(require("./protect"), exports);
|
|
@@ -35,4 +35,15 @@ Object.defineProperty(exports, "handleSilentCallback", { enumerable: true, get:
|
|
|
35
35
|
// overlay geometry, session credential flag). Surfaced here from @atlasauth/js.
|
|
36
36
|
var js_2 = require("@atlasauth/js");
|
|
37
37
|
Object.defineProperty(exports, "diagnoseProvider", { enumerable: true, get: function () { return js_2.diagnoseProvider; } });
|
|
38
|
+
// Provider configuration errors (a missing/invalid `frontendApi`) and the
|
|
39
|
+
// sign-out result/error types, surfaced from @atlasauth/js.
|
|
40
|
+
var js_3 = require("@atlasauth/js");
|
|
41
|
+
Object.defineProperty(exports, "AtlasConfigError", { enumerable: true, get: function () { return js_3.AtlasConfigError; } });
|
|
42
|
+
Object.defineProperty(exports, "SAME_ORIGIN_FRONTEND_API", { enumerable: true, get: function () { return js_3.SAME_ORIGIN_FRONTEND_API; } });
|
|
43
|
+
Object.defineProperty(exports, "SignOutError", { enumerable: true, get: function () { return js_3.SignOutError; } });
|
|
44
|
+
// Built-in UI languages for `<AtlasProvider locale>` + CI coverage helpers.
|
|
45
|
+
var localizations_1 = require("@atlasauth/localizations");
|
|
46
|
+
Object.defineProperty(exports, "LOCALIZATION_KEYS", { enumerable: true, get: function () { return localizations_1.LOCALIZATION_KEYS; } });
|
|
47
|
+
Object.defineProperty(exports, "missingKeys", { enumerable: true, get: function () { return localizations_1.missingKeys; } });
|
|
48
|
+
Object.defineProperty(exports, "resolveLocale", { enumerable: true, get: function () { return localizations_1.resolveLocale; } });
|
|
38
49
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,0CAAwB;AACxB,yCAAuB;AACvB,+CAA6B;AAC7B,uDAAqC;AACrC,iFAAiF;AACjF,gDAAgD;AAChD,oCAAmE;AAA1D,kGAAA,YAAY,OAAA;AAAE,0GAAA,oBAAoB,OAAA;AAE3C,qFAAqF;AACrF,gFAAgF;AAChF,gFAAgF;AAChF,oCAAiD;AAAxC,sGAAA,gBAAgB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,0CAAwB;AACxB,yCAAuB;AACvB,+CAA6B;AAC7B,uDAAqC;AACrC,iFAAiF;AACjF,gDAAgD;AAChD,oCAAmE;AAA1D,kGAAA,YAAY,OAAA;AAAE,0GAAA,oBAAoB,OAAA;AAE3C,qFAAqF;AACrF,gFAAgF;AAChF,gFAAgF;AAChF,oCAAiD;AAAxC,sGAAA,gBAAgB,OAAA;AACzB,0EAA0E;AAC1E,4DAA4D;AAC5D,oCAAyF;AAAhF,sGAAA,gBAAgB,OAAA;AAAE,8GAAA,wBAAwB,OAAA;AAAE,kGAAA,YAAY,OAAA;AAEjE,4EAA4E;AAC5E,0DAAyF;AAAhF,kHAAA,iBAAiB,OAAA;AAAE,4GAAA,WAAW,OAAA;AAAE,8GAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The instance's public sign-in / sign-up settings (`useAtlas().instanceSettings`),
|
|
3
|
+
* read from the same `GET /v1/appearance` response the provider already fetches
|
|
4
|
+
* for the dashboard design. The parser is shared with every framework SDK's
|
|
5
|
+
* prebuilt forms and lives in `@atlasauth/js`.
|
|
6
|
+
*/
|
|
7
|
+
export { instanceSettingsFrom, type InstanceSettings, type PublicSignUpField, } from '@atlasauth/js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instanceSettingsFrom = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The instance's public sign-in / sign-up settings (`useAtlas().instanceSettings`),
|
|
6
|
+
* read from the same `GET /v1/appearance` response the provider already fetches
|
|
7
|
+
* for the dashboard design. The parser is shared with every framework SDK's
|
|
8
|
+
* prebuilt forms and lives in `@atlasauth/js`.
|
|
9
|
+
*/
|
|
10
|
+
var js_1 = require("@atlasauth/js");
|
|
11
|
+
Object.defineProperty(exports, "instanceSettingsFrom", { enumerable: true, get: function () { return js_1.instanceSettingsFrom; } });
|
|
12
|
+
//# sourceMappingURL=instance-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance-settings.js","sourceRoot":"","sources":["../src/instance-settings.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,oCAIuB;AAHrB,0GAAA,oBAAoB,OAAA"}
|
package/dist/sign-in.js
CHANGED
|
@@ -8,10 +8,11 @@ const react_1 = require("react");
|
|
|
8
8
|
const js_1 = require("@atlasauth/js");
|
|
9
9
|
const AtlasProvider_1 = require("./AtlasProvider");
|
|
10
10
|
const fapi_1 = require("./fapi");
|
|
11
|
+
const captcha_1 = require("./captcha");
|
|
11
12
|
const flow_1 = require("./flow");
|
|
12
13
|
function SignIn(props = {}) {
|
|
13
|
-
const { state, submit, client, finish } = (0, flow_1.useFlow)({ afterUrl: props.afterUrl });
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(flow_1.AttemptFlow, { attempt: state.attempt, busy: state.busy, errors: state.errors, titleKey: "signIn.title", hideTitle: props.hideTitle, onSubmit: submit }), !state.attempt ? ((0, jsx_runtime_1.jsx)(flow_1.SocialSignInButtons, { client: client, onComplete: finish, oneTap: props.googleOneTap, oauthMode: props.oauthMode, onProviderUnavailable: props.onProviderUnavailable, googleButton: props.googleButton })) : null] }));
|
|
14
|
+
const { state, submit, client, finish, captcha } = (0, flow_1.useFlow)({ afterUrl: props.afterUrl });
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(flow_1.AttemptFlow, { attempt: state.attempt, busy: state.busy, errors: state.errors, titleKey: "signIn.title", hideTitle: props.hideTitle, onSubmit: submit, captcha: (0, jsx_runtime_1.jsx)(captcha_1.CaptchaSlot, { controller: captcha }) }), !state.attempt ? ((0, jsx_runtime_1.jsx)(flow_1.SocialSignInButtons, { client: client, onComplete: finish, oneTap: props.googleOneTap, oauthMode: props.oauthMode, onProviderUnavailable: props.onProviderUnavailable, googleButton: props.googleButton })) : null] }));
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* §6 headless native sign-in, for a consumer that renders its OWN Google button
|
package/dist/sign-in.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../src/sign-in.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../src/sign-in.tsx"],"names":[],"mappings":";;AAsBA,wBA4BC;AAUD,8BA2EC;AAwBD,gDA4FC;;AA3PD,iCAAgG;AAChG,sCAMuB;AACvB,mDAA2C;AAC3C,iCAAoD;AACpD,uCAAwC;AACxC,iCASgB;AAEhB,SAAgB,MAAM,CAAC,QAAmB,EAAE;IAC1C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,cAAO,EAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEzF,OAAO,CACL,6DACE,uBAAC,kBAAW,IACV,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,QAAQ,EAAC,cAAc,EACvB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uBAAC,qBAAW,IAAC,UAAU,EAAE,OAAO,GAAI,GAC7C,EAGD,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAChB,uBAAC,0BAAmB,IAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,KAAK,CAAC,YAAY,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,YAAY,EAAE,KAAK,CAAC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C,KAAK,UAAU,CAAC;YACd,QAAQ;YACR,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE;SACjD,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAG,CACb,mCACE,IAAI,EAAC,QAAQ,KACT,WAAW,EACf,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACzB,qEAAqE;YACrE,wEAAwE;YACxE,iDAAiD;YACjD,IAAI,CAAC,YAAY;gBAAE,aAAa,EAAE,CAAC;QACrC,CAAC,YAEA,QAAQ,IAAI,iBAAiB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,GACvD,CACV,CAAC;IAEF,+EAA+E;IAC/E,6EAA6E;IAC7E,8EAA8E;IAC9E,gEAAgE;IAChE,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CACL,iCAAM,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,YAC5E,MAAM,GACF,CACR,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/sign-up.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { type FlowState } from './fapi';
|
|
2
2
|
import { type FlowProps } from './flow';
|
|
3
|
+
/**
|
|
4
|
+
* §10.2 `<SignUp/>` — creates an account.
|
|
5
|
+
*
|
|
6
|
+
* The first step is the create-account form: the instance's configured extra
|
|
7
|
+
* fields, email + password, the legal-consent row and — when the instance
|
|
8
|
+
* requires one on sign-up — the captcha widget. It POSTs `/v1/client/sign_ups`;
|
|
9
|
+
* from there the flow is server-driven exactly like `<SignIn>` (the shared
|
|
10
|
+
* `AttemptFlow` renders the email-code step, which `advance` posts to the
|
|
11
|
+
* sign-up's `attempt_verification`), finishing through the same ticket exchange.
|
|
12
|
+
*
|
|
13
|
+
* All of it is read from the instance's settings, so a field, a consent policy
|
|
14
|
+
* or a captcha switched on in the dashboard appears here with no code change.
|
|
15
|
+
*/
|
|
3
16
|
export declare function SignUp(props?: FlowProps): import("react").JSX.Element;
|
|
4
17
|
/**
|
|
5
18
|
* §5.1 headless sign-up — the sign-up counterpart of {@link useSignIn}. Starts a
|
package/dist/sign-up.js
CHANGED
|
@@ -8,9 +8,127 @@ const js_1 = require("@atlasauth/js");
|
|
|
8
8
|
const AtlasProvider_1 = require("./AtlasProvider");
|
|
9
9
|
const fapi_1 = require("./fapi");
|
|
10
10
|
const flow_1 = require("./flow");
|
|
11
|
+
const captcha_1 = require("./captcha");
|
|
12
|
+
const components_shared_1 = require("./components-shared");
|
|
13
|
+
/**
|
|
14
|
+
* §10.2 `<SignUp/>` — creates an account.
|
|
15
|
+
*
|
|
16
|
+
* The first step is the create-account form: the instance's configured extra
|
|
17
|
+
* fields, email + password, the legal-consent row and — when the instance
|
|
18
|
+
* requires one on sign-up — the captcha widget. It POSTs `/v1/client/sign_ups`;
|
|
19
|
+
* from there the flow is server-driven exactly like `<SignIn>` (the shared
|
|
20
|
+
* `AttemptFlow` renders the email-code step, which `advance` posts to the
|
|
21
|
+
* sign-up's `attempt_verification`), finishing through the same ticket exchange.
|
|
22
|
+
*
|
|
23
|
+
* All of it is read from the instance's settings, so a field, a consent policy
|
|
24
|
+
* or a captcha switched on in the dashboard appears here with no code change.
|
|
25
|
+
*/
|
|
11
26
|
function SignUp(props = {}) {
|
|
12
|
-
const {
|
|
13
|
-
|
|
27
|
+
const { instanceSettings } = (0, AtlasProvider_1.useAtlas)();
|
|
28
|
+
const t = (0, components_shared_1.useText)();
|
|
29
|
+
const { state, setState, submit, client, finish } = (0, flow_1.useFlow)({
|
|
30
|
+
afterUrl: props.afterUrl,
|
|
31
|
+
signInCaptcha: false,
|
|
32
|
+
});
|
|
33
|
+
const signUpFlow = instanceSettings?.captchaFlows.signUp;
|
|
34
|
+
const captcha = (0, captcha_1.useCaptcha)(signUpFlow, {
|
|
35
|
+
active: !state.attempt && (0, js_1.flowNeedsCaptcha)(signUpFlow),
|
|
36
|
+
});
|
|
37
|
+
const create = (0, react_1.useCallback)((values, consent) => {
|
|
38
|
+
void (async () => {
|
|
39
|
+
setState((current) => ({ ...current, busy: true, errors: [] }));
|
|
40
|
+
const { email = '', password = '', ...rest } = values;
|
|
41
|
+
// Drop blank optional fields so the server never sees empty strings.
|
|
42
|
+
const fields = {};
|
|
43
|
+
for (const [key, value] of Object.entries(rest))
|
|
44
|
+
if (value)
|
|
45
|
+
fields[key] = value;
|
|
46
|
+
const token = await captcha.getToken();
|
|
47
|
+
let next = await (0, js_1.startSignUp)(client, {
|
|
48
|
+
email,
|
|
49
|
+
password,
|
|
50
|
+
fields,
|
|
51
|
+
consent,
|
|
52
|
+
captchaToken: token ?? undefined,
|
|
53
|
+
});
|
|
54
|
+
const localized = (0, captcha_1.localizeCaptchaErrors)(next.errors, t);
|
|
55
|
+
next = { ...next, errors: localized.errors };
|
|
56
|
+
// The token was spent either way; a refused create needs a fresh one.
|
|
57
|
+
if (next.errors.length > 0 && captcha.needed)
|
|
58
|
+
captcha.reset();
|
|
59
|
+
await finish(next);
|
|
60
|
+
})();
|
|
61
|
+
}, [captcha, client, finish, setState, t]);
|
|
62
|
+
if (state.attempt) {
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(flow_1.AttemptFlow, { attempt: state.attempt, busy: state.busy, errors: state.errors, titleKey: "signUp.title", hideTitle: props.hideTitle, onSubmit: submit }));
|
|
64
|
+
}
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(SignUpForm, { settings: instanceSettings, busy: state.busy, errors: state.errors, hideTitle: props.hideTitle, captcha: captcha, onSubmit: create }));
|
|
66
|
+
}
|
|
67
|
+
/** The create-account step. Values are kept in state so an error never clears them. */
|
|
68
|
+
function SignUpForm({ settings, busy, errors, hideTitle, captcha, onSubmit, }) {
|
|
69
|
+
const t = (0, components_shared_1.useText)();
|
|
70
|
+
const cardClass = (0, components_shared_1.useClass)('card', 'atlas-card');
|
|
71
|
+
const titleClass = (0, components_shared_1.useClass)('headerTitle', 'atlas-title');
|
|
72
|
+
const inputClass = (0, components_shared_1.useClass)('formFieldInput', 'atlas-input');
|
|
73
|
+
const buttonClass = (0, components_shared_1.useClass)('formButtonPrimary', 'atlas-button');
|
|
74
|
+
const errorClass = (0, components_shared_1.useClass)('formFieldError', 'atlas-error');
|
|
75
|
+
const cls = (0, components_shared_1.useClasses)();
|
|
76
|
+
const [values, setValues] = (0, react_1.useState)({});
|
|
77
|
+
const [agreed, setAgreed] = (0, react_1.useState)(false);
|
|
78
|
+
const set = (name, value) => setValues((v) => ({ ...v, [name]: value }));
|
|
79
|
+
const legal = settings?.legal;
|
|
80
|
+
const showLegal = !!legal && (!!legal.termsUrl || !!legal.privacyUrl);
|
|
81
|
+
const consentOk = !legal?.required || agreed;
|
|
82
|
+
const fieldErrors = (name) => errors
|
|
83
|
+
.filter((error) => error.param === name)
|
|
84
|
+
.map((error) => ((0, jsx_runtime_1.jsx)("span", { className: errorClass, children: error.message }, error.code)));
|
|
85
|
+
const label = (f) => f.required ? f.label : t('signUp.optionalField', { label: f.label });
|
|
86
|
+
const control = (f) => {
|
|
87
|
+
const value = values[f.key] ?? '';
|
|
88
|
+
switch (f.type) {
|
|
89
|
+
case 'checkbox':
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", name: f.key, checked: value === 'true', onChange: (e) => set(f.key, e.target.checked ? 'true' : '') }));
|
|
91
|
+
case 'select':
|
|
92
|
+
return ((0, jsx_runtime_1.jsxs)("select", { className: inputClass, name: f.key, value: value, required: f.required, onChange: (e) => set(f.key, e.target.value), children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: f.placeholder ?? t('signUp.selectPlaceholder') }), f.options.map((o) => ((0, jsx_runtime_1.jsx)("option", { value: o, children: o }, o)))] }));
|
|
93
|
+
case 'textarea':
|
|
94
|
+
return ((0, jsx_runtime_1.jsx)("textarea", { className: inputClass, name: f.key, rows: 3, value: value, required: f.required, placeholder: f.placeholder ?? undefined, onChange: (e) => set(f.key, e.target.value) }));
|
|
95
|
+
case 'radio':
|
|
96
|
+
case 'multiselect': {
|
|
97
|
+
// Same encoding as the embed widget and hosted page: one value, or a
|
|
98
|
+
// comma-joined list for multiselect.
|
|
99
|
+
const picked = value ? value.split(', ') : [];
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: cls('list', 'atlas-choices'), children: f.options.map((o) => ((0, jsx_runtime_1.jsxs)("label", { className: cls('listItem', 'atlas-choice'), children: [(0, jsx_runtime_1.jsx)("input", { type: f.type === 'radio' ? 'radio' : 'checkbox', name: f.key, value: o, checked: picked.includes(o), onChange: (e) => {
|
|
101
|
+
if (f.type === 'radio')
|
|
102
|
+
set(f.key, o);
|
|
103
|
+
else
|
|
104
|
+
set(f.key, (e.target.checked ? [...picked, o] : picked.filter((p) => p !== o)).join(', '));
|
|
105
|
+
} }), o] }, o))) }));
|
|
106
|
+
}
|
|
107
|
+
default: {
|
|
108
|
+
const type = ['email', 'tel', 'url', 'number', 'date'].includes(f.type) ? f.type : 'text';
|
|
109
|
+
return ((0, jsx_runtime_1.jsx)("input", { className: inputClass, type: type, name: f.key, value: value, required: f.required, placeholder: f.placeholder ?? undefined, onChange: (e) => set(f.key, e.target.value) }));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const textField = (name, labelKey, type, autoComplete) => ((0, jsx_runtime_1.jsxs)("label", { className: cls('formField', 'atlas-field'), children: [(0, jsx_runtime_1.jsx)("span", { className: cls('formFieldLabel', 'atlas-field-label'), children: t(labelKey) }), (0, jsx_runtime_1.jsx)("input", { className: inputClass, type: type, name: name, autoComplete: autoComplete, required: true, value: values[name] ?? '', onChange: (e) => set(name, e.target.value) }), fieldErrors(name)] }, name));
|
|
114
|
+
const links = showLegal
|
|
115
|
+
? [
|
|
116
|
+
legal.termsUrl ? ((0, jsx_runtime_1.jsx)("a", { className: cls('link', 'atlas-link'), href: legal.termsUrl, target: "_blank", rel: "noopener noreferrer", children: t('signUp.terms') }, "terms")) : null,
|
|
117
|
+
legal.privacyUrl ? ((0, jsx_runtime_1.jsx)("a", { className: cls('link', 'atlas-link'), href: legal.privacyUrl, target: "_blank", rel: "noopener noreferrer", children: t('signUp.privacy') }, "privacy")) : null,
|
|
118
|
+
].filter((x) => x !== null)
|
|
119
|
+
: [];
|
|
120
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cardClass, children: [hideTitle ? null : (0, jsx_runtime_1.jsx)("h1", { className: titleClass, children: t('signUp.title') }), errors
|
|
121
|
+
.filter((error) => !error.param)
|
|
122
|
+
.map((error) => ((0, jsx_runtime_1.jsx)("p", { className: errorClass, role: "alert", children: error.message }, error.code))), (0, jsx_runtime_1.jsxs)("form", { onSubmit: (event) => {
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
if (!consentOk)
|
|
125
|
+
return;
|
|
126
|
+
onSubmit(values, legal?.required ? agreed : true);
|
|
127
|
+
}, children: [(settings?.signUpFields ?? []).map((f) => {
|
|
128
|
+
const body = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: cls('formFieldLabel', 'atlas-field-label'), children: label(f) }), control(f), fieldErrors(f.key)] }));
|
|
129
|
+
// A choice group holds several inputs, so it can't sit inside one <label>.
|
|
130
|
+
return f.type === 'radio' || f.type === 'multiselect' ? ((0, jsx_runtime_1.jsx)("div", { className: cls('formField', 'atlas-field'), children: body }, f.key)) : ((0, jsx_runtime_1.jsx)("label", { className: cls('formField', 'atlas-field'), children: body }, f.key));
|
|
131
|
+
}), textField('email', 'signUp.emailLabel', 'email', 'email'), textField('password', 'signUp.passwordLabel', 'password', 'new-password'), showLegal ? ((0, jsx_runtime_1.jsxs)("label", { className: cls('formField', 'atlas-consent'), children: [legal.required ? ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", name: "consent", checked: agreed, onChange: (e) => setAgreed(e.target.checked) })) : null, (0, jsx_runtime_1.jsxs)("span", { className: cls('text', 'atlas-text'), children: [t(legal.required ? 'signUp.consentAgree' : 'signUp.consentNotice'), ' ', links.map((link, i) => ((0, jsx_runtime_1.jsxs)("span", { children: [i > 0 ? ` ${t('signUp.and')} ` : null, link] }, i))), "."] }), fieldErrors('consent')] })) : null, (0, jsx_runtime_1.jsx)(captcha_1.CaptchaSlot, { controller: captcha }), (0, jsx_runtime_1.jsx)("button", { className: buttonClass, disabled: busy || !consentOk, type: "submit", children: t('signUp.submit') })] })] }));
|
|
14
132
|
}
|
|
15
133
|
/**
|
|
16
134
|
* §5.1 headless sign-up — the sign-up counterpart of {@link useSignIn}. Starts a
|
package/dist/sign-up.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-up.js","sourceRoot":"","sources":["../src/sign-up.tsx"],"names":[],"mappings":";;AAMA,wBAaC;AAQD,8BA2BC;;AAtDD,iCAA6C;AAC7C,sCAA4C;AAC5C,mDAA2C;AAC3C,iCAAoD;AACpD,iCAA8D;AAE9D,SAAgB,MAAM,CAAC,QAAmB,EAAE;IAC1C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAA,cAAO,EAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEhE,OAAO,CACL,uBAAC,kBAAW,IACV,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,QAAQ,EAAC,cAAc,EACvB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,MAAM,GAChB,CACH,CAA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D,MAAM,MAAM,GAAG,IAAA,eAAO,EACpB,GAAG,EAAE,CAAC,IAAI,iBAAU,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAC9D,CAAC,WAAW,EAAE,cAAc,CAAC,CAC9B,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,mBAAW,EACxB,KAAK,EAAE,KAMN,EAAsB,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,IAAA,gBAAW,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC9C,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACvD,MAAM,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;gBAC/C,UAAU,EAAG,IAAI,CAAC,OAA2B,CAAC,EAAE;gBAChD,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,MAAM,MAAM,EAAE,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,EACD,CAAC,MAAM,EAAE,MAAM,CAAC,CACjB,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
|
package/dist/styles.d.ts
CHANGED
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
* (`appearance.elements` classes, or the host's own CSS) are APPENDED and land
|
|
18
18
|
* later in the cascade, so they win on equal specificity — the base never fights
|
|
19
19
|
* an override.
|
|
20
|
+
*
|
|
21
|
+
* Accessibility floor: label text on a primary fill reads
|
|
22
|
+
* `--atlas-color-text-on-primary` (contrast-picked from the primary by
|
|
23
|
+
* `resolveTokens`), every interactive element gets a solid 2px
|
|
24
|
+
* `:focus-visible` outline in `--atlas-color-focus-ring` (a glow alone is too
|
|
25
|
+
* faint to find the focus by), and inputs are never under 16px so iOS Safari
|
|
26
|
+
* does not zoom the page on focus.
|
|
20
27
|
*/
|
|
21
28
|
export declare const ATLAS_STYLE_ELEMENT_ID = "atlas-base-styles";
|
|
22
29
|
export declare const ATLAS_BASE_CSS: string;
|
|
@@ -39,9 +46,14 @@ export declare const ATLAS_BASE_CSS: string;
|
|
|
39
46
|
export declare const ATLAS_DESIGN_CSS: string;
|
|
40
47
|
/**
|
|
41
48
|
* The full stylesheet the provider renders: base rules + design-system rules.
|
|
42
|
-
* (Exported separately so the base rules
|
|
43
|
-
*
|
|
49
|
+
* (Exported separately so the base rules are pinned by a hash — they change
|
|
50
|
+
* only deliberately, as in 0.5.0 for accessibility.)
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Rules for the create-account form and the captcha slot (added in 0.5.0). Kept
|
|
54
|
+
* out of {@link ATLAS_BASE_CSS} so the base rules stay byte-identical.
|
|
44
55
|
*/
|
|
56
|
+
export declare const ATLAS_FLOW_CSS = ".atlas-captcha{display:flex;justify-content:center;}\n.atlas-captcha:empty{display:none;}\n.atlas-consent{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;font-size:.875rem;}\n.atlas-choices{display:flex;flex-direction:column;gap:6px;}\n.atlas-choice{display:flex;gap:6px;align-items:center;font-weight:400;}";
|
|
45
57
|
export declare const ATLAS_STYLES_CSS: string;
|
|
46
58
|
/**
|
|
47
59
|
* Inject the base stylesheet once. Idempotent (guards on the element id), so
|
package/dist/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ATLAS_STYLES_CSS = exports.ATLAS_DESIGN_CSS = exports.ATLAS_BASE_CSS = exports.ATLAS_STYLE_ELEMENT_ID = void 0;
|
|
3
|
+
exports.ATLAS_STYLES_CSS = exports.ATLAS_FLOW_CSS = exports.ATLAS_DESIGN_CSS = exports.ATLAS_BASE_CSS = exports.ATLAS_STYLE_ELEMENT_ID = void 0;
|
|
4
4
|
exports.injectAtlasStyles = injectAtlasStyles;
|
|
5
5
|
/**
|
|
6
6
|
* §10.3 base component styles.
|
|
@@ -21,6 +21,13 @@ exports.injectAtlasStyles = injectAtlasStyles;
|
|
|
21
21
|
* (`appearance.elements` classes, or the host's own CSS) are APPENDED and land
|
|
22
22
|
* later in the cascade, so they win on equal specificity — the base never fights
|
|
23
23
|
* an override.
|
|
24
|
+
*
|
|
25
|
+
* Accessibility floor: label text on a primary fill reads
|
|
26
|
+
* `--atlas-color-text-on-primary` (contrast-picked from the primary by
|
|
27
|
+
* `resolveTokens`), every interactive element gets a solid 2px
|
|
28
|
+
* `:focus-visible` outline in `--atlas-color-focus-ring` (a glow alone is too
|
|
29
|
+
* faint to find the focus by), and inputs are never under 16px so iOS Safari
|
|
30
|
+
* does not zoom the page on focus.
|
|
24
31
|
*/
|
|
25
32
|
exports.ATLAS_STYLE_ELEMENT_ID = 'atlas-base-styles';
|
|
26
33
|
exports.ATLAS_BASE_CSS = `
|
|
@@ -35,10 +42,11 @@ exports.ATLAS_BASE_CSS = `
|
|
|
35
42
|
.atlas-field{display:flex;flex-direction:column;gap:calc(var(--atlas-spacing-unit,4px) * 1.5);font-size:.875rem;}
|
|
36
43
|
.atlas-field > span{font-weight:500;color:var(--atlas-color-text,#1c1c1f);}
|
|
37
44
|
|
|
38
|
-
.atlas-input{width:100%;padding:10px 12px;font-size
|
|
39
|
-
.atlas-input:focus{border-color:var(--atlas-color-primary,#5b5bd6);
|
|
45
|
+
.atlas-input{width:100%;padding:10px 12px;font-size:max(16px,.95rem);font-family:inherit;color:var(--atlas-color-text,#1c1c1f);background:var(--atlas-color-background,#fff);border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);outline:none;transition:border-color .15s ease,box-shadow .15s ease;}
|
|
46
|
+
.atlas-input:focus{border-color:var(--atlas-color-primary,#5b5bd6);}
|
|
47
|
+
:is(.atlas-input,.atlas-button,.atlas-social-button,.atlas-menu-item,.atlas-tab,.atlas-avatar):focus-visible{outline:2px solid var(--atlas-color-focus-ring,var(--atlas-color-primary,#5b5bd6));outline-offset:2px;}
|
|
40
48
|
|
|
41
|
-
.atlas-button{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:40px;padding:10px 16px;font-size:.95rem;font-weight:600;font-family:inherit;color
|
|
49
|
+
.atlas-button{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:40px;padding:10px 16px;font-size:.95rem;font-weight:600;font-family:inherit;color:var(--atlas-color-text-on-primary,#fff);background:var(--atlas-color-primary,#5b5bd6);border:1px solid transparent;border-radius:var(--atlas-border-radius,8px);cursor:pointer;transition:filter .15s ease,opacity .15s ease;}
|
|
42
50
|
.atlas-button:hover:not(:disabled){filter:brightness(1.06);}
|
|
43
51
|
.atlas-button:active:not(:disabled){filter:brightness(.94);}
|
|
44
52
|
.atlas-button:disabled{opacity:.6;cursor:not-allowed;}
|
|
@@ -56,7 +64,7 @@ exports.ATLAS_BASE_CSS = `
|
|
|
56
64
|
.atlas-social-icon svg{width:18px;height:18px;display:block;}
|
|
57
65
|
|
|
58
66
|
.atlas-user-button{position:relative;display:inline-block;}
|
|
59
|
-
.atlas-avatar{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:999px;overflow:hidden;background:var(--atlas-color-primary,#5b5bd6);color
|
|
67
|
+
.atlas-avatar{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:999px;overflow:hidden;background:var(--atlas-color-primary,#5b5bd6);color:var(--atlas-color-text-on-primary,#fff);font-weight:600;font-size:.875rem;cursor:pointer;}
|
|
60
68
|
.atlas-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
|
|
61
69
|
|
|
62
70
|
.atlas-menu{position:absolute;right:0;top:100%;margin-top:6px;min-width:12rem;display:flex;flex-direction:column;padding:4px;background:var(--atlas-color-background,#fff);border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);box-shadow:0 8px 24px rgba(0,0,0,.12);z-index:50;}
|
|
@@ -113,14 +121,14 @@ exports.ATLAS_DESIGN_CSS = `
|
|
|
113
121
|
:where(.atlas-root[data-atlas-design]) .atlas-account-field{display:flex;flex-direction:column;gap:calc(var(--atlas-space-unit) * 1.5);font-size:var(--atlas-font-size-sm);color:var(--atlas-color-text);}
|
|
114
122
|
:where(.atlas-root[data-atlas-design]) .atlas-account-input{padding:6px 10px;font-family:inherit;outline:none;}
|
|
115
123
|
|
|
116
|
-
:where(.atlas-root[data-atlas-design]) :is(.atlas-input,.atlas-account-input){min-height:var(--atlas-control-height);font-size:var(--atlas-font-size-base);color:var(--atlas-color-input-text);background:var(--atlas-color-input-background);border:var(--atlas-border-width) solid var(--atlas-color-border);border-radius:var(--atlas-radius-control);}
|
|
117
|
-
:where(.atlas-root[data-atlas-design]) :is(.atlas-input:focus,.atlas-account-input:focus){border-color:var(--atlas-color-primary);
|
|
124
|
+
:where(.atlas-root[data-atlas-design]) :is(.atlas-input,.atlas-account-input){min-height:var(--atlas-control-height);font-size:max(16px,var(--atlas-font-size-base));color:var(--atlas-color-input-text);background:var(--atlas-color-input-background);border:var(--atlas-border-width) solid var(--atlas-color-border);border-radius:var(--atlas-radius-control);}
|
|
125
|
+
:where(.atlas-root[data-atlas-design]) :is(.atlas-input:focus,.atlas-account-input:focus){border-color:var(--atlas-color-primary);}
|
|
126
|
+
:where(.atlas-root[data-atlas-design]) :is(.atlas-input,.atlas-account-input,.atlas-button,.atlas-button-secondary,.atlas-social-button,.atlas-menu-item,.atlas-tab,.atlas-avatar):focus-visible{outline:2px solid var(--atlas-focus-outline-color,var(--atlas-color-primary));outline-offset:2px;}
|
|
118
127
|
:where(.atlas-root[data-atlas-input="filled"]) :is(.atlas-input,.atlas-account-input){background:color-mix(in srgb,var(--atlas-color-text) 6%,var(--atlas-color-input-background));border-color:transparent;}
|
|
119
128
|
:where(.atlas-root[data-atlas-input="underline"]) :is(.atlas-input,.atlas-account-input){background:transparent;border-width:0 0 max(1px,var(--atlas-border-width)) 0;border-radius:0;padding-left:0;padding-right:0;}
|
|
120
129
|
:where(.atlas-root[data-atlas-input="underline"]) :is(.atlas-input,.atlas-account-input):focus{box-shadow:0 1px 0 0 var(--atlas-color-primary);}
|
|
121
130
|
|
|
122
|
-
:where(.atlas-root[data-atlas-design]) .atlas-button{min-height:var(--atlas-control-height);font-size:var(--atlas-font-size-base);color:var(--atlas-color-primary-ink);background:var(--atlas-color-primary);border-width:var(--atlas-border-width);border-radius:var(--atlas-radius-control);text-transform:var(--atlas-button-text-transform);letter-spacing:var(--atlas-button-letter-spacing);}
|
|
123
|
-
:where(.atlas-root[data-atlas-design]) :is(.atlas-button,.atlas-button-secondary,.atlas-social-button):focus-visible{outline:none;box-shadow:0 0 0 3px var(--atlas-color-focus-ring);}
|
|
131
|
+
:where(.atlas-root[data-atlas-design]) .atlas-button{min-height:var(--atlas-control-height);font-size:var(--atlas-font-size-base);color:var(--atlas-color-text-on-primary,var(--atlas-color-primary-ink));background:var(--atlas-color-primary);border-width:var(--atlas-border-width);border-radius:var(--atlas-radius-control);text-transform:var(--atlas-button-text-transform);letter-spacing:var(--atlas-button-letter-spacing);}
|
|
124
132
|
:where(.atlas-root[data-atlas-button="outline"]) .atlas-button{background:transparent;color:var(--atlas-color-primary-text);border:max(1px,var(--atlas-border-width)) solid var(--atlas-color-primary);}
|
|
125
133
|
:where(.atlas-root[data-atlas-button="soft"]) .atlas-button{background:color-mix(in srgb,var(--atlas-color-primary) 14%,transparent);color:var(--atlas-color-primary-text);border-color:transparent;}
|
|
126
134
|
:where(.atlas-root[data-atlas-button="gradient"]) .atlas-button{background:linear-gradient(135deg,var(--atlas-color-primary),var(--atlas-color-accent));}
|
|
@@ -131,7 +139,7 @@ exports.ATLAS_DESIGN_CSS = `
|
|
|
131
139
|
|
|
132
140
|
:where(.atlas-root[data-atlas-social="icons"]) .atlas-social-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
|
|
133
141
|
|
|
134
|
-
:where(.atlas-root[data-atlas-design]) .atlas-avatar{background:var(--atlas-color-primary);color:var(--atlas-color-primary-ink);}
|
|
142
|
+
:where(.atlas-root[data-atlas-design]) .atlas-avatar{background:var(--atlas-color-primary);color:var(--atlas-color-text-on-primary,var(--atlas-color-primary-ink));}
|
|
135
143
|
:where(.atlas-root[data-atlas-design]) .atlas-menu{background:var(--atlas-color-surface);border:var(--atlas-card-border-width) solid var(--atlas-color-border);border-radius:var(--atlas-radius-card);box-shadow:var(--atlas-shadow-card);}
|
|
136
144
|
:where(.atlas-root[data-atlas-design]) .atlas-menu-item{color:var(--atlas-color-text);border-radius:var(--atlas-radius-control);}
|
|
137
145
|
:where(.atlas-root[data-atlas-design]) .atlas-tabs{border-bottom-color:var(--atlas-color-border);}
|
|
@@ -143,10 +151,19 @@ exports.ATLAS_DESIGN_CSS = `
|
|
|
143
151
|
`.trim();
|
|
144
152
|
/**
|
|
145
153
|
* The full stylesheet the provider renders: base rules + design-system rules.
|
|
146
|
-
* (Exported separately so the base rules
|
|
147
|
-
*
|
|
154
|
+
* (Exported separately so the base rules are pinned by a hash — they change
|
|
155
|
+
* only deliberately, as in 0.5.0 for accessibility.)
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* Rules for the create-account form and the captcha slot (added in 0.5.0). Kept
|
|
159
|
+
* out of {@link ATLAS_BASE_CSS} so the base rules stay byte-identical.
|
|
148
160
|
*/
|
|
149
|
-
exports.
|
|
161
|
+
exports.ATLAS_FLOW_CSS = `.atlas-captcha{display:flex;justify-content:center;}
|
|
162
|
+
.atlas-captcha:empty{display:none;}
|
|
163
|
+
.atlas-consent{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;font-size:.875rem;}
|
|
164
|
+
.atlas-choices{display:flex;flex-direction:column;gap:6px;}
|
|
165
|
+
.atlas-choice{display:flex;gap:6px;align-items:center;font-weight:400;}`;
|
|
166
|
+
exports.ATLAS_STYLES_CSS = `${exports.ATLAS_BASE_CSS}\n${exports.ATLAS_DESIGN_CSS}\n${exports.ATLAS_FLOW_CSS}`;
|
|
150
167
|
/**
|
|
151
168
|
* Inject the base stylesheet once. Idempotent (guards on the element id), so
|
|
152
169
|
* multiple `<AtlasProvider>`s — or a re-mount — add it exactly once. A no-op
|
package/dist/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":";;;AA4KA,8CAOC;AAnLD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sBAAsB,GAAG,mBAAmB,CAAC;AAE7C,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD7B,CAAC,IAAI,EAAE,CAAC;AAET;;;;;;;;;;;;;;;GAeG;AACU,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD/B,CAAC,IAAI,EAAE,CAAC;AAET;;;;GAIG;AACH;;;GAGG;AACU,QAAA,cAAc,GAAG;;;;wEAI0C,CAAC;AAE5D,QAAA,gBAAgB,GAAG,GAAG,sBAAc,KAAK,wBAAgB,KAAK,sBAAc,EAAE,CAAC;AAE5F;;;;GAIG;AACH,SAAgB,iBAAiB;IAC/B,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IAC5C,IAAI,QAAQ,CAAC,cAAc,CAAC,8BAAsB,CAAC;QAAE,OAAO;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,8BAAsB,CAAC;IAClC,KAAK,CAAC,WAAW,GAAG,wBAAgB,CAAC;IACrC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@atlasauth/
|
|
7
|
+
"@atlasauth/design": "0.1.0",
|
|
8
|
+
"@atlasauth/localizations": "0.2.0",
|
|
8
9
|
"@atlasauth/authz": "0.1.1",
|
|
9
|
-
"@atlasauth/
|
|
10
|
+
"@atlasauth/js": "0.6.0"
|
|
10
11
|
},
|
|
11
12
|
"peerDependencies": {
|
|
12
13
|
"react": ">=18"
|