@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/cjs/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AlertTitle: () => AlertTitle,
|
|
37
37
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
38
38
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
39
|
-
AsgardeoRuntimeError: () =>
|
|
39
|
+
AsgardeoRuntimeError: () => import_browser75.AsgardeoRuntimeError,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseOrganization: () => BaseOrganization_default,
|
|
42
42
|
BaseOrganizationList: () => BaseOrganizationList_default,
|
|
@@ -125,17 +125,17 @@ __export(index_exports, {
|
|
|
125
125
|
UsernamePassword: () => UsernamePassword_default,
|
|
126
126
|
createField: () => createField,
|
|
127
127
|
createOrganization: () => createOrganization_default,
|
|
128
|
-
createPatchOperations: () =>
|
|
128
|
+
createPatchOperations: () => import_browser74.createPatchOperations,
|
|
129
129
|
createSignInOption: () => createSignInOption,
|
|
130
130
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
131
|
-
getActiveTheme: () =>
|
|
131
|
+
getActiveTheme: () => import_browser75.getActiveTheme,
|
|
132
132
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
133
133
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
134
134
|
getMeProfile: () => getScim2Me_default,
|
|
135
135
|
getOrganization: () => getOrganization_default,
|
|
136
136
|
getSchemas: () => getSchemas_default,
|
|
137
|
-
http: () =>
|
|
138
|
-
navigate: () =>
|
|
137
|
+
http: () => import_browser75.http,
|
|
138
|
+
navigate: () => import_browser75.navigate,
|
|
139
139
|
updateMeProfile: () => updateMeProfile_default,
|
|
140
140
|
updateOrganization: () => updateOrganization_default,
|
|
141
141
|
useAlertVariant: () => useAlertVariant,
|
|
@@ -893,16 +893,22 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
893
893
|
return Promise.resolve(String(response));
|
|
894
894
|
}
|
|
895
895
|
async signUp(...args) {
|
|
896
|
-
const
|
|
896
|
+
const config = await this.asgardeo.getConfigData();
|
|
897
897
|
const firstArg = args[0];
|
|
898
|
+
const baseUrl = config?.baseUrl;
|
|
899
|
+
if (config.platform === import_browser6.Platform.AsgardeoV2) {
|
|
900
|
+
return (0, import_browser6.executeEmbeddedSignUpFlowV2)({
|
|
901
|
+
baseUrl,
|
|
902
|
+
payload: firstArg
|
|
903
|
+
});
|
|
904
|
+
}
|
|
898
905
|
if (typeof firstArg === "object" && "flowType" in firstArg) {
|
|
899
|
-
const baseUrl = configData?.baseUrl;
|
|
900
906
|
return (0, import_browser6.executeEmbeddedSignUpFlow)({
|
|
901
907
|
baseUrl,
|
|
902
908
|
payload: firstArg
|
|
903
909
|
});
|
|
904
910
|
}
|
|
905
|
-
(0, import_browser6.navigate)((0, import_browser6.getRedirectBasedSignUpUrl)(
|
|
911
|
+
(0, import_browser6.navigate)((0, import_browser6.getRedirectBasedSignUpUrl)(config));
|
|
906
912
|
}
|
|
907
913
|
async request(requestConfig) {
|
|
908
914
|
return this.asgardeo.httpRequest(requestConfig);
|
|
@@ -1390,6 +1396,7 @@ var ThemeProvider = ({
|
|
|
1390
1396
|
};
|
|
1391
1397
|
}, [inheritFromBranding, brandingTheme, themeConfig]);
|
|
1392
1398
|
const theme = (0, import_react11.useMemo)(() => (0, import_browser10.createTheme)(finalThemeConfig, colorScheme === "dark"), [finalThemeConfig, colorScheme]);
|
|
1399
|
+
const direction = finalThemeConfig?.direction || "ltr";
|
|
1393
1400
|
const handleThemeChange = (0, import_react11.useCallback)((isDark) => {
|
|
1394
1401
|
setColorScheme(isDark ? "dark" : "light");
|
|
1395
1402
|
}, []);
|
|
@@ -1428,9 +1435,15 @@ var ThemeProvider = ({
|
|
|
1428
1435
|
(0, import_react11.useEffect)(() => {
|
|
1429
1436
|
applyThemeToDOM(theme);
|
|
1430
1437
|
}, [theme]);
|
|
1438
|
+
(0, import_react11.useEffect)(() => {
|
|
1439
|
+
if (typeof document !== "undefined") {
|
|
1440
|
+
document.documentElement.dir = direction;
|
|
1441
|
+
}
|
|
1442
|
+
}, [direction]);
|
|
1431
1443
|
const value = {
|
|
1432
1444
|
theme,
|
|
1433
1445
|
colorScheme,
|
|
1446
|
+
direction,
|
|
1434
1447
|
toggleTheme,
|
|
1435
1448
|
isBrandingLoading,
|
|
1436
1449
|
brandingError,
|
|
@@ -1892,7 +1905,10 @@ var AsgardeoProvider = ({
|
|
|
1892
1905
|
ThemeProvider_default,
|
|
1893
1906
|
{
|
|
1894
1907
|
inheritFromBranding: preferences?.theme?.inheritFromBranding,
|
|
1895
|
-
theme:
|
|
1908
|
+
theme: {
|
|
1909
|
+
...preferences?.theme?.overrides,
|
|
1910
|
+
direction: preferences?.theme?.direction
|
|
1911
|
+
},
|
|
1896
1912
|
mode: (0, import_browser12.getActiveTheme)(preferences?.theme?.mode),
|
|
1897
1913
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(UserProvider_default, { profile: userProfile, onUpdateProfile: handleProfileUpdate, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1898
1914
|
OrganizationProvider_default,
|
|
@@ -3378,13 +3394,13 @@ var import_react34 = require("react");
|
|
|
3378
3394
|
var useStyles4 = (theme, colorScheme, helperTextAlign, helperTextMarginLeft, hasError) => {
|
|
3379
3395
|
return (0, import_react34.useMemo)(() => {
|
|
3380
3396
|
const formControl = import_css10.css`
|
|
3381
|
-
text-align:
|
|
3397
|
+
text-align: start;
|
|
3382
3398
|
margin-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
3383
3399
|
`;
|
|
3384
3400
|
const helperText = import_css10.css`
|
|
3385
3401
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
3386
|
-
text-align: ${helperTextAlign};
|
|
3387
|
-
${helperTextMarginLeft && `margin-
|
|
3402
|
+
text-align: ${helperTextAlign === "left" ? "start" : helperTextAlign};
|
|
3403
|
+
${helperTextMarginLeft && `margin-inline-start: ${helperTextMarginLeft};`}
|
|
3388
3404
|
`;
|
|
3389
3405
|
const helperTextError = import_css10.css`
|
|
3390
3406
|
color: ${theme.vars.colors.error.main};
|
|
@@ -3518,8 +3534,8 @@ var import_css14 = require("@emotion/css");
|
|
|
3518
3534
|
var import_react36 = require("react");
|
|
3519
3535
|
var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIcon) => {
|
|
3520
3536
|
return (0, import_react36.useMemo)(() => {
|
|
3521
|
-
const
|
|
3522
|
-
const
|
|
3537
|
+
const inlineStartPadding = hasStartIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3538
|
+
const inlineEndPadding = hasEndIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3523
3539
|
const inputContainer = import_css14.css`
|
|
3524
3540
|
position: relative;
|
|
3525
3541
|
display: flex;
|
|
@@ -3527,7 +3543,9 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3527
3543
|
`;
|
|
3528
3544
|
const input = import_css14.css`
|
|
3529
3545
|
width: 100%;
|
|
3530
|
-
padding: ${theme.vars.spacing.unit}
|
|
3546
|
+
padding-block: ${theme.vars.spacing.unit};
|
|
3547
|
+
padding-inline-start: ${inlineStartPadding};
|
|
3548
|
+
padding-inline-end: ${inlineEndPadding};
|
|
3531
3549
|
border: 1px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
|
|
3532
3550
|
border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
|
|
3533
3551
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
@@ -3598,11 +3616,11 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3598
3616
|
`;
|
|
3599
3617
|
const startIcon = import_css14.css`
|
|
3600
3618
|
${icon};
|
|
3601
|
-
|
|
3619
|
+
inset-inline-start: ${theme.vars.spacing.unit};
|
|
3602
3620
|
`;
|
|
3603
3621
|
const endIcon = import_css14.css`
|
|
3604
3622
|
${icon};
|
|
3605
|
-
|
|
3623
|
+
inset-inline-end: ${theme.vars.spacing.unit};
|
|
3606
3624
|
`;
|
|
3607
3625
|
return {
|
|
3608
3626
|
inputContainer,
|
|
@@ -4317,7 +4335,7 @@ var useStyles11 = (theme, colorScheme, hasError, required) => {
|
|
|
4317
4335
|
const inputStyles = import_css24.css`
|
|
4318
4336
|
width: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4319
4337
|
height: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4320
|
-
margin-
|
|
4338
|
+
margin-inline-end: ${theme.vars.spacing.unit};
|
|
4321
4339
|
accent-color: ${theme.vars.colors.primary.main};
|
|
4322
4340
|
cursor: pointer;
|
|
4323
4341
|
|
|
@@ -5834,8 +5852,9 @@ var useStyles14 = (theme, colorScheme, orientation, variant, color, hasChildren)
|
|
|
5834
5852
|
height: 100%;
|
|
5835
5853
|
min-height: calc(${theme.vars.spacing.unit} * 2);
|
|
5836
5854
|
width: 1px;
|
|
5837
|
-
border-
|
|
5838
|
-
margin: 0
|
|
5855
|
+
border-inline-start: 1px ${borderStyle} ${baseColor};
|
|
5856
|
+
margin-block: 0;
|
|
5857
|
+
margin-inline: calc(${theme.vars.spacing.unit} * 1);
|
|
5839
5858
|
`;
|
|
5840
5859
|
const horizontalDivider = import_css30.css`
|
|
5841
5860
|
display: flex;
|
|
@@ -7536,7 +7555,7 @@ var normalizeFlowResponse = (response, t) => {
|
|
|
7536
7555
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7537
7556
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7538
7557
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7539
|
-
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading
|
|
7558
|
+
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
7540
7559
|
const { t } = useTranslation_default();
|
|
7541
7560
|
const [components, setComponents] = (0, import_react60.useState)([]);
|
|
7542
7561
|
const [currentFlowId, setCurrentFlowId] = (0, import_react60.useState)(null);
|
|
@@ -7551,10 +7570,13 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7551
7570
|
}
|
|
7552
7571
|
}, [isInitialized, isLoading, isFlowInitialized]);
|
|
7553
7572
|
const initializeFlow = async () => {
|
|
7554
|
-
const
|
|
7555
|
-
|
|
7573
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
7574
|
+
const flowIdFromUrl = urlParams.get("flowId");
|
|
7575
|
+
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
7576
|
+
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
7577
|
+
if (!flowIdFromUrl && !effectiveApplicationId) {
|
|
7556
7578
|
const error = new import_browser49.AsgardeoRuntimeError(
|
|
7557
|
-
|
|
7579
|
+
"Either flowId or applicationId is required for authentication",
|
|
7558
7580
|
"SignIn-initializeFlow-RuntimeError-001",
|
|
7559
7581
|
"react",
|
|
7560
7582
|
"Something went wrong while trying to sign in. Please try again later."
|
|
@@ -7564,10 +7586,17 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7564
7586
|
}
|
|
7565
7587
|
try {
|
|
7566
7588
|
setFlowError(null);
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7589
|
+
let response;
|
|
7590
|
+
if (flowIdFromUrl) {
|
|
7591
|
+
response = await signIn({
|
|
7592
|
+
flowId: flowIdFromUrl
|
|
7593
|
+
});
|
|
7594
|
+
} else {
|
|
7595
|
+
response = await signIn({
|
|
7596
|
+
applicationId: effectiveApplicationId,
|
|
7597
|
+
flowType: import_browser49.EmbeddedFlowType.Authentication
|
|
7598
|
+
});
|
|
7599
|
+
}
|
|
7571
7600
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
7572
7601
|
if (flowId && components2) {
|
|
7573
7602
|
setCurrentFlowId(flowId);
|
|
@@ -7706,7 +7735,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7706
7735
|
var SignIn_default2 = SignIn2;
|
|
7707
7736
|
|
|
7708
7737
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7709
|
-
var
|
|
7738
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
7710
7739
|
var import_css39 = require("@emotion/css");
|
|
7711
7740
|
var import_react62 = require("react");
|
|
7712
7741
|
|
|
@@ -8218,6 +8247,110 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8218
8247
|
)
|
|
8219
8248
|
).filter(Boolean);
|
|
8220
8249
|
|
|
8250
|
+
// src/components/presentation/SignUp/transformer.ts
|
|
8251
|
+
var import_browser58 = require("@asgardeo/browser");
|
|
8252
|
+
var generateId2 = (prefix) => {
|
|
8253
|
+
const suffix = Math.random().toString(36).substring(2, 6);
|
|
8254
|
+
return `${prefix}_${suffix}`;
|
|
8255
|
+
};
|
|
8256
|
+
var getInputVariant2 = (type) => {
|
|
8257
|
+
switch (type.toLowerCase()) {
|
|
8258
|
+
case "email":
|
|
8259
|
+
return "EMAIL";
|
|
8260
|
+
case "password":
|
|
8261
|
+
return "PASSWORD";
|
|
8262
|
+
default:
|
|
8263
|
+
return "TEXT";
|
|
8264
|
+
}
|
|
8265
|
+
};
|
|
8266
|
+
var getInputLabel2 = (name, type, t) => {
|
|
8267
|
+
const i18nKey = `elements.fields.${name}`;
|
|
8268
|
+
const label = t(i18nKey);
|
|
8269
|
+
if (label === i18nKey || !label) {
|
|
8270
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
8271
|
+
}
|
|
8272
|
+
return label;
|
|
8273
|
+
};
|
|
8274
|
+
var getInputPlaceholder2 = (name, type, t) => {
|
|
8275
|
+
const label = getInputLabel2(name, type, t);
|
|
8276
|
+
const placeholder = t("elements.fields.placeholder", { field: label });
|
|
8277
|
+
if (!placeholder || placeholder === "elements.fields.placeholder") {
|
|
8278
|
+
return `Enter your ${label}`;
|
|
8279
|
+
}
|
|
8280
|
+
return placeholder;
|
|
8281
|
+
};
|
|
8282
|
+
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8283
|
+
const variant = getInputVariant2(input.type);
|
|
8284
|
+
const label = getInputLabel2(input.name, input.type, t);
|
|
8285
|
+
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
8286
|
+
return {
|
|
8287
|
+
id: generateId2("input"),
|
|
8288
|
+
type: import_browser58.EmbeddedFlowComponentType.Input,
|
|
8289
|
+
variant,
|
|
8290
|
+
config: {
|
|
8291
|
+
type: input.type === "string" ? "text" : input.type,
|
|
8292
|
+
label,
|
|
8293
|
+
placeholder,
|
|
8294
|
+
required: input.required,
|
|
8295
|
+
identifier: input.name,
|
|
8296
|
+
hint: ""
|
|
8297
|
+
},
|
|
8298
|
+
components: []
|
|
8299
|
+
};
|
|
8300
|
+
};
|
|
8301
|
+
var convertActionToComponent2 = (action, t) => {
|
|
8302
|
+
const i18nKey = `elements.buttons.${action.id}`;
|
|
8303
|
+
let text = t(i18nKey);
|
|
8304
|
+
if (!text || text === i18nKey) {
|
|
8305
|
+
text = action.id.replace(/_/g, " ");
|
|
8306
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
8307
|
+
}
|
|
8308
|
+
return {
|
|
8309
|
+
id: generateId2("action"),
|
|
8310
|
+
type: import_browser58.EmbeddedFlowComponentType.Button,
|
|
8311
|
+
variant: "SECONDARY",
|
|
8312
|
+
config: {
|
|
8313
|
+
type: "button",
|
|
8314
|
+
text,
|
|
8315
|
+
actionId: action.id,
|
|
8316
|
+
actionType: action.type
|
|
8317
|
+
},
|
|
8318
|
+
components: []
|
|
8319
|
+
};
|
|
8320
|
+
};
|
|
8321
|
+
var transformSimpleToComponentDriven2 = (response, t) => {
|
|
8322
|
+
const inputComponents = response?.data?.inputs?.map((input) => convertSimpleInputToComponent2(input, t)) || [];
|
|
8323
|
+
const actionComponents = response?.data?.actions?.map((action) => convertActionToComponent2(action, t)) || [];
|
|
8324
|
+
const submitButton = inputComponents.length > 0 ? {
|
|
8325
|
+
id: generateId2("button"),
|
|
8326
|
+
type: import_browser58.EmbeddedFlowComponentType.Button,
|
|
8327
|
+
variant: "PRIMARY",
|
|
8328
|
+
config: {
|
|
8329
|
+
type: "submit",
|
|
8330
|
+
text: t("elements.buttons.signUp")
|
|
8331
|
+
},
|
|
8332
|
+
components: []
|
|
8333
|
+
} : null;
|
|
8334
|
+
const formComponents = [];
|
|
8335
|
+
if (inputComponents.length > 0) {
|
|
8336
|
+
formComponents.push(...inputComponents);
|
|
8337
|
+
if (submitButton) formComponents.push(submitButton);
|
|
8338
|
+
}
|
|
8339
|
+
const result = [];
|
|
8340
|
+
if (formComponents.length > 0) {
|
|
8341
|
+
result.push({
|
|
8342
|
+
id: generateId2("form"),
|
|
8343
|
+
type: import_browser58.EmbeddedFlowComponentType.Form,
|
|
8344
|
+
config: {},
|
|
8345
|
+
components: formComponents
|
|
8346
|
+
});
|
|
8347
|
+
}
|
|
8348
|
+
if (actionComponents.length > 0) {
|
|
8349
|
+
result.push(...actionComponents);
|
|
8350
|
+
}
|
|
8351
|
+
return result;
|
|
8352
|
+
};
|
|
8353
|
+
|
|
8221
8354
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8222
8355
|
var import_css38 = require("@emotion/css");
|
|
8223
8356
|
var import_react61 = require("react");
|
|
@@ -8383,7 +8516,8 @@ var BaseSignUpContent = ({
|
|
|
8383
8516
|
messageClassName = "",
|
|
8384
8517
|
size = "medium",
|
|
8385
8518
|
variant = "outlined",
|
|
8386
|
-
isInitialized
|
|
8519
|
+
isInitialized,
|
|
8520
|
+
children
|
|
8387
8521
|
}) => {
|
|
8388
8522
|
const { theme, colorScheme } = useTheme_default();
|
|
8389
8523
|
const { t } = useTranslation_default();
|
|
@@ -8395,12 +8529,31 @@ var BaseSignUpContent = ({
|
|
|
8395
8529
|
const [error, setError] = (0, import_react62.useState)(null);
|
|
8396
8530
|
const [formData, setFormData] = (0, import_react62.useState)({});
|
|
8397
8531
|
const initializationAttemptedRef = (0, import_react62.useRef)(false);
|
|
8532
|
+
const normalizeFlowResponse2 = (0, import_react62.useCallback)(
|
|
8533
|
+
(response) => {
|
|
8534
|
+
if (response?.data?.components && Array.isArray(response.data.components)) {
|
|
8535
|
+
return response;
|
|
8536
|
+
}
|
|
8537
|
+
if (response?.data && (response.data.inputs || response.data.actions)) {
|
|
8538
|
+
const transformedComponents = transformSimpleToComponentDriven2(response, t);
|
|
8539
|
+
return {
|
|
8540
|
+
...response,
|
|
8541
|
+
data: {
|
|
8542
|
+
...response.data,
|
|
8543
|
+
components: transformedComponents
|
|
8544
|
+
}
|
|
8545
|
+
};
|
|
8546
|
+
}
|
|
8547
|
+
return response;
|
|
8548
|
+
},
|
|
8549
|
+
[t]
|
|
8550
|
+
);
|
|
8398
8551
|
const extractFormFields = (0, import_react62.useCallback)(
|
|
8399
8552
|
(components) => {
|
|
8400
8553
|
const fields = [];
|
|
8401
8554
|
const processComponents = (comps) => {
|
|
8402
8555
|
comps.forEach((component) => {
|
|
8403
|
-
if (component.type ===
|
|
8556
|
+
if (component.type === import_browser59.EmbeddedFlowComponentType.Input) {
|
|
8404
8557
|
const config = component.config || {};
|
|
8405
8558
|
fields.push({
|
|
8406
8559
|
name: config.name || component.id,
|
|
@@ -8490,13 +8643,14 @@ var BaseSignUpContent = ({
|
|
|
8490
8643
|
inputs: filteredInputs,
|
|
8491
8644
|
actionId: component.id
|
|
8492
8645
|
};
|
|
8493
|
-
const
|
|
8646
|
+
const rawResponse = await onSubmit(payload);
|
|
8647
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8494
8648
|
onFlowChange?.(response);
|
|
8495
|
-
if (response.flowStatus ===
|
|
8649
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8496
8650
|
onComplete?.(response);
|
|
8497
8651
|
return;
|
|
8498
8652
|
}
|
|
8499
|
-
if (response.flowStatus ===
|
|
8653
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8500
8654
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8501
8655
|
return;
|
|
8502
8656
|
}
|
|
@@ -8504,7 +8658,7 @@ var BaseSignUpContent = ({
|
|
|
8504
8658
|
setupFormFields(response);
|
|
8505
8659
|
}
|
|
8506
8660
|
} catch (err) {
|
|
8507
|
-
const errorMessage = err instanceof
|
|
8661
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8508
8662
|
setError(errorMessage);
|
|
8509
8663
|
onError?.(err);
|
|
8510
8664
|
} finally {
|
|
@@ -8512,7 +8666,7 @@ var BaseSignUpContent = ({
|
|
|
8512
8666
|
}
|
|
8513
8667
|
};
|
|
8514
8668
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8515
|
-
if (response?.type ===
|
|
8669
|
+
if (response?.type === import_browser59.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8516
8670
|
const redirectUrl = response.data.redirectURL;
|
|
8517
8671
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8518
8672
|
if (!popup) {
|
|
@@ -8541,16 +8695,16 @@ var BaseSignUpContent = ({
|
|
|
8541
8695
|
try {
|
|
8542
8696
|
const continueResponse = await onSubmit(payload);
|
|
8543
8697
|
onFlowChange?.(continueResponse);
|
|
8544
|
-
if (continueResponse.flowStatus ===
|
|
8698
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8545
8699
|
onComplete?.(continueResponse);
|
|
8546
|
-
} else if (continueResponse.flowStatus ===
|
|
8700
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8547
8701
|
setCurrentFlow(continueResponse);
|
|
8548
8702
|
setupFormFields(continueResponse);
|
|
8549
8703
|
}
|
|
8550
8704
|
popup.close();
|
|
8551
8705
|
cleanup();
|
|
8552
8706
|
} catch (err) {
|
|
8553
|
-
const errorMessage = err instanceof
|
|
8707
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8554
8708
|
setError(errorMessage);
|
|
8555
8709
|
onError?.(err);
|
|
8556
8710
|
popup.close();
|
|
@@ -8602,15 +8756,15 @@ var BaseSignUpContent = ({
|
|
|
8602
8756
|
try {
|
|
8603
8757
|
const continueResponse = await onSubmit(payload);
|
|
8604
8758
|
onFlowChange?.(continueResponse);
|
|
8605
|
-
if (continueResponse.flowStatus ===
|
|
8759
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8606
8760
|
onComplete?.(continueResponse);
|
|
8607
|
-
} else if (continueResponse.flowStatus ===
|
|
8761
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8608
8762
|
setCurrentFlow(continueResponse);
|
|
8609
8763
|
setupFormFields(continueResponse);
|
|
8610
8764
|
}
|
|
8611
8765
|
popup.close();
|
|
8612
8766
|
} catch (err) {
|
|
8613
|
-
const errorMessage = err instanceof
|
|
8767
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8614
8768
|
setError(errorMessage);
|
|
8615
8769
|
onError?.(err);
|
|
8616
8770
|
popup.close();
|
|
@@ -8629,30 +8783,30 @@ var BaseSignUpContent = ({
|
|
|
8629
8783
|
};
|
|
8630
8784
|
const containerClasses = (0, import_css39.cx)(
|
|
8631
8785
|
[
|
|
8632
|
-
(0,
|
|
8633
|
-
(0,
|
|
8634
|
-
(0,
|
|
8786
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup"),
|
|
8787
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
8788
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
8635
8789
|
],
|
|
8636
8790
|
className
|
|
8637
8791
|
);
|
|
8638
8792
|
const inputClasses = (0, import_css39.cx)(
|
|
8639
8793
|
[
|
|
8640
|
-
(0,
|
|
8641
|
-
size === "small" && (0,
|
|
8642
|
-
size === "large" && (0,
|
|
8794
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup__input"),
|
|
8795
|
+
size === "small" && (0, import_browser59.withVendorCSSClassPrefix)("signup__input--small"),
|
|
8796
|
+
size === "large" && (0, import_browser59.withVendorCSSClassPrefix)("signup__input--large")
|
|
8643
8797
|
],
|
|
8644
8798
|
inputClassName
|
|
8645
8799
|
);
|
|
8646
8800
|
const buttonClasses = (0, import_css39.cx)(
|
|
8647
8801
|
[
|
|
8648
|
-
(0,
|
|
8649
|
-
size === "small" && (0,
|
|
8650
|
-
size === "large" && (0,
|
|
8802
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup__button"),
|
|
8803
|
+
size === "small" && (0, import_browser59.withVendorCSSClassPrefix)("signup__button--small"),
|
|
8804
|
+
size === "large" && (0, import_browser59.withVendorCSSClassPrefix)("signup__button--large")
|
|
8651
8805
|
],
|
|
8652
8806
|
buttonClassName
|
|
8653
8807
|
);
|
|
8654
|
-
const errorClasses = (0, import_css39.cx)([(0,
|
|
8655
|
-
const messageClasses = (0, import_css39.cx)([(0,
|
|
8808
|
+
const errorClasses = (0, import_css39.cx)([(0, import_browser59.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
8809
|
+
const messageClasses = (0, import_css39.cx)([(0, import_browser59.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
8656
8810
|
const renderComponents = (0, import_react62.useCallback)(
|
|
8657
8811
|
(components) => renderSignUpComponents(
|
|
8658
8812
|
components,
|
|
@@ -8692,15 +8846,16 @@ var BaseSignUpContent = ({
|
|
|
8692
8846
|
setIsLoading(true);
|
|
8693
8847
|
setError(null);
|
|
8694
8848
|
try {
|
|
8695
|
-
const
|
|
8849
|
+
const rawResponse = await onInitialize();
|
|
8850
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8696
8851
|
setCurrentFlow(response);
|
|
8697
8852
|
setIsFlowInitialized(true);
|
|
8698
8853
|
onFlowChange?.(response);
|
|
8699
|
-
if (response.flowStatus ===
|
|
8854
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8700
8855
|
onComplete?.(response);
|
|
8701
8856
|
return;
|
|
8702
8857
|
}
|
|
8703
|
-
if (response.flowStatus ===
|
|
8858
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8704
8859
|
setupFormFields(response);
|
|
8705
8860
|
}
|
|
8706
8861
|
} catch (err) {
|
|
@@ -8720,9 +8875,28 @@ var BaseSignUpContent = ({
|
|
|
8720
8875
|
onError,
|
|
8721
8876
|
onFlowChange,
|
|
8722
8877
|
setupFormFields,
|
|
8878
|
+
normalizeFlowResponse2,
|
|
8723
8879
|
afterSignUpUrl,
|
|
8724
8880
|
t
|
|
8725
8881
|
]);
|
|
8882
|
+
if (children) {
|
|
8883
|
+
const renderProps = {
|
|
8884
|
+
values: formValues,
|
|
8885
|
+
errors: formErrors,
|
|
8886
|
+
touched: touchedFields,
|
|
8887
|
+
isValid: isFormValid,
|
|
8888
|
+
isLoading,
|
|
8889
|
+
error,
|
|
8890
|
+
components: currentFlow?.data?.components || [],
|
|
8891
|
+
handleInputChange,
|
|
8892
|
+
handleSubmit,
|
|
8893
|
+
validateForm,
|
|
8894
|
+
title: flowTitle || t("signup.title"),
|
|
8895
|
+
subtitle: flowSubtitle || t("signup.subtitle"),
|
|
8896
|
+
messages: flowMessages || []
|
|
8897
|
+
};
|
|
8898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: containerClasses, children: children(renderProps) });
|
|
8899
|
+
}
|
|
8726
8900
|
if (!isFlowInitialized && isLoading) {
|
|
8727
8901
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: styles.loadingContainer, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
8728
8902
|
}
|
|
@@ -8754,7 +8928,7 @@ var BaseSignUpContent = ({
|
|
|
8754
8928
|
var BaseSignUp_default = BaseSignUp;
|
|
8755
8929
|
|
|
8756
8930
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8757
|
-
var
|
|
8931
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
8758
8932
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
8759
8933
|
var SignUp = ({
|
|
8760
8934
|
className,
|
|
@@ -8763,21 +8937,24 @@ var SignUp = ({
|
|
|
8763
8937
|
onError,
|
|
8764
8938
|
onComplete,
|
|
8765
8939
|
shouldRedirectAfterSignUp = true,
|
|
8940
|
+
children,
|
|
8766
8941
|
...rest
|
|
8767
8942
|
}) => {
|
|
8768
|
-
const { signUp, isInitialized } = useAsgardeo_default();
|
|
8769
|
-
const handleInitialize = async (payload) =>
|
|
8770
|
-
payload || {
|
|
8771
|
-
flowType:
|
|
8772
|
-
|
|
8773
|
-
|
|
8943
|
+
const { signUp, isInitialized, applicationId, platform } = useAsgardeo_default();
|
|
8944
|
+
const handleInitialize = async (payload) => {
|
|
8945
|
+
const initialPayload = payload || {
|
|
8946
|
+
flowType: import_browser60.EmbeddedFlowType.Registration,
|
|
8947
|
+
...platform === import_browser60.Platform.AsgardeoV2 && applicationId && { applicationId }
|
|
8948
|
+
};
|
|
8949
|
+
return await signUp(initialPayload);
|
|
8950
|
+
};
|
|
8774
8951
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8775
8952
|
const handleComplete = (response) => {
|
|
8776
8953
|
onComplete?.(response);
|
|
8777
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
8954
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser60.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
8778
8955
|
window.location.href = afterSignUpUrl;
|
|
8779
8956
|
}
|
|
8780
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
8957
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser60.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
8781
8958
|
!response.data.redirectURL.includes("auth")) {
|
|
8782
8959
|
window.location.href = response.data.redirectURL;
|
|
8783
8960
|
}
|
|
@@ -8793,6 +8970,7 @@ var SignUp = ({
|
|
|
8793
8970
|
className,
|
|
8794
8971
|
size,
|
|
8795
8972
|
isInitialized,
|
|
8973
|
+
children,
|
|
8796
8974
|
...rest
|
|
8797
8975
|
}
|
|
8798
8976
|
);
|
|
@@ -8840,35 +9018,35 @@ Organization5.displayName = "Organization";
|
|
|
8840
9018
|
var Organization_default = Organization5;
|
|
8841
9019
|
|
|
8842
9020
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8843
|
-
var
|
|
9021
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
8844
9022
|
var import_css47 = require("@emotion/css");
|
|
8845
9023
|
var import_react71 = require("react");
|
|
8846
9024
|
|
|
8847
9025
|
// src/utils/getMappedUserProfileValue.ts
|
|
8848
|
-
var
|
|
9026
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
8849
9027
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8850
9028
|
if (!key || !mappings || !user) {
|
|
8851
9029
|
return void 0;
|
|
8852
9030
|
}
|
|
8853
9031
|
const mapping = mappings[key];
|
|
8854
9032
|
if (!mapping) {
|
|
8855
|
-
return (0,
|
|
9033
|
+
return (0, import_browser61.get)(user, key);
|
|
8856
9034
|
}
|
|
8857
9035
|
if (Array.isArray(mapping)) {
|
|
8858
9036
|
for (const path of mapping) {
|
|
8859
|
-
const value = (0,
|
|
9037
|
+
const value = (0, import_browser61.get)(user, path);
|
|
8860
9038
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8861
9039
|
return value;
|
|
8862
9040
|
}
|
|
8863
9041
|
}
|
|
8864
9042
|
return void 0;
|
|
8865
9043
|
}
|
|
8866
|
-
return (0,
|
|
9044
|
+
return (0, import_browser61.get)(user, mapping);
|
|
8867
9045
|
};
|
|
8868
9046
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8869
9047
|
|
|
8870
9048
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8871
|
-
var
|
|
9049
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
8872
9050
|
var import_css41 = require("@emotion/css");
|
|
8873
9051
|
var import_react64 = require("react");
|
|
8874
9052
|
|
|
@@ -8987,20 +9165,20 @@ var Avatar = ({
|
|
|
8987
9165
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
8988
9166
|
const renderContent = () => {
|
|
8989
9167
|
if (imageUrl) {
|
|
8990
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("img", { src: imageUrl, alt, className: (0, import_css41.cx)((0,
|
|
9168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("img", { src: imageUrl, alt, className: (0, import_css41.cx)((0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", "image")), styles.image) });
|
|
8991
9169
|
}
|
|
8992
9170
|
if (name) {
|
|
8993
9171
|
return getInitials(name);
|
|
8994
9172
|
}
|
|
8995
9173
|
if (isLoading) {
|
|
8996
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: (0, import_css41.cx)((0,
|
|
9174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: (0, import_css41.cx)((0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
8997
9175
|
}
|
|
8998
9176
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
8999
9177
|
"svg",
|
|
9000
9178
|
{
|
|
9001
9179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9002
9180
|
viewBox: "0 0 640 640",
|
|
9003
|
-
className: (0, import_css41.cx)((0,
|
|
9181
|
+
className: (0, import_css41.cx)((0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", "icon")), styles.icon),
|
|
9004
9182
|
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
9005
9183
|
}
|
|
9006
9184
|
);
|
|
@@ -9009,11 +9187,11 @@ var Avatar = ({
|
|
|
9009
9187
|
"div",
|
|
9010
9188
|
{
|
|
9011
9189
|
className: (0, import_css41.cx)(
|
|
9012
|
-
(0,
|
|
9190
|
+
(0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar")),
|
|
9013
9191
|
styles.avatar,
|
|
9014
9192
|
styles.variant,
|
|
9015
|
-
(0,
|
|
9016
|
-
isDefaultState && (0,
|
|
9193
|
+
(0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", null, variant)),
|
|
9194
|
+
isDefaultState && (0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", "default")),
|
|
9017
9195
|
className
|
|
9018
9196
|
),
|
|
9019
9197
|
children: renderContent()
|
|
@@ -9023,7 +9201,7 @@ var Avatar = ({
|
|
|
9023
9201
|
var Avatar_default = Avatar;
|
|
9024
9202
|
|
|
9025
9203
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9026
|
-
var
|
|
9204
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
9027
9205
|
var import_react66 = require("@floating-ui/react");
|
|
9028
9206
|
var import_css43 = require("@emotion/css");
|
|
9029
9207
|
var import_react67 = __toESM(require("react"), 1);
|
|
@@ -9260,11 +9438,11 @@ var DialogContent = import_react67.default.forwardRef((props, propRef) => {
|
|
|
9260
9438
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9261
9439
|
const ref = (0, import_react66.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
9262
9440
|
if (!floatingContext.open) return null;
|
|
9263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react66.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react66.FloatingOverlay, { className: (0, import_css43.cx)((0,
|
|
9441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react66.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react66.FloatingOverlay, { className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react66.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9264
9442
|
"div",
|
|
9265
9443
|
{
|
|
9266
9444
|
ref,
|
|
9267
|
-
className: (0, import_css43.cx)((0,
|
|
9445
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "content")), styles.content, props.className),
|
|
9268
9446
|
"aria-labelledby": context.labelId,
|
|
9269
9447
|
"aria-describedby": context.descriptionId,
|
|
9270
9448
|
...context.getFloatingProps(props),
|
|
@@ -9282,14 +9460,14 @@ var DialogHeading = import_react67.default.forwardRef(
|
|
|
9282
9460
|
context.setLabelId(id);
|
|
9283
9461
|
return () => context.setLabelId(void 0);
|
|
9284
9462
|
}, [id, context.setLabelId]);
|
|
9285
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_css43.cx)((0,
|
|
9463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "header")), styles.header), children: [
|
|
9286
9464
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9287
9465
|
"h2",
|
|
9288
9466
|
{
|
|
9289
9467
|
...props,
|
|
9290
9468
|
ref,
|
|
9291
9469
|
id,
|
|
9292
|
-
className: (0, import_css43.cx)((0,
|
|
9470
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "title")), styles.headerTitle),
|
|
9293
9471
|
children
|
|
9294
9472
|
}
|
|
9295
9473
|
),
|
|
@@ -9324,7 +9502,7 @@ var DialogDescription = import_react67.default.forwardRef(
|
|
|
9324
9502
|
...props,
|
|
9325
9503
|
ref,
|
|
9326
9504
|
id,
|
|
9327
|
-
className: (0, import_css43.cx)((0,
|
|
9505
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "description")), styles.description, props.className),
|
|
9328
9506
|
children
|
|
9329
9507
|
}
|
|
9330
9508
|
);
|
|
@@ -9354,7 +9532,7 @@ var DialogClose = import_react67.default.forwardRef(({ children, asChild = false
|
|
|
9354
9532
|
...props,
|
|
9355
9533
|
ref,
|
|
9356
9534
|
onClick: handleClick,
|
|
9357
|
-
className: (0, import_css43.cx)((0,
|
|
9535
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "close")), props.className),
|
|
9358
9536
|
variant: "text",
|
|
9359
9537
|
children
|
|
9360
9538
|
}
|
|
@@ -9375,7 +9553,7 @@ var Dialog_default = Dialog;
|
|
|
9375
9553
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9376
9554
|
var import_react69 = require("react");
|
|
9377
9555
|
var import_css45 = require("@emotion/css");
|
|
9378
|
-
var
|
|
9556
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
9379
9557
|
|
|
9380
9558
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
9381
9559
|
var import_css44 = require("@emotion/css");
|
|
@@ -9567,26 +9745,26 @@ var MultiInput = ({
|
|
|
9567
9745
|
{
|
|
9568
9746
|
error,
|
|
9569
9747
|
helperText,
|
|
9570
|
-
className: (0, import_css45.cx)((0,
|
|
9748
|
+
className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input")), className),
|
|
9571
9749
|
style,
|
|
9572
9750
|
children: [
|
|
9573
9751
|
label && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
9574
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css45.cx)((0,
|
|
9575
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_css45.cx)((0,
|
|
9752
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "container")), styles.container), children: [
|
|
9753
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
9576
9754
|
currentInputValue,
|
|
9577
9755
|
setCurrentInputValue,
|
|
9578
9756
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9579
9757
|
canAddMore ? handleInputSubmit : void 0
|
|
9580
9758
|
) }) }),
|
|
9581
|
-
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_css45.cx)((0,
|
|
9759
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
9582
9760
|
"div",
|
|
9583
9761
|
{
|
|
9584
|
-
className: (0, import_css45.cx)((0,
|
|
9762
|
+
className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "list-item")), styles.listItem),
|
|
9585
9763
|
children: [
|
|
9586
9764
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9587
9765
|
"span",
|
|
9588
9766
|
{
|
|
9589
|
-
className: (0, import_css45.cx)((0,
|
|
9767
|
+
className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
9590
9768
|
children: value
|
|
9591
9769
|
}
|
|
9592
9770
|
),
|
|
@@ -9596,7 +9774,7 @@ var MultiInput = ({
|
|
|
9596
9774
|
type: "button",
|
|
9597
9775
|
onClick: () => handleRemoveValue(index),
|
|
9598
9776
|
disabled,
|
|
9599
|
-
className: (0, import_css45.cx)((0,
|
|
9777
|
+
className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
9600
9778
|
title: "Remove value",
|
|
9601
9779
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(BinIcon, { className: styles.icon })
|
|
9602
9780
|
}
|
|
@@ -9615,7 +9793,7 @@ var MultiInput_default = MultiInput;
|
|
|
9615
9793
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
9616
9794
|
var import_css46 = require("@emotion/css");
|
|
9617
9795
|
var import_react70 = require("react");
|
|
9618
|
-
var
|
|
9796
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9619
9797
|
var useStyles22 = (theme, colorScheme) => {
|
|
9620
9798
|
const valuePlaceholder = import_css46.css`
|
|
9621
9799
|
font-style: italic;
|
|
@@ -9642,7 +9820,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9642
9820
|
display: flex;
|
|
9643
9821
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
9644
9822
|
align-items: center;
|
|
9645
|
-
margin-
|
|
9823
|
+
margin-inline-start: calc(${theme.vars.spacing.unit} * 4);
|
|
9646
9824
|
`;
|
|
9647
9825
|
const complexTextarea = import_css46.css`
|
|
9648
9826
|
min-height: 60px;
|
|
@@ -9709,7 +9887,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9709
9887
|
width: 120px;
|
|
9710
9888
|
flex-shrink: 0;
|
|
9711
9889
|
line-height: 28px;
|
|
9712
|
-
text-align:
|
|
9890
|
+
text-align: start;
|
|
9713
9891
|
`;
|
|
9714
9892
|
const value = import_css46.css`
|
|
9715
9893
|
color: ${theme.vars.colors.text.primary};
|
|
@@ -9724,9 +9902,9 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9724
9902
|
text-overflow: ellipsis;
|
|
9725
9903
|
white-space: nowrap;
|
|
9726
9904
|
max-width: 350px;
|
|
9727
|
-
text-align:
|
|
9905
|
+
text-align: start;
|
|
9728
9906
|
|
|
9729
|
-
.${(0,
|
|
9907
|
+
.${(0, import_browser65.withVendorCSSClassPrefix)("form-control")} {
|
|
9730
9908
|
margin-bottom: 0;
|
|
9731
9909
|
}
|
|
9732
9910
|
|
|
@@ -9925,7 +10103,7 @@ var BaseUserProfile = ({
|
|
|
9925
10103
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
9926
10104
|
}
|
|
9927
10105
|
let payload = {};
|
|
9928
|
-
if (schema.schemaId && schema.schemaId !==
|
|
10106
|
+
if (schema.schemaId && schema.schemaId !== import_browser66.WellKnownSchemaIds.User) {
|
|
9929
10107
|
payload = {
|
|
9930
10108
|
[schema.schemaId]: {
|
|
9931
10109
|
[fieldName]: fieldValue
|
|
@@ -10159,7 +10337,7 @@ var BaseUserProfile = ({
|
|
|
10159
10337
|
const containerClasses = (0, import_css47.cx)(
|
|
10160
10338
|
styles.root,
|
|
10161
10339
|
cardLayout ? styles.card : "",
|
|
10162
|
-
(0,
|
|
10340
|
+
(0, import_browser66.withVendorCSSClassPrefix)("user-profile"),
|
|
10163
10341
|
className
|
|
10164
10342
|
);
|
|
10165
10343
|
const currentUser = flattenedProfile || profile;
|
|
@@ -10177,7 +10355,7 @@ var BaseUserProfile = ({
|
|
|
10177
10355
|
] }, key)) });
|
|
10178
10356
|
};
|
|
10179
10357
|
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Card_default, { className: containerClasses, children: [
|
|
10180
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Alert_default, { variant: "error", className: (0, import_css47.cx)((0,
|
|
10358
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Alert_default, { variant: "error", className: (0, import_css47.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("user-profile", "alert")), styles.alert), children: [
|
|
10181
10359
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10182
10360
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Alert_default.Description, { children: error })
|
|
10183
10361
|
] }),
|
|
@@ -10225,8 +10403,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
10225
10403
|
var import_react72 = require("react");
|
|
10226
10404
|
|
|
10227
10405
|
// src/api/updateMeProfile.ts
|
|
10228
|
-
var
|
|
10229
|
-
var httpClient5 =
|
|
10406
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
10407
|
+
var httpClient5 = import_browser67.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser67.AsgardeoSPAClient.getInstance());
|
|
10230
10408
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
10231
10409
|
const defaultFetcher = async (url, config) => {
|
|
10232
10410
|
const response = await httpClient5({
|
|
@@ -10243,7 +10421,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10243
10421
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10244
10422
|
};
|
|
10245
10423
|
};
|
|
10246
|
-
return (0,
|
|
10424
|
+
return (0, import_browser67.updateMeProfile)({
|
|
10247
10425
|
...requestConfig,
|
|
10248
10426
|
fetcher: fetcher || defaultFetcher
|
|
10249
10427
|
});
|
|
@@ -10251,7 +10429,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10251
10429
|
var updateMeProfile_default = updateMeProfile;
|
|
10252
10430
|
|
|
10253
10431
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10254
|
-
var
|
|
10432
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
10255
10433
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
10256
10434
|
var UserProfile3 = ({ ...rest }) => {
|
|
10257
10435
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
@@ -10265,7 +10443,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10265
10443
|
onUpdateProfile(response);
|
|
10266
10444
|
} catch (error2) {
|
|
10267
10445
|
let message = t("user.profile.update.generic.error");
|
|
10268
|
-
if (error2 instanceof
|
|
10446
|
+
if (error2 instanceof import_browser68.AsgardeoError) {
|
|
10269
10447
|
message = error2?.message;
|
|
10270
10448
|
}
|
|
10271
10449
|
setError(message);
|
|
@@ -10286,7 +10464,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10286
10464
|
var UserProfile_default = UserProfile3;
|
|
10287
10465
|
|
|
10288
10466
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10289
|
-
var
|
|
10467
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10290
10468
|
var import_react74 = require("@floating-ui/react");
|
|
10291
10469
|
var import_css49 = require("@emotion/css");
|
|
10292
10470
|
var import_react75 = require("react");
|
|
@@ -10359,7 +10537,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10359
10537
|
border: none;
|
|
10360
10538
|
cursor: pointer;
|
|
10361
10539
|
font-size: 0.875rem;
|
|
10362
|
-
text-align:
|
|
10540
|
+
text-align: start;
|
|
10363
10541
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10364
10542
|
transition: none;
|
|
10365
10543
|
box-shadow: none;
|
|
@@ -10388,7 +10566,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10388
10566
|
background: none;
|
|
10389
10567
|
cursor: pointer;
|
|
10390
10568
|
font-size: 0.875rem;
|
|
10391
|
-
text-align:
|
|
10569
|
+
text-align: start;
|
|
10392
10570
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10393
10571
|
transition: background-color 0.15s ease-in-out;
|
|
10394
10572
|
|
|
@@ -10547,12 +10725,12 @@ var BaseUserDropdown = ({
|
|
|
10547
10725
|
}
|
|
10548
10726
|
allMenuItems.push(...defaultMenuItems);
|
|
10549
10727
|
}
|
|
10550
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0,
|
|
10728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
10551
10729
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
10552
10730
|
Button_default,
|
|
10553
10731
|
{
|
|
10554
10732
|
ref: refs.setReference,
|
|
10555
|
-
className: (0, import_css49.cx)((0,
|
|
10733
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
10556
10734
|
color: "tertiary",
|
|
10557
10735
|
variant: "text",
|
|
10558
10736
|
size: "medium",
|
|
@@ -10571,7 +10749,7 @@ var BaseUserDropdown = ({
|
|
|
10571
10749
|
Typography_default,
|
|
10572
10750
|
{
|
|
10573
10751
|
variant: "body2",
|
|
10574
|
-
className: (0, import_css49.cx)((0,
|
|
10752
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
10575
10753
|
children: getDisplayName_default(mergedMappings, user)
|
|
10576
10754
|
}
|
|
10577
10755
|
)
|
|
@@ -10582,7 +10760,7 @@ var BaseUserDropdown = ({
|
|
|
10582
10760
|
"div",
|
|
10583
10761
|
{
|
|
10584
10762
|
ref: refs.setFloating,
|
|
10585
|
-
className: (0, import_css49.cx)((0,
|
|
10763
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
10586
10764
|
style: {
|
|
10587
10765
|
...floatingStyles,
|
|
10588
10766
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -10591,7 +10769,7 @@ var BaseUserDropdown = ({
|
|
|
10591
10769
|
},
|
|
10592
10770
|
...getFloatingProps(),
|
|
10593
10771
|
children: [
|
|
10594
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0,
|
|
10772
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10595
10773
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10596
10774
|
Avatar,
|
|
10597
10775
|
{
|
|
@@ -10601,12 +10779,12 @@ var BaseUserDropdown = ({
|
|
|
10601
10779
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10602
10780
|
}
|
|
10603
10781
|
),
|
|
10604
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0,
|
|
10782
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10605
10783
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10606
10784
|
Typography_default,
|
|
10607
10785
|
{
|
|
10608
10786
|
noWrap: true,
|
|
10609
|
-
className: (0,
|
|
10787
|
+
className: (0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
10610
10788
|
variant: "body1",
|
|
10611
10789
|
fontWeight: "medium",
|
|
10612
10790
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -10616,7 +10794,7 @@ var BaseUserDropdown = ({
|
|
|
10616
10794
|
Typography_default,
|
|
10617
10795
|
{
|
|
10618
10796
|
noWrap: true,
|
|
10619
|
-
className: (0,
|
|
10797
|
+
className: (0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
10620
10798
|
variant: "caption",
|
|
10621
10799
|
color: "secondary",
|
|
10622
10800
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -10624,14 +10802,14 @@ var BaseUserDropdown = ({
|
|
|
10624
10802
|
)
|
|
10625
10803
|
] })
|
|
10626
10804
|
] }),
|
|
10627
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: (0, import_css49.cx)((0,
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
10628
10806
|
"a",
|
|
10629
10807
|
{
|
|
10630
10808
|
href: item.href,
|
|
10631
10809
|
style: {
|
|
10632
10810
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10633
10811
|
},
|
|
10634
|
-
className: (0, import_css49.cx)((0,
|
|
10812
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
10635
10813
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
10636
10814
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
10637
10815
|
onFocus: () => setHoveredItemIndex(index),
|
|
@@ -10648,7 +10826,7 @@ var BaseUserDropdown = ({
|
|
|
10648
10826
|
style: {
|
|
10649
10827
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10650
10828
|
},
|
|
10651
|
-
className: (0, import_css49.cx)((0,
|
|
10829
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
10652
10830
|
color: "tertiary",
|
|
10653
10831
|
variant: "text",
|
|
10654
10832
|
size: "small",
|
|
@@ -10861,7 +11039,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10861
11039
|
`;
|
|
10862
11040
|
const manageButton = import_css50.css`
|
|
10863
11041
|
min-width: auto;
|
|
10864
|
-
margin-
|
|
11042
|
+
margin-inline-start: auto;
|
|
10865
11043
|
`;
|
|
10866
11044
|
const menu = import_css50.css`
|
|
10867
11045
|
display: flex;
|
|
@@ -10881,7 +11059,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10881
11059
|
background-color: transparent;
|
|
10882
11060
|
cursor: pointer;
|
|
10883
11061
|
font-size: 0.875rem;
|
|
10884
|
-
text-align:
|
|
11062
|
+
text-align: start;
|
|
10885
11063
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10886
11064
|
transition: background-color 0.15s ease-in-out;
|
|
10887
11065
|
|
|
@@ -11019,11 +11197,12 @@ var BaseOrganizationSwitcher = ({
|
|
|
11019
11197
|
avatarSize = 24,
|
|
11020
11198
|
fallback = null
|
|
11021
11199
|
}) => {
|
|
11022
|
-
const { theme, colorScheme } = useTheme_default();
|
|
11200
|
+
const { theme, colorScheme, direction } = useTheme_default();
|
|
11023
11201
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
11024
11202
|
const [isOpen, setIsOpen] = (0, import_react79.useState)(false);
|
|
11025
11203
|
const [hoveredItemIndex, setHoveredItemIndex] = (0, import_react79.useState)(null);
|
|
11026
11204
|
const { t } = useTranslation_default();
|
|
11205
|
+
const isRTL = direction === "rtl";
|
|
11027
11206
|
const { refs, floatingStyles, context } = (0, import_react78.useFloating)({
|
|
11028
11207
|
open: isOpen,
|
|
11029
11208
|
onOpenChange: setIsOpen,
|
|
@@ -11105,7 +11284,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11105
11284
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11106
11285
|
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Typography_default, { variant: "body2", className: (0, import_css51.cx)(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
11107
11286
|
] }),
|
|
11108
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChevronDown_default, { width: "16", height: "16" })
|
|
11287
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChevronDown_default, { width: "16", height: "16" }) })
|
|
11109
11288
|
]
|
|
11110
11289
|
}
|
|
11111
11290
|
),
|
|
@@ -11550,8 +11729,8 @@ var BaseCreateOrganization = ({
|
|
|
11550
11729
|
};
|
|
11551
11730
|
|
|
11552
11731
|
// src/api/createOrganization.ts
|
|
11553
|
-
var
|
|
11554
|
-
var httpClient6 =
|
|
11732
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
11733
|
+
var httpClient6 = import_browser70.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser70.AsgardeoSPAClient.getInstance());
|
|
11555
11734
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11556
11735
|
const defaultFetcher = async (url, config) => {
|
|
11557
11736
|
const response = await httpClient6({
|
|
@@ -11568,7 +11747,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11568
11747
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11569
11748
|
};
|
|
11570
11749
|
};
|
|
11571
|
-
return (0,
|
|
11750
|
+
return (0, import_browser70.createOrganization)({
|
|
11572
11751
|
...requestConfig,
|
|
11573
11752
|
fetcher: fetcher || defaultFetcher
|
|
11574
11753
|
});
|
|
@@ -11643,12 +11822,12 @@ var CreateOrganization = ({
|
|
|
11643
11822
|
var import_react87 = require("react");
|
|
11644
11823
|
|
|
11645
11824
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11646
|
-
var
|
|
11825
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11647
11826
|
var import_css57 = require("@emotion/css");
|
|
11648
11827
|
var import_react86 = require("react");
|
|
11649
11828
|
|
|
11650
11829
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11651
|
-
var
|
|
11830
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
11652
11831
|
var import_css55 = require("@emotion/css");
|
|
11653
11832
|
var import_react84 = require("react");
|
|
11654
11833
|
|
|
@@ -11883,27 +12062,27 @@ var KeyValueInput = ({
|
|
|
11883
12062
|
);
|
|
11884
12063
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
11885
12064
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
11886
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
11887
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("label", { className: (0, import_css55.cx)((0,
|
|
12065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input")), styles.container, className), children: [
|
|
12066
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("label", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "label")), styles.label), children: [
|
|
11888
12067
|
label,
|
|
11889
12068
|
required && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11890
12069
|
"span",
|
|
11891
12070
|
{
|
|
11892
|
-
className: (0, import_css55.cx)((0,
|
|
12071
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
11893
12072
|
children: " *"
|
|
11894
12073
|
}
|
|
11895
12074
|
)
|
|
11896
12075
|
] }),
|
|
11897
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
11898
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css55.cx)((0,
|
|
12076
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12077
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11899
12078
|
"div",
|
|
11900
12079
|
{
|
|
11901
|
-
className: (0, import_css55.cx)((0,
|
|
12080
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
11902
12081
|
children: [
|
|
11903
12082
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11904
12083
|
"span",
|
|
11905
12084
|
{
|
|
11906
|
-
className: (0, import_css55.cx)((0,
|
|
12085
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
11907
12086
|
children: [
|
|
11908
12087
|
pair.key,
|
|
11909
12088
|
":"
|
|
@@ -11913,7 +12092,7 @@ var KeyValueInput = ({
|
|
|
11913
12092
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11914
12093
|
"span",
|
|
11915
12094
|
{
|
|
11916
|
-
className: (0, import_css55.cx)((0,
|
|
12095
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
11917
12096
|
children: pair.value
|
|
11918
12097
|
}
|
|
11919
12098
|
)
|
|
@@ -11923,7 +12102,7 @@ var KeyValueInput = ({
|
|
|
11923
12102
|
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11924
12103
|
"div",
|
|
11925
12104
|
{
|
|
11926
|
-
className: (0, import_css55.cx)((0,
|
|
12105
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
11927
12106
|
children: [
|
|
11928
12107
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11929
12108
|
TextField_default,
|
|
@@ -11932,7 +12111,7 @@ var KeyValueInput = ({
|
|
|
11932
12111
|
value: pair.key,
|
|
11933
12112
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
11934
12113
|
disabled: disabled || readOnly,
|
|
11935
|
-
className: (0, import_css55.cx)((0,
|
|
12114
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11936
12115
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
11937
12116
|
}
|
|
11938
12117
|
),
|
|
@@ -11943,7 +12122,7 @@ var KeyValueInput = ({
|
|
|
11943
12122
|
value: pair.value,
|
|
11944
12123
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
11945
12124
|
disabled: disabled || readOnly,
|
|
11946
|
-
className: (0, import_css55.cx)((0,
|
|
12125
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11947
12126
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
11948
12127
|
}
|
|
11949
12128
|
),
|
|
@@ -11953,7 +12132,7 @@ var KeyValueInput = ({
|
|
|
11953
12132
|
type: "button",
|
|
11954
12133
|
onClick: () => handleRemovePair(index),
|
|
11955
12134
|
disabled,
|
|
11956
|
-
className: (0, import_css55.cx)((0,
|
|
12135
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
11957
12136
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
11958
12137
|
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(X_default, { width: 16, height: 16 })
|
|
11959
12138
|
}
|
|
@@ -11962,7 +12141,7 @@ var KeyValueInput = ({
|
|
|
11962
12141
|
},
|
|
11963
12142
|
`${pair.key}-${index}`
|
|
11964
12143
|
)),
|
|
11965
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
12144
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
11966
12145
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11967
12146
|
TextField_default,
|
|
11968
12147
|
{
|
|
@@ -11970,7 +12149,7 @@ var KeyValueInput = ({
|
|
|
11970
12149
|
value: newKey,
|
|
11971
12150
|
onChange: (e) => setNewKey(e.target.value),
|
|
11972
12151
|
disabled,
|
|
11973
|
-
className: (0, import_css55.cx)((0,
|
|
12152
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11974
12153
|
"aria-label": "New key"
|
|
11975
12154
|
}
|
|
11976
12155
|
),
|
|
@@ -11981,7 +12160,7 @@ var KeyValueInput = ({
|
|
|
11981
12160
|
value: newValue,
|
|
11982
12161
|
onChange: (e) => setNewValue(e.target.value),
|
|
11983
12162
|
disabled,
|
|
11984
|
-
className: (0, import_css55.cx)((0,
|
|
12163
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11985
12164
|
"aria-label": "New value",
|
|
11986
12165
|
onKeyPress: (e) => {
|
|
11987
12166
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -11996,15 +12175,15 @@ var KeyValueInput = ({
|
|
|
11996
12175
|
type: "button",
|
|
11997
12176
|
onClick: handleAddPair,
|
|
11998
12177
|
disabled: isAddDisabled,
|
|
11999
|
-
className: (0, import_css55.cx)((0,
|
|
12178
|
+
className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "add-button")), styles.addButton),
|
|
12000
12179
|
"aria-label": "Add new key-value pair",
|
|
12001
12180
|
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Plus_default, { width: 16, height: 16 })
|
|
12002
12181
|
}
|
|
12003
12182
|
)
|
|
12004
12183
|
] })
|
|
12005
12184
|
] }),
|
|
12006
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css55.cx)((0,
|
|
12007
|
-
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
12185
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12186
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser71.withVendorCSSClassPrefix)((0, import_browser71.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
12008
12187
|
pairs.length,
|
|
12009
12188
|
" of ",
|
|
12010
12189
|
maxPairs,
|
|
@@ -12208,13 +12387,13 @@ var BaseOrganizationProfile = ({
|
|
|
12208
12387
|
key: "created",
|
|
12209
12388
|
label: "Created Date",
|
|
12210
12389
|
editable: false,
|
|
12211
|
-
render: (value) => (0,
|
|
12390
|
+
render: (value) => (0, import_browser72.formatDate)(value)
|
|
12212
12391
|
},
|
|
12213
12392
|
{
|
|
12214
12393
|
key: "lastModified",
|
|
12215
12394
|
label: "Last Modified Date",
|
|
12216
12395
|
editable: false,
|
|
12217
|
-
render: (value) => (0,
|
|
12396
|
+
render: (value) => (0, import_browser72.formatDate)(value)
|
|
12218
12397
|
}
|
|
12219
12398
|
]
|
|
12220
12399
|
}) => {
|
|
@@ -12451,8 +12630,8 @@ var BaseOrganizationProfile = ({
|
|
|
12451
12630
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
12452
12631
|
|
|
12453
12632
|
// src/api/getOrganization.ts
|
|
12454
|
-
var
|
|
12455
|
-
var httpClient7 =
|
|
12633
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
12634
|
+
var httpClient7 = import_browser73.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser73.AsgardeoSPAClient.getInstance());
|
|
12456
12635
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
12457
12636
|
const defaultFetcher = async (url, config) => {
|
|
12458
12637
|
const response = await httpClient7({
|
|
@@ -12468,7 +12647,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12468
12647
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12469
12648
|
};
|
|
12470
12649
|
};
|
|
12471
|
-
return (0,
|
|
12650
|
+
return (0, import_browser73.getOrganization)({
|
|
12472
12651
|
...requestConfig,
|
|
12473
12652
|
fetcher: fetcher || defaultFetcher
|
|
12474
12653
|
});
|
|
@@ -12476,8 +12655,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12476
12655
|
var getOrganization_default = getOrganization;
|
|
12477
12656
|
|
|
12478
12657
|
// src/api/updateOrganization.ts
|
|
12479
|
-
var
|
|
12480
|
-
var httpClient8 =
|
|
12658
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
12659
|
+
var httpClient8 = import_browser74.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser74.AsgardeoSPAClient.getInstance());
|
|
12481
12660
|
var updateOrganization = async ({
|
|
12482
12661
|
fetcher,
|
|
12483
12662
|
...requestConfig
|
|
@@ -12497,7 +12676,7 @@ var updateOrganization = async ({
|
|
|
12497
12676
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12498
12677
|
};
|
|
12499
12678
|
};
|
|
12500
|
-
return (0,
|
|
12679
|
+
return (0, import_browser74.updateOrganization)({
|
|
12501
12680
|
...requestConfig,
|
|
12502
12681
|
fetcher: fetcher || defaultFetcher
|
|
12503
12682
|
});
|
|
@@ -12550,7 +12729,7 @@ var OrganizationProfile = ({
|
|
|
12550
12729
|
const handleOrganizationUpdate = async (payload) => {
|
|
12551
12730
|
if (!baseUrl || !organizationId) return;
|
|
12552
12731
|
try {
|
|
12553
|
-
const operations = (0,
|
|
12732
|
+
const operations = (0, import_browser74.createPatchOperations)(payload);
|
|
12554
12733
|
await updateOrganization_default({
|
|
12555
12734
|
baseUrl,
|
|
12556
12735
|
organizationId,
|
|
@@ -12987,10 +13166,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
12987
13166
|
|
|
12988
13167
|
&__loading-overlay {
|
|
12989
13168
|
position: absolute;
|
|
12990
|
-
|
|
12991
|
-
left: 0;
|
|
12992
|
-
right: 0;
|
|
12993
|
-
bottom: 0;
|
|
13169
|
+
inset: 0;
|
|
12994
13170
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
12995
13171
|
display: flex;
|
|
12996
13172
|
align-items: center;
|
|
@@ -13015,10 +13191,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13015
13191
|
`,
|
|
13016
13192
|
loadingOverlay: import_css60.css`
|
|
13017
13193
|
position: absolute;
|
|
13018
|
-
|
|
13019
|
-
left: 0;
|
|
13020
|
-
right: 0;
|
|
13021
|
-
bottom: 0;
|
|
13194
|
+
inset: 0;
|
|
13022
13195
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13023
13196
|
display: flex;
|
|
13024
13197
|
align-items: center;
|
|
@@ -13206,5 +13379,5 @@ var OrganizationSwitcher = ({
|
|
|
13206
13379
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
13207
13380
|
|
|
13208
13381
|
// src/index.ts
|
|
13209
|
-
var
|
|
13382
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
13210
13383
|
//# sourceMappingURL=index.js.map
|