@asgardeo/react 0.5.32 → 0.6.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/dist/cjs/index.js +337 -164
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/SignUp/BaseSignUp.d.ts +95 -6
- package/dist/components/presentation/SignUp/SignUp.d.ts +52 -3
- package/dist/components/presentation/SignUp/transformer.d.ts +30 -0
- package/dist/contexts/Theme/ThemeContext.d.ts +4 -0
- package/dist/contexts/Theme/types.d.ts +5 -0
- package/dist/index.js +228 -53
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -63,7 +63,8 @@ import {
|
|
|
63
63
|
navigate,
|
|
64
64
|
getRedirectBasedSignUpUrl,
|
|
65
65
|
Platform,
|
|
66
|
-
isEmpty
|
|
66
|
+
isEmpty,
|
|
67
|
+
executeEmbeddedSignUpFlowV2
|
|
67
68
|
} from "@asgardeo/browser";
|
|
68
69
|
|
|
69
70
|
// src/__temp__/api.ts
|
|
@@ -778,16 +779,22 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
|
|
|
778
779
|
return Promise.resolve(String(response));
|
|
779
780
|
}
|
|
780
781
|
async signUp(...args) {
|
|
781
|
-
const
|
|
782
|
+
const config = await this.asgardeo.getConfigData();
|
|
782
783
|
const firstArg = args[0];
|
|
784
|
+
const baseUrl = config?.baseUrl;
|
|
785
|
+
if (config.platform === Platform.AsgardeoV2) {
|
|
786
|
+
return executeEmbeddedSignUpFlowV2({
|
|
787
|
+
baseUrl,
|
|
788
|
+
payload: firstArg
|
|
789
|
+
});
|
|
790
|
+
}
|
|
783
791
|
if (typeof firstArg === "object" && "flowType" in firstArg) {
|
|
784
|
-
const baseUrl = configData?.baseUrl;
|
|
785
792
|
return executeEmbeddedSignUpFlow({
|
|
786
793
|
baseUrl,
|
|
787
794
|
payload: firstArg
|
|
788
795
|
});
|
|
789
796
|
}
|
|
790
|
-
navigate(getRedirectBasedSignUpUrl(
|
|
797
|
+
navigate(getRedirectBasedSignUpUrl(config));
|
|
791
798
|
}
|
|
792
799
|
async request(requestConfig) {
|
|
793
800
|
return this.asgardeo.httpRequest(requestConfig);
|
|
@@ -1283,6 +1290,7 @@ var ThemeProvider = ({
|
|
|
1283
1290
|
};
|
|
1284
1291
|
}, [inheritFromBranding, brandingTheme, themeConfig]);
|
|
1285
1292
|
const theme = useMemo4(() => createTheme(finalThemeConfig, colorScheme === "dark"), [finalThemeConfig, colorScheme]);
|
|
1293
|
+
const direction = finalThemeConfig?.direction || "ltr";
|
|
1286
1294
|
const handleThemeChange = useCallback4((isDark) => {
|
|
1287
1295
|
setColorScheme(isDark ? "dark" : "light");
|
|
1288
1296
|
}, []);
|
|
@@ -1321,9 +1329,15 @@ var ThemeProvider = ({
|
|
|
1321
1329
|
useEffect2(() => {
|
|
1322
1330
|
applyThemeToDOM(theme);
|
|
1323
1331
|
}, [theme]);
|
|
1332
|
+
useEffect2(() => {
|
|
1333
|
+
if (typeof document !== "undefined") {
|
|
1334
|
+
document.documentElement.dir = direction;
|
|
1335
|
+
}
|
|
1336
|
+
}, [direction]);
|
|
1324
1337
|
const value = {
|
|
1325
1338
|
theme,
|
|
1326
1339
|
colorScheme,
|
|
1340
|
+
direction,
|
|
1327
1341
|
toggleTheme,
|
|
1328
1342
|
isBrandingLoading,
|
|
1329
1343
|
brandingError,
|
|
@@ -1785,7 +1799,10 @@ var AsgardeoProvider = ({
|
|
|
1785
1799
|
ThemeProvider_default,
|
|
1786
1800
|
{
|
|
1787
1801
|
inheritFromBranding: preferences?.theme?.inheritFromBranding,
|
|
1788
|
-
theme:
|
|
1802
|
+
theme: {
|
|
1803
|
+
...preferences?.theme?.overrides,
|
|
1804
|
+
direction: preferences?.theme?.direction
|
|
1805
|
+
},
|
|
1789
1806
|
mode: getActiveTheme(preferences?.theme?.mode),
|
|
1790
1807
|
children: /* @__PURE__ */ jsx7(FlowProvider_default, { children: /* @__PURE__ */ jsx7(UserProvider_default, { profile: userProfile, onUpdateProfile: handleProfileUpdate, children: /* @__PURE__ */ jsx7(
|
|
1791
1808
|
OrganizationProvider_default,
|
|
@@ -3288,13 +3305,13 @@ import { useMemo as useMemo11 } from "react";
|
|
|
3288
3305
|
var useStyles4 = (theme, colorScheme, helperTextAlign, helperTextMarginLeft, hasError) => {
|
|
3289
3306
|
return useMemo11(() => {
|
|
3290
3307
|
const formControl = css4`
|
|
3291
|
-
text-align:
|
|
3308
|
+
text-align: start;
|
|
3292
3309
|
margin-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
3293
3310
|
`;
|
|
3294
3311
|
const helperText = css4`
|
|
3295
3312
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
3296
|
-
text-align: ${helperTextAlign};
|
|
3297
|
-
${helperTextMarginLeft && `margin-
|
|
3313
|
+
text-align: ${helperTextAlign === "left" ? "start" : helperTextAlign};
|
|
3314
|
+
${helperTextMarginLeft && `margin-inline-start: ${helperTextMarginLeft};`}
|
|
3298
3315
|
`;
|
|
3299
3316
|
const helperTextError = css4`
|
|
3300
3317
|
color: ${theme.vars.colors.error.main};
|
|
@@ -3428,8 +3445,8 @@ import { css as css6 } from "@emotion/css";
|
|
|
3428
3445
|
import { useMemo as useMemo13 } from "react";
|
|
3429
3446
|
var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIcon) => {
|
|
3430
3447
|
return useMemo13(() => {
|
|
3431
|
-
const
|
|
3432
|
-
const
|
|
3448
|
+
const inlineStartPadding = hasStartIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3449
|
+
const inlineEndPadding = hasEndIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3433
3450
|
const inputContainer = css6`
|
|
3434
3451
|
position: relative;
|
|
3435
3452
|
display: flex;
|
|
@@ -3437,7 +3454,9 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3437
3454
|
`;
|
|
3438
3455
|
const input = css6`
|
|
3439
3456
|
width: 100%;
|
|
3440
|
-
padding: ${theme.vars.spacing.unit}
|
|
3457
|
+
padding-block: ${theme.vars.spacing.unit};
|
|
3458
|
+
padding-inline-start: ${inlineStartPadding};
|
|
3459
|
+
padding-inline-end: ${inlineEndPadding};
|
|
3441
3460
|
border: 1px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
|
|
3442
3461
|
border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
|
|
3443
3462
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
@@ -3508,11 +3527,11 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3508
3527
|
`;
|
|
3509
3528
|
const startIcon = css6`
|
|
3510
3529
|
${icon};
|
|
3511
|
-
|
|
3530
|
+
inset-inline-start: ${theme.vars.spacing.unit};
|
|
3512
3531
|
`;
|
|
3513
3532
|
const endIcon = css6`
|
|
3514
3533
|
${icon};
|
|
3515
|
-
|
|
3534
|
+
inset-inline-end: ${theme.vars.spacing.unit};
|
|
3516
3535
|
`;
|
|
3517
3536
|
return {
|
|
3518
3537
|
inputContainer,
|
|
@@ -4227,7 +4246,7 @@ var useStyles11 = (theme, colorScheme, hasError, required) => {
|
|
|
4227
4246
|
const inputStyles = css11`
|
|
4228
4247
|
width: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4229
4248
|
height: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4230
|
-
margin-
|
|
4249
|
+
margin-inline-end: ${theme.vars.spacing.unit};
|
|
4231
4250
|
accent-color: ${theme.vars.colors.primary.main};
|
|
4232
4251
|
cursor: pointer;
|
|
4233
4252
|
|
|
@@ -5748,8 +5767,9 @@ var useStyles14 = (theme, colorScheme, orientation, variant, color, hasChildren)
|
|
|
5748
5767
|
height: 100%;
|
|
5749
5768
|
min-height: calc(${theme.vars.spacing.unit} * 2);
|
|
5750
5769
|
width: 1px;
|
|
5751
|
-
border-
|
|
5752
|
-
margin: 0
|
|
5770
|
+
border-inline-start: 1px ${borderStyle} ${baseColor};
|
|
5771
|
+
margin-block: 0;
|
|
5772
|
+
margin-inline: calc(${theme.vars.spacing.unit} * 1);
|
|
5753
5773
|
`;
|
|
5754
5774
|
const horizontalDivider = css14`
|
|
5755
5775
|
display: flex;
|
|
@@ -7456,7 +7476,7 @@ var normalizeFlowResponse = (response, t) => {
|
|
|
7456
7476
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7457
7477
|
import { Fragment as Fragment12, jsx as jsx57 } from "react/jsx-runtime";
|
|
7458
7478
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7459
|
-
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading
|
|
7479
|
+
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
7460
7480
|
const { t } = useTranslation_default();
|
|
7461
7481
|
const [components, setComponents] = useState16([]);
|
|
7462
7482
|
const [currentFlowId, setCurrentFlowId] = useState16(null);
|
|
@@ -7471,10 +7491,13 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7471
7491
|
}
|
|
7472
7492
|
}, [isInitialized, isLoading, isFlowInitialized]);
|
|
7473
7493
|
const initializeFlow = async () => {
|
|
7474
|
-
const
|
|
7475
|
-
|
|
7494
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
7495
|
+
const flowIdFromUrl = urlParams.get("flowId");
|
|
7496
|
+
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
7497
|
+
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
7498
|
+
if (!flowIdFromUrl && !effectiveApplicationId) {
|
|
7476
7499
|
const error = new AsgardeoRuntimeError8(
|
|
7477
|
-
|
|
7500
|
+
"Either flowId or applicationId is required for authentication",
|
|
7478
7501
|
"SignIn-initializeFlow-RuntimeError-001",
|
|
7479
7502
|
"react",
|
|
7480
7503
|
"Something went wrong while trying to sign in. Please try again later."
|
|
@@ -7484,10 +7507,17 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7484
7507
|
}
|
|
7485
7508
|
try {
|
|
7486
7509
|
setFlowError(null);
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7510
|
+
let response;
|
|
7511
|
+
if (flowIdFromUrl) {
|
|
7512
|
+
response = await signIn({
|
|
7513
|
+
flowId: flowIdFromUrl
|
|
7514
|
+
});
|
|
7515
|
+
} else {
|
|
7516
|
+
response = await signIn({
|
|
7517
|
+
applicationId: effectiveApplicationId,
|
|
7518
|
+
flowType: EmbeddedFlowType.Authentication
|
|
7519
|
+
});
|
|
7520
|
+
}
|
|
7491
7521
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
7492
7522
|
if (flowId && components2) {
|
|
7493
7523
|
setCurrentFlowId(flowId);
|
|
@@ -7628,7 +7658,7 @@ var SignIn_default2 = SignIn2;
|
|
|
7628
7658
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7629
7659
|
import {
|
|
7630
7660
|
EmbeddedFlowStatus,
|
|
7631
|
-
EmbeddedFlowComponentType as
|
|
7661
|
+
EmbeddedFlowComponentType as EmbeddedFlowComponentType5,
|
|
7632
7662
|
EmbeddedFlowResponseType,
|
|
7633
7663
|
withVendorCSSClassPrefix as withVendorCSSClassPrefix21,
|
|
7634
7664
|
AsgardeoAPIError as AsgardeoAPIError3
|
|
@@ -8144,6 +8174,110 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8144
8174
|
)
|
|
8145
8175
|
).filter(Boolean);
|
|
8146
8176
|
|
|
8177
|
+
// src/components/presentation/SignUp/transformer.ts
|
|
8178
|
+
import { EmbeddedFlowComponentType as EmbeddedFlowComponentType4 } from "@asgardeo/browser";
|
|
8179
|
+
var generateId2 = (prefix) => {
|
|
8180
|
+
const suffix = Math.random().toString(36).substring(2, 6);
|
|
8181
|
+
return `${prefix}_${suffix}`;
|
|
8182
|
+
};
|
|
8183
|
+
var getInputVariant2 = (type) => {
|
|
8184
|
+
switch (type.toLowerCase()) {
|
|
8185
|
+
case "email":
|
|
8186
|
+
return "EMAIL";
|
|
8187
|
+
case "password":
|
|
8188
|
+
return "PASSWORD";
|
|
8189
|
+
default:
|
|
8190
|
+
return "TEXT";
|
|
8191
|
+
}
|
|
8192
|
+
};
|
|
8193
|
+
var getInputLabel2 = (name, type, t) => {
|
|
8194
|
+
const i18nKey = `elements.fields.${name}`;
|
|
8195
|
+
const label = t(i18nKey);
|
|
8196
|
+
if (label === i18nKey || !label) {
|
|
8197
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
8198
|
+
}
|
|
8199
|
+
return label;
|
|
8200
|
+
};
|
|
8201
|
+
var getInputPlaceholder2 = (name, type, t) => {
|
|
8202
|
+
const label = getInputLabel2(name, type, t);
|
|
8203
|
+
const placeholder = t("elements.fields.placeholder", { field: label });
|
|
8204
|
+
if (!placeholder || placeholder === "elements.fields.placeholder") {
|
|
8205
|
+
return `Enter your ${label}`;
|
|
8206
|
+
}
|
|
8207
|
+
return placeholder;
|
|
8208
|
+
};
|
|
8209
|
+
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8210
|
+
const variant = getInputVariant2(input.type);
|
|
8211
|
+
const label = getInputLabel2(input.name, input.type, t);
|
|
8212
|
+
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
8213
|
+
return {
|
|
8214
|
+
id: generateId2("input"),
|
|
8215
|
+
type: EmbeddedFlowComponentType4.Input,
|
|
8216
|
+
variant,
|
|
8217
|
+
config: {
|
|
8218
|
+
type: input.type === "string" ? "text" : input.type,
|
|
8219
|
+
label,
|
|
8220
|
+
placeholder,
|
|
8221
|
+
required: input.required,
|
|
8222
|
+
identifier: input.name,
|
|
8223
|
+
hint: ""
|
|
8224
|
+
},
|
|
8225
|
+
components: []
|
|
8226
|
+
};
|
|
8227
|
+
};
|
|
8228
|
+
var convertActionToComponent2 = (action, t) => {
|
|
8229
|
+
const i18nKey = `elements.buttons.${action.id}`;
|
|
8230
|
+
let text = t(i18nKey);
|
|
8231
|
+
if (!text || text === i18nKey) {
|
|
8232
|
+
text = action.id.replace(/_/g, " ");
|
|
8233
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
8234
|
+
}
|
|
8235
|
+
return {
|
|
8236
|
+
id: generateId2("action"),
|
|
8237
|
+
type: EmbeddedFlowComponentType4.Button,
|
|
8238
|
+
variant: "SECONDARY",
|
|
8239
|
+
config: {
|
|
8240
|
+
type: "button",
|
|
8241
|
+
text,
|
|
8242
|
+
actionId: action.id,
|
|
8243
|
+
actionType: action.type
|
|
8244
|
+
},
|
|
8245
|
+
components: []
|
|
8246
|
+
};
|
|
8247
|
+
};
|
|
8248
|
+
var transformSimpleToComponentDriven2 = (response, t) => {
|
|
8249
|
+
const inputComponents = response?.data?.inputs?.map((input) => convertSimpleInputToComponent2(input, t)) || [];
|
|
8250
|
+
const actionComponents = response?.data?.actions?.map((action) => convertActionToComponent2(action, t)) || [];
|
|
8251
|
+
const submitButton = inputComponents.length > 0 ? {
|
|
8252
|
+
id: generateId2("button"),
|
|
8253
|
+
type: EmbeddedFlowComponentType4.Button,
|
|
8254
|
+
variant: "PRIMARY",
|
|
8255
|
+
config: {
|
|
8256
|
+
type: "submit",
|
|
8257
|
+
text: t("elements.buttons.signUp")
|
|
8258
|
+
},
|
|
8259
|
+
components: []
|
|
8260
|
+
} : null;
|
|
8261
|
+
const formComponents = [];
|
|
8262
|
+
if (inputComponents.length > 0) {
|
|
8263
|
+
formComponents.push(...inputComponents);
|
|
8264
|
+
if (submitButton) formComponents.push(submitButton);
|
|
8265
|
+
}
|
|
8266
|
+
const result = [];
|
|
8267
|
+
if (formComponents.length > 0) {
|
|
8268
|
+
result.push({
|
|
8269
|
+
id: generateId2("form"),
|
|
8270
|
+
type: EmbeddedFlowComponentType4.Form,
|
|
8271
|
+
config: {},
|
|
8272
|
+
components: formComponents
|
|
8273
|
+
});
|
|
8274
|
+
}
|
|
8275
|
+
if (actionComponents.length > 0) {
|
|
8276
|
+
result.push(...actionComponents);
|
|
8277
|
+
}
|
|
8278
|
+
return result;
|
|
8279
|
+
};
|
|
8280
|
+
|
|
8147
8281
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8148
8282
|
import { css as css18 } from "@emotion/css";
|
|
8149
8283
|
import { useMemo as useMemo25 } from "react";
|
|
@@ -8309,7 +8443,8 @@ var BaseSignUpContent = ({
|
|
|
8309
8443
|
messageClassName = "",
|
|
8310
8444
|
size = "medium",
|
|
8311
8445
|
variant = "outlined",
|
|
8312
|
-
isInitialized
|
|
8446
|
+
isInitialized,
|
|
8447
|
+
children
|
|
8313
8448
|
}) => {
|
|
8314
8449
|
const { theme, colorScheme } = useTheme_default();
|
|
8315
8450
|
const { t } = useTranslation_default();
|
|
@@ -8321,12 +8456,31 @@ var BaseSignUpContent = ({
|
|
|
8321
8456
|
const [error, setError] = useState17(null);
|
|
8322
8457
|
const [formData, setFormData] = useState17({});
|
|
8323
8458
|
const initializationAttemptedRef = useRef5(false);
|
|
8459
|
+
const normalizeFlowResponse2 = useCallback11(
|
|
8460
|
+
(response) => {
|
|
8461
|
+
if (response?.data?.components && Array.isArray(response.data.components)) {
|
|
8462
|
+
return response;
|
|
8463
|
+
}
|
|
8464
|
+
if (response?.data && (response.data.inputs || response.data.actions)) {
|
|
8465
|
+
const transformedComponents = transformSimpleToComponentDriven2(response, t);
|
|
8466
|
+
return {
|
|
8467
|
+
...response,
|
|
8468
|
+
data: {
|
|
8469
|
+
...response.data,
|
|
8470
|
+
components: transformedComponents
|
|
8471
|
+
}
|
|
8472
|
+
};
|
|
8473
|
+
}
|
|
8474
|
+
return response;
|
|
8475
|
+
},
|
|
8476
|
+
[t]
|
|
8477
|
+
);
|
|
8324
8478
|
const extractFormFields = useCallback11(
|
|
8325
8479
|
(components) => {
|
|
8326
8480
|
const fields = [];
|
|
8327
8481
|
const processComponents = (comps) => {
|
|
8328
8482
|
comps.forEach((component) => {
|
|
8329
|
-
if (component.type ===
|
|
8483
|
+
if (component.type === EmbeddedFlowComponentType5.Input) {
|
|
8330
8484
|
const config = component.config || {};
|
|
8331
8485
|
fields.push({
|
|
8332
8486
|
name: config.name || component.id,
|
|
@@ -8416,7 +8570,8 @@ var BaseSignUpContent = ({
|
|
|
8416
8570
|
inputs: filteredInputs,
|
|
8417
8571
|
actionId: component.id
|
|
8418
8572
|
};
|
|
8419
|
-
const
|
|
8573
|
+
const rawResponse = await onSubmit(payload);
|
|
8574
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8420
8575
|
onFlowChange?.(response);
|
|
8421
8576
|
if (response.flowStatus === EmbeddedFlowStatus.Complete) {
|
|
8422
8577
|
onComplete?.(response);
|
|
@@ -8618,7 +8773,8 @@ var BaseSignUpContent = ({
|
|
|
8618
8773
|
setIsLoading(true);
|
|
8619
8774
|
setError(null);
|
|
8620
8775
|
try {
|
|
8621
|
-
const
|
|
8776
|
+
const rawResponse = await onInitialize();
|
|
8777
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8622
8778
|
setCurrentFlow(response);
|
|
8623
8779
|
setIsFlowInitialized(true);
|
|
8624
8780
|
onFlowChange?.(response);
|
|
@@ -8646,9 +8802,28 @@ var BaseSignUpContent = ({
|
|
|
8646
8802
|
onError,
|
|
8647
8803
|
onFlowChange,
|
|
8648
8804
|
setupFormFields,
|
|
8805
|
+
normalizeFlowResponse2,
|
|
8649
8806
|
afterSignUpUrl,
|
|
8650
8807
|
t
|
|
8651
8808
|
]);
|
|
8809
|
+
if (children) {
|
|
8810
|
+
const renderProps = {
|
|
8811
|
+
values: formValues,
|
|
8812
|
+
errors: formErrors,
|
|
8813
|
+
touched: touchedFields,
|
|
8814
|
+
isValid: isFormValid,
|
|
8815
|
+
isLoading,
|
|
8816
|
+
error,
|
|
8817
|
+
components: currentFlow?.data?.components || [],
|
|
8818
|
+
handleInputChange,
|
|
8819
|
+
handleSubmit,
|
|
8820
|
+
validateForm,
|
|
8821
|
+
title: flowTitle || t("signup.title"),
|
|
8822
|
+
subtitle: flowSubtitle || t("signup.subtitle"),
|
|
8823
|
+
messages: flowMessages || []
|
|
8824
|
+
};
|
|
8825
|
+
return /* @__PURE__ */ jsx66("div", { className: containerClasses, children: children(renderProps) });
|
|
8826
|
+
}
|
|
8652
8827
|
if (!isFlowInitialized && isLoading) {
|
|
8653
8828
|
return /* @__PURE__ */ jsx66(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx66(Card_default.Content, { children: /* @__PURE__ */ jsx66("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx66(Spinner_default, { size: "medium" }) }) }) });
|
|
8654
8829
|
}
|
|
@@ -8682,7 +8857,8 @@ var BaseSignUp_default = BaseSignUp;
|
|
|
8682
8857
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8683
8858
|
import {
|
|
8684
8859
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType2,
|
|
8685
|
-
EmbeddedFlowType as EmbeddedFlowType2
|
|
8860
|
+
EmbeddedFlowType as EmbeddedFlowType2,
|
|
8861
|
+
Platform as Platform4
|
|
8686
8862
|
} from "@asgardeo/browser";
|
|
8687
8863
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
8688
8864
|
var SignUp = ({
|
|
@@ -8692,14 +8868,17 @@ var SignUp = ({
|
|
|
8692
8868
|
onError,
|
|
8693
8869
|
onComplete,
|
|
8694
8870
|
shouldRedirectAfterSignUp = true,
|
|
8871
|
+
children,
|
|
8695
8872
|
...rest
|
|
8696
8873
|
}) => {
|
|
8697
|
-
const { signUp, isInitialized } = useAsgardeo_default();
|
|
8698
|
-
const handleInitialize = async (payload) =>
|
|
8699
|
-
payload || {
|
|
8700
|
-
flowType: EmbeddedFlowType2.Registration
|
|
8701
|
-
|
|
8702
|
-
|
|
8874
|
+
const { signUp, isInitialized, applicationId, platform } = useAsgardeo_default();
|
|
8875
|
+
const handleInitialize = async (payload) => {
|
|
8876
|
+
const initialPayload = payload || {
|
|
8877
|
+
flowType: EmbeddedFlowType2.Registration,
|
|
8878
|
+
...platform === Platform4.AsgardeoV2 && applicationId && { applicationId }
|
|
8879
|
+
};
|
|
8880
|
+
return await signUp(initialPayload);
|
|
8881
|
+
};
|
|
8703
8882
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8704
8883
|
const handleComplete = (response) => {
|
|
8705
8884
|
onComplete?.(response);
|
|
@@ -8722,6 +8901,7 @@ var SignUp = ({
|
|
|
8722
8901
|
className,
|
|
8723
8902
|
size,
|
|
8724
8903
|
isInitialized,
|
|
8904
|
+
children,
|
|
8725
8905
|
...rest
|
|
8726
8906
|
}
|
|
8727
8907
|
);
|
|
@@ -9582,7 +9762,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9582
9762
|
display: flex;
|
|
9583
9763
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
9584
9764
|
align-items: center;
|
|
9585
|
-
margin-
|
|
9765
|
+
margin-inline-start: calc(${theme.vars.spacing.unit} * 4);
|
|
9586
9766
|
`;
|
|
9587
9767
|
const complexTextarea = css22`
|
|
9588
9768
|
min-height: 60px;
|
|
@@ -9649,7 +9829,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9649
9829
|
width: 120px;
|
|
9650
9830
|
flex-shrink: 0;
|
|
9651
9831
|
line-height: 28px;
|
|
9652
|
-
text-align:
|
|
9832
|
+
text-align: start;
|
|
9653
9833
|
`;
|
|
9654
9834
|
const value = css22`
|
|
9655
9835
|
color: ${theme.vars.colors.text.primary};
|
|
@@ -9664,7 +9844,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9664
9844
|
text-overflow: ellipsis;
|
|
9665
9845
|
white-space: nowrap;
|
|
9666
9846
|
max-width: 350px;
|
|
9667
|
-
text-align:
|
|
9847
|
+
text-align: start;
|
|
9668
9848
|
|
|
9669
9849
|
.${withVendorCSSClassPrefix25("form-control")} {
|
|
9670
9850
|
margin-bottom: 0;
|
|
@@ -10314,7 +10494,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10314
10494
|
border: none;
|
|
10315
10495
|
cursor: pointer;
|
|
10316
10496
|
font-size: 0.875rem;
|
|
10317
|
-
text-align:
|
|
10497
|
+
text-align: start;
|
|
10318
10498
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10319
10499
|
transition: none;
|
|
10320
10500
|
box-shadow: none;
|
|
@@ -10343,7 +10523,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10343
10523
|
background: none;
|
|
10344
10524
|
cursor: pointer;
|
|
10345
10525
|
font-size: 0.875rem;
|
|
10346
|
-
text-align:
|
|
10526
|
+
text-align: start;
|
|
10347
10527
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10348
10528
|
transition: background-color 0.15s ease-in-out;
|
|
10349
10529
|
|
|
@@ -10828,7 +11008,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10828
11008
|
`;
|
|
10829
11009
|
const manageButton = css24`
|
|
10830
11010
|
min-width: auto;
|
|
10831
|
-
margin-
|
|
11011
|
+
margin-inline-start: auto;
|
|
10832
11012
|
`;
|
|
10833
11013
|
const menu = css24`
|
|
10834
11014
|
display: flex;
|
|
@@ -10848,7 +11028,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10848
11028
|
background-color: transparent;
|
|
10849
11029
|
cursor: pointer;
|
|
10850
11030
|
font-size: 0.875rem;
|
|
10851
|
-
text-align:
|
|
11031
|
+
text-align: start;
|
|
10852
11032
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10853
11033
|
transition: background-color 0.15s ease-in-out;
|
|
10854
11034
|
|
|
@@ -10986,11 +11166,12 @@ var BaseOrganizationSwitcher = ({
|
|
|
10986
11166
|
avatarSize = 24,
|
|
10987
11167
|
fallback = null
|
|
10988
11168
|
}) => {
|
|
10989
|
-
const { theme, colorScheme } = useTheme_default();
|
|
11169
|
+
const { theme, colorScheme, direction } = useTheme_default();
|
|
10990
11170
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
10991
11171
|
const [isOpen, setIsOpen] = useState23(false);
|
|
10992
11172
|
const [hoveredItemIndex, setHoveredItemIndex] = useState23(null);
|
|
10993
11173
|
const { t } = useTranslation_default();
|
|
11174
|
+
const isRTL = direction === "rtl";
|
|
10994
11175
|
const { refs, floatingStyles, context } = useFloating3({
|
|
10995
11176
|
open: isOpen,
|
|
10996
11177
|
onOpenChange: setIsOpen,
|
|
@@ -11072,7 +11253,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11072
11253
|
/* @__PURE__ */ jsx86(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11073
11254
|
showTriggerLabel && /* @__PURE__ */ jsx86(Typography_default, { variant: "body2", className: cx27(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
11074
11255
|
] }),
|
|
11075
|
-
/* @__PURE__ */ jsx86(ChevronDown_default, { width: "16", height: "16" })
|
|
11256
|
+
/* @__PURE__ */ jsx86("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ jsx86(ChevronDown_default, { width: "16", height: "16" }) })
|
|
11076
11257
|
]
|
|
11077
11258
|
}
|
|
11078
11259
|
),
|
|
@@ -12964,10 +13145,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
12964
13145
|
|
|
12965
13146
|
&__loading-overlay {
|
|
12966
13147
|
position: absolute;
|
|
12967
|
-
|
|
12968
|
-
left: 0;
|
|
12969
|
-
right: 0;
|
|
12970
|
-
bottom: 0;
|
|
13148
|
+
inset: 0;
|
|
12971
13149
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
12972
13150
|
display: flex;
|
|
12973
13151
|
align-items: center;
|
|
@@ -12992,10 +13170,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
12992
13170
|
`,
|
|
12993
13171
|
loadingOverlay: css29`
|
|
12994
13172
|
position: absolute;
|
|
12995
|
-
|
|
12996
|
-
left: 0;
|
|
12997
|
-
right: 0;
|
|
12998
|
-
bottom: 0;
|
|
13173
|
+
inset: 0;
|
|
12999
13174
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13000
13175
|
display: flex;
|
|
13001
13176
|
align-items: center;
|