@asgardeo/react 0.5.33 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +811 -582
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/factories/FieldFactory.d.ts +4 -0
- package/dist/components/presentation/SignIn/BaseSignIn.d.ts +27 -0
- package/dist/components/presentation/SignIn/SignIn.d.ts +2 -2
- package/dist/components/presentation/SignIn/component-driven/SignInOptionFactory.d.ts +1 -0
- package/dist/components/presentation/SignUp/BaseSignUp.d.ts +91 -6
- package/dist/components/presentation/SignUp/SignUp.d.ts +52 -3
- package/dist/components/presentation/SignUp/SignUpOptionFactory.d.ts +0 -6
- package/dist/components/presentation/SignUp/transformer.d.ts +104 -0
- package/dist/contexts/Theme/ThemeContext.d.ts +4 -0
- package/dist/contexts/Theme/types.d.ts +5 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +633 -399
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -36,13 +36,13 @@ __export(index_exports, {
|
|
|
36
36
|
AlertTitle: () => AlertTitle,
|
|
37
37
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
38
38
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
39
|
-
AsgardeoRuntimeError: () =>
|
|
39
|
+
AsgardeoRuntimeError: () => import_browser76.AsgardeoRuntimeError,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseOrganization: () => BaseOrganization_default,
|
|
42
42
|
BaseOrganizationList: () => BaseOrganizationList_default,
|
|
43
43
|
BaseOrganizationProfile: () => BaseOrganizationProfile_default,
|
|
44
44
|
BaseOrganizationSwitcher: () => BaseOrganizationSwitcher_default,
|
|
45
|
-
BaseSignIn: () =>
|
|
45
|
+
BaseSignIn: () => BaseSignIn_default3,
|
|
46
46
|
BaseSignInButton: () => BaseSignInButton_default,
|
|
47
47
|
BaseSignOutButton: () => BaseSignOutButton_default,
|
|
48
48
|
BaseSignUp: () => BaseSignUp_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_browser75.createPatchOperations,
|
|
129
129
|
createSignInOption: () => createSignInOption,
|
|
130
130
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
131
|
-
getActiveTheme: () =>
|
|
131
|
+
getActiveTheme: () => import_browser76.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_browser76.http,
|
|
138
|
+
navigate: () => import_browser76.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,
|
|
@@ -2990,6 +3006,9 @@ var Loading = ({ children, fallback = null }) => {
|
|
|
2990
3006
|
Loading.displayName = "Loading";
|
|
2991
3007
|
var Loading_default = Loading;
|
|
2992
3008
|
|
|
3009
|
+
// src/components/presentation/SignIn/BaseSignIn.tsx
|
|
3010
|
+
var import_browser48 = require("@asgardeo/browser");
|
|
3011
|
+
|
|
2993
3012
|
// src/components/presentation/SignIn/non-component-driven/BaseSignIn.tsx
|
|
2994
3013
|
var import_browser44 = require("@asgardeo/browser");
|
|
2995
3014
|
var import_css35 = require("@emotion/css");
|
|
@@ -3378,13 +3397,13 @@ var import_react34 = require("react");
|
|
|
3378
3397
|
var useStyles4 = (theme, colorScheme, helperTextAlign, helperTextMarginLeft, hasError) => {
|
|
3379
3398
|
return (0, import_react34.useMemo)(() => {
|
|
3380
3399
|
const formControl = import_css10.css`
|
|
3381
|
-
text-align:
|
|
3400
|
+
text-align: start;
|
|
3382
3401
|
margin-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
3383
3402
|
`;
|
|
3384
3403
|
const helperText = import_css10.css`
|
|
3385
3404
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
3386
|
-
text-align: ${helperTextAlign};
|
|
3387
|
-
${helperTextMarginLeft && `margin-
|
|
3405
|
+
text-align: ${helperTextAlign === "left" ? "start" : helperTextAlign};
|
|
3406
|
+
${helperTextMarginLeft && `margin-inline-start: ${helperTextMarginLeft};`}
|
|
3388
3407
|
`;
|
|
3389
3408
|
const helperTextError = import_css10.css`
|
|
3390
3409
|
color: ${theme.vars.colors.error.main};
|
|
@@ -3518,8 +3537,8 @@ var import_css14 = require("@emotion/css");
|
|
|
3518
3537
|
var import_react36 = require("react");
|
|
3519
3538
|
var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIcon) => {
|
|
3520
3539
|
return (0, import_react36.useMemo)(() => {
|
|
3521
|
-
const
|
|
3522
|
-
const
|
|
3540
|
+
const inlineStartPadding = hasStartIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3541
|
+
const inlineEndPadding = hasEndIcon ? `calc(${theme.vars.spacing.unit} * 5)` : `calc(${theme.vars.spacing.unit} * 1.5)`;
|
|
3523
3542
|
const inputContainer = import_css14.css`
|
|
3524
3543
|
position: relative;
|
|
3525
3544
|
display: flex;
|
|
@@ -3527,7 +3546,9 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3527
3546
|
`;
|
|
3528
3547
|
const input = import_css14.css`
|
|
3529
3548
|
width: 100%;
|
|
3530
|
-
padding: ${theme.vars.spacing.unit}
|
|
3549
|
+
padding-block: ${theme.vars.spacing.unit};
|
|
3550
|
+
padding-inline-start: ${inlineStartPadding};
|
|
3551
|
+
padding-inline-end: ${inlineEndPadding};
|
|
3531
3552
|
border: 1px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
|
|
3532
3553
|
border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
|
|
3533
3554
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
@@ -3598,11 +3619,11 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
|
|
|
3598
3619
|
`;
|
|
3599
3620
|
const startIcon = import_css14.css`
|
|
3600
3621
|
${icon};
|
|
3601
|
-
|
|
3622
|
+
inset-inline-start: ${theme.vars.spacing.unit};
|
|
3602
3623
|
`;
|
|
3603
3624
|
const endIcon = import_css14.css`
|
|
3604
3625
|
${icon};
|
|
3605
|
-
|
|
3626
|
+
inset-inline-end: ${theme.vars.spacing.unit};
|
|
3606
3627
|
`;
|
|
3607
3628
|
return {
|
|
3608
3629
|
inputContainer,
|
|
@@ -4317,7 +4338,7 @@ var useStyles11 = (theme, colorScheme, hasError, required) => {
|
|
|
4317
4338
|
const inputStyles = import_css24.css`
|
|
4318
4339
|
width: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4319
4340
|
height: calc(${theme.vars.spacing.unit} * 2.5);
|
|
4320
|
-
margin-
|
|
4341
|
+
margin-inline-end: ${theme.vars.spacing.unit};
|
|
4321
4342
|
accent-color: ${theme.vars.colors.primary.main};
|
|
4322
4343
|
cursor: pointer;
|
|
4323
4344
|
|
|
@@ -4437,6 +4458,7 @@ var createField = (config) => {
|
|
|
4437
4458
|
required,
|
|
4438
4459
|
value,
|
|
4439
4460
|
onChange,
|
|
4461
|
+
onBlur,
|
|
4440
4462
|
disabled = false,
|
|
4441
4463
|
error,
|
|
4442
4464
|
className,
|
|
@@ -4453,7 +4475,8 @@ var createField = (config) => {
|
|
|
4453
4475
|
error: validationError,
|
|
4454
4476
|
className,
|
|
4455
4477
|
value,
|
|
4456
|
-
placeholder
|
|
4478
|
+
placeholder,
|
|
4479
|
+
onBlur
|
|
4457
4480
|
};
|
|
4458
4481
|
switch (type) {
|
|
4459
4482
|
case import_browser32.FieldType.Password:
|
|
@@ -5834,8 +5857,9 @@ var useStyles14 = (theme, colorScheme, orientation, variant, color, hasChildren)
|
|
|
5834
5857
|
height: 100%;
|
|
5835
5858
|
min-height: calc(${theme.vars.spacing.unit} * 2);
|
|
5836
5859
|
width: 1px;
|
|
5837
|
-
border-
|
|
5838
|
-
margin: 0
|
|
5860
|
+
border-inline-start: 1px ${borderStyle} ${baseColor};
|
|
5861
|
+
margin-block: 0;
|
|
5862
|
+
margin-inline: calc(${theme.vars.spacing.unit} * 1);
|
|
5839
5863
|
`;
|
|
5840
5864
|
const horizontalDivider = import_css30.css`
|
|
5841
5865
|
display: flex;
|
|
@@ -6872,12 +6896,6 @@ var BaseSignInContent = ({
|
|
|
6872
6896
|
};
|
|
6873
6897
|
var BaseSignIn_default = BaseSignIn;
|
|
6874
6898
|
|
|
6875
|
-
// src/components/presentation/SignIn/SignIn.tsx
|
|
6876
|
-
var import_browser50 = require("@asgardeo/browser");
|
|
6877
|
-
|
|
6878
|
-
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
6879
|
-
var import_react60 = require("react");
|
|
6880
|
-
|
|
6881
6899
|
// src/components/presentation/SignIn/component-driven/BaseSignIn.tsx
|
|
6882
6900
|
var import_react59 = require("react");
|
|
6883
6901
|
var import_css37 = require("@emotion/css");
|
|
@@ -7097,6 +7115,7 @@ var createSignInComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
7097
7115
|
value,
|
|
7098
7116
|
error,
|
|
7099
7117
|
onChange: (newValue) => onInputChange(identifier, newValue),
|
|
7118
|
+
onBlur: () => options.onInputBlur?.(identifier),
|
|
7100
7119
|
className: options.inputClassName
|
|
7101
7120
|
});
|
|
7102
7121
|
return import_react58.default.cloneElement(field, { key });
|
|
@@ -7273,6 +7292,8 @@ var BaseSignInContent2 = ({
|
|
|
7273
7292
|
} = form;
|
|
7274
7293
|
const handleInputChange = (name, value) => {
|
|
7275
7294
|
setFormValue(name, value);
|
|
7295
|
+
};
|
|
7296
|
+
const handleInputBlur = (name) => {
|
|
7276
7297
|
setFormTouched(name, true);
|
|
7277
7298
|
};
|
|
7278
7299
|
const handleSubmit = async (component, data) => {
|
|
@@ -7352,6 +7373,7 @@ var BaseSignInContent2 = ({
|
|
|
7352
7373
|
buttonClassName: buttonClasses,
|
|
7353
7374
|
error,
|
|
7354
7375
|
inputClassName: inputClasses,
|
|
7376
|
+
onInputBlur: handleInputBlur,
|
|
7355
7377
|
onSubmit: handleSubmit,
|
|
7356
7378
|
size,
|
|
7357
7379
|
variant
|
|
@@ -7368,6 +7390,7 @@ var BaseSignInContent2 = ({
|
|
|
7368
7390
|
error,
|
|
7369
7391
|
inputClasses,
|
|
7370
7392
|
buttonClasses,
|
|
7393
|
+
handleInputBlur,
|
|
7371
7394
|
handleSubmit
|
|
7372
7395
|
]
|
|
7373
7396
|
);
|
|
@@ -7420,16 +7443,38 @@ var BaseSignInContent2 = ({
|
|
|
7420
7443
|
};
|
|
7421
7444
|
var BaseSignIn_default2 = BaseSignIn2;
|
|
7422
7445
|
|
|
7446
|
+
// src/components/presentation/SignIn/BaseSignIn.tsx
|
|
7447
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7448
|
+
var BaseSignIn3 = (props) => {
|
|
7449
|
+
const { platform } = useAsgardeo_default();
|
|
7450
|
+
if (platform === import_browser48.Platform.AsgardeoV2) {
|
|
7451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BaseSignIn_default2, { ...props });
|
|
7452
|
+
}
|
|
7453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BaseSignIn_default, { ...props });
|
|
7454
|
+
};
|
|
7455
|
+
var BaseSignIn_default3 = BaseSignIn3;
|
|
7456
|
+
|
|
7457
|
+
// src/components/presentation/SignIn/SignIn.tsx
|
|
7458
|
+
var import_browser51 = require("@asgardeo/browser");
|
|
7459
|
+
|
|
7423
7460
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7424
|
-
var
|
|
7461
|
+
var import_react60 = require("react");
|
|
7462
|
+
var import_browser50 = require("@asgardeo/browser");
|
|
7425
7463
|
|
|
7426
7464
|
// src/components/presentation/SignIn/component-driven/transformer.ts
|
|
7427
|
-
var
|
|
7465
|
+
var import_browser49 = require("@asgardeo/browser");
|
|
7428
7466
|
var generateId = (prefix) => {
|
|
7429
7467
|
const suffix = Math.random().toString(36).substring(2, 6);
|
|
7430
7468
|
return `${prefix}_${suffix}`;
|
|
7431
7469
|
};
|
|
7432
|
-
var getInputVariant = (type) => {
|
|
7470
|
+
var getInputVariant = (type, name) => {
|
|
7471
|
+
const lowerName = name.toLowerCase();
|
|
7472
|
+
if (lowerName.includes("password")) {
|
|
7473
|
+
return "PASSWORD";
|
|
7474
|
+
}
|
|
7475
|
+
if (lowerName.includes("email")) {
|
|
7476
|
+
return "EMAIL";
|
|
7477
|
+
}
|
|
7433
7478
|
switch (type.toLowerCase()) {
|
|
7434
7479
|
case "email":
|
|
7435
7480
|
return "EMAIL";
|
|
@@ -7456,15 +7501,15 @@ var getInputPlaceholder = (name, type, t) => {
|
|
|
7456
7501
|
return placeholder;
|
|
7457
7502
|
};
|
|
7458
7503
|
var convertSimpleInputToComponent = (input, t) => {
|
|
7459
|
-
const variant = getInputVariant(input.type);
|
|
7504
|
+
const variant = getInputVariant(input.type, input.name);
|
|
7460
7505
|
const label = getInputLabel(input.name, input.type, t);
|
|
7461
7506
|
const placeholder = getInputPlaceholder(input.name, input.type, t);
|
|
7462
7507
|
return {
|
|
7463
7508
|
id: generateId("input"),
|
|
7464
|
-
type:
|
|
7509
|
+
type: import_browser49.EmbeddedFlowComponentType.Input,
|
|
7465
7510
|
variant,
|
|
7466
7511
|
config: {
|
|
7467
|
-
type: input.type
|
|
7512
|
+
type: input.type,
|
|
7468
7513
|
label,
|
|
7469
7514
|
placeholder,
|
|
7470
7515
|
required: input.required,
|
|
@@ -7483,7 +7528,7 @@ var convertActionToComponent = (action, t) => {
|
|
|
7483
7528
|
}
|
|
7484
7529
|
return {
|
|
7485
7530
|
id: generateId("action"),
|
|
7486
|
-
type:
|
|
7531
|
+
type: import_browser49.EmbeddedFlowComponentType.Button,
|
|
7487
7532
|
variant: "SECONDARY",
|
|
7488
7533
|
config: {
|
|
7489
7534
|
type: "button",
|
|
@@ -7499,7 +7544,7 @@ var transformSimpleToComponentDriven = (response, t) => {
|
|
|
7499
7544
|
const actionComponents = response?.data?.actions?.map((action) => convertActionToComponent(action, t)) || [];
|
|
7500
7545
|
const submitButton = inputComponents.length > 0 ? {
|
|
7501
7546
|
id: generateId("button"),
|
|
7502
|
-
type:
|
|
7547
|
+
type: import_browser49.EmbeddedFlowComponentType.Button,
|
|
7503
7548
|
variant: "PRIMARY",
|
|
7504
7549
|
config: {
|
|
7505
7550
|
type: "submit",
|
|
@@ -7516,7 +7561,7 @@ var transformSimpleToComponentDriven = (response, t) => {
|
|
|
7516
7561
|
if (formComponents.length > 0) {
|
|
7517
7562
|
result.push({
|
|
7518
7563
|
id: generateId("form"),
|
|
7519
|
-
type:
|
|
7564
|
+
type: import_browser49.EmbeddedFlowComponentType.Form,
|
|
7520
7565
|
config: {},
|
|
7521
7566
|
components: formComponents
|
|
7522
7567
|
});
|
|
@@ -7534,7 +7579,7 @@ var normalizeFlowResponse = (response, t) => {
|
|
|
7534
7579
|
};
|
|
7535
7580
|
|
|
7536
7581
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7537
|
-
var
|
|
7582
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7538
7583
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7539
7584
|
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
7540
7585
|
const { t } = useTranslation_default();
|
|
@@ -7556,7 +7601,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7556
7601
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
7557
7602
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
7558
7603
|
if (!flowIdFromUrl && !effectiveApplicationId) {
|
|
7559
|
-
const error = new
|
|
7604
|
+
const error = new import_browser50.AsgardeoRuntimeError(
|
|
7560
7605
|
"Either flowId or applicationId is required for authentication",
|
|
7561
7606
|
"SignIn-initializeFlow-RuntimeError-001",
|
|
7562
7607
|
"react",
|
|
@@ -7575,7 +7620,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7575
7620
|
} else {
|
|
7576
7621
|
response = await signIn({
|
|
7577
7622
|
applicationId: effectiveApplicationId,
|
|
7578
|
-
flowType:
|
|
7623
|
+
flowType: import_browser50.EmbeddedFlowType.Authentication
|
|
7579
7624
|
});
|
|
7580
7625
|
}
|
|
7581
7626
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
@@ -7588,7 +7633,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7588
7633
|
const err = error;
|
|
7589
7634
|
setFlowError(err);
|
|
7590
7635
|
onError?.(err);
|
|
7591
|
-
throw new
|
|
7636
|
+
throw new import_browser50.AsgardeoRuntimeError(
|
|
7592
7637
|
`Failed to initialize authentication flow: ${error instanceof Error ? error.message : String(error)}`,
|
|
7593
7638
|
"SignIn-initializeFlow-RuntimeError-002",
|
|
7594
7639
|
"react",
|
|
@@ -7608,7 +7653,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7608
7653
|
...payload
|
|
7609
7654
|
});
|
|
7610
7655
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
7611
|
-
if (response.flowStatus ===
|
|
7656
|
+
if (response.flowStatus === import_browser50.EmbeddedSignInFlowStatusV2.Complete) {
|
|
7612
7657
|
onSuccess && onSuccess({
|
|
7613
7658
|
redirectUrl: response.redirectUrl || afterSignInUrl,
|
|
7614
7659
|
...response.data
|
|
@@ -7624,7 +7669,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7624
7669
|
const err = error;
|
|
7625
7670
|
setFlowError(err);
|
|
7626
7671
|
onError?.(err);
|
|
7627
|
-
throw new
|
|
7672
|
+
throw new import_browser50.AsgardeoRuntimeError(
|
|
7628
7673
|
`Failed to submit authentication flow: ${error instanceof Error ? error.message : String(error)}`,
|
|
7629
7674
|
"SignIn-handleSubmit-RuntimeError-001",
|
|
7630
7675
|
"react",
|
|
@@ -7648,9 +7693,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7648
7693
|
components,
|
|
7649
7694
|
error: flowError
|
|
7650
7695
|
};
|
|
7651
|
-
return /* @__PURE__ */ (0,
|
|
7696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: children(renderProps) });
|
|
7652
7697
|
}
|
|
7653
|
-
return /* @__PURE__ */ (0,
|
|
7698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7654
7699
|
BaseSignIn_default2,
|
|
7655
7700
|
{
|
|
7656
7701
|
components,
|
|
@@ -7666,7 +7711,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7666
7711
|
var SignIn_default = SignIn;
|
|
7667
7712
|
|
|
7668
7713
|
// src/components/presentation/SignIn/SignIn.tsx
|
|
7669
|
-
var
|
|
7714
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7670
7715
|
var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
7671
7716
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
7672
7717
|
const handleInitialize = async () => {
|
|
@@ -7686,8 +7731,8 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7686
7731
|
window.location.href = url.toString();
|
|
7687
7732
|
}
|
|
7688
7733
|
};
|
|
7689
|
-
if (platform ===
|
|
7690
|
-
return /* @__PURE__ */ (0,
|
|
7734
|
+
if (platform === import_browser51.Platform.AsgardeoV2) {
|
|
7735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7691
7736
|
SignIn_default,
|
|
7692
7737
|
{
|
|
7693
7738
|
className,
|
|
@@ -7699,7 +7744,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7699
7744
|
}
|
|
7700
7745
|
);
|
|
7701
7746
|
}
|
|
7702
|
-
return /* @__PURE__ */ (0,
|
|
7747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7703
7748
|
BaseSignIn_default,
|
|
7704
7749
|
{
|
|
7705
7750
|
isLoading: isLoading || !isInitialized,
|
|
@@ -7716,15 +7761,15 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7716
7761
|
var SignIn_default2 = SignIn2;
|
|
7717
7762
|
|
|
7718
7763
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7719
|
-
var
|
|
7764
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
7720
7765
|
var import_css39 = require("@emotion/css");
|
|
7721
7766
|
var import_react62 = require("react");
|
|
7722
7767
|
|
|
7723
7768
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
7724
|
-
var
|
|
7769
|
+
var import_browser58 = require("@asgardeo/browser");
|
|
7725
7770
|
|
|
7726
7771
|
// src/components/adapters/CheckboxInput.tsx
|
|
7727
|
-
var
|
|
7772
|
+
var import_browser52 = require("@asgardeo/browser");
|
|
7728
7773
|
var CheckboxInput = ({
|
|
7729
7774
|
component,
|
|
7730
7775
|
formValues,
|
|
@@ -7738,7 +7783,7 @@ var CheckboxInput = ({
|
|
|
7738
7783
|
const value = formValues[fieldName] || false;
|
|
7739
7784
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7740
7785
|
return createField({
|
|
7741
|
-
type:
|
|
7786
|
+
type: import_browser52.FieldType.Checkbox,
|
|
7742
7787
|
name: fieldName,
|
|
7743
7788
|
label: config["label"] || "",
|
|
7744
7789
|
placeholder: config["placeholder"] || "",
|
|
@@ -7752,7 +7797,7 @@ var CheckboxInput = ({
|
|
|
7752
7797
|
var CheckboxInput_default = CheckboxInput;
|
|
7753
7798
|
|
|
7754
7799
|
// src/components/adapters/DateInput.tsx
|
|
7755
|
-
var
|
|
7800
|
+
var import_browser53 = require("@asgardeo/browser");
|
|
7756
7801
|
var DateInput = ({
|
|
7757
7802
|
component,
|
|
7758
7803
|
formValues,
|
|
@@ -7766,7 +7811,7 @@ var DateInput = ({
|
|
|
7766
7811
|
const value = formValues[fieldName] || "";
|
|
7767
7812
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7768
7813
|
return createField({
|
|
7769
|
-
type:
|
|
7814
|
+
type: import_browser53.FieldType.Date,
|
|
7770
7815
|
name: fieldName,
|
|
7771
7816
|
label: config["label"] || "",
|
|
7772
7817
|
placeholder: config["placeholder"] || "",
|
|
@@ -7780,13 +7825,13 @@ var DateInput = ({
|
|
|
7780
7825
|
var DateInput_default = DateInput;
|
|
7781
7826
|
|
|
7782
7827
|
// src/components/adapters/DividerComponent.tsx
|
|
7783
|
-
var
|
|
7828
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7784
7829
|
var DividerComponent = ({ component }) => {
|
|
7785
7830
|
const { theme } = useTheme_default();
|
|
7786
7831
|
const config = component.config || {};
|
|
7787
7832
|
const text = config["text"] || "";
|
|
7788
7833
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
7789
|
-
return /* @__PURE__ */ (0,
|
|
7834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7790
7835
|
Divider_default,
|
|
7791
7836
|
{
|
|
7792
7837
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -7799,7 +7844,7 @@ var DividerComponent = ({ component }) => {
|
|
|
7799
7844
|
var DividerComponent_default = DividerComponent;
|
|
7800
7845
|
|
|
7801
7846
|
// src/components/adapters/EmailInput.tsx
|
|
7802
|
-
var
|
|
7847
|
+
var import_browser54 = require("@asgardeo/browser");
|
|
7803
7848
|
var EmailInput = ({
|
|
7804
7849
|
component,
|
|
7805
7850
|
formValues,
|
|
@@ -7813,7 +7858,7 @@ var EmailInput = ({
|
|
|
7813
7858
|
const value = formValues[fieldName] || "";
|
|
7814
7859
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7815
7860
|
return createField({
|
|
7816
|
-
type:
|
|
7861
|
+
type: import_browser54.FieldType.Email,
|
|
7817
7862
|
name: fieldName,
|
|
7818
7863
|
label: config["label"] || "Email",
|
|
7819
7864
|
placeholder: config["placeholder"] || "Enter your email",
|
|
@@ -7827,7 +7872,7 @@ var EmailInput = ({
|
|
|
7827
7872
|
var EmailInput_default = EmailInput;
|
|
7828
7873
|
|
|
7829
7874
|
// src/components/adapters/FormContainer.tsx
|
|
7830
|
-
var
|
|
7875
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7831
7876
|
var FormContainer = (props) => {
|
|
7832
7877
|
const { component } = props;
|
|
7833
7878
|
if (component.components && component.components.length > 0) {
|
|
@@ -7840,19 +7885,19 @@ var FormContainer = (props) => {
|
|
|
7840
7885
|
props.onSubmit(submitButton, props.formValues);
|
|
7841
7886
|
}
|
|
7842
7887
|
};
|
|
7843
|
-
return /* @__PURE__ */ (0,
|
|
7888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
7844
7889
|
(childComponent, index) => createSignUpComponent({
|
|
7845
7890
|
...props,
|
|
7846
7891
|
component: childComponent
|
|
7847
7892
|
})
|
|
7848
7893
|
) }, component.id);
|
|
7849
7894
|
}
|
|
7850
|
-
return /* @__PURE__ */ (0,
|
|
7895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", {}, component.id);
|
|
7851
7896
|
};
|
|
7852
7897
|
var FormContainer_default = FormContainer;
|
|
7853
7898
|
|
|
7854
7899
|
// src/components/adapters/ImageComponent.tsx
|
|
7855
|
-
var
|
|
7900
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7856
7901
|
var ImageComponent = ({ component }) => {
|
|
7857
7902
|
const { theme } = useTheme_default();
|
|
7858
7903
|
const config = component.config || {};
|
|
@@ -7869,7 +7914,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7869
7914
|
if (!src) {
|
|
7870
7915
|
return null;
|
|
7871
7916
|
}
|
|
7872
|
-
return /* @__PURE__ */ (0,
|
|
7917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7873
7918
|
"img",
|
|
7874
7919
|
{
|
|
7875
7920
|
src,
|
|
@@ -7884,7 +7929,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7884
7929
|
var ImageComponent_default = ImageComponent;
|
|
7885
7930
|
|
|
7886
7931
|
// src/components/adapters/NumberInput.tsx
|
|
7887
|
-
var
|
|
7932
|
+
var import_browser55 = require("@asgardeo/browser");
|
|
7888
7933
|
var NumberInput = ({
|
|
7889
7934
|
component,
|
|
7890
7935
|
formValues,
|
|
@@ -7898,7 +7943,7 @@ var NumberInput = ({
|
|
|
7898
7943
|
const value = formValues[fieldName] || "";
|
|
7899
7944
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7900
7945
|
return createField({
|
|
7901
|
-
type:
|
|
7946
|
+
type: import_browser55.FieldType.Number,
|
|
7902
7947
|
name: fieldName,
|
|
7903
7948
|
label: config["label"] || "",
|
|
7904
7949
|
placeholder: config["placeholder"] || "",
|
|
@@ -7912,7 +7957,7 @@ var NumberInput = ({
|
|
|
7912
7957
|
var NumberInput_default = NumberInput;
|
|
7913
7958
|
|
|
7914
7959
|
// src/components/adapters/PasswordInput.tsx
|
|
7915
|
-
var
|
|
7960
|
+
var import_browser56 = require("@asgardeo/browser");
|
|
7916
7961
|
var PasswordInput = ({
|
|
7917
7962
|
component,
|
|
7918
7963
|
formValues,
|
|
@@ -7958,7 +8003,7 @@ var PasswordInput = ({
|
|
|
7958
8003
|
});
|
|
7959
8004
|
const hint = validationHints.length > 0 ? validationHints.join(", ") : config["hint"] || "";
|
|
7960
8005
|
return createField({
|
|
7961
|
-
type:
|
|
8006
|
+
type: import_browser56.FieldType.Password,
|
|
7962
8007
|
name: fieldName,
|
|
7963
8008
|
label: config["label"] || "Password",
|
|
7964
8009
|
placeholder: config["placeholder"] || "Enter your password",
|
|
@@ -7972,7 +8017,7 @@ var PasswordInput = ({
|
|
|
7972
8017
|
var PasswordInput_default = PasswordInput;
|
|
7973
8018
|
|
|
7974
8019
|
// src/components/adapters/SubmitButton.tsx
|
|
7975
|
-
var
|
|
8020
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7976
8021
|
var ButtonComponent = ({
|
|
7977
8022
|
component,
|
|
7978
8023
|
isLoading,
|
|
@@ -8005,7 +8050,7 @@ var ButtonComponent = ({
|
|
|
8005
8050
|
onSubmit(component);
|
|
8006
8051
|
}
|
|
8007
8052
|
};
|
|
8008
|
-
return /* @__PURE__ */ (0,
|
|
8053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8009
8054
|
Button_default,
|
|
8010
8055
|
{
|
|
8011
8056
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -8016,7 +8061,7 @@ var ButtonComponent = ({
|
|
|
8016
8061
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
8017
8062
|
className: buttonClassName,
|
|
8018
8063
|
style: { width: "100%" },
|
|
8019
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
8064
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Spinner_default, { size: "small" }) : buttonText
|
|
8020
8065
|
},
|
|
8021
8066
|
component.id
|
|
8022
8067
|
);
|
|
@@ -8024,7 +8069,7 @@ var ButtonComponent = ({
|
|
|
8024
8069
|
var SubmitButton_default = ButtonComponent;
|
|
8025
8070
|
|
|
8026
8071
|
// src/components/adapters/TelephoneInput.tsx
|
|
8027
|
-
var
|
|
8072
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8028
8073
|
var TelephoneInput = ({
|
|
8029
8074
|
component,
|
|
8030
8075
|
formValues,
|
|
@@ -8037,7 +8082,7 @@ var TelephoneInput = ({
|
|
|
8037
8082
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
8038
8083
|
const value = formValues[fieldName] || "";
|
|
8039
8084
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8040
|
-
return /* @__PURE__ */ (0,
|
|
8085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8041
8086
|
TextField_default,
|
|
8042
8087
|
{
|
|
8043
8088
|
name: fieldName,
|
|
@@ -8057,7 +8102,7 @@ var TelephoneInput = ({
|
|
|
8057
8102
|
var TelephoneInput_default = TelephoneInput;
|
|
8058
8103
|
|
|
8059
8104
|
// src/components/adapters/TextInput.tsx
|
|
8060
|
-
var
|
|
8105
|
+
var import_browser57 = require("@asgardeo/browser");
|
|
8061
8106
|
var TextInput = ({
|
|
8062
8107
|
component,
|
|
8063
8108
|
formValues,
|
|
@@ -8071,7 +8116,7 @@ var TextInput = ({
|
|
|
8071
8116
|
const value = formValues[fieldName] || "";
|
|
8072
8117
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8073
8118
|
return createField({
|
|
8074
|
-
type:
|
|
8119
|
+
type: import_browser57.FieldType.Text,
|
|
8075
8120
|
name: fieldName,
|
|
8076
8121
|
label: config["label"] || "",
|
|
8077
8122
|
placeholder: config["placeholder"] || "",
|
|
@@ -8085,7 +8130,7 @@ var TextInput = ({
|
|
|
8085
8130
|
var TextInput_default = TextInput;
|
|
8086
8131
|
|
|
8087
8132
|
// src/components/adapters/Typography.tsx
|
|
8088
|
-
var
|
|
8133
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8089
8134
|
var TypographyComponent = ({ component }) => {
|
|
8090
8135
|
const { theme } = useTheme_default();
|
|
8091
8136
|
const config = component.config || {};
|
|
@@ -8126,7 +8171,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
8126
8171
|
default:
|
|
8127
8172
|
typographyVariant = "body1";
|
|
8128
8173
|
}
|
|
8129
|
-
return /* @__PURE__ */ (0,
|
|
8174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
8130
8175
|
Typography_default,
|
|
8131
8176
|
{
|
|
8132
8177
|
variant: typographyVariant,
|
|
@@ -8139,66 +8184,66 @@ var TypographyComponent = ({ component }) => {
|
|
|
8139
8184
|
var Typography_default2 = TypographyComponent;
|
|
8140
8185
|
|
|
8141
8186
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
8142
|
-
var
|
|
8187
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8143
8188
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8144
8189
|
switch (component.type) {
|
|
8145
|
-
case
|
|
8146
|
-
return /* @__PURE__ */ (0,
|
|
8147
|
-
case
|
|
8190
|
+
case import_browser58.EmbeddedFlowComponentType.Typography:
|
|
8191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
8192
|
+
case import_browser58.EmbeddedFlowComponentType.Input:
|
|
8148
8193
|
const inputVariant = component.variant?.toUpperCase();
|
|
8149
8194
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8150
8195
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
8151
|
-
return /* @__PURE__ */ (0,
|
|
8196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(EmailInput_default, { component, onSubmit, ...rest });
|
|
8152
8197
|
}
|
|
8153
8198
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
8154
|
-
return /* @__PURE__ */ (0,
|
|
8199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PasswordInput_default, { component, onSubmit, ...rest });
|
|
8155
8200
|
}
|
|
8156
8201
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
8157
|
-
return /* @__PURE__ */ (0,
|
|
8202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
8158
8203
|
}
|
|
8159
8204
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
8160
|
-
return /* @__PURE__ */ (0,
|
|
8205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(NumberInput_default, { component, onSubmit, ...rest });
|
|
8161
8206
|
}
|
|
8162
8207
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
8163
|
-
return /* @__PURE__ */ (0,
|
|
8208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DateInput_default, { component, onSubmit, ...rest });
|
|
8164
8209
|
}
|
|
8165
8210
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
8166
|
-
return /* @__PURE__ */ (0,
|
|
8211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8167
8212
|
}
|
|
8168
|
-
return /* @__PURE__ */ (0,
|
|
8169
|
-
case
|
|
8213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
8214
|
+
case import_browser58.EmbeddedFlowComponentType.Button: {
|
|
8170
8215
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8171
8216
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8172
8217
|
if (buttonVariant === "SOCIAL") {
|
|
8173
8218
|
if (buttonText.toLowerCase().includes("google")) {
|
|
8174
|
-
return /* @__PURE__ */ (0,
|
|
8219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8175
8220
|
}
|
|
8176
8221
|
if (buttonText.toLowerCase().includes("github")) {
|
|
8177
|
-
return /* @__PURE__ */ (0,
|
|
8222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8178
8223
|
}
|
|
8179
8224
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
8180
|
-
return /* @__PURE__ */ (0,
|
|
8225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8181
8226
|
}
|
|
8182
8227
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
8183
|
-
return /* @__PURE__ */ (0,
|
|
8228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8184
8229
|
}
|
|
8185
8230
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
8186
|
-
return /* @__PURE__ */ (0,
|
|
8231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8187
8232
|
}
|
|
8188
8233
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
8189
|
-
return /* @__PURE__ */ (0,
|
|
8234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8190
8235
|
}
|
|
8191
8236
|
}
|
|
8192
|
-
return /* @__PURE__ */ (0,
|
|
8237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8193
8238
|
}
|
|
8194
|
-
case
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8196
|
-
case
|
|
8197
|
-
return /* @__PURE__ */ (0,
|
|
8198
|
-
case
|
|
8199
|
-
return /* @__PURE__ */ (0,
|
|
8239
|
+
case import_browser58.EmbeddedFlowComponentType.Form:
|
|
8240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
8241
|
+
case import_browser58.EmbeddedFlowComponentType.Divider:
|
|
8242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8243
|
+
case import_browser58.EmbeddedFlowComponentType.Image:
|
|
8244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8200
8245
|
default:
|
|
8201
|
-
return /* @__PURE__ */ (0,
|
|
8246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", {});
|
|
8202
8247
|
}
|
|
8203
8248
|
};
|
|
8204
8249
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -8228,6 +8273,149 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8228
8273
|
)
|
|
8229
8274
|
).filter(Boolean);
|
|
8230
8275
|
|
|
8276
|
+
// src/components/presentation/SignUp/transformer.ts
|
|
8277
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
8278
|
+
var generateId2 = (prefix) => {
|
|
8279
|
+
const suffix = Math.random().toString(36).substring(2, 6);
|
|
8280
|
+
return `${prefix}_${suffix}`;
|
|
8281
|
+
};
|
|
8282
|
+
var getInputVariant2 = (type, name) => {
|
|
8283
|
+
const lowerName = name.toLowerCase();
|
|
8284
|
+
if (lowerName.includes("password")) {
|
|
8285
|
+
return "PASSWORD";
|
|
8286
|
+
}
|
|
8287
|
+
if (lowerName.includes("email")) {
|
|
8288
|
+
return "EMAIL";
|
|
8289
|
+
}
|
|
8290
|
+
switch (type.toLowerCase()) {
|
|
8291
|
+
case "email":
|
|
8292
|
+
return "EMAIL";
|
|
8293
|
+
case "password":
|
|
8294
|
+
return "PASSWORD";
|
|
8295
|
+
default:
|
|
8296
|
+
return "TEXT";
|
|
8297
|
+
}
|
|
8298
|
+
};
|
|
8299
|
+
var getInputLabel2 = (name, type, t) => {
|
|
8300
|
+
const i18nKey = `elements.fields.${name}`;
|
|
8301
|
+
const label = t(i18nKey);
|
|
8302
|
+
if (label === i18nKey || !label) {
|
|
8303
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
8304
|
+
}
|
|
8305
|
+
return label;
|
|
8306
|
+
};
|
|
8307
|
+
var getInputPlaceholder2 = (name, type, t) => {
|
|
8308
|
+
const label = getInputLabel2(name, type, t);
|
|
8309
|
+
const placeholder = t("elements.fields.placeholder", { field: label });
|
|
8310
|
+
if (!placeholder || placeholder === "elements.fields.placeholder") {
|
|
8311
|
+
return `Enter your ${label}`;
|
|
8312
|
+
}
|
|
8313
|
+
return placeholder;
|
|
8314
|
+
};
|
|
8315
|
+
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8316
|
+
const variant = getInputVariant2(input.type, input.name);
|
|
8317
|
+
const label = getInputLabel2(input.name, input.type, t);
|
|
8318
|
+
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
8319
|
+
return {
|
|
8320
|
+
id: generateId2("input"),
|
|
8321
|
+
type: import_browser59.EmbeddedFlowComponentType.Input,
|
|
8322
|
+
variant,
|
|
8323
|
+
config: {
|
|
8324
|
+
type: input.type,
|
|
8325
|
+
label,
|
|
8326
|
+
placeholder,
|
|
8327
|
+
required: input.required,
|
|
8328
|
+
identifier: input.name,
|
|
8329
|
+
hint: ""
|
|
8330
|
+
},
|
|
8331
|
+
components: []
|
|
8332
|
+
};
|
|
8333
|
+
};
|
|
8334
|
+
var convertActionToComponent2 = (action, t) => {
|
|
8335
|
+
const i18nKey = `elements.buttons.${action.id}`;
|
|
8336
|
+
let text = t(i18nKey);
|
|
8337
|
+
if (!text || text === i18nKey) {
|
|
8338
|
+
text = action.id.replace(/_/g, " ");
|
|
8339
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
8340
|
+
}
|
|
8341
|
+
return {
|
|
8342
|
+
id: generateId2("action"),
|
|
8343
|
+
type: import_browser59.EmbeddedFlowComponentType.Button,
|
|
8344
|
+
variant: "SECONDARY",
|
|
8345
|
+
config: {
|
|
8346
|
+
type: "button",
|
|
8347
|
+
text,
|
|
8348
|
+
actionId: action.id,
|
|
8349
|
+
actionType: action.type
|
|
8350
|
+
},
|
|
8351
|
+
components: []
|
|
8352
|
+
};
|
|
8353
|
+
};
|
|
8354
|
+
var transformSimpleToComponentDriven2 = (response, t) => {
|
|
8355
|
+
const inputComponents = response?.data?.inputs?.map((input) => convertSimpleInputToComponent2(input, t)) || [];
|
|
8356
|
+
const actionComponents = response?.data?.actions?.map((action) => convertActionToComponent2(action, t)) || [];
|
|
8357
|
+
const submitButton = inputComponents.length > 0 ? {
|
|
8358
|
+
id: generateId2("button"),
|
|
8359
|
+
type: import_browser59.EmbeddedFlowComponentType.Button,
|
|
8360
|
+
variant: "PRIMARY",
|
|
8361
|
+
config: {
|
|
8362
|
+
type: "submit",
|
|
8363
|
+
text: t("elements.buttons.signUp")
|
|
8364
|
+
},
|
|
8365
|
+
components: []
|
|
8366
|
+
} : null;
|
|
8367
|
+
const formComponents = [];
|
|
8368
|
+
if (inputComponents.length > 0) {
|
|
8369
|
+
formComponents.push(...inputComponents);
|
|
8370
|
+
if (submitButton) formComponents.push(submitButton);
|
|
8371
|
+
}
|
|
8372
|
+
const result = [];
|
|
8373
|
+
if (formComponents.length > 0) {
|
|
8374
|
+
result.push({
|
|
8375
|
+
id: generateId2("form"),
|
|
8376
|
+
type: import_browser59.EmbeddedFlowComponentType.Form,
|
|
8377
|
+
config: {},
|
|
8378
|
+
components: formComponents
|
|
8379
|
+
});
|
|
8380
|
+
}
|
|
8381
|
+
if (actionComponents.length > 0) {
|
|
8382
|
+
result.push(...actionComponents);
|
|
8383
|
+
}
|
|
8384
|
+
return result;
|
|
8385
|
+
};
|
|
8386
|
+
var extractErrorMessage = (error, t) => {
|
|
8387
|
+
let errorMessage = t("errors.sign.up.flow.failure");
|
|
8388
|
+
if (error && typeof error === "object") {
|
|
8389
|
+
if (error.flowStatus === "ERROR" && error.failureReason) {
|
|
8390
|
+
errorMessage = error.failureReason;
|
|
8391
|
+
} else if (error.code && (error.message || error.description)) {
|
|
8392
|
+
errorMessage = error.description || error.message;
|
|
8393
|
+
} else if (error instanceof Error && error.name === "AsgardeoAPIError") {
|
|
8394
|
+
try {
|
|
8395
|
+
const errorResponse = JSON.parse(
|
|
8396
|
+
error.message
|
|
8397
|
+
);
|
|
8398
|
+
if (errorResponse.failureReason) {
|
|
8399
|
+
errorMessage = errorResponse.failureReason;
|
|
8400
|
+
} else if (errorResponse.description) {
|
|
8401
|
+
errorMessage = errorResponse.description;
|
|
8402
|
+
} else if (errorResponse.message) {
|
|
8403
|
+
errorMessage = errorResponse.message;
|
|
8404
|
+
} else {
|
|
8405
|
+
errorMessage = error.message;
|
|
8406
|
+
}
|
|
8407
|
+
} catch {
|
|
8408
|
+
errorMessage = error.message;
|
|
8409
|
+
}
|
|
8410
|
+
} else if (error.message) {
|
|
8411
|
+
errorMessage = error.message;
|
|
8412
|
+
}
|
|
8413
|
+
} else if (typeof error === "string") {
|
|
8414
|
+
errorMessage = error;
|
|
8415
|
+
}
|
|
8416
|
+
return errorMessage;
|
|
8417
|
+
};
|
|
8418
|
+
|
|
8231
8419
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8232
8420
|
var import_css38 = require("@emotion/css");
|
|
8233
8421
|
var import_react61 = require("react");
|
|
@@ -8370,13 +8558,13 @@ var useStyles18 = (theme, colorScheme) => {
|
|
|
8370
8558
|
var BaseSignUp_styles_default = useStyles18;
|
|
8371
8559
|
|
|
8372
8560
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
8373
|
-
var
|
|
8561
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
8374
8562
|
var BaseSignUp = (props) => {
|
|
8375
8563
|
const { theme, colorScheme } = useTheme_default();
|
|
8376
8564
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8377
|
-
return /* @__PURE__ */ (0,
|
|
8378
|
-
/* @__PURE__ */ (0,
|
|
8379
|
-
/* @__PURE__ */ (0,
|
|
8565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8566
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Logo_default, { size: "large" }) }),
|
|
8567
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(BaseSignUpContent, { ...props }) })
|
|
8380
8568
|
] });
|
|
8381
8569
|
};
|
|
8382
8570
|
var BaseSignUpContent = ({
|
|
@@ -8393,24 +8581,54 @@ var BaseSignUpContent = ({
|
|
|
8393
8581
|
messageClassName = "",
|
|
8394
8582
|
size = "medium",
|
|
8395
8583
|
variant = "outlined",
|
|
8396
|
-
isInitialized
|
|
8584
|
+
isInitialized,
|
|
8585
|
+
children
|
|
8397
8586
|
}) => {
|
|
8398
8587
|
const { theme, colorScheme } = useTheme_default();
|
|
8399
8588
|
const { t } = useTranslation_default();
|
|
8400
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages } = useFlow_default();
|
|
8589
|
+
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
8401
8590
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8591
|
+
const handleError = (0, import_react62.useCallback)(
|
|
8592
|
+
(error) => {
|
|
8593
|
+
const errorMessage = extractErrorMessage(error, t);
|
|
8594
|
+
clearMessages();
|
|
8595
|
+
addMessage({
|
|
8596
|
+
type: "error",
|
|
8597
|
+
message: errorMessage
|
|
8598
|
+
});
|
|
8599
|
+
},
|
|
8600
|
+
[t, addMessage, clearMessages]
|
|
8601
|
+
);
|
|
8402
8602
|
const [isLoading, setIsLoading] = (0, import_react62.useState)(false);
|
|
8403
8603
|
const [isFlowInitialized, setIsFlowInitialized] = (0, import_react62.useState)(false);
|
|
8404
8604
|
const [currentFlow, setCurrentFlow] = (0, import_react62.useState)(null);
|
|
8405
|
-
const [error, setError] = (0, import_react62.useState)(null);
|
|
8406
8605
|
const [formData, setFormData] = (0, import_react62.useState)({});
|
|
8407
8606
|
const initializationAttemptedRef = (0, import_react62.useRef)(false);
|
|
8607
|
+
const normalizeFlowResponse2 = (0, import_react62.useCallback)(
|
|
8608
|
+
(response) => {
|
|
8609
|
+
if (response?.data?.components && Array.isArray(response.data.components)) {
|
|
8610
|
+
return response;
|
|
8611
|
+
}
|
|
8612
|
+
if (response?.data && (response.data.inputs || response.data.actions)) {
|
|
8613
|
+
const transformedComponents = transformSimpleToComponentDriven2(response, t);
|
|
8614
|
+
return {
|
|
8615
|
+
...response,
|
|
8616
|
+
data: {
|
|
8617
|
+
...response.data,
|
|
8618
|
+
components: transformedComponents
|
|
8619
|
+
}
|
|
8620
|
+
};
|
|
8621
|
+
}
|
|
8622
|
+
return response;
|
|
8623
|
+
},
|
|
8624
|
+
[t]
|
|
8625
|
+
);
|
|
8408
8626
|
const extractFormFields = (0, import_react62.useCallback)(
|
|
8409
8627
|
(components) => {
|
|
8410
8628
|
const fields = [];
|
|
8411
8629
|
const processComponents = (comps) => {
|
|
8412
8630
|
comps.forEach((component) => {
|
|
8413
|
-
if (component.type ===
|
|
8631
|
+
if (component.type === import_browser60.EmbeddedFlowComponentType.Input) {
|
|
8414
8632
|
const config = component.config || {};
|
|
8415
8633
|
fields.push({
|
|
8416
8634
|
name: config.name || component.id,
|
|
@@ -8484,7 +8702,7 @@ var BaseSignUpContent = ({
|
|
|
8484
8702
|
return;
|
|
8485
8703
|
}
|
|
8486
8704
|
setIsLoading(true);
|
|
8487
|
-
|
|
8705
|
+
clearMessages();
|
|
8488
8706
|
try {
|
|
8489
8707
|
const filteredInputs = {};
|
|
8490
8708
|
if (data) {
|
|
@@ -8500,13 +8718,14 @@ var BaseSignUpContent = ({
|
|
|
8500
8718
|
inputs: filteredInputs,
|
|
8501
8719
|
actionId: component.id
|
|
8502
8720
|
};
|
|
8503
|
-
const
|
|
8721
|
+
const rawResponse = await onSubmit(payload);
|
|
8722
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8504
8723
|
onFlowChange?.(response);
|
|
8505
|
-
if (response.flowStatus ===
|
|
8724
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
8506
8725
|
onComplete?.(response);
|
|
8507
8726
|
return;
|
|
8508
8727
|
}
|
|
8509
|
-
if (response.flowStatus ===
|
|
8728
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
8510
8729
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8511
8730
|
return;
|
|
8512
8731
|
}
|
|
@@ -8514,15 +8733,14 @@ var BaseSignUpContent = ({
|
|
|
8514
8733
|
setupFormFields(response);
|
|
8515
8734
|
}
|
|
8516
8735
|
} catch (err) {
|
|
8517
|
-
|
|
8518
|
-
setError(errorMessage);
|
|
8736
|
+
handleError(err);
|
|
8519
8737
|
onError?.(err);
|
|
8520
8738
|
} finally {
|
|
8521
8739
|
setIsLoading(false);
|
|
8522
8740
|
}
|
|
8523
8741
|
};
|
|
8524
8742
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8525
|
-
if (response?.type ===
|
|
8743
|
+
if (response?.type === import_browser60.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8526
8744
|
const redirectUrl = response.data.redirectURL;
|
|
8527
8745
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8528
8746
|
if (!popup) {
|
|
@@ -8551,17 +8769,16 @@ var BaseSignUpContent = ({
|
|
|
8551
8769
|
try {
|
|
8552
8770
|
const continueResponse = await onSubmit(payload);
|
|
8553
8771
|
onFlowChange?.(continueResponse);
|
|
8554
|
-
if (continueResponse.flowStatus ===
|
|
8772
|
+
if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
8555
8773
|
onComplete?.(continueResponse);
|
|
8556
|
-
} else if (continueResponse.flowStatus ===
|
|
8774
|
+
} else if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
8557
8775
|
setCurrentFlow(continueResponse);
|
|
8558
8776
|
setupFormFields(continueResponse);
|
|
8559
8777
|
}
|
|
8560
8778
|
popup.close();
|
|
8561
8779
|
cleanup();
|
|
8562
8780
|
} catch (err) {
|
|
8563
|
-
|
|
8564
|
-
setError(errorMessage);
|
|
8781
|
+
handleError(err);
|
|
8565
8782
|
onError?.(err);
|
|
8566
8783
|
popup.close();
|
|
8567
8784
|
cleanup();
|
|
@@ -8592,9 +8809,9 @@ var BaseSignUpContent = ({
|
|
|
8592
8809
|
const url = new URL(popupUrl);
|
|
8593
8810
|
const code = url.searchParams.get("code");
|
|
8594
8811
|
const state = url.searchParams.get("state");
|
|
8595
|
-
const
|
|
8596
|
-
if (
|
|
8597
|
-
console.error("OAuth error:",
|
|
8812
|
+
const error = url.searchParams.get("error");
|
|
8813
|
+
if (error) {
|
|
8814
|
+
console.error("OAuth error:", error);
|
|
8598
8815
|
popup.close();
|
|
8599
8816
|
cleanup();
|
|
8600
8817
|
return;
|
|
@@ -8612,16 +8829,15 @@ var BaseSignUpContent = ({
|
|
|
8612
8829
|
try {
|
|
8613
8830
|
const continueResponse = await onSubmit(payload);
|
|
8614
8831
|
onFlowChange?.(continueResponse);
|
|
8615
|
-
if (continueResponse.flowStatus ===
|
|
8832
|
+
if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
8616
8833
|
onComplete?.(continueResponse);
|
|
8617
|
-
} else if (continueResponse.flowStatus ===
|
|
8834
|
+
} else if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
8618
8835
|
setCurrentFlow(continueResponse);
|
|
8619
8836
|
setupFormFields(continueResponse);
|
|
8620
8837
|
}
|
|
8621
8838
|
popup.close();
|
|
8622
8839
|
} catch (err) {
|
|
8623
|
-
|
|
8624
|
-
setError(errorMessage);
|
|
8840
|
+
handleError(err);
|
|
8625
8841
|
onError?.(err);
|
|
8626
8842
|
popup.close();
|
|
8627
8843
|
}
|
|
@@ -8639,30 +8855,30 @@ var BaseSignUpContent = ({
|
|
|
8639
8855
|
};
|
|
8640
8856
|
const containerClasses = (0, import_css39.cx)(
|
|
8641
8857
|
[
|
|
8642
|
-
(0,
|
|
8643
|
-
(0,
|
|
8644
|
-
(0,
|
|
8858
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup"),
|
|
8859
|
+
(0, import_browser60.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
8860
|
+
(0, import_browser60.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
8645
8861
|
],
|
|
8646
8862
|
className
|
|
8647
8863
|
);
|
|
8648
8864
|
const inputClasses = (0, import_css39.cx)(
|
|
8649
8865
|
[
|
|
8650
|
-
(0,
|
|
8651
|
-
size === "small" && (0,
|
|
8652
|
-
size === "large" && (0,
|
|
8866
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup__input"),
|
|
8867
|
+
size === "small" && (0, import_browser60.withVendorCSSClassPrefix)("signup__input--small"),
|
|
8868
|
+
size === "large" && (0, import_browser60.withVendorCSSClassPrefix)("signup__input--large")
|
|
8653
8869
|
],
|
|
8654
8870
|
inputClassName
|
|
8655
8871
|
);
|
|
8656
8872
|
const buttonClasses = (0, import_css39.cx)(
|
|
8657
8873
|
[
|
|
8658
|
-
(0,
|
|
8659
|
-
size === "small" && (0,
|
|
8660
|
-
size === "large" && (0,
|
|
8874
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup__button"),
|
|
8875
|
+
size === "small" && (0, import_browser60.withVendorCSSClassPrefix)("signup__button--small"),
|
|
8876
|
+
size === "large" && (0, import_browser60.withVendorCSSClassPrefix)("signup__button--large")
|
|
8661
8877
|
],
|
|
8662
8878
|
buttonClassName
|
|
8663
8879
|
);
|
|
8664
|
-
const errorClasses = (0, import_css39.cx)([(0,
|
|
8665
|
-
const messageClasses = (0, import_css39.cx)([(0,
|
|
8880
|
+
const errorClasses = (0, import_css39.cx)([(0, import_browser60.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
8881
|
+
const messageClasses = (0, import_css39.cx)([(0, import_browser60.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
8666
8882
|
const renderComponents = (0, import_react62.useCallback)(
|
|
8667
8883
|
(components) => renderSignUpComponents(
|
|
8668
8884
|
components,
|
|
@@ -8674,7 +8890,6 @@ var BaseSignUpContent = ({
|
|
|
8674
8890
|
handleInputChange,
|
|
8675
8891
|
{
|
|
8676
8892
|
buttonClassName: buttonClasses,
|
|
8677
|
-
error,
|
|
8678
8893
|
inputClassName: inputClasses,
|
|
8679
8894
|
onSubmit: handleSubmit,
|
|
8680
8895
|
size,
|
|
@@ -8689,7 +8904,6 @@ var BaseSignUpContent = ({
|
|
|
8689
8904
|
isLoading,
|
|
8690
8905
|
size,
|
|
8691
8906
|
variant,
|
|
8692
|
-
error,
|
|
8693
8907
|
inputClasses,
|
|
8694
8908
|
buttonClasses,
|
|
8695
8909
|
handleSubmit
|
|
@@ -8700,22 +8914,22 @@ var BaseSignUpContent = ({
|
|
|
8700
8914
|
initializationAttemptedRef.current = true;
|
|
8701
8915
|
(async () => {
|
|
8702
8916
|
setIsLoading(true);
|
|
8703
|
-
|
|
8917
|
+
clearMessages();
|
|
8704
8918
|
try {
|
|
8705
|
-
const
|
|
8919
|
+
const rawResponse = await onInitialize();
|
|
8920
|
+
const response = normalizeFlowResponse2(rawResponse);
|
|
8706
8921
|
setCurrentFlow(response);
|
|
8707
8922
|
setIsFlowInitialized(true);
|
|
8708
8923
|
onFlowChange?.(response);
|
|
8709
|
-
if (response.flowStatus ===
|
|
8924
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
8710
8925
|
onComplete?.(response);
|
|
8711
8926
|
return;
|
|
8712
8927
|
}
|
|
8713
|
-
if (response.flowStatus ===
|
|
8928
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
8714
8929
|
setupFormFields(response);
|
|
8715
8930
|
}
|
|
8716
8931
|
} catch (err) {
|
|
8717
|
-
|
|
8718
|
-
setError(errorMessage);
|
|
8932
|
+
handleError(err);
|
|
8719
8933
|
onError?.(err);
|
|
8720
8934
|
} finally {
|
|
8721
8935
|
setIsLoading(false);
|
|
@@ -8730,42 +8944,58 @@ var BaseSignUpContent = ({
|
|
|
8730
8944
|
onError,
|
|
8731
8945
|
onFlowChange,
|
|
8732
8946
|
setupFormFields,
|
|
8947
|
+
normalizeFlowResponse2,
|
|
8733
8948
|
afterSignUpUrl,
|
|
8734
8949
|
t
|
|
8735
8950
|
]);
|
|
8951
|
+
if (children) {
|
|
8952
|
+
const renderProps = {
|
|
8953
|
+
values: formValues,
|
|
8954
|
+
errors: formErrors,
|
|
8955
|
+
touched: touchedFields,
|
|
8956
|
+
isValid: isFormValid,
|
|
8957
|
+
isLoading,
|
|
8958
|
+
components: currentFlow?.data?.components || [],
|
|
8959
|
+
handleInputChange,
|
|
8960
|
+
handleSubmit,
|
|
8961
|
+
validateForm,
|
|
8962
|
+
title: flowTitle || t("signup.title"),
|
|
8963
|
+
subtitle: flowSubtitle || t("signup.subtitle"),
|
|
8964
|
+
messages: flowMessages || []
|
|
8965
|
+
};
|
|
8966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: containerClasses, children: children(renderProps) });
|
|
8967
|
+
}
|
|
8736
8968
|
if (!isFlowInitialized && isLoading) {
|
|
8737
|
-
return /* @__PURE__ */ (0,
|
|
8969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.loadingContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
8738
8970
|
}
|
|
8739
8971
|
if (!currentFlow) {
|
|
8740
|
-
return /* @__PURE__ */ (0,
|
|
8741
|
-
/* @__PURE__ */ (0,
|
|
8742
|
-
/* @__PURE__ */ (0,
|
|
8972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
8973
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Title, { children: t("errors.title") }),
|
|
8974
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: t("errors.sign.up.flow.initialization.failure") })
|
|
8743
8975
|
] }) }) });
|
|
8744
8976
|
}
|
|
8745
|
-
return /* @__PURE__ */ (0,
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
{
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: styles.contentContainer, children: currentFlow.data?.components && renderComponents(currentFlow.data.components) })
|
|
8761
|
-
] })
|
|
8977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: [
|
|
8978
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
8979
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.title") }),
|
|
8980
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subtitle") }),
|
|
8981
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8982
|
+
Alert_default,
|
|
8983
|
+
{
|
|
8984
|
+
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
8985
|
+
className: (0, import_css39.cx)(styles.flowMessageItem, messageClasses),
|
|
8986
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: message.message })
|
|
8987
|
+
},
|
|
8988
|
+
message.id || index
|
|
8989
|
+
)) })
|
|
8990
|
+
] }),
|
|
8991
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Typography_default, { variant: "body1", children: t("errors.sign.up.components.not.available") }) }) }) })
|
|
8762
8992
|
] });
|
|
8763
8993
|
};
|
|
8764
8994
|
var BaseSignUp_default = BaseSignUp;
|
|
8765
8995
|
|
|
8766
8996
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8767
|
-
var
|
|
8768
|
-
var
|
|
8997
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
8998
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8769
8999
|
var SignUp = ({
|
|
8770
9000
|
className,
|
|
8771
9001
|
size = "medium",
|
|
@@ -8773,26 +9003,29 @@ var SignUp = ({
|
|
|
8773
9003
|
onError,
|
|
8774
9004
|
onComplete,
|
|
8775
9005
|
shouldRedirectAfterSignUp = true,
|
|
9006
|
+
children,
|
|
8776
9007
|
...rest
|
|
8777
9008
|
}) => {
|
|
8778
|
-
const { signUp, isInitialized } = useAsgardeo_default();
|
|
8779
|
-
const handleInitialize = async (payload) =>
|
|
8780
|
-
payload || {
|
|
8781
|
-
flowType:
|
|
8782
|
-
|
|
8783
|
-
|
|
9009
|
+
const { signUp, isInitialized, applicationId, platform } = useAsgardeo_default();
|
|
9010
|
+
const handleInitialize = async (payload) => {
|
|
9011
|
+
const initialPayload = payload || {
|
|
9012
|
+
flowType: import_browser61.EmbeddedFlowType.Registration,
|
|
9013
|
+
...platform === import_browser61.Platform.AsgardeoV2 && applicationId && { applicationId }
|
|
9014
|
+
};
|
|
9015
|
+
return await signUp(initialPayload);
|
|
9016
|
+
};
|
|
8784
9017
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8785
9018
|
const handleComplete = (response) => {
|
|
8786
9019
|
onComplete?.(response);
|
|
8787
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
9020
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser61.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
8788
9021
|
window.location.href = afterSignUpUrl;
|
|
8789
9022
|
}
|
|
8790
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
9023
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser61.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
8791
9024
|
!response.data.redirectURL.includes("auth")) {
|
|
8792
9025
|
window.location.href = response.data.redirectURL;
|
|
8793
9026
|
}
|
|
8794
9027
|
};
|
|
8795
|
-
return /* @__PURE__ */ (0,
|
|
9028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
8796
9029
|
BaseSignUp_default,
|
|
8797
9030
|
{
|
|
8798
9031
|
afterSignUpUrl,
|
|
@@ -8803,6 +9036,7 @@ var SignUp = ({
|
|
|
8803
9036
|
className,
|
|
8804
9037
|
size,
|
|
8805
9038
|
isInitialized,
|
|
9039
|
+
children,
|
|
8806
9040
|
...rest
|
|
8807
9041
|
}
|
|
8808
9042
|
);
|
|
@@ -8810,75 +9044,75 @@ var SignUp = ({
|
|
|
8810
9044
|
var SignUp_default = SignUp;
|
|
8811
9045
|
|
|
8812
9046
|
// src/components/presentation/User/BaseUser.tsx
|
|
8813
|
-
var
|
|
9047
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
8814
9048
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
8815
9049
|
if (!user) {
|
|
8816
|
-
return /* @__PURE__ */ (0,
|
|
9050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: fallback });
|
|
8817
9051
|
}
|
|
8818
|
-
return /* @__PURE__ */ (0,
|
|
9052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: children(user) });
|
|
8819
9053
|
};
|
|
8820
9054
|
BaseUser.displayName = "BaseUser";
|
|
8821
9055
|
var BaseUser_default = BaseUser;
|
|
8822
9056
|
|
|
8823
9057
|
// src/components/presentation/User/User.tsx
|
|
8824
|
-
var
|
|
9058
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
8825
9059
|
var User5 = ({ children, fallback = null }) => {
|
|
8826
9060
|
const { user } = useAsgardeo_default();
|
|
8827
|
-
return /* @__PURE__ */ (0,
|
|
9061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(BaseUser_default, { user, fallback, children });
|
|
8828
9062
|
};
|
|
8829
9063
|
User5.displayName = "User";
|
|
8830
9064
|
var User_default = User5;
|
|
8831
9065
|
|
|
8832
9066
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
8833
|
-
var
|
|
9067
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
8834
9068
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
8835
9069
|
if (!organization) {
|
|
8836
|
-
return /* @__PURE__ */ (0,
|
|
9070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: fallback });
|
|
8837
9071
|
}
|
|
8838
|
-
return /* @__PURE__ */ (0,
|
|
9072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: children(organization) });
|
|
8839
9073
|
};
|
|
8840
9074
|
BaseOrganization.displayName = "BaseOrganization";
|
|
8841
9075
|
var BaseOrganization_default = BaseOrganization;
|
|
8842
9076
|
|
|
8843
9077
|
// src/components/presentation/Organization/Organization.tsx
|
|
8844
|
-
var
|
|
9078
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
8845
9079
|
var Organization5 = ({ children, fallback = null }) => {
|
|
8846
9080
|
const { currentOrganization } = useOrganization_default();
|
|
8847
|
-
return /* @__PURE__ */ (0,
|
|
9081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
8848
9082
|
};
|
|
8849
9083
|
Organization5.displayName = "Organization";
|
|
8850
9084
|
var Organization_default = Organization5;
|
|
8851
9085
|
|
|
8852
9086
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8853
|
-
var
|
|
9087
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
8854
9088
|
var import_css47 = require("@emotion/css");
|
|
8855
9089
|
var import_react71 = require("react");
|
|
8856
9090
|
|
|
8857
9091
|
// src/utils/getMappedUserProfileValue.ts
|
|
8858
|
-
var
|
|
9092
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
8859
9093
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8860
9094
|
if (!key || !mappings || !user) {
|
|
8861
9095
|
return void 0;
|
|
8862
9096
|
}
|
|
8863
9097
|
const mapping = mappings[key];
|
|
8864
9098
|
if (!mapping) {
|
|
8865
|
-
return (0,
|
|
9099
|
+
return (0, import_browser62.get)(user, key);
|
|
8866
9100
|
}
|
|
8867
9101
|
if (Array.isArray(mapping)) {
|
|
8868
9102
|
for (const path of mapping) {
|
|
8869
|
-
const value = (0,
|
|
9103
|
+
const value = (0, import_browser62.get)(user, path);
|
|
8870
9104
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8871
9105
|
return value;
|
|
8872
9106
|
}
|
|
8873
9107
|
}
|
|
8874
9108
|
return void 0;
|
|
8875
9109
|
}
|
|
8876
|
-
return (0,
|
|
9110
|
+
return (0, import_browser62.get)(user, mapping);
|
|
8877
9111
|
};
|
|
8878
9112
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8879
9113
|
|
|
8880
9114
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8881
|
-
var
|
|
9115
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
8882
9116
|
var import_css41 = require("@emotion/css");
|
|
8883
9117
|
var import_react64 = require("react");
|
|
8884
9118
|
|
|
@@ -8950,7 +9184,7 @@ var useStyles19 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
8950
9184
|
var Avatar_styles_default = useStyles19;
|
|
8951
9185
|
|
|
8952
9186
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8953
|
-
var
|
|
9187
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
8954
9188
|
var Avatar = ({
|
|
8955
9189
|
alt = "User avatar",
|
|
8956
9190
|
background = "random",
|
|
@@ -8997,33 +9231,33 @@ var Avatar = ({
|
|
|
8997
9231
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
8998
9232
|
const renderContent = () => {
|
|
8999
9233
|
if (imageUrl) {
|
|
9000
|
-
return /* @__PURE__ */ (0,
|
|
9234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: imageUrl, alt, className: (0, import_css41.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar", "image")), styles.image) });
|
|
9001
9235
|
}
|
|
9002
9236
|
if (name) {
|
|
9003
9237
|
return getInitials(name);
|
|
9004
9238
|
}
|
|
9005
9239
|
if (isLoading) {
|
|
9006
|
-
return /* @__PURE__ */ (0,
|
|
9240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: (0, import_css41.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
9007
9241
|
}
|
|
9008
|
-
return /* @__PURE__ */ (0,
|
|
9242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
9009
9243
|
"svg",
|
|
9010
9244
|
{
|
|
9011
9245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9012
9246
|
viewBox: "0 0 640 640",
|
|
9013
|
-
className: (0, import_css41.cx)((0,
|
|
9014
|
-
children: /* @__PURE__ */ (0,
|
|
9247
|
+
className: (0, import_css41.cx)((0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar", "icon")), styles.icon),
|
|
9248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.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
9249
|
}
|
|
9016
9250
|
);
|
|
9017
9251
|
};
|
|
9018
|
-
return /* @__PURE__ */ (0,
|
|
9252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
9019
9253
|
"div",
|
|
9020
9254
|
{
|
|
9021
9255
|
className: (0, import_css41.cx)(
|
|
9022
|
-
(0,
|
|
9256
|
+
(0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar")),
|
|
9023
9257
|
styles.avatar,
|
|
9024
9258
|
styles.variant,
|
|
9025
|
-
(0,
|
|
9026
|
-
isDefaultState && (0,
|
|
9259
|
+
(0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar", null, variant)),
|
|
9260
|
+
isDefaultState && (0, import_browser63.withVendorCSSClassPrefix)((0, import_browser63.bem)("avatar", "default")),
|
|
9027
9261
|
className
|
|
9028
9262
|
),
|
|
9029
9263
|
children: renderContent()
|
|
@@ -9033,14 +9267,14 @@ var Avatar = ({
|
|
|
9033
9267
|
var Avatar_default = Avatar;
|
|
9034
9268
|
|
|
9035
9269
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9036
|
-
var
|
|
9270
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
9037
9271
|
var import_react66 = require("@floating-ui/react");
|
|
9038
9272
|
var import_css43 = require("@emotion/css");
|
|
9039
9273
|
var import_react67 = __toESM(require("react"), 1);
|
|
9040
9274
|
|
|
9041
9275
|
// src/components/primitives/Icons/LogOut.tsx
|
|
9042
|
-
var
|
|
9043
|
-
var LogOut = (props) => /* @__PURE__ */ (0,
|
|
9276
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
9277
|
+
var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
9044
9278
|
"svg",
|
|
9045
9279
|
{
|
|
9046
9280
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9054,17 +9288,17 @@ var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
|
9054
9288
|
strokeLinejoin: "round",
|
|
9055
9289
|
...props,
|
|
9056
9290
|
children: [
|
|
9057
|
-
/* @__PURE__ */ (0,
|
|
9058
|
-
/* @__PURE__ */ (0,
|
|
9059
|
-
/* @__PURE__ */ (0,
|
|
9291
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { d: "m16 17 5-5-5-5" }),
|
|
9292
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { d: "M21 12H9" }),
|
|
9293
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
9060
9294
|
]
|
|
9061
9295
|
}
|
|
9062
9296
|
);
|
|
9063
9297
|
var LogOut_default = LogOut;
|
|
9064
9298
|
|
|
9065
9299
|
// src/components/primitives/Icons/Plus.tsx
|
|
9066
|
-
var
|
|
9067
|
-
var Plus = (props) => /* @__PURE__ */ (0,
|
|
9300
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
9301
|
+
var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
9068
9302
|
"svg",
|
|
9069
9303
|
{
|
|
9070
9304
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9078,16 +9312,16 @@ var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
|
9078
9312
|
strokeLinejoin: "round",
|
|
9079
9313
|
...props,
|
|
9080
9314
|
children: [
|
|
9081
|
-
/* @__PURE__ */ (0,
|
|
9082
|
-
/* @__PURE__ */ (0,
|
|
9315
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M5 12h14" }),
|
|
9316
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M12 5v14" })
|
|
9083
9317
|
]
|
|
9084
9318
|
}
|
|
9085
9319
|
);
|
|
9086
9320
|
var Plus_default = Plus;
|
|
9087
9321
|
|
|
9088
9322
|
// src/components/primitives/Icons/User.tsx
|
|
9089
|
-
var
|
|
9090
|
-
var User7 = (props) => /* @__PURE__ */ (0,
|
|
9323
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
9324
|
+
var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
9091
9325
|
"svg",
|
|
9092
9326
|
{
|
|
9093
9327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9101,16 +9335,16 @@ var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
|
9101
9335
|
strokeLinejoin: "round",
|
|
9102
9336
|
...props,
|
|
9103
9337
|
children: [
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9105
|
-
/* @__PURE__ */ (0,
|
|
9338
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
9339
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("circle", { cx: "12", cy: "7", r: "4" })
|
|
9106
9340
|
]
|
|
9107
9341
|
}
|
|
9108
9342
|
);
|
|
9109
9343
|
var User_default2 = User7;
|
|
9110
9344
|
|
|
9111
9345
|
// src/components/primitives/Icons/X.tsx
|
|
9112
|
-
var
|
|
9113
|
-
var X = (props) => /* @__PURE__ */ (0,
|
|
9346
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
9347
|
+
var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
9114
9348
|
"svg",
|
|
9115
9349
|
{
|
|
9116
9350
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9124,8 +9358,8 @@ var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
|
9124
9358
|
strokeLinejoin: "round",
|
|
9125
9359
|
...props,
|
|
9126
9360
|
children: [
|
|
9127
|
-
/* @__PURE__ */ (0,
|
|
9128
|
-
/* @__PURE__ */ (0,
|
|
9361
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { d: "M18 6 6 18" }),
|
|
9362
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { d: "m6 6 12 12" })
|
|
9129
9363
|
]
|
|
9130
9364
|
}
|
|
9131
9365
|
);
|
|
@@ -9197,7 +9431,7 @@ var useStyles20 = (theme, colorScheme) => {
|
|
|
9197
9431
|
var Dialog_styles_default = useStyles20;
|
|
9198
9432
|
|
|
9199
9433
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9200
|
-
var
|
|
9434
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
9201
9435
|
function useDialog({
|
|
9202
9436
|
initialOpen = false,
|
|
9203
9437
|
open: controlledOpen,
|
|
@@ -9243,7 +9477,7 @@ var useDialogContext = () => {
|
|
|
9243
9477
|
};
|
|
9244
9478
|
function Dialog({ children, ...options }) {
|
|
9245
9479
|
const dialog = useDialog(options);
|
|
9246
|
-
return /* @__PURE__ */ (0,
|
|
9480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DialogContext.Provider, { value: dialog, children });
|
|
9247
9481
|
}
|
|
9248
9482
|
var DialogTrigger = import_react67.default.forwardRef(
|
|
9249
9483
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -9261,7 +9495,7 @@ var DialogTrigger = import_react67.default.forwardRef(
|
|
|
9261
9495
|
})
|
|
9262
9496
|
);
|
|
9263
9497
|
}
|
|
9264
|
-
return /* @__PURE__ */ (0,
|
|
9498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
9265
9499
|
}
|
|
9266
9500
|
);
|
|
9267
9501
|
var DialogContent = import_react67.default.forwardRef((props, propRef) => {
|
|
@@ -9270,11 +9504,11 @@ var DialogContent = import_react67.default.forwardRef((props, propRef) => {
|
|
|
9270
9504
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9271
9505
|
const ref = (0, import_react66.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
9272
9506
|
if (!floatingContext.open) return null;
|
|
9273
|
-
return /* @__PURE__ */ (0,
|
|
9507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react66.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react66.FloatingOverlay, { className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react66.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9274
9508
|
"div",
|
|
9275
9509
|
{
|
|
9276
9510
|
ref,
|
|
9277
|
-
className: (0, import_css43.cx)((0,
|
|
9511
|
+
className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "content")), styles.content, props.className),
|
|
9278
9512
|
"aria-labelledby": context.labelId,
|
|
9279
9513
|
"aria-describedby": context.descriptionId,
|
|
9280
9514
|
...context.getFloatingProps(props),
|
|
@@ -9292,18 +9526,18 @@ var DialogHeading = import_react67.default.forwardRef(
|
|
|
9292
9526
|
context.setLabelId(id);
|
|
9293
9527
|
return () => context.setLabelId(void 0);
|
|
9294
9528
|
}, [id, context.setLabelId]);
|
|
9295
|
-
return /* @__PURE__ */ (0,
|
|
9296
|
-
/* @__PURE__ */ (0,
|
|
9529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "header")), styles.header), children: [
|
|
9530
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9297
9531
|
"h2",
|
|
9298
9532
|
{
|
|
9299
9533
|
...props,
|
|
9300
9534
|
ref,
|
|
9301
9535
|
id,
|
|
9302
|
-
className: (0, import_css43.cx)((0,
|
|
9536
|
+
className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "title")), styles.headerTitle),
|
|
9303
9537
|
children
|
|
9304
9538
|
}
|
|
9305
9539
|
),
|
|
9306
|
-
/* @__PURE__ */ (0,
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9307
9541
|
Button_default,
|
|
9308
9542
|
{
|
|
9309
9543
|
color: "tertiary",
|
|
@@ -9312,7 +9546,7 @@ var DialogHeading = import_react67.default.forwardRef(
|
|
|
9312
9546
|
shape: "round",
|
|
9313
9547
|
onClick: () => context.setOpen(false),
|
|
9314
9548
|
"aria-label": "Close",
|
|
9315
|
-
children: /* @__PURE__ */ (0,
|
|
9549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(X_default, { width: 16, height: 16 })
|
|
9316
9550
|
}
|
|
9317
9551
|
)
|
|
9318
9552
|
] });
|
|
@@ -9328,13 +9562,13 @@ var DialogDescription = import_react67.default.forwardRef(
|
|
|
9328
9562
|
context.setDescriptionId(id);
|
|
9329
9563
|
return () => context.setDescriptionId(void 0);
|
|
9330
9564
|
}, [id, context.setDescriptionId]);
|
|
9331
|
-
return /* @__PURE__ */ (0,
|
|
9565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9332
9566
|
"p",
|
|
9333
9567
|
{
|
|
9334
9568
|
...props,
|
|
9335
9569
|
ref,
|
|
9336
9570
|
id,
|
|
9337
|
-
className: (0, import_css43.cx)((0,
|
|
9571
|
+
className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "description")), styles.description, props.className),
|
|
9338
9572
|
children
|
|
9339
9573
|
}
|
|
9340
9574
|
);
|
|
@@ -9358,13 +9592,13 @@ var DialogClose = import_react67.default.forwardRef(({ children, asChild = false
|
|
|
9358
9592
|
onClick: handleClick
|
|
9359
9593
|
});
|
|
9360
9594
|
}
|
|
9361
|
-
return /* @__PURE__ */ (0,
|
|
9595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9362
9596
|
Button_default,
|
|
9363
9597
|
{
|
|
9364
9598
|
...props,
|
|
9365
9599
|
ref,
|
|
9366
9600
|
onClick: handleClick,
|
|
9367
|
-
className: (0, import_css43.cx)((0,
|
|
9601
|
+
className: (0, import_css43.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("dialog", "close")), props.className),
|
|
9368
9602
|
variant: "text",
|
|
9369
9603
|
children
|
|
9370
9604
|
}
|
|
@@ -9385,7 +9619,7 @@ var Dialog_default = Dialog;
|
|
|
9385
9619
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9386
9620
|
var import_react69 = require("react");
|
|
9387
9621
|
var import_css45 = require("@emotion/css");
|
|
9388
|
-
var
|
|
9622
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9389
9623
|
|
|
9390
9624
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
9391
9625
|
var import_css44 = require("@emotion/css");
|
|
@@ -9481,7 +9715,7 @@ var useStyles21 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
9481
9715
|
var MultiInput_styles_default = useStyles21;
|
|
9482
9716
|
|
|
9483
9717
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9484
|
-
var
|
|
9718
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
9485
9719
|
var MultiInput = ({
|
|
9486
9720
|
label,
|
|
9487
9721
|
error,
|
|
@@ -9504,8 +9738,8 @@ var MultiInput = ({
|
|
|
9504
9738
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
9505
9739
|
const canRemove = values.length > minFields;
|
|
9506
9740
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
9507
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ (0,
|
|
9508
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ (0,
|
|
9741
|
+
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css45.cx)(styles.icon, className2), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M12 5v14M5 12h14" }) });
|
|
9742
|
+
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css45.cx)(styles.icon, className2), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6" }) });
|
|
9509
9743
|
const handleAddValue = (0, import_react69.useCallback)(
|
|
9510
9744
|
(newValue) => {
|
|
9511
9745
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -9549,9 +9783,9 @@ var MultiInput = ({
|
|
|
9549
9783
|
};
|
|
9550
9784
|
switch (fieldType) {
|
|
9551
9785
|
case "DATE_TIME":
|
|
9552
|
-
return /* @__PURE__ */ (0,
|
|
9786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DatePicker_default, { ...commonProps });
|
|
9553
9787
|
case "BOOLEAN":
|
|
9554
|
-
return /* @__PURE__ */ (0,
|
|
9788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9555
9789
|
Checkbox_default,
|
|
9556
9790
|
{
|
|
9557
9791
|
...commonProps,
|
|
@@ -9560,7 +9794,7 @@ var MultiInput = ({
|
|
|
9560
9794
|
}
|
|
9561
9795
|
);
|
|
9562
9796
|
default:
|
|
9563
|
-
return /* @__PURE__ */ (0,
|
|
9797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextField_default, { ...commonProps, type });
|
|
9564
9798
|
}
|
|
9565
9799
|
},
|
|
9566
9800
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -9572,43 +9806,43 @@ var MultiInput = ({
|
|
|
9572
9806
|
setCurrentInputValue("");
|
|
9573
9807
|
}
|
|
9574
9808
|
}, [currentInputValue, handleAddValue]);
|
|
9575
|
-
return /* @__PURE__ */ (0,
|
|
9809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
9576
9810
|
FormControl_default,
|
|
9577
9811
|
{
|
|
9578
9812
|
error,
|
|
9579
9813
|
helperText,
|
|
9580
|
-
className: (0, import_css45.cx)((0,
|
|
9814
|
+
className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input")), className),
|
|
9581
9815
|
style,
|
|
9582
9816
|
children: [
|
|
9583
|
-
label && /* @__PURE__ */ (0,
|
|
9584
|
-
/* @__PURE__ */ (0,
|
|
9585
|
-
/* @__PURE__ */ (0,
|
|
9817
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
9818
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "container")), styles.container), children: [
|
|
9819
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
9586
9820
|
currentInputValue,
|
|
9587
9821
|
setCurrentInputValue,
|
|
9588
|
-
canAddMore ? /* @__PURE__ */ (0,
|
|
9822
|
+
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9589
9823
|
canAddMore ? handleInputSubmit : void 0
|
|
9590
9824
|
) }) }),
|
|
9591
|
-
values.length > 0 && /* @__PURE__ */ (0,
|
|
9825
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
9592
9826
|
"div",
|
|
9593
9827
|
{
|
|
9594
|
-
className: (0, import_css45.cx)((0,
|
|
9828
|
+
className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "list-item")), styles.listItem),
|
|
9595
9829
|
children: [
|
|
9596
|
-
/* @__PURE__ */ (0,
|
|
9830
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9597
9831
|
"span",
|
|
9598
9832
|
{
|
|
9599
|
-
className: (0, import_css45.cx)((0,
|
|
9833
|
+
className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
9600
9834
|
children: value
|
|
9601
9835
|
}
|
|
9602
9836
|
),
|
|
9603
|
-
canRemove && /* @__PURE__ */ (0,
|
|
9837
|
+
canRemove && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9604
9838
|
"button",
|
|
9605
9839
|
{
|
|
9606
9840
|
type: "button",
|
|
9607
9841
|
onClick: () => handleRemoveValue(index),
|
|
9608
9842
|
disabled,
|
|
9609
|
-
className: (0, import_css45.cx)((0,
|
|
9843
|
+
className: (0, import_css45.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
9610
9844
|
title: "Remove value",
|
|
9611
|
-
children: /* @__PURE__ */ (0,
|
|
9845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(BinIcon, { className: styles.icon })
|
|
9612
9846
|
}
|
|
9613
9847
|
)
|
|
9614
9848
|
]
|
|
@@ -9625,7 +9859,7 @@ var MultiInput_default = MultiInput;
|
|
|
9625
9859
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
9626
9860
|
var import_css46 = require("@emotion/css");
|
|
9627
9861
|
var import_react70 = require("react");
|
|
9628
|
-
var
|
|
9862
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
9629
9863
|
var useStyles22 = (theme, colorScheme) => {
|
|
9630
9864
|
const valuePlaceholder = import_css46.css`
|
|
9631
9865
|
font-style: italic;
|
|
@@ -9652,7 +9886,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9652
9886
|
display: flex;
|
|
9653
9887
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
9654
9888
|
align-items: center;
|
|
9655
|
-
margin-
|
|
9889
|
+
margin-inline-start: calc(${theme.vars.spacing.unit} * 4);
|
|
9656
9890
|
`;
|
|
9657
9891
|
const complexTextarea = import_css46.css`
|
|
9658
9892
|
min-height: 60px;
|
|
@@ -9719,7 +9953,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9719
9953
|
width: 120px;
|
|
9720
9954
|
flex-shrink: 0;
|
|
9721
9955
|
line-height: 28px;
|
|
9722
|
-
text-align:
|
|
9956
|
+
text-align: start;
|
|
9723
9957
|
`;
|
|
9724
9958
|
const value = import_css46.css`
|
|
9725
9959
|
color: ${theme.vars.colors.text.primary};
|
|
@@ -9734,9 +9968,9 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9734
9968
|
text-overflow: ellipsis;
|
|
9735
9969
|
white-space: nowrap;
|
|
9736
9970
|
max-width: 350px;
|
|
9737
|
-
text-align:
|
|
9971
|
+
text-align: start;
|
|
9738
9972
|
|
|
9739
|
-
.${(0,
|
|
9973
|
+
.${(0, import_browser66.withVendorCSSClassPrefix)("form-control")} {
|
|
9740
9974
|
margin-bottom: 0;
|
|
9741
9975
|
}
|
|
9742
9976
|
|
|
@@ -9807,7 +10041,7 @@ var getDisplayName = (mergedMappings, user) => {
|
|
|
9807
10041
|
var getDisplayName_default = getDisplayName;
|
|
9808
10042
|
|
|
9809
10043
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
9810
|
-
var
|
|
10044
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
9811
10045
|
var fieldsToSkip = [
|
|
9812
10046
|
"roles.default",
|
|
9813
10047
|
"active",
|
|
@@ -9867,7 +10101,7 @@ var BaseUserProfile = ({
|
|
|
9867
10101
|
},
|
|
9868
10102
|
[showFields, hideFields]
|
|
9869
10103
|
);
|
|
9870
|
-
const PencilIcon = () => /* @__PURE__ */ (0,
|
|
10104
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
9871
10105
|
"svg",
|
|
9872
10106
|
{
|
|
9873
10107
|
width: "16",
|
|
@@ -9878,7 +10112,7 @@ var BaseUserProfile = ({
|
|
|
9878
10112
|
strokeWidth: "2",
|
|
9879
10113
|
strokeLinecap: "round",
|
|
9880
10114
|
strokeLinejoin: "round",
|
|
9881
|
-
children: /* @__PURE__ */ (0,
|
|
10115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
9882
10116
|
}
|
|
9883
10117
|
);
|
|
9884
10118
|
const toggleFieldEdit = (0, import_react71.useCallback)((fieldName) => {
|
|
@@ -9903,12 +10137,12 @@ var BaseUserProfile = ({
|
|
|
9903
10137
|
}, []);
|
|
9904
10138
|
const ObjectDisplay = ({ data }) => {
|
|
9905
10139
|
if (!data || typeof data !== "object") return null;
|
|
9906
|
-
return /* @__PURE__ */ (0,
|
|
9907
|
-
/* @__PURE__ */ (0,
|
|
10140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("table", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("tr", { children: [
|
|
10141
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("td", { className: styles.objectKey, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("strong", { children: [
|
|
9908
10142
|
formatLabel(key),
|
|
9909
10143
|
":"
|
|
9910
10144
|
] }) }),
|
|
9911
|
-
/* @__PURE__ */ (0,
|
|
10145
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ObjectDisplay, { data: value }) : String(value) })
|
|
9912
10146
|
] }, key)) }) });
|
|
9913
10147
|
};
|
|
9914
10148
|
function set(obj, path, value) {
|
|
@@ -9935,7 +10169,7 @@ var BaseUserProfile = ({
|
|
|
9935
10169
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
9936
10170
|
}
|
|
9937
10171
|
let payload = {};
|
|
9938
|
-
if (schema.schemaId && schema.schemaId !==
|
|
10172
|
+
if (schema.schemaId && schema.schemaId !== import_browser67.WellKnownSchemaIds.User) {
|
|
9939
10173
|
payload = {
|
|
9940
10174
|
[schema.schemaId]: {
|
|
9941
10175
|
[fieldName]: fieldValue
|
|
@@ -9981,9 +10215,9 @@ var BaseUserProfile = ({
|
|
|
9981
10215
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
9982
10216
|
const label = displayName || description || name || "";
|
|
9983
10217
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
9984
|
-
return /* @__PURE__ */ (0,
|
|
9985
|
-
/* @__PURE__ */ (0,
|
|
9986
|
-
/* @__PURE__ */ (0,
|
|
10218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_jsx_runtime80.Fragment, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: styles.field, children: [
|
|
10219
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
10220
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.value, children: Array.isArray(subAttr.value) ? subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ") : typeof subAttr.value === "object" ? JSON.stringify(subAttr.value) : String(subAttr.value) })
|
|
9987
10221
|
] }, index)) });
|
|
9988
10222
|
}
|
|
9989
10223
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -9999,9 +10233,9 @@ var BaseUserProfile = ({
|
|
|
9999
10233
|
} else {
|
|
10000
10234
|
fieldValues = [];
|
|
10001
10235
|
}
|
|
10002
|
-
return /* @__PURE__ */ (0,
|
|
10003
|
-
/* @__PURE__ */ (0,
|
|
10004
|
-
/* @__PURE__ */ (0,
|
|
10236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
10237
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: label }),
|
|
10238
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10005
10239
|
MultiInput_default,
|
|
10006
10240
|
{
|
|
10007
10241
|
values: fieldValues,
|
|
@@ -10032,9 +10266,9 @@ var BaseUserProfile = ({
|
|
|
10032
10266
|
} else {
|
|
10033
10267
|
displayValue2 = "-";
|
|
10034
10268
|
}
|
|
10035
|
-
return /* @__PURE__ */ (0,
|
|
10036
|
-
/* @__PURE__ */ (0,
|
|
10037
|
-
/* @__PURE__ */ (0,
|
|
10269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
10270
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: label }),
|
|
10271
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: (0, import_css47.cx)(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10038
10272
|
Button_default,
|
|
10039
10273
|
{
|
|
10040
10274
|
onClick: onStartEdit,
|
|
@@ -10049,7 +10283,7 @@ var BaseUserProfile = ({
|
|
|
10049
10283
|
] });
|
|
10050
10284
|
}
|
|
10051
10285
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
10052
|
-
return /* @__PURE__ */ (0,
|
|
10286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ObjectDisplay, { data: value });
|
|
10053
10287
|
}
|
|
10054
10288
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
10055
10289
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -10064,16 +10298,16 @@ var BaseUserProfile = ({
|
|
|
10064
10298
|
let field;
|
|
10065
10299
|
switch (type) {
|
|
10066
10300
|
case "STRING":
|
|
10067
|
-
field = /* @__PURE__ */ (0,
|
|
10301
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TextField_default, { ...commonProps });
|
|
10068
10302
|
break;
|
|
10069
10303
|
case "DATE_TIME":
|
|
10070
|
-
field = /* @__PURE__ */ (0,
|
|
10304
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(DatePicker_default, { ...commonProps });
|
|
10071
10305
|
break;
|
|
10072
10306
|
case "BOOLEAN":
|
|
10073
|
-
field = /* @__PURE__ */ (0,
|
|
10307
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
10074
10308
|
break;
|
|
10075
10309
|
case "COMPLEX":
|
|
10076
|
-
field = /* @__PURE__ */ (0,
|
|
10310
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10077
10311
|
"textarea",
|
|
10078
10312
|
{
|
|
10079
10313
|
value: fieldValue,
|
|
@@ -10085,11 +10319,11 @@ var BaseUserProfile = ({
|
|
|
10085
10319
|
);
|
|
10086
10320
|
break;
|
|
10087
10321
|
default:
|
|
10088
|
-
field = /* @__PURE__ */ (0,
|
|
10322
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TextField_default, { ...commonProps });
|
|
10089
10323
|
}
|
|
10090
|
-
return /* @__PURE__ */ (0,
|
|
10091
|
-
/* @__PURE__ */ (0,
|
|
10092
|
-
/* @__PURE__ */ (0,
|
|
10324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
10325
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: label }),
|
|
10326
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.value, children: field })
|
|
10093
10327
|
] });
|
|
10094
10328
|
}
|
|
10095
10329
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -10102,9 +10336,9 @@ var BaseUserProfile = ({
|
|
|
10102
10336
|
} else {
|
|
10103
10337
|
displayValue = "-";
|
|
10104
10338
|
}
|
|
10105
|
-
return /* @__PURE__ */ (0,
|
|
10106
|
-
/* @__PURE__ */ (0,
|
|
10107
|
-
/* @__PURE__ */ (0,
|
|
10339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
10340
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: label }),
|
|
10341
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: (0, import_css47.cx)(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10108
10342
|
Button_default,
|
|
10109
10343
|
{
|
|
10110
10344
|
onClick: onStartEdit,
|
|
@@ -10132,8 +10366,8 @@ var BaseUserProfile = ({
|
|
|
10132
10366
|
alignItems: "center",
|
|
10133
10367
|
gap: theme.vars.spacing.unit
|
|
10134
10368
|
};
|
|
10135
|
-
return /* @__PURE__ */ (0,
|
|
10136
|
-
/* @__PURE__ */ (0,
|
|
10369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: styles.field, children: [
|
|
10370
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
10137
10371
|
schema,
|
|
10138
10372
|
isFieldEditing,
|
|
10139
10373
|
(value) => {
|
|
@@ -10143,12 +10377,12 @@ var BaseUserProfile = ({
|
|
|
10143
10377
|
},
|
|
10144
10378
|
() => toggleFieldEdit(schema.name)
|
|
10145
10379
|
) }),
|
|
10146
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0,
|
|
10147
|
-
isFieldEditing && /* @__PURE__ */ (0,
|
|
10148
|
-
/* @__PURE__ */ (0,
|
|
10149
|
-
/* @__PURE__ */ (0,
|
|
10380
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: styles.fieldActions, children: [
|
|
10381
|
+
isFieldEditing && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
10382
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
10383
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
10150
10384
|
] }),
|
|
10151
|
-
!isFieldEditing && hasValue && /* @__PURE__ */ (0,
|
|
10385
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10152
10386
|
Button_default,
|
|
10153
10387
|
{
|
|
10154
10388
|
size: "small",
|
|
@@ -10157,7 +10391,7 @@ var BaseUserProfile = ({
|
|
|
10157
10391
|
onClick: () => toggleFieldEdit(schema.name),
|
|
10158
10392
|
title: "Edit",
|
|
10159
10393
|
className: styles.editButton,
|
|
10160
|
-
children: /* @__PURE__ */ (0,
|
|
10394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PencilIcon, {})
|
|
10161
10395
|
}
|
|
10162
10396
|
)
|
|
10163
10397
|
] })
|
|
@@ -10169,7 +10403,7 @@ var BaseUserProfile = ({
|
|
|
10169
10403
|
const containerClasses = (0, import_css47.cx)(
|
|
10170
10404
|
styles.root,
|
|
10171
10405
|
cardLayout ? styles.card : "",
|
|
10172
|
-
(0,
|
|
10406
|
+
(0, import_browser67.withVendorCSSClassPrefix)("user-profile"),
|
|
10173
10407
|
className
|
|
10174
10408
|
);
|
|
10175
10409
|
const currentUser = flattenedProfile || profile;
|
|
@@ -10181,17 +10415,17 @@ var BaseUserProfile = ({
|
|
|
10181
10415
|
if (!shouldShowField(key)) return false;
|
|
10182
10416
|
return value !== void 0 && value !== "" && value !== null;
|
|
10183
10417
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
10184
|
-
return /* @__PURE__ */ (0,
|
|
10185
|
-
/* @__PURE__ */ (0,
|
|
10186
|
-
/* @__PURE__ */ (0,
|
|
10418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_jsx_runtime80.Fragment, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: styles.field, children: [
|
|
10419
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: styles.label, children: formatLabel(key) }),
|
|
10420
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
10187
10421
|
] }, key)) });
|
|
10188
10422
|
};
|
|
10189
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
10190
|
-
error && /* @__PURE__ */ (0,
|
|
10191
|
-
/* @__PURE__ */ (0,
|
|
10192
|
-
/* @__PURE__ */ (0,
|
|
10423
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default, { className: containerClasses, children: [
|
|
10424
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", className: (0, import_css47.cx)((0, import_browser67.withVendorCSSClassPrefix)((0, import_browser67.bem)("user-profile", "alert")), styles.alert), children: [
|
|
10425
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10426
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: error })
|
|
10193
10427
|
] }),
|
|
10194
|
-
/* @__PURE__ */ (0,
|
|
10428
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
10195
10429
|
Avatar,
|
|
10196
10430
|
{
|
|
10197
10431
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -10201,7 +10435,7 @@ var BaseUserProfile = ({
|
|
|
10201
10435
|
isLoading
|
|
10202
10436
|
}
|
|
10203
10437
|
) }),
|
|
10204
|
-
/* @__PURE__ */ (0,
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
10205
10439
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
10206
10440
|
if (!editable) {
|
|
10207
10441
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -10218,13 +10452,13 @@ var BaseUserProfile = ({
|
|
|
10218
10452
|
...schema,
|
|
10219
10453
|
value
|
|
10220
10454
|
};
|
|
10221
|
-
return /* @__PURE__ */ (0,
|
|
10455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
10222
10456
|
}) : renderProfileWithoutSchemas() })
|
|
10223
10457
|
] });
|
|
10224
10458
|
if (mode === "popup") {
|
|
10225
|
-
return /* @__PURE__ */ (0,
|
|
10226
|
-
/* @__PURE__ */ (0,
|
|
10227
|
-
/* @__PURE__ */ (0,
|
|
10459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Dialog_default.Content, { children: [
|
|
10460
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Dialog_default.Heading, { children: title ?? t("user.profile.title") }),
|
|
10461
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: styles.popup, children: profileContent })
|
|
10228
10462
|
] }) });
|
|
10229
10463
|
}
|
|
10230
10464
|
return profileContent;
|
|
@@ -10235,8 +10469,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
10235
10469
|
var import_react72 = require("react");
|
|
10236
10470
|
|
|
10237
10471
|
// src/api/updateMeProfile.ts
|
|
10238
|
-
var
|
|
10239
|
-
var httpClient5 =
|
|
10472
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
10473
|
+
var httpClient5 = import_browser68.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser68.AsgardeoSPAClient.getInstance());
|
|
10240
10474
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
10241
10475
|
const defaultFetcher = async (url, config) => {
|
|
10242
10476
|
const response = await httpClient5({
|
|
@@ -10253,7 +10487,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10253
10487
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10254
10488
|
};
|
|
10255
10489
|
};
|
|
10256
|
-
return (0,
|
|
10490
|
+
return (0, import_browser68.updateMeProfile)({
|
|
10257
10491
|
...requestConfig,
|
|
10258
10492
|
fetcher: fetcher || defaultFetcher
|
|
10259
10493
|
});
|
|
@@ -10261,8 +10495,8 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10261
10495
|
var updateMeProfile_default = updateMeProfile;
|
|
10262
10496
|
|
|
10263
10497
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10264
|
-
var
|
|
10265
|
-
var
|
|
10498
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10499
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
10266
10500
|
var UserProfile3 = ({ ...rest }) => {
|
|
10267
10501
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
10268
10502
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
@@ -10275,13 +10509,13 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10275
10509
|
onUpdateProfile(response);
|
|
10276
10510
|
} catch (error2) {
|
|
10277
10511
|
let message = t("user.profile.update.generic.error");
|
|
10278
|
-
if (error2 instanceof
|
|
10512
|
+
if (error2 instanceof import_browser69.AsgardeoError) {
|
|
10279
10513
|
message = error2?.message;
|
|
10280
10514
|
}
|
|
10281
10515
|
setError(message);
|
|
10282
10516
|
}
|
|
10283
10517
|
};
|
|
10284
|
-
return /* @__PURE__ */ (0,
|
|
10518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10285
10519
|
BaseUserProfile_default,
|
|
10286
10520
|
{
|
|
10287
10521
|
profile,
|
|
@@ -10296,7 +10530,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10296
10530
|
var UserProfile_default = UserProfile3;
|
|
10297
10531
|
|
|
10298
10532
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10299
|
-
var
|
|
10533
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
10300
10534
|
var import_react74 = require("@floating-ui/react");
|
|
10301
10535
|
var import_css49 = require("@emotion/css");
|
|
10302
10536
|
var import_react75 = require("react");
|
|
@@ -10369,7 +10603,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10369
10603
|
border: none;
|
|
10370
10604
|
cursor: pointer;
|
|
10371
10605
|
font-size: 0.875rem;
|
|
10372
|
-
text-align:
|
|
10606
|
+
text-align: start;
|
|
10373
10607
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10374
10608
|
transition: none;
|
|
10375
10609
|
box-shadow: none;
|
|
@@ -10398,7 +10632,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10398
10632
|
background: none;
|
|
10399
10633
|
cursor: pointer;
|
|
10400
10634
|
font-size: 0.875rem;
|
|
10401
|
-
text-align:
|
|
10635
|
+
text-align: start;
|
|
10402
10636
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10403
10637
|
transition: background-color 0.15s ease-in-out;
|
|
10404
10638
|
|
|
@@ -10486,7 +10720,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10486
10720
|
var BaseUserDropdown_styles_default = useStyles23;
|
|
10487
10721
|
|
|
10488
10722
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10489
|
-
var
|
|
10723
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
10490
10724
|
var BaseUserDropdown = ({
|
|
10491
10725
|
fallback = null,
|
|
10492
10726
|
className = "",
|
|
@@ -10540,14 +10774,14 @@ var BaseUserDropdown = ({
|
|
|
10540
10774
|
defaultMenuItems.push({
|
|
10541
10775
|
label: "Manage Profile",
|
|
10542
10776
|
onClick: onManageProfile,
|
|
10543
|
-
icon: /* @__PURE__ */ (0,
|
|
10777
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(User_default2, { width: "16", height: "16" })
|
|
10544
10778
|
});
|
|
10545
10779
|
}
|
|
10546
10780
|
if (onSignOut) {
|
|
10547
10781
|
defaultMenuItems.push({
|
|
10548
10782
|
label: "Sign Out",
|
|
10549
10783
|
onClick: onSignOut,
|
|
10550
|
-
icon: /* @__PURE__ */ (0,
|
|
10784
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(LogOut_default, { width: "16", height: "16" })
|
|
10551
10785
|
});
|
|
10552
10786
|
}
|
|
10553
10787
|
const allMenuItems = [...menuItems];
|
|
@@ -10557,18 +10791,18 @@ var BaseUserDropdown = ({
|
|
|
10557
10791
|
}
|
|
10558
10792
|
allMenuItems.push(...defaultMenuItems);
|
|
10559
10793
|
}
|
|
10560
|
-
return /* @__PURE__ */ (0,
|
|
10561
|
-
/* @__PURE__ */ (0,
|
|
10794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
10795
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10562
10796
|
Button_default,
|
|
10563
10797
|
{
|
|
10564
10798
|
ref: refs.setReference,
|
|
10565
|
-
className: (0, import_css49.cx)((0,
|
|
10799
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
10566
10800
|
color: "tertiary",
|
|
10567
10801
|
variant: "text",
|
|
10568
10802
|
size: "medium",
|
|
10569
10803
|
...getReferenceProps(),
|
|
10570
10804
|
children: [
|
|
10571
|
-
/* @__PURE__ */ (0,
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10572
10806
|
Avatar,
|
|
10573
10807
|
{
|
|
10574
10808
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10577,22 +10811,22 @@ var BaseUserDropdown = ({
|
|
|
10577
10811
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10578
10812
|
}
|
|
10579
10813
|
),
|
|
10580
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
10814
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10581
10815
|
Typography_default,
|
|
10582
10816
|
{
|
|
10583
10817
|
variant: "body2",
|
|
10584
|
-
className: (0, import_css49.cx)((0,
|
|
10818
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
10585
10819
|
children: getDisplayName_default(mergedMappings, user)
|
|
10586
10820
|
}
|
|
10587
10821
|
)
|
|
10588
10822
|
]
|
|
10589
10823
|
}
|
|
10590
10824
|
),
|
|
10591
|
-
isOpen && /* @__PURE__ */ (0,
|
|
10825
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react74.FloatingPortal, { id: portalId, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react74.FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10592
10826
|
"div",
|
|
10593
10827
|
{
|
|
10594
10828
|
ref: refs.setFloating,
|
|
10595
|
-
className: (0, import_css49.cx)((0,
|
|
10829
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
10596
10830
|
style: {
|
|
10597
10831
|
...floatingStyles,
|
|
10598
10832
|
// 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,8 +10835,8 @@ var BaseUserDropdown = ({
|
|
|
10601
10835
|
},
|
|
10602
10836
|
...getFloatingProps(),
|
|
10603
10837
|
children: [
|
|
10604
|
-
/* @__PURE__ */ (0,
|
|
10605
|
-
/* @__PURE__ */ (0,
|
|
10838
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10839
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10606
10840
|
Avatar,
|
|
10607
10841
|
{
|
|
10608
10842
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10611,22 +10845,22 @@ var BaseUserDropdown = ({
|
|
|
10611
10845
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10612
10846
|
}
|
|
10613
10847
|
),
|
|
10614
|
-
/* @__PURE__ */ (0,
|
|
10615
|
-
/* @__PURE__ */ (0,
|
|
10848
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10849
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10616
10850
|
Typography_default,
|
|
10617
10851
|
{
|
|
10618
10852
|
noWrap: true,
|
|
10619
|
-
className: (0,
|
|
10853
|
+
className: (0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
10620
10854
|
variant: "body1",
|
|
10621
10855
|
fontWeight: "medium",
|
|
10622
10856
|
children: getDisplayName_default(mergedMappings, user)
|
|
10623
10857
|
}
|
|
10624
10858
|
),
|
|
10625
|
-
/* @__PURE__ */ (0,
|
|
10859
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10626
10860
|
Typography_default,
|
|
10627
10861
|
{
|
|
10628
10862
|
noWrap: true,
|
|
10629
|
-
className: (0,
|
|
10863
|
+
className: (0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
10630
10864
|
variant: "caption",
|
|
10631
10865
|
color: "secondary",
|
|
10632
10866
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -10634,31 +10868,31 @@ var BaseUserDropdown = ({
|
|
|
10634
10868
|
)
|
|
10635
10869
|
] })
|
|
10636
10870
|
] }),
|
|
10637
|
-
/* @__PURE__ */ (0,
|
|
10871
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10638
10872
|
"a",
|
|
10639
10873
|
{
|
|
10640
10874
|
href: item.href,
|
|
10641
10875
|
style: {
|
|
10642
10876
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10643
10877
|
},
|
|
10644
|
-
className: (0, import_css49.cx)((0,
|
|
10878
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
10645
10879
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
10646
10880
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
10647
10881
|
onFocus: () => setHoveredItemIndex(index),
|
|
10648
10882
|
onBlur: () => setHoveredItemIndex(null),
|
|
10649
10883
|
children: [
|
|
10650
10884
|
item.icon,
|
|
10651
|
-
/* @__PURE__ */ (0,
|
|
10885
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: item.label })
|
|
10652
10886
|
]
|
|
10653
10887
|
}
|
|
10654
|
-
) : /* @__PURE__ */ (0,
|
|
10888
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10655
10889
|
Button_default,
|
|
10656
10890
|
{
|
|
10657
10891
|
onClick: () => handleMenuItemClick(item),
|
|
10658
10892
|
style: {
|
|
10659
10893
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10660
10894
|
},
|
|
10661
|
-
className: (0, import_css49.cx)((0,
|
|
10895
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
10662
10896
|
color: "tertiary",
|
|
10663
10897
|
variant: "text",
|
|
10664
10898
|
size: "small",
|
|
@@ -10677,7 +10911,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
10677
10911
|
|
|
10678
10912
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
10679
10913
|
var import_react76 = require("react");
|
|
10680
|
-
var
|
|
10914
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
10681
10915
|
var UserDropdown = ({
|
|
10682
10916
|
children,
|
|
10683
10917
|
renderTrigger,
|
|
@@ -10706,14 +10940,14 @@ var UserDropdown = ({
|
|
|
10706
10940
|
closeProfile
|
|
10707
10941
|
};
|
|
10708
10942
|
if (children) {
|
|
10709
|
-
return /* @__PURE__ */ (0,
|
|
10943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
10710
10944
|
children(renderProps),
|
|
10711
|
-
/* @__PURE__ */ (0,
|
|
10945
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10712
10946
|
] });
|
|
10713
10947
|
}
|
|
10714
10948
|
if (renderTrigger || renderDropdown) {
|
|
10715
|
-
return /* @__PURE__ */ (0,
|
|
10716
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0,
|
|
10949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
10950
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
10717
10951
|
BaseUserDropdown_default,
|
|
10718
10952
|
{
|
|
10719
10953
|
user,
|
|
@@ -10723,11 +10957,11 @@ var UserDropdown = ({
|
|
|
10723
10957
|
...rest
|
|
10724
10958
|
}
|
|
10725
10959
|
),
|
|
10726
|
-
/* @__PURE__ */ (0,
|
|
10960
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10727
10961
|
] });
|
|
10728
10962
|
}
|
|
10729
|
-
return /* @__PURE__ */ (0,
|
|
10730
|
-
/* @__PURE__ */ (0,
|
|
10963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
10964
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
10731
10965
|
BaseUserDropdown_default,
|
|
10732
10966
|
{
|
|
10733
10967
|
user,
|
|
@@ -10737,7 +10971,7 @@ var UserDropdown = ({
|
|
|
10737
10971
|
...rest
|
|
10738
10972
|
}
|
|
10739
10973
|
),
|
|
10740
|
-
isProfileOpen && /* @__PURE__ */ (0,
|
|
10974
|
+
isProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10741
10975
|
] });
|
|
10742
10976
|
};
|
|
10743
10977
|
var UserDropdown_default = UserDropdown;
|
|
@@ -10748,9 +10982,9 @@ var import_css51 = require("@emotion/css");
|
|
|
10748
10982
|
var import_react79 = require("react");
|
|
10749
10983
|
|
|
10750
10984
|
// src/components/primitives/Icons/Building.tsx
|
|
10751
|
-
var
|
|
10752
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
10753
|
-
/* @__PURE__ */ (0,
|
|
10985
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
10986
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
10987
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
10754
10988
|
"path",
|
|
10755
10989
|
{
|
|
10756
10990
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -10760,25 +10994,25 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
10760
10994
|
strokeLinejoin: "round"
|
|
10761
10995
|
}
|
|
10762
10996
|
),
|
|
10763
|
-
/* @__PURE__ */ (0,
|
|
10764
|
-
/* @__PURE__ */ (0,
|
|
10765
|
-
/* @__PURE__ */ (0,
|
|
10766
|
-
/* @__PURE__ */ (0,
|
|
10767
|
-
/* @__PURE__ */ (0,
|
|
10768
|
-
/* @__PURE__ */ (0,
|
|
10997
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10998
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10999
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
11000
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
11001
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
11002
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
10769
11003
|
] });
|
|
10770
11004
|
Building.displayName = "Building";
|
|
10771
11005
|
var Building_default = Building;
|
|
10772
11006
|
|
|
10773
11007
|
// src/components/primitives/Icons/Check.tsx
|
|
10774
|
-
var
|
|
10775
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
11008
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
11009
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
10776
11010
|
Check.displayName = "Check";
|
|
10777
11011
|
var Check_default = Check;
|
|
10778
11012
|
|
|
10779
11013
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
10780
|
-
var
|
|
10781
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
11014
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
11015
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
10782
11016
|
ChevronDown.displayName = "ChevronDown";
|
|
10783
11017
|
var ChevronDown_default = ChevronDown;
|
|
10784
11018
|
|
|
@@ -10871,7 +11105,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10871
11105
|
`;
|
|
10872
11106
|
const manageButton = import_css50.css`
|
|
10873
11107
|
min-width: auto;
|
|
10874
|
-
margin-
|
|
11108
|
+
margin-inline-start: auto;
|
|
10875
11109
|
`;
|
|
10876
11110
|
const menu = import_css50.css`
|
|
10877
11111
|
display: flex;
|
|
@@ -10891,7 +11125,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10891
11125
|
background-color: transparent;
|
|
10892
11126
|
cursor: pointer;
|
|
10893
11127
|
font-size: 0.875rem;
|
|
10894
|
-
text-align:
|
|
11128
|
+
text-align: start;
|
|
10895
11129
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
10896
11130
|
transition: background-color 0.15s ease-in-out;
|
|
10897
11131
|
|
|
@@ -11008,7 +11242,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
11008
11242
|
var BaseOrganizationSwitcher_styles_default = useStyles24;
|
|
11009
11243
|
|
|
11010
11244
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
11011
|
-
var
|
|
11245
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
11012
11246
|
var BaseOrganizationSwitcher = ({
|
|
11013
11247
|
organizations,
|
|
11014
11248
|
currentOrganization,
|
|
@@ -11029,11 +11263,12 @@ var BaseOrganizationSwitcher = ({
|
|
|
11029
11263
|
avatarSize = 24,
|
|
11030
11264
|
fallback = null
|
|
11031
11265
|
}) => {
|
|
11032
|
-
const { theme, colorScheme } = useTheme_default();
|
|
11266
|
+
const { theme, colorScheme, direction } = useTheme_default();
|
|
11033
11267
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
11034
11268
|
const [isOpen, setIsOpen] = (0, import_react79.useState)(false);
|
|
11035
11269
|
const [hoveredItemIndex, setHoveredItemIndex] = (0, import_react79.useState)(null);
|
|
11036
11270
|
const { t } = useTranslation_default();
|
|
11271
|
+
const isRTL = direction === "rtl";
|
|
11037
11272
|
const { refs, floatingStyles, context } = (0, import_react78.useFloating)({
|
|
11038
11273
|
open: isOpen,
|
|
11039
11274
|
onOpenChange: setIsOpen,
|
|
@@ -11061,8 +11296,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
11061
11296
|
const switchableOrganizations = organizations.filter(
|
|
11062
11297
|
(org) => org.id !== currentOrganization?.id
|
|
11063
11298
|
);
|
|
11064
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0,
|
|
11065
|
-
/* @__PURE__ */ (0,
|
|
11299
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
11300
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11066
11301
|
Avatar,
|
|
11067
11302
|
{
|
|
11068
11303
|
variant: "square",
|
|
@@ -11072,24 +11307,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
11072
11307
|
alt: `${organization.name} avatar`
|
|
11073
11308
|
}
|
|
11074
11309
|
),
|
|
11075
|
-
/* @__PURE__ */ (0,
|
|
11076
|
-
/* @__PURE__ */ (0,
|
|
11077
|
-
/* @__PURE__ */ (0,
|
|
11078
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
11310
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.organizationInfo), children: [
|
|
11311
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "body2", fontWeight: "medium", className: (0, import_css51.cx)(styles.organizationName), children: organization.name }),
|
|
11312
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.organizationMeta), children: [
|
|
11313
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
|
|
11079
11314
|
organization.memberCount,
|
|
11080
11315
|
" ",
|
|
11081
11316
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
11082
11317
|
] }),
|
|
11083
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
11084
|
-
showRole && organization.role && /* @__PURE__ */ (0,
|
|
11318
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: " \u2022 " }),
|
|
11319
|
+
showRole && organization.role && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: (0, import_css51.cx)(styles.roleCapitalized), children: organization.role })
|
|
11085
11320
|
] })
|
|
11086
11321
|
] }),
|
|
11087
|
-
isSelected && /* @__PURE__ */ (0,
|
|
11322
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
11088
11323
|
] });
|
|
11089
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */ (0,
|
|
11090
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0,
|
|
11091
|
-
return /* @__PURE__ */ (0,
|
|
11092
|
-
/* @__PURE__ */ (0,
|
|
11324
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css51.cx)(styles.loadingContainer), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "caption", className: (0, import_css51.cx)(styles.loadingText), children: t("organization.switcher.loading.organizations") }) });
|
|
11325
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css51.cx)(styles.errorContainer), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "caption", className: (0, import_css51.cx)(styles.errorText), children: errorMessage }) });
|
|
11326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.root, className), style, children: [
|
|
11327
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
11093
11328
|
Button_default,
|
|
11094
11329
|
{
|
|
11095
11330
|
ref: refs.setReference,
|
|
@@ -11099,8 +11334,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
11099
11334
|
size: "medium",
|
|
11100
11335
|
...getReferenceProps(),
|
|
11101
11336
|
children: [
|
|
11102
|
-
currentOrganization ? /* @__PURE__ */ (0,
|
|
11103
|
-
/* @__PURE__ */ (0,
|
|
11337
|
+
currentOrganization ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
11338
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11104
11339
|
Avatar,
|
|
11105
11340
|
{
|
|
11106
11341
|
variant: "square",
|
|
@@ -11110,18 +11345,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
11110
11345
|
alt: `${currentOrganization.name} avatar`
|
|
11111
11346
|
}
|
|
11112
11347
|
),
|
|
11113
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
11114
|
-
] }) : /* @__PURE__ */ (0,
|
|
11115
|
-
/* @__PURE__ */ (0,
|
|
11116
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
11348
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "body2", className: (0, import_css51.cx)(styles.triggerLabel), children: currentOrganization.name })
|
|
11349
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
11350
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11351
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "body2", className: (0, import_css51.cx)(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
11117
11352
|
] }),
|
|
11118
|
-
/* @__PURE__ */ (0,
|
|
11353
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ChevronDown_default, { width: "16", height: "16" }) })
|
|
11119
11354
|
]
|
|
11120
11355
|
}
|
|
11121
11356
|
),
|
|
11122
|
-
isOpen && /* @__PURE__ */ (0,
|
|
11123
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
11124
|
-
/* @__PURE__ */ (0,
|
|
11357
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react78.FloatingPortal, { id: portalId, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react78.FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { ref: refs.setFloating, className: (0, import_css51.cx)(styles.content), style: floatingStyles, ...getFloatingProps(), children: [
|
|
11358
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.header), children: [
|
|
11359
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11125
11360
|
Avatar,
|
|
11126
11361
|
{
|
|
11127
11362
|
variant: "square",
|
|
@@ -11131,10 +11366,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11131
11366
|
alt: `${currentOrganization.name} avatar`
|
|
11132
11367
|
}
|
|
11133
11368
|
),
|
|
11134
|
-
/* @__PURE__ */ (0,
|
|
11135
|
-
/* @__PURE__ */ (0,
|
|
11136
|
-
/* @__PURE__ */ (0,
|
|
11137
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
11369
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.headerInfo), children: [
|
|
11370
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { noWrap: true, className: (0, import_css51.cx)(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
11371
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css51.cx)(styles.headerMeta), children: [
|
|
11372
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
11138
11373
|
Typography_default,
|
|
11139
11374
|
{
|
|
11140
11375
|
noWrap: true,
|
|
@@ -11144,17 +11379,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
11144
11379
|
currentOrganization.memberCount,
|
|
11145
11380
|
" ",
|
|
11146
11381
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
11147
|
-
showRole && currentOrganization.role && /* @__PURE__ */ (0,
|
|
11382
|
+
showRole && currentOrganization.role && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
|
|
11148
11383
|
" \u2022 ",
|
|
11149
11384
|
currentOrganization.role
|
|
11150
11385
|
] })
|
|
11151
11386
|
]
|
|
11152
11387
|
}
|
|
11153
11388
|
),
|
|
11154
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0,
|
|
11389
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { noWrap: true, className: (0, import_css51.cx)(styles.headerRole), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
11155
11390
|
] })
|
|
11156
11391
|
] }),
|
|
11157
|
-
onManageProfile && /* @__PURE__ */ (0,
|
|
11392
|
+
onManageProfile && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11158
11393
|
Button_default,
|
|
11159
11394
|
{
|
|
11160
11395
|
onClick: onManageProfile,
|
|
@@ -11163,7 +11398,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11163
11398
|
size: "small",
|
|
11164
11399
|
"aria-label": "Manage Organization Profile",
|
|
11165
11400
|
className: (0, import_css51.cx)(styles.manageButton),
|
|
11166
|
-
endIcon: /* @__PURE__ */ (0,
|
|
11401
|
+
endIcon: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
11167
11402
|
"svg",
|
|
11168
11403
|
{
|
|
11169
11404
|
width: "16",
|
|
@@ -11175,8 +11410,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
11175
11410
|
strokeLinecap: "round",
|
|
11176
11411
|
strokeLinejoin: "round",
|
|
11177
11412
|
children: [
|
|
11178
|
-
/* @__PURE__ */ (0,
|
|
11179
|
-
/* @__PURE__ */ (0,
|
|
11413
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
11414
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
11180
11415
|
]
|
|
11181
11416
|
}
|
|
11182
11417
|
),
|
|
@@ -11184,20 +11419,20 @@ var BaseOrganizationSwitcher = ({
|
|
|
11184
11419
|
}
|
|
11185
11420
|
)
|
|
11186
11421
|
] }),
|
|
11187
|
-
organizations.length > 1 && /* @__PURE__ */ (0,
|
|
11422
|
+
organizations.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11188
11423
|
"div",
|
|
11189
11424
|
{
|
|
11190
11425
|
className: (0, import_css51.cx)(styles.header, styles.sectionHeaderContainer),
|
|
11191
11426
|
style: {
|
|
11192
11427
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
11193
11428
|
},
|
|
11194
|
-
children: /* @__PURE__ */ (0,
|
|
11429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Typography_default, { variant: "caption", fontWeight: 600, className: (0, import_css51.cx)(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
11195
11430
|
}
|
|
11196
11431
|
),
|
|
11197
|
-
/* @__PURE__ */ (0,
|
|
11432
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css51.cx)(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
11198
11433
|
switchableOrganizations.map((organization) => {
|
|
11199
11434
|
const isSelected = false;
|
|
11200
|
-
return /* @__PURE__ */ (0,
|
|
11435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11201
11436
|
Button_default,
|
|
11202
11437
|
{
|
|
11203
11438
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -11215,10 +11450,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11215
11450
|
organization.id
|
|
11216
11451
|
);
|
|
11217
11452
|
}),
|
|
11218
|
-
menuItems.length > 0 && /* @__PURE__ */ (0,
|
|
11219
|
-
/* @__PURE__ */ (0,
|
|
11453
|
+
menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
11454
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css51.cx)(styles.menuDivider) }),
|
|
11220
11455
|
menuItems.map(
|
|
11221
|
-
(item, index) => /* @__PURE__ */ (0,
|
|
11456
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: item.href ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
11222
11457
|
"a",
|
|
11223
11458
|
{
|
|
11224
11459
|
href: item.href,
|
|
@@ -11232,10 +11467,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11232
11467
|
onBlur: () => setHoveredItemIndex(null),
|
|
11233
11468
|
children: [
|
|
11234
11469
|
item.icon,
|
|
11235
|
-
/* @__PURE__ */ (0,
|
|
11470
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: item.label })
|
|
11236
11471
|
]
|
|
11237
11472
|
}
|
|
11238
|
-
) : /* @__PURE__ */ (0,
|
|
11473
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11239
11474
|
Button_default,
|
|
11240
11475
|
{
|
|
11241
11476
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -11409,7 +11644,7 @@ var useStyles25 = (theme, colorScheme) => {
|
|
|
11409
11644
|
var BaseCreateOrganization_styles_default = useStyles25;
|
|
11410
11645
|
|
|
11411
11646
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
11412
|
-
var
|
|
11647
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
11413
11648
|
var BaseCreateOrganization = ({
|
|
11414
11649
|
cardLayout = true,
|
|
11415
11650
|
className = "",
|
|
@@ -11496,13 +11731,13 @@ var BaseCreateOrganization = ({
|
|
|
11496
11731
|
console.error("Form submission error:", submitError);
|
|
11497
11732
|
}
|
|
11498
11733
|
};
|
|
11499
|
-
const createOrganizationContent = /* @__PURE__ */ (0,
|
|
11500
|
-
/* @__PURE__ */ (0,
|
|
11501
|
-
error && /* @__PURE__ */ (0,
|
|
11502
|
-
/* @__PURE__ */ (0,
|
|
11503
|
-
/* @__PURE__ */ (0,
|
|
11734
|
+
const createOrganizationContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css53.cx)(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css53.cx)(styles.content), children: [
|
|
11735
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("form", { id: "create-organization-form", className: (0, import_css53.cx)(styles.form), onSubmit: handleSubmit, children: [
|
|
11736
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
11737
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Alert_default.Title, { children: "Error" }),
|
|
11738
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Alert_default.Description, { children: error })
|
|
11504
11739
|
] }),
|
|
11505
|
-
/* @__PURE__ */ (0,
|
|
11740
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css53.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
11506
11741
|
TextField_default,
|
|
11507
11742
|
{
|
|
11508
11743
|
label: `${t("organization.create.name.label")}`,
|
|
@@ -11515,7 +11750,7 @@ var BaseCreateOrganization = ({
|
|
|
11515
11750
|
className: (0, import_css53.cx)(styles.input)
|
|
11516
11751
|
}
|
|
11517
11752
|
) }),
|
|
11518
|
-
/* @__PURE__ */ (0,
|
|
11753
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css53.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
11519
11754
|
TextField_default,
|
|
11520
11755
|
{
|
|
11521
11756
|
label: `${t("organization.create.handle.label") || "Organization Handle"}`,
|
|
@@ -11529,9 +11764,9 @@ var BaseCreateOrganization = ({
|
|
|
11529
11764
|
className: (0, import_css53.cx)(styles.input)
|
|
11530
11765
|
}
|
|
11531
11766
|
) }),
|
|
11532
|
-
/* @__PURE__ */ (0,
|
|
11533
|
-
/* @__PURE__ */ (0,
|
|
11534
|
-
/* @__PURE__ */ (0,
|
|
11767
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css53.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(FormControl_default, { error: formErrors.description, children: [
|
|
11768
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(InputLabel_default, { required: true, children: t("organization.create.description.label") }),
|
|
11769
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
11535
11770
|
"textarea",
|
|
11536
11771
|
{
|
|
11537
11772
|
className: (0, import_css53.cx)(styles.textarea, formErrors.description && styles.textareaError),
|
|
@@ -11545,23 +11780,23 @@ var BaseCreateOrganization = ({
|
|
|
11545
11780
|
] }) }),
|
|
11546
11781
|
renderAdditionalFields && renderAdditionalFields()
|
|
11547
11782
|
] }),
|
|
11548
|
-
/* @__PURE__ */ (0,
|
|
11549
|
-
onCancel && /* @__PURE__ */ (0,
|
|
11550
|
-
/* @__PURE__ */ (0,
|
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css53.cx)(styles.actions), children: [
|
|
11784
|
+
onCancel && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.cancel") }),
|
|
11785
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.creating") : t("organization.create.button") })
|
|
11551
11786
|
] })
|
|
11552
11787
|
] }) });
|
|
11553
11788
|
if (mode === "popup") {
|
|
11554
|
-
return /* @__PURE__ */ (0,
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11556
|
-
/* @__PURE__ */ (0,
|
|
11789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Dialog_default.Content, { children: [
|
|
11790
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default.Heading, { children: title }),
|
|
11791
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.popup, children: createOrganizationContent })
|
|
11557
11792
|
] }) });
|
|
11558
11793
|
}
|
|
11559
11794
|
return createOrganizationContent;
|
|
11560
11795
|
};
|
|
11561
11796
|
|
|
11562
11797
|
// src/api/createOrganization.ts
|
|
11563
|
-
var
|
|
11564
|
-
var httpClient6 =
|
|
11798
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
11799
|
+
var httpClient6 = import_browser71.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser71.AsgardeoSPAClient.getInstance());
|
|
11565
11800
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11566
11801
|
const defaultFetcher = async (url, config) => {
|
|
11567
11802
|
const response = await httpClient6({
|
|
@@ -11578,7 +11813,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11578
11813
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11579
11814
|
};
|
|
11580
11815
|
};
|
|
11581
|
-
return (0,
|
|
11816
|
+
return (0, import_browser71.createOrganization)({
|
|
11582
11817
|
...requestConfig,
|
|
11583
11818
|
fetcher: fetcher || defaultFetcher
|
|
11584
11819
|
});
|
|
@@ -11586,7 +11821,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11586
11821
|
var createOrganization_default = createOrganization;
|
|
11587
11822
|
|
|
11588
11823
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
11589
|
-
var
|
|
11824
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
11590
11825
|
var CreateOrganization = ({
|
|
11591
11826
|
onCreateOrganization,
|
|
11592
11827
|
fallback = null,
|
|
@@ -11602,7 +11837,7 @@ var CreateOrganization = ({
|
|
|
11602
11837
|
return fallback;
|
|
11603
11838
|
}
|
|
11604
11839
|
if (!isSignedIn) {
|
|
11605
|
-
return /* @__PURE__ */ (0,
|
|
11840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_jsx_runtime89.Fragment, {});
|
|
11606
11841
|
}
|
|
11607
11842
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
11608
11843
|
const handleSubmit = async (payload) => {
|
|
@@ -11636,7 +11871,7 @@ var CreateOrganization = ({
|
|
|
11636
11871
|
setLoading(false);
|
|
11637
11872
|
}
|
|
11638
11873
|
};
|
|
11639
|
-
return /* @__PURE__ */ (0,
|
|
11874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11640
11875
|
BaseCreateOrganization,
|
|
11641
11876
|
{
|
|
11642
11877
|
onSubmit: handleSubmit,
|
|
@@ -11653,12 +11888,12 @@ var CreateOrganization = ({
|
|
|
11653
11888
|
var import_react87 = require("react");
|
|
11654
11889
|
|
|
11655
11890
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11656
|
-
var
|
|
11891
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
11657
11892
|
var import_css57 = require("@emotion/css");
|
|
11658
11893
|
var import_react86 = require("react");
|
|
11659
11894
|
|
|
11660
11895
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11661
|
-
var
|
|
11896
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11662
11897
|
var import_css55 = require("@emotion/css");
|
|
11663
11898
|
var import_react84 = require("react");
|
|
11664
11899
|
|
|
@@ -11818,7 +12053,7 @@ var useStyles26 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
11818
12053
|
var KeyValueInput_styles_default = useStyles26;
|
|
11819
12054
|
|
|
11820
12055
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11821
|
-
var
|
|
12056
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
11822
12057
|
var KeyValueInput = ({
|
|
11823
12058
|
className = "",
|
|
11824
12059
|
disabled = false,
|
|
@@ -11893,105 +12128,105 @@ var KeyValueInput = ({
|
|
|
11893
12128
|
);
|
|
11894
12129
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
11895
12130
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
11896
|
-
return /* @__PURE__ */ (0,
|
|
11897
|
-
label && /* @__PURE__ */ (0,
|
|
12131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input")), styles.container, className), children: [
|
|
12132
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("label", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "label")), styles.label), children: [
|
|
11898
12133
|
label,
|
|
11899
|
-
required && /* @__PURE__ */ (0,
|
|
12134
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11900
12135
|
"span",
|
|
11901
12136
|
{
|
|
11902
|
-
className: (0, import_css55.cx)((0,
|
|
12137
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
11903
12138
|
children: " *"
|
|
11904
12139
|
}
|
|
11905
12140
|
)
|
|
11906
12141
|
] }),
|
|
11907
|
-
/* @__PURE__ */ (0,
|
|
11908
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0,
|
|
12142
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12143
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
11909
12144
|
"div",
|
|
11910
12145
|
{
|
|
11911
|
-
className: (0, import_css55.cx)((0,
|
|
12146
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
11912
12147
|
children: [
|
|
11913
|
-
/* @__PURE__ */ (0,
|
|
12148
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
11914
12149
|
"span",
|
|
11915
12150
|
{
|
|
11916
|
-
className: (0, import_css55.cx)((0,
|
|
12151
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
11917
12152
|
children: [
|
|
11918
12153
|
pair.key,
|
|
11919
12154
|
":"
|
|
11920
12155
|
]
|
|
11921
12156
|
}
|
|
11922
12157
|
),
|
|
11923
|
-
/* @__PURE__ */ (0,
|
|
12158
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11924
12159
|
"span",
|
|
11925
12160
|
{
|
|
11926
|
-
className: (0, import_css55.cx)((0,
|
|
12161
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
11927
12162
|
children: pair.value
|
|
11928
12163
|
}
|
|
11929
12164
|
)
|
|
11930
12165
|
]
|
|
11931
12166
|
},
|
|
11932
12167
|
`${pair.key}-${index}`
|
|
11933
|
-
)) : pairs.map((pair, index) => /* @__PURE__ */ (0,
|
|
12168
|
+
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
11934
12169
|
"div",
|
|
11935
12170
|
{
|
|
11936
|
-
className: (0, import_css55.cx)((0,
|
|
12171
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
11937
12172
|
children: [
|
|
11938
|
-
/* @__PURE__ */ (0,
|
|
12173
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11939
12174
|
TextField_default,
|
|
11940
12175
|
{
|
|
11941
12176
|
placeholder: keyPlaceholder,
|
|
11942
12177
|
value: pair.key,
|
|
11943
12178
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
11944
12179
|
disabled: disabled || readOnly,
|
|
11945
|
-
className: (0, import_css55.cx)((0,
|
|
12180
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11946
12181
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
11947
12182
|
}
|
|
11948
12183
|
),
|
|
11949
|
-
/* @__PURE__ */ (0,
|
|
12184
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11950
12185
|
TextField_default,
|
|
11951
12186
|
{
|
|
11952
12187
|
placeholder: valuePlaceholder,
|
|
11953
12188
|
value: pair.value,
|
|
11954
12189
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
11955
12190
|
disabled: disabled || readOnly,
|
|
11956
|
-
className: (0, import_css55.cx)((0,
|
|
12191
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11957
12192
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
11958
12193
|
}
|
|
11959
12194
|
),
|
|
11960
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
12195
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11961
12196
|
"button",
|
|
11962
12197
|
{
|
|
11963
12198
|
type: "button",
|
|
11964
12199
|
onClick: () => handleRemovePair(index),
|
|
11965
12200
|
disabled,
|
|
11966
|
-
className: (0, import_css55.cx)((0,
|
|
12201
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
11967
12202
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
11968
|
-
children: /* @__PURE__ */ (0,
|
|
12203
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(X_default, { width: 16, height: 16 })
|
|
11969
12204
|
}
|
|
11970
12205
|
)
|
|
11971
12206
|
]
|
|
11972
12207
|
},
|
|
11973
12208
|
`${pair.key}-${index}`
|
|
11974
12209
|
)),
|
|
11975
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
11976
|
-
/* @__PURE__ */ (0,
|
|
12210
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
12211
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11977
12212
|
TextField_default,
|
|
11978
12213
|
{
|
|
11979
12214
|
placeholder: keyPlaceholder,
|
|
11980
12215
|
value: newKey,
|
|
11981
12216
|
onChange: (e) => setNewKey(e.target.value),
|
|
11982
12217
|
disabled,
|
|
11983
|
-
className: (0, import_css55.cx)((0,
|
|
12218
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11984
12219
|
"aria-label": "New key"
|
|
11985
12220
|
}
|
|
11986
12221
|
),
|
|
11987
|
-
/* @__PURE__ */ (0,
|
|
12222
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
11988
12223
|
TextField_default,
|
|
11989
12224
|
{
|
|
11990
12225
|
placeholder: valuePlaceholder,
|
|
11991
12226
|
value: newValue,
|
|
11992
12227
|
onChange: (e) => setNewValue(e.target.value),
|
|
11993
12228
|
disabled,
|
|
11994
|
-
className: (0, import_css55.cx)((0,
|
|
12229
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11995
12230
|
"aria-label": "New value",
|
|
11996
12231
|
onKeyPress: (e) => {
|
|
11997
12232
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -12000,21 +12235,21 @@ var KeyValueInput = ({
|
|
|
12000
12235
|
}
|
|
12001
12236
|
}
|
|
12002
12237
|
),
|
|
12003
|
-
/* @__PURE__ */ (0,
|
|
12238
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12004
12239
|
"button",
|
|
12005
12240
|
{
|
|
12006
12241
|
type: "button",
|
|
12007
12242
|
onClick: handleAddPair,
|
|
12008
12243
|
disabled: isAddDisabled,
|
|
12009
|
-
className: (0, import_css55.cx)((0,
|
|
12244
|
+
className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "add-button")), styles.addButton),
|
|
12010
12245
|
"aria-label": "Add new key-value pair",
|
|
12011
|
-
children: /* @__PURE__ */ (0,
|
|
12246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Plus_default, { width: 16, height: 16 })
|
|
12012
12247
|
}
|
|
12013
12248
|
)
|
|
12014
12249
|
] })
|
|
12015
12250
|
] }),
|
|
12016
|
-
(helperText || error) && /* @__PURE__ */ (0,
|
|
12017
|
-
maxPairs && /* @__PURE__ */ (0,
|
|
12251
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12252
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css55.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
12018
12253
|
pairs.length,
|
|
12019
12254
|
" of ",
|
|
12020
12255
|
maxPairs,
|
|
@@ -12181,7 +12416,7 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
12181
12416
|
var BaseOrganizationProfile_styles_default = useStyles27;
|
|
12182
12417
|
|
|
12183
12418
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
12184
|
-
var
|
|
12419
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
12185
12420
|
var BaseOrganizationProfile = ({
|
|
12186
12421
|
fallback = null,
|
|
12187
12422
|
className = "",
|
|
@@ -12218,13 +12453,13 @@ var BaseOrganizationProfile = ({
|
|
|
12218
12453
|
key: "created",
|
|
12219
12454
|
label: "Created Date",
|
|
12220
12455
|
editable: false,
|
|
12221
|
-
render: (value) => (0,
|
|
12456
|
+
render: (value) => (0, import_browser73.formatDate)(value)
|
|
12222
12457
|
},
|
|
12223
12458
|
{
|
|
12224
12459
|
key: "lastModified",
|
|
12225
12460
|
label: "Last Modified Date",
|
|
12226
12461
|
editable: false,
|
|
12227
|
-
render: (value) => (0,
|
|
12462
|
+
render: (value) => (0, import_browser73.formatDate)(value)
|
|
12228
12463
|
}
|
|
12229
12464
|
]
|
|
12230
12465
|
}) => {
|
|
@@ -12232,7 +12467,7 @@ var BaseOrganizationProfile = ({
|
|
|
12232
12467
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
12233
12468
|
const [editedOrganization, setEditedOrganization] = (0, import_react86.useState)(organization);
|
|
12234
12469
|
const [editingFields, setEditingFields] = (0, import_react86.useState)({});
|
|
12235
|
-
const PencilIcon = () => /* @__PURE__ */ (0,
|
|
12470
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12236
12471
|
"svg",
|
|
12237
12472
|
{
|
|
12238
12473
|
width: "16",
|
|
@@ -12243,7 +12478,7 @@ var BaseOrganizationProfile = ({
|
|
|
12243
12478
|
strokeWidth: "2",
|
|
12244
12479
|
strokeLinecap: "round",
|
|
12245
12480
|
strokeLinejoin: "round",
|
|
12246
|
-
children: /* @__PURE__ */ (0,
|
|
12481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
12247
12482
|
}
|
|
12248
12483
|
);
|
|
12249
12484
|
const toggleFieldEdit = (0, import_react86.useCallback)((fieldName) => {
|
|
@@ -12306,7 +12541,7 @@ var BaseOrganizationProfile = ({
|
|
|
12306
12541
|
let fieldInput;
|
|
12307
12542
|
if (key === "attributes") {
|
|
12308
12543
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
12309
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
12544
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12310
12545
|
KeyValueInput_default,
|
|
12311
12546
|
{
|
|
12312
12547
|
value: attributesValue,
|
|
@@ -12344,26 +12579,26 @@ var BaseOrganizationProfile = ({
|
|
|
12344
12579
|
}
|
|
12345
12580
|
);
|
|
12346
12581
|
} else {
|
|
12347
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
12582
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextField_default, { ...commonProps });
|
|
12348
12583
|
}
|
|
12349
|
-
return /* @__PURE__ */ (0,
|
|
12350
|
-
/* @__PURE__ */ (0,
|
|
12351
|
-
/* @__PURE__ */ (0,
|
|
12584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
12585
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: (0, import_css57.cx)(styles.label), children: label }),
|
|
12586
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.value), children: fieldInput })
|
|
12352
12587
|
] });
|
|
12353
12588
|
}
|
|
12354
12589
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
12355
12590
|
const isFieldEditable = editable && fieldEditable;
|
|
12356
12591
|
let displayValue;
|
|
12357
12592
|
if (hasValue) {
|
|
12358
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0,
|
|
12593
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
12359
12594
|
} else if (isFieldEditable) {
|
|
12360
12595
|
displayValue = getFieldPlaceholder(key);
|
|
12361
12596
|
} else {
|
|
12362
12597
|
displayValue = "-";
|
|
12363
12598
|
}
|
|
12364
|
-
return /* @__PURE__ */ (0,
|
|
12365
|
-
/* @__PURE__ */ (0,
|
|
12366
|
-
/* @__PURE__ */ (0,
|
|
12599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
12600
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: (0, import_css57.cx)(styles.label), children: label }),
|
|
12601
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12367
12602
|
Button_default,
|
|
12368
12603
|
{
|
|
12369
12604
|
onClick: onStartEdit,
|
|
@@ -12386,8 +12621,8 @@ var BaseOrganizationProfile = ({
|
|
|
12386
12621
|
if (!shouldShow) {
|
|
12387
12622
|
return null;
|
|
12388
12623
|
}
|
|
12389
|
-
return /* @__PURE__ */ (0,
|
|
12390
|
-
/* @__PURE__ */ (0,
|
|
12624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_css57.cx)(styles.field), children: [
|
|
12625
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.fieldContent), children: renderField(
|
|
12391
12626
|
field,
|
|
12392
12627
|
isFieldEditing,
|
|
12393
12628
|
(value) => {
|
|
@@ -12397,8 +12632,8 @@ var BaseOrganizationProfile = ({
|
|
|
12397
12632
|
},
|
|
12398
12633
|
() => toggleFieldEdit(field.key)
|
|
12399
12634
|
) }),
|
|
12400
|
-
isFieldEditable && /* @__PURE__ */ (0,
|
|
12401
|
-
/* @__PURE__ */ (0,
|
|
12635
|
+
isFieldEditable && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
12636
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12402
12637
|
Button_default,
|
|
12403
12638
|
{
|
|
12404
12639
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -12409,7 +12644,7 @@ var BaseOrganizationProfile = ({
|
|
|
12409
12644
|
children: saveButtonText
|
|
12410
12645
|
}
|
|
12411
12646
|
),
|
|
12412
|
-
/* @__PURE__ */ (0,
|
|
12647
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12413
12648
|
Button_default,
|
|
12414
12649
|
{
|
|
12415
12650
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -12420,7 +12655,7 @@ var BaseOrganizationProfile = ({
|
|
|
12420
12655
|
children: cancelButtonText
|
|
12421
12656
|
}
|
|
12422
12657
|
)
|
|
12423
|
-
] }) : hasValue && /* @__PURE__ */ (0,
|
|
12658
|
+
] }) : hasValue && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12424
12659
|
Button_default,
|
|
12425
12660
|
{
|
|
12426
12661
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -12429,7 +12664,7 @@ var BaseOrganizationProfile = ({
|
|
|
12429
12664
|
size: "small",
|
|
12430
12665
|
title: "Edit field",
|
|
12431
12666
|
className: (0, import_css57.cx)(styles.editButton),
|
|
12432
|
-
children: /* @__PURE__ */ (0,
|
|
12667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PencilIcon, {})
|
|
12433
12668
|
}
|
|
12434
12669
|
) })
|
|
12435
12670
|
] }, field.key);
|
|
@@ -12437,23 +12672,23 @@ var BaseOrganizationProfile = ({
|
|
|
12437
12672
|
if (!organization) {
|
|
12438
12673
|
return fallback;
|
|
12439
12674
|
}
|
|
12440
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
12441
|
-
/* @__PURE__ */ (0,
|
|
12442
|
-
/* @__PURE__ */ (0,
|
|
12443
|
-
/* @__PURE__ */ (0,
|
|
12444
|
-
/* @__PURE__ */ (0,
|
|
12445
|
-
organization.orgHandle && /* @__PURE__ */ (0,
|
|
12675
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Card_default, { className: (0, import_css57.cx)(styles.root, cardLayout && styles.card, className), children: [
|
|
12676
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_css57.cx)(styles.header), children: [
|
|
12677
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
12678
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_css57.cx)(styles.orgInfo), children: [
|
|
12679
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("h2", { className: (0, import_css57.cx)(styles.name), children: organization.name }),
|
|
12680
|
+
organization.orgHandle && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("p", { className: (0, import_css57.cx)(styles.handle), children: [
|
|
12446
12681
|
"@",
|
|
12447
12682
|
organization.orgHandle
|
|
12448
12683
|
] })
|
|
12449
12684
|
] })
|
|
12450
12685
|
] }),
|
|
12451
|
-
/* @__PURE__ */ (0,
|
|
12686
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
12452
12687
|
] });
|
|
12453
12688
|
if (mode === "popup") {
|
|
12454
|
-
return /* @__PURE__ */ (0,
|
|
12455
|
-
/* @__PURE__ */ (0,
|
|
12456
|
-
/* @__PURE__ */ (0,
|
|
12689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Dialog_default.Content, { children: [
|
|
12690
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Dialog_default.Heading, { children: title }),
|
|
12691
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css57.cx)(styles.popup), children: profileContent })
|
|
12457
12692
|
] }) });
|
|
12458
12693
|
}
|
|
12459
12694
|
return profileContent;
|
|
@@ -12461,8 +12696,8 @@ var BaseOrganizationProfile = ({
|
|
|
12461
12696
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
12462
12697
|
|
|
12463
12698
|
// src/api/getOrganization.ts
|
|
12464
|
-
var
|
|
12465
|
-
var httpClient7 =
|
|
12699
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
12700
|
+
var httpClient7 = import_browser74.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser74.AsgardeoSPAClient.getInstance());
|
|
12466
12701
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
12467
12702
|
const defaultFetcher = async (url, config) => {
|
|
12468
12703
|
const response = await httpClient7({
|
|
@@ -12478,7 +12713,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12478
12713
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12479
12714
|
};
|
|
12480
12715
|
};
|
|
12481
|
-
return (0,
|
|
12716
|
+
return (0, import_browser74.getOrganization)({
|
|
12482
12717
|
...requestConfig,
|
|
12483
12718
|
fetcher: fetcher || defaultFetcher
|
|
12484
12719
|
});
|
|
@@ -12486,8 +12721,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12486
12721
|
var getOrganization_default = getOrganization;
|
|
12487
12722
|
|
|
12488
12723
|
// src/api/updateOrganization.ts
|
|
12489
|
-
var
|
|
12490
|
-
var httpClient8 =
|
|
12724
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
12725
|
+
var httpClient8 = import_browser75.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser75.AsgardeoSPAClient.getInstance());
|
|
12491
12726
|
var updateOrganization = async ({
|
|
12492
12727
|
fetcher,
|
|
12493
12728
|
...requestConfig
|
|
@@ -12507,7 +12742,7 @@ var updateOrganization = async ({
|
|
|
12507
12742
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12508
12743
|
};
|
|
12509
12744
|
};
|
|
12510
|
-
return (0,
|
|
12745
|
+
return (0, import_browser75.updateOrganization)({
|
|
12511
12746
|
...requestConfig,
|
|
12512
12747
|
fetcher: fetcher || defaultFetcher
|
|
12513
12748
|
});
|
|
@@ -12515,7 +12750,7 @@ var updateOrganization = async ({
|
|
|
12515
12750
|
var updateOrganization_default = updateOrganization;
|
|
12516
12751
|
|
|
12517
12752
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
12518
|
-
var
|
|
12753
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
12519
12754
|
var OrganizationProfile = ({
|
|
12520
12755
|
organizationId,
|
|
12521
12756
|
mode = "default",
|
|
@@ -12523,8 +12758,8 @@ var OrganizationProfile = ({
|
|
|
12523
12758
|
onOpenChange,
|
|
12524
12759
|
onUpdate,
|
|
12525
12760
|
popupTitle,
|
|
12526
|
-
loadingFallback = /* @__PURE__ */ (0,
|
|
12527
|
-
errorFallback = /* @__PURE__ */ (0,
|
|
12761
|
+
loadingFallback = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: "Loading organization..." }),
|
|
12762
|
+
errorFallback = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: "Failed to load organization data" }),
|
|
12528
12763
|
...rest
|
|
12529
12764
|
}) => {
|
|
12530
12765
|
const { baseUrl } = useAsgardeo_default();
|
|
@@ -12560,7 +12795,7 @@ var OrganizationProfile = ({
|
|
|
12560
12795
|
const handleOrganizationUpdate = async (payload) => {
|
|
12561
12796
|
if (!baseUrl || !organizationId) return;
|
|
12562
12797
|
try {
|
|
12563
|
-
const operations = (0,
|
|
12798
|
+
const operations = (0, import_browser75.createPatchOperations)(payload);
|
|
12564
12799
|
await updateOrganization_default({
|
|
12565
12800
|
baseUrl,
|
|
12566
12801
|
organizationId,
|
|
@@ -12575,7 +12810,7 @@ var OrganizationProfile = ({
|
|
|
12575
12810
|
throw err;
|
|
12576
12811
|
}
|
|
12577
12812
|
};
|
|
12578
|
-
return /* @__PURE__ */ (0,
|
|
12813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12579
12814
|
BaseOrganizationProfile_default,
|
|
12580
12815
|
{
|
|
12581
12816
|
organization,
|
|
@@ -12825,21 +13060,21 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
12825
13060
|
var BaseOrganizationList_styles_default = useStyles28;
|
|
12826
13061
|
|
|
12827
13062
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
12828
|
-
var
|
|
13063
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
12829
13064
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
12830
|
-
return /* @__PURE__ */ (0,
|
|
12831
|
-
/* @__PURE__ */ (0,
|
|
12832
|
-
/* @__PURE__ */ (0,
|
|
12833
|
-
/* @__PURE__ */ (0,
|
|
12834
|
-
/* @__PURE__ */ (0,
|
|
12835
|
-
/* @__PURE__ */ (0,
|
|
13065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.organizationItem), children: [
|
|
13066
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.organizationContent), children: [
|
|
13067
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
13068
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.organizationInfo), children: [
|
|
13069
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Typography_default, { variant: "h6", className: (0, import_css59.cx)(styles.organizationName), children: organization.name }),
|
|
13070
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css59.cx)(styles.organizationHandle), children: [
|
|
12836
13071
|
"@",
|
|
12837
13072
|
organization.orgHandle
|
|
12838
13073
|
] }),
|
|
12839
|
-
showStatus && /* @__PURE__ */ (0,
|
|
13074
|
+
showStatus && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css59.cx)(styles.organizationStatus), children: [
|
|
12840
13075
|
t("organization.switcher.status.label"),
|
|
12841
13076
|
" ",
|
|
12842
|
-
/* @__PURE__ */ (0,
|
|
13077
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12843
13078
|
"span",
|
|
12844
13079
|
{
|
|
12845
13080
|
className: (0, import_css59.cx)(
|
|
@@ -12852,7 +13087,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12852
13087
|
] })
|
|
12853
13088
|
] })
|
|
12854
13089
|
] }),
|
|
12855
|
-
organization.canSwitch && /* @__PURE__ */ (0,
|
|
13090
|
+
organization.canSwitch && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.organizationActions), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12856
13091
|
Button_default,
|
|
12857
13092
|
{
|
|
12858
13093
|
onClick: (e) => {
|
|
@@ -12866,17 +13101,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12866
13101
|
) })
|
|
12867
13102
|
] }, organization.id);
|
|
12868
13103
|
};
|
|
12869
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0,
|
|
12870
|
-
/* @__PURE__ */ (0,
|
|
12871
|
-
/* @__PURE__ */ (0,
|
|
13104
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.loadingContainer), children: [
|
|
13105
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Spinner_default, { size: "medium" }),
|
|
13106
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css59.cx)(styles.loadingText), children: t("organization.switcher.loading.organizations") })
|
|
12872
13107
|
] });
|
|
12873
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ (0,
|
|
12874
|
-
/* @__PURE__ */ (0,
|
|
13108
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.errorContainer), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Typography_default, { variant: "body1", color: "error", children: [
|
|
13109
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("strong", { children: t("organization.switcher.error.prefix") }),
|
|
12875
13110
|
" ",
|
|
12876
13111
|
error
|
|
12877
13112
|
] }) });
|
|
12878
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ (0,
|
|
12879
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0,
|
|
13113
|
+
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button_default, { onClick: onLoadMore, disabled: isLoading, className: (0, import_css59.cx)(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoading ? t("organization.switcher.loading.more") : t("organization.switcher.load.more") });
|
|
13114
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.emptyContainer), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css59.cx)(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
12880
13115
|
var BaseOrganizationList = ({
|
|
12881
13116
|
className = "",
|
|
12882
13117
|
allOrganizations,
|
|
@@ -12919,53 +13154,53 @@ var BaseOrganizationList = ({
|
|
|
12919
13154
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
12920
13155
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
12921
13156
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12922
|
-
const loadingContent = /* @__PURE__ */ (0,
|
|
13157
|
+
const loadingContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
12923
13158
|
if (mode === "popup") {
|
|
12924
|
-
return /* @__PURE__ */ (0,
|
|
12925
|
-
/* @__PURE__ */ (0,
|
|
12926
|
-
/* @__PURE__ */ (0,
|
|
13159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Dialog_default.Content, { children: [
|
|
13160
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default.Heading, { children: title }),
|
|
13161
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.popupContent), children: loadingContent })
|
|
12927
13162
|
] }) });
|
|
12928
13163
|
}
|
|
12929
13164
|
return loadingContent;
|
|
12930
13165
|
}
|
|
12931
13166
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
12932
|
-
const errorContent = /* @__PURE__ */ (0,
|
|
13167
|
+
const errorContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
12933
13168
|
if (mode === "popup") {
|
|
12934
|
-
return /* @__PURE__ */ (0,
|
|
12935
|
-
/* @__PURE__ */ (0,
|
|
12936
|
-
/* @__PURE__ */ (0,
|
|
13169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Dialog_default.Content, { children: [
|
|
13170
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default.Heading, { children: title }),
|
|
13171
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.popupContent), children: errorContent })
|
|
12937
13172
|
] }) });
|
|
12938
13173
|
}
|
|
12939
13174
|
return errorContent;
|
|
12940
13175
|
}
|
|
12941
13176
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12942
|
-
const emptyContent = /* @__PURE__ */ (0,
|
|
13177
|
+
const emptyContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
12943
13178
|
if (mode === "popup") {
|
|
12944
|
-
return /* @__PURE__ */ (0,
|
|
12945
|
-
/* @__PURE__ */ (0,
|
|
12946
|
-
/* @__PURE__ */ (0,
|
|
13179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Dialog_default.Content, { children: [
|
|
13180
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default.Heading, { children: title }),
|
|
13181
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.popupContent), children: emptyContent })
|
|
12947
13182
|
] }) });
|
|
12948
13183
|
}
|
|
12949
13184
|
return emptyContent;
|
|
12950
13185
|
}
|
|
12951
|
-
const organizationListContent = /* @__PURE__ */ (0,
|
|
12952
|
-
/* @__PURE__ */ (0,
|
|
12953
|
-
/* @__PURE__ */ (0,
|
|
13186
|
+
const organizationListContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.root, className), style, children: [
|
|
13187
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css59.cx)(styles.header), children: [
|
|
13188
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.headerInfo), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css59.cx)(styles.subtitle), children: t("organization.switcher.showing.count", {
|
|
12954
13189
|
showing: organizationsWithSwitchAccess?.length,
|
|
12955
13190
|
total: allOrganizations?.organizations?.length || 0
|
|
12956
13191
|
}) }) }),
|
|
12957
|
-
onRefresh && /* @__PURE__ */ (0,
|
|
13192
|
+
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button_default, { onClick: onRefresh, className: (0, import_css59.cx)(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.refresh.button") })
|
|
12958
13193
|
] }),
|
|
12959
|
-
/* @__PURE__ */ (0,
|
|
13194
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
12960
13195
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
12961
13196
|
) }),
|
|
12962
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0,
|
|
12963
|
-
hasMore && fetchMore && /* @__PURE__ */ (0,
|
|
13197
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
13198
|
+
hasMore && fetchMore && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
12964
13199
|
] });
|
|
12965
13200
|
if (mode === "popup") {
|
|
12966
|
-
return /* @__PURE__ */ (0,
|
|
12967
|
-
/* @__PURE__ */ (0,
|
|
12968
|
-
/* @__PURE__ */ (0,
|
|
13201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Dialog_default.Content, { children: [
|
|
13202
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Dialog_default.Heading, { children: title }),
|
|
13203
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: (0, import_css59.cx)(styles.popupContent), children: organizationListContent })
|
|
12969
13204
|
] }) });
|
|
12970
13205
|
}
|
|
12971
13206
|
return organizationListContent;
|
|
@@ -12997,10 +13232,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
12997
13232
|
|
|
12998
13233
|
&__loading-overlay {
|
|
12999
13234
|
position: absolute;
|
|
13000
|
-
|
|
13001
|
-
left: 0;
|
|
13002
|
-
right: 0;
|
|
13003
|
-
bottom: 0;
|
|
13235
|
+
inset: 0;
|
|
13004
13236
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13005
13237
|
display: flex;
|
|
13006
13238
|
align-items: center;
|
|
@@ -13025,10 +13257,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13025
13257
|
`,
|
|
13026
13258
|
loadingOverlay: import_css60.css`
|
|
13027
13259
|
position: absolute;
|
|
13028
|
-
|
|
13029
|
-
left: 0;
|
|
13030
|
-
right: 0;
|
|
13031
|
-
bottom: 0;
|
|
13260
|
+
inset: 0;
|
|
13032
13261
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
13033
13262
|
display: flex;
|
|
13034
13263
|
align-items: center;
|
|
@@ -13042,7 +13271,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13042
13271
|
var OrganizationList_styles_default = useStyles29;
|
|
13043
13272
|
|
|
13044
13273
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
13045
|
-
var
|
|
13274
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
13046
13275
|
var OrganizationList = ({
|
|
13047
13276
|
autoFetch = true,
|
|
13048
13277
|
filter = "",
|
|
@@ -13064,7 +13293,7 @@ var OrganizationList = ({
|
|
|
13064
13293
|
setAllOrganizations(await getAllOrganizations2());
|
|
13065
13294
|
})();
|
|
13066
13295
|
}, []);
|
|
13067
|
-
return /* @__PURE__ */ (0,
|
|
13296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: (0, import_css61.cx)(styles.root, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: (0, import_css61.cx)(styles.container), children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
13068
13297
|
BaseOrganizationList_default,
|
|
13069
13298
|
{
|
|
13070
13299
|
allOrganizations,
|
|
@@ -13079,8 +13308,8 @@ var OrganizationList = ({
|
|
|
13079
13308
|
var OrganizationList_default = OrganizationList;
|
|
13080
13309
|
|
|
13081
13310
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
13082
|
-
var
|
|
13083
|
-
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
13311
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
13312
|
+
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
13084
13313
|
"svg",
|
|
13085
13314
|
{
|
|
13086
13315
|
width,
|
|
@@ -13093,13 +13322,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
13093
13322
|
strokeLinecap: "round",
|
|
13094
13323
|
strokeLinejoin: "round",
|
|
13095
13324
|
children: [
|
|
13096
|
-
/* @__PURE__ */ (0,
|
|
13097
|
-
/* @__PURE__ */ (0,
|
|
13098
|
-
/* @__PURE__ */ (0,
|
|
13099
|
-
/* @__PURE__ */ (0,
|
|
13100
|
-
/* @__PURE__ */ (0,
|
|
13101
|
-
/* @__PURE__ */ (0,
|
|
13102
|
-
/* @__PURE__ */ (0,
|
|
13325
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
13326
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
13327
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
13328
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M10 6h4" }),
|
|
13329
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M10 10h4" }),
|
|
13330
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M10 14h4" }),
|
|
13331
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M10 18h4" })
|
|
13103
13332
|
]
|
|
13104
13333
|
}
|
|
13105
13334
|
);
|
|
@@ -13107,7 +13336,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
13107
13336
|
var BuildingAlt_default = BuildingAlt;
|
|
13108
13337
|
|
|
13109
13338
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
13110
|
-
var
|
|
13339
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
13111
13340
|
var OrganizationSwitcher = ({
|
|
13112
13341
|
currentOrganization: propCurrentOrganization,
|
|
13113
13342
|
fallback = null,
|
|
@@ -13131,7 +13360,7 @@ var OrganizationSwitcher = ({
|
|
|
13131
13360
|
return fallback;
|
|
13132
13361
|
}
|
|
13133
13362
|
if (!isSignedIn) {
|
|
13134
|
-
return /* @__PURE__ */ (0,
|
|
13363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_jsx_runtime96.Fragment, {});
|
|
13135
13364
|
}
|
|
13136
13365
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
13137
13366
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -13145,19 +13374,19 @@ var OrganizationSwitcher = ({
|
|
|
13145
13374
|
const defaultMenuItems = [];
|
|
13146
13375
|
if (currentOrganization) {
|
|
13147
13376
|
defaultMenuItems.push({
|
|
13148
|
-
icon: /* @__PURE__ */ (0,
|
|
13377
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BuildingAlt_default, {}),
|
|
13149
13378
|
label: t("organization.switcher.manage.organizations"),
|
|
13150
13379
|
onClick: handleManageOrganizations
|
|
13151
13380
|
});
|
|
13152
13381
|
}
|
|
13153
13382
|
defaultMenuItems.push({
|
|
13154
|
-
icon: /* @__PURE__ */ (0,
|
|
13383
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
13155
13384
|
label: t("organization.switcher.create.organization"),
|
|
13156
13385
|
onClick: () => setIsCreateOrgOpen(true)
|
|
13157
13386
|
});
|
|
13158
13387
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
13159
|
-
return /* @__PURE__ */ (0,
|
|
13160
|
-
/* @__PURE__ */ (0,
|
|
13388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
13389
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13161
13390
|
BaseOrganizationSwitcher_default,
|
|
13162
13391
|
{
|
|
13163
13392
|
organizations,
|
|
@@ -13170,7 +13399,7 @@ var OrganizationSwitcher = ({
|
|
|
13170
13399
|
...props
|
|
13171
13400
|
}
|
|
13172
13401
|
),
|
|
13173
|
-
/* @__PURE__ */ (0,
|
|
13402
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13174
13403
|
CreateOrganization,
|
|
13175
13404
|
{
|
|
13176
13405
|
mode: "popup",
|
|
@@ -13184,7 +13413,7 @@ var OrganizationSwitcher = ({
|
|
|
13184
13413
|
}
|
|
13185
13414
|
}
|
|
13186
13415
|
),
|
|
13187
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
13416
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13188
13417
|
OrganizationProfile_default,
|
|
13189
13418
|
{
|
|
13190
13419
|
organizationId: currentOrganization.id,
|
|
@@ -13192,11 +13421,11 @@ var OrganizationSwitcher = ({
|
|
|
13192
13421
|
open: isProfileOpen,
|
|
13193
13422
|
onOpenChange: setIsProfileOpen,
|
|
13194
13423
|
cardLayout: true,
|
|
13195
|
-
loadingFallback: /* @__PURE__ */ (0,
|
|
13196
|
-
errorFallback: /* @__PURE__ */ (0,
|
|
13424
|
+
loadingFallback: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { children: t("organization.profile.loading") }),
|
|
13425
|
+
errorFallback: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { children: t("organization.profile.error") })
|
|
13197
13426
|
}
|
|
13198
13427
|
),
|
|
13199
|
-
/* @__PURE__ */ (0,
|
|
13428
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13200
13429
|
OrganizationList_default,
|
|
13201
13430
|
{
|
|
13202
13431
|
mode: "popup",
|
|
@@ -13216,5 +13445,5 @@ var OrganizationSwitcher = ({
|
|
|
13216
13445
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
13217
13446
|
|
|
13218
13447
|
// src/index.ts
|
|
13219
|
-
var
|
|
13448
|
+
var import_browser76 = require("@asgardeo/browser");
|
|
13220
13449
|
//# sourceMappingURL=index.js.map
|