@asgardeo/react 0.5.23 → 0.5.24
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 +939 -876
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/SignIn/options/SignInOptionFactory.d.ts +3 -3
- package/dist/components/presentation/SignUp/options/SignUpOptionFactory.d.ts +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +3 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +10 -0
- package/dist/components/presentation/{SignIn/options → options}/FacebookButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/GitHubButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/GoogleButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/LinkedInButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/MicrosoftButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/SignInWithEthereumButton.d.ts +3 -3
- package/dist/components/presentation/{SignIn/options → options}/SocialButton.d.ts +3 -3
- package/dist/components/primitives/Avatar/Avatar.d.ts +4 -0
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +684 -617
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/components/presentation/SignUp/options/GoogleButton.d.ts +0 -25
- package/dist/components/presentation/SignUp/options/index.d.ts +0 -26
package/dist/cjs/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AlertTitle: () => AlertTitle,
|
|
37
37
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
38
38
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
39
|
-
AsgardeoRuntimeError: () =>
|
|
39
|
+
AsgardeoRuntimeError: () => import_browser69.AsgardeoRuntimeError,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseOrganization: () => BaseOrganization_default,
|
|
42
42
|
BaseOrganizationList: () => BaseOrganizationList_default,
|
|
@@ -125,15 +125,16 @@ __export(index_exports, {
|
|
|
125
125
|
UsernamePassword: () => UsernamePassword_default,
|
|
126
126
|
createField: () => createField,
|
|
127
127
|
createOrganization: () => createOrganization_default,
|
|
128
|
-
createPatchOperations: () =>
|
|
128
|
+
createPatchOperations: () => import_browser68.createPatchOperations,
|
|
129
129
|
createSignInOption: () => createSignInOption,
|
|
130
130
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
131
|
+
getActiveTheme: () => import_browser69.getActiveTheme,
|
|
131
132
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
132
133
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
133
134
|
getMeProfile: () => getScim2Me_default,
|
|
134
135
|
getOrganization: () => getOrganization_default,
|
|
135
136
|
getSchemas: () => getSchemas_default,
|
|
136
|
-
http: () =>
|
|
137
|
+
http: () => import_browser69.http,
|
|
137
138
|
updateMeProfile: () => updateMeProfile_default,
|
|
138
139
|
updateOrganization: () => updateOrganization_default,
|
|
139
140
|
useAlertVariant: () => useAlertVariant,
|
|
@@ -835,29 +836,16 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
835
836
|
return Promise.resolve(String(response));
|
|
836
837
|
}
|
|
837
838
|
async signUp(...args) {
|
|
838
|
-
|
|
839
|
-
throw new import_browser6.AsgardeoRuntimeError(
|
|
840
|
-
"No arguments provided for signUp method.",
|
|
841
|
-
"react-AsgardeoReactClient-ValidationError-001",
|
|
842
|
-
"react",
|
|
843
|
-
"The signUp method requires at least one argument, either a SignUpOptions object or an EmbeddedFlowExecuteRequestPayload."
|
|
844
|
-
);
|
|
845
|
-
}
|
|
839
|
+
const configData = await this.asgardeo.getConfigData();
|
|
846
840
|
const firstArg = args[0];
|
|
847
841
|
if (typeof firstArg === "object" && "flowType" in firstArg) {
|
|
848
|
-
const configData = await this.asgardeo.getConfigData();
|
|
849
842
|
const baseUrl = configData?.baseUrl;
|
|
850
843
|
return (0, import_browser6.executeEmbeddedSignUpFlow)({
|
|
851
844
|
baseUrl,
|
|
852
845
|
payload: firstArg
|
|
853
846
|
});
|
|
854
847
|
}
|
|
855
|
-
|
|
856
|
-
"Not implemented",
|
|
857
|
-
"react-AsgardeoReactClient-ValidationError-002",
|
|
858
|
-
"react",
|
|
859
|
-
"The signUp method with SignUpOptions is not implemented in the React client."
|
|
860
|
-
);
|
|
848
|
+
(0, import_browser6.navigate)((0, import_browser6.getRedirectBasedSignUpUrl)(configData));
|
|
861
849
|
}
|
|
862
850
|
async request(requestConfig) {
|
|
863
851
|
return this.asgardeo.httpRequest(requestConfig);
|
|
@@ -1261,7 +1249,7 @@ var applyThemeToDOM = (theme) => {
|
|
|
1261
1249
|
var ThemeProvider = ({
|
|
1262
1250
|
children,
|
|
1263
1251
|
theme: themeConfig,
|
|
1264
|
-
mode =
|
|
1252
|
+
mode = import_browser11.DEFAULT_THEME,
|
|
1265
1253
|
detection = {},
|
|
1266
1254
|
inheritFromBranding = true
|
|
1267
1255
|
}) => {
|
|
@@ -1756,12 +1744,6 @@ var AsgardeoProvider = ({
|
|
|
1756
1744
|
setIsLoadingSync(asgardeo.isLoading());
|
|
1757
1745
|
}
|
|
1758
1746
|
};
|
|
1759
|
-
const isDarkMode = (0, import_react15.useMemo)(() => {
|
|
1760
|
-
if (!preferences?.theme?.mode || preferences.theme.mode === "system") {
|
|
1761
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1762
|
-
}
|
|
1763
|
-
return preferences.theme.mode === "dark";
|
|
1764
|
-
}, [preferences?.theme?.mode]);
|
|
1765
1747
|
const handleProfileUpdate = (payload) => {
|
|
1766
1748
|
setUser(payload);
|
|
1767
1749
|
setUserProfile((prev) => ({
|
|
@@ -1829,7 +1811,7 @@ var AsgardeoProvider = ({
|
|
|
1829
1811
|
{
|
|
1830
1812
|
inheritFromBranding: preferences?.theme?.inheritFromBranding,
|
|
1831
1813
|
theme: preferences?.theme?.overrides,
|
|
1832
|
-
mode:
|
|
1814
|
+
mode: (0, import_browser13.getActiveTheme)(preferences.theme.mode),
|
|
1833
1815
|
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)(
|
|
1834
1816
|
OrganizationProvider_default,
|
|
1835
1817
|
{
|
|
@@ -2342,6 +2324,10 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2342
2324
|
background-color: ${theme.vars.colors.primary.main};
|
|
2343
2325
|
opacity: 0.8;
|
|
2344
2326
|
}
|
|
2327
|
+
&:focus:not(:disabled) {
|
|
2328
|
+
background-color: ${theme.vars.colors.primary.main};
|
|
2329
|
+
opacity: 0.8;
|
|
2330
|
+
}
|
|
2345
2331
|
`,
|
|
2346
2332
|
"primary-outline": import_css3.css`
|
|
2347
2333
|
background-color: transparent;
|
|
@@ -2356,30 +2342,50 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2356
2342
|
color: ${theme.vars.colors.primary.contrastText};
|
|
2357
2343
|
opacity: 0.9;
|
|
2358
2344
|
}
|
|
2345
|
+
&:focus:not(:disabled) {
|
|
2346
|
+
background-color: ${theme.vars.colors.primary.main};
|
|
2347
|
+
color: ${theme.vars.colors.primary.contrastText};
|
|
2348
|
+
opacity: 0.9;
|
|
2349
|
+
}
|
|
2359
2350
|
`,
|
|
2360
2351
|
"primary-text": import_css3.css`
|
|
2361
2352
|
background-color: transparent;
|
|
2362
2353
|
color: ${theme.vars.colors.primary.main};
|
|
2363
2354
|
border-color: transparent;
|
|
2364
2355
|
&:hover:not(:disabled) {
|
|
2356
|
+
border-color: transparent;
|
|
2365
2357
|
background-color: ${theme.vars.colors.action.hover};
|
|
2366
2358
|
}
|
|
2367
2359
|
&:active:not(:disabled) {
|
|
2360
|
+
border-color: transparent;
|
|
2368
2361
|
background-color: ${theme.vars.colors.action.selected};
|
|
2369
2362
|
}
|
|
2363
|
+
&:focus:not(:disabled) {
|
|
2364
|
+
border-color: transparent;
|
|
2365
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2366
|
+
outline: none;
|
|
2367
|
+
}
|
|
2370
2368
|
`,
|
|
2371
2369
|
"primary-icon": import_css3.css`
|
|
2372
2370
|
background-color: transparent;
|
|
2373
2371
|
color: ${theme.vars.colors.primary.main};
|
|
2374
2372
|
border-color: transparent;
|
|
2375
2373
|
&:hover:not(:disabled) {
|
|
2374
|
+
border-color: transparent;
|
|
2376
2375
|
background-color: ${theme.vars.colors.action.hover};
|
|
2377
2376
|
color: ${theme.vars.colors.primary.dark};
|
|
2378
2377
|
}
|
|
2379
2378
|
&:active:not(:disabled) {
|
|
2379
|
+
border-color: transparent;
|
|
2380
2380
|
background-color: ${theme.vars.colors.action.selected};
|
|
2381
2381
|
color: ${theme.vars.colors.primary.dark};
|
|
2382
2382
|
}
|
|
2383
|
+
&:focus:not(:disabled) {
|
|
2384
|
+
border-color: transparent;
|
|
2385
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2386
|
+
color: ${theme.vars.colors.primary.dark};
|
|
2387
|
+
outline: none;
|
|
2388
|
+
}
|
|
2383
2389
|
`,
|
|
2384
2390
|
"secondary-solid": import_css3.css`
|
|
2385
2391
|
background-color: ${theme.vars.colors.secondary.main};
|
|
@@ -2393,6 +2399,10 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2393
2399
|
background-color: ${theme.vars.colors.secondary.main};
|
|
2394
2400
|
opacity: 0.8;
|
|
2395
2401
|
}
|
|
2402
|
+
&:focus:not(:disabled) {
|
|
2403
|
+
background-color: ${theme.vars.colors.secondary.main};
|
|
2404
|
+
opacity: 0.8;
|
|
2405
|
+
}
|
|
2396
2406
|
`,
|
|
2397
2407
|
"secondary-outline": import_css3.css`
|
|
2398
2408
|
background-color: transparent;
|
|
@@ -2407,30 +2417,50 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2407
2417
|
color: ${theme.vars.colors.secondary.contrastText};
|
|
2408
2418
|
opacity: 0.9;
|
|
2409
2419
|
}
|
|
2420
|
+
&:focus:not(:disabled) {
|
|
2421
|
+
background-color: ${theme.vars.colors.secondary.main};
|
|
2422
|
+
color: ${theme.vars.colors.secondary.contrastText};
|
|
2423
|
+
opacity: 0.9;
|
|
2424
|
+
}
|
|
2410
2425
|
`,
|
|
2411
2426
|
"secondary-text": import_css3.css`
|
|
2412
2427
|
background-color: transparent;
|
|
2413
2428
|
color: ${theme.vars.colors.secondary.main};
|
|
2414
2429
|
border-color: transparent;
|
|
2415
2430
|
&:hover:not(:disabled) {
|
|
2431
|
+
border-color: transparent;
|
|
2416
2432
|
background-color: ${theme.vars.colors.action.hover};
|
|
2417
2433
|
}
|
|
2418
2434
|
&:active:not(:disabled) {
|
|
2435
|
+
border-color: transparent;
|
|
2419
2436
|
background-color: ${theme.vars.colors.action.selected};
|
|
2420
2437
|
}
|
|
2438
|
+
&:focus:not(:disabled) {
|
|
2439
|
+
border-color: transparent;
|
|
2440
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2441
|
+
outline: none;
|
|
2442
|
+
}
|
|
2421
2443
|
`,
|
|
2422
2444
|
"secondary-icon": import_css3.css`
|
|
2423
2445
|
background-color: transparent;
|
|
2424
2446
|
color: ${theme.vars.colors.secondary.main};
|
|
2425
2447
|
border-color: transparent;
|
|
2426
2448
|
&:hover:not(:disabled) {
|
|
2449
|
+
border-color: transparent;
|
|
2427
2450
|
background-color: ${theme.vars.colors.action.hover};
|
|
2428
2451
|
color: ${theme.vars.colors.secondary.dark};
|
|
2429
2452
|
}
|
|
2430
2453
|
&:active:not(:disabled) {
|
|
2454
|
+
border-color: transparent;
|
|
2431
2455
|
background-color: ${theme.vars.colors.action.selected};
|
|
2432
2456
|
color: ${theme.vars.colors.secondary.dark};
|
|
2433
2457
|
}
|
|
2458
|
+
&:focus:not(:disabled) {
|
|
2459
|
+
border-color: transparent;
|
|
2460
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2461
|
+
color: ${theme.vars.colors.secondary.dark};
|
|
2462
|
+
outline: none;
|
|
2463
|
+
}
|
|
2434
2464
|
`,
|
|
2435
2465
|
"tertiary-solid": import_css3.css`
|
|
2436
2466
|
background-color: ${theme.vars.colors.text.secondary};
|
|
@@ -2445,6 +2475,11 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2445
2475
|
color: ${theme.vars.colors.background.surface};
|
|
2446
2476
|
opacity: 0.9;
|
|
2447
2477
|
}
|
|
2478
|
+
&:focus:not(:disabled) {
|
|
2479
|
+
background-color: ${theme.vars.colors.text.primary};
|
|
2480
|
+
color: ${theme.vars.colors.background.surface};
|
|
2481
|
+
opacity: 0.9;
|
|
2482
|
+
}
|
|
2448
2483
|
`,
|
|
2449
2484
|
"tertiary-outline": import_css3.css`
|
|
2450
2485
|
background-color: transparent;
|
|
@@ -2458,32 +2493,52 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2458
2493
|
background-color: ${theme.vars.colors.action.selected};
|
|
2459
2494
|
border-color: ${theme.vars.colors.text.primary};
|
|
2460
2495
|
}
|
|
2496
|
+
&:focus:not(:disabled) {
|
|
2497
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2498
|
+
border-color: ${theme.vars.colors.text.primary};
|
|
2499
|
+
}
|
|
2461
2500
|
`,
|
|
2462
2501
|
"tertiary-text": import_css3.css`
|
|
2463
2502
|
background-color: transparent;
|
|
2464
2503
|
color: ${theme.vars.colors.text.secondary};
|
|
2465
2504
|
border-color: transparent;
|
|
2466
2505
|
&:hover:not(:disabled) {
|
|
2506
|
+
border-color: transparent;
|
|
2467
2507
|
background-color: ${theme.vars.colors.action.hover};
|
|
2468
2508
|
color: ${theme.vars.colors.text.primary};
|
|
2469
2509
|
}
|
|
2470
2510
|
&:active:not(:disabled) {
|
|
2511
|
+
border-color: transparent;
|
|
2471
2512
|
background-color: ${theme.vars.colors.action.selected};
|
|
2472
2513
|
color: ${theme.vars.colors.text.primary};
|
|
2473
2514
|
}
|
|
2515
|
+
&:focus:not(:disabled) {
|
|
2516
|
+
border-color: transparent;
|
|
2517
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2518
|
+
color: ${theme.vars.colors.text.primary};
|
|
2519
|
+
outline: none;
|
|
2520
|
+
}
|
|
2474
2521
|
`,
|
|
2475
2522
|
"tertiary-icon": import_css3.css`
|
|
2476
2523
|
background-color: transparent;
|
|
2477
2524
|
color: ${theme.vars.colors.text.secondary};
|
|
2478
2525
|
border-color: transparent;
|
|
2479
2526
|
&:hover:not(:disabled) {
|
|
2527
|
+
border-color: transparent;
|
|
2480
2528
|
background-color: ${theme.vars.colors.action.hover};
|
|
2481
2529
|
color: ${theme.vars.colors.text.primary};
|
|
2482
2530
|
}
|
|
2483
2531
|
&:active:not(:disabled) {
|
|
2532
|
+
border-color: transparent;
|
|
2484
2533
|
background-color: ${theme.vars.colors.action.selected};
|
|
2485
2534
|
color: ${theme.vars.colors.text.primary};
|
|
2486
2535
|
}
|
|
2536
|
+
&:focus:not(:disabled) {
|
|
2537
|
+
border-color: transparent;
|
|
2538
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2539
|
+
color: ${theme.vars.colors.text.primary};
|
|
2540
|
+
outline: none;
|
|
2541
|
+
}
|
|
2487
2542
|
`
|
|
2488
2543
|
};
|
|
2489
2544
|
const spinnerStyles = import_css3.css`
|
|
@@ -2630,8 +2685,7 @@ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferen
|
|
|
2630
2685
|
try {
|
|
2631
2686
|
setIsLoading(true);
|
|
2632
2687
|
if (signInUrl) {
|
|
2633
|
-
|
|
2634
|
-
window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
|
|
2688
|
+
(0, import_browser18.navigate)(signInUrl);
|
|
2635
2689
|
} else {
|
|
2636
2690
|
await signIn(overriddenSignInOptions ?? signInOptions);
|
|
2637
2691
|
}
|
|
@@ -2640,7 +2694,7 @@ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferen
|
|
|
2640
2694
|
}
|
|
2641
2695
|
} catch (error) {
|
|
2642
2696
|
throw new import_browser18.AsgardeoRuntimeError(
|
|
2643
|
-
`Sign in failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
2697
|
+
`Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
|
|
2644
2698
|
"SignInButton-handleSignIn-RuntimeError-001",
|
|
2645
2699
|
"react",
|
|
2646
2700
|
"Something went wrong while trying to sign in. Please try again later."
|
|
@@ -2754,6 +2808,8 @@ var BaseSignUpButton = (0, import_react31.forwardRef)(
|
|
|
2754
2808
|
disabled: isLoading,
|
|
2755
2809
|
loading: isLoading,
|
|
2756
2810
|
type: "button",
|
|
2811
|
+
color: "primary",
|
|
2812
|
+
variant: "solid",
|
|
2757
2813
|
...rest,
|
|
2758
2814
|
children
|
|
2759
2815
|
}
|
|
@@ -2765,6 +2821,7 @@ var BaseSignUpButton_default = BaseSignUpButton;
|
|
|
2765
2821
|
|
|
2766
2822
|
// src/components/actions/SignUpButton/SignUpButton.tsx
|
|
2767
2823
|
var import_browser22 = require("@asgardeo/browser");
|
|
2824
|
+
var import_browser23 = require("@asgardeo/browser");
|
|
2768
2825
|
var import_react32 = require("react");
|
|
2769
2826
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2770
2827
|
var SignUpButton = (0, import_react32.forwardRef)(({ children, onClick, preferences, ...rest }, ref) => {
|
|
@@ -2775,8 +2832,7 @@ var SignUpButton = (0, import_react32.forwardRef)(({ children, onClick, preferen
|
|
|
2775
2832
|
try {
|
|
2776
2833
|
setIsLoading(true);
|
|
2777
2834
|
if (signUpUrl) {
|
|
2778
|
-
|
|
2779
|
-
window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
|
|
2835
|
+
(0, import_browser23.navigate)(signUpUrl);
|
|
2780
2836
|
} else {
|
|
2781
2837
|
await signUp();
|
|
2782
2838
|
}
|
|
@@ -2853,15 +2909,15 @@ Loading.displayName = "Loading";
|
|
|
2853
2909
|
var Loading_default = Loading;
|
|
2854
2910
|
|
|
2855
2911
|
// src/components/presentation/SignIn/BaseSignIn.tsx
|
|
2856
|
-
var
|
|
2912
|
+
var import_browser45 = require("@asgardeo/browser");
|
|
2857
2913
|
var import_css35 = require("@emotion/css");
|
|
2858
2914
|
var import_react56 = require("react");
|
|
2859
2915
|
|
|
2860
2916
|
// src/components/presentation/SignIn/options/SignInOptionFactory.tsx
|
|
2861
|
-
var
|
|
2917
|
+
var import_browser40 = require("@asgardeo/browser");
|
|
2862
2918
|
|
|
2863
2919
|
// src/components/presentation/SignIn/options/UsernamePassword.tsx
|
|
2864
|
-
var
|
|
2920
|
+
var import_browser34 = require("@asgardeo/browser");
|
|
2865
2921
|
var import_react44 = require("react");
|
|
2866
2922
|
|
|
2867
2923
|
// src/components/primitives/TextField/TextField.tsx
|
|
@@ -2869,11 +2925,11 @@ var import_css15 = require("@emotion/css");
|
|
|
2869
2925
|
|
|
2870
2926
|
// src/components/primitives/FormControl/FormControl.tsx
|
|
2871
2927
|
var import_css11 = require("@emotion/css");
|
|
2872
|
-
var
|
|
2928
|
+
var import_browser25 = require("@asgardeo/browser");
|
|
2873
2929
|
|
|
2874
2930
|
// src/components/primitives/Typography/Typography.tsx
|
|
2875
2931
|
var import_css9 = require("@emotion/css");
|
|
2876
|
-
var
|
|
2932
|
+
var import_browser24 = require("@asgardeo/browser");
|
|
2877
2933
|
|
|
2878
2934
|
// src/components/primitives/Typography/Typography.styles.ts
|
|
2879
2935
|
var import_css8 = require("@emotion/css");
|
|
@@ -3221,8 +3277,8 @@ var Typography = ({
|
|
|
3221
3277
|
}
|
|
3222
3278
|
};
|
|
3223
3279
|
const typographyClassName = (0, import_css9.cx)(
|
|
3224
|
-
(0,
|
|
3225
|
-
(0,
|
|
3280
|
+
(0, import_browser24.withVendorCSSClassPrefix)((0, import_browser24.bem)("typography")),
|
|
3281
|
+
(0, import_browser24.withVendorCSSClassPrefix)((0, import_browser24.bem)("typography", variant)),
|
|
3226
3282
|
styles.typography,
|
|
3227
3283
|
getVariantClass(variant),
|
|
3228
3284
|
noWrap && styles.typographyNoWrap,
|
|
@@ -3272,15 +3328,15 @@ var FormControl = ({
|
|
|
3272
3328
|
}) => {
|
|
3273
3329
|
const { theme, colorScheme } = useTheme_default();
|
|
3274
3330
|
const styles = FormControl_styles_default(theme, colorScheme, helperTextAlign, helperTextMarginLeft, !!error);
|
|
3275
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_css11.cx)((0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_css11.cx)((0, import_browser25.withVendorCSSClassPrefix)((0, import_browser25.bem)("form-control")), styles.formControl, className), children: [
|
|
3276
3332
|
children,
|
|
3277
3333
|
(error || helperText) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3278
3334
|
Typography_default,
|
|
3279
3335
|
{
|
|
3280
3336
|
variant: "caption",
|
|
3281
3337
|
color: error ? "error" : "textSecondary",
|
|
3282
|
-
className: (0, import_css11.cx)((0,
|
|
3283
|
-
[(0,
|
|
3338
|
+
className: (0, import_css11.cx)((0, import_browser25.withVendorCSSClassPrefix)((0, import_browser25.bem)("form-control", "helper-text")), styles.helperText, {
|
|
3339
|
+
[(0, import_browser25.withVendorCSSClassPrefix)((0, import_browser25.bem)("form-control", "helper-text", "error"))]: !!error,
|
|
3284
3340
|
[styles.helperTextError]: !!error
|
|
3285
3341
|
}),
|
|
3286
3342
|
children: error || helperText
|
|
@@ -3292,7 +3348,7 @@ var FormControl_default = FormControl;
|
|
|
3292
3348
|
|
|
3293
3349
|
// src/components/primitives/InputLabel/InputLabel.tsx
|
|
3294
3350
|
var import_css13 = require("@emotion/css");
|
|
3295
|
-
var
|
|
3351
|
+
var import_browser26 = require("@asgardeo/browser");
|
|
3296
3352
|
|
|
3297
3353
|
// src/components/primitives/InputLabel/InputLabel.styles.ts
|
|
3298
3354
|
var import_css12 = require("@emotion/css");
|
|
@@ -3351,12 +3407,12 @@ var InputLabel = ({
|
|
|
3351
3407
|
"label",
|
|
3352
3408
|
{
|
|
3353
3409
|
className: (0, import_css13.cx)(
|
|
3354
|
-
(0,
|
|
3355
|
-
(0,
|
|
3410
|
+
(0, import_browser26.withVendorCSSClassPrefix)((0, import_browser26.bem)("input-label")),
|
|
3411
|
+
(0, import_browser26.withVendorCSSClassPrefix)((0, import_browser26.bem)("input-label", variant)),
|
|
3356
3412
|
styles.label,
|
|
3357
3413
|
variant === "block" ? styles.block : styles.inline,
|
|
3358
3414
|
{
|
|
3359
|
-
[(0,
|
|
3415
|
+
[(0, import_browser26.withVendorCSSClassPrefix)((0, import_browser26.bem)("input-label", "error"))]: error,
|
|
3360
3416
|
[styles.error]: error
|
|
3361
3417
|
},
|
|
3362
3418
|
className
|
|
@@ -3365,7 +3421,7 @@ var InputLabel = ({
|
|
|
3365
3421
|
...rest,
|
|
3366
3422
|
children: [
|
|
3367
3423
|
children,
|
|
3368
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_css13.cx)((0,
|
|
3424
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_css13.cx)((0, import_browser26.withVendorCSSClassPrefix)((0, import_browser26.bem)("input-label", "required")), styles.requiredIndicator), children: " *" })
|
|
3369
3425
|
]
|
|
3370
3426
|
}
|
|
3371
3427
|
);
|
|
@@ -3373,7 +3429,7 @@ var InputLabel = ({
|
|
|
3373
3429
|
var InputLabel_default = InputLabel;
|
|
3374
3430
|
|
|
3375
3431
|
// src/components/primitives/TextField/TextField.tsx
|
|
3376
|
-
var
|
|
3432
|
+
var import_browser27 = require("@asgardeo/browser");
|
|
3377
3433
|
|
|
3378
3434
|
// src/components/primitives/TextField/TextField.styles.ts
|
|
3379
3435
|
var import_css14 = require("@emotion/css");
|
|
@@ -3502,20 +3558,20 @@ var TextField = ({
|
|
|
3502
3558
|
const hasEndIcon = !!endIcon;
|
|
3503
3559
|
const styles = TextField_styles_default(theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIcon);
|
|
3504
3560
|
const inputClassName = (0, import_css15.cx)(
|
|
3505
|
-
(0,
|
|
3561
|
+
(0, import_browser27.withVendorCSSClassPrefix)((0, import_browser27.bem)("text-field", "input")),
|
|
3506
3562
|
styles.input,
|
|
3507
3563
|
hasError && styles.inputError,
|
|
3508
3564
|
disabled && styles.inputDisabled
|
|
3509
3565
|
);
|
|
3510
|
-
const containerClassName = (0, import_css15.cx)((0,
|
|
3511
|
-
const startIconClassName = (0, import_css15.cx)((0,
|
|
3512
|
-
const endIconClassName = (0, import_css15.cx)((0,
|
|
3566
|
+
const containerClassName = (0, import_css15.cx)((0, import_browser27.withVendorCSSClassPrefix)((0, import_browser27.bem)("text-field", "container")), styles.inputContainer);
|
|
3567
|
+
const startIconClassName = (0, import_css15.cx)((0, import_browser27.withVendorCSSClassPrefix)((0, import_browser27.bem)("text-field", "start-icon")), styles.startIcon);
|
|
3568
|
+
const endIconClassName = (0, import_css15.cx)((0, import_browser27.withVendorCSSClassPrefix)((0, import_browser27.bem)("text-field", "end-icon")), styles.endIcon);
|
|
3513
3569
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3514
3570
|
FormControl_default,
|
|
3515
3571
|
{
|
|
3516
3572
|
error,
|
|
3517
3573
|
helperText,
|
|
3518
|
-
className: (0, import_css15.cx)((0,
|
|
3574
|
+
className: (0, import_css15.cx)((0, import_browser27.withVendorCSSClassPrefix)((0, import_browser27.bem)("text-field")), className),
|
|
3519
3575
|
style,
|
|
3520
3576
|
children: [
|
|
3521
3577
|
label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InputLabel_default, { required, error: hasError, children: label }),
|
|
@@ -3562,7 +3618,7 @@ var TextField_default = TextField;
|
|
|
3562
3618
|
|
|
3563
3619
|
// src/components/primitives/Select/Select.tsx
|
|
3564
3620
|
var import_css17 = require("@emotion/css");
|
|
3565
|
-
var
|
|
3621
|
+
var import_browser28 = require("@asgardeo/browser");
|
|
3566
3622
|
|
|
3567
3623
|
// src/components/primitives/Select/Select.styles.ts
|
|
3568
3624
|
var import_css16 = require("@emotion/css");
|
|
@@ -3660,7 +3716,7 @@ var Select = ({
|
|
|
3660
3716
|
const hasError = !!error;
|
|
3661
3717
|
const styles = Select_styles_default(theme, colorScheme, disabled, hasError);
|
|
3662
3718
|
const selectClassName = (0, import_css17.cx)(
|
|
3663
|
-
(0,
|
|
3719
|
+
(0, import_browser28.withVendorCSSClassPrefix)((0, import_browser28.bem)("select", "input")),
|
|
3664
3720
|
styles.select,
|
|
3665
3721
|
hasError && styles.selectError,
|
|
3666
3722
|
disabled && styles.selectDisabled
|
|
@@ -3670,7 +3726,7 @@ var Select = ({
|
|
|
3670
3726
|
{
|
|
3671
3727
|
error,
|
|
3672
3728
|
helperText,
|
|
3673
|
-
className: (0, import_css17.cx)((0,
|
|
3729
|
+
className: (0, import_css17.cx)((0, import_browser28.withVendorCSSClassPrefix)((0, import_browser28.bem)("select")), className),
|
|
3674
3730
|
style,
|
|
3675
3731
|
children: [
|
|
3676
3732
|
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InputLabel_default, { required, error: hasError, children: label }),
|
|
@@ -3694,7 +3750,7 @@ var Select_default = Select;
|
|
|
3694
3750
|
// src/components/primitives/OtpField/OtpField.tsx
|
|
3695
3751
|
var import_react39 = require("react");
|
|
3696
3752
|
var import_css19 = require("@emotion/css");
|
|
3697
|
-
var
|
|
3753
|
+
var import_browser29 = require("@asgardeo/browser");
|
|
3698
3754
|
|
|
3699
3755
|
// src/components/primitives/OtpField/OtpField.styles.ts
|
|
3700
3756
|
var import_css18 = require("@emotion/css");
|
|
@@ -3870,12 +3926,12 @@ var OtpField = ({
|
|
|
3870
3926
|
{
|
|
3871
3927
|
error,
|
|
3872
3928
|
helperText,
|
|
3873
|
-
className: (0, import_css19.cx)((0,
|
|
3929
|
+
className: (0, import_css19.cx)((0, import_browser29.withVendorCSSClassPrefix)((0, import_browser29.bem)("otp-field")), className),
|
|
3874
3930
|
helperTextAlign: "center",
|
|
3875
3931
|
style,
|
|
3876
3932
|
children: [
|
|
3877
3933
|
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
3878
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: (0, import_css19.cx)((0,
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: (0, import_css19.cx)((0, import_browser29.withVendorCSSClassPrefix)((0, import_browser29.bem)("otp-field", "input-container")), styles.inputContainer), children: Array.from({ length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3879
3935
|
"input",
|
|
3880
3936
|
{
|
|
3881
3937
|
ref: (el) => {
|
|
@@ -3887,10 +3943,10 @@ var OtpField = ({
|
|
|
3887
3943
|
onChange: (event) => handleChange(index, event),
|
|
3888
3944
|
onKeyDown: (event) => handleKeyDown(index, event),
|
|
3889
3945
|
onPaste: handlePaste,
|
|
3890
|
-
className: (0, import_css19.cx)((0,
|
|
3891
|
-
[(0,
|
|
3946
|
+
className: (0, import_css19.cx)((0, import_browser29.withVendorCSSClassPrefix)((0, import_browser29.bem)("otp-field", "input")), styles.input, {
|
|
3947
|
+
[(0, import_browser29.withVendorCSSClassPrefix)((0, import_browser29.bem)("otp-field", "input", "error"))]: !!error,
|
|
3892
3948
|
[styles.inputError]: !!error,
|
|
3893
|
-
[(0,
|
|
3949
|
+
[(0, import_browser29.withVendorCSSClassPrefix)((0, import_browser29.bem)("otp-field", "input", "disabled"))]: !!disabled,
|
|
3894
3950
|
[styles.inputDisabled]: !!disabled
|
|
3895
3951
|
}),
|
|
3896
3952
|
maxLength: 1,
|
|
@@ -3912,7 +3968,7 @@ var OtpField_default = OtpField;
|
|
|
3912
3968
|
// src/components/primitives/PasswordField/PasswordField.tsx
|
|
3913
3969
|
var import_react41 = require("react");
|
|
3914
3970
|
var import_css21 = require("@emotion/css");
|
|
3915
|
-
var
|
|
3971
|
+
var import_browser30 = require("@asgardeo/browser");
|
|
3916
3972
|
|
|
3917
3973
|
// src/components/primitives/Icons/Eye.tsx
|
|
3918
3974
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -4008,7 +4064,7 @@ var PasswordField = ({ onChange, className, disabled, error, ...textFieldProps }
|
|
|
4008
4064
|
TextField_default,
|
|
4009
4065
|
{
|
|
4010
4066
|
...textFieldProps,
|
|
4011
|
-
className: (0, import_css21.cx)((0,
|
|
4067
|
+
className: (0, import_css21.cx)((0, import_browser30.withVendorCSSClassPrefix)((0, import_browser30.bem)("password-field")), className),
|
|
4012
4068
|
type: showPassword ? "text" : "password",
|
|
4013
4069
|
onChange: (e) => onChange(e.target.value),
|
|
4014
4070
|
autoComplete: "current-password",
|
|
@@ -4020,7 +4076,7 @@ var PasswordField = ({ onChange, className, disabled, error, ...textFieldProps }
|
|
|
4020
4076
|
width: 16,
|
|
4021
4077
|
height: 16,
|
|
4022
4078
|
className: (0, import_css21.cx)(
|
|
4023
|
-
(0,
|
|
4079
|
+
(0, import_browser30.withVendorCSSClassPrefix)((0, import_browser30.bem)("password-field", "toggle-icon")),
|
|
4024
4080
|
styles.toggleIcon,
|
|
4025
4081
|
showPassword ? styles.visibleIcon : styles.hiddenIcon
|
|
4026
4082
|
)
|
|
@@ -4034,7 +4090,7 @@ var PasswordField_default = PasswordField;
|
|
|
4034
4090
|
|
|
4035
4091
|
// src/components/primitives/DatePicker/DatePicker.tsx
|
|
4036
4092
|
var import_css23 = require("@emotion/css");
|
|
4037
|
-
var
|
|
4093
|
+
var import_browser31 = require("@asgardeo/browser");
|
|
4038
4094
|
|
|
4039
4095
|
// src/components/primitives/DatePicker/DatePicker.styles.ts
|
|
4040
4096
|
var import_css22 = require("@emotion/css");
|
|
@@ -4123,7 +4179,7 @@ var DatePicker = ({
|
|
|
4123
4179
|
{
|
|
4124
4180
|
error,
|
|
4125
4181
|
helperText,
|
|
4126
|
-
className: (0, import_css23.cx)((0,
|
|
4182
|
+
className: (0, import_css23.cx)((0, import_browser31.withVendorCSSClassPrefix)((0, import_browser31.bem)("date-picker")), className),
|
|
4127
4183
|
style,
|
|
4128
4184
|
children: [
|
|
4129
4185
|
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -4131,7 +4187,7 @@ var DatePicker = ({
|
|
|
4131
4187
|
{
|
|
4132
4188
|
required,
|
|
4133
4189
|
error: hasError,
|
|
4134
|
-
className: (0, import_css23.cx)((0,
|
|
4190
|
+
className: (0, import_css23.cx)((0, import_browser31.withVendorCSSClassPrefix)((0, import_browser31.bem)("date-picker", "label")), styles.label),
|
|
4135
4191
|
children: label
|
|
4136
4192
|
}
|
|
4137
4193
|
),
|
|
@@ -4142,13 +4198,13 @@ var DatePicker = ({
|
|
|
4142
4198
|
pattern: "\\d{4}-\\d{2}-\\d{2}",
|
|
4143
4199
|
placeholder: dateFormat,
|
|
4144
4200
|
className: (0, import_css23.cx)(
|
|
4145
|
-
(0,
|
|
4201
|
+
(0, import_browser31.withVendorCSSClassPrefix)((0, import_browser31.bem)("date-picker", "input")),
|
|
4146
4202
|
styles.input,
|
|
4147
4203
|
styles.errorInput,
|
|
4148
4204
|
styles.disabledInput,
|
|
4149
4205
|
{
|
|
4150
|
-
[(0,
|
|
4151
|
-
[(0,
|
|
4206
|
+
[(0, import_browser31.withVendorCSSClassPrefix)((0, import_browser31.bem)("date-picker", "input", "error"))]: hasError,
|
|
4207
|
+
[(0, import_browser31.withVendorCSSClassPrefix)((0, import_browser31.bem)("date-picker", "input", "disabled"))]: disabled
|
|
4152
4208
|
}
|
|
4153
4209
|
),
|
|
4154
4210
|
disabled,
|
|
@@ -4165,7 +4221,7 @@ var DatePicker_default = DatePicker;
|
|
|
4165
4221
|
|
|
4166
4222
|
// src/components/primitives/Checkbox/Checkbox.tsx
|
|
4167
4223
|
var import_css25 = require("@emotion/css");
|
|
4168
|
-
var
|
|
4224
|
+
var import_browser32 = require("@asgardeo/browser");
|
|
4169
4225
|
|
|
4170
4226
|
// src/components/primitives/Checkbox/Checkbox.styles.ts
|
|
4171
4227
|
var import_css24 = require("@emotion/css");
|
|
@@ -4238,15 +4294,15 @@ var Checkbox = ({ label, error, className, required, helperText, style = {}, ...
|
|
|
4238
4294
|
{
|
|
4239
4295
|
error,
|
|
4240
4296
|
helperText,
|
|
4241
|
-
className: (0, import_css25.cx)((0,
|
|
4297
|
+
className: (0, import_css25.cx)((0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox")), className),
|
|
4242
4298
|
helperTextMarginLeft: `calc(${theme.vars.spacing.unit} * 3.5)`,
|
|
4243
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style, className: (0, import_css25.cx)((0,
|
|
4299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style, className: (0, import_css25.cx)((0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox", "container")), styles.container), children: [
|
|
4244
4300
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4245
4301
|
"input",
|
|
4246
4302
|
{
|
|
4247
4303
|
type: "checkbox",
|
|
4248
|
-
className: (0, import_css25.cx)((0,
|
|
4249
|
-
[(0,
|
|
4304
|
+
className: (0, import_css25.cx)((0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox", "input")), styles.input, styles.errorInput, {
|
|
4305
|
+
[(0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox", "input", "error"))]: hasError
|
|
4250
4306
|
}),
|
|
4251
4307
|
"aria-invalid": hasError,
|
|
4252
4308
|
"aria-required": required,
|
|
@@ -4259,8 +4315,8 @@ var Checkbox = ({ label, error, className, required, helperText, style = {}, ...
|
|
|
4259
4315
|
required,
|
|
4260
4316
|
error: hasError,
|
|
4261
4317
|
variant: "inline",
|
|
4262
|
-
className: (0, import_css25.cx)((0,
|
|
4263
|
-
[(0,
|
|
4318
|
+
className: (0, import_css25.cx)((0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox", "label")), styles.label, styles.errorLabel, {
|
|
4319
|
+
[(0, import_browser32.withVendorCSSClassPrefix)((0, import_browser32.bem)("checkbox", "label", "error"))]: hasError
|
|
4264
4320
|
}),
|
|
4265
4321
|
children: label
|
|
4266
4322
|
}
|
|
@@ -4272,7 +4328,7 @@ var Checkbox = ({ label, error, className, required, helperText, style = {}, ...
|
|
|
4272
4328
|
var Checkbox_default = Checkbox;
|
|
4273
4329
|
|
|
4274
4330
|
// src/components/factories/FieldFactory.tsx
|
|
4275
|
-
var
|
|
4331
|
+
var import_browser33 = require("@asgardeo/browser");
|
|
4276
4332
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4277
4333
|
var validateFieldValue = (value, type, required = false, touched = false) => {
|
|
4278
4334
|
if (required && touched && (!value || value.trim() === "")) {
|
|
@@ -4282,7 +4338,7 @@ var validateFieldValue = (value, type, required = false, touched = false) => {
|
|
|
4282
4338
|
return null;
|
|
4283
4339
|
}
|
|
4284
4340
|
switch (type) {
|
|
4285
|
-
case
|
|
4341
|
+
case import_browser33.FieldType.Number:
|
|
4286
4342
|
const numValue = parseInt(value, 10);
|
|
4287
4343
|
if (isNaN(numValue)) {
|
|
4288
4344
|
return "Please enter a valid number";
|
|
@@ -4318,20 +4374,20 @@ var createField = (config) => {
|
|
|
4318
4374
|
placeholder
|
|
4319
4375
|
};
|
|
4320
4376
|
switch (type) {
|
|
4321
|
-
case
|
|
4377
|
+
case import_browser33.FieldType.Password:
|
|
4322
4378
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PasswordField_default, { ...commonProps, onChange });
|
|
4323
|
-
case
|
|
4379
|
+
case import_browser33.FieldType.Text:
|
|
4324
4380
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TextField_default, { ...commonProps, type: "text", onChange: (e) => onChange(e.target.value), autoComplete: "off" });
|
|
4325
|
-
case
|
|
4381
|
+
case import_browser33.FieldType.Email:
|
|
4326
4382
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TextField_default, { ...commonProps, type: "email", onChange: (e) => onChange(e.target.value), autoComplete: "email" });
|
|
4327
|
-
case
|
|
4383
|
+
case import_browser33.FieldType.Date:
|
|
4328
4384
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DatePicker_default, { ...commonProps, onChange: (e) => onChange(e.target.value) });
|
|
4329
|
-
case
|
|
4385
|
+
case import_browser33.FieldType.Checkbox:
|
|
4330
4386
|
const isChecked = value === "true" || value === true;
|
|
4331
4387
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Checkbox_default, { ...commonProps, checked: isChecked, onChange: (e) => onChange(e.target.checked.toString()) });
|
|
4332
|
-
case
|
|
4388
|
+
case import_browser33.FieldType.Otp:
|
|
4333
4389
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(OtpField_default, { ...commonProps, onChange: (e) => onChange(e.target.value) });
|
|
4334
|
-
case
|
|
4390
|
+
case import_browser33.FieldType.Number:
|
|
4335
4391
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4336
4392
|
TextField_default,
|
|
4337
4393
|
{
|
|
@@ -4341,7 +4397,7 @@ var createField = (config) => {
|
|
|
4341
4397
|
helperText: "Enter a numeric value"
|
|
4342
4398
|
}
|
|
4343
4399
|
);
|
|
4344
|
-
case
|
|
4400
|
+
case import_browser33.FieldType.Select:
|
|
4345
4401
|
const fieldOptions = options.length > 0 ? options : [];
|
|
4346
4402
|
if (fieldOptions.length > 0) {
|
|
4347
4403
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
@@ -4404,7 +4460,7 @@ var UsernamePassword = ({
|
|
|
4404
4460
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
4405
4461
|
formFields.map((param) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: createField({
|
|
4406
4462
|
name: param.param,
|
|
4407
|
-
type: param.type ===
|
|
4463
|
+
type: param.type === import_browser34.EmbeddedSignInFlowAuthenticatorParamType.String ? param.confidential ? import_browser34.FieldType.Password : import_browser34.FieldType.Text : import_browser34.FieldType.Text,
|
|
4408
4464
|
label: param.displayName,
|
|
4409
4465
|
required: authenticator.requiredParams.includes(param.param),
|
|
4410
4466
|
value: formValues[param.param] || "",
|
|
@@ -4419,13 +4475,13 @@ var UsernamePassword = ({
|
|
|
4419
4475
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4420
4476
|
Button_default,
|
|
4421
4477
|
{
|
|
4478
|
+
fullWidth: true,
|
|
4422
4479
|
type: "submit",
|
|
4480
|
+
color: "primary",
|
|
4481
|
+
variant: "solid",
|
|
4423
4482
|
disabled: isLoading,
|
|
4424
4483
|
loading: isLoading,
|
|
4425
4484
|
className: buttonClassName,
|
|
4426
|
-
color: "primary",
|
|
4427
|
-
variant: "solid",
|
|
4428
|
-
fullWidth: true,
|
|
4429
4485
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4430
4486
|
children: t("username.password.submit.button")
|
|
4431
4487
|
}
|
|
@@ -4435,7 +4491,7 @@ var UsernamePassword = ({
|
|
|
4435
4491
|
var UsernamePassword_default = UsernamePassword;
|
|
4436
4492
|
|
|
4437
4493
|
// src/components/presentation/SignIn/options/IdentifierFirst.tsx
|
|
4438
|
-
var
|
|
4494
|
+
var import_browser35 = require("@asgardeo/browser");
|
|
4439
4495
|
var import_react45 = require("react");
|
|
4440
4496
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4441
4497
|
var IdentifierFirst = ({
|
|
@@ -4460,7 +4516,7 @@ var IdentifierFirst = ({
|
|
|
4460
4516
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4461
4517
|
formFields.map((param) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: createField({
|
|
4462
4518
|
name: param.param,
|
|
4463
|
-
type: param.type ===
|
|
4519
|
+
type: param.type === import_browser35.EmbeddedSignInFlowAuthenticatorParamType.String ? param.confidential ? import_browser35.FieldType.Password : import_browser35.FieldType.Text : import_browser35.FieldType.Text,
|
|
4464
4520
|
label: param.displayName,
|
|
4465
4521
|
required: authenticator.requiredParams.includes(param.param),
|
|
4466
4522
|
value: formValues[param.param] || "",
|
|
@@ -4475,13 +4531,13 @@ var IdentifierFirst = ({
|
|
|
4475
4531
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4476
4532
|
Button_default,
|
|
4477
4533
|
{
|
|
4534
|
+
fullWidth: true,
|
|
4478
4535
|
type: "submit",
|
|
4536
|
+
color: "primary",
|
|
4537
|
+
variant: "solid",
|
|
4479
4538
|
disabled: isLoading,
|
|
4480
4539
|
loading: isLoading,
|
|
4481
4540
|
className: buttonClassName,
|
|
4482
|
-
color: "primary",
|
|
4483
|
-
variant: "solid",
|
|
4484
|
-
fullWidth: true,
|
|
4485
4541
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4486
4542
|
children: t("identifier.first.submit.button")
|
|
4487
4543
|
}
|
|
@@ -4490,29 +4546,24 @@ var IdentifierFirst = ({
|
|
|
4490
4546
|
};
|
|
4491
4547
|
var IdentifierFirst_default = IdentifierFirst;
|
|
4492
4548
|
|
|
4493
|
-
// src/components/presentation/
|
|
4549
|
+
// src/components/presentation/options/GoogleButton.tsx
|
|
4494
4550
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4495
4551
|
var GoogleButton = ({
|
|
4496
|
-
authenticator,
|
|
4497
4552
|
isLoading,
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4553
|
+
preferences,
|
|
4554
|
+
children,
|
|
4555
|
+
...rest
|
|
4501
4556
|
}) => {
|
|
4502
4557
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4503
|
-
const handleClick = () => {
|
|
4504
|
-
onSubmit(authenticator);
|
|
4505
|
-
};
|
|
4506
4558
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4507
4559
|
Button_default,
|
|
4508
4560
|
{
|
|
4561
|
+
...rest,
|
|
4562
|
+
fullWidth: true,
|
|
4509
4563
|
type: "button",
|
|
4510
|
-
variant: "solid",
|
|
4511
4564
|
color: "secondary",
|
|
4512
|
-
|
|
4565
|
+
variant: "solid",
|
|
4513
4566
|
disabled: isLoading,
|
|
4514
|
-
onClick: handleClick,
|
|
4515
|
-
className: buttonClassName,
|
|
4516
4567
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 67.91 67.901", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("g", { transform: "translate(-0.001 -0.001)", children: [
|
|
4517
4568
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4518
4569
|
"path",
|
|
@@ -4547,35 +4598,30 @@ var GoogleButton = ({
|
|
|
4547
4598
|
}
|
|
4548
4599
|
)
|
|
4549
4600
|
] }) }),
|
|
4550
|
-
children: t("elements.buttons.google")
|
|
4601
|
+
children: children ?? t("elements.buttons.google")
|
|
4551
4602
|
}
|
|
4552
4603
|
);
|
|
4553
4604
|
};
|
|
4554
4605
|
var GoogleButton_default = GoogleButton;
|
|
4555
4606
|
|
|
4556
|
-
// src/components/presentation/
|
|
4607
|
+
// src/components/presentation/options/GitHubButton.tsx
|
|
4557
4608
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4558
4609
|
var GitHubButton = ({
|
|
4559
|
-
authenticator,
|
|
4560
4610
|
isLoading,
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4611
|
+
preferences,
|
|
4612
|
+
children,
|
|
4613
|
+
...rest
|
|
4564
4614
|
}) => {
|
|
4565
4615
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4566
|
-
const handleClick = () => {
|
|
4567
|
-
onSubmit(authenticator);
|
|
4568
|
-
};
|
|
4569
4616
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4570
4617
|
Button_default,
|
|
4571
4618
|
{
|
|
4619
|
+
...rest,
|
|
4620
|
+
fullWidth: true,
|
|
4572
4621
|
type: "button",
|
|
4573
|
-
variant: "solid",
|
|
4574
4622
|
color: "secondary",
|
|
4575
|
-
|
|
4623
|
+
variant: "solid",
|
|
4576
4624
|
disabled: isLoading,
|
|
4577
|
-
onClick: handleClick,
|
|
4578
|
-
className: buttonClassName,
|
|
4579
4625
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 67.91 66.233", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("g", { transform: "translate(-386.96 658.072)", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4580
4626
|
"path",
|
|
4581
4627
|
{
|
|
@@ -4583,35 +4629,30 @@ var GitHubButton = ({
|
|
|
4583
4629
|
fill: "#ffffff"
|
|
4584
4630
|
}
|
|
4585
4631
|
) }) }),
|
|
4586
|
-
children: t("elements.buttons.github")
|
|
4632
|
+
children: children ?? t("elements.buttons.github")
|
|
4587
4633
|
}
|
|
4588
4634
|
);
|
|
4589
4635
|
};
|
|
4590
4636
|
var GitHubButton_default = GitHubButton;
|
|
4591
4637
|
|
|
4592
|
-
// src/components/presentation/
|
|
4638
|
+
// src/components/presentation/options/MicrosoftButton.tsx
|
|
4593
4639
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4594
4640
|
var MicrosoftButton = ({
|
|
4595
|
-
authenticator,
|
|
4596
4641
|
isLoading,
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4642
|
+
preferences,
|
|
4643
|
+
children,
|
|
4644
|
+
...rest
|
|
4600
4645
|
}) => {
|
|
4601
4646
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4602
|
-
const handleClick = () => {
|
|
4603
|
-
onSubmit(authenticator);
|
|
4604
|
-
};
|
|
4605
4647
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4606
4648
|
Button_default,
|
|
4607
4649
|
{
|
|
4608
|
-
|
|
4609
|
-
variant: "outline",
|
|
4610
|
-
color: "primary",
|
|
4650
|
+
...rest,
|
|
4611
4651
|
fullWidth: true,
|
|
4652
|
+
type: "button",
|
|
4653
|
+
color: "secondary",
|
|
4654
|
+
variant: "solid",
|
|
4612
4655
|
disabled: isLoading,
|
|
4613
|
-
onClick: handleClick,
|
|
4614
|
-
className: buttonClassName,
|
|
4615
4656
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 23 23", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4616
4657
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { fill: "#f3f3f3", d: "M0 0h23v23H0z" }),
|
|
4617
4658
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { fill: "#f35325", d: "M1 1h10v10H1z" }),
|
|
@@ -4619,36 +4660,30 @@ var MicrosoftButton = ({
|
|
|
4619
4660
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { fill: "#05a6f0", d: "M1 12h10v10H1z" }),
|
|
4620
4661
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { fill: "#ffba08", d: "M12 12h10v10H12z" })
|
|
4621
4662
|
] }),
|
|
4622
|
-
children: t("elements.buttons.microsoft")
|
|
4663
|
+
children: children ?? t("elements.buttons.microsoft")
|
|
4623
4664
|
}
|
|
4624
4665
|
);
|
|
4625
4666
|
};
|
|
4626
4667
|
var MicrosoftButton_default = MicrosoftButton;
|
|
4627
4668
|
|
|
4628
|
-
// src/components/presentation/
|
|
4669
|
+
// src/components/presentation/options/FacebookButton.tsx
|
|
4629
4670
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4630
4671
|
var FacebookButton = ({
|
|
4631
|
-
authenticator,
|
|
4632
4672
|
isLoading,
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
preferences
|
|
4673
|
+
preferences,
|
|
4674
|
+
children,
|
|
4675
|
+
...rest
|
|
4637
4676
|
}) => {
|
|
4638
4677
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4639
|
-
const handleClick = () => {
|
|
4640
|
-
onSubmit(authenticator);
|
|
4641
|
-
};
|
|
4642
4678
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4643
4679
|
Button_default,
|
|
4644
4680
|
{
|
|
4681
|
+
...rest,
|
|
4682
|
+
fullWidth: true,
|
|
4645
4683
|
type: "button",
|
|
4646
|
-
variant: "solid",
|
|
4647
4684
|
color: "primary",
|
|
4648
|
-
|
|
4685
|
+
variant: "solid",
|
|
4649
4686
|
disabled: isLoading,
|
|
4650
|
-
onClick: handleClick,
|
|
4651
|
-
className: buttonClassName,
|
|
4652
4687
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 512 512", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4653
4688
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4654
4689
|
"path",
|
|
@@ -4665,35 +4700,30 @@ var FacebookButton = ({
|
|
|
4665
4700
|
}
|
|
4666
4701
|
)
|
|
4667
4702
|
] }),
|
|
4668
|
-
children: t("elements.buttons.facebook")
|
|
4703
|
+
children: children ?? t("elements.buttons.facebook")
|
|
4669
4704
|
}
|
|
4670
4705
|
);
|
|
4671
4706
|
};
|
|
4672
4707
|
var FacebookButton_default = FacebookButton;
|
|
4673
4708
|
|
|
4674
|
-
// src/components/presentation/
|
|
4709
|
+
// src/components/presentation/options/LinkedInButton.tsx
|
|
4675
4710
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4676
4711
|
var LinkedInButton = ({
|
|
4677
|
-
authenticator,
|
|
4678
4712
|
isLoading,
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4713
|
+
preferences,
|
|
4714
|
+
children,
|
|
4715
|
+
...rest
|
|
4682
4716
|
}) => {
|
|
4683
4717
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4684
|
-
const handleClick = () => {
|
|
4685
|
-
onSubmit(authenticator);
|
|
4686
|
-
};
|
|
4687
4718
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4688
4719
|
Button_default,
|
|
4689
4720
|
{
|
|
4690
|
-
|
|
4691
|
-
variant: "outline",
|
|
4692
|
-
color: "primary",
|
|
4721
|
+
...rest,
|
|
4693
4722
|
fullWidth: true,
|
|
4723
|
+
type: "button",
|
|
4724
|
+
color: "secondary",
|
|
4725
|
+
variant: "solid",
|
|
4694
4726
|
disabled: isLoading,
|
|
4695
|
-
onClick: handleClick,
|
|
4696
|
-
className: buttonClassName,
|
|
4697
4727
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4698
4728
|
"path",
|
|
4699
4729
|
{
|
|
@@ -4701,35 +4731,30 @@ var LinkedInButton = ({
|
|
|
4701
4731
|
d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
|
4702
4732
|
}
|
|
4703
4733
|
) }),
|
|
4704
|
-
children: t("elements.buttons.linkedin")
|
|
4734
|
+
children: children ?? t("elements.buttons.linkedin")
|
|
4705
4735
|
}
|
|
4706
4736
|
);
|
|
4707
4737
|
};
|
|
4708
4738
|
var LinkedInButton_default = LinkedInButton;
|
|
4709
4739
|
|
|
4710
|
-
// src/components/presentation/
|
|
4740
|
+
// src/components/presentation/options/SignInWithEthereumButton.tsx
|
|
4711
4741
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4712
4742
|
var SignInWithEthereumButton = ({
|
|
4713
|
-
authenticator,
|
|
4714
4743
|
isLoading,
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4744
|
+
preferences,
|
|
4745
|
+
children,
|
|
4746
|
+
...rest
|
|
4718
4747
|
}) => {
|
|
4719
4748
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4720
|
-
const handleClick = () => {
|
|
4721
|
-
onSubmit(authenticator);
|
|
4722
|
-
};
|
|
4723
4749
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4724
4750
|
Button_default,
|
|
4725
4751
|
{
|
|
4752
|
+
...rest,
|
|
4753
|
+
fullWidth: true,
|
|
4726
4754
|
type: "button",
|
|
4727
|
-
variant: "outline",
|
|
4728
4755
|
color: "secondary",
|
|
4729
|
-
|
|
4756
|
+
variant: "solid",
|
|
4730
4757
|
disabled: isLoading,
|
|
4731
|
-
onClick: handleClick,
|
|
4732
|
-
className: buttonClassName,
|
|
4733
4758
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4734
4759
|
"path",
|
|
4735
4760
|
{
|
|
@@ -4737,14 +4762,14 @@ var SignInWithEthereumButton = ({
|
|
|
4737
4762
|
d: "M11.944 17.97L4.58 13.62 11.943 24l7.37-10.38-7.372 4.35h.003zM12.056 0L4.69 12.223l7.365 4.354 7.365-4.35L12.056 0z"
|
|
4738
4763
|
}
|
|
4739
4764
|
) }),
|
|
4740
|
-
children: t("elements.buttons.ethereum")
|
|
4765
|
+
children: children ?? t("elements.buttons.ethereum")
|
|
4741
4766
|
}
|
|
4742
4767
|
);
|
|
4743
4768
|
};
|
|
4744
4769
|
var SignInWithEthereumButton_default = SignInWithEthereumButton;
|
|
4745
4770
|
|
|
4746
4771
|
// src/components/presentation/SignIn/options/EmailOtp.tsx
|
|
4747
|
-
var
|
|
4772
|
+
var import_browser36 = require("@asgardeo/browser");
|
|
4748
4773
|
var import_react46 = require("react");
|
|
4749
4774
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4750
4775
|
var EmailOtp = ({
|
|
@@ -4783,7 +4808,7 @@ var EmailOtp = ({
|
|
|
4783
4808
|
}
|
|
4784
4809
|
) : createField({
|
|
4785
4810
|
name: param.param,
|
|
4786
|
-
type: param.type ===
|
|
4811
|
+
type: param.type === import_browser36.EmbeddedSignInFlowAuthenticatorParamType.String ? param.confidential ? import_browser36.FieldType.Password : import_browser36.FieldType.Text : import_browser36.FieldType.Text,
|
|
4787
4812
|
label: param.displayName,
|
|
4788
4813
|
required: authenticator.requiredParams.includes(param.param),
|
|
4789
4814
|
value: formValues[param.param] || "",
|
|
@@ -4796,13 +4821,13 @@ var EmailOtp = ({
|
|
|
4796
4821
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4797
4822
|
Button_default,
|
|
4798
4823
|
{
|
|
4824
|
+
fullWidth: true,
|
|
4799
4825
|
type: "submit",
|
|
4826
|
+
color: "primary",
|
|
4827
|
+
variant: "solid",
|
|
4800
4828
|
disabled: isLoading,
|
|
4801
4829
|
loading: isLoading,
|
|
4802
4830
|
className: buttonClassName,
|
|
4803
|
-
color: "primary",
|
|
4804
|
-
variant: "solid",
|
|
4805
|
-
fullWidth: true,
|
|
4806
4831
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4807
4832
|
children: t("email.otp.submit.button")
|
|
4808
4833
|
}
|
|
@@ -4812,7 +4837,7 @@ var EmailOtp = ({
|
|
|
4812
4837
|
var EmailOtp_default = EmailOtp;
|
|
4813
4838
|
|
|
4814
4839
|
// src/components/presentation/SignIn/options/Totp.tsx
|
|
4815
|
-
var
|
|
4840
|
+
var import_browser37 = require("@asgardeo/browser");
|
|
4816
4841
|
var import_react47 = require("react");
|
|
4817
4842
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4818
4843
|
var Totp = ({
|
|
@@ -4851,7 +4876,7 @@ var Totp = ({
|
|
|
4851
4876
|
}
|
|
4852
4877
|
) : createField({
|
|
4853
4878
|
name: param.param,
|
|
4854
|
-
type: param.type ===
|
|
4879
|
+
type: param.type === import_browser37.EmbeddedSignInFlowAuthenticatorParamType.String ? param.confidential ? import_browser37.FieldType.Password : import_browser37.FieldType.Text : import_browser37.FieldType.Text,
|
|
4855
4880
|
label: param.displayName,
|
|
4856
4881
|
required: authenticator.requiredParams.includes(param.param),
|
|
4857
4882
|
value: formValues[param.param] || "",
|
|
@@ -4864,13 +4889,13 @@ var Totp = ({
|
|
|
4864
4889
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4865
4890
|
Button_default,
|
|
4866
4891
|
{
|
|
4892
|
+
fullWidth: true,
|
|
4867
4893
|
type: "submit",
|
|
4894
|
+
color: "primary",
|
|
4895
|
+
variant: "solid",
|
|
4868
4896
|
disabled: isLoading,
|
|
4869
4897
|
loading: isLoading,
|
|
4870
4898
|
className: buttonClassName,
|
|
4871
|
-
color: "primary",
|
|
4872
|
-
variant: "solid",
|
|
4873
|
-
fullWidth: true,
|
|
4874
4899
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4875
4900
|
children: t("totp.submit.button")
|
|
4876
4901
|
}
|
|
@@ -4880,7 +4905,7 @@ var Totp = ({
|
|
|
4880
4905
|
var Totp_default = Totp;
|
|
4881
4906
|
|
|
4882
4907
|
// src/components/presentation/SignIn/options/SmsOtp.tsx
|
|
4883
|
-
var
|
|
4908
|
+
var import_browser38 = require("@asgardeo/browser");
|
|
4884
4909
|
var import_react48 = require("react");
|
|
4885
4910
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4886
4911
|
var SmsOtp = ({
|
|
@@ -4919,7 +4944,7 @@ var SmsOtp = ({
|
|
|
4919
4944
|
}
|
|
4920
4945
|
) : createField({
|
|
4921
4946
|
name: param.param,
|
|
4922
|
-
type: param.type ===
|
|
4947
|
+
type: param.type === import_browser38.EmbeddedSignInFlowAuthenticatorParamType.String ? param.confidential ? import_browser38.FieldType.Password : import_browser38.FieldType.Text : import_browser38.FieldType.Text,
|
|
4923
4948
|
label: param.displayName,
|
|
4924
4949
|
required: authenticator.requiredParams.includes(param.param),
|
|
4925
4950
|
value: formValues[param.param] || "",
|
|
@@ -4932,13 +4957,13 @@ var SmsOtp = ({
|
|
|
4932
4957
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4933
4958
|
Button_default,
|
|
4934
4959
|
{
|
|
4960
|
+
fullWidth: true,
|
|
4935
4961
|
type: "submit",
|
|
4962
|
+
color: "primary",
|
|
4963
|
+
variant: "solid",
|
|
4936
4964
|
disabled: isLoading,
|
|
4937
4965
|
loading: isLoading,
|
|
4938
4966
|
className: buttonClassName,
|
|
4939
|
-
color: "primary",
|
|
4940
|
-
variant: "solid",
|
|
4941
|
-
fullWidth: true,
|
|
4942
4967
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4943
4968
|
children: t("sms.otp.submit.button")
|
|
4944
4969
|
}
|
|
@@ -4947,33 +4972,24 @@ var SmsOtp = ({
|
|
|
4947
4972
|
};
|
|
4948
4973
|
var SmsOtp_default = SmsOtp;
|
|
4949
4974
|
|
|
4950
|
-
// src/components/presentation/
|
|
4975
|
+
// src/components/presentation/options/SocialButton.tsx
|
|
4951
4976
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4952
4977
|
var SocialLogin = ({
|
|
4953
|
-
authenticator,
|
|
4954
4978
|
isLoading,
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4979
|
+
preferences,
|
|
4980
|
+
children,
|
|
4981
|
+
...rest
|
|
4958
4982
|
}) => {
|
|
4959
4983
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4960
|
-
const getDisplayName = () => {
|
|
4961
|
-
const providerName = authenticator.idp;
|
|
4962
|
-
return t("elements.buttons.social", { connection: providerName });
|
|
4963
|
-
};
|
|
4964
|
-
const handleClick = () => {
|
|
4965
|
-
onSubmit(authenticator);
|
|
4966
|
-
};
|
|
4967
4984
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4968
4985
|
Button_default,
|
|
4969
4986
|
{
|
|
4987
|
+
...rest,
|
|
4988
|
+
fullWidth: true,
|
|
4970
4989
|
type: "button",
|
|
4971
|
-
variant: "outline",
|
|
4972
4990
|
color: "secondary",
|
|
4973
|
-
|
|
4991
|
+
variant: "outline",
|
|
4974
4992
|
disabled: isLoading,
|
|
4975
|
-
onClick: handleClick,
|
|
4976
|
-
className: buttonClassName,
|
|
4977
4993
|
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4978
4994
|
"path",
|
|
4979
4995
|
{
|
|
@@ -4981,14 +4997,14 @@ var SocialLogin = ({
|
|
|
4981
4997
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
4982
4998
|
}
|
|
4983
4999
|
) }),
|
|
4984
|
-
children:
|
|
5000
|
+
children: t("elements.buttons.social", { connection: children })
|
|
4985
5001
|
}
|
|
4986
5002
|
);
|
|
4987
5003
|
};
|
|
4988
5004
|
var SocialButton_default = SocialLogin;
|
|
4989
5005
|
|
|
4990
5006
|
// src/components/presentation/SignIn/options/MultiOptionButton.tsx
|
|
4991
|
-
var
|
|
5007
|
+
var import_browser39 = require("@asgardeo/browser");
|
|
4992
5008
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4993
5009
|
var MultiOptionButton = ({
|
|
4994
5010
|
authenticator,
|
|
@@ -5000,7 +5016,7 @@ var MultiOptionButton = ({
|
|
|
5000
5016
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
5001
5017
|
const getDisplayName = () => {
|
|
5002
5018
|
let authenticatorName = authenticator.authenticator;
|
|
5003
|
-
if (authenticator.idp !==
|
|
5019
|
+
if (authenticator.idp !== import_browser39.EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {
|
|
5004
5020
|
authenticatorName = authenticator.idp;
|
|
5005
5021
|
}
|
|
5006
5022
|
switch (authenticatorName) {
|
|
@@ -5011,7 +5027,7 @@ var MultiOptionButton = ({
|
|
|
5011
5027
|
const getIcon = () => {
|
|
5012
5028
|
const authenticatorId = authenticator.authenticatorId;
|
|
5013
5029
|
switch (authenticatorId) {
|
|
5014
|
-
case
|
|
5030
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:
|
|
5015
5031
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5016
5032
|
"path",
|
|
5017
5033
|
{
|
|
@@ -5019,7 +5035,7 @@ var MultiOptionButton = ({
|
|
|
5019
5035
|
d: "M20 15.5c-1.25 0-2.45-.2-3.57-.57a1.02 1.02 0 0 0-1.02.24l-2.2 2.2a15.074 15.074 0 0 1-6.59-6.59l2.2-2.2c.27-.27.35-.67.24-1.02A11.36 11.36 0 0 1 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1M12 3v10l3-3h6V3z"
|
|
5020
5036
|
}
|
|
5021
5037
|
) });
|
|
5022
|
-
case
|
|
5038
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:
|
|
5023
5039
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5024
5040
|
"path",
|
|
5025
5041
|
{
|
|
@@ -5027,9 +5043,9 @@ var MultiOptionButton = ({
|
|
|
5027
5043
|
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4l-8 5l-8-5V6l8 5l8-5z"
|
|
5028
5044
|
}
|
|
5029
5045
|
) });
|
|
5030
|
-
case
|
|
5046
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:
|
|
5031
5047
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { fill: "currentColor", d: "M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5z" }) });
|
|
5032
|
-
case
|
|
5048
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.PushNotification:
|
|
5033
5049
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5034
5050
|
"path",
|
|
5035
5051
|
{
|
|
@@ -5037,7 +5053,7 @@ var MultiOptionButton = ({
|
|
|
5037
5053
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m1-13h-2v6h2zm0 8h-2v2h2z"
|
|
5038
5054
|
}
|
|
5039
5055
|
) });
|
|
5040
|
-
case
|
|
5056
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey:
|
|
5041
5057
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("svg", { fill: "currentColor", width: "18", height: "18", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
5042
5058
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }),
|
|
5043
5059
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("g", { id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
@@ -5046,7 +5062,7 @@ var MultiOptionButton = ({
|
|
|
5046
5062
|
" "
|
|
5047
5063
|
] })
|
|
5048
5064
|
] });
|
|
5049
|
-
case
|
|
5065
|
+
case import_browser39.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.MagicLink:
|
|
5050
5066
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5051
5067
|
"path",
|
|
5052
5068
|
{
|
|
@@ -5070,10 +5086,10 @@ var MultiOptionButton = ({
|
|
|
5070
5086
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5071
5087
|
Button_default,
|
|
5072
5088
|
{
|
|
5073
|
-
type: "button",
|
|
5074
|
-
variant: "outline",
|
|
5075
|
-
color: "primary",
|
|
5076
5089
|
fullWidth: true,
|
|
5090
|
+
type: "button",
|
|
5091
|
+
color: "secondary",
|
|
5092
|
+
variant: "solid",
|
|
5077
5093
|
disabled: isLoading,
|
|
5078
5094
|
onClick: handleClick,
|
|
5079
5095
|
className: buttonClassName,
|
|
@@ -5086,40 +5102,109 @@ var MultiOptionButton_default = MultiOptionButton;
|
|
|
5086
5102
|
|
|
5087
5103
|
// src/components/presentation/SignIn/options/SignInOptionFactory.tsx
|
|
5088
5104
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5089
|
-
var createSignInOption = (
|
|
5090
|
-
|
|
5105
|
+
var createSignInOption = ({
|
|
5106
|
+
authenticator,
|
|
5107
|
+
onSubmit,
|
|
5108
|
+
buttonClassName,
|
|
5109
|
+
preferences,
|
|
5110
|
+
...rest
|
|
5111
|
+
}) => {
|
|
5091
5112
|
const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;
|
|
5092
5113
|
switch (authenticator.authenticatorId) {
|
|
5093
|
-
case
|
|
5094
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UsernamePassword_default, { ...
|
|
5095
|
-
case
|
|
5096
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IdentifierFirst_default, { ...
|
|
5097
|
-
case
|
|
5098
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5114
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.UsernamePassword:
|
|
5115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UsernamePassword_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5116
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.IdentifierFirst:
|
|
5117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IdentifierFirst_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5118
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Google:
|
|
5119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5120
|
+
GoogleButton_default,
|
|
5121
|
+
{
|
|
5122
|
+
className: buttonClassName,
|
|
5123
|
+
onClick: () => onSubmit(authenticator),
|
|
5124
|
+
authenticator,
|
|
5125
|
+
preferences,
|
|
5126
|
+
...rest
|
|
5127
|
+
}
|
|
5128
|
+
);
|
|
5129
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.GitHub:
|
|
5130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5131
|
+
GitHubButton_default,
|
|
5132
|
+
{
|
|
5133
|
+
authenticator,
|
|
5134
|
+
preferences,
|
|
5135
|
+
className: buttonClassName,
|
|
5136
|
+
onClick: () => onSubmit(authenticator),
|
|
5137
|
+
...rest
|
|
5138
|
+
}
|
|
5139
|
+
);
|
|
5140
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Microsoft:
|
|
5141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5142
|
+
MicrosoftButton_default,
|
|
5143
|
+
{
|
|
5144
|
+
authenticator,
|
|
5145
|
+
preferences,
|
|
5146
|
+
className: buttonClassName,
|
|
5147
|
+
onClick: () => onSubmit(authenticator),
|
|
5148
|
+
...rest
|
|
5149
|
+
}
|
|
5150
|
+
);
|
|
5151
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Facebook:
|
|
5152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5153
|
+
FacebookButton_default,
|
|
5154
|
+
{
|
|
5155
|
+
authenticator,
|
|
5156
|
+
preferences,
|
|
5157
|
+
className: buttonClassName,
|
|
5158
|
+
onClick: () => onSubmit(authenticator),
|
|
5159
|
+
...rest
|
|
5160
|
+
}
|
|
5161
|
+
);
|
|
5162
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.LinkedIn:
|
|
5163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5164
|
+
LinkedInButton_default,
|
|
5165
|
+
{
|
|
5166
|
+
authenticator,
|
|
5167
|
+
preferences,
|
|
5168
|
+
className: buttonClassName,
|
|
5169
|
+
onClick: () => onSubmit(authenticator),
|
|
5170
|
+
...rest
|
|
5171
|
+
}
|
|
5172
|
+
);
|
|
5173
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SignInWithEthereum:
|
|
5174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5175
|
+
SignInWithEthereumButton_default,
|
|
5176
|
+
{
|
|
5177
|
+
authenticator,
|
|
5178
|
+
preferences,
|
|
5179
|
+
className: buttonClassName,
|
|
5180
|
+
onClick: () => onSubmit(authenticator),
|
|
5181
|
+
...rest
|
|
5182
|
+
}
|
|
5183
|
+
);
|
|
5184
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.EmailOtp:
|
|
5185
|
+
return hasParams ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EmailOtp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5186
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Totp:
|
|
5187
|
+
return hasParams ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Totp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5188
|
+
case import_browser40.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.SmsOtp:
|
|
5189
|
+
return hasParams ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SmsOtp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5115
5190
|
default:
|
|
5116
|
-
if (authenticator.idp !==
|
|
5117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5191
|
+
if (authenticator.idp !== import_browser40.EmbeddedSignInFlowAuthenticatorKnownIdPType.Local) {
|
|
5192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5193
|
+
SocialButton_default,
|
|
5194
|
+
{
|
|
5195
|
+
authenticator,
|
|
5196
|
+
preferences,
|
|
5197
|
+
className: buttonClassName,
|
|
5198
|
+
onClick: () => onSubmit(authenticator),
|
|
5199
|
+
...rest,
|
|
5200
|
+
children: authenticator.idp
|
|
5201
|
+
}
|
|
5202
|
+
);
|
|
5118
5203
|
}
|
|
5119
5204
|
if (hasParams) {
|
|
5120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UsernamePassword_default, { ...
|
|
5205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UsernamePassword_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5121
5206
|
} else {
|
|
5122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiOptionButton_default, { ...
|
|
5207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5123
5208
|
}
|
|
5124
5209
|
}
|
|
5125
5210
|
};
|
|
@@ -5137,7 +5222,7 @@ var createSignInOptionFromAuthenticator = (authenticator, formValues, touchedFie
|
|
|
5137
5222
|
|
|
5138
5223
|
// src/components/primitives/Alert/Alert.tsx
|
|
5139
5224
|
var import_react50 = require("react");
|
|
5140
|
-
var
|
|
5225
|
+
var import_browser41 = require("@asgardeo/browser");
|
|
5141
5226
|
var import_css27 = require("@emotion/css");
|
|
5142
5227
|
|
|
5143
5228
|
// src/components/primitives/Icons/CircleCheck.tsx
|
|
@@ -5338,16 +5423,16 @@ var Alert = (0, import_react50.forwardRef)(
|
|
|
5338
5423
|
role: "alert",
|
|
5339
5424
|
style,
|
|
5340
5425
|
className: (0, import_css27.cx)(
|
|
5341
|
-
(0,
|
|
5426
|
+
(0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert")),
|
|
5342
5427
|
styles.alert,
|
|
5343
5428
|
styles.variant,
|
|
5344
|
-
(0,
|
|
5429
|
+
(0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert", null, variant)),
|
|
5345
5430
|
className
|
|
5346
5431
|
),
|
|
5347
5432
|
...rest,
|
|
5348
5433
|
children: [
|
|
5349
|
-
showIcon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_css27.cx)((0,
|
|
5350
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_css27.cx)((0,
|
|
5434
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_css27.cx)((0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert", "icon")), styles.icon), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(IconComponent, {}) }),
|
|
5435
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: (0, import_css27.cx)((0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert", "content")), styles.content), children })
|
|
5351
5436
|
]
|
|
5352
5437
|
}
|
|
5353
5438
|
) });
|
|
@@ -5365,7 +5450,7 @@ var AlertTitle = (0, import_react50.forwardRef)(({ children, className, style, .
|
|
|
5365
5450
|
variant: "h6",
|
|
5366
5451
|
fontWeight: 600,
|
|
5367
5452
|
style,
|
|
5368
|
-
className: (0, import_css27.cx)((0,
|
|
5453
|
+
className: (0, import_css27.cx)((0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert", "title")), styles.title, className),
|
|
5369
5454
|
...filteredRest,
|
|
5370
5455
|
children
|
|
5371
5456
|
}
|
|
@@ -5383,7 +5468,7 @@ var AlertDescription = (0, import_react50.forwardRef)(
|
|
|
5383
5468
|
component: "p",
|
|
5384
5469
|
variant: "body2",
|
|
5385
5470
|
style,
|
|
5386
|
-
className: (0, import_css27.cx)((0,
|
|
5471
|
+
className: (0, import_css27.cx)((0, import_browser41.withVendorCSSClassPrefix)((0, import_browser41.bem)("alert", "description")), styles.description, className),
|
|
5387
5472
|
...filteredRest,
|
|
5388
5473
|
children
|
|
5389
5474
|
}
|
|
@@ -5398,7 +5483,7 @@ Alert.Description = AlertDescription;
|
|
|
5398
5483
|
var Alert_default = Alert;
|
|
5399
5484
|
|
|
5400
5485
|
// src/components/primitives/Card/Card.tsx
|
|
5401
|
-
var
|
|
5486
|
+
var import_browser42 = require("@asgardeo/browser");
|
|
5402
5487
|
var import_css29 = require("@emotion/css");
|
|
5403
5488
|
var import_react52 = require("react");
|
|
5404
5489
|
|
|
@@ -5493,13 +5578,13 @@ var Card = (0, import_react52.forwardRef)(
|
|
|
5493
5578
|
ref,
|
|
5494
5579
|
style,
|
|
5495
5580
|
className: (0, import_css29.cx)(
|
|
5496
|
-
(0,
|
|
5581
|
+
(0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card")),
|
|
5497
5582
|
styles.card,
|
|
5498
5583
|
styles.variant,
|
|
5499
5584
|
styles.clickable,
|
|
5500
|
-
(0,
|
|
5585
|
+
(0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", null, variant)),
|
|
5501
5586
|
{
|
|
5502
|
-
[(0,
|
|
5587
|
+
[(0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", null, "clickable"))]: clickable
|
|
5503
5588
|
},
|
|
5504
5589
|
className
|
|
5505
5590
|
),
|
|
@@ -5517,7 +5602,7 @@ var CardHeader = (0, import_react52.forwardRef)(({ children, className, style, .
|
|
|
5517
5602
|
{
|
|
5518
5603
|
ref,
|
|
5519
5604
|
style,
|
|
5520
|
-
className: (0, import_css29.cx)((0,
|
|
5605
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "header")), styles.header, className),
|
|
5521
5606
|
...rest,
|
|
5522
5607
|
children
|
|
5523
5608
|
}
|
|
@@ -5570,7 +5655,7 @@ var CardTitle = (0, import_react52.forwardRef)(
|
|
|
5570
5655
|
component: getComponentFromLevel(level),
|
|
5571
5656
|
variant: getVariantFromLevel(level),
|
|
5572
5657
|
style,
|
|
5573
|
-
className: (0, import_css29.cx)((0,
|
|
5658
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "title")), styles.title, className),
|
|
5574
5659
|
fontWeight: 600,
|
|
5575
5660
|
...filteredRest,
|
|
5576
5661
|
children
|
|
@@ -5590,7 +5675,7 @@ var CardDescription = (0, import_react52.forwardRef)(
|
|
|
5590
5675
|
variant: "body2",
|
|
5591
5676
|
color: "textSecondary",
|
|
5592
5677
|
style,
|
|
5593
|
-
className: (0, import_css29.cx)((0,
|
|
5678
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "description")), styles.description, className),
|
|
5594
5679
|
...filteredRest,
|
|
5595
5680
|
children
|
|
5596
5681
|
}
|
|
@@ -5605,7 +5690,7 @@ var CardAction = (0, import_react52.forwardRef)(({ children, className, style, .
|
|
|
5605
5690
|
{
|
|
5606
5691
|
ref,
|
|
5607
5692
|
style,
|
|
5608
|
-
className: (0, import_css29.cx)((0,
|
|
5693
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "action")), styles.action, className),
|
|
5609
5694
|
...rest,
|
|
5610
5695
|
children
|
|
5611
5696
|
}
|
|
@@ -5619,7 +5704,7 @@ var CardContent = (0, import_react52.forwardRef)(({ children, className, style,
|
|
|
5619
5704
|
{
|
|
5620
5705
|
ref,
|
|
5621
5706
|
style,
|
|
5622
|
-
className: (0, import_css29.cx)((0,
|
|
5707
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "content")), styles.content, className),
|
|
5623
5708
|
...rest,
|
|
5624
5709
|
children
|
|
5625
5710
|
}
|
|
@@ -5633,7 +5718,7 @@ var CardFooter = (0, import_react52.forwardRef)(({ children, className, style, .
|
|
|
5633
5718
|
{
|
|
5634
5719
|
ref,
|
|
5635
5720
|
style,
|
|
5636
|
-
className: (0, import_css29.cx)((0,
|
|
5721
|
+
className: (0, import_css29.cx)((0, import_browser42.withVendorCSSClassPrefix)((0, import_browser42.bem)("card", "footer")), styles.footer, className),
|
|
5637
5722
|
...rest,
|
|
5638
5723
|
children
|
|
5639
5724
|
}
|
|
@@ -5655,7 +5740,7 @@ Card.Footer = CardFooter;
|
|
|
5655
5740
|
var Card_default = Card;
|
|
5656
5741
|
|
|
5657
5742
|
// src/components/primitives/Divider/Divider.tsx
|
|
5658
|
-
var
|
|
5743
|
+
var import_browser43 = require("@asgardeo/browser");
|
|
5659
5744
|
var import_css31 = require("@emotion/css");
|
|
5660
5745
|
|
|
5661
5746
|
// src/components/primitives/Divider/Divider.styles.ts
|
|
@@ -5724,8 +5809,8 @@ var Divider = ({
|
|
|
5724
5809
|
"div",
|
|
5725
5810
|
{
|
|
5726
5811
|
className: (0, import_css31.cx)(
|
|
5727
|
-
(0,
|
|
5728
|
-
(0,
|
|
5812
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider")),
|
|
5813
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "vertical")),
|
|
5729
5814
|
styles.divider,
|
|
5730
5815
|
styles.vertical,
|
|
5731
5816
|
className
|
|
@@ -5742,9 +5827,9 @@ var Divider = ({
|
|
|
5742
5827
|
"div",
|
|
5743
5828
|
{
|
|
5744
5829
|
className: (0, import_css31.cx)(
|
|
5745
|
-
(0,
|
|
5746
|
-
(0,
|
|
5747
|
-
(0,
|
|
5830
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider")),
|
|
5831
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "horizontal")),
|
|
5832
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "with-text")),
|
|
5748
5833
|
styles.divider,
|
|
5749
5834
|
styles.horizontal,
|
|
5750
5835
|
className
|
|
@@ -5754,18 +5839,18 @@ var Divider = ({
|
|
|
5754
5839
|
"aria-orientation": "horizontal",
|
|
5755
5840
|
...rest,
|
|
5756
5841
|
children: [
|
|
5757
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: (0, import_css31.cx)((0,
|
|
5842
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: (0, import_css31.cx)((0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "line")), styles.line) }),
|
|
5758
5843
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5759
5844
|
Typography_default,
|
|
5760
5845
|
{
|
|
5761
5846
|
variant: "body2",
|
|
5762
5847
|
color: "textSecondary",
|
|
5763
|
-
className: (0, import_css31.cx)((0,
|
|
5848
|
+
className: (0, import_css31.cx)((0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "text")), styles.text),
|
|
5764
5849
|
inline: true,
|
|
5765
5850
|
children
|
|
5766
5851
|
}
|
|
5767
5852
|
),
|
|
5768
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: (0, import_css31.cx)((0,
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: (0, import_css31.cx)((0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "line")), styles.line) })
|
|
5769
5854
|
]
|
|
5770
5855
|
}
|
|
5771
5856
|
);
|
|
@@ -5774,8 +5859,8 @@ var Divider = ({
|
|
|
5774
5859
|
"div",
|
|
5775
5860
|
{
|
|
5776
5861
|
className: (0, import_css31.cx)(
|
|
5777
|
-
(0,
|
|
5778
|
-
(0,
|
|
5862
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider")),
|
|
5863
|
+
(0, import_browser43.withVendorCSSClassPrefix)((0, import_browser43.bem)("divider", "horizontal")),
|
|
5779
5864
|
styles.divider,
|
|
5780
5865
|
styles.horizontal,
|
|
5781
5866
|
className
|
|
@@ -5791,7 +5876,7 @@ var Divider_default = Divider;
|
|
|
5791
5876
|
|
|
5792
5877
|
// src/components/primitives/Logo/Logo.tsx
|
|
5793
5878
|
var import_css33 = require("@emotion/css");
|
|
5794
|
-
var
|
|
5879
|
+
var import_browser44 = require("@asgardeo/browser");
|
|
5795
5880
|
|
|
5796
5881
|
// src/components/primitives/Logo/Logo.styles.ts
|
|
5797
5882
|
var import_css32 = require("@emotion/css");
|
|
@@ -5850,8 +5935,8 @@ var Logo = ({ className, src, alt, title, size = "medium" }) => {
|
|
|
5850
5935
|
alt: logoAlt,
|
|
5851
5936
|
title: logoTitle,
|
|
5852
5937
|
className: (0, import_css33.cx)(
|
|
5853
|
-
(0,
|
|
5854
|
-
(0,
|
|
5938
|
+
(0, import_browser44.withVendorCSSClassPrefix)((0, import_browser44.bem)("logo")),
|
|
5939
|
+
(0, import_browser44.withVendorCSSClassPrefix)((0, import_browser44.bem)("logo", size)),
|
|
5855
5940
|
styles.logo,
|
|
5856
5941
|
styles.size,
|
|
5857
5942
|
className
|
|
@@ -6117,7 +6202,7 @@ var handleWebAuthnAuthentication = async (challengeData) => {
|
|
|
6117
6202
|
throw new Error(`Passkey authentication failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
6118
6203
|
}
|
|
6119
6204
|
};
|
|
6120
|
-
var isPasskeyAuthenticator = (authenticator) => authenticator.authenticatorId ===
|
|
6205
|
+
var isPasskeyAuthenticator = (authenticator) => authenticator.authenticatorId === import_browser45.ApplicationNativeAuthenticationConstants.SupportedAuthenticators.Passkey && authenticator.metadata?.promptType === import_browser45.EmbeddedSignInFlowAuthenticatorPromptType.InternalPrompt && authenticator.metadata?.additionalData?.challengeData;
|
|
6121
6206
|
var BaseSignIn = (props) => {
|
|
6122
6207
|
const { theme } = useTheme_default();
|
|
6123
6208
|
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
@@ -6203,9 +6288,9 @@ var BaseSignInContent = ({
|
|
|
6203
6288
|
touchAllFields();
|
|
6204
6289
|
};
|
|
6205
6290
|
const handleRedirectionIfNeeded = (response) => {
|
|
6206
|
-
if (response && "nextStep" in response && response.nextStep && response.nextStep.stepType ===
|
|
6291
|
+
if (response && "nextStep" in response && response.nextStep && response.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.AuthenticatorPrompt && response.nextStep.authenticators && response.nextStep.authenticators.length === 1) {
|
|
6207
6292
|
const responseAuthenticator = response.nextStep.authenticators[0];
|
|
6208
|
-
if (responseAuthenticator.metadata?.promptType ===
|
|
6293
|
+
if (responseAuthenticator.metadata?.promptType === import_browser45.EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt && responseAuthenticator.metadata?.additionalData?.redirectUrl) {
|
|
6209
6294
|
const redirectUrl = responseAuthenticator.metadata?.additionalData?.redirectUrl;
|
|
6210
6295
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
6211
6296
|
if (!popup) {
|
|
@@ -6291,7 +6376,7 @@ var BaseSignInContent = ({
|
|
|
6291
6376
|
});
|
|
6292
6377
|
popup.close();
|
|
6293
6378
|
onFlowChange?.(response2);
|
|
6294
|
-
if (response2?.flowStatus ===
|
|
6379
|
+
if (response2?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6295
6380
|
onSuccess?.(response2.authData);
|
|
6296
6381
|
}
|
|
6297
6382
|
}
|
|
@@ -6332,11 +6417,11 @@ var BaseSignInContent = ({
|
|
|
6332
6417
|
url: currentFlow?.links[0].href
|
|
6333
6418
|
});
|
|
6334
6419
|
onFlowChange?.(response);
|
|
6335
|
-
if (response?.flowStatus ===
|
|
6420
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6336
6421
|
onSuccess?.(response.authData);
|
|
6337
6422
|
return;
|
|
6338
6423
|
}
|
|
6339
|
-
if (response?.flowStatus ===
|
|
6424
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
6340
6425
|
setError(t("errors.sign.in.flow.completion.failure"));
|
|
6341
6426
|
return;
|
|
6342
6427
|
}
|
|
@@ -6347,7 +6432,7 @@ var BaseSignInContent = ({
|
|
|
6347
6432
|
const nextStepResponse = response;
|
|
6348
6433
|
setCurrentFlow(nextStepResponse);
|
|
6349
6434
|
if (nextStepResponse.nextStep?.authenticators?.length > 0) {
|
|
6350
|
-
if (nextStepResponse.nextStep.stepType ===
|
|
6435
|
+
if (nextStepResponse.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) {
|
|
6351
6436
|
setCurrentAuthenticator(null);
|
|
6352
6437
|
} else {
|
|
6353
6438
|
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
@@ -6365,7 +6450,7 @@ var BaseSignInContent = ({
|
|
|
6365
6450
|
}
|
|
6366
6451
|
}
|
|
6367
6452
|
} catch (err) {
|
|
6368
|
-
const errorMessage = err instanceof
|
|
6453
|
+
const errorMessage = err instanceof import_browser45.AsgardeoAPIError ? err.message : t("errors.sign.in.flow.failure");
|
|
6369
6454
|
setError(errorMessage);
|
|
6370
6455
|
onError?.(err);
|
|
6371
6456
|
} finally {
|
|
@@ -6404,11 +6489,11 @@ var BaseSignInContent = ({
|
|
|
6404
6489
|
url: currentFlow?.links[0].href
|
|
6405
6490
|
});
|
|
6406
6491
|
onFlowChange?.(response);
|
|
6407
|
-
if (response?.flowStatus ===
|
|
6492
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6408
6493
|
onSuccess?.(response.authData);
|
|
6409
6494
|
return;
|
|
6410
6495
|
}
|
|
6411
|
-
if (response?.flowStatus ===
|
|
6496
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
6412
6497
|
setError(t("errors.sign.in.flow.passkeys.completion.failure"));
|
|
6413
6498
|
return;
|
|
6414
6499
|
}
|
|
@@ -6416,7 +6501,7 @@ var BaseSignInContent = ({
|
|
|
6416
6501
|
const nextStepResponse = response;
|
|
6417
6502
|
setCurrentFlow(nextStepResponse);
|
|
6418
6503
|
if (nextStepResponse.nextStep?.authenticators?.length > 0) {
|
|
6419
|
-
if (nextStepResponse.nextStep.stepType ===
|
|
6504
|
+
if (nextStepResponse.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) {
|
|
6420
6505
|
setCurrentAuthenticator(null);
|
|
6421
6506
|
} else {
|
|
6422
6507
|
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
@@ -6445,7 +6530,7 @@ var BaseSignInContent = ({
|
|
|
6445
6530
|
}
|
|
6446
6531
|
setError(errorMessage);
|
|
6447
6532
|
}
|
|
6448
|
-
} else if (authenticator.metadata?.promptType ===
|
|
6533
|
+
} else if (authenticator.metadata?.promptType === import_browser45.EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt) {
|
|
6449
6534
|
const payload = {
|
|
6450
6535
|
flowId: currentFlow.flowId,
|
|
6451
6536
|
selectedAuthenticator: {
|
|
@@ -6458,7 +6543,7 @@ var BaseSignInContent = ({
|
|
|
6458
6543
|
url: currentFlow?.links[0].href
|
|
6459
6544
|
});
|
|
6460
6545
|
onFlowChange?.(response);
|
|
6461
|
-
if (response?.flowStatus ===
|
|
6546
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6462
6547
|
onSuccess?.(response.authData);
|
|
6463
6548
|
return;
|
|
6464
6549
|
}
|
|
@@ -6481,11 +6566,11 @@ var BaseSignInContent = ({
|
|
|
6481
6566
|
url: currentFlow?.links[0].href
|
|
6482
6567
|
});
|
|
6483
6568
|
onFlowChange?.(response);
|
|
6484
|
-
if (response?.flowStatus ===
|
|
6569
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6485
6570
|
onSuccess?.(response.authData);
|
|
6486
6571
|
return;
|
|
6487
6572
|
}
|
|
6488
|
-
if (response?.flowStatus ===
|
|
6573
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
6489
6574
|
setError("Authentication failed. Please check your credentials and try again.");
|
|
6490
6575
|
return;
|
|
6491
6576
|
}
|
|
@@ -6496,7 +6581,7 @@ var BaseSignInContent = ({
|
|
|
6496
6581
|
const nextStepResponse = response;
|
|
6497
6582
|
setCurrentFlow(nextStepResponse);
|
|
6498
6583
|
if (nextStepResponse.nextStep?.authenticators?.length > 0) {
|
|
6499
|
-
if (nextStepResponse.nextStep.stepType ===
|
|
6584
|
+
if (nextStepResponse.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) {
|
|
6500
6585
|
setCurrentAuthenticator(null);
|
|
6501
6586
|
} else {
|
|
6502
6587
|
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
@@ -6532,11 +6617,11 @@ var BaseSignInContent = ({
|
|
|
6532
6617
|
url: currentFlow?.links[0].href
|
|
6533
6618
|
});
|
|
6534
6619
|
onFlowChange?.(response);
|
|
6535
|
-
if (response?.flowStatus ===
|
|
6620
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6536
6621
|
onSuccess?.(response.authData);
|
|
6537
6622
|
return;
|
|
6538
6623
|
}
|
|
6539
|
-
if (response?.flowStatus ===
|
|
6624
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.FailIncomplete) {
|
|
6540
6625
|
setError("Authentication failed. Please try again.");
|
|
6541
6626
|
return;
|
|
6542
6627
|
}
|
|
@@ -6547,7 +6632,7 @@ var BaseSignInContent = ({
|
|
|
6547
6632
|
const nextStepResponse = response;
|
|
6548
6633
|
setCurrentFlow(nextStepResponse);
|
|
6549
6634
|
if (nextStepResponse.nextStep?.authenticators?.length > 0) {
|
|
6550
|
-
if (nextStepResponse.nextStep.stepType ===
|
|
6635
|
+
if (nextStepResponse.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && nextStepResponse.nextStep.authenticators.length > 1) {
|
|
6551
6636
|
setCurrentAuthenticator(null);
|
|
6552
6637
|
} else {
|
|
6553
6638
|
const nextAuthenticator = nextStepResponse.nextStep.authenticators[0];
|
|
@@ -6574,7 +6659,7 @@ var BaseSignInContent = ({
|
|
|
6574
6659
|
}
|
|
6575
6660
|
}
|
|
6576
6661
|
} catch (err) {
|
|
6577
|
-
const errorMessage = err instanceof
|
|
6662
|
+
const errorMessage = err instanceof import_browser45.AsgardeoAPIError ? err?.message : "Authenticator selection failed";
|
|
6578
6663
|
setError(errorMessage);
|
|
6579
6664
|
onError?.(err);
|
|
6580
6665
|
} finally {
|
|
@@ -6586,7 +6671,7 @@ var BaseSignInContent = ({
|
|
|
6586
6671
|
setFormTouched(param, true);
|
|
6587
6672
|
};
|
|
6588
6673
|
const hasMultipleOptions = (0, import_react56.useCallback)(
|
|
6589
|
-
() => currentFlow && "nextStep" in currentFlow && currentFlow.nextStep?.stepType ===
|
|
6674
|
+
() => currentFlow && "nextStep" in currentFlow && currentFlow.nextStep?.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && currentFlow.nextStep?.authenticators && currentFlow.nextStep.authenticators.length > 1,
|
|
6590
6675
|
[currentFlow]
|
|
6591
6676
|
);
|
|
6592
6677
|
const getAvailableAuthenticators = (0, import_react56.useCallback)(() => {
|
|
@@ -6597,30 +6682,30 @@ var BaseSignInContent = ({
|
|
|
6597
6682
|
}, [currentFlow]);
|
|
6598
6683
|
const containerClasses = (0, import_css35.cx)(
|
|
6599
6684
|
[
|
|
6600
|
-
(0,
|
|
6601
|
-
(0,
|
|
6602
|
-
(0,
|
|
6685
|
+
(0, import_browser45.withVendorCSSClassPrefix)("signin"),
|
|
6686
|
+
(0, import_browser45.withVendorCSSClassPrefix)(`signin--${size}`),
|
|
6687
|
+
(0, import_browser45.withVendorCSSClassPrefix)(`signin--${variant}`)
|
|
6603
6688
|
],
|
|
6604
6689
|
className
|
|
6605
6690
|
);
|
|
6606
6691
|
const inputClasses = (0, import_css35.cx)(
|
|
6607
6692
|
[
|
|
6608
|
-
(0,
|
|
6609
|
-
size === "small" && (0,
|
|
6610
|
-
size === "large" && (0,
|
|
6693
|
+
(0, import_browser45.withVendorCSSClassPrefix)("signin__input"),
|
|
6694
|
+
size === "small" && (0, import_browser45.withVendorCSSClassPrefix)("signin__input--small"),
|
|
6695
|
+
size === "large" && (0, import_browser45.withVendorCSSClassPrefix)("signin__input--large")
|
|
6611
6696
|
],
|
|
6612
6697
|
inputClassName
|
|
6613
6698
|
);
|
|
6614
6699
|
const buttonClasses = (0, import_css35.cx)(
|
|
6615
6700
|
[
|
|
6616
|
-
(0,
|
|
6617
|
-
size === "small" && (0,
|
|
6618
|
-
size === "large" && (0,
|
|
6701
|
+
(0, import_browser45.withVendorCSSClassPrefix)("signin__button"),
|
|
6702
|
+
size === "small" && (0, import_browser45.withVendorCSSClassPrefix)("signin__button--small"),
|
|
6703
|
+
size === "large" && (0, import_browser45.withVendorCSSClassPrefix)("signin__button--large")
|
|
6619
6704
|
],
|
|
6620
6705
|
buttonClassName
|
|
6621
6706
|
);
|
|
6622
|
-
const errorClasses = (0, import_css35.cx)([(0,
|
|
6623
|
-
const messageClasses = (0, import_css35.cx)([(0,
|
|
6707
|
+
const errorClasses = (0, import_css35.cx)([(0, import_browser45.withVendorCSSClassPrefix)("signin__error")], errorClassName);
|
|
6708
|
+
const messageClasses = (0, import_css35.cx)([(0, import_browser45.withVendorCSSClassPrefix)("signin__messages")], messageClassName);
|
|
6624
6709
|
(0, import_react56.useEffect)(() => {
|
|
6625
6710
|
if (isLoading) {
|
|
6626
6711
|
return;
|
|
@@ -6637,12 +6722,12 @@ var BaseSignInContent = ({
|
|
|
6637
6722
|
setCurrentFlow(response);
|
|
6638
6723
|
setIsInitialized(true);
|
|
6639
6724
|
onFlowChange?.(response);
|
|
6640
|
-
if (response?.flowStatus ===
|
|
6725
|
+
if (response?.flowStatus === import_browser45.EmbeddedSignInFlowStatus.SuccessCompleted) {
|
|
6641
6726
|
onSuccess?.(response.authData || {});
|
|
6642
6727
|
return;
|
|
6643
6728
|
}
|
|
6644
6729
|
if (response?.nextStep?.authenticators?.length > 0) {
|
|
6645
|
-
if (response.nextStep.stepType ===
|
|
6730
|
+
if (response.nextStep.stepType === import_browser45.EmbeddedSignInFlowStepType.MultiOptionsPrompt && response.nextStep.authenticators.length > 1) {
|
|
6646
6731
|
setCurrentAuthenticator(null);
|
|
6647
6732
|
} else {
|
|
6648
6733
|
const authenticator = response.nextStep.authenticators[0];
|
|
@@ -6660,7 +6745,7 @@ var BaseSignInContent = ({
|
|
|
6660
6745
|
);
|
|
6661
6746
|
}
|
|
6662
6747
|
} catch (err) {
|
|
6663
|
-
const errorMessage = err instanceof
|
|
6748
|
+
const errorMessage = err instanceof import_browser45.AsgardeoAPIError ? err.message : t("errors.sign.in.initialization");
|
|
6664
6749
|
setError(errorMessage);
|
|
6665
6750
|
onError?.(err);
|
|
6666
6751
|
} finally {
|
|
@@ -6677,7 +6762,7 @@ var BaseSignInContent = ({
|
|
|
6677
6762
|
if (hasMultipleOptions() && !currentAuthenticator) {
|
|
6678
6763
|
const availableAuthenticators = getAvailableAuthenticators();
|
|
6679
6764
|
const userPromptAuthenticators = availableAuthenticators.filter(
|
|
6680
|
-
(auth) => auth.metadata?.promptType ===
|
|
6765
|
+
(auth) => auth.metadata?.promptType === import_browser45.EmbeddedSignInFlowAuthenticatorPromptType.UserPrompt || // Fallback: LOCAL authenticators with params are typically user prompts
|
|
6681
6766
|
auth.idp === "LOCAL" && auth.metadata?.params && auth.metadata.params.length > 0
|
|
6682
6767
|
);
|
|
6683
6768
|
const optionAuthenticators = availableAuthenticators.filter((auth) => !userPromptAuthenticators.includes(auth)).filter((authenticator) => !HIDDEN_AUTHENTICATORS.includes(authenticator.authenticatorId));
|
|
@@ -6862,15 +6947,15 @@ var SignIn = ({ className, size = "medium", ...rest }) => {
|
|
|
6862
6947
|
var SignIn_default = SignIn;
|
|
6863
6948
|
|
|
6864
6949
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
6865
|
-
var
|
|
6950
|
+
var import_browser53 = require("@asgardeo/browser");
|
|
6866
6951
|
var import_css37 = require("@emotion/css");
|
|
6867
6952
|
var import_react58 = require("react");
|
|
6868
6953
|
|
|
6869
6954
|
// src/components/presentation/SignUp/options/SignUpOptionFactory.tsx
|
|
6870
|
-
var
|
|
6955
|
+
var import_browser52 = require("@asgardeo/browser");
|
|
6871
6956
|
|
|
6872
6957
|
// src/components/presentation/SignUp/options/CheckboxInput.tsx
|
|
6873
|
-
var
|
|
6958
|
+
var import_browser46 = require("@asgardeo/browser");
|
|
6874
6959
|
var CheckboxInput = ({
|
|
6875
6960
|
component,
|
|
6876
6961
|
formValues,
|
|
@@ -6884,7 +6969,7 @@ var CheckboxInput = ({
|
|
|
6884
6969
|
const value = formValues[fieldName] || "";
|
|
6885
6970
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
6886
6971
|
return createField({
|
|
6887
|
-
type:
|
|
6972
|
+
type: import_browser46.FieldType.Checkbox,
|
|
6888
6973
|
name: fieldName,
|
|
6889
6974
|
label: config["label"] || "",
|
|
6890
6975
|
placeholder: config["placeholder"] || "",
|
|
@@ -6898,7 +6983,7 @@ var CheckboxInput = ({
|
|
|
6898
6983
|
var CheckboxInput_default = CheckboxInput;
|
|
6899
6984
|
|
|
6900
6985
|
// src/components/presentation/SignUp/options/DateInput.tsx
|
|
6901
|
-
var
|
|
6986
|
+
var import_browser47 = require("@asgardeo/browser");
|
|
6902
6987
|
var DateInput = ({
|
|
6903
6988
|
component,
|
|
6904
6989
|
formValues,
|
|
@@ -6912,7 +6997,7 @@ var DateInput = ({
|
|
|
6912
6997
|
const value = formValues[fieldName] || "";
|
|
6913
6998
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
6914
6999
|
return createField({
|
|
6915
|
-
type:
|
|
7000
|
+
type: import_browser47.FieldType.Date,
|
|
6916
7001
|
name: fieldName,
|
|
6917
7002
|
label: config["label"] || "",
|
|
6918
7003
|
placeholder: config["placeholder"] || "",
|
|
@@ -6945,7 +7030,7 @@ var DividerComponent = ({ component }) => {
|
|
|
6945
7030
|
var DividerComponent_default = DividerComponent;
|
|
6946
7031
|
|
|
6947
7032
|
// src/components/presentation/SignUp/options/EmailInput.tsx
|
|
6948
|
-
var
|
|
7033
|
+
var import_browser48 = require("@asgardeo/browser");
|
|
6949
7034
|
var EmailInput = ({
|
|
6950
7035
|
component,
|
|
6951
7036
|
formValues,
|
|
@@ -6959,7 +7044,7 @@ var EmailInput = ({
|
|
|
6959
7044
|
const value = formValues[fieldName] || "";
|
|
6960
7045
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
6961
7046
|
return createField({
|
|
6962
|
-
type:
|
|
7047
|
+
type: import_browser48.FieldType.Email,
|
|
6963
7048
|
name: fieldName,
|
|
6964
7049
|
label: config["label"] || "Email",
|
|
6965
7050
|
placeholder: config["placeholder"] || "Enter your email",
|
|
@@ -6997,75 +7082,8 @@ var FormContainer = (props) => {
|
|
|
6997
7082
|
};
|
|
6998
7083
|
var FormContainer_default = FormContainer;
|
|
6999
7084
|
|
|
7000
|
-
// src/components/presentation/SignUp/options/GoogleButton.tsx
|
|
7001
|
-
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7002
|
-
var GoogleButton2 = ({
|
|
7003
|
-
component,
|
|
7004
|
-
isLoading,
|
|
7005
|
-
buttonClassName = "",
|
|
7006
|
-
size = "medium",
|
|
7007
|
-
onSubmit
|
|
7008
|
-
}) => {
|
|
7009
|
-
const config = component.config || {};
|
|
7010
|
-
const buttonText = config["text"] || config["label"] || "Continue with Google";
|
|
7011
|
-
const handleClick = () => {
|
|
7012
|
-
if (onSubmit) {
|
|
7013
|
-
onSubmit(component, {});
|
|
7014
|
-
}
|
|
7015
|
-
};
|
|
7016
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7017
|
-
Button_default,
|
|
7018
|
-
{
|
|
7019
|
-
type: "button",
|
|
7020
|
-
variant: "solid",
|
|
7021
|
-
color: "secondary",
|
|
7022
|
-
size,
|
|
7023
|
-
disabled: isLoading,
|
|
7024
|
-
onClick: handleClick,
|
|
7025
|
-
className: buttonClassName,
|
|
7026
|
-
style: { width: "100%" },
|
|
7027
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 67.91 67.901", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("g", { transform: "translate(-0.001 -0.001)", children: [
|
|
7028
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7029
|
-
"path",
|
|
7030
|
-
{
|
|
7031
|
-
d: "M15.049,160.965l-2.364,8.824-8.639.183a34.011,34.011,0,0,1-.25-31.7h0l7.691,1.41,3.369,7.645a20.262,20.262,0,0,0,.19,13.642Z",
|
|
7032
|
-
transform: "translate(0 -119.93)",
|
|
7033
|
-
fill: "#fbbb00"
|
|
7034
|
-
}
|
|
7035
|
-
),
|
|
7036
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7037
|
-
"path",
|
|
7038
|
-
{
|
|
7039
|
-
d: "M294.24,208.176A33.939,33.939,0,0,1,282.137,241h0l-9.687-.494-1.371-8.559a20.235,20.235,0,0,0,8.706-10.333H261.628V208.176Z",
|
|
7040
|
-
transform: "translate(-226.93 -180.567)",
|
|
7041
|
-
fill: "#518ef8"
|
|
7042
|
-
}
|
|
7043
|
-
),
|
|
7044
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7045
|
-
"path",
|
|
7046
|
-
{
|
|
7047
|
-
d: "M81.668,328.8h0a33.962,33.962,0,0,1-51.161-10.387l11-9.006a20.192,20.192,0,0,0,29.1,10.338Z",
|
|
7048
|
-
transform: "translate(-26.463 -268.374)",
|
|
7049
|
-
fill: "#28b446"
|
|
7050
|
-
}
|
|
7051
|
-
),
|
|
7052
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7053
|
-
"path",
|
|
7054
|
-
{
|
|
7055
|
-
d: "M80.451,7.816l-11,9A20.19,20.19,0,0,0,39.686,27.393l-11.06-9.055h0A33.959,33.959,0,0,1,80.451,7.816Z",
|
|
7056
|
-
transform: "translate(-24.828)",
|
|
7057
|
-
fill: "#f14336"
|
|
7058
|
-
}
|
|
7059
|
-
)
|
|
7060
|
-
] }) }),
|
|
7061
|
-
children: buttonText
|
|
7062
|
-
}
|
|
7063
|
-
);
|
|
7064
|
-
};
|
|
7065
|
-
var GoogleButton_default2 = GoogleButton2;
|
|
7066
|
-
|
|
7067
7085
|
// src/components/presentation/SignUp/options/ImageComponent.tsx
|
|
7068
|
-
var
|
|
7086
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7069
7087
|
var ImageComponent = ({ component }) => {
|
|
7070
7088
|
const { theme } = useTheme_default();
|
|
7071
7089
|
const config = component.config || {};
|
|
@@ -7082,7 +7100,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7082
7100
|
if (!src) {
|
|
7083
7101
|
return null;
|
|
7084
7102
|
}
|
|
7085
|
-
return /* @__PURE__ */ (0,
|
|
7103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7086
7104
|
"img",
|
|
7087
7105
|
{
|
|
7088
7106
|
src,
|
|
@@ -7097,7 +7115,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7097
7115
|
var ImageComponent_default = ImageComponent;
|
|
7098
7116
|
|
|
7099
7117
|
// src/components/presentation/SignUp/options/NumberInput.tsx
|
|
7100
|
-
var
|
|
7118
|
+
var import_browser49 = require("@asgardeo/browser");
|
|
7101
7119
|
var NumberInput = ({
|
|
7102
7120
|
component,
|
|
7103
7121
|
formValues,
|
|
@@ -7111,7 +7129,7 @@ var NumberInput = ({
|
|
|
7111
7129
|
const value = formValues[fieldName] || "";
|
|
7112
7130
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7113
7131
|
return createField({
|
|
7114
|
-
type:
|
|
7132
|
+
type: import_browser49.FieldType.Number,
|
|
7115
7133
|
name: fieldName,
|
|
7116
7134
|
label: config["label"] || "",
|
|
7117
7135
|
placeholder: config["placeholder"] || "",
|
|
@@ -7125,7 +7143,7 @@ var NumberInput = ({
|
|
|
7125
7143
|
var NumberInput_default = NumberInput;
|
|
7126
7144
|
|
|
7127
7145
|
// src/components/presentation/SignUp/options/PasswordInput.tsx
|
|
7128
|
-
var
|
|
7146
|
+
var import_browser50 = require("@asgardeo/browser");
|
|
7129
7147
|
var PasswordInput = ({
|
|
7130
7148
|
component,
|
|
7131
7149
|
formValues,
|
|
@@ -7171,7 +7189,7 @@ var PasswordInput = ({
|
|
|
7171
7189
|
});
|
|
7172
7190
|
const hint = validationHints.length > 0 ? validationHints.join(", ") : config["hint"] || "";
|
|
7173
7191
|
return createField({
|
|
7174
|
-
type:
|
|
7192
|
+
type: import_browser50.FieldType.Password,
|
|
7175
7193
|
name: fieldName,
|
|
7176
7194
|
label: config["label"] || "Password",
|
|
7177
7195
|
placeholder: config["placeholder"] || "Enter your password",
|
|
@@ -7185,7 +7203,7 @@ var PasswordInput = ({
|
|
|
7185
7203
|
var PasswordInput_default = PasswordInput;
|
|
7186
7204
|
|
|
7187
7205
|
// src/components/presentation/SignUp/options/SubmitButton.tsx
|
|
7188
|
-
var
|
|
7206
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7189
7207
|
var ButtonComponent = ({
|
|
7190
7208
|
component,
|
|
7191
7209
|
isLoading,
|
|
@@ -7218,7 +7236,7 @@ var ButtonComponent = ({
|
|
|
7218
7236
|
onSubmit(component);
|
|
7219
7237
|
}
|
|
7220
7238
|
};
|
|
7221
|
-
return /* @__PURE__ */ (0,
|
|
7239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7222
7240
|
Button_default,
|
|
7223
7241
|
{
|
|
7224
7242
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -7229,7 +7247,7 @@ var ButtonComponent = ({
|
|
|
7229
7247
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
7230
7248
|
className: buttonClassName,
|
|
7231
7249
|
style: { width: "100%" },
|
|
7232
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
7250
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Spinner_default, { size: "small" }) : buttonText
|
|
7233
7251
|
},
|
|
7234
7252
|
component.id
|
|
7235
7253
|
);
|
|
@@ -7237,7 +7255,7 @@ var ButtonComponent = ({
|
|
|
7237
7255
|
var SubmitButton_default = ButtonComponent;
|
|
7238
7256
|
|
|
7239
7257
|
// src/components/presentation/SignUp/options/TelephoneInput.tsx
|
|
7240
|
-
var
|
|
7258
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7241
7259
|
var TelephoneInput = ({
|
|
7242
7260
|
component,
|
|
7243
7261
|
formValues,
|
|
@@ -7250,7 +7268,7 @@ var TelephoneInput = ({
|
|
|
7250
7268
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
7251
7269
|
const value = formValues[fieldName] || "";
|
|
7252
7270
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7253
|
-
return /* @__PURE__ */ (0,
|
|
7271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7254
7272
|
TextField_default,
|
|
7255
7273
|
{
|
|
7256
7274
|
name: fieldName,
|
|
@@ -7270,7 +7288,7 @@ var TelephoneInput = ({
|
|
|
7270
7288
|
var TelephoneInput_default = TelephoneInput;
|
|
7271
7289
|
|
|
7272
7290
|
// src/components/presentation/SignUp/options/TextInput.tsx
|
|
7273
|
-
var
|
|
7291
|
+
var import_browser51 = require("@asgardeo/browser");
|
|
7274
7292
|
var TextInput = ({
|
|
7275
7293
|
component,
|
|
7276
7294
|
formValues,
|
|
@@ -7284,7 +7302,7 @@ var TextInput = ({
|
|
|
7284
7302
|
const value = formValues[fieldName] || "";
|
|
7285
7303
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7286
7304
|
return createField({
|
|
7287
|
-
type:
|
|
7305
|
+
type: import_browser51.FieldType.Text,
|
|
7288
7306
|
name: fieldName,
|
|
7289
7307
|
label: config["label"] || "",
|
|
7290
7308
|
placeholder: config["placeholder"] || "",
|
|
@@ -7298,7 +7316,7 @@ var TextInput = ({
|
|
|
7298
7316
|
var TextInput_default = TextInput;
|
|
7299
7317
|
|
|
7300
7318
|
// src/components/presentation/SignUp/options/Typography.tsx
|
|
7301
|
-
var
|
|
7319
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7302
7320
|
var TypographyComponent = ({ component }) => {
|
|
7303
7321
|
const { theme } = useTheme_default();
|
|
7304
7322
|
const config = component.config || {};
|
|
@@ -7339,7 +7357,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
7339
7357
|
default:
|
|
7340
7358
|
typographyVariant = "body1";
|
|
7341
7359
|
}
|
|
7342
|
-
return /* @__PURE__ */ (0,
|
|
7360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7343
7361
|
Typography_default,
|
|
7344
7362
|
{
|
|
7345
7363
|
variant: typographyVariant,
|
|
@@ -7352,50 +7370,66 @@ var TypographyComponent = ({ component }) => {
|
|
|
7352
7370
|
var Typography_default2 = TypographyComponent;
|
|
7353
7371
|
|
|
7354
7372
|
// src/components/presentation/SignUp/options/SignUpOptionFactory.tsx
|
|
7355
|
-
var
|
|
7356
|
-
var createSignUpComponent = (
|
|
7357
|
-
const { component } = props;
|
|
7373
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7374
|
+
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
7358
7375
|
switch (component.type) {
|
|
7359
|
-
case
|
|
7360
|
-
return /* @__PURE__ */ (0,
|
|
7361
|
-
case
|
|
7376
|
+
case import_browser52.EmbeddedFlowComponentType.Typography:
|
|
7377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
7378
|
+
case import_browser52.EmbeddedFlowComponentType.Input:
|
|
7362
7379
|
const inputVariant = component.variant?.toUpperCase();
|
|
7363
7380
|
const inputType = component.config["type"]?.toLowerCase();
|
|
7364
7381
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
7365
|
-
return /* @__PURE__ */ (0,
|
|
7382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(EmailInput_default, { component, onSubmit, ...rest });
|
|
7366
7383
|
}
|
|
7367
7384
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
7368
|
-
return /* @__PURE__ */ (0,
|
|
7385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(PasswordInput_default, { component, onSubmit, ...rest });
|
|
7369
7386
|
}
|
|
7370
7387
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
7371
|
-
return /* @__PURE__ */ (0,
|
|
7388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
7372
7389
|
}
|
|
7373
7390
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
7374
|
-
return /* @__PURE__ */ (0,
|
|
7391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NumberInput_default, { component, onSubmit, ...rest });
|
|
7375
7392
|
}
|
|
7376
7393
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
7377
|
-
return /* @__PURE__ */ (0,
|
|
7394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DateInput_default, { component, onSubmit, ...rest });
|
|
7378
7395
|
}
|
|
7379
7396
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
7380
|
-
return /* @__PURE__ */ (0,
|
|
7397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
7381
7398
|
}
|
|
7382
|
-
return /* @__PURE__ */ (0,
|
|
7383
|
-
case
|
|
7399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
7400
|
+
case import_browser52.EmbeddedFlowComponentType.Button: {
|
|
7384
7401
|
const buttonVariant = component.variant?.toUpperCase();
|
|
7385
7402
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
7386
|
-
if (buttonVariant === "SOCIAL"
|
|
7387
|
-
|
|
7403
|
+
if (buttonVariant === "SOCIAL") {
|
|
7404
|
+
if (buttonText.toLowerCase().includes("google")) {
|
|
7405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7406
|
+
}
|
|
7407
|
+
if (buttonText.toLowerCase().includes("github")) {
|
|
7408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7409
|
+
}
|
|
7410
|
+
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
7411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7412
|
+
}
|
|
7413
|
+
if (buttonText.toLowerCase().includes("facebook")) {
|
|
7414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7415
|
+
}
|
|
7416
|
+
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
7417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7418
|
+
}
|
|
7419
|
+
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
7420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7421
|
+
}
|
|
7388
7422
|
}
|
|
7389
|
-
return /* @__PURE__ */ (0,
|
|
7423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
7390
7424
|
}
|
|
7391
|
-
case
|
|
7392
|
-
return /* @__PURE__ */ (0,
|
|
7393
|
-
case
|
|
7394
|
-
return /* @__PURE__ */ (0,
|
|
7395
|
-
case
|
|
7396
|
-
return /* @__PURE__ */ (0,
|
|
7425
|
+
case import_browser52.EmbeddedFlowComponentType.Form:
|
|
7426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
7427
|
+
case import_browser52.EmbeddedFlowComponentType.Divider:
|
|
7428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
7429
|
+
case import_browser52.EmbeddedFlowComponentType.Image:
|
|
7430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
7397
7431
|
default:
|
|
7398
|
-
return /* @__PURE__ */ (0,
|
|
7432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", {});
|
|
7399
7433
|
}
|
|
7400
7434
|
};
|
|
7401
7435
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -7567,13 +7601,13 @@ var useStyles17 = (theme, colorScheme) => {
|
|
|
7567
7601
|
var BaseSignUp_styles_default = useStyles17;
|
|
7568
7602
|
|
|
7569
7603
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7570
|
-
var
|
|
7604
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7571
7605
|
var BaseSignUp = (props) => {
|
|
7572
7606
|
const { theme, colorScheme } = useTheme_default();
|
|
7573
7607
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
7574
|
-
return /* @__PURE__ */ (0,
|
|
7575
|
-
/* @__PURE__ */ (0,
|
|
7576
|
-
/* @__PURE__ */ (0,
|
|
7608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { children: [
|
|
7609
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Logo_default, { size: "large" }) }),
|
|
7610
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(BaseSignUpContent, { ...props }) })
|
|
7577
7611
|
] });
|
|
7578
7612
|
};
|
|
7579
7613
|
var BaseSignUpContent = ({
|
|
@@ -7607,7 +7641,7 @@ var BaseSignUpContent = ({
|
|
|
7607
7641
|
const fields = [];
|
|
7608
7642
|
const processComponents = (comps) => {
|
|
7609
7643
|
comps.forEach((component) => {
|
|
7610
|
-
if (component.type ===
|
|
7644
|
+
if (component.type === import_browser53.EmbeddedFlowComponentType.Input) {
|
|
7611
7645
|
const config = component.config || {};
|
|
7612
7646
|
fields.push({
|
|
7613
7647
|
name: config.name || component.id,
|
|
@@ -7699,11 +7733,11 @@ var BaseSignUpContent = ({
|
|
|
7699
7733
|
};
|
|
7700
7734
|
const response = await onSubmit(payload);
|
|
7701
7735
|
onFlowChange?.(response);
|
|
7702
|
-
if (response.flowStatus ===
|
|
7736
|
+
if (response.flowStatus === import_browser53.EmbeddedFlowStatus.Complete) {
|
|
7703
7737
|
onComplete?.(response);
|
|
7704
7738
|
return;
|
|
7705
7739
|
}
|
|
7706
|
-
if (response.flowStatus ===
|
|
7740
|
+
if (response.flowStatus === import_browser53.EmbeddedFlowStatus.Incomplete) {
|
|
7707
7741
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
7708
7742
|
return;
|
|
7709
7743
|
}
|
|
@@ -7711,7 +7745,7 @@ var BaseSignUpContent = ({
|
|
|
7711
7745
|
setupFormFields(response);
|
|
7712
7746
|
}
|
|
7713
7747
|
} catch (err) {
|
|
7714
|
-
const errorMessage = err instanceof
|
|
7748
|
+
const errorMessage = err instanceof import_browser53.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
7715
7749
|
setError(errorMessage);
|
|
7716
7750
|
onError?.(err);
|
|
7717
7751
|
} finally {
|
|
@@ -7719,7 +7753,7 @@ var BaseSignUpContent = ({
|
|
|
7719
7753
|
}
|
|
7720
7754
|
};
|
|
7721
7755
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
7722
|
-
if (response?.type ===
|
|
7756
|
+
if (response?.type === import_browser53.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
7723
7757
|
const redirectUrl = response.data.redirectURL;
|
|
7724
7758
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
7725
7759
|
if (!popup) {
|
|
@@ -7748,16 +7782,16 @@ var BaseSignUpContent = ({
|
|
|
7748
7782
|
try {
|
|
7749
7783
|
const continueResponse = await onSubmit(payload);
|
|
7750
7784
|
onFlowChange?.(continueResponse);
|
|
7751
|
-
if (continueResponse.flowStatus ===
|
|
7785
|
+
if (continueResponse.flowStatus === import_browser53.EmbeddedFlowStatus.Complete) {
|
|
7752
7786
|
onComplete?.(continueResponse);
|
|
7753
|
-
} else if (continueResponse.flowStatus ===
|
|
7787
|
+
} else if (continueResponse.flowStatus === import_browser53.EmbeddedFlowStatus.Incomplete) {
|
|
7754
7788
|
setCurrentFlow(continueResponse);
|
|
7755
7789
|
setupFormFields(continueResponse);
|
|
7756
7790
|
}
|
|
7757
7791
|
popup.close();
|
|
7758
7792
|
cleanup();
|
|
7759
7793
|
} catch (err) {
|
|
7760
|
-
const errorMessage = err instanceof
|
|
7794
|
+
const errorMessage = err instanceof import_browser53.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
7761
7795
|
setError(errorMessage);
|
|
7762
7796
|
onError?.(err);
|
|
7763
7797
|
popup.close();
|
|
@@ -7809,15 +7843,15 @@ var BaseSignUpContent = ({
|
|
|
7809
7843
|
try {
|
|
7810
7844
|
const continueResponse = await onSubmit(payload);
|
|
7811
7845
|
onFlowChange?.(continueResponse);
|
|
7812
|
-
if (continueResponse.flowStatus ===
|
|
7846
|
+
if (continueResponse.flowStatus === import_browser53.EmbeddedFlowStatus.Complete) {
|
|
7813
7847
|
onComplete?.(continueResponse);
|
|
7814
|
-
} else if (continueResponse.flowStatus ===
|
|
7848
|
+
} else if (continueResponse.flowStatus === import_browser53.EmbeddedFlowStatus.Incomplete) {
|
|
7815
7849
|
setCurrentFlow(continueResponse);
|
|
7816
7850
|
setupFormFields(continueResponse);
|
|
7817
7851
|
}
|
|
7818
7852
|
popup.close();
|
|
7819
7853
|
} catch (err) {
|
|
7820
|
-
const errorMessage = err instanceof
|
|
7854
|
+
const errorMessage = err instanceof import_browser53.AsgardeoAPIError ? err.message : t("errors.sign.up.flow.failure");
|
|
7821
7855
|
setError(errorMessage);
|
|
7822
7856
|
onError?.(err);
|
|
7823
7857
|
popup.close();
|
|
@@ -7836,30 +7870,30 @@ var BaseSignUpContent = ({
|
|
|
7836
7870
|
};
|
|
7837
7871
|
const containerClasses = (0, import_css37.cx)(
|
|
7838
7872
|
[
|
|
7839
|
-
(0,
|
|
7840
|
-
(0,
|
|
7841
|
-
(0,
|
|
7873
|
+
(0, import_browser53.withVendorCSSClassPrefix)("signup"),
|
|
7874
|
+
(0, import_browser53.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
7875
|
+
(0, import_browser53.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
7842
7876
|
],
|
|
7843
7877
|
className
|
|
7844
7878
|
);
|
|
7845
7879
|
const inputClasses = (0, import_css37.cx)(
|
|
7846
7880
|
[
|
|
7847
|
-
(0,
|
|
7848
|
-
size === "small" && (0,
|
|
7849
|
-
size === "large" && (0,
|
|
7881
|
+
(0, import_browser53.withVendorCSSClassPrefix)("signup__input"),
|
|
7882
|
+
size === "small" && (0, import_browser53.withVendorCSSClassPrefix)("signup__input--small"),
|
|
7883
|
+
size === "large" && (0, import_browser53.withVendorCSSClassPrefix)("signup__input--large")
|
|
7850
7884
|
],
|
|
7851
7885
|
inputClassName
|
|
7852
7886
|
);
|
|
7853
7887
|
const buttonClasses = (0, import_css37.cx)(
|
|
7854
7888
|
[
|
|
7855
|
-
(0,
|
|
7856
|
-
size === "small" && (0,
|
|
7857
|
-
size === "large" && (0,
|
|
7889
|
+
(0, import_browser53.withVendorCSSClassPrefix)("signup__button"),
|
|
7890
|
+
size === "small" && (0, import_browser53.withVendorCSSClassPrefix)("signup__button--small"),
|
|
7891
|
+
size === "large" && (0, import_browser53.withVendorCSSClassPrefix)("signup__button--large")
|
|
7858
7892
|
],
|
|
7859
7893
|
buttonClassName
|
|
7860
7894
|
);
|
|
7861
|
-
const errorClasses = (0, import_css37.cx)([(0,
|
|
7862
|
-
const messageClasses = (0, import_css37.cx)([(0,
|
|
7895
|
+
const errorClasses = (0, import_css37.cx)([(0, import_browser53.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
7896
|
+
const messageClasses = (0, import_css37.cx)([(0, import_browser53.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
7863
7897
|
const renderComponents = (0, import_react58.useCallback)(
|
|
7864
7898
|
(components) => renderSignUpComponents(
|
|
7865
7899
|
components,
|
|
@@ -7903,11 +7937,11 @@ var BaseSignUpContent = ({
|
|
|
7903
7937
|
setCurrentFlow(response);
|
|
7904
7938
|
setIsFlowInitialized(true);
|
|
7905
7939
|
onFlowChange?.(response);
|
|
7906
|
-
if (response.flowStatus ===
|
|
7940
|
+
if (response.flowStatus === import_browser53.EmbeddedFlowStatus.Complete) {
|
|
7907
7941
|
onComplete?.(response);
|
|
7908
7942
|
return;
|
|
7909
7943
|
}
|
|
7910
|
-
if (response.flowStatus ===
|
|
7944
|
+
if (response.flowStatus === import_browser53.EmbeddedFlowStatus.Incomplete) {
|
|
7911
7945
|
setupFormFields(response);
|
|
7912
7946
|
}
|
|
7913
7947
|
} catch (err) {
|
|
@@ -7931,38 +7965,38 @@ var BaseSignUpContent = ({
|
|
|
7931
7965
|
t
|
|
7932
7966
|
]);
|
|
7933
7967
|
if (!isFlowInitialized && isLoading) {
|
|
7934
|
-
return /* @__PURE__ */ (0,
|
|
7968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: styles.loadingContainer, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
7935
7969
|
}
|
|
7936
7970
|
if (!currentFlow) {
|
|
7937
|
-
return /* @__PURE__ */ (0,
|
|
7938
|
-
/* @__PURE__ */ (0,
|
|
7939
|
-
/* @__PURE__ */ (0,
|
|
7971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
7972
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
7973
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Alert_default.Description, { children: error || t("errors.sign.up.flow.initialization.failure") })
|
|
7940
7974
|
] }) }) });
|
|
7941
7975
|
}
|
|
7942
|
-
return /* @__PURE__ */ (0,
|
|
7943
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0,
|
|
7976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), variant, children: [
|
|
7977
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: styles.messagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7944
7978
|
Alert_default,
|
|
7945
7979
|
{
|
|
7946
7980
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
7947
7981
|
className: (0, import_css37.cx)(styles.messageItem, messageClasses),
|
|
7948
|
-
children: /* @__PURE__ */ (0,
|
|
7982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Alert_default.Description, { children: message.message })
|
|
7949
7983
|
},
|
|
7950
7984
|
message.id || index
|
|
7951
7985
|
)) }) }),
|
|
7952
|
-
/* @__PURE__ */ (0,
|
|
7953
|
-
error && /* @__PURE__ */ (0,
|
|
7954
|
-
/* @__PURE__ */ (0,
|
|
7955
|
-
/* @__PURE__ */ (0,
|
|
7986
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Card_default.Content, { children: [
|
|
7987
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Alert_default, { variant: "error", className: (0, import_css37.cx)(styles.errorContainer, errorClasses), children: [
|
|
7988
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
7989
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Alert_default.Description, { children: error })
|
|
7956
7990
|
] }),
|
|
7957
|
-
/* @__PURE__ */ (0,
|
|
7991
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: styles.contentContainer, children: currentFlow.data?.components && renderComponents(currentFlow.data.components) })
|
|
7958
7992
|
] })
|
|
7959
7993
|
] });
|
|
7960
7994
|
};
|
|
7961
7995
|
var BaseSignUp_default = BaseSignUp;
|
|
7962
7996
|
|
|
7963
7997
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
7964
|
-
var
|
|
7965
|
-
var
|
|
7998
|
+
var import_browser54 = require("@asgardeo/browser");
|
|
7999
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7966
8000
|
var SignUp = ({
|
|
7967
8001
|
className,
|
|
7968
8002
|
size = "medium",
|
|
@@ -7975,21 +8009,21 @@ var SignUp = ({
|
|
|
7975
8009
|
const { signUp, isInitialized } = useAsgardeo_default();
|
|
7976
8010
|
const handleInitialize = async (payload) => await signUp(
|
|
7977
8011
|
payload || {
|
|
7978
|
-
flowType:
|
|
8012
|
+
flowType: import_browser54.EmbeddedFlowType.Registration
|
|
7979
8013
|
}
|
|
7980
8014
|
);
|
|
7981
8015
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
7982
8016
|
const handleComplete = (response) => {
|
|
7983
8017
|
onComplete?.(response);
|
|
7984
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
8018
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser54.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
7985
8019
|
window.location.href = afterSignUpUrl;
|
|
7986
8020
|
}
|
|
7987
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
8021
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser54.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
7988
8022
|
!response.data.redirectURL.includes("auth")) {
|
|
7989
8023
|
window.location.href = response.data.redirectURL;
|
|
7990
8024
|
}
|
|
7991
8025
|
};
|
|
7992
|
-
return /* @__PURE__ */ (0,
|
|
8026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
7993
8027
|
BaseSignUp_default,
|
|
7994
8028
|
{
|
|
7995
8029
|
afterSignUpUrl,
|
|
@@ -8007,75 +8041,75 @@ var SignUp = ({
|
|
|
8007
8041
|
var SignUp_default = SignUp;
|
|
8008
8042
|
|
|
8009
8043
|
// src/components/presentation/User/BaseUser.tsx
|
|
8010
|
-
var
|
|
8044
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8011
8045
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
8012
8046
|
if (!user) {
|
|
8013
|
-
return /* @__PURE__ */ (0,
|
|
8047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: fallback });
|
|
8014
8048
|
}
|
|
8015
|
-
return /* @__PURE__ */ (0,
|
|
8049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: children(user) });
|
|
8016
8050
|
};
|
|
8017
8051
|
BaseUser.displayName = "BaseUser";
|
|
8018
8052
|
var BaseUser_default = BaseUser;
|
|
8019
8053
|
|
|
8020
8054
|
// src/components/presentation/User/User.tsx
|
|
8021
|
-
var
|
|
8055
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8022
8056
|
var User5 = ({ children, fallback = null }) => {
|
|
8023
8057
|
const { user } = useAsgardeo_default();
|
|
8024
|
-
return /* @__PURE__ */ (0,
|
|
8058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BaseUser_default, { user, fallback, children });
|
|
8025
8059
|
};
|
|
8026
8060
|
User5.displayName = "User";
|
|
8027
8061
|
var User_default = User5;
|
|
8028
8062
|
|
|
8029
8063
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
8030
|
-
var
|
|
8064
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8031
8065
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
8032
8066
|
if (!organization) {
|
|
8033
|
-
return /* @__PURE__ */ (0,
|
|
8067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: fallback });
|
|
8034
8068
|
}
|
|
8035
|
-
return /* @__PURE__ */ (0,
|
|
8069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: children(organization) });
|
|
8036
8070
|
};
|
|
8037
8071
|
BaseOrganization.displayName = "BaseOrganization";
|
|
8038
8072
|
var BaseOrganization_default = BaseOrganization;
|
|
8039
8073
|
|
|
8040
8074
|
// src/components/presentation/Organization/Organization.tsx
|
|
8041
|
-
var
|
|
8075
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
8042
8076
|
var Organization5 = ({ children, fallback = null }) => {
|
|
8043
8077
|
const { currentOrganization } = useOrganization_default();
|
|
8044
|
-
return /* @__PURE__ */ (0,
|
|
8078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
8045
8079
|
};
|
|
8046
8080
|
Organization5.displayName = "Organization";
|
|
8047
8081
|
var Organization_default = Organization5;
|
|
8048
8082
|
|
|
8049
8083
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8050
|
-
var
|
|
8084
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
8051
8085
|
var import_css45 = require("@emotion/css");
|
|
8052
8086
|
var import_react67 = require("react");
|
|
8053
8087
|
|
|
8054
8088
|
// src/utils/getMappedUserProfileValue.ts
|
|
8055
|
-
var
|
|
8089
|
+
var import_browser55 = require("@asgardeo/browser");
|
|
8056
8090
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8057
8091
|
if (!key || !mappings || !user) {
|
|
8058
8092
|
return void 0;
|
|
8059
8093
|
}
|
|
8060
8094
|
const mapping = mappings[key];
|
|
8061
8095
|
if (!mapping) {
|
|
8062
|
-
return (0,
|
|
8096
|
+
return (0, import_browser55.get)(user, key);
|
|
8063
8097
|
}
|
|
8064
8098
|
if (Array.isArray(mapping)) {
|
|
8065
8099
|
for (const path of mapping) {
|
|
8066
|
-
const value = (0,
|
|
8100
|
+
const value = (0, import_browser55.get)(user, path);
|
|
8067
8101
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8068
8102
|
return value;
|
|
8069
8103
|
}
|
|
8070
8104
|
}
|
|
8071
8105
|
return void 0;
|
|
8072
8106
|
}
|
|
8073
|
-
return (0,
|
|
8107
|
+
return (0, import_browser55.get)(user, mapping);
|
|
8074
8108
|
};
|
|
8075
8109
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8076
8110
|
|
|
8077
8111
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8078
|
-
var
|
|
8112
|
+
var import_browser56 = require("@asgardeo/browser");
|
|
8079
8113
|
var import_css39 = require("@emotion/css");
|
|
8080
8114
|
var import_react60 = require("react");
|
|
8081
8115
|
|
|
@@ -8129,18 +8163,25 @@ var useStyles18 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
8129
8163
|
}
|
|
8130
8164
|
}
|
|
8131
8165
|
`;
|
|
8166
|
+
const iconStyles = import_css38.css`
|
|
8167
|
+
width: 60%;
|
|
8168
|
+
height: 60%;
|
|
8169
|
+
fill: ${backgroundColor ? "#ffffff" : theme.vars.colors.text.secondary};
|
|
8170
|
+
opacity: 0.8;
|
|
8171
|
+
`;
|
|
8132
8172
|
return {
|
|
8133
8173
|
avatar: baseAvatar,
|
|
8134
8174
|
variant: variantStyles[variant],
|
|
8135
8175
|
image: imageStyles,
|
|
8136
|
-
skeleton: skeletonStyles
|
|
8176
|
+
skeleton: skeletonStyles,
|
|
8177
|
+
icon: iconStyles
|
|
8137
8178
|
};
|
|
8138
8179
|
}, [theme, colorScheme, size, variant, backgroundColor]);
|
|
8139
8180
|
};
|
|
8140
8181
|
var Avatar_styles_default = useStyles18;
|
|
8141
8182
|
|
|
8142
8183
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8143
|
-
var
|
|
8184
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8144
8185
|
var Avatar = ({
|
|
8145
8186
|
alt = "User avatar",
|
|
8146
8187
|
background = "random",
|
|
@@ -8148,7 +8189,8 @@ var Avatar = ({
|
|
|
8148
8189
|
imageUrl,
|
|
8149
8190
|
name,
|
|
8150
8191
|
size = 64,
|
|
8151
|
-
variant = "circular"
|
|
8192
|
+
variant = "circular",
|
|
8193
|
+
isLoading = false
|
|
8152
8194
|
}) => {
|
|
8153
8195
|
const { theme, colorScheme } = useTheme_default();
|
|
8154
8196
|
const generateBackgroundColor = (inputString) => {
|
|
@@ -8182,24 +8224,37 @@ var Avatar = ({
|
|
|
8182
8224
|
return background;
|
|
8183
8225
|
}, [background, name, imageUrl]);
|
|
8184
8226
|
const styles = Avatar_styles_default(theme, colorScheme, size, variant, backgroundColor);
|
|
8227
|
+
const isDefaultState = !imageUrl && !name && !isLoading;
|
|
8185
8228
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
8186
8229
|
const renderContent = () => {
|
|
8187
8230
|
if (imageUrl) {
|
|
8188
|
-
return /* @__PURE__ */ (0,
|
|
8231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("img", { src: imageUrl, alt, className: (0, import_css39.cx)((0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar", "image")), styles.image) });
|
|
8189
8232
|
}
|
|
8190
8233
|
if (name) {
|
|
8191
8234
|
return getInitials(name);
|
|
8192
8235
|
}
|
|
8193
|
-
|
|
8236
|
+
if (isLoading) {
|
|
8237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: (0, import_css39.cx)((0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
8238
|
+
}
|
|
8239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
8240
|
+
"svg",
|
|
8241
|
+
{
|
|
8242
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8243
|
+
viewBox: "0 0 640 640",
|
|
8244
|
+
className: (0, import_css39.cx)((0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar", "icon")), styles.icon),
|
|
8245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.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" })
|
|
8246
|
+
}
|
|
8247
|
+
);
|
|
8194
8248
|
};
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
8196
8250
|
"div",
|
|
8197
8251
|
{
|
|
8198
8252
|
className: (0, import_css39.cx)(
|
|
8199
|
-
(0,
|
|
8253
|
+
(0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar")),
|
|
8200
8254
|
styles.avatar,
|
|
8201
8255
|
styles.variant,
|
|
8202
|
-
(0,
|
|
8256
|
+
(0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar", null, variant)),
|
|
8257
|
+
isDefaultState && (0, import_browser56.withVendorCSSClassPrefix)((0, import_browser56.bem)("avatar", "default")),
|
|
8203
8258
|
className
|
|
8204
8259
|
),
|
|
8205
8260
|
children: renderContent()
|
|
@@ -8209,14 +8264,14 @@ var Avatar = ({
|
|
|
8209
8264
|
var Avatar_default = Avatar;
|
|
8210
8265
|
|
|
8211
8266
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
8212
|
-
var
|
|
8267
|
+
var import_browser57 = require("@asgardeo/browser");
|
|
8213
8268
|
var import_react62 = require("@floating-ui/react");
|
|
8214
8269
|
var import_css41 = require("@emotion/css");
|
|
8215
8270
|
var import_react63 = __toESM(require("react"), 1);
|
|
8216
8271
|
|
|
8217
8272
|
// src/components/primitives/Icons/LogOut.tsx
|
|
8218
|
-
var
|
|
8219
|
-
var LogOut = (props) => /* @__PURE__ */ (0,
|
|
8273
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
8274
|
+
var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
8220
8275
|
"svg",
|
|
8221
8276
|
{
|
|
8222
8277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8230,17 +8285,17 @@ var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
|
8230
8285
|
strokeLinejoin: "round",
|
|
8231
8286
|
...props,
|
|
8232
8287
|
children: [
|
|
8233
|
-
/* @__PURE__ */ (0,
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8235
|
-
/* @__PURE__ */ (0,
|
|
8288
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { d: "m16 17 5-5-5-5" }),
|
|
8289
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { d: "M21 12H9" }),
|
|
8290
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
8236
8291
|
]
|
|
8237
8292
|
}
|
|
8238
8293
|
);
|
|
8239
8294
|
var LogOut_default = LogOut;
|
|
8240
8295
|
|
|
8241
8296
|
// src/components/primitives/Icons/Plus.tsx
|
|
8242
|
-
var
|
|
8243
|
-
var Plus = (props) => /* @__PURE__ */ (0,
|
|
8297
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
8298
|
+
var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
8244
8299
|
"svg",
|
|
8245
8300
|
{
|
|
8246
8301
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8254,16 +8309,16 @@ var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
|
8254
8309
|
strokeLinejoin: "round",
|
|
8255
8310
|
...props,
|
|
8256
8311
|
children: [
|
|
8257
|
-
/* @__PURE__ */ (0,
|
|
8258
|
-
/* @__PURE__ */ (0,
|
|
8312
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M5 12h14" }),
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("path", { d: "M12 5v14" })
|
|
8259
8314
|
]
|
|
8260
8315
|
}
|
|
8261
8316
|
);
|
|
8262
8317
|
var Plus_default = Plus;
|
|
8263
8318
|
|
|
8264
8319
|
// src/components/primitives/Icons/User.tsx
|
|
8265
|
-
var
|
|
8266
|
-
var User7 = (props) => /* @__PURE__ */ (0,
|
|
8320
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
8321
|
+
var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
8267
8322
|
"svg",
|
|
8268
8323
|
{
|
|
8269
8324
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8277,16 +8332,16 @@ var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
|
8277
8332
|
strokeLinejoin: "round",
|
|
8278
8333
|
...props,
|
|
8279
8334
|
children: [
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8281
|
-
/* @__PURE__ */ (0,
|
|
8335
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
8336
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("circle", { cx: "12", cy: "7", r: "4" })
|
|
8282
8337
|
]
|
|
8283
8338
|
}
|
|
8284
8339
|
);
|
|
8285
8340
|
var User_default2 = User7;
|
|
8286
8341
|
|
|
8287
8342
|
// src/components/primitives/Icons/X.tsx
|
|
8288
|
-
var
|
|
8289
|
-
var X = (props) => /* @__PURE__ */ (0,
|
|
8343
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
8344
|
+
var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
8290
8345
|
"svg",
|
|
8291
8346
|
{
|
|
8292
8347
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8300,8 +8355,8 @@ var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
|
8300
8355
|
strokeLinejoin: "round",
|
|
8301
8356
|
...props,
|
|
8302
8357
|
children: [
|
|
8303
|
-
/* @__PURE__ */ (0,
|
|
8304
|
-
/* @__PURE__ */ (0,
|
|
8358
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { d: "M18 6 6 18" }),
|
|
8359
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { d: "m6 6 12 12" })
|
|
8305
8360
|
]
|
|
8306
8361
|
}
|
|
8307
8362
|
);
|
|
@@ -8324,17 +8379,6 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
8324
8379
|
border-radius: ${theme.vars.borderRadius.large};
|
|
8325
8380
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
8326
8381
|
outline: none;
|
|
8327
|
-
max-width: 35vw;
|
|
8328
|
-
min-width: 35vw;
|
|
8329
|
-
@media (max-width: 900px) {
|
|
8330
|
-
max-width: 80vw;
|
|
8331
|
-
min-width: 80vw;
|
|
8332
|
-
}
|
|
8333
|
-
@media (max-width: 600px) {
|
|
8334
|
-
max-width: 95vw;
|
|
8335
|
-
min-width: 95vw;
|
|
8336
|
-
}
|
|
8337
|
-
max-height: 90vh;
|
|
8338
8382
|
overflow-y: auto;
|
|
8339
8383
|
z-index: 10000;
|
|
8340
8384
|
`;
|
|
@@ -8384,7 +8428,7 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
8384
8428
|
var Dialog_styles_default = useStyles19;
|
|
8385
8429
|
|
|
8386
8430
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
8387
|
-
var
|
|
8431
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
8388
8432
|
function useDialog({
|
|
8389
8433
|
initialOpen = false,
|
|
8390
8434
|
open: controlledOpen,
|
|
@@ -8430,7 +8474,7 @@ var useDialogContext = () => {
|
|
|
8430
8474
|
};
|
|
8431
8475
|
function Dialog({ children, ...options }) {
|
|
8432
8476
|
const dialog = useDialog(options);
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(DialogContext.Provider, { value: dialog, children });
|
|
8434
8478
|
}
|
|
8435
8479
|
var DialogTrigger = import_react63.default.forwardRef(
|
|
8436
8480
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -8448,7 +8492,7 @@ var DialogTrigger = import_react63.default.forwardRef(
|
|
|
8448
8492
|
})
|
|
8449
8493
|
);
|
|
8450
8494
|
}
|
|
8451
|
-
return /* @__PURE__ */ (0,
|
|
8495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
8452
8496
|
}
|
|
8453
8497
|
);
|
|
8454
8498
|
var DialogContent = import_react63.default.forwardRef((props, propRef) => {
|
|
@@ -8457,11 +8501,11 @@ var DialogContent = import_react63.default.forwardRef((props, propRef) => {
|
|
|
8457
8501
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
8458
8502
|
const ref = (0, import_react62.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
8459
8503
|
if (!floatingContext.open) return null;
|
|
8460
|
-
return /* @__PURE__ */ (0,
|
|
8504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react62.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react62.FloatingOverlay, { className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react62.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8461
8505
|
"div",
|
|
8462
8506
|
{
|
|
8463
8507
|
ref,
|
|
8464
|
-
className: (0, import_css41.cx)((0,
|
|
8508
|
+
className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "content")), styles.content, props.className),
|
|
8465
8509
|
"aria-labelledby": context.labelId,
|
|
8466
8510
|
"aria-describedby": context.descriptionId,
|
|
8467
8511
|
...context.getFloatingProps(props),
|
|
@@ -8479,18 +8523,18 @@ var DialogHeading = import_react63.default.forwardRef(
|
|
|
8479
8523
|
context.setLabelId(id);
|
|
8480
8524
|
return () => context.setLabelId(void 0);
|
|
8481
8525
|
}, [id, context.setLabelId]);
|
|
8482
|
-
return /* @__PURE__ */ (0,
|
|
8483
|
-
/* @__PURE__ */ (0,
|
|
8526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "header")), styles.header), children: [
|
|
8527
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8484
8528
|
"h2",
|
|
8485
8529
|
{
|
|
8486
8530
|
...props,
|
|
8487
8531
|
ref,
|
|
8488
8532
|
id,
|
|
8489
|
-
className: (0, import_css41.cx)((0,
|
|
8533
|
+
className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "title")), styles.headerTitle),
|
|
8490
8534
|
children
|
|
8491
8535
|
}
|
|
8492
8536
|
),
|
|
8493
|
-
/* @__PURE__ */ (0,
|
|
8537
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8494
8538
|
Button_default,
|
|
8495
8539
|
{
|
|
8496
8540
|
color: "tertiary",
|
|
@@ -8499,7 +8543,7 @@ var DialogHeading = import_react63.default.forwardRef(
|
|
|
8499
8543
|
shape: "round",
|
|
8500
8544
|
onClick: () => context.setOpen(false),
|
|
8501
8545
|
"aria-label": "Close",
|
|
8502
|
-
children: /* @__PURE__ */ (0,
|
|
8546
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(X_default, { width: 16, height: 16 })
|
|
8503
8547
|
}
|
|
8504
8548
|
)
|
|
8505
8549
|
] });
|
|
@@ -8515,13 +8559,13 @@ var DialogDescription = import_react63.default.forwardRef(
|
|
|
8515
8559
|
context.setDescriptionId(id);
|
|
8516
8560
|
return () => context.setDescriptionId(void 0);
|
|
8517
8561
|
}, [id, context.setDescriptionId]);
|
|
8518
|
-
return /* @__PURE__ */ (0,
|
|
8562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8519
8563
|
"p",
|
|
8520
8564
|
{
|
|
8521
8565
|
...props,
|
|
8522
8566
|
ref,
|
|
8523
8567
|
id,
|
|
8524
|
-
className: (0, import_css41.cx)((0,
|
|
8568
|
+
className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "description")), styles.description, props.className),
|
|
8525
8569
|
children
|
|
8526
8570
|
}
|
|
8527
8571
|
);
|
|
@@ -8545,13 +8589,13 @@ var DialogClose = import_react63.default.forwardRef(({ children, asChild = false
|
|
|
8545
8589
|
onClick: handleClick
|
|
8546
8590
|
});
|
|
8547
8591
|
}
|
|
8548
|
-
return /* @__PURE__ */ (0,
|
|
8592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
8549
8593
|
Button_default,
|
|
8550
8594
|
{
|
|
8551
8595
|
...props,
|
|
8552
8596
|
ref,
|
|
8553
8597
|
onClick: handleClick,
|
|
8554
|
-
className: (0, import_css41.cx)((0,
|
|
8598
|
+
className: (0, import_css41.cx)((0, import_browser57.withVendorCSSClassPrefix)((0, import_browser57.bem)("dialog", "close")), props.className),
|
|
8555
8599
|
variant: "text",
|
|
8556
8600
|
children
|
|
8557
8601
|
}
|
|
@@ -8572,7 +8616,7 @@ var Dialog_default = Dialog;
|
|
|
8572
8616
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
8573
8617
|
var import_react65 = require("react");
|
|
8574
8618
|
var import_css43 = require("@emotion/css");
|
|
8575
|
-
var
|
|
8619
|
+
var import_browser58 = require("@asgardeo/browser");
|
|
8576
8620
|
|
|
8577
8621
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
8578
8622
|
var import_css42 = require("@emotion/css");
|
|
@@ -8668,7 +8712,7 @@ var useStyles20 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
8668
8712
|
var MultiInput_styles_default = useStyles20;
|
|
8669
8713
|
|
|
8670
8714
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
8671
|
-
var
|
|
8715
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
8672
8716
|
var MultiInput = ({
|
|
8673
8717
|
label,
|
|
8674
8718
|
error,
|
|
@@ -8691,8 +8735,8 @@ var MultiInput = ({
|
|
|
8691
8735
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
8692
8736
|
const canRemove = values.length > minFields;
|
|
8693
8737
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
8694
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ (0,
|
|
8695
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ (0,
|
|
8738
|
+
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css43.cx)(styles.icon, className2), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { d: "M12 5v14M5 12h14" }) });
|
|
8739
|
+
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css43.cx)(styles.icon, className2), children: /* @__PURE__ */ (0, import_jsx_runtime74.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" }) });
|
|
8696
8740
|
const handleAddValue = (0, import_react65.useCallback)(
|
|
8697
8741
|
(newValue) => {
|
|
8698
8742
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -8736,9 +8780,9 @@ var MultiInput = ({
|
|
|
8736
8780
|
};
|
|
8737
8781
|
switch (fieldType) {
|
|
8738
8782
|
case "DATE_TIME":
|
|
8739
|
-
return /* @__PURE__ */ (0,
|
|
8783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(DatePicker_default, { ...commonProps });
|
|
8740
8784
|
case "BOOLEAN":
|
|
8741
|
-
return /* @__PURE__ */ (0,
|
|
8785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
8742
8786
|
Checkbox_default,
|
|
8743
8787
|
{
|
|
8744
8788
|
...commonProps,
|
|
@@ -8747,7 +8791,7 @@ var MultiInput = ({
|
|
|
8747
8791
|
}
|
|
8748
8792
|
);
|
|
8749
8793
|
default:
|
|
8750
|
-
return /* @__PURE__ */ (0,
|
|
8794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TextField_default, { ...commonProps, type });
|
|
8751
8795
|
}
|
|
8752
8796
|
},
|
|
8753
8797
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -8759,43 +8803,43 @@ var MultiInput = ({
|
|
|
8759
8803
|
setCurrentInputValue("");
|
|
8760
8804
|
}
|
|
8761
8805
|
}, [currentInputValue, handleAddValue]);
|
|
8762
|
-
return /* @__PURE__ */ (0,
|
|
8806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
8763
8807
|
FormControl_default,
|
|
8764
8808
|
{
|
|
8765
8809
|
error,
|
|
8766
8810
|
helperText,
|
|
8767
|
-
className: (0, import_css43.cx)((0,
|
|
8811
|
+
className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input")), className),
|
|
8768
8812
|
style,
|
|
8769
8813
|
children: [
|
|
8770
|
-
label && /* @__PURE__ */ (0,
|
|
8771
|
-
/* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8814
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "container")), styles.container), children: [
|
|
8816
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
8773
8817
|
currentInputValue,
|
|
8774
8818
|
setCurrentInputValue,
|
|
8775
|
-
canAddMore ? /* @__PURE__ */ (0,
|
|
8819
|
+
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
8776
8820
|
canAddMore ? handleInputSubmit : void 0
|
|
8777
8821
|
) }) }),
|
|
8778
|
-
values.length > 0 && /* @__PURE__ */ (0,
|
|
8822
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
8779
8823
|
"div",
|
|
8780
8824
|
{
|
|
8781
|
-
className: (0, import_css43.cx)((0,
|
|
8825
|
+
className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "list-item")), styles.listItem),
|
|
8782
8826
|
children: [
|
|
8783
|
-
/* @__PURE__ */ (0,
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
8784
8828
|
"span",
|
|
8785
8829
|
{
|
|
8786
|
-
className: (0, import_css43.cx)((0,
|
|
8830
|
+
className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
8787
8831
|
children: value
|
|
8788
8832
|
}
|
|
8789
8833
|
),
|
|
8790
|
-
canRemove && /* @__PURE__ */ (0,
|
|
8834
|
+
canRemove && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
8791
8835
|
"button",
|
|
8792
8836
|
{
|
|
8793
8837
|
type: "button",
|
|
8794
8838
|
onClick: () => handleRemoveValue(index),
|
|
8795
8839
|
disabled,
|
|
8796
|
-
className: (0, import_css43.cx)((0,
|
|
8840
|
+
className: (0, import_css43.cx)((0, import_browser58.withVendorCSSClassPrefix)((0, import_browser58.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
8797
8841
|
title: "Remove value",
|
|
8798
|
-
children: /* @__PURE__ */ (0,
|
|
8842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(BinIcon, { className: styles.icon })
|
|
8799
8843
|
}
|
|
8800
8844
|
)
|
|
8801
8845
|
]
|
|
@@ -8812,7 +8856,7 @@ var MultiInput_default = MultiInput;
|
|
|
8812
8856
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
8813
8857
|
var import_css44 = require("@emotion/css");
|
|
8814
8858
|
var import_react66 = require("react");
|
|
8815
|
-
var
|
|
8859
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
8816
8860
|
var useStyles21 = (theme, colorScheme) => {
|
|
8817
8861
|
const valuePlaceholder = import_css44.css`
|
|
8818
8862
|
font-style: italic;
|
|
@@ -8923,7 +8967,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
8923
8967
|
max-width: 350px;
|
|
8924
8968
|
text-align: left;
|
|
8925
8969
|
|
|
8926
|
-
.${(0,
|
|
8970
|
+
.${(0, import_browser59.withVendorCSSClassPrefix)("form-control")} {
|
|
8927
8971
|
margin-bottom: 0;
|
|
8928
8972
|
}
|
|
8929
8973
|
|
|
@@ -8983,7 +9027,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
8983
9027
|
var BaseUserProfile_styles_default = useStyles21;
|
|
8984
9028
|
|
|
8985
9029
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8986
|
-
var
|
|
9030
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
8987
9031
|
var fieldsToSkip = [
|
|
8988
9032
|
"roles.default",
|
|
8989
9033
|
"active",
|
|
@@ -9019,13 +9063,31 @@ var BaseUserProfile = ({
|
|
|
9019
9063
|
onOpenChange,
|
|
9020
9064
|
onUpdate,
|
|
9021
9065
|
open = false,
|
|
9022
|
-
error = null
|
|
9066
|
+
error = null,
|
|
9067
|
+
isLoading = false,
|
|
9068
|
+
showFields = [],
|
|
9069
|
+
hideFields = []
|
|
9023
9070
|
}) => {
|
|
9024
9071
|
const { theme, colorScheme } = useTheme_default();
|
|
9025
9072
|
const [editedUser, setEditedUser] = (0, import_react67.useState)(flattenedProfile || profile);
|
|
9026
9073
|
const [editingFields, setEditingFields] = (0, import_react67.useState)({});
|
|
9027
9074
|
const { t } = useTranslation_default();
|
|
9028
|
-
const
|
|
9075
|
+
const shouldShowField = (0, import_react67.useCallback)(
|
|
9076
|
+
(fieldName) => {
|
|
9077
|
+
if (fieldsToSkip.includes(fieldName)) {
|
|
9078
|
+
return false;
|
|
9079
|
+
}
|
|
9080
|
+
if (hideFields.length > 0 && hideFields.includes(fieldName)) {
|
|
9081
|
+
return false;
|
|
9082
|
+
}
|
|
9083
|
+
if (showFields.length > 0) {
|
|
9084
|
+
return showFields.includes(fieldName);
|
|
9085
|
+
}
|
|
9086
|
+
return true;
|
|
9087
|
+
},
|
|
9088
|
+
[showFields, hideFields]
|
|
9089
|
+
);
|
|
9090
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9029
9091
|
"svg",
|
|
9030
9092
|
{
|
|
9031
9093
|
width: "16",
|
|
@@ -9036,7 +9098,7 @@ var BaseUserProfile = ({
|
|
|
9036
9098
|
strokeWidth: "2",
|
|
9037
9099
|
strokeLinecap: "round",
|
|
9038
9100
|
strokeLinejoin: "round",
|
|
9039
|
-
children: /* @__PURE__ */ (0,
|
|
9101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
9040
9102
|
}
|
|
9041
9103
|
);
|
|
9042
9104
|
const toggleFieldEdit = (0, import_react67.useCallback)((fieldName) => {
|
|
@@ -9061,12 +9123,12 @@ var BaseUserProfile = ({
|
|
|
9061
9123
|
}, []);
|
|
9062
9124
|
const ObjectDisplay = ({ data }) => {
|
|
9063
9125
|
if (!data || typeof data !== "object") return null;
|
|
9064
|
-
return /* @__PURE__ */ (0,
|
|
9065
|
-
/* @__PURE__ */ (0,
|
|
9126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("table", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("tr", { children: [
|
|
9127
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("td", { className: styles.objectKey, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("strong", { children: [
|
|
9066
9128
|
formatLabel(key),
|
|
9067
9129
|
":"
|
|
9068
9130
|
] }) }),
|
|
9069
|
-
/* @__PURE__ */ (0,
|
|
9131
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ObjectDisplay, { data: value }) : String(value) })
|
|
9070
9132
|
] }, key)) }) });
|
|
9071
9133
|
};
|
|
9072
9134
|
function set(obj, path, value) {
|
|
@@ -9093,7 +9155,7 @@ var BaseUserProfile = ({
|
|
|
9093
9155
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
9094
9156
|
}
|
|
9095
9157
|
let payload = {};
|
|
9096
|
-
if (schema.schemaId && schema.schemaId !==
|
|
9158
|
+
if (schema.schemaId && schema.schemaId !== import_browser60.WellKnownSchemaIds.User) {
|
|
9097
9159
|
payload = {
|
|
9098
9160
|
[schema.schemaId]: {
|
|
9099
9161
|
[fieldName]: fieldValue
|
|
@@ -9136,9 +9198,9 @@ var BaseUserProfile = ({
|
|
|
9136
9198
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
9137
9199
|
const label = displayName || description || name || "";
|
|
9138
9200
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
9139
|
-
return /* @__PURE__ */ (0,
|
|
9140
|
-
/* @__PURE__ */ (0,
|
|
9141
|
-
/* @__PURE__ */ (0,
|
|
9201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_jsx_runtime75.Fragment, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: styles.field, children: [
|
|
9202
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
9203
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.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) })
|
|
9142
9204
|
] }, index)) });
|
|
9143
9205
|
}
|
|
9144
9206
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -9154,9 +9216,9 @@ var BaseUserProfile = ({
|
|
|
9154
9216
|
} else {
|
|
9155
9217
|
fieldValues = [];
|
|
9156
9218
|
}
|
|
9157
|
-
return /* @__PURE__ */ (0,
|
|
9158
|
-
/* @__PURE__ */ (0,
|
|
9159
|
-
/* @__PURE__ */ (0,
|
|
9219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: label }),
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9160
9222
|
MultiInput_default,
|
|
9161
9223
|
{
|
|
9162
9224
|
values: fieldValues,
|
|
@@ -9187,9 +9249,9 @@ var BaseUserProfile = ({
|
|
|
9187
9249
|
} else {
|
|
9188
9250
|
displayValue2 = "-";
|
|
9189
9251
|
}
|
|
9190
|
-
return /* @__PURE__ */ (0,
|
|
9191
|
-
/* @__PURE__ */ (0,
|
|
9192
|
-
/* @__PURE__ */ (0,
|
|
9252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
9253
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: label }),
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: (0, import_css45.cx)(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9193
9255
|
Button_default,
|
|
9194
9256
|
{
|
|
9195
9257
|
onClick: onStartEdit,
|
|
@@ -9204,7 +9266,7 @@ var BaseUserProfile = ({
|
|
|
9204
9266
|
] });
|
|
9205
9267
|
}
|
|
9206
9268
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
9207
|
-
return /* @__PURE__ */ (0,
|
|
9269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ObjectDisplay, { data: value });
|
|
9208
9270
|
}
|
|
9209
9271
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
9210
9272
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -9219,16 +9281,16 @@ var BaseUserProfile = ({
|
|
|
9219
9281
|
let field;
|
|
9220
9282
|
switch (type) {
|
|
9221
9283
|
case "STRING":
|
|
9222
|
-
field = /* @__PURE__ */ (0,
|
|
9284
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextField_default, { ...commonProps });
|
|
9223
9285
|
break;
|
|
9224
9286
|
case "DATE_TIME":
|
|
9225
|
-
field = /* @__PURE__ */ (0,
|
|
9287
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DatePicker_default, { ...commonProps });
|
|
9226
9288
|
break;
|
|
9227
9289
|
case "BOOLEAN":
|
|
9228
|
-
field = /* @__PURE__ */ (0,
|
|
9290
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
9229
9291
|
break;
|
|
9230
9292
|
case "COMPLEX":
|
|
9231
|
-
field = /* @__PURE__ */ (0,
|
|
9293
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9232
9294
|
"textarea",
|
|
9233
9295
|
{
|
|
9234
9296
|
value: fieldValue,
|
|
@@ -9240,11 +9302,11 @@ var BaseUserProfile = ({
|
|
|
9240
9302
|
);
|
|
9241
9303
|
break;
|
|
9242
9304
|
default:
|
|
9243
|
-
field = /* @__PURE__ */ (0,
|
|
9305
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextField_default, { ...commonProps });
|
|
9244
9306
|
}
|
|
9245
|
-
return /* @__PURE__ */ (0,
|
|
9246
|
-
/* @__PURE__ */ (0,
|
|
9247
|
-
/* @__PURE__ */ (0,
|
|
9307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
9308
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: label }),
|
|
9309
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.value, children: field })
|
|
9248
9310
|
] });
|
|
9249
9311
|
}
|
|
9250
9312
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -9257,9 +9319,9 @@ var BaseUserProfile = ({
|
|
|
9257
9319
|
} else {
|
|
9258
9320
|
displayValue = "-";
|
|
9259
9321
|
}
|
|
9260
|
-
return /* @__PURE__ */ (0,
|
|
9261
|
-
/* @__PURE__ */ (0,
|
|
9262
|
-
/* @__PURE__ */ (0,
|
|
9322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
9323
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: label }),
|
|
9324
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: (0, import_css45.cx)(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9263
9325
|
Button_default,
|
|
9264
9326
|
{
|
|
9265
9327
|
onClick: onStartEdit,
|
|
@@ -9287,8 +9349,8 @@ var BaseUserProfile = ({
|
|
|
9287
9349
|
alignItems: "center",
|
|
9288
9350
|
gap: theme.vars.spacing.unit
|
|
9289
9351
|
};
|
|
9290
|
-
return /* @__PURE__ */ (0,
|
|
9291
|
-
/* @__PURE__ */ (0,
|
|
9352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: styles.field, children: [
|
|
9353
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
9292
9354
|
schema,
|
|
9293
9355
|
isFieldEditing,
|
|
9294
9356
|
(value) => {
|
|
@@ -9298,21 +9360,21 @@ var BaseUserProfile = ({
|
|
|
9298
9360
|
},
|
|
9299
9361
|
() => toggleFieldEdit(schema.name)
|
|
9300
9362
|
) }),
|
|
9301
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0,
|
|
9302
|
-
isFieldEditing && /* @__PURE__ */ (0,
|
|
9303
|
-
/* @__PURE__ */ (0,
|
|
9304
|
-
/* @__PURE__ */ (0,
|
|
9363
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: styles.fieldActions, children: [
|
|
9364
|
+
isFieldEditing && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
9365
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
9366
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
9305
9367
|
] }),
|
|
9306
|
-
!isFieldEditing && hasValue && /* @__PURE__ */ (0,
|
|
9368
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9307
9369
|
Button_default,
|
|
9308
9370
|
{
|
|
9309
9371
|
size: "small",
|
|
9310
9372
|
color: "tertiary",
|
|
9311
|
-
variant: "
|
|
9373
|
+
variant: "icon",
|
|
9312
9374
|
onClick: () => toggleFieldEdit(schema.name),
|
|
9313
9375
|
title: "Edit",
|
|
9314
9376
|
className: styles.editButton,
|
|
9315
|
-
children: /* @__PURE__ */ (0,
|
|
9377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PencilIcon, {})
|
|
9316
9378
|
}
|
|
9317
9379
|
)
|
|
9318
9380
|
] })
|
|
@@ -9332,7 +9394,7 @@ var BaseUserProfile = ({
|
|
|
9332
9394
|
const containerClasses = (0, import_css45.cx)(
|
|
9333
9395
|
styles.root,
|
|
9334
9396
|
cardLayout ? styles.card : "",
|
|
9335
|
-
(0,
|
|
9397
|
+
(0, import_browser60.withVendorCSSClassPrefix)("user-profile"),
|
|
9336
9398
|
className
|
|
9337
9399
|
);
|
|
9338
9400
|
const currentUser = flattenedProfile || profile;
|
|
@@ -9341,30 +9403,31 @@ var BaseUserProfile = ({
|
|
|
9341
9403
|
const renderProfileWithoutSchemas = () => {
|
|
9342
9404
|
if (!currentUser) return null;
|
|
9343
9405
|
const profileEntries = Object.entries(currentUser).filter(([key, value]) => {
|
|
9344
|
-
if (
|
|
9406
|
+
if (!shouldShowField(key)) return false;
|
|
9345
9407
|
return value !== void 0 && value !== "" && value !== null;
|
|
9346
9408
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
9347
|
-
return /* @__PURE__ */ (0,
|
|
9348
|
-
/* @__PURE__ */ (0,
|
|
9349
|
-
/* @__PURE__ */ (0,
|
|
9409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_jsx_runtime75.Fragment, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: styles.field, children: [
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: styles.label, children: formatLabel(key) }),
|
|
9411
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
9350
9412
|
] }, key)) });
|
|
9351
9413
|
};
|
|
9352
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
9353
|
-
error && /* @__PURE__ */ (0,
|
|
9354
|
-
/* @__PURE__ */ (0,
|
|
9355
|
-
/* @__PURE__ */ (0,
|
|
9414
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Card_default, { className: containerClasses, children: [
|
|
9415
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Alert_default, { variant: "error", className: (0, import_css45.cx)((0, import_browser60.withVendorCSSClassPrefix)((0, import_browser60.bem)("user-profile", "alert")), styles.alert), children: [
|
|
9416
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
9417
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Description, { children: error })
|
|
9356
9418
|
] }),
|
|
9357
|
-
/* @__PURE__ */ (0,
|
|
9419
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
9358
9420
|
Avatar,
|
|
9359
9421
|
{
|
|
9360
9422
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
9361
9423
|
name: getDisplayName(),
|
|
9362
9424
|
size: 80,
|
|
9363
|
-
alt: `${getDisplayName()}'s avatar
|
|
9425
|
+
alt: `${getDisplayName()}'s avatar`,
|
|
9426
|
+
isLoading
|
|
9364
9427
|
}
|
|
9365
9428
|
) }),
|
|
9366
|
-
/* @__PURE__ */ (0,
|
|
9367
|
-
if (
|
|
9429
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
9430
|
+
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
9368
9431
|
if (!editable) {
|
|
9369
9432
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
9370
9433
|
return value !== void 0 && value !== "" && value !== null;
|
|
@@ -9380,13 +9443,13 @@ var BaseUserProfile = ({
|
|
|
9380
9443
|
...schema,
|
|
9381
9444
|
value
|
|
9382
9445
|
};
|
|
9383
|
-
return /* @__PURE__ */ (0,
|
|
9446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
9384
9447
|
}) : renderProfileWithoutSchemas() })
|
|
9385
9448
|
] });
|
|
9386
9449
|
if (mode === "popup") {
|
|
9387
|
-
return /* @__PURE__ */ (0,
|
|
9388
|
-
/* @__PURE__ */ (0,
|
|
9389
|
-
/* @__PURE__ */ (0,
|
|
9450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Dialog_default.Content, { children: [
|
|
9451
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Dialog_default.Heading, { children: title ?? t("user.profile.title") }),
|
|
9452
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.popup, children: profileContent })
|
|
9390
9453
|
] }) });
|
|
9391
9454
|
}
|
|
9392
9455
|
return profileContent;
|
|
@@ -9397,8 +9460,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
9397
9460
|
var import_react68 = require("react");
|
|
9398
9461
|
|
|
9399
9462
|
// src/api/updateMeProfile.ts
|
|
9400
|
-
var
|
|
9401
|
-
var httpClient5 =
|
|
9463
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
9464
|
+
var httpClient5 = import_browser61.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser61.AsgardeoSPAClient.getInstance());
|
|
9402
9465
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
9403
9466
|
const defaultFetcher = async (url, config) => {
|
|
9404
9467
|
const response = await httpClient5({
|
|
@@ -9415,7 +9478,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
9415
9478
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
9416
9479
|
};
|
|
9417
9480
|
};
|
|
9418
|
-
return (0,
|
|
9481
|
+
return (0, import_browser61.updateMeProfile)({
|
|
9419
9482
|
...requestConfig,
|
|
9420
9483
|
fetcher: fetcher || defaultFetcher
|
|
9421
9484
|
});
|
|
@@ -9423,10 +9486,10 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
9423
9486
|
var updateMeProfile_default = updateMeProfile;
|
|
9424
9487
|
|
|
9425
9488
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
9426
|
-
var
|
|
9427
|
-
var
|
|
9489
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
9490
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
9428
9491
|
var UserProfile3 = ({ ...rest }) => {
|
|
9429
|
-
const { baseUrl } = useAsgardeo_default();
|
|
9492
|
+
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
9430
9493
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
9431
9494
|
const { t } = useTranslation_default();
|
|
9432
9495
|
const [error, setError] = (0, import_react68.useState)(null);
|
|
@@ -9437,13 +9500,13 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
9437
9500
|
onUpdateProfile(response);
|
|
9438
9501
|
} catch (error2) {
|
|
9439
9502
|
let message = t("user.profile.update.generic.error");
|
|
9440
|
-
if (error2 instanceof
|
|
9503
|
+
if (error2 instanceof import_browser62.AsgardeoError) {
|
|
9441
9504
|
message = error2?.message;
|
|
9442
9505
|
}
|
|
9443
9506
|
setError(message);
|
|
9444
9507
|
}
|
|
9445
9508
|
};
|
|
9446
|
-
return /* @__PURE__ */ (0,
|
|
9509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
9447
9510
|
BaseUserProfile_default,
|
|
9448
9511
|
{
|
|
9449
9512
|
profile,
|
|
@@ -9458,7 +9521,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
9458
9521
|
var UserProfile_default = UserProfile3;
|
|
9459
9522
|
|
|
9460
9523
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
9461
|
-
var
|
|
9524
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
9462
9525
|
var import_react70 = require("@floating-ui/react");
|
|
9463
9526
|
var import_css47 = require("@emotion/css");
|
|
9464
9527
|
var import_react71 = require("react");
|
|
@@ -9648,7 +9711,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9648
9711
|
var BaseUserDropdown_styles_default = useStyles22;
|
|
9649
9712
|
|
|
9650
9713
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
9651
|
-
var
|
|
9714
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
9652
9715
|
var BaseUserDropdown = ({
|
|
9653
9716
|
fallback = null,
|
|
9654
9717
|
className = "",
|
|
@@ -9707,14 +9770,14 @@ var BaseUserDropdown = ({
|
|
|
9707
9770
|
defaultMenuItems.push({
|
|
9708
9771
|
label: "Manage Profile",
|
|
9709
9772
|
onClick: onManageProfile,
|
|
9710
|
-
icon: /* @__PURE__ */ (0,
|
|
9773
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(User_default2, { width: "16", height: "16" })
|
|
9711
9774
|
});
|
|
9712
9775
|
}
|
|
9713
9776
|
if (onSignOut) {
|
|
9714
9777
|
defaultMenuItems.push({
|
|
9715
9778
|
label: "Sign Out",
|
|
9716
9779
|
onClick: onSignOut,
|
|
9717
|
-
icon: /* @__PURE__ */ (0,
|
|
9780
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(LogOut_default, { width: "16", height: "16" })
|
|
9718
9781
|
});
|
|
9719
9782
|
}
|
|
9720
9783
|
const allMenuItems = [...menuItems];
|
|
@@ -9724,18 +9787,18 @@ var BaseUserDropdown = ({
|
|
|
9724
9787
|
}
|
|
9725
9788
|
allMenuItems.push(...defaultMenuItems);
|
|
9726
9789
|
}
|
|
9727
|
-
return /* @__PURE__ */ (0,
|
|
9728
|
-
/* @__PURE__ */ (0,
|
|
9790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
9791
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
9729
9792
|
Button_default,
|
|
9730
9793
|
{
|
|
9731
9794
|
ref: refs.setReference,
|
|
9732
|
-
className: (0, import_css47.cx)((0,
|
|
9795
|
+
className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
9733
9796
|
color: "tertiary",
|
|
9734
9797
|
variant: "text",
|
|
9735
9798
|
size: "medium",
|
|
9736
9799
|
...getReferenceProps(),
|
|
9737
9800
|
children: [
|
|
9738
|
-
/* @__PURE__ */ (0,
|
|
9801
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9739
9802
|
Avatar,
|
|
9740
9803
|
{
|
|
9741
9804
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -9744,27 +9807,27 @@ var BaseUserDropdown = ({
|
|
|
9744
9807
|
alt: `${getDisplayName()}'s avatar`
|
|
9745
9808
|
}
|
|
9746
9809
|
),
|
|
9747
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
9810
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9748
9811
|
Typography_default,
|
|
9749
9812
|
{
|
|
9750
9813
|
variant: "body2",
|
|
9751
|
-
className: (0, import_css47.cx)((0,
|
|
9814
|
+
className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
9752
9815
|
children: getDisplayName()
|
|
9753
9816
|
}
|
|
9754
9817
|
)
|
|
9755
9818
|
]
|
|
9756
9819
|
}
|
|
9757
9820
|
),
|
|
9758
|
-
isOpen && /* @__PURE__ */ (0,
|
|
9821
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react70.FloatingPortal, { id: portalId, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react70.FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
9759
9822
|
"div",
|
|
9760
9823
|
{
|
|
9761
9824
|
ref: refs.setFloating,
|
|
9762
|
-
className: (0, import_css47.cx)((0,
|
|
9825
|
+
className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
9763
9826
|
style: floatingStyles,
|
|
9764
9827
|
...getFloatingProps(),
|
|
9765
9828
|
children: [
|
|
9766
|
-
/* @__PURE__ */ (0,
|
|
9767
|
-
/* @__PURE__ */ (0,
|
|
9829
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
9830
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9768
9831
|
Avatar,
|
|
9769
9832
|
{
|
|
9770
9833
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -9773,22 +9836,22 @@ var BaseUserDropdown = ({
|
|
|
9773
9836
|
alt: `${getDisplayName()}'s avatar`
|
|
9774
9837
|
}
|
|
9775
9838
|
),
|
|
9776
|
-
/* @__PURE__ */ (0,
|
|
9777
|
-
/* @__PURE__ */ (0,
|
|
9839
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
9840
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9778
9841
|
Typography_default,
|
|
9779
9842
|
{
|
|
9780
9843
|
noWrap: true,
|
|
9781
|
-
className: (0,
|
|
9844
|
+
className: (0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
9782
9845
|
variant: "body1",
|
|
9783
9846
|
fontWeight: "medium",
|
|
9784
9847
|
children: getDisplayName()
|
|
9785
9848
|
}
|
|
9786
9849
|
),
|
|
9787
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9788
9851
|
Typography_default,
|
|
9789
9852
|
{
|
|
9790
9853
|
noWrap: true,
|
|
9791
|
-
className: (0,
|
|
9854
|
+
className: (0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
9792
9855
|
variant: "caption",
|
|
9793
9856
|
color: "secondary",
|
|
9794
9857
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -9796,31 +9859,31 @@ var BaseUserDropdown = ({
|
|
|
9796
9859
|
)
|
|
9797
9860
|
] })
|
|
9798
9861
|
] }),
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9862
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
9800
9863
|
"a",
|
|
9801
9864
|
{
|
|
9802
9865
|
href: item.href,
|
|
9803
9866
|
style: {
|
|
9804
9867
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
9805
9868
|
},
|
|
9806
|
-
className: (0, import_css47.cx)((0,
|
|
9869
|
+
className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
9807
9870
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
9808
9871
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
9809
9872
|
onFocus: () => setHoveredItemIndex(index),
|
|
9810
9873
|
onBlur: () => setHoveredItemIndex(null),
|
|
9811
9874
|
children: [
|
|
9812
9875
|
item.icon,
|
|
9813
|
-
/* @__PURE__ */ (0,
|
|
9876
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: item.label })
|
|
9814
9877
|
]
|
|
9815
9878
|
}
|
|
9816
|
-
) : /* @__PURE__ */ (0,
|
|
9879
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
9817
9880
|
Button_default,
|
|
9818
9881
|
{
|
|
9819
9882
|
onClick: () => handleMenuItemClick(item),
|
|
9820
9883
|
style: {
|
|
9821
9884
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
9822
9885
|
},
|
|
9823
|
-
className: (0, import_css47.cx)((0,
|
|
9886
|
+
className: (0, import_css47.cx)((0, import_browser63.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
9824
9887
|
color: "tertiary",
|
|
9825
9888
|
variant: "text",
|
|
9826
9889
|
size: "small",
|
|
@@ -9839,7 +9902,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
9839
9902
|
|
|
9840
9903
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
9841
9904
|
var import_react72 = require("react");
|
|
9842
|
-
var
|
|
9905
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
9843
9906
|
var UserDropdown = ({
|
|
9844
9907
|
children,
|
|
9845
9908
|
renderTrigger,
|
|
@@ -9868,14 +9931,14 @@ var UserDropdown = ({
|
|
|
9868
9931
|
closeProfile
|
|
9869
9932
|
};
|
|
9870
9933
|
if (children) {
|
|
9871
|
-
return /* @__PURE__ */ (0,
|
|
9934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
9872
9935
|
children(renderProps),
|
|
9873
|
-
/* @__PURE__ */ (0,
|
|
9936
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9874
9937
|
] });
|
|
9875
9938
|
}
|
|
9876
9939
|
if (renderTrigger || renderDropdown) {
|
|
9877
|
-
return /* @__PURE__ */ (0,
|
|
9878
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0,
|
|
9940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
9941
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9879
9942
|
BaseUserDropdown_default,
|
|
9880
9943
|
{
|
|
9881
9944
|
user,
|
|
@@ -9885,11 +9948,11 @@ var UserDropdown = ({
|
|
|
9885
9948
|
...rest
|
|
9886
9949
|
}
|
|
9887
9950
|
),
|
|
9888
|
-
/* @__PURE__ */ (0,
|
|
9951
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9889
9952
|
] });
|
|
9890
9953
|
}
|
|
9891
|
-
return /* @__PURE__ */ (0,
|
|
9892
|
-
/* @__PURE__ */ (0,
|
|
9954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
9955
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9893
9956
|
BaseUserDropdown_default,
|
|
9894
9957
|
{
|
|
9895
9958
|
user,
|
|
@@ -9899,7 +9962,7 @@ var UserDropdown = ({
|
|
|
9899
9962
|
...rest
|
|
9900
9963
|
}
|
|
9901
9964
|
),
|
|
9902
|
-
isProfileOpen && /* @__PURE__ */ (0,
|
|
9965
|
+
isProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9903
9966
|
] });
|
|
9904
9967
|
};
|
|
9905
9968
|
var UserDropdown_default = UserDropdown;
|
|
@@ -9910,9 +9973,9 @@ var import_css49 = require("@emotion/css");
|
|
|
9910
9973
|
var import_react75 = require("react");
|
|
9911
9974
|
|
|
9912
9975
|
// src/components/primitives/Icons/Building.tsx
|
|
9913
|
-
var
|
|
9914
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
9915
|
-
/* @__PURE__ */ (0,
|
|
9976
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
9977
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
9978
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9916
9979
|
"path",
|
|
9917
9980
|
{
|
|
9918
9981
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -9922,25 +9985,25 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
9922
9985
|
strokeLinejoin: "round"
|
|
9923
9986
|
}
|
|
9924
9987
|
),
|
|
9925
|
-
/* @__PURE__ */ (0,
|
|
9926
|
-
/* @__PURE__ */ (0,
|
|
9927
|
-
/* @__PURE__ */ (0,
|
|
9928
|
-
/* @__PURE__ */ (0,
|
|
9929
|
-
/* @__PURE__ */ (0,
|
|
9930
|
-
/* @__PURE__ */ (0,
|
|
9988
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9989
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9990
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9991
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9992
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9993
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
9931
9994
|
] });
|
|
9932
9995
|
Building.displayName = "Building";
|
|
9933
9996
|
var Building_default = Building;
|
|
9934
9997
|
|
|
9935
9998
|
// src/components/primitives/Icons/Check.tsx
|
|
9936
|
-
var
|
|
9937
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
9999
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
10000
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
9938
10001
|
Check.displayName = "Check";
|
|
9939
10002
|
var Check_default = Check;
|
|
9940
10003
|
|
|
9941
10004
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
9942
|
-
var
|
|
9943
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
10005
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
10006
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
9944
10007
|
ChevronDown.displayName = "ChevronDown";
|
|
9945
10008
|
var ChevronDown_default = ChevronDown;
|
|
9946
10009
|
|
|
@@ -10170,7 +10233,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10170
10233
|
var BaseOrganizationSwitcher_styles_default = useStyles23;
|
|
10171
10234
|
|
|
10172
10235
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
10173
|
-
var
|
|
10236
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
10174
10237
|
var BaseOrganizationSwitcher = ({
|
|
10175
10238
|
organizations,
|
|
10176
10239
|
currentOrganization,
|
|
@@ -10223,8 +10286,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10223
10286
|
const switchableOrganizations = organizations.filter(
|
|
10224
10287
|
(org) => org.id !== currentOrganization?.id
|
|
10225
10288
|
);
|
|
10226
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0,
|
|
10227
|
-
/* @__PURE__ */ (0,
|
|
10289
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10290
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10228
10291
|
Avatar,
|
|
10229
10292
|
{
|
|
10230
10293
|
variant: "square",
|
|
@@ -10234,24 +10297,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
10234
10297
|
alt: `${organization.name} avatar`
|
|
10235
10298
|
}
|
|
10236
10299
|
),
|
|
10237
|
-
/* @__PURE__ */ (0,
|
|
10238
|
-
/* @__PURE__ */ (0,
|
|
10239
|
-
/* @__PURE__ */ (0,
|
|
10240
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
10300
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.organizationInfo), children: [
|
|
10301
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body2", fontWeight: "medium", className: (0, import_css49.cx)(styles.organizationName), children: organization.name }),
|
|
10302
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.organizationMeta), children: [
|
|
10303
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { children: [
|
|
10241
10304
|
organization.memberCount,
|
|
10242
10305
|
" ",
|
|
10243
10306
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
10244
10307
|
] }),
|
|
10245
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
10246
|
-
showRole && organization.role && /* @__PURE__ */ (0,
|
|
10308
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: " \u2022 " }),
|
|
10309
|
+
showRole && organization.role && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: (0, import_css49.cx)(styles.roleCapitalized), children: organization.role })
|
|
10247
10310
|
] })
|
|
10248
10311
|
] }),
|
|
10249
|
-
isSelected && /* @__PURE__ */ (0,
|
|
10312
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
10250
10313
|
] });
|
|
10251
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */ (0,
|
|
10252
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0,
|
|
10253
|
-
return /* @__PURE__ */ (0,
|
|
10254
|
-
/* @__PURE__ */ (0,
|
|
10314
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)(styles.loadingContainer), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "caption", className: (0, import_css49.cx)(styles.loadingText), children: t("organization.switcher.loading.organizations") }) });
|
|
10315
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)(styles.errorContainer), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "caption", className: (0, import_css49.cx)(styles.errorText), children: errorMessage }) });
|
|
10316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.root, className), style, children: [
|
|
10317
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10255
10318
|
Button_default,
|
|
10256
10319
|
{
|
|
10257
10320
|
ref: refs.setReference,
|
|
@@ -10261,8 +10324,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10261
10324
|
size: "medium",
|
|
10262
10325
|
...getReferenceProps(),
|
|
10263
10326
|
children: [
|
|
10264
|
-
currentOrganization ? /* @__PURE__ */ (0,
|
|
10265
|
-
/* @__PURE__ */ (0,
|
|
10327
|
+
currentOrganization ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10328
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10266
10329
|
Avatar,
|
|
10267
10330
|
{
|
|
10268
10331
|
variant: "square",
|
|
@@ -10272,18 +10335,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
10272
10335
|
alt: `${currentOrganization.name} avatar`
|
|
10273
10336
|
}
|
|
10274
10337
|
),
|
|
10275
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
10276
|
-
] }) : /* @__PURE__ */ (0,
|
|
10277
|
-
/* @__PURE__ */ (0,
|
|
10278
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
10338
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body2", className: (0, import_css49.cx)(styles.triggerLabel), children: currentOrganization.name })
|
|
10339
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10340
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Building_default, { width: avatarSize, height: avatarSize }),
|
|
10341
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body2", className: (0, import_css49.cx)(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
10279
10342
|
] }),
|
|
10280
|
-
/* @__PURE__ */ (0,
|
|
10343
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ChevronDown_default, { width: "16", height: "16" })
|
|
10281
10344
|
]
|
|
10282
10345
|
}
|
|
10283
10346
|
),
|
|
10284
|
-
isOpen && /* @__PURE__ */ (0,
|
|
10285
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
10286
|
-
/* @__PURE__ */ (0,
|
|
10347
|
+
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)("div", { ref: refs.setFloating, className: (0, import_css49.cx)(styles.content), style: floatingStyles, ...getFloatingProps(), children: [
|
|
10348
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.header), children: [
|
|
10349
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10287
10350
|
Avatar,
|
|
10288
10351
|
{
|
|
10289
10352
|
variant: "square",
|
|
@@ -10293,10 +10356,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10293
10356
|
alt: `${currentOrganization.name} avatar`
|
|
10294
10357
|
}
|
|
10295
10358
|
),
|
|
10296
|
-
/* @__PURE__ */ (0,
|
|
10297
|
-
/* @__PURE__ */ (0,
|
|
10298
|
-
/* @__PURE__ */ (0,
|
|
10299
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
10359
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.headerInfo), children: [
|
|
10360
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { noWrap: true, className: (0, import_css49.cx)(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
10361
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css49.cx)(styles.headerMeta), children: [
|
|
10362
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10300
10363
|
Typography_default,
|
|
10301
10364
|
{
|
|
10302
10365
|
noWrap: true,
|
|
@@ -10306,17 +10369,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
10306
10369
|
currentOrganization.memberCount,
|
|
10307
10370
|
" ",
|
|
10308
10371
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
10309
|
-
showRole && currentOrganization.role && /* @__PURE__ */ (0,
|
|
10372
|
+
showRole && currentOrganization.role && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { children: [
|
|
10310
10373
|
" \u2022 ",
|
|
10311
10374
|
currentOrganization.role
|
|
10312
10375
|
] })
|
|
10313
10376
|
]
|
|
10314
10377
|
}
|
|
10315
10378
|
),
|
|
10316
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0,
|
|
10379
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { noWrap: true, className: (0, import_css49.cx)(styles.headerRole), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
10317
10380
|
] })
|
|
10318
10381
|
] }),
|
|
10319
|
-
onManageProfile && /* @__PURE__ */ (0,
|
|
10382
|
+
onManageProfile && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10320
10383
|
Button_default,
|
|
10321
10384
|
{
|
|
10322
10385
|
onClick: onManageProfile,
|
|
@@ -10325,7 +10388,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
10325
10388
|
size: "small",
|
|
10326
10389
|
"aria-label": "Manage Organization Profile",
|
|
10327
10390
|
className: (0, import_css49.cx)(styles.manageButton),
|
|
10328
|
-
endIcon: /* @__PURE__ */ (0,
|
|
10391
|
+
endIcon: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10329
10392
|
"svg",
|
|
10330
10393
|
{
|
|
10331
10394
|
width: "16",
|
|
@@ -10337,8 +10400,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10337
10400
|
strokeLinecap: "round",
|
|
10338
10401
|
strokeLinejoin: "round",
|
|
10339
10402
|
children: [
|
|
10340
|
-
/* @__PURE__ */ (0,
|
|
10341
|
-
/* @__PURE__ */ (0,
|
|
10403
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
10404
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.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" })
|
|
10342
10405
|
]
|
|
10343
10406
|
}
|
|
10344
10407
|
),
|
|
@@ -10346,20 +10409,20 @@ var BaseOrganizationSwitcher = ({
|
|
|
10346
10409
|
}
|
|
10347
10410
|
)
|
|
10348
10411
|
] }),
|
|
10349
|
-
organizations.length > 1 && /* @__PURE__ */ (0,
|
|
10412
|
+
organizations.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10350
10413
|
"div",
|
|
10351
10414
|
{
|
|
10352
10415
|
className: (0, import_css49.cx)(styles.header, styles.sectionHeaderContainer),
|
|
10353
10416
|
style: {
|
|
10354
10417
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
10355
10418
|
},
|
|
10356
|
-
children: /* @__PURE__ */ (0,
|
|
10419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "caption", fontWeight: 600, className: (0, import_css49.cx)(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
10357
10420
|
}
|
|
10358
10421
|
),
|
|
10359
|
-
/* @__PURE__ */ (0,
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10360
10423
|
switchableOrganizations.map((organization) => {
|
|
10361
10424
|
const isSelected = false;
|
|
10362
|
-
return /* @__PURE__ */ (0,
|
|
10425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10363
10426
|
Button_default,
|
|
10364
10427
|
{
|
|
10365
10428
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -10377,10 +10440,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10377
10440
|
organization.id
|
|
10378
10441
|
);
|
|
10379
10442
|
}),
|
|
10380
|
-
menuItems.length > 0 && /* @__PURE__ */ (0,
|
|
10381
|
-
/* @__PURE__ */ (0,
|
|
10443
|
+
menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
10444
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css49.cx)(styles.menuDivider) }),
|
|
10382
10445
|
menuItems.map(
|
|
10383
|
-
(item, index) => /* @__PURE__ */ (0,
|
|
10446
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: item.href ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10384
10447
|
"a",
|
|
10385
10448
|
{
|
|
10386
10449
|
href: item.href,
|
|
@@ -10394,10 +10457,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10394
10457
|
onBlur: () => setHoveredItemIndex(null),
|
|
10395
10458
|
children: [
|
|
10396
10459
|
item.icon,
|
|
10397
|
-
/* @__PURE__ */ (0,
|
|
10460
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: item.label })
|
|
10398
10461
|
]
|
|
10399
10462
|
}
|
|
10400
|
-
) : /* @__PURE__ */ (0,
|
|
10463
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10401
10464
|
Button_default,
|
|
10402
10465
|
{
|
|
10403
10466
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -10571,7 +10634,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10571
10634
|
var BaseCreateOrganization_styles_default = useStyles24;
|
|
10572
10635
|
|
|
10573
10636
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
10574
|
-
var
|
|
10637
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
10575
10638
|
var BaseCreateOrganization = ({
|
|
10576
10639
|
cardLayout = true,
|
|
10577
10640
|
className = "",
|
|
@@ -10658,13 +10721,13 @@ var BaseCreateOrganization = ({
|
|
|
10658
10721
|
console.error("Form submission error:", submitError);
|
|
10659
10722
|
}
|
|
10660
10723
|
};
|
|
10661
|
-
const createOrganizationContent = /* @__PURE__ */ (0,
|
|
10662
|
-
/* @__PURE__ */ (0,
|
|
10663
|
-
error && /* @__PURE__ */ (0,
|
|
10664
|
-
/* @__PURE__ */ (0,
|
|
10665
|
-
/* @__PURE__ */ (0,
|
|
10724
|
+
const createOrganizationContent = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: (0, import_css51.cx)(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_css51.cx)(styles.content), children: [
|
|
10725
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("form", { id: "create-organization-form", className: (0, import_css51.cx)(styles.form), onSubmit: handleSubmit, children: [
|
|
10726
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
10727
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Title, { children: "Error" }),
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: error })
|
|
10666
10729
|
] }),
|
|
10667
|
-
/* @__PURE__ */ (0,
|
|
10730
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: (0, import_css51.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
10668
10731
|
TextField_default,
|
|
10669
10732
|
{
|
|
10670
10733
|
label: `${t("organization.create.name.label")}`,
|
|
@@ -10677,7 +10740,7 @@ var BaseCreateOrganization = ({
|
|
|
10677
10740
|
className: (0, import_css51.cx)(styles.input)
|
|
10678
10741
|
}
|
|
10679
10742
|
) }),
|
|
10680
|
-
/* @__PURE__ */ (0,
|
|
10743
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: (0, import_css51.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
10681
10744
|
TextField_default,
|
|
10682
10745
|
{
|
|
10683
10746
|
label: `${t("organization.create.handle.label") || "Organization Handle"}`,
|
|
@@ -10691,9 +10754,9 @@ var BaseCreateOrganization = ({
|
|
|
10691
10754
|
className: (0, import_css51.cx)(styles.input)
|
|
10692
10755
|
}
|
|
10693
10756
|
) }),
|
|
10694
|
-
/* @__PURE__ */ (0,
|
|
10695
|
-
/* @__PURE__ */ (0,
|
|
10696
|
-
/* @__PURE__ */ (0,
|
|
10757
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: (0, import_css51.cx)(styles.fieldGroup), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(FormControl_default, { error: formErrors.description, children: [
|
|
10758
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(InputLabel_default, { required: true, children: t("organization.create.description.label") }),
|
|
10759
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
10697
10760
|
"textarea",
|
|
10698
10761
|
{
|
|
10699
10762
|
className: (0, import_css51.cx)(styles.textarea, formErrors.description && styles.textareaError),
|
|
@@ -10707,23 +10770,23 @@ var BaseCreateOrganization = ({
|
|
|
10707
10770
|
] }) }),
|
|
10708
10771
|
renderAdditionalFields && renderAdditionalFields()
|
|
10709
10772
|
] }),
|
|
10710
|
-
/* @__PURE__ */ (0,
|
|
10711
|
-
onCancel && /* @__PURE__ */ (0,
|
|
10712
|
-
/* @__PURE__ */ (0,
|
|
10773
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_css51.cx)(styles.actions), children: [
|
|
10774
|
+
onCancel && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.cancel") }),
|
|
10775
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.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") })
|
|
10713
10776
|
] })
|
|
10714
10777
|
] }) });
|
|
10715
10778
|
if (mode === "popup") {
|
|
10716
|
-
return /* @__PURE__ */ (0,
|
|
10717
|
-
/* @__PURE__ */ (0,
|
|
10718
|
-
/* @__PURE__ */ (0,
|
|
10779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Dialog_default.Content, { children: [
|
|
10780
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Dialog_default.Heading, { children: title }),
|
|
10781
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: styles.popup, children: createOrganizationContent })
|
|
10719
10782
|
] }) });
|
|
10720
10783
|
}
|
|
10721
10784
|
return createOrganizationContent;
|
|
10722
10785
|
};
|
|
10723
10786
|
|
|
10724
10787
|
// src/api/createOrganization.ts
|
|
10725
|
-
var
|
|
10726
|
-
var httpClient6 =
|
|
10788
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
10789
|
+
var httpClient6 = import_browser64.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser64.AsgardeoSPAClient.getInstance());
|
|
10727
10790
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
10728
10791
|
const defaultFetcher = async (url, config) => {
|
|
10729
10792
|
const response = await httpClient6({
|
|
@@ -10740,7 +10803,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
10740
10803
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10741
10804
|
};
|
|
10742
10805
|
};
|
|
10743
|
-
return (0,
|
|
10806
|
+
return (0, import_browser64.createOrganization)({
|
|
10744
10807
|
...requestConfig,
|
|
10745
10808
|
fetcher: fetcher || defaultFetcher
|
|
10746
10809
|
});
|
|
@@ -10748,7 +10811,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
10748
10811
|
var createOrganization_default = createOrganization;
|
|
10749
10812
|
|
|
10750
10813
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
10751
|
-
var
|
|
10814
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
10752
10815
|
var CreateOrganization = ({
|
|
10753
10816
|
onCreateOrganization,
|
|
10754
10817
|
fallback = null,
|
|
@@ -10764,7 +10827,7 @@ var CreateOrganization = ({
|
|
|
10764
10827
|
return fallback;
|
|
10765
10828
|
}
|
|
10766
10829
|
if (!isSignedIn) {
|
|
10767
|
-
return /* @__PURE__ */ (0,
|
|
10830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_jsx_runtime84.Fragment, {});
|
|
10768
10831
|
}
|
|
10769
10832
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
10770
10833
|
const handleSubmit = async (payload) => {
|
|
@@ -10798,7 +10861,7 @@ var CreateOrganization = ({
|
|
|
10798
10861
|
setLoading(false);
|
|
10799
10862
|
}
|
|
10800
10863
|
};
|
|
10801
|
-
return /* @__PURE__ */ (0,
|
|
10864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
10802
10865
|
BaseCreateOrganization,
|
|
10803
10866
|
{
|
|
10804
10867
|
onSubmit: handleSubmit,
|
|
@@ -10815,12 +10878,12 @@ var CreateOrganization = ({
|
|
|
10815
10878
|
var import_react83 = require("react");
|
|
10816
10879
|
|
|
10817
10880
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
10818
|
-
var
|
|
10881
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
10819
10882
|
var import_css55 = require("@emotion/css");
|
|
10820
10883
|
var import_react82 = require("react");
|
|
10821
10884
|
|
|
10822
10885
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
10823
|
-
var
|
|
10886
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
10824
10887
|
var import_css53 = require("@emotion/css");
|
|
10825
10888
|
var import_react80 = require("react");
|
|
10826
10889
|
|
|
@@ -10980,7 +11043,7 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
10980
11043
|
var KeyValueInput_styles_default = useStyles25;
|
|
10981
11044
|
|
|
10982
11045
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
10983
|
-
var
|
|
11046
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
10984
11047
|
var KeyValueInput = ({
|
|
10985
11048
|
className = "",
|
|
10986
11049
|
disabled = false,
|
|
@@ -11055,105 +11118,105 @@ var KeyValueInput = ({
|
|
|
11055
11118
|
);
|
|
11056
11119
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
11057
11120
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
11058
|
-
return /* @__PURE__ */ (0,
|
|
11059
|
-
label && /* @__PURE__ */ (0,
|
|
11121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input")), styles.container, className), children: [
|
|
11122
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("label", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "label")), styles.label), children: [
|
|
11060
11123
|
label,
|
|
11061
|
-
required && /* @__PURE__ */ (0,
|
|
11124
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11062
11125
|
"span",
|
|
11063
11126
|
{
|
|
11064
|
-
className: (0, import_css53.cx)((0,
|
|
11127
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
11065
11128
|
children: " *"
|
|
11066
11129
|
}
|
|
11067
11130
|
)
|
|
11068
11131
|
] }),
|
|
11069
|
-
/* @__PURE__ */ (0,
|
|
11070
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0,
|
|
11132
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
11133
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
11071
11134
|
"div",
|
|
11072
11135
|
{
|
|
11073
|
-
className: (0, import_css53.cx)((0,
|
|
11136
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
11074
11137
|
children: [
|
|
11075
|
-
/* @__PURE__ */ (0,
|
|
11138
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
11076
11139
|
"span",
|
|
11077
11140
|
{
|
|
11078
|
-
className: (0, import_css53.cx)((0,
|
|
11141
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
11079
11142
|
children: [
|
|
11080
11143
|
pair.key,
|
|
11081
11144
|
":"
|
|
11082
11145
|
]
|
|
11083
11146
|
}
|
|
11084
11147
|
),
|
|
11085
|
-
/* @__PURE__ */ (0,
|
|
11148
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11086
11149
|
"span",
|
|
11087
11150
|
{
|
|
11088
|
-
className: (0, import_css53.cx)((0,
|
|
11151
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
11089
11152
|
children: pair.value
|
|
11090
11153
|
}
|
|
11091
11154
|
)
|
|
11092
11155
|
]
|
|
11093
11156
|
},
|
|
11094
11157
|
`${pair.key}-${index}`
|
|
11095
|
-
)) : pairs.map((pair, index) => /* @__PURE__ */ (0,
|
|
11158
|
+
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
11096
11159
|
"div",
|
|
11097
11160
|
{
|
|
11098
|
-
className: (0, import_css53.cx)((0,
|
|
11161
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
11099
11162
|
children: [
|
|
11100
|
-
/* @__PURE__ */ (0,
|
|
11163
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11101
11164
|
TextField_default,
|
|
11102
11165
|
{
|
|
11103
11166
|
placeholder: keyPlaceholder,
|
|
11104
11167
|
value: pair.key,
|
|
11105
11168
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
11106
11169
|
disabled: disabled || readOnly,
|
|
11107
|
-
className: (0, import_css53.cx)((0,
|
|
11170
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11108
11171
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
11109
11172
|
}
|
|
11110
11173
|
),
|
|
11111
|
-
/* @__PURE__ */ (0,
|
|
11174
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11112
11175
|
TextField_default,
|
|
11113
11176
|
{
|
|
11114
11177
|
placeholder: valuePlaceholder,
|
|
11115
11178
|
value: pair.value,
|
|
11116
11179
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
11117
11180
|
disabled: disabled || readOnly,
|
|
11118
|
-
className: (0, import_css53.cx)((0,
|
|
11181
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11119
11182
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
11120
11183
|
}
|
|
11121
11184
|
),
|
|
11122
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
11185
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11123
11186
|
"button",
|
|
11124
11187
|
{
|
|
11125
11188
|
type: "button",
|
|
11126
11189
|
onClick: () => handleRemovePair(index),
|
|
11127
11190
|
disabled,
|
|
11128
|
-
className: (0, import_css53.cx)((0,
|
|
11191
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
11129
11192
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
11130
|
-
children: /* @__PURE__ */ (0,
|
|
11193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(X_default, { width: 16, height: 16 })
|
|
11131
11194
|
}
|
|
11132
11195
|
)
|
|
11133
11196
|
]
|
|
11134
11197
|
},
|
|
11135
11198
|
`${pair.key}-${index}`
|
|
11136
11199
|
)),
|
|
11137
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
11138
|
-
/* @__PURE__ */ (0,
|
|
11200
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
11201
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11139
11202
|
TextField_default,
|
|
11140
11203
|
{
|
|
11141
11204
|
placeholder: keyPlaceholder,
|
|
11142
11205
|
value: newKey,
|
|
11143
11206
|
onChange: (e) => setNewKey(e.target.value),
|
|
11144
11207
|
disabled,
|
|
11145
|
-
className: (0, import_css53.cx)((0,
|
|
11208
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11146
11209
|
"aria-label": "New key"
|
|
11147
11210
|
}
|
|
11148
11211
|
),
|
|
11149
|
-
/* @__PURE__ */ (0,
|
|
11212
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11150
11213
|
TextField_default,
|
|
11151
11214
|
{
|
|
11152
11215
|
placeholder: valuePlaceholder,
|
|
11153
11216
|
value: newValue,
|
|
11154
11217
|
onChange: (e) => setNewValue(e.target.value),
|
|
11155
11218
|
disabled,
|
|
11156
|
-
className: (0, import_css53.cx)((0,
|
|
11219
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
11157
11220
|
"aria-label": "New value",
|
|
11158
11221
|
onKeyPress: (e) => {
|
|
11159
11222
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -11162,21 +11225,21 @@ var KeyValueInput = ({
|
|
|
11162
11225
|
}
|
|
11163
11226
|
}
|
|
11164
11227
|
),
|
|
11165
|
-
/* @__PURE__ */ (0,
|
|
11228
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
11166
11229
|
"button",
|
|
11167
11230
|
{
|
|
11168
11231
|
type: "button",
|
|
11169
11232
|
onClick: handleAddPair,
|
|
11170
11233
|
disabled: isAddDisabled,
|
|
11171
|
-
className: (0, import_css53.cx)((0,
|
|
11234
|
+
className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "add-button")), styles.addButton),
|
|
11172
11235
|
"aria-label": "Add new key-value pair",
|
|
11173
|
-
children: /* @__PURE__ */ (0,
|
|
11236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Plus_default, { width: 16, height: 16 })
|
|
11174
11237
|
}
|
|
11175
11238
|
)
|
|
11176
11239
|
] })
|
|
11177
11240
|
] }),
|
|
11178
|
-
(helperText || error) && /* @__PURE__ */ (0,
|
|
11179
|
-
maxPairs && /* @__PURE__ */ (0,
|
|
11241
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
11242
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
11180
11243
|
pairs.length,
|
|
11181
11244
|
" of ",
|
|
11182
11245
|
maxPairs,
|
|
@@ -11343,7 +11406,7 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
11343
11406
|
var BaseOrganizationProfile_styles_default = useStyles26;
|
|
11344
11407
|
|
|
11345
11408
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11346
|
-
var
|
|
11409
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
11347
11410
|
var BaseOrganizationProfile = ({
|
|
11348
11411
|
fallback = null,
|
|
11349
11412
|
className = "",
|
|
@@ -11380,13 +11443,13 @@ var BaseOrganizationProfile = ({
|
|
|
11380
11443
|
key: "created",
|
|
11381
11444
|
label: "Created Date",
|
|
11382
11445
|
editable: false,
|
|
11383
|
-
render: (value) => (0,
|
|
11446
|
+
render: (value) => (0, import_browser66.formatDate)(value)
|
|
11384
11447
|
},
|
|
11385
11448
|
{
|
|
11386
11449
|
key: "lastModified",
|
|
11387
11450
|
label: "Last Modified Date",
|
|
11388
11451
|
editable: false,
|
|
11389
|
-
render: (value) => (0,
|
|
11452
|
+
render: (value) => (0, import_browser66.formatDate)(value)
|
|
11390
11453
|
}
|
|
11391
11454
|
]
|
|
11392
11455
|
}) => {
|
|
@@ -11394,7 +11457,7 @@ var BaseOrganizationProfile = ({
|
|
|
11394
11457
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
11395
11458
|
const [editedOrganization, setEditedOrganization] = (0, import_react82.useState)(organization);
|
|
11396
11459
|
const [editingFields, setEditingFields] = (0, import_react82.useState)({});
|
|
11397
|
-
const PencilIcon = () => /* @__PURE__ */ (0,
|
|
11460
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11398
11461
|
"svg",
|
|
11399
11462
|
{
|
|
11400
11463
|
width: "16",
|
|
@@ -11405,7 +11468,7 @@ var BaseOrganizationProfile = ({
|
|
|
11405
11468
|
strokeWidth: "2",
|
|
11406
11469
|
strokeLinecap: "round",
|
|
11407
11470
|
strokeLinejoin: "round",
|
|
11408
|
-
children: /* @__PURE__ */ (0,
|
|
11471
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
11409
11472
|
}
|
|
11410
11473
|
);
|
|
11411
11474
|
const toggleFieldEdit = (0, import_react82.useCallback)((fieldName) => {
|
|
@@ -11468,7 +11531,7 @@ var BaseOrganizationProfile = ({
|
|
|
11468
11531
|
let fieldInput;
|
|
11469
11532
|
if (key === "attributes") {
|
|
11470
11533
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
11471
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
11534
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11472
11535
|
KeyValueInput_default,
|
|
11473
11536
|
{
|
|
11474
11537
|
value: attributesValue,
|
|
@@ -11506,26 +11569,26 @@ var BaseOrganizationProfile = ({
|
|
|
11506
11569
|
}
|
|
11507
11570
|
);
|
|
11508
11571
|
} else {
|
|
11509
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
11572
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TextField_default, { ...commonProps });
|
|
11510
11573
|
}
|
|
11511
|
-
return /* @__PURE__ */ (0,
|
|
11512
|
-
/* @__PURE__ */ (0,
|
|
11513
|
-
/* @__PURE__ */ (0,
|
|
11574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
11575
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: (0, import_css55.cx)(styles.label), children: label }),
|
|
11576
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.value), children: fieldInput })
|
|
11514
11577
|
] });
|
|
11515
11578
|
}
|
|
11516
11579
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
11517
11580
|
const isFieldEditable = editable && fieldEditable;
|
|
11518
11581
|
let displayValue;
|
|
11519
11582
|
if (hasValue) {
|
|
11520
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0,
|
|
11583
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
11521
11584
|
} else if (isFieldEditable) {
|
|
11522
11585
|
displayValue = getFieldPlaceholder(key);
|
|
11523
11586
|
} else {
|
|
11524
11587
|
displayValue = "-";
|
|
11525
11588
|
}
|
|
11526
|
-
return /* @__PURE__ */ (0,
|
|
11527
|
-
/* @__PURE__ */ (0,
|
|
11528
|
-
/* @__PURE__ */ (0,
|
|
11589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
11590
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: (0, import_css55.cx)(styles.label), children: label }),
|
|
11591
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11529
11592
|
Button_default,
|
|
11530
11593
|
{
|
|
11531
11594
|
onClick: onStartEdit,
|
|
@@ -11548,8 +11611,8 @@ var BaseOrganizationProfile = ({
|
|
|
11548
11611
|
if (!shouldShow) {
|
|
11549
11612
|
return null;
|
|
11550
11613
|
}
|
|
11551
|
-
return /* @__PURE__ */ (0,
|
|
11552
|
-
/* @__PURE__ */ (0,
|
|
11614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: (0, import_css55.cx)(styles.field), children: [
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.fieldContent), children: renderField(
|
|
11553
11616
|
field,
|
|
11554
11617
|
isFieldEditing,
|
|
11555
11618
|
(value) => {
|
|
@@ -11559,8 +11622,8 @@ var BaseOrganizationProfile = ({
|
|
|
11559
11622
|
},
|
|
11560
11623
|
() => toggleFieldEdit(field.key)
|
|
11561
11624
|
) }),
|
|
11562
|
-
isFieldEditable && /* @__PURE__ */ (0,
|
|
11563
|
-
/* @__PURE__ */ (0,
|
|
11625
|
+
isFieldEditable && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
11626
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11564
11627
|
Button_default,
|
|
11565
11628
|
{
|
|
11566
11629
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -11571,7 +11634,7 @@ var BaseOrganizationProfile = ({
|
|
|
11571
11634
|
children: saveButtonText
|
|
11572
11635
|
}
|
|
11573
11636
|
),
|
|
11574
|
-
/* @__PURE__ */ (0,
|
|
11637
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11575
11638
|
Button_default,
|
|
11576
11639
|
{
|
|
11577
11640
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -11582,7 +11645,7 @@ var BaseOrganizationProfile = ({
|
|
|
11582
11645
|
children: cancelButtonText
|
|
11583
11646
|
}
|
|
11584
11647
|
)
|
|
11585
|
-
] }) : hasValue && /* @__PURE__ */ (0,
|
|
11648
|
+
] }) : hasValue && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11586
11649
|
Button_default,
|
|
11587
11650
|
{
|
|
11588
11651
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -11591,7 +11654,7 @@ var BaseOrganizationProfile = ({
|
|
|
11591
11654
|
size: "small",
|
|
11592
11655
|
title: "Edit field",
|
|
11593
11656
|
className: (0, import_css55.cx)(styles.editButton),
|
|
11594
|
-
children: /* @__PURE__ */ (0,
|
|
11657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(PencilIcon, {})
|
|
11595
11658
|
}
|
|
11596
11659
|
) })
|
|
11597
11660
|
] }, field.key);
|
|
@@ -11599,23 +11662,23 @@ var BaseOrganizationProfile = ({
|
|
|
11599
11662
|
if (!organization) {
|
|
11600
11663
|
return fallback;
|
|
11601
11664
|
}
|
|
11602
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
11603
|
-
/* @__PURE__ */ (0,
|
|
11604
|
-
/* @__PURE__ */ (0,
|
|
11605
|
-
/* @__PURE__ */ (0,
|
|
11606
|
-
/* @__PURE__ */ (0,
|
|
11607
|
-
organization.orgHandle && /* @__PURE__ */ (0,
|
|
11665
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Card_default, { className: (0, import_css55.cx)(styles.root, cardLayout && styles.card, className), children: [
|
|
11666
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: (0, import_css55.cx)(styles.header), children: [
|
|
11667
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
11668
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: (0, import_css55.cx)(styles.orgInfo), children: [
|
|
11669
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h2", { className: (0, import_css55.cx)(styles.name), children: organization.name }),
|
|
11670
|
+
organization.orgHandle && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("p", { className: (0, import_css55.cx)(styles.handle), children: [
|
|
11608
11671
|
"@",
|
|
11609
11672
|
organization.orgHandle
|
|
11610
11673
|
] })
|
|
11611
11674
|
] })
|
|
11612
11675
|
] }),
|
|
11613
|
-
/* @__PURE__ */ (0,
|
|
11676
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
11614
11677
|
] });
|
|
11615
11678
|
if (mode === "popup") {
|
|
11616
|
-
return /* @__PURE__ */ (0,
|
|
11617
|
-
/* @__PURE__ */ (0,
|
|
11618
|
-
/* @__PURE__ */ (0,
|
|
11679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Dialog_default.Content, { children: [
|
|
11680
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Dialog_default.Heading, { children: title }),
|
|
11681
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: (0, import_css55.cx)(styles.popup), children: profileContent })
|
|
11619
11682
|
] }) });
|
|
11620
11683
|
}
|
|
11621
11684
|
return profileContent;
|
|
@@ -11623,8 +11686,8 @@ var BaseOrganizationProfile = ({
|
|
|
11623
11686
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
11624
11687
|
|
|
11625
11688
|
// src/api/getOrganization.ts
|
|
11626
|
-
var
|
|
11627
|
-
var httpClient7 =
|
|
11689
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
11690
|
+
var httpClient7 = import_browser67.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser67.AsgardeoSPAClient.getInstance());
|
|
11628
11691
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11629
11692
|
const defaultFetcher = async (url, config) => {
|
|
11630
11693
|
const response = await httpClient7({
|
|
@@ -11640,7 +11703,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11640
11703
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11641
11704
|
};
|
|
11642
11705
|
};
|
|
11643
|
-
return (0,
|
|
11706
|
+
return (0, import_browser67.getOrganization)({
|
|
11644
11707
|
...requestConfig,
|
|
11645
11708
|
fetcher: fetcher || defaultFetcher
|
|
11646
11709
|
});
|
|
@@ -11648,8 +11711,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11648
11711
|
var getOrganization_default = getOrganization;
|
|
11649
11712
|
|
|
11650
11713
|
// src/api/updateOrganization.ts
|
|
11651
|
-
var
|
|
11652
|
-
var httpClient8 =
|
|
11714
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
11715
|
+
var httpClient8 = import_browser68.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser68.AsgardeoSPAClient.getInstance());
|
|
11653
11716
|
var updateOrganization = async ({
|
|
11654
11717
|
fetcher,
|
|
11655
11718
|
...requestConfig
|
|
@@ -11669,7 +11732,7 @@ var updateOrganization = async ({
|
|
|
11669
11732
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11670
11733
|
};
|
|
11671
11734
|
};
|
|
11672
|
-
return (0,
|
|
11735
|
+
return (0, import_browser68.updateOrganization)({
|
|
11673
11736
|
...requestConfig,
|
|
11674
11737
|
fetcher: fetcher || defaultFetcher
|
|
11675
11738
|
});
|
|
@@ -11677,7 +11740,7 @@ var updateOrganization = async ({
|
|
|
11677
11740
|
var updateOrganization_default = updateOrganization;
|
|
11678
11741
|
|
|
11679
11742
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
11680
|
-
var
|
|
11743
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
11681
11744
|
var OrganizationProfile = ({
|
|
11682
11745
|
organizationId,
|
|
11683
11746
|
mode = "default",
|
|
@@ -11685,8 +11748,8 @@ var OrganizationProfile = ({
|
|
|
11685
11748
|
onOpenChange,
|
|
11686
11749
|
onUpdate,
|
|
11687
11750
|
popupTitle,
|
|
11688
|
-
loadingFallback = /* @__PURE__ */ (0,
|
|
11689
|
-
errorFallback = /* @__PURE__ */ (0,
|
|
11751
|
+
loadingFallback = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: "Loading organization..." }),
|
|
11752
|
+
errorFallback = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: "Failed to load organization data" }),
|
|
11690
11753
|
...rest
|
|
11691
11754
|
}) => {
|
|
11692
11755
|
const { baseUrl } = useAsgardeo_default();
|
|
@@ -11722,7 +11785,7 @@ var OrganizationProfile = ({
|
|
|
11722
11785
|
const handleOrganizationUpdate = async (payload) => {
|
|
11723
11786
|
if (!baseUrl || !organizationId) return;
|
|
11724
11787
|
try {
|
|
11725
|
-
const operations = (0,
|
|
11788
|
+
const operations = (0, import_browser68.createPatchOperations)(payload);
|
|
11726
11789
|
await updateOrganization_default({
|
|
11727
11790
|
baseUrl,
|
|
11728
11791
|
organizationId,
|
|
@@ -11737,7 +11800,7 @@ var OrganizationProfile = ({
|
|
|
11737
11800
|
throw err;
|
|
11738
11801
|
}
|
|
11739
11802
|
};
|
|
11740
|
-
return /* @__PURE__ */ (0,
|
|
11803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11741
11804
|
BaseOrganizationProfile_default,
|
|
11742
11805
|
{
|
|
11743
11806
|
organization,
|
|
@@ -11987,21 +12050,21 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
11987
12050
|
var BaseOrganizationList_styles_default = useStyles27;
|
|
11988
12051
|
|
|
11989
12052
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
11990
|
-
var
|
|
12053
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
11991
12054
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
11992
|
-
return /* @__PURE__ */ (0,
|
|
11993
|
-
/* @__PURE__ */ (0,
|
|
11994
|
-
/* @__PURE__ */ (0,
|
|
11995
|
-
/* @__PURE__ */ (0,
|
|
11996
|
-
/* @__PURE__ */ (0,
|
|
11997
|
-
/* @__PURE__ */ (0,
|
|
12055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.organizationItem), children: [
|
|
12056
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.organizationContent), children: [
|
|
12057
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
12058
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.organizationInfo), children: [
|
|
12059
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Typography_default, { variant: "h6", className: (0, import_css57.cx)(styles.organizationName), children: organization.name }),
|
|
12060
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css57.cx)(styles.organizationHandle), children: [
|
|
11998
12061
|
"@",
|
|
11999
12062
|
organization.orgHandle
|
|
12000
12063
|
] }),
|
|
12001
|
-
showStatus && /* @__PURE__ */ (0,
|
|
12064
|
+
showStatus && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css57.cx)(styles.organizationStatus), children: [
|
|
12002
12065
|
t("organization.switcher.status.label"),
|
|
12003
12066
|
" ",
|
|
12004
|
-
/* @__PURE__ */ (0,
|
|
12067
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
12005
12068
|
"span",
|
|
12006
12069
|
{
|
|
12007
12070
|
className: (0, import_css57.cx)(
|
|
@@ -12014,7 +12077,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12014
12077
|
] })
|
|
12015
12078
|
] })
|
|
12016
12079
|
] }),
|
|
12017
|
-
organization.canSwitch && /* @__PURE__ */ (0,
|
|
12080
|
+
organization.canSwitch && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.organizationActions), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
12018
12081
|
Button_default,
|
|
12019
12082
|
{
|
|
12020
12083
|
onClick: (e) => {
|
|
@@ -12028,17 +12091,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12028
12091
|
) })
|
|
12029
12092
|
] }, organization.id);
|
|
12030
12093
|
};
|
|
12031
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0,
|
|
12032
|
-
/* @__PURE__ */ (0,
|
|
12033
|
-
/* @__PURE__ */ (0,
|
|
12094
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.loadingContainer), children: [
|
|
12095
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Spinner_default, { size: "medium" }),
|
|
12096
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css57.cx)(styles.loadingText), children: t("organization.switcher.loading.organizations") })
|
|
12034
12097
|
] });
|
|
12035
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ (0,
|
|
12036
|
-
/* @__PURE__ */ (0,
|
|
12098
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.errorContainer), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Typography_default, { variant: "body1", color: "error", children: [
|
|
12099
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("strong", { children: t("organization.switcher.error.prefix") }),
|
|
12037
12100
|
" ",
|
|
12038
12101
|
error
|
|
12039
12102
|
] }) });
|
|
12040
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ (0,
|
|
12041
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0,
|
|
12103
|
+
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Button_default, { onClick: onLoadMore, disabled: isLoading, className: (0, import_css57.cx)(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoading ? t("organization.switcher.loading.more") : t("organization.switcher.load.more") });
|
|
12104
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.emptyContainer), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css57.cx)(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
12042
12105
|
var BaseOrganizationList = ({
|
|
12043
12106
|
className = "",
|
|
12044
12107
|
allOrganizations,
|
|
@@ -12081,53 +12144,53 @@ var BaseOrganizationList = ({
|
|
|
12081
12144
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
12082
12145
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
12083
12146
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12084
|
-
const loadingContent = /* @__PURE__ */ (0,
|
|
12147
|
+
const loadingContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
12085
12148
|
if (mode === "popup") {
|
|
12086
|
-
return /* @__PURE__ */ (0,
|
|
12087
|
-
/* @__PURE__ */ (0,
|
|
12088
|
-
/* @__PURE__ */ (0,
|
|
12149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Dialog_default.Content, { children: [
|
|
12150
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default.Heading, { children: title }),
|
|
12151
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.popupContent), children: loadingContent })
|
|
12089
12152
|
] }) });
|
|
12090
12153
|
}
|
|
12091
12154
|
return loadingContent;
|
|
12092
12155
|
}
|
|
12093
12156
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
12094
|
-
const errorContent = /* @__PURE__ */ (0,
|
|
12157
|
+
const errorContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
12095
12158
|
if (mode === "popup") {
|
|
12096
|
-
return /* @__PURE__ */ (0,
|
|
12097
|
-
/* @__PURE__ */ (0,
|
|
12098
|
-
/* @__PURE__ */ (0,
|
|
12159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Dialog_default.Content, { children: [
|
|
12160
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default.Heading, { children: title }),
|
|
12161
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.popupContent), children: errorContent })
|
|
12099
12162
|
] }) });
|
|
12100
12163
|
}
|
|
12101
12164
|
return errorContent;
|
|
12102
12165
|
}
|
|
12103
12166
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12104
|
-
const emptyContent = /* @__PURE__ */ (0,
|
|
12167
|
+
const emptyContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
12105
12168
|
if (mode === "popup") {
|
|
12106
|
-
return /* @__PURE__ */ (0,
|
|
12107
|
-
/* @__PURE__ */ (0,
|
|
12108
|
-
/* @__PURE__ */ (0,
|
|
12169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Dialog_default.Content, { children: [
|
|
12170
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default.Heading, { children: title }),
|
|
12171
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.popupContent), children: emptyContent })
|
|
12109
12172
|
] }) });
|
|
12110
12173
|
}
|
|
12111
12174
|
return emptyContent;
|
|
12112
12175
|
}
|
|
12113
|
-
const organizationListContent = /* @__PURE__ */ (0,
|
|
12114
|
-
/* @__PURE__ */ (0,
|
|
12115
|
-
/* @__PURE__ */ (0,
|
|
12176
|
+
const organizationListContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.root, className), style, children: [
|
|
12177
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: (0, import_css57.cx)(styles.header), children: [
|
|
12178
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.headerInfo), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css57.cx)(styles.subtitle), children: t("organization.switcher.showing.count", {
|
|
12116
12179
|
showing: organizationsWithSwitchAccess?.length,
|
|
12117
12180
|
total: allOrganizations?.organizations?.length || 0
|
|
12118
12181
|
}) }) }),
|
|
12119
|
-
onRefresh && /* @__PURE__ */ (0,
|
|
12182
|
+
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Button_default, { onClick: onRefresh, className: (0, import_css57.cx)(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.refresh.button") })
|
|
12120
12183
|
] }),
|
|
12121
|
-
/* @__PURE__ */ (0,
|
|
12184
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
12122
12185
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
12123
12186
|
) }),
|
|
12124
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0,
|
|
12125
|
-
hasMore && fetchMore && /* @__PURE__ */ (0,
|
|
12187
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
12188
|
+
hasMore && fetchMore && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
12126
12189
|
] });
|
|
12127
12190
|
if (mode === "popup") {
|
|
12128
|
-
return /* @__PURE__ */ (0,
|
|
12129
|
-
/* @__PURE__ */ (0,
|
|
12130
|
-
/* @__PURE__ */ (0,
|
|
12191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Dialog_default.Content, { children: [
|
|
12192
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog_default.Heading, { children: title }),
|
|
12193
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css57.cx)(styles.popupContent), children: organizationListContent })
|
|
12131
12194
|
] }) });
|
|
12132
12195
|
}
|
|
12133
12196
|
return organizationListContent;
|
|
@@ -12204,7 +12267,7 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
12204
12267
|
var OrganizationList_styles_default = useStyles28;
|
|
12205
12268
|
|
|
12206
12269
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
12207
|
-
var
|
|
12270
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
12208
12271
|
var OrganizationList = ({
|
|
12209
12272
|
autoFetch = true,
|
|
12210
12273
|
filter = "",
|
|
@@ -12226,7 +12289,7 @@ var OrganizationList = ({
|
|
|
12226
12289
|
setAllOrganizations(await getAllOrganizations2());
|
|
12227
12290
|
})();
|
|
12228
12291
|
}, []);
|
|
12229
|
-
return /* @__PURE__ */ (0,
|
|
12292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css59.cx)(styles.root, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_css59.cx)(styles.container), children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
12230
12293
|
BaseOrganizationList_default,
|
|
12231
12294
|
{
|
|
12232
12295
|
allOrganizations,
|
|
@@ -12241,8 +12304,8 @@ var OrganizationList = ({
|
|
|
12241
12304
|
var OrganizationList_default = OrganizationList;
|
|
12242
12305
|
|
|
12243
12306
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
12244
|
-
var
|
|
12245
|
-
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
12307
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
12308
|
+
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12246
12309
|
"svg",
|
|
12247
12310
|
{
|
|
12248
12311
|
width,
|
|
@@ -12255,13 +12318,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
12255
12318
|
strokeLinecap: "round",
|
|
12256
12319
|
strokeLinejoin: "round",
|
|
12257
12320
|
children: [
|
|
12258
|
-
/* @__PURE__ */ (0,
|
|
12259
|
-
/* @__PURE__ */ (0,
|
|
12260
|
-
/* @__PURE__ */ (0,
|
|
12261
|
-
/* @__PURE__ */ (0,
|
|
12262
|
-
/* @__PURE__ */ (0,
|
|
12263
|
-
/* @__PURE__ */ (0,
|
|
12264
|
-
/* @__PURE__ */ (0,
|
|
12321
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
12322
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
12323
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
12324
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M10 6h4" }),
|
|
12325
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M10 10h4" }),
|
|
12326
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M10 14h4" }),
|
|
12327
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M10 18h4" })
|
|
12265
12328
|
]
|
|
12266
12329
|
}
|
|
12267
12330
|
);
|
|
@@ -12269,7 +12332,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
12269
12332
|
var BuildingAlt_default = BuildingAlt;
|
|
12270
12333
|
|
|
12271
12334
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
12272
|
-
var
|
|
12335
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
12273
12336
|
var OrganizationSwitcher = ({
|
|
12274
12337
|
currentOrganization: propCurrentOrganization,
|
|
12275
12338
|
fallback = null,
|
|
@@ -12293,7 +12356,7 @@ var OrganizationSwitcher = ({
|
|
|
12293
12356
|
return fallback;
|
|
12294
12357
|
}
|
|
12295
12358
|
if (!isSignedIn) {
|
|
12296
|
-
return /* @__PURE__ */ (0,
|
|
12359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, {});
|
|
12297
12360
|
}
|
|
12298
12361
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
12299
12362
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -12307,19 +12370,19 @@ var OrganizationSwitcher = ({
|
|
|
12307
12370
|
const defaultMenuItems = [];
|
|
12308
12371
|
if (currentOrganization) {
|
|
12309
12372
|
defaultMenuItems.push({
|
|
12310
|
-
icon: /* @__PURE__ */ (0,
|
|
12373
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BuildingAlt_default, {}),
|
|
12311
12374
|
label: t("organization.switcher.manage.organizations"),
|
|
12312
12375
|
onClick: handleManageOrganizations
|
|
12313
12376
|
});
|
|
12314
12377
|
}
|
|
12315
12378
|
defaultMenuItems.push({
|
|
12316
|
-
icon: /* @__PURE__ */ (0,
|
|
12379
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
12317
12380
|
label: t("organization.switcher.create.organization"),
|
|
12318
12381
|
onClick: () => setIsCreateOrgOpen(true)
|
|
12319
12382
|
});
|
|
12320
12383
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
12321
|
-
return /* @__PURE__ */ (0,
|
|
12322
|
-
/* @__PURE__ */ (0,
|
|
12384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
12385
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12323
12386
|
BaseOrganizationSwitcher_default,
|
|
12324
12387
|
{
|
|
12325
12388
|
organizations,
|
|
@@ -12332,7 +12395,7 @@ var OrganizationSwitcher = ({
|
|
|
12332
12395
|
...props
|
|
12333
12396
|
}
|
|
12334
12397
|
),
|
|
12335
|
-
/* @__PURE__ */ (0,
|
|
12398
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12336
12399
|
CreateOrganization,
|
|
12337
12400
|
{
|
|
12338
12401
|
mode: "popup",
|
|
@@ -12346,7 +12409,7 @@ var OrganizationSwitcher = ({
|
|
|
12346
12409
|
}
|
|
12347
12410
|
}
|
|
12348
12411
|
),
|
|
12349
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
12412
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12350
12413
|
OrganizationProfile_default,
|
|
12351
12414
|
{
|
|
12352
12415
|
organizationId: currentOrganization.id,
|
|
@@ -12354,11 +12417,11 @@ var OrganizationSwitcher = ({
|
|
|
12354
12417
|
open: isProfileOpen,
|
|
12355
12418
|
onOpenChange: setIsProfileOpen,
|
|
12356
12419
|
cardLayout: true,
|
|
12357
|
-
loadingFallback: /* @__PURE__ */ (0,
|
|
12358
|
-
errorFallback: /* @__PURE__ */ (0,
|
|
12420
|
+
loadingFallback: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: t("organization.profile.loading") }),
|
|
12421
|
+
errorFallback: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: t("organization.profile.error") })
|
|
12359
12422
|
}
|
|
12360
12423
|
),
|
|
12361
|
-
/* @__PURE__ */ (0,
|
|
12424
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12362
12425
|
OrganizationList_default,
|
|
12363
12426
|
{
|
|
12364
12427
|
mode: "popup",
|
|
@@ -12378,5 +12441,5 @@ var OrganizationSwitcher = ({
|
|
|
12378
12441
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
12379
12442
|
|
|
12380
12443
|
// src/index.ts
|
|
12381
|
-
var
|
|
12444
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
12382
12445
|
//# sourceMappingURL=index.js.map
|