@asgardeo/react 0.5.33 → 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 +319 -156
- 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 +210 -45
- 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;
|
|
@@ -7716,7 +7735,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7716
7735
|
var SignIn_default2 = SignIn2;
|
|
7717
7736
|
|
|
7718
7737
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7719
|
-
var
|
|
7738
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
7720
7739
|
var import_css39 = require("@emotion/css");
|
|
7721
7740
|
var import_react62 = require("react");
|
|
7722
7741
|
|
|
@@ -8228,6 +8247,110 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8228
8247
|
)
|
|
8229
8248
|
).filter(Boolean);
|
|
8230
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
|
+
|
|
8231
8354
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8232
8355
|
var import_css38 = require("@emotion/css");
|
|
8233
8356
|
var import_react61 = require("react");
|
|
@@ -8393,7 +8516,8 @@ var BaseSignUpContent = ({
|
|
|
8393
8516
|
messageClassName = "",
|
|
8394
8517
|
size = "medium",
|
|
8395
8518
|
variant = "outlined",
|
|
8396
|
-
isInitialized
|
|
8519
|
+
isInitialized,
|
|
8520
|
+
children
|
|
8397
8521
|
}) => {
|
|
8398
8522
|
const { theme, colorScheme } = useTheme_default();
|
|
8399
8523
|
const { t } = useTranslation_default();
|
|
@@ -8405,12 +8529,31 @@ var BaseSignUpContent = ({
|
|
|
8405
8529
|
const [error, setError] = (0, import_react62.useState)(null);
|
|
8406
8530
|
const [formData, setFormData] = (0, import_react62.useState)({});
|
|
8407
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
|
+
);
|
|
8408
8551
|
const extractFormFields = (0, import_react62.useCallback)(
|
|
8409
8552
|
(components) => {
|
|
8410
8553
|
const fields = [];
|
|
8411
8554
|
const processComponents = (comps) => {
|
|
8412
8555
|
comps.forEach((component) => {
|
|
8413
|
-
if (component.type ===
|
|
8556
|
+
if (component.type === import_browser59.EmbeddedFlowComponentType.Input) {
|
|
8414
8557
|
const config = component.config || {};
|
|
8415
8558
|
fields.push({
|
|
8416
8559
|
name: config.name || component.id,
|
|
@@ -8500,13 +8643,14 @@ var BaseSignUpContent = ({
|
|
|
8500
8643
|
inputs: filteredInputs,
|
|
8501
8644
|
actionId: component.id
|
|
8502
8645
|
};
|
|
8503
|
-
const
|
|
8646
|
+
const rawResponse = await onSubmit(payload);
|
|
8647
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8504
8648
|
onFlowChange?.(response);
|
|
8505
|
-
if (response.flowStatus ===
|
|
8649
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8506
8650
|
onComplete?.(response);
|
|
8507
8651
|
return;
|
|
8508
8652
|
}
|
|
8509
|
-
if (response.flowStatus ===
|
|
8653
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8510
8654
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8511
8655
|
return;
|
|
8512
8656
|
}
|
|
@@ -8514,7 +8658,7 @@ var BaseSignUpContent = ({
|
|
|
8514
8658
|
setupFormFields(response);
|
|
8515
8659
|
}
|
|
8516
8660
|
} catch (err) {
|
|
8517
|
-
const errorMessage = err instanceof
|
|
8661
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8518
8662
|
setError(errorMessage);
|
|
8519
8663
|
onError?.(err);
|
|
8520
8664
|
} finally {
|
|
@@ -8522,7 +8666,7 @@ var BaseSignUpContent = ({
|
|
|
8522
8666
|
}
|
|
8523
8667
|
};
|
|
8524
8668
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8525
|
-
if (response?.type ===
|
|
8669
|
+
if (response?.type === import_browser59.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8526
8670
|
const redirectUrl = response.data.redirectURL;
|
|
8527
8671
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8528
8672
|
if (!popup) {
|
|
@@ -8551,16 +8695,16 @@ var BaseSignUpContent = ({
|
|
|
8551
8695
|
try {
|
|
8552
8696
|
const continueResponse = await onSubmit(payload);
|
|
8553
8697
|
onFlowChange?.(continueResponse);
|
|
8554
|
-
if (continueResponse.flowStatus ===
|
|
8698
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8555
8699
|
onComplete?.(continueResponse);
|
|
8556
|
-
} else if (continueResponse.flowStatus ===
|
|
8700
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8557
8701
|
setCurrentFlow(continueResponse);
|
|
8558
8702
|
setupFormFields(continueResponse);
|
|
8559
8703
|
}
|
|
8560
8704
|
popup.close();
|
|
8561
8705
|
cleanup();
|
|
8562
8706
|
} catch (err) {
|
|
8563
|
-
const errorMessage = err instanceof
|
|
8707
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8564
8708
|
setError(errorMessage);
|
|
8565
8709
|
onError?.(err);
|
|
8566
8710
|
popup.close();
|
|
@@ -8612,15 +8756,15 @@ var BaseSignUpContent = ({
|
|
|
8612
8756
|
try {
|
|
8613
8757
|
const continueResponse = await onSubmit(payload);
|
|
8614
8758
|
onFlowChange?.(continueResponse);
|
|
8615
|
-
if (continueResponse.flowStatus ===
|
|
8759
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8616
8760
|
onComplete?.(continueResponse);
|
|
8617
|
-
} else if (continueResponse.flowStatus ===
|
|
8761
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8618
8762
|
setCurrentFlow(continueResponse);
|
|
8619
8763
|
setupFormFields(continueResponse);
|
|
8620
8764
|
}
|
|
8621
8765
|
popup.close();
|
|
8622
8766
|
} catch (err) {
|
|
8623
|
-
const errorMessage = err instanceof
|
|
8767
|
+
const errorMessage = err instanceof import_browser59.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
8624
8768
|
setError(errorMessage);
|
|
8625
8769
|
onError?.(err);
|
|
8626
8770
|
popup.close();
|
|
@@ -8639,30 +8783,30 @@ var BaseSignUpContent = ({
|
|
|
8639
8783
|
};
|
|
8640
8784
|
const containerClasses = (0, import_css39.cx)(
|
|
8641
8785
|
[
|
|
8642
|
-
(0,
|
|
8643
|
-
(0,
|
|
8644
|
-
(0,
|
|
8786
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup"),
|
|
8787
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
8788
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
8645
8789
|
],
|
|
8646
8790
|
className
|
|
8647
8791
|
);
|
|
8648
8792
|
const inputClasses = (0, import_css39.cx)(
|
|
8649
8793
|
[
|
|
8650
|
-
(0,
|
|
8651
|
-
size === "small" && (0,
|
|
8652
|
-
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")
|
|
8653
8797
|
],
|
|
8654
8798
|
inputClassName
|
|
8655
8799
|
);
|
|
8656
8800
|
const buttonClasses = (0, import_css39.cx)(
|
|
8657
8801
|
[
|
|
8658
|
-
(0,
|
|
8659
|
-
size === "small" && (0,
|
|
8660
|
-
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")
|
|
8661
8805
|
],
|
|
8662
8806
|
buttonClassName
|
|
8663
8807
|
);
|
|
8664
|
-
const errorClasses = (0, import_css39.cx)([(0,
|
|
8665
|
-
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);
|
|
8666
8810
|
const renderComponents = (0, import_react62.useCallback)(
|
|
8667
8811
|
(components) => renderSignUpComponents(
|
|
8668
8812
|
components,
|
|
@@ -8702,15 +8846,16 @@ var BaseSignUpContent = ({
|
|
|
8702
8846
|
setIsLoading(true);
|
|
8703
8847
|
setError(null);
|
|
8704
8848
|
try {
|
|
8705
|
-
const
|
|
8849
|
+
const rawResponse = await onInitialize();
|
|
8850
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8706
8851
|
setCurrentFlow(response);
|
|
8707
8852
|
setIsFlowInitialized(true);
|
|
8708
8853
|
onFlowChange?.(response);
|
|
8709
|
-
if (response.flowStatus ===
|
|
8854
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8710
8855
|
onComplete?.(response);
|
|
8711
8856
|
return;
|
|
8712
8857
|
}
|
|
8713
|
-
if (response.flowStatus ===
|
|
8858
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8714
8859
|
setupFormFields(response);
|
|
8715
8860
|
}
|
|
8716
8861
|
} catch (err) {
|
|
@@ -8730,9 +8875,28 @@ var BaseSignUpContent = ({
|
|
|
8730
8875
|
onError,
|
|
8731
8876
|
onFlowChange,
|
|
8732
8877
|
setupFormFields,
|
|
8878
|
+
normalizeFlowResponse2,
|
|
8733
8879
|
afterSignUpUrl,
|
|
8734
8880
|
t
|
|
8735
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
|
+
}
|
|
8736
8900
|
if (!isFlowInitialized && isLoading) {
|
|
8737
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" }) }) }) });
|
|
8738
8902
|
}
|
|
@@ -8764,7 +8928,7 @@ var BaseSignUpContent = ({
|
|
|
8764
8928
|
var BaseSignUp_default = BaseSignUp;
|
|
8765
8929
|
|
|
8766
8930
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8767
|
-
var
|
|
8931
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
8768
8932
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
8769
8933
|
var SignUp = ({
|
|
8770
8934
|
className,
|
|
@@ -8773,21 +8937,24 @@ var SignUp = ({
|
|
|
8773
8937
|
onError,
|
|
8774
8938
|
onComplete,
|
|
8775
8939
|
shouldRedirectAfterSignUp = true,
|
|
8940
|
+
children,
|
|
8776
8941
|
...rest
|
|
8777
8942
|
}) => {
|
|
8778
|
-
const { signUp, isInitialized } = useAsgardeo_default();
|
|
8779
|
-
const handleInitialize = async (payload) =>
|
|
8780
|
-
payload || {
|
|
8781
|
-
flowType:
|
|
8782
|
-
|
|
8783
|
-
|
|
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
|
+
};
|
|
8784
8951
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8785
8952
|
const handleComplete = (response) => {
|
|
8786
8953
|
onComplete?.(response);
|
|
8787
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
8954
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser60.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
8788
8955
|
window.location.href = afterSignUpUrl;
|
|
8789
8956
|
}
|
|
8790
|
-
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
|
|
8791
8958
|
!response.data.redirectURL.includes("auth")) {
|
|
8792
8959
|
window.location.href = response.data.redirectURL;
|
|
8793
8960
|
}
|
|
@@ -8803,6 +8970,7 @@ var SignUp = ({
|
|
|
8803
8970
|
className,
|
|
8804
8971
|
size,
|
|
8805
8972
|
isInitialized,
|
|
8973
|
+
children,
|
|
8806
8974
|
...rest
|
|
8807
8975
|
}
|
|
8808
8976
|
);
|
|
@@ -8850,35 +9018,35 @@ Organization5.displayName = "Organization";
|
|
|
8850
9018
|
var Organization_default = Organization5;
|
|
8851
9019
|
|
|
8852
9020
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8853
|
-
var
|
|
9021
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
8854
9022
|
var import_css47 = require("@emotion/css");
|
|
8855
9023
|
var import_react71 = require("react");
|
|
8856
9024
|
|
|
8857
9025
|
// src/utils/getMappedUserProfileValue.ts
|
|
8858
|
-
var
|
|
9026
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
8859
9027
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8860
9028
|
if (!key || !mappings || !user) {
|
|
8861
9029
|
return void 0;
|
|
8862
9030
|
}
|
|
8863
9031
|
const mapping = mappings[key];
|
|
8864
9032
|
if (!mapping) {
|
|
8865
|
-
return (0,
|
|
9033
|
+
return (0, import_browser61.get)(user, key);
|
|
8866
9034
|
}
|
|
8867
9035
|
if (Array.isArray(mapping)) {
|
|
8868
9036
|
for (const path of mapping) {
|
|
8869
|
-
const value = (0,
|
|
9037
|
+
const value = (0, import_browser61.get)(user, path);
|
|
8870
9038
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8871
9039
|
return value;
|
|
8872
9040
|
}
|
|
8873
9041
|
}
|
|
8874
9042
|
return void 0;
|
|
8875
9043
|
}
|
|
8876
|
-
return (0,
|
|
9044
|
+
return (0, import_browser61.get)(user, mapping);
|
|
8877
9045
|
};
|
|
8878
9046
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8879
9047
|
|
|
8880
9048
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8881
|
-
var
|
|
9049
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
8882
9050
|
var import_css41 = require("@emotion/css");
|
|
8883
9051
|
var import_react64 = require("react");
|
|
8884
9052
|
|
|
@@ -8997,20 +9165,20 @@ var Avatar = ({
|
|
|
8997
9165
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
8998
9166
|
const renderContent = () => {
|
|
8999
9167
|
if (imageUrl) {
|
|
9000
|
-
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) });
|
|
9001
9169
|
}
|
|
9002
9170
|
if (name) {
|
|
9003
9171
|
return getInitials(name);
|
|
9004
9172
|
}
|
|
9005
9173
|
if (isLoading) {
|
|
9006
|
-
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) });
|
|
9007
9175
|
}
|
|
9008
9176
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
9009
9177
|
"svg",
|
|
9010
9178
|
{
|
|
9011
9179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9012
9180
|
viewBox: "0 0 640 640",
|
|
9013
|
-
className: (0, import_css41.cx)((0,
|
|
9181
|
+
className: (0, import_css41.cx)((0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar", "icon")), styles.icon),
|
|
9014
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" })
|
|
9015
9183
|
}
|
|
9016
9184
|
);
|
|
@@ -9019,11 +9187,11 @@ var Avatar = ({
|
|
|
9019
9187
|
"div",
|
|
9020
9188
|
{
|
|
9021
9189
|
className: (0, import_css41.cx)(
|
|
9022
|
-
(0,
|
|
9190
|
+
(0, import_browser62.withVendorCSSClassPrefix)((0, import_browser62.bem)("avatar")),
|
|
9023
9191
|
styles.avatar,
|
|
9024
9192
|
styles.variant,
|
|
9025
|
-
(0,
|
|
9026
|
-
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")),
|
|
9027
9195
|
className
|
|
9028
9196
|
),
|
|
9029
9197
|
children: renderContent()
|
|
@@ -9033,7 +9201,7 @@ var Avatar = ({
|
|
|
9033
9201
|
var Avatar_default = Avatar;
|
|
9034
9202
|
|
|
9035
9203
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9036
|
-
var
|
|
9204
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
9037
9205
|
var import_react66 = require("@floating-ui/react");
|
|
9038
9206
|
var import_css43 = require("@emotion/css");
|
|
9039
9207
|
var import_react67 = __toESM(require("react"), 1);
|
|
@@ -9270,11 +9438,11 @@ var DialogContent = import_react67.default.forwardRef((props, propRef) => {
|
|
|
9270
9438
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9271
9439
|
const ref = (0, import_react66.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
9272
9440
|
if (!floatingContext.open) return null;
|
|
9273
|
-
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)(
|
|
9274
9442
|
"div",
|
|
9275
9443
|
{
|
|
9276
9444
|
ref,
|
|
9277
|
-
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),
|
|
9278
9446
|
"aria-labelledby": context.labelId,
|
|
9279
9447
|
"aria-describedby": context.descriptionId,
|
|
9280
9448
|
...context.getFloatingProps(props),
|
|
@@ -9292,14 +9460,14 @@ var DialogHeading = import_react67.default.forwardRef(
|
|
|
9292
9460
|
context.setLabelId(id);
|
|
9293
9461
|
return () => context.setLabelId(void 0);
|
|
9294
9462
|
}, [id, context.setLabelId]);
|
|
9295
|
-
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: [
|
|
9296
9464
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9297
9465
|
"h2",
|
|
9298
9466
|
{
|
|
9299
9467
|
...props,
|
|
9300
9468
|
ref,
|
|
9301
9469
|
id,
|
|
9302
|
-
className: (0, import_css43.cx)((0,
|
|
9470
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "title")), styles.headerTitle),
|
|
9303
9471
|
children
|
|
9304
9472
|
}
|
|
9305
9473
|
),
|
|
@@ -9334,7 +9502,7 @@ var DialogDescription = import_react67.default.forwardRef(
|
|
|
9334
9502
|
...props,
|
|
9335
9503
|
ref,
|
|
9336
9504
|
id,
|
|
9337
|
-
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),
|
|
9338
9506
|
children
|
|
9339
9507
|
}
|
|
9340
9508
|
);
|
|
@@ -9364,7 +9532,7 @@ var DialogClose = import_react67.default.forwardRef(({ children, asChild = false
|
|
|
9364
9532
|
...props,
|
|
9365
9533
|
ref,
|
|
9366
9534
|
onClick: handleClick,
|
|
9367
|
-
className: (0, import_css43.cx)((0,
|
|
9535
|
+
className: (0, import_css43.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("dialog", "close")), props.className),
|
|
9368
9536
|
variant: "text",
|
|
9369
9537
|
children
|
|
9370
9538
|
}
|
|
@@ -9385,7 +9553,7 @@ var Dialog_default = Dialog;
|
|
|
9385
9553
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9386
9554
|
var import_react69 = require("react");
|
|
9387
9555
|
var import_css45 = require("@emotion/css");
|
|
9388
|
-
var
|
|
9556
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
9389
9557
|
|
|
9390
9558
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
9391
9559
|
var import_css44 = require("@emotion/css");
|
|
@@ -9577,26 +9745,26 @@ var MultiInput = ({
|
|
|
9577
9745
|
{
|
|
9578
9746
|
error,
|
|
9579
9747
|
helperText,
|
|
9580
|
-
className: (0, import_css45.cx)((0,
|
|
9748
|
+
className: (0, import_css45.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("multi-input")), className),
|
|
9581
9749
|
style,
|
|
9582
9750
|
children: [
|
|
9583
9751
|
label && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
9584
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css45.cx)((0,
|
|
9585
|
-
/* @__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(
|
|
9586
9754
|
currentInputValue,
|
|
9587
9755
|
setCurrentInputValue,
|
|
9588
9756
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9589
9757
|
canAddMore ? handleInputSubmit : void 0
|
|
9590
9758
|
) }) }),
|
|
9591
|
-
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)(
|
|
9592
9760
|
"div",
|
|
9593
9761
|
{
|
|
9594
|
-
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),
|
|
9595
9763
|
children: [
|
|
9596
9764
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9597
9765
|
"span",
|
|
9598
9766
|
{
|
|
9599
|
-
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),
|
|
9600
9768
|
children: value
|
|
9601
9769
|
}
|
|
9602
9770
|
),
|
|
@@ -9606,7 +9774,7 @@ var MultiInput = ({
|
|
|
9606
9774
|
type: "button",
|
|
9607
9775
|
onClick: () => handleRemoveValue(index),
|
|
9608
9776
|
disabled,
|
|
9609
|
-
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),
|
|
9610
9778
|
title: "Remove value",
|
|
9611
9779
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(BinIcon, { className: styles.icon })
|
|
9612
9780
|
}
|
|
@@ -9625,7 +9793,7 @@ var MultiInput_default = MultiInput;
|
|
|
9625
9793
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
9626
9794
|
var import_css46 = require("@emotion/css");
|
|
9627
9795
|
var import_react70 = require("react");
|
|
9628
|
-
var
|
|
9796
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9629
9797
|
var useStyles22 = (theme, colorScheme) => {
|
|
9630
9798
|
const valuePlaceholder = import_css46.css`
|
|
9631
9799
|
font-style: italic;
|
|
@@ -9652,7 +9820,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9652
9820
|
display: flex;
|
|
9653
9821
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
9654
9822
|
align-items: center;
|
|
9655
|
-
margin-
|
|
9823
|
+
margin-inline-start: calc(${theme.vars.spacing.unit} * 4);
|
|
9656
9824
|
`;
|
|
9657
9825
|
const complexTextarea = import_css46.css`
|
|
9658
9826
|
min-height: 60px;
|
|
@@ -9719,7 +9887,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9719
9887
|
width: 120px;
|
|
9720
9888
|
flex-shrink: 0;
|
|
9721
9889
|
line-height: 28px;
|
|
9722
|
-
text-align:
|
|
9890
|
+
text-align: start;
|
|
9723
9891
|
`;
|
|
9724
9892
|
const value = import_css46.css`
|
|
9725
9893
|
color: ${theme.vars.colors.text.primary};
|
|
@@ -9734,9 +9902,9 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9734
9902
|
text-overflow: ellipsis;
|
|
9735
9903
|
white-space: nowrap;
|
|
9736
9904
|
max-width: 350px;
|
|
9737
|
-
text-align:
|
|
9905
|
+
text-align: start;
|
|
9738
9906
|
|
|
9739
|
-
.${(0,
|
|
9907
|
+
.${(0, import_browser65.withVendorCSSClassPrefix)("form-control")} {
|
|
9740
9908
|
margin-bottom: 0;
|
|
9741
9909
|
}
|
|
9742
9910
|
|
|
@@ -9935,7 +10103,7 @@ var BaseUserProfile = ({
|
|
|
9935
10103
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
9936
10104
|
}
|
|
9937
10105
|
let payload = {};
|
|
9938
|
-
if (schema.schemaId && schema.schemaId !==
|
|
10106
|
+
if (schema.schemaId && schema.schemaId !== import_browser66.WellKnownSchemaIds.User) {
|
|
9939
10107
|
payload = {
|
|
9940
10108
|
[schema.schemaId]: {
|
|
9941
10109
|
[fieldName]: fieldValue
|
|
@@ -10169,7 +10337,7 @@ var BaseUserProfile = ({
|
|
|
10169
10337
|
const containerClasses = (0, import_css47.cx)(
|
|
10170
10338
|
styles.root,
|
|
10171
10339
|
cardLayout ? styles.card : "",
|
|
10172
|
-
(0,
|
|
10340
|
+
(0, import_browser66.withVendorCSSClassPrefix)("user-profile"),
|
|
10173
10341
|
className
|
|
10174
10342
|
);
|
|
10175
10343
|
const currentUser = flattenedProfile || profile;
|
|
@@ -10187,7 +10355,7 @@ var BaseUserProfile = ({
|
|
|
10187
10355
|
] }, key)) });
|
|
10188
10356
|
};
|
|
10189
10357
|
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Card_default, { className: containerClasses, children: [
|
|
10190
|
-
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: [
|
|
10191
10359
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10192
10360
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Alert_default.Description, { children: error })
|
|
10193
10361
|
] }),
|
|
@@ -10235,8 +10403,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
10235
10403
|
var import_react72 = require("react");
|
|
10236
10404
|
|
|
10237
10405
|
// src/api/updateMeProfile.ts
|
|
10238
|
-
var
|
|
10239
|
-
var httpClient5 =
|
|
10406
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
10407
|
+
var httpClient5 = import_browser67.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser67.AsgardeoSPAClient.getInstance());
|
|
10240
10408
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
10241
10409
|
const defaultFetcher = async (url, config) => {
|
|
10242
10410
|
const response = await httpClient5({
|
|
@@ -10253,7 +10421,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10253
10421
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10254
10422
|
};
|
|
10255
10423
|
};
|
|
10256
|
-
return (0,
|
|
10424
|
+
return (0, import_browser67.updateMeProfile)({
|
|
10257
10425
|
...requestConfig,
|
|
10258
10426
|
fetcher: fetcher || defaultFetcher
|
|
10259
10427
|
});
|
|
@@ -10261,7 +10429,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10261
10429
|
var updateMeProfile_default = updateMeProfile;
|
|
10262
10430
|
|
|
10263
10431
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10264
|
-
var
|
|
10432
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
10265
10433
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
10266
10434
|
var UserProfile3 = ({ ...rest }) => {
|
|
10267
10435
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
@@ -10275,7 +10443,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10275
10443
|
onUpdateProfile(response);
|
|
10276
10444
|
} catch (error2) {
|
|
10277
10445
|
let message = t("user.profile.update.generic.error");
|
|
10278
|
-
if (error2 instanceof
|
|
10446
|
+
if (error2 instanceof import_browser68.AsgardeoError) {
|
|
10279
10447
|
message = error2?.message;
|
|
10280
10448
|
}
|
|
10281
10449
|
setError(message);
|
|
@@ -10296,7 +10464,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10296
10464
|
var UserProfile_default = UserProfile3;
|
|
10297
10465
|
|
|
10298
10466
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10299
|
-
var
|
|
10467
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10300
10468
|
var import_react74 = require("@floating-ui/react");
|
|
10301
10469
|
var import_css49 = require("@emotion/css");
|
|
10302
10470
|
var import_react75 = require("react");
|
|
@@ -10369,7 +10537,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10369
10537
|
border: none;
|
|
10370
10538
|
cursor: pointer;
|
|
10371
10539
|
font-size: 0.875rem;
|
|
10372
|
-
text-align:
|
|
10540
|
+
text-align: start;
|
|
10373
10541
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10374
10542
|
transition: none;
|
|
10375
10543
|
box-shadow: none;
|
|
@@ -10398,7 +10566,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10398
10566
|
background: none;
|
|
10399
10567
|
cursor: pointer;
|
|
10400
10568
|
font-size: 0.875rem;
|
|
10401
|
-
text-align:
|
|
10569
|
+
text-align: start;
|
|
10402
10570
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10403
10571
|
transition: background-color 0.15s ease-in-out;
|
|
10404
10572
|
|
|
@@ -10557,12 +10725,12 @@ var BaseUserDropdown = ({
|
|
|
10557
10725
|
}
|
|
10558
10726
|
allMenuItems.push(...defaultMenuItems);
|
|
10559
10727
|
}
|
|
10560
|
-
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: [
|
|
10561
10729
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
10562
10730
|
Button_default,
|
|
10563
10731
|
{
|
|
10564
10732
|
ref: refs.setReference,
|
|
10565
|
-
className: (0, import_css49.cx)((0,
|
|
10733
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
10566
10734
|
color: "tertiary",
|
|
10567
10735
|
variant: "text",
|
|
10568
10736
|
size: "medium",
|
|
@@ -10581,7 +10749,7 @@ var BaseUserDropdown = ({
|
|
|
10581
10749
|
Typography_default,
|
|
10582
10750
|
{
|
|
10583
10751
|
variant: "body2",
|
|
10584
|
-
className: (0, import_css49.cx)((0,
|
|
10752
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
10585
10753
|
children: getDisplayName_default(mergedMappings, user)
|
|
10586
10754
|
}
|
|
10587
10755
|
)
|
|
@@ -10592,7 +10760,7 @@ var BaseUserDropdown = ({
|
|
|
10592
10760
|
"div",
|
|
10593
10761
|
{
|
|
10594
10762
|
ref: refs.setFloating,
|
|
10595
|
-
className: (0, import_css49.cx)((0,
|
|
10763
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
10596
10764
|
style: {
|
|
10597
10765
|
...floatingStyles,
|
|
10598
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.
|
|
@@ -10601,7 +10769,7 @@ var BaseUserDropdown = ({
|
|
|
10601
10769
|
},
|
|
10602
10770
|
...getFloatingProps(),
|
|
10603
10771
|
children: [
|
|
10604
|
-
/* @__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: [
|
|
10605
10773
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10606
10774
|
Avatar,
|
|
10607
10775
|
{
|
|
@@ -10611,12 +10779,12 @@ var BaseUserDropdown = ({
|
|
|
10611
10779
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10612
10780
|
}
|
|
10613
10781
|
),
|
|
10614
|
-
/* @__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: [
|
|
10615
10783
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10616
10784
|
Typography_default,
|
|
10617
10785
|
{
|
|
10618
10786
|
noWrap: true,
|
|
10619
|
-
className: (0,
|
|
10787
|
+
className: (0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
10620
10788
|
variant: "body1",
|
|
10621
10789
|
fontWeight: "medium",
|
|
10622
10790
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -10626,7 +10794,7 @@ var BaseUserDropdown = ({
|
|
|
10626
10794
|
Typography_default,
|
|
10627
10795
|
{
|
|
10628
10796
|
noWrap: true,
|
|
10629
|
-
className: (0,
|
|
10797
|
+
className: (0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
10630
10798
|
variant: "caption",
|
|
10631
10799
|
color: "secondary",
|
|
10632
10800
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -10634,14 +10802,14 @@ var BaseUserDropdown = ({
|
|
|
10634
10802
|
)
|
|
10635
10803
|
] })
|
|
10636
10804
|
] }),
|
|
10637
|
-
/* @__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)(
|
|
10638
10806
|
"a",
|
|
10639
10807
|
{
|
|
10640
10808
|
href: item.href,
|
|
10641
10809
|
style: {
|
|
10642
10810
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10643
10811
|
},
|
|
10644
|
-
className: (0, import_css49.cx)((0,
|
|
10812
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
10645
10813
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
10646
10814
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
10647
10815
|
onFocus: () => setHoveredItemIndex(index),
|
|
@@ -10658,7 +10826,7 @@ var BaseUserDropdown = ({
|
|
|
10658
10826
|
style: {
|
|
10659
10827
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10660
10828
|
},
|
|
10661
|
-
className: (0, import_css49.cx)((0,
|
|
10829
|
+
className: (0, import_css49.cx)((0, import_browser69.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
10662
10830
|
color: "tertiary",
|
|
10663
10831
|
variant: "text",
|
|
10664
10832
|
size: "small",
|
|
@@ -10871,7 +11039,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10871
11039
|
`;
|
|
10872
11040
|
const manageButton = import_css50.css`
|
|
10873
11041
|
min-width: auto;
|
|
10874
|
-
margin-
|
|
11042
|
+
margin-inline-start: auto;
|
|
10875
11043
|
`;
|
|
10876
11044
|
const menu = import_css50.css`
|
|
10877
11045
|
display: flex;
|
|
@@ -10891,7 +11059,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10891
11059
|
background-color: transparent;
|
|
10892
11060
|
cursor: pointer;
|
|
10893
11061
|
font-size: 0.875rem;
|
|
10894
|
-
text-align:
|
|
11062
|
+
text-align: start;
|
|
10895
11063
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10896
11064
|
transition: background-color 0.15s ease-in-out;
|
|
10897
11065
|
|
|
@@ -11029,11 +11197,12 @@ var BaseOrganizationSwitcher = ({
|
|
|
11029
11197
|
avatarSize = 24,
|
|
11030
11198
|
fallback = null
|
|
11031
11199
|
}) => {
|
|
11032
|
-
const { theme, colorScheme } = useTheme_default();
|
|
11200
|
+
const { theme, colorScheme, direction } = useTheme_default();
|
|
11033
11201
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
11034
11202
|
const [isOpen, setIsOpen] = (0, import_react79.useState)(false);
|
|
11035
11203
|
const [hoveredItemIndex, setHoveredItemIndex] = (0, import_react79.useState)(null);
|
|
11036
11204
|
const { t } = useTranslation_default();
|
|
11205
|
+
const isRTL = direction === "rtl";
|
|
11037
11206
|
const { refs, floatingStyles, context } = (0, import_react78.useFloating)({
|
|
11038
11207
|
open: isOpen,
|
|
11039
11208
|
onOpenChange: setIsOpen,
|
|
@@ -11115,7 +11284,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11115
11284
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11116
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") })
|
|
11117
11286
|
] }),
|
|
11118
|
-
/* @__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" }) })
|
|
11119
11288
|
]
|
|
11120
11289
|
}
|
|
11121
11290
|
),
|
|
@@ -11560,8 +11729,8 @@ var BaseCreateOrganization = ({
|
|
|
11560
11729
|
};
|
|
11561
11730
|
|
|
11562
11731
|
// src/api/createOrganization.ts
|
|
11563
|
-
var
|
|
11564
|
-
var httpClient6 =
|
|
11732
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
11733
|
+
var httpClient6 = import_browser70.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser70.AsgardeoSPAClient.getInstance());
|
|
11565
11734
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11566
11735
|
const defaultFetcher = async (url, config) => {
|
|
11567
11736
|
const response = await httpClient6({
|
|
@@ -11578,7 +11747,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11578
11747
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11579
11748
|
};
|
|
11580
11749
|
};
|
|
11581
|
-
return (0,
|
|
11750
|
+
return (0, import_browser70.createOrganization)({
|
|
11582
11751
|
...requestConfig,
|
|
11583
11752
|
fetcher: fetcher || defaultFetcher
|
|
11584
11753
|
});
|
|
@@ -11653,12 +11822,12 @@ var CreateOrganization = ({
|
|
|
11653
11822
|
var import_react87 = require("react");
|
|
11654
11823
|
|
|
11655
11824
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11656
|
-
var
|
|
11825
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11657
11826
|
var import_css57 = require("@emotion/css");
|
|
11658
11827
|
var import_react86 = require("react");
|
|
11659
11828
|
|
|
11660
11829
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11661
|
-
var
|
|
11830
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
11662
11831
|
var import_css55 = require("@emotion/css");
|
|
11663
11832
|
var import_react84 = require("react");
|
|
11664
11833
|
|
|
@@ -11893,27 +12062,27 @@ var KeyValueInput = ({
|
|
|
11893
12062
|
);
|
|
11894
12063
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
11895
12064
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
11896
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
11897
|
-
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: [
|
|
11898
12067
|
label,
|
|
11899
12068
|
required && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11900
12069
|
"span",
|
|
11901
12070
|
{
|
|
11902
|
-
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),
|
|
11903
12072
|
children: " *"
|
|
11904
12073
|
}
|
|
11905
12074
|
)
|
|
11906
12075
|
] }),
|
|
11907
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: (0, import_css55.cx)((0,
|
|
11908
|
-
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)(
|
|
11909
12078
|
"div",
|
|
11910
12079
|
{
|
|
11911
|
-
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),
|
|
11912
12081
|
children: [
|
|
11913
12082
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11914
12083
|
"span",
|
|
11915
12084
|
{
|
|
11916
|
-
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),
|
|
11917
12086
|
children: [
|
|
11918
12087
|
pair.key,
|
|
11919
12088
|
":"
|
|
@@ -11923,7 +12092,7 @@ var KeyValueInput = ({
|
|
|
11923
12092
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11924
12093
|
"span",
|
|
11925
12094
|
{
|
|
11926
|
-
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),
|
|
11927
12096
|
children: pair.value
|
|
11928
12097
|
}
|
|
11929
12098
|
)
|
|
@@ -11933,7 +12102,7 @@ var KeyValueInput = ({
|
|
|
11933
12102
|
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11934
12103
|
"div",
|
|
11935
12104
|
{
|
|
11936
|
-
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),
|
|
11937
12106
|
children: [
|
|
11938
12107
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11939
12108
|
TextField_default,
|
|
@@ -11942,7 +12111,7 @@ var KeyValueInput = ({
|
|
|
11942
12111
|
value: pair.key,
|
|
11943
12112
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
11944
12113
|
disabled: disabled || readOnly,
|
|
11945
|
-
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),
|
|
11946
12115
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
11947
12116
|
}
|
|
11948
12117
|
),
|
|
@@ -11953,7 +12122,7 @@ var KeyValueInput = ({
|
|
|
11953
12122
|
value: pair.value,
|
|
11954
12123
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
11955
12124
|
disabled: disabled || readOnly,
|
|
11956
|
-
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),
|
|
11957
12126
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
11958
12127
|
}
|
|
11959
12128
|
),
|
|
@@ -11963,7 +12132,7 @@ var KeyValueInput = ({
|
|
|
11963
12132
|
type: "button",
|
|
11964
12133
|
onClick: () => handleRemovePair(index),
|
|
11965
12134
|
disabled,
|
|
11966
|
-
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),
|
|
11967
12136
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
11968
12137
|
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(X_default, { width: 16, height: 16 })
|
|
11969
12138
|
}
|
|
@@ -11972,7 +12141,7 @@ var KeyValueInput = ({
|
|
|
11972
12141
|
},
|
|
11973
12142
|
`${pair.key}-${index}`
|
|
11974
12143
|
)),
|
|
11975
|
-
!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: [
|
|
11976
12145
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11977
12146
|
TextField_default,
|
|
11978
12147
|
{
|
|
@@ -11980,7 +12149,7 @@ var KeyValueInput = ({
|
|
|
11980
12149
|
value: newKey,
|
|
11981
12150
|
onChange: (e) => setNewKey(e.target.value),
|
|
11982
12151
|
disabled,
|
|
11983
|
-
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),
|
|
11984
12153
|
"aria-label": "New key"
|
|
11985
12154
|
}
|
|
11986
12155
|
),
|
|
@@ -11991,7 +12160,7 @@ var KeyValueInput = ({
|
|
|
11991
12160
|
value: newValue,
|
|
11992
12161
|
onChange: (e) => setNewValue(e.target.value),
|
|
11993
12162
|
disabled,
|
|
11994
|
-
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),
|
|
11995
12164
|
"aria-label": "New value",
|
|
11996
12165
|
onKeyPress: (e) => {
|
|
11997
12166
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -12006,15 +12175,15 @@ var KeyValueInput = ({
|
|
|
12006
12175
|
type: "button",
|
|
12007
12176
|
onClick: handleAddPair,
|
|
12008
12177
|
disabled: isAddDisabled,
|
|
12009
|
-
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),
|
|
12010
12179
|
"aria-label": "Add new key-value pair",
|
|
12011
12180
|
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Plus_default, { width: 16, height: 16 })
|
|
12012
12181
|
}
|
|
12013
12182
|
)
|
|
12014
12183
|
] })
|
|
12015
12184
|
] }),
|
|
12016
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css55.cx)((0,
|
|
12017
|
-
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: [
|
|
12018
12187
|
pairs.length,
|
|
12019
12188
|
" of ",
|
|
12020
12189
|
maxPairs,
|
|
@@ -12218,13 +12387,13 @@ var BaseOrganizationProfile = ({
|
|
|
12218
12387
|
key: "created",
|
|
12219
12388
|
label: "Created Date",
|
|
12220
12389
|
editable: false,
|
|
12221
|
-
render: (value) => (0,
|
|
12390
|
+
render: (value) => (0, import_browser72.formatDate)(value)
|
|
12222
12391
|
},
|
|
12223
12392
|
{
|
|
12224
12393
|
key: "lastModified",
|
|
12225
12394
|
label: "Last Modified Date",
|
|
12226
12395
|
editable: false,
|
|
12227
|
-
render: (value) => (0,
|
|
12396
|
+
render: (value) => (0, import_browser72.formatDate)(value)
|
|
12228
12397
|
}
|
|
12229
12398
|
]
|
|
12230
12399
|
}) => {
|
|
@@ -12461,8 +12630,8 @@ var BaseOrganizationProfile = ({
|
|
|
12461
12630
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
12462
12631
|
|
|
12463
12632
|
// src/api/getOrganization.ts
|
|
12464
|
-
var
|
|
12465
|
-
var httpClient7 =
|
|
12633
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
12634
|
+
var httpClient7 = import_browser73.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser73.AsgardeoSPAClient.getInstance());
|
|
12466
12635
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
12467
12636
|
const defaultFetcher = async (url, config) => {
|
|
12468
12637
|
const response = await httpClient7({
|
|
@@ -12478,7 +12647,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12478
12647
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12479
12648
|
};
|
|
12480
12649
|
};
|
|
12481
|
-
return (0,
|
|
12650
|
+
return (0, import_browser73.getOrganization)({
|
|
12482
12651
|
...requestConfig,
|
|
12483
12652
|
fetcher: fetcher || defaultFetcher
|
|
12484
12653
|
});
|
|
@@ -12486,8 +12655,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12486
12655
|
var getOrganization_default = getOrganization;
|
|
12487
12656
|
|
|
12488
12657
|
// src/api/updateOrganization.ts
|
|
12489
|
-
var
|
|
12490
|
-
var httpClient8 =
|
|
12658
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
12659
|
+
var httpClient8 = import_browser74.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser74.AsgardeoSPAClient.getInstance());
|
|
12491
12660
|
var updateOrganization = async ({
|
|
12492
12661
|
fetcher,
|
|
12493
12662
|
...requestConfig
|
|
@@ -12507,7 +12676,7 @@ var updateOrganization = async ({
|
|
|
12507
12676
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12508
12677
|
};
|
|
12509
12678
|
};
|
|
12510
|
-
return (0,
|
|
12679
|
+
return (0, import_browser74.updateOrganization)({
|
|
12511
12680
|
...requestConfig,
|
|
12512
12681
|
fetcher: fetcher || defaultFetcher
|
|
12513
12682
|
});
|
|
@@ -12560,7 +12729,7 @@ var OrganizationProfile = ({
|
|
|
12560
12729
|
const handleOrganizationUpdate = async (payload) => {
|
|
12561
12730
|
if (!baseUrl || !organizationId) return;
|
|
12562
12731
|
try {
|
|
12563
|
-
const operations = (0,
|
|
12732
|
+
const operations = (0, import_browser74.createPatchOperations)(payload);
|
|
12564
12733
|
await updateOrganization_default({
|
|
12565
12734
|
baseUrl,
|
|
12566
12735
|
organizationId,
|
|
@@ -12997,10 +13166,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
12997
13166
|
|
|
12998
13167
|
&__loading-overlay {
|
|
12999
13168
|
position: absolute;
|
|
13000
|
-
|
|
13001
|
-
left: 0;
|
|
13002
|
-
right: 0;
|
|
13003
|
-
bottom: 0;
|
|
13169
|
+
inset: 0;
|
|
13004
13170
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13005
13171
|
display: flex;
|
|
13006
13172
|
align-items: center;
|
|
@@ -13025,10 +13191,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13025
13191
|
`,
|
|
13026
13192
|
loadingOverlay: import_css60.css`
|
|
13027
13193
|
position: absolute;
|
|
13028
|
-
|
|
13029
|
-
left: 0;
|
|
13030
|
-
right: 0;
|
|
13031
|
-
bottom: 0;
|
|
13194
|
+
inset: 0;
|
|
13032
13195
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13033
13196
|
display: flex;
|
|
13034
13197
|
align-items: center;
|
|
@@ -13216,5 +13379,5 @@ var OrganizationSwitcher = ({
|
|
|
13216
13379
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
13217
13380
|
|
|
13218
13381
|
// src/index.ts
|
|
13219
|
-
var
|
|
13382
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
13220
13383
|
//# sourceMappingURL=index.js.map
|