@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/index.js
CHANGED
|
@@ -6,7 +6,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6
6
|
import {
|
|
7
7
|
AsgardeoRuntimeError as AsgardeoRuntimeError3,
|
|
8
8
|
generateFlattenedUserProfile as generateFlattenedUserProfile2,
|
|
9
|
-
getBrandingPreference
|
|
9
|
+
getBrandingPreference,
|
|
10
|
+
getActiveTheme
|
|
10
11
|
} from "@asgardeo/browser";
|
|
11
12
|
import { useEffect as useEffect5, useMemo as useMemo6, useRef, useState as useState7, useCallback as useCallback7 } from "react";
|
|
12
13
|
|
|
@@ -51,7 +52,9 @@ import {
|
|
|
51
52
|
executeEmbeddedSignUpFlow,
|
|
52
53
|
executeEmbeddedSignInFlow,
|
|
53
54
|
deriveOrganizationHandleFromBaseUrl,
|
|
54
|
-
extractUserClaimsFromIdToken
|
|
55
|
+
extractUserClaimsFromIdToken,
|
|
56
|
+
navigate,
|
|
57
|
+
getRedirectBasedSignUpUrl
|
|
55
58
|
} from "@asgardeo/browser";
|
|
56
59
|
|
|
57
60
|
// src/__temp__/api.ts
|
|
@@ -714,29 +717,16 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
|
|
|
714
717
|
return Promise.resolve(String(response));
|
|
715
718
|
}
|
|
716
719
|
async signUp(...args) {
|
|
717
|
-
|
|
718
|
-
throw new AsgardeoRuntimeError(
|
|
719
|
-
"No arguments provided for signUp method.",
|
|
720
|
-
"react-AsgardeoReactClient-ValidationError-001",
|
|
721
|
-
"react",
|
|
722
|
-
"The signUp method requires at least one argument, either a SignUpOptions object or an EmbeddedFlowExecuteRequestPayload."
|
|
723
|
-
);
|
|
724
|
-
}
|
|
720
|
+
const configData = await this.asgardeo.getConfigData();
|
|
725
721
|
const firstArg = args[0];
|
|
726
722
|
if (typeof firstArg === "object" && "flowType" in firstArg) {
|
|
727
|
-
const configData = await this.asgardeo.getConfigData();
|
|
728
723
|
const baseUrl = configData?.baseUrl;
|
|
729
724
|
return executeEmbeddedSignUpFlow({
|
|
730
725
|
baseUrl,
|
|
731
726
|
payload: firstArg
|
|
732
727
|
});
|
|
733
728
|
}
|
|
734
|
-
|
|
735
|
-
"Not implemented",
|
|
736
|
-
"react-AsgardeoReactClient-ValidationError-002",
|
|
737
|
-
"react",
|
|
738
|
-
"The signUp method with SignUpOptions is not implemented in the React client."
|
|
739
|
-
);
|
|
729
|
+
navigate(getRedirectBasedSignUpUrl(configData));
|
|
740
730
|
}
|
|
741
731
|
async request(requestConfig) {
|
|
742
732
|
return this.asgardeo.httpRequest(requestConfig);
|
|
@@ -1109,7 +1099,8 @@ import {
|
|
|
1109
1099
|
createTheme,
|
|
1110
1100
|
detectThemeMode,
|
|
1111
1101
|
createClassObserver,
|
|
1112
|
-
createMediaQueryListener
|
|
1102
|
+
createMediaQueryListener,
|
|
1103
|
+
DEFAULT_THEME
|
|
1113
1104
|
} from "@asgardeo/browser";
|
|
1114
1105
|
|
|
1115
1106
|
// src/contexts/Theme/ThemeContext.ts
|
|
@@ -1147,7 +1138,7 @@ var applyThemeToDOM = (theme) => {
|
|
|
1147
1138
|
var ThemeProvider = ({
|
|
1148
1139
|
children,
|
|
1149
1140
|
theme: themeConfig,
|
|
1150
|
-
mode =
|
|
1141
|
+
mode = DEFAULT_THEME,
|
|
1151
1142
|
detection = {},
|
|
1152
1143
|
inheritFromBranding = true
|
|
1153
1144
|
}) => {
|
|
@@ -1642,12 +1633,6 @@ var AsgardeoProvider = ({
|
|
|
1642
1633
|
setIsLoadingSync(asgardeo.isLoading());
|
|
1643
1634
|
}
|
|
1644
1635
|
};
|
|
1645
|
-
const isDarkMode = useMemo6(() => {
|
|
1646
|
-
if (!preferences?.theme?.mode || preferences.theme.mode === "system") {
|
|
1647
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1648
|
-
}
|
|
1649
|
-
return preferences.theme.mode === "dark";
|
|
1650
|
-
}, [preferences?.theme?.mode]);
|
|
1651
1636
|
const handleProfileUpdate = (payload) => {
|
|
1652
1637
|
setUser(payload);
|
|
1653
1638
|
setUserProfile((prev) => ({
|
|
@@ -1715,7 +1700,7 @@ var AsgardeoProvider = ({
|
|
|
1715
1700
|
{
|
|
1716
1701
|
inheritFromBranding: preferences?.theme?.inheritFromBranding,
|
|
1717
1702
|
theme: preferences?.theme?.overrides,
|
|
1718
|
-
mode:
|
|
1703
|
+
mode: getActiveTheme(preferences.theme.mode),
|
|
1719
1704
|
children: /* @__PURE__ */ jsx7(FlowProvider_default, { children: /* @__PURE__ */ jsx7(UserProvider_default, { profile: userProfile, onUpdateProfile: handleProfileUpdate, children: /* @__PURE__ */ jsx7(
|
|
1720
1705
|
OrganizationProvider_default,
|
|
1721
1706
|
{
|
|
@@ -2230,6 +2215,10 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2230
2215
|
background-color: ${theme.vars.colors.primary.main};
|
|
2231
2216
|
opacity: 0.8;
|
|
2232
2217
|
}
|
|
2218
|
+
&:focus:not(:disabled) {
|
|
2219
|
+
background-color: ${theme.vars.colors.primary.main};
|
|
2220
|
+
opacity: 0.8;
|
|
2221
|
+
}
|
|
2233
2222
|
`,
|
|
2234
2223
|
"primary-outline": css2`
|
|
2235
2224
|
background-color: transparent;
|
|
@@ -2244,30 +2233,50 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2244
2233
|
color: ${theme.vars.colors.primary.contrastText};
|
|
2245
2234
|
opacity: 0.9;
|
|
2246
2235
|
}
|
|
2236
|
+
&:focus:not(:disabled) {
|
|
2237
|
+
background-color: ${theme.vars.colors.primary.main};
|
|
2238
|
+
color: ${theme.vars.colors.primary.contrastText};
|
|
2239
|
+
opacity: 0.9;
|
|
2240
|
+
}
|
|
2247
2241
|
`,
|
|
2248
2242
|
"primary-text": css2`
|
|
2249
2243
|
background-color: transparent;
|
|
2250
2244
|
color: ${theme.vars.colors.primary.main};
|
|
2251
2245
|
border-color: transparent;
|
|
2252
2246
|
&:hover:not(:disabled) {
|
|
2247
|
+
border-color: transparent;
|
|
2253
2248
|
background-color: ${theme.vars.colors.action.hover};
|
|
2254
2249
|
}
|
|
2255
2250
|
&:active:not(:disabled) {
|
|
2251
|
+
border-color: transparent;
|
|
2256
2252
|
background-color: ${theme.vars.colors.action.selected};
|
|
2257
2253
|
}
|
|
2254
|
+
&:focus:not(:disabled) {
|
|
2255
|
+
border-color: transparent;
|
|
2256
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2257
|
+
outline: none;
|
|
2258
|
+
}
|
|
2258
2259
|
`,
|
|
2259
2260
|
"primary-icon": css2`
|
|
2260
2261
|
background-color: transparent;
|
|
2261
2262
|
color: ${theme.vars.colors.primary.main};
|
|
2262
2263
|
border-color: transparent;
|
|
2263
2264
|
&:hover:not(:disabled) {
|
|
2265
|
+
border-color: transparent;
|
|
2264
2266
|
background-color: ${theme.vars.colors.action.hover};
|
|
2265
2267
|
color: ${theme.vars.colors.primary.dark};
|
|
2266
2268
|
}
|
|
2267
2269
|
&:active:not(:disabled) {
|
|
2270
|
+
border-color: transparent;
|
|
2268
2271
|
background-color: ${theme.vars.colors.action.selected};
|
|
2269
2272
|
color: ${theme.vars.colors.primary.dark};
|
|
2270
2273
|
}
|
|
2274
|
+
&:focus:not(:disabled) {
|
|
2275
|
+
border-color: transparent;
|
|
2276
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2277
|
+
color: ${theme.vars.colors.primary.dark};
|
|
2278
|
+
outline: none;
|
|
2279
|
+
}
|
|
2271
2280
|
`,
|
|
2272
2281
|
"secondary-solid": css2`
|
|
2273
2282
|
background-color: ${theme.vars.colors.secondary.main};
|
|
@@ -2281,6 +2290,10 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2281
2290
|
background-color: ${theme.vars.colors.secondary.main};
|
|
2282
2291
|
opacity: 0.8;
|
|
2283
2292
|
}
|
|
2293
|
+
&:focus:not(:disabled) {
|
|
2294
|
+
background-color: ${theme.vars.colors.secondary.main};
|
|
2295
|
+
opacity: 0.8;
|
|
2296
|
+
}
|
|
2284
2297
|
`,
|
|
2285
2298
|
"secondary-outline": css2`
|
|
2286
2299
|
background-color: transparent;
|
|
@@ -2295,30 +2308,50 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2295
2308
|
color: ${theme.vars.colors.secondary.contrastText};
|
|
2296
2309
|
opacity: 0.9;
|
|
2297
2310
|
}
|
|
2311
|
+
&:focus:not(:disabled) {
|
|
2312
|
+
background-color: ${theme.vars.colors.secondary.main};
|
|
2313
|
+
color: ${theme.vars.colors.secondary.contrastText};
|
|
2314
|
+
opacity: 0.9;
|
|
2315
|
+
}
|
|
2298
2316
|
`,
|
|
2299
2317
|
"secondary-text": css2`
|
|
2300
2318
|
background-color: transparent;
|
|
2301
2319
|
color: ${theme.vars.colors.secondary.main};
|
|
2302
2320
|
border-color: transparent;
|
|
2303
2321
|
&:hover:not(:disabled) {
|
|
2322
|
+
border-color: transparent;
|
|
2304
2323
|
background-color: ${theme.vars.colors.action.hover};
|
|
2305
2324
|
}
|
|
2306
2325
|
&:active:not(:disabled) {
|
|
2326
|
+
border-color: transparent;
|
|
2307
2327
|
background-color: ${theme.vars.colors.action.selected};
|
|
2308
2328
|
}
|
|
2329
|
+
&:focus:not(:disabled) {
|
|
2330
|
+
border-color: transparent;
|
|
2331
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2332
|
+
outline: none;
|
|
2333
|
+
}
|
|
2309
2334
|
`,
|
|
2310
2335
|
"secondary-icon": css2`
|
|
2311
2336
|
background-color: transparent;
|
|
2312
2337
|
color: ${theme.vars.colors.secondary.main};
|
|
2313
2338
|
border-color: transparent;
|
|
2314
2339
|
&:hover:not(:disabled) {
|
|
2340
|
+
border-color: transparent;
|
|
2315
2341
|
background-color: ${theme.vars.colors.action.hover};
|
|
2316
2342
|
color: ${theme.vars.colors.secondary.dark};
|
|
2317
2343
|
}
|
|
2318
2344
|
&:active:not(:disabled) {
|
|
2345
|
+
border-color: transparent;
|
|
2319
2346
|
background-color: ${theme.vars.colors.action.selected};
|
|
2320
2347
|
color: ${theme.vars.colors.secondary.dark};
|
|
2321
2348
|
}
|
|
2349
|
+
&:focus:not(:disabled) {
|
|
2350
|
+
border-color: transparent;
|
|
2351
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2352
|
+
color: ${theme.vars.colors.secondary.dark};
|
|
2353
|
+
outline: none;
|
|
2354
|
+
}
|
|
2322
2355
|
`,
|
|
2323
2356
|
"tertiary-solid": css2`
|
|
2324
2357
|
background-color: ${theme.vars.colors.text.secondary};
|
|
@@ -2333,6 +2366,11 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2333
2366
|
color: ${theme.vars.colors.background.surface};
|
|
2334
2367
|
opacity: 0.9;
|
|
2335
2368
|
}
|
|
2369
|
+
&:focus:not(:disabled) {
|
|
2370
|
+
background-color: ${theme.vars.colors.text.primary};
|
|
2371
|
+
color: ${theme.vars.colors.background.surface};
|
|
2372
|
+
opacity: 0.9;
|
|
2373
|
+
}
|
|
2336
2374
|
`,
|
|
2337
2375
|
"tertiary-outline": css2`
|
|
2338
2376
|
background-color: transparent;
|
|
@@ -2346,32 +2384,52 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
|
|
|
2346
2384
|
background-color: ${theme.vars.colors.action.selected};
|
|
2347
2385
|
border-color: ${theme.vars.colors.text.primary};
|
|
2348
2386
|
}
|
|
2387
|
+
&:focus:not(:disabled) {
|
|
2388
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2389
|
+
border-color: ${theme.vars.colors.text.primary};
|
|
2390
|
+
}
|
|
2349
2391
|
`,
|
|
2350
2392
|
"tertiary-text": css2`
|
|
2351
2393
|
background-color: transparent;
|
|
2352
2394
|
color: ${theme.vars.colors.text.secondary};
|
|
2353
2395
|
border-color: transparent;
|
|
2354
2396
|
&:hover:not(:disabled) {
|
|
2397
|
+
border-color: transparent;
|
|
2355
2398
|
background-color: ${theme.vars.colors.action.hover};
|
|
2356
2399
|
color: ${theme.vars.colors.text.primary};
|
|
2357
2400
|
}
|
|
2358
2401
|
&:active:not(:disabled) {
|
|
2402
|
+
border-color: transparent;
|
|
2359
2403
|
background-color: ${theme.vars.colors.action.selected};
|
|
2360
2404
|
color: ${theme.vars.colors.text.primary};
|
|
2361
2405
|
}
|
|
2406
|
+
&:focus:not(:disabled) {
|
|
2407
|
+
border-color: transparent;
|
|
2408
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2409
|
+
color: ${theme.vars.colors.text.primary};
|
|
2410
|
+
outline: none;
|
|
2411
|
+
}
|
|
2362
2412
|
`,
|
|
2363
2413
|
"tertiary-icon": css2`
|
|
2364
2414
|
background-color: transparent;
|
|
2365
2415
|
color: ${theme.vars.colors.text.secondary};
|
|
2366
2416
|
border-color: transparent;
|
|
2367
2417
|
&:hover:not(:disabled) {
|
|
2418
|
+
border-color: transparent;
|
|
2368
2419
|
background-color: ${theme.vars.colors.action.hover};
|
|
2369
2420
|
color: ${theme.vars.colors.text.primary};
|
|
2370
2421
|
}
|
|
2371
2422
|
&:active:not(:disabled) {
|
|
2423
|
+
border-color: transparent;
|
|
2372
2424
|
background-color: ${theme.vars.colors.action.selected};
|
|
2373
2425
|
color: ${theme.vars.colors.text.primary};
|
|
2374
2426
|
}
|
|
2427
|
+
&:focus:not(:disabled) {
|
|
2428
|
+
border-color: transparent;
|
|
2429
|
+
background-color: ${theme.vars.colors.action.focus};
|
|
2430
|
+
color: ${theme.vars.colors.text.primary};
|
|
2431
|
+
outline: none;
|
|
2432
|
+
}
|
|
2375
2433
|
`
|
|
2376
2434
|
};
|
|
2377
2435
|
const spinnerStyles = css2`
|
|
@@ -2507,7 +2565,7 @@ BaseSignInButton.displayName = "BaseSignInButton";
|
|
|
2507
2565
|
var BaseSignInButton_default = BaseSignInButton;
|
|
2508
2566
|
|
|
2509
2567
|
// src/components/actions/SignInButton/SignInButton.tsx
|
|
2510
|
-
import { AsgardeoRuntimeError as AsgardeoRuntimeError4 } from "@asgardeo/browser";
|
|
2568
|
+
import { AsgardeoRuntimeError as AsgardeoRuntimeError4, navigate as navigate2 } from "@asgardeo/browser";
|
|
2511
2569
|
import { forwardRef as forwardRef3, useState as useState9 } from "react";
|
|
2512
2570
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2513
2571
|
var SignInButton = forwardRef3(({ children, onClick, preferences, signInOptions: overriddenSignInOptions = {}, ...rest }, ref) => {
|
|
@@ -2518,8 +2576,7 @@ var SignInButton = forwardRef3(({ children, onClick, preferences, signInOptions:
|
|
|
2518
2576
|
try {
|
|
2519
2577
|
setIsLoading(true);
|
|
2520
2578
|
if (signInUrl) {
|
|
2521
|
-
|
|
2522
|
-
window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
|
|
2579
|
+
navigate2(signInUrl);
|
|
2523
2580
|
} else {
|
|
2524
2581
|
await signIn(overriddenSignInOptions ?? signInOptions);
|
|
2525
2582
|
}
|
|
@@ -2528,7 +2585,7 @@ var SignInButton = forwardRef3(({ children, onClick, preferences, signInOptions:
|
|
|
2528
2585
|
}
|
|
2529
2586
|
} catch (error) {
|
|
2530
2587
|
throw new AsgardeoRuntimeError4(
|
|
2531
|
-
`Sign in failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
2588
|
+
`Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
|
|
2532
2589
|
"SignInButton-handleSignIn-RuntimeError-001",
|
|
2533
2590
|
"react",
|
|
2534
2591
|
"Something went wrong while trying to sign in. Please try again later."
|
|
@@ -2646,6 +2703,8 @@ var BaseSignUpButton = forwardRef6(
|
|
|
2646
2703
|
disabled: isLoading,
|
|
2647
2704
|
loading: isLoading,
|
|
2648
2705
|
type: "button",
|
|
2706
|
+
color: "primary",
|
|
2707
|
+
variant: "solid",
|
|
2649
2708
|
...rest,
|
|
2650
2709
|
children
|
|
2651
2710
|
}
|
|
@@ -2657,6 +2716,7 @@ var BaseSignUpButton_default = BaseSignUpButton;
|
|
|
2657
2716
|
|
|
2658
2717
|
// src/components/actions/SignUpButton/SignUpButton.tsx
|
|
2659
2718
|
import { AsgardeoRuntimeError as AsgardeoRuntimeError6 } from "@asgardeo/browser";
|
|
2719
|
+
import { navigate as navigate3 } from "@asgardeo/browser";
|
|
2660
2720
|
import { forwardRef as forwardRef7, useState as useState11 } from "react";
|
|
2661
2721
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2662
2722
|
var SignUpButton = forwardRef7(({ children, onClick, preferences, ...rest }, ref) => {
|
|
@@ -2667,8 +2727,7 @@ var SignUpButton = forwardRef7(({ children, onClick, preferences, ...rest }, ref
|
|
|
2667
2727
|
try {
|
|
2668
2728
|
setIsLoading(true);
|
|
2669
2729
|
if (signUpUrl) {
|
|
2670
|
-
|
|
2671
|
-
window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
|
|
2730
|
+
navigate3(signUpUrl);
|
|
2672
2731
|
} else {
|
|
2673
2732
|
await signUp();
|
|
2674
2733
|
}
|
|
@@ -4321,13 +4380,13 @@ var UsernamePassword = ({
|
|
|
4321
4380
|
/* @__PURE__ */ jsx31(
|
|
4322
4381
|
Button_default,
|
|
4323
4382
|
{
|
|
4383
|
+
fullWidth: true,
|
|
4324
4384
|
type: "submit",
|
|
4385
|
+
color: "primary",
|
|
4386
|
+
variant: "solid",
|
|
4325
4387
|
disabled: isLoading,
|
|
4326
4388
|
loading: isLoading,
|
|
4327
4389
|
className: buttonClassName,
|
|
4328
|
-
color: "primary",
|
|
4329
|
-
variant: "solid",
|
|
4330
|
-
fullWidth: true,
|
|
4331
4390
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4332
4391
|
children: t("username.password.submit.button")
|
|
4333
4392
|
}
|
|
@@ -4377,13 +4436,13 @@ var IdentifierFirst = ({
|
|
|
4377
4436
|
/* @__PURE__ */ jsx32(
|
|
4378
4437
|
Button_default,
|
|
4379
4438
|
{
|
|
4439
|
+
fullWidth: true,
|
|
4380
4440
|
type: "submit",
|
|
4441
|
+
color: "primary",
|
|
4442
|
+
variant: "solid",
|
|
4381
4443
|
disabled: isLoading,
|
|
4382
4444
|
loading: isLoading,
|
|
4383
4445
|
className: buttonClassName,
|
|
4384
|
-
color: "primary",
|
|
4385
|
-
variant: "solid",
|
|
4386
|
-
fullWidth: true,
|
|
4387
4446
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4388
4447
|
children: t("identifier.first.submit.button")
|
|
4389
4448
|
}
|
|
@@ -4392,29 +4451,24 @@ var IdentifierFirst = ({
|
|
|
4392
4451
|
};
|
|
4393
4452
|
var IdentifierFirst_default = IdentifierFirst;
|
|
4394
4453
|
|
|
4395
|
-
// src/components/presentation/
|
|
4454
|
+
// src/components/presentation/options/GoogleButton.tsx
|
|
4396
4455
|
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4397
4456
|
var GoogleButton = ({
|
|
4398
|
-
authenticator,
|
|
4399
4457
|
isLoading,
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4458
|
+
preferences,
|
|
4459
|
+
children,
|
|
4460
|
+
...rest
|
|
4403
4461
|
}) => {
|
|
4404
4462
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4405
|
-
const handleClick = () => {
|
|
4406
|
-
onSubmit(authenticator);
|
|
4407
|
-
};
|
|
4408
4463
|
return /* @__PURE__ */ jsx33(
|
|
4409
4464
|
Button_default,
|
|
4410
4465
|
{
|
|
4466
|
+
...rest,
|
|
4467
|
+
fullWidth: true,
|
|
4411
4468
|
type: "button",
|
|
4412
|
-
variant: "solid",
|
|
4413
4469
|
color: "secondary",
|
|
4414
|
-
|
|
4470
|
+
variant: "solid",
|
|
4415
4471
|
disabled: isLoading,
|
|
4416
|
-
onClick: handleClick,
|
|
4417
|
-
className: buttonClassName,
|
|
4418
4472
|
startIcon: /* @__PURE__ */ jsx33("svg", { width: "18", height: "18", viewBox: "0 0 67.91 67.901", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxs13("g", { transform: "translate(-0.001 -0.001)", children: [
|
|
4419
4473
|
/* @__PURE__ */ jsx33(
|
|
4420
4474
|
"path",
|
|
@@ -4449,35 +4503,30 @@ var GoogleButton = ({
|
|
|
4449
4503
|
}
|
|
4450
4504
|
)
|
|
4451
4505
|
] }) }),
|
|
4452
|
-
children: t("elements.buttons.google")
|
|
4506
|
+
children: children ?? t("elements.buttons.google")
|
|
4453
4507
|
}
|
|
4454
4508
|
);
|
|
4455
4509
|
};
|
|
4456
4510
|
var GoogleButton_default = GoogleButton;
|
|
4457
4511
|
|
|
4458
|
-
// src/components/presentation/
|
|
4512
|
+
// src/components/presentation/options/GitHubButton.tsx
|
|
4459
4513
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4460
4514
|
var GitHubButton = ({
|
|
4461
|
-
authenticator,
|
|
4462
4515
|
isLoading,
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4516
|
+
preferences,
|
|
4517
|
+
children,
|
|
4518
|
+
...rest
|
|
4466
4519
|
}) => {
|
|
4467
4520
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4468
|
-
const handleClick = () => {
|
|
4469
|
-
onSubmit(authenticator);
|
|
4470
|
-
};
|
|
4471
4521
|
return /* @__PURE__ */ jsx34(
|
|
4472
4522
|
Button_default,
|
|
4473
4523
|
{
|
|
4524
|
+
...rest,
|
|
4525
|
+
fullWidth: true,
|
|
4474
4526
|
type: "button",
|
|
4475
|
-
variant: "solid",
|
|
4476
4527
|
color: "secondary",
|
|
4477
|
-
|
|
4528
|
+
variant: "solid",
|
|
4478
4529
|
disabled: isLoading,
|
|
4479
|
-
onClick: handleClick,
|
|
4480
|
-
className: buttonClassName,
|
|
4481
4530
|
startIcon: /* @__PURE__ */ jsx34("svg", { width: "18", height: "18", viewBox: "0 0 67.91 66.233", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx34("g", { transform: "translate(-386.96 658.072)", children: /* @__PURE__ */ jsx34(
|
|
4482
4531
|
"path",
|
|
4483
4532
|
{
|
|
@@ -4485,35 +4534,30 @@ var GitHubButton = ({
|
|
|
4485
4534
|
fill: "#ffffff"
|
|
4486
4535
|
}
|
|
4487
4536
|
) }) }),
|
|
4488
|
-
children: t("elements.buttons.github")
|
|
4537
|
+
children: children ?? t("elements.buttons.github")
|
|
4489
4538
|
}
|
|
4490
4539
|
);
|
|
4491
4540
|
};
|
|
4492
4541
|
var GitHubButton_default = GitHubButton;
|
|
4493
4542
|
|
|
4494
|
-
// src/components/presentation/
|
|
4543
|
+
// src/components/presentation/options/MicrosoftButton.tsx
|
|
4495
4544
|
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4496
4545
|
var MicrosoftButton = ({
|
|
4497
|
-
authenticator,
|
|
4498
4546
|
isLoading,
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4547
|
+
preferences,
|
|
4548
|
+
children,
|
|
4549
|
+
...rest
|
|
4502
4550
|
}) => {
|
|
4503
4551
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4504
|
-
const handleClick = () => {
|
|
4505
|
-
onSubmit(authenticator);
|
|
4506
|
-
};
|
|
4507
4552
|
return /* @__PURE__ */ jsx35(
|
|
4508
4553
|
Button_default,
|
|
4509
4554
|
{
|
|
4510
|
-
|
|
4511
|
-
variant: "outline",
|
|
4512
|
-
color: "primary",
|
|
4555
|
+
...rest,
|
|
4513
4556
|
fullWidth: true,
|
|
4557
|
+
type: "button",
|
|
4558
|
+
color: "secondary",
|
|
4559
|
+
variant: "solid",
|
|
4514
4560
|
disabled: isLoading,
|
|
4515
|
-
onClick: handleClick,
|
|
4516
|
-
className: buttonClassName,
|
|
4517
4561
|
startIcon: /* @__PURE__ */ jsxs14("svg", { width: "14", height: "14", viewBox: "0 0 23 23", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4518
4562
|
/* @__PURE__ */ jsx35("path", { fill: "#f3f3f3", d: "M0 0h23v23H0z" }),
|
|
4519
4563
|
/* @__PURE__ */ jsx35("path", { fill: "#f35325", d: "M1 1h10v10H1z" }),
|
|
@@ -4521,36 +4565,30 @@ var MicrosoftButton = ({
|
|
|
4521
4565
|
/* @__PURE__ */ jsx35("path", { fill: "#05a6f0", d: "M1 12h10v10H1z" }),
|
|
4522
4566
|
/* @__PURE__ */ jsx35("path", { fill: "#ffba08", d: "M12 12h10v10H12z" })
|
|
4523
4567
|
] }),
|
|
4524
|
-
children: t("elements.buttons.microsoft")
|
|
4568
|
+
children: children ?? t("elements.buttons.microsoft")
|
|
4525
4569
|
}
|
|
4526
4570
|
);
|
|
4527
4571
|
};
|
|
4528
4572
|
var MicrosoftButton_default = MicrosoftButton;
|
|
4529
4573
|
|
|
4530
|
-
// src/components/presentation/
|
|
4574
|
+
// src/components/presentation/options/FacebookButton.tsx
|
|
4531
4575
|
import { jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4532
4576
|
var FacebookButton = ({
|
|
4533
|
-
authenticator,
|
|
4534
4577
|
isLoading,
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
preferences
|
|
4578
|
+
preferences,
|
|
4579
|
+
children,
|
|
4580
|
+
...rest
|
|
4539
4581
|
}) => {
|
|
4540
4582
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4541
|
-
const handleClick = () => {
|
|
4542
|
-
onSubmit(authenticator);
|
|
4543
|
-
};
|
|
4544
4583
|
return /* @__PURE__ */ jsx36(
|
|
4545
4584
|
Button_default,
|
|
4546
4585
|
{
|
|
4586
|
+
...rest,
|
|
4587
|
+
fullWidth: true,
|
|
4547
4588
|
type: "button",
|
|
4548
|
-
variant: "solid",
|
|
4549
4589
|
color: "primary",
|
|
4550
|
-
|
|
4590
|
+
variant: "solid",
|
|
4551
4591
|
disabled: isLoading,
|
|
4552
|
-
onClick: handleClick,
|
|
4553
|
-
className: buttonClassName,
|
|
4554
4592
|
startIcon: /* @__PURE__ */ jsxs15("svg", { width: "18", height: "18", viewBox: "0 0 512 512", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4555
4593
|
/* @__PURE__ */ jsx36(
|
|
4556
4594
|
"path",
|
|
@@ -4567,35 +4605,30 @@ var FacebookButton = ({
|
|
|
4567
4605
|
}
|
|
4568
4606
|
)
|
|
4569
4607
|
] }),
|
|
4570
|
-
children: t("elements.buttons.facebook")
|
|
4608
|
+
children: children ?? t("elements.buttons.facebook")
|
|
4571
4609
|
}
|
|
4572
4610
|
);
|
|
4573
4611
|
};
|
|
4574
4612
|
var FacebookButton_default = FacebookButton;
|
|
4575
4613
|
|
|
4576
|
-
// src/components/presentation/
|
|
4614
|
+
// src/components/presentation/options/LinkedInButton.tsx
|
|
4577
4615
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4578
4616
|
var LinkedInButton = ({
|
|
4579
|
-
authenticator,
|
|
4580
4617
|
isLoading,
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4618
|
+
preferences,
|
|
4619
|
+
children,
|
|
4620
|
+
...rest
|
|
4584
4621
|
}) => {
|
|
4585
4622
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4586
|
-
const handleClick = () => {
|
|
4587
|
-
onSubmit(authenticator);
|
|
4588
|
-
};
|
|
4589
4623
|
return /* @__PURE__ */ jsx37(
|
|
4590
4624
|
Button_default,
|
|
4591
4625
|
{
|
|
4592
|
-
|
|
4593
|
-
variant: "outline",
|
|
4594
|
-
color: "primary",
|
|
4626
|
+
...rest,
|
|
4595
4627
|
fullWidth: true,
|
|
4628
|
+
type: "button",
|
|
4629
|
+
color: "secondary",
|
|
4630
|
+
variant: "solid",
|
|
4596
4631
|
disabled: isLoading,
|
|
4597
|
-
onClick: handleClick,
|
|
4598
|
-
className: buttonClassName,
|
|
4599
4632
|
startIcon: /* @__PURE__ */ jsx37("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx37(
|
|
4600
4633
|
"path",
|
|
4601
4634
|
{
|
|
@@ -4603,35 +4636,30 @@ var LinkedInButton = ({
|
|
|
4603
4636
|
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"
|
|
4604
4637
|
}
|
|
4605
4638
|
) }),
|
|
4606
|
-
children: t("elements.buttons.linkedin")
|
|
4639
|
+
children: children ?? t("elements.buttons.linkedin")
|
|
4607
4640
|
}
|
|
4608
4641
|
);
|
|
4609
4642
|
};
|
|
4610
4643
|
var LinkedInButton_default = LinkedInButton;
|
|
4611
4644
|
|
|
4612
|
-
// src/components/presentation/
|
|
4645
|
+
// src/components/presentation/options/SignInWithEthereumButton.tsx
|
|
4613
4646
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
4614
4647
|
var SignInWithEthereumButton = ({
|
|
4615
|
-
authenticator,
|
|
4616
4648
|
isLoading,
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4649
|
+
preferences,
|
|
4650
|
+
children,
|
|
4651
|
+
...rest
|
|
4620
4652
|
}) => {
|
|
4621
4653
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4622
|
-
const handleClick = () => {
|
|
4623
|
-
onSubmit(authenticator);
|
|
4624
|
-
};
|
|
4625
4654
|
return /* @__PURE__ */ jsx38(
|
|
4626
4655
|
Button_default,
|
|
4627
4656
|
{
|
|
4657
|
+
...rest,
|
|
4658
|
+
fullWidth: true,
|
|
4628
4659
|
type: "button",
|
|
4629
|
-
variant: "outline",
|
|
4630
4660
|
color: "secondary",
|
|
4631
|
-
|
|
4661
|
+
variant: "solid",
|
|
4632
4662
|
disabled: isLoading,
|
|
4633
|
-
onClick: handleClick,
|
|
4634
|
-
className: buttonClassName,
|
|
4635
4663
|
startIcon: /* @__PURE__ */ jsx38("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx38(
|
|
4636
4664
|
"path",
|
|
4637
4665
|
{
|
|
@@ -4639,7 +4667,7 @@ var SignInWithEthereumButton = ({
|
|
|
4639
4667
|
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"
|
|
4640
4668
|
}
|
|
4641
4669
|
) }),
|
|
4642
|
-
children: t("elements.buttons.ethereum")
|
|
4670
|
+
children: children ?? t("elements.buttons.ethereum")
|
|
4643
4671
|
}
|
|
4644
4672
|
);
|
|
4645
4673
|
};
|
|
@@ -4698,13 +4726,13 @@ var EmailOtp = ({
|
|
|
4698
4726
|
/* @__PURE__ */ jsx39(
|
|
4699
4727
|
Button_default,
|
|
4700
4728
|
{
|
|
4729
|
+
fullWidth: true,
|
|
4701
4730
|
type: "submit",
|
|
4731
|
+
color: "primary",
|
|
4732
|
+
variant: "solid",
|
|
4702
4733
|
disabled: isLoading,
|
|
4703
4734
|
loading: isLoading,
|
|
4704
4735
|
className: buttonClassName,
|
|
4705
|
-
color: "primary",
|
|
4706
|
-
variant: "solid",
|
|
4707
|
-
fullWidth: true,
|
|
4708
4736
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4709
4737
|
children: t("email.otp.submit.button")
|
|
4710
4738
|
}
|
|
@@ -4766,13 +4794,13 @@ var Totp = ({
|
|
|
4766
4794
|
/* @__PURE__ */ jsx40(
|
|
4767
4795
|
Button_default,
|
|
4768
4796
|
{
|
|
4797
|
+
fullWidth: true,
|
|
4769
4798
|
type: "submit",
|
|
4799
|
+
color: "primary",
|
|
4800
|
+
variant: "solid",
|
|
4770
4801
|
disabled: isLoading,
|
|
4771
4802
|
loading: isLoading,
|
|
4772
4803
|
className: buttonClassName,
|
|
4773
|
-
color: "primary",
|
|
4774
|
-
variant: "solid",
|
|
4775
|
-
fullWidth: true,
|
|
4776
4804
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4777
4805
|
children: t("totp.submit.button")
|
|
4778
4806
|
}
|
|
@@ -4834,13 +4862,13 @@ var SmsOtp = ({
|
|
|
4834
4862
|
/* @__PURE__ */ jsx41(
|
|
4835
4863
|
Button_default,
|
|
4836
4864
|
{
|
|
4865
|
+
fullWidth: true,
|
|
4837
4866
|
type: "submit",
|
|
4867
|
+
color: "primary",
|
|
4868
|
+
variant: "solid",
|
|
4838
4869
|
disabled: isLoading,
|
|
4839
4870
|
loading: isLoading,
|
|
4840
4871
|
className: buttonClassName,
|
|
4841
|
-
color: "primary",
|
|
4842
|
-
variant: "solid",
|
|
4843
|
-
fullWidth: true,
|
|
4844
4872
|
style: { marginBottom: `calc(${theme.vars.spacing.unit} * 2)` },
|
|
4845
4873
|
children: t("sms.otp.submit.button")
|
|
4846
4874
|
}
|
|
@@ -4849,33 +4877,24 @@ var SmsOtp = ({
|
|
|
4849
4877
|
};
|
|
4850
4878
|
var SmsOtp_default = SmsOtp;
|
|
4851
4879
|
|
|
4852
|
-
// src/components/presentation/
|
|
4880
|
+
// src/components/presentation/options/SocialButton.tsx
|
|
4853
4881
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4854
4882
|
var SocialLogin = ({
|
|
4855
|
-
authenticator,
|
|
4856
4883
|
isLoading,
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4884
|
+
preferences,
|
|
4885
|
+
children,
|
|
4886
|
+
...rest
|
|
4860
4887
|
}) => {
|
|
4861
4888
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
4862
|
-
const getDisplayName = () => {
|
|
4863
|
-
const providerName = authenticator.idp;
|
|
4864
|
-
return t("elements.buttons.social", { connection: providerName });
|
|
4865
|
-
};
|
|
4866
|
-
const handleClick = () => {
|
|
4867
|
-
onSubmit(authenticator);
|
|
4868
|
-
};
|
|
4869
4889
|
return /* @__PURE__ */ jsx42(
|
|
4870
4890
|
Button_default,
|
|
4871
4891
|
{
|
|
4892
|
+
...rest,
|
|
4893
|
+
fullWidth: true,
|
|
4872
4894
|
type: "button",
|
|
4873
|
-
variant: "outline",
|
|
4874
4895
|
color: "secondary",
|
|
4875
|
-
|
|
4896
|
+
variant: "outline",
|
|
4876
4897
|
disabled: isLoading,
|
|
4877
|
-
onClick: handleClick,
|
|
4878
|
-
className: buttonClassName,
|
|
4879
4898
|
startIcon: /* @__PURE__ */ jsx42("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx42(
|
|
4880
4899
|
"path",
|
|
4881
4900
|
{
|
|
@@ -4883,7 +4902,7 @@ var SocialLogin = ({
|
|
|
4883
4902
|
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"
|
|
4884
4903
|
}
|
|
4885
4904
|
) }),
|
|
4886
|
-
children:
|
|
4905
|
+
children: t("elements.buttons.social", { connection: children })
|
|
4887
4906
|
}
|
|
4888
4907
|
);
|
|
4889
4908
|
};
|
|
@@ -4972,10 +4991,10 @@ var MultiOptionButton = ({
|
|
|
4972
4991
|
return /* @__PURE__ */ jsx43(
|
|
4973
4992
|
Button_default,
|
|
4974
4993
|
{
|
|
4975
|
-
type: "button",
|
|
4976
|
-
variant: "outline",
|
|
4977
|
-
color: "primary",
|
|
4978
4994
|
fullWidth: true,
|
|
4995
|
+
type: "button",
|
|
4996
|
+
color: "secondary",
|
|
4997
|
+
variant: "solid",
|
|
4979
4998
|
disabled: isLoading,
|
|
4980
4999
|
onClick: handleClick,
|
|
4981
5000
|
className: buttonClassName,
|
|
@@ -4988,40 +5007,109 @@ var MultiOptionButton_default = MultiOptionButton;
|
|
|
4988
5007
|
|
|
4989
5008
|
// src/components/presentation/SignIn/options/SignInOptionFactory.tsx
|
|
4990
5009
|
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4991
|
-
var createSignInOption = (
|
|
4992
|
-
|
|
5010
|
+
var createSignInOption = ({
|
|
5011
|
+
authenticator,
|
|
5012
|
+
onSubmit,
|
|
5013
|
+
buttonClassName,
|
|
5014
|
+
preferences,
|
|
5015
|
+
...rest
|
|
5016
|
+
}) => {
|
|
4993
5017
|
const hasParams = authenticator.metadata?.params && authenticator.metadata.params.length > 0;
|
|
4994
5018
|
switch (authenticator.authenticatorId) {
|
|
4995
5019
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.UsernamePassword:
|
|
4996
|
-
return /* @__PURE__ */ jsx44(UsernamePassword_default, { ...
|
|
5020
|
+
return /* @__PURE__ */ jsx44(UsernamePassword_default, { authenticator, preferences, onSubmit, ...rest });
|
|
4997
5021
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.IdentifierFirst:
|
|
4998
|
-
return /* @__PURE__ */ jsx44(IdentifierFirst_default, { ...
|
|
5022
|
+
return /* @__PURE__ */ jsx44(IdentifierFirst_default, { authenticator, preferences, onSubmit, ...rest });
|
|
4999
5023
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.Google:
|
|
5000
|
-
return /* @__PURE__ */ jsx44(
|
|
5024
|
+
return /* @__PURE__ */ jsx44(
|
|
5025
|
+
GoogleButton_default,
|
|
5026
|
+
{
|
|
5027
|
+
className: buttonClassName,
|
|
5028
|
+
onClick: () => onSubmit(authenticator),
|
|
5029
|
+
authenticator,
|
|
5030
|
+
preferences,
|
|
5031
|
+
...rest
|
|
5032
|
+
}
|
|
5033
|
+
);
|
|
5001
5034
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.GitHub:
|
|
5002
|
-
return /* @__PURE__ */ jsx44(
|
|
5035
|
+
return /* @__PURE__ */ jsx44(
|
|
5036
|
+
GitHubButton_default,
|
|
5037
|
+
{
|
|
5038
|
+
authenticator,
|
|
5039
|
+
preferences,
|
|
5040
|
+
className: buttonClassName,
|
|
5041
|
+
onClick: () => onSubmit(authenticator),
|
|
5042
|
+
...rest
|
|
5043
|
+
}
|
|
5044
|
+
);
|
|
5003
5045
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.Microsoft:
|
|
5004
|
-
return /* @__PURE__ */ jsx44(
|
|
5046
|
+
return /* @__PURE__ */ jsx44(
|
|
5047
|
+
MicrosoftButton_default,
|
|
5048
|
+
{
|
|
5049
|
+
authenticator,
|
|
5050
|
+
preferences,
|
|
5051
|
+
className: buttonClassName,
|
|
5052
|
+
onClick: () => onSubmit(authenticator),
|
|
5053
|
+
...rest
|
|
5054
|
+
}
|
|
5055
|
+
);
|
|
5005
5056
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.Facebook:
|
|
5006
|
-
return /* @__PURE__ */ jsx44(
|
|
5057
|
+
return /* @__PURE__ */ jsx44(
|
|
5058
|
+
FacebookButton_default,
|
|
5059
|
+
{
|
|
5060
|
+
authenticator,
|
|
5061
|
+
preferences,
|
|
5062
|
+
className: buttonClassName,
|
|
5063
|
+
onClick: () => onSubmit(authenticator),
|
|
5064
|
+
...rest
|
|
5065
|
+
}
|
|
5066
|
+
);
|
|
5007
5067
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.LinkedIn:
|
|
5008
|
-
return /* @__PURE__ */ jsx44(
|
|
5068
|
+
return /* @__PURE__ */ jsx44(
|
|
5069
|
+
LinkedInButton_default,
|
|
5070
|
+
{
|
|
5071
|
+
authenticator,
|
|
5072
|
+
preferences,
|
|
5073
|
+
className: buttonClassName,
|
|
5074
|
+
onClick: () => onSubmit(authenticator),
|
|
5075
|
+
...rest
|
|
5076
|
+
}
|
|
5077
|
+
);
|
|
5009
5078
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.SignInWithEthereum:
|
|
5010
|
-
return /* @__PURE__ */ jsx44(
|
|
5079
|
+
return /* @__PURE__ */ jsx44(
|
|
5080
|
+
SignInWithEthereumButton_default,
|
|
5081
|
+
{
|
|
5082
|
+
authenticator,
|
|
5083
|
+
preferences,
|
|
5084
|
+
className: buttonClassName,
|
|
5085
|
+
onClick: () => onSubmit(authenticator),
|
|
5086
|
+
...rest
|
|
5087
|
+
}
|
|
5088
|
+
);
|
|
5011
5089
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.EmailOtp:
|
|
5012
|
-
return hasParams ? /* @__PURE__ */ jsx44(EmailOtp_default, { ...
|
|
5090
|
+
return hasParams ? /* @__PURE__ */ jsx44(EmailOtp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ jsx44(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5013
5091
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.Totp:
|
|
5014
|
-
return hasParams ? /* @__PURE__ */ jsx44(Totp_default, { ...
|
|
5092
|
+
return hasParams ? /* @__PURE__ */ jsx44(Totp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ jsx44(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5015
5093
|
case ApplicationNativeAuthenticationConstants2.SupportedAuthenticators.SmsOtp:
|
|
5016
|
-
return hasParams ? /* @__PURE__ */ jsx44(SmsOtp_default, { ...
|
|
5094
|
+
return hasParams ? /* @__PURE__ */ jsx44(SmsOtp_default, { authenticator, preferences, onSubmit, ...rest }) : /* @__PURE__ */ jsx44(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5017
5095
|
default:
|
|
5018
5096
|
if (authenticator.idp !== EmbeddedSignInFlowAuthenticatorKnownIdPType2.Local) {
|
|
5019
|
-
return /* @__PURE__ */ jsx44(
|
|
5097
|
+
return /* @__PURE__ */ jsx44(
|
|
5098
|
+
SocialButton_default,
|
|
5099
|
+
{
|
|
5100
|
+
authenticator,
|
|
5101
|
+
preferences,
|
|
5102
|
+
className: buttonClassName,
|
|
5103
|
+
onClick: () => onSubmit(authenticator),
|
|
5104
|
+
...rest,
|
|
5105
|
+
children: authenticator.idp
|
|
5106
|
+
}
|
|
5107
|
+
);
|
|
5020
5108
|
}
|
|
5021
5109
|
if (hasParams) {
|
|
5022
|
-
return /* @__PURE__ */ jsx44(UsernamePassword_default, { ...
|
|
5110
|
+
return /* @__PURE__ */ jsx44(UsernamePassword_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5023
5111
|
} else {
|
|
5024
|
-
return /* @__PURE__ */ jsx44(MultiOptionButton_default, { ...
|
|
5112
|
+
return /* @__PURE__ */ jsx44(MultiOptionButton_default, { authenticator, preferences, onSubmit, ...rest });
|
|
5025
5113
|
}
|
|
5026
5114
|
}
|
|
5027
5115
|
};
|
|
@@ -6909,75 +6997,8 @@ var FormContainer = (props) => {
|
|
|
6909
6997
|
};
|
|
6910
6998
|
var FormContainer_default = FormContainer;
|
|
6911
6999
|
|
|
6912
|
-
// src/components/presentation/SignUp/options/GoogleButton.tsx
|
|
6913
|
-
import { jsx as jsx57, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6914
|
-
var GoogleButton2 = ({
|
|
6915
|
-
component,
|
|
6916
|
-
isLoading,
|
|
6917
|
-
buttonClassName = "",
|
|
6918
|
-
size = "medium",
|
|
6919
|
-
onSubmit
|
|
6920
|
-
}) => {
|
|
6921
|
-
const config = component.config || {};
|
|
6922
|
-
const buttonText = config["text"] || config["label"] || "Continue with Google";
|
|
6923
|
-
const handleClick = () => {
|
|
6924
|
-
if (onSubmit) {
|
|
6925
|
-
onSubmit(component, {});
|
|
6926
|
-
}
|
|
6927
|
-
};
|
|
6928
|
-
return /* @__PURE__ */ jsx57(
|
|
6929
|
-
Button_default,
|
|
6930
|
-
{
|
|
6931
|
-
type: "button",
|
|
6932
|
-
variant: "solid",
|
|
6933
|
-
color: "secondary",
|
|
6934
|
-
size,
|
|
6935
|
-
disabled: isLoading,
|
|
6936
|
-
onClick: handleClick,
|
|
6937
|
-
className: buttonClassName,
|
|
6938
|
-
style: { width: "100%" },
|
|
6939
|
-
startIcon: /* @__PURE__ */ jsx57("svg", { width: "18", height: "18", viewBox: "0 0 67.91 67.901", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxs27("g", { transform: "translate(-0.001 -0.001)", children: [
|
|
6940
|
-
/* @__PURE__ */ jsx57(
|
|
6941
|
-
"path",
|
|
6942
|
-
{
|
|
6943
|
-
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",
|
|
6944
|
-
transform: "translate(0 -119.93)",
|
|
6945
|
-
fill: "#fbbb00"
|
|
6946
|
-
}
|
|
6947
|
-
),
|
|
6948
|
-
/* @__PURE__ */ jsx57(
|
|
6949
|
-
"path",
|
|
6950
|
-
{
|
|
6951
|
-
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",
|
|
6952
|
-
transform: "translate(-226.93 -180.567)",
|
|
6953
|
-
fill: "#518ef8"
|
|
6954
|
-
}
|
|
6955
|
-
),
|
|
6956
|
-
/* @__PURE__ */ jsx57(
|
|
6957
|
-
"path",
|
|
6958
|
-
{
|
|
6959
|
-
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",
|
|
6960
|
-
transform: "translate(-26.463 -268.374)",
|
|
6961
|
-
fill: "#28b446"
|
|
6962
|
-
}
|
|
6963
|
-
),
|
|
6964
|
-
/* @__PURE__ */ jsx57(
|
|
6965
|
-
"path",
|
|
6966
|
-
{
|
|
6967
|
-
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",
|
|
6968
|
-
transform: "translate(-24.828)",
|
|
6969
|
-
fill: "#f14336"
|
|
6970
|
-
}
|
|
6971
|
-
)
|
|
6972
|
-
] }) }),
|
|
6973
|
-
children: buttonText
|
|
6974
|
-
}
|
|
6975
|
-
);
|
|
6976
|
-
};
|
|
6977
|
-
var GoogleButton_default2 = GoogleButton2;
|
|
6978
|
-
|
|
6979
7000
|
// src/components/presentation/SignUp/options/ImageComponent.tsx
|
|
6980
|
-
import { jsx as
|
|
7001
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
6981
7002
|
var ImageComponent = ({ component }) => {
|
|
6982
7003
|
const { theme } = useTheme_default();
|
|
6983
7004
|
const config = component.config || {};
|
|
@@ -6994,7 +7015,7 @@ var ImageComponent = ({ component }) => {
|
|
|
6994
7015
|
if (!src) {
|
|
6995
7016
|
return null;
|
|
6996
7017
|
}
|
|
6997
|
-
return /* @__PURE__ */
|
|
7018
|
+
return /* @__PURE__ */ jsx57("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsx57(
|
|
6998
7019
|
"img",
|
|
6999
7020
|
{
|
|
7000
7021
|
src,
|
|
@@ -7097,7 +7118,7 @@ var PasswordInput = ({
|
|
|
7097
7118
|
var PasswordInput_default = PasswordInput;
|
|
7098
7119
|
|
|
7099
7120
|
// src/components/presentation/SignUp/options/SubmitButton.tsx
|
|
7100
|
-
import { jsx as
|
|
7121
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
7101
7122
|
var ButtonComponent = ({
|
|
7102
7123
|
component,
|
|
7103
7124
|
isLoading,
|
|
@@ -7130,7 +7151,7 @@ var ButtonComponent = ({
|
|
|
7130
7151
|
onSubmit(component);
|
|
7131
7152
|
}
|
|
7132
7153
|
};
|
|
7133
|
-
return /* @__PURE__ */
|
|
7154
|
+
return /* @__PURE__ */ jsx58(
|
|
7134
7155
|
Button_default,
|
|
7135
7156
|
{
|
|
7136
7157
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -7141,7 +7162,7 @@ var ButtonComponent = ({
|
|
|
7141
7162
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
7142
7163
|
className: buttonClassName,
|
|
7143
7164
|
style: { width: "100%" },
|
|
7144
|
-
children: isLoading ? /* @__PURE__ */
|
|
7165
|
+
children: isLoading ? /* @__PURE__ */ jsx58(Spinner_default, { size: "small" }) : buttonText
|
|
7145
7166
|
},
|
|
7146
7167
|
component.id
|
|
7147
7168
|
);
|
|
@@ -7149,7 +7170,7 @@ var ButtonComponent = ({
|
|
|
7149
7170
|
var SubmitButton_default = ButtonComponent;
|
|
7150
7171
|
|
|
7151
7172
|
// src/components/presentation/SignUp/options/TelephoneInput.tsx
|
|
7152
|
-
import { jsx as
|
|
7173
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7153
7174
|
var TelephoneInput = ({
|
|
7154
7175
|
component,
|
|
7155
7176
|
formValues,
|
|
@@ -7162,7 +7183,7 @@ var TelephoneInput = ({
|
|
|
7162
7183
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
7163
7184
|
const value = formValues[fieldName] || "";
|
|
7164
7185
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7165
|
-
return /* @__PURE__ */
|
|
7186
|
+
return /* @__PURE__ */ jsx59(
|
|
7166
7187
|
TextField_default,
|
|
7167
7188
|
{
|
|
7168
7189
|
name: fieldName,
|
|
@@ -7210,7 +7231,7 @@ var TextInput = ({
|
|
|
7210
7231
|
var TextInput_default = TextInput;
|
|
7211
7232
|
|
|
7212
7233
|
// src/components/presentation/SignUp/options/Typography.tsx
|
|
7213
|
-
import { jsx as
|
|
7234
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
7214
7235
|
var TypographyComponent = ({ component }) => {
|
|
7215
7236
|
const { theme } = useTheme_default();
|
|
7216
7237
|
const config = component.config || {};
|
|
@@ -7251,7 +7272,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
7251
7272
|
default:
|
|
7252
7273
|
typographyVariant = "body1";
|
|
7253
7274
|
}
|
|
7254
|
-
return /* @__PURE__ */
|
|
7275
|
+
return /* @__PURE__ */ jsx60(
|
|
7255
7276
|
Typography_default,
|
|
7256
7277
|
{
|
|
7257
7278
|
variant: typographyVariant,
|
|
@@ -7264,50 +7285,66 @@ var TypographyComponent = ({ component }) => {
|
|
|
7264
7285
|
var Typography_default2 = TypographyComponent;
|
|
7265
7286
|
|
|
7266
7287
|
// src/components/presentation/SignUp/options/SignUpOptionFactory.tsx
|
|
7267
|
-
import { jsx as
|
|
7268
|
-
var createSignUpComponent = (
|
|
7269
|
-
const { component } = props;
|
|
7288
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
7289
|
+
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
7270
7290
|
switch (component.type) {
|
|
7271
7291
|
case EmbeddedFlowComponentType.Typography:
|
|
7272
|
-
return /* @__PURE__ */
|
|
7292
|
+
return /* @__PURE__ */ jsx61(Typography_default2, { component, onSubmit, ...rest });
|
|
7273
7293
|
case EmbeddedFlowComponentType.Input:
|
|
7274
7294
|
const inputVariant = component.variant?.toUpperCase();
|
|
7275
7295
|
const inputType = component.config["type"]?.toLowerCase();
|
|
7276
7296
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
7277
|
-
return /* @__PURE__ */
|
|
7297
|
+
return /* @__PURE__ */ jsx61(EmailInput_default, { component, onSubmit, ...rest });
|
|
7278
7298
|
}
|
|
7279
7299
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
7280
|
-
return /* @__PURE__ */
|
|
7300
|
+
return /* @__PURE__ */ jsx61(PasswordInput_default, { component, onSubmit, ...rest });
|
|
7281
7301
|
}
|
|
7282
7302
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
7283
|
-
return /* @__PURE__ */
|
|
7303
|
+
return /* @__PURE__ */ jsx61(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
7284
7304
|
}
|
|
7285
7305
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
7286
|
-
return /* @__PURE__ */
|
|
7306
|
+
return /* @__PURE__ */ jsx61(NumberInput_default, { component, onSubmit, ...rest });
|
|
7287
7307
|
}
|
|
7288
7308
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
7289
|
-
return /* @__PURE__ */
|
|
7309
|
+
return /* @__PURE__ */ jsx61(DateInput_default, { component, onSubmit, ...rest });
|
|
7290
7310
|
}
|
|
7291
7311
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
7292
|
-
return /* @__PURE__ */
|
|
7312
|
+
return /* @__PURE__ */ jsx61(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
7293
7313
|
}
|
|
7294
|
-
return /* @__PURE__ */
|
|
7314
|
+
return /* @__PURE__ */ jsx61(TextInput_default, { component, onSubmit, ...rest });
|
|
7295
7315
|
case EmbeddedFlowComponentType.Button: {
|
|
7296
7316
|
const buttonVariant = component.variant?.toUpperCase();
|
|
7297
7317
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
7298
|
-
if (buttonVariant === "SOCIAL"
|
|
7299
|
-
|
|
7318
|
+
if (buttonVariant === "SOCIAL") {
|
|
7319
|
+
if (buttonText.toLowerCase().includes("google")) {
|
|
7320
|
+
return /* @__PURE__ */ jsx61(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7321
|
+
}
|
|
7322
|
+
if (buttonText.toLowerCase().includes("github")) {
|
|
7323
|
+
return /* @__PURE__ */ jsx61(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7324
|
+
}
|
|
7325
|
+
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
7326
|
+
return /* @__PURE__ */ jsx61(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7327
|
+
}
|
|
7328
|
+
if (buttonText.toLowerCase().includes("facebook")) {
|
|
7329
|
+
return /* @__PURE__ */ jsx61(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7330
|
+
}
|
|
7331
|
+
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
7332
|
+
return /* @__PURE__ */ jsx61(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7333
|
+
}
|
|
7334
|
+
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
7335
|
+
return /* @__PURE__ */ jsx61(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
7336
|
+
}
|
|
7300
7337
|
}
|
|
7301
|
-
return /* @__PURE__ */
|
|
7338
|
+
return /* @__PURE__ */ jsx61(SubmitButton_default, { component, onSubmit, ...rest });
|
|
7302
7339
|
}
|
|
7303
7340
|
case EmbeddedFlowComponentType.Form:
|
|
7304
|
-
return /* @__PURE__ */
|
|
7341
|
+
return /* @__PURE__ */ jsx61(FormContainer_default, { component, onSubmit, ...rest });
|
|
7305
7342
|
case EmbeddedFlowComponentType.Divider:
|
|
7306
|
-
return /* @__PURE__ */
|
|
7343
|
+
return /* @__PURE__ */ jsx61(DividerComponent_default, { component, onSubmit, ...rest });
|
|
7307
7344
|
case EmbeddedFlowComponentType.Image:
|
|
7308
|
-
return /* @__PURE__ */
|
|
7345
|
+
return /* @__PURE__ */ jsx61(ImageComponent_default, { component, onSubmit, ...rest });
|
|
7309
7346
|
default:
|
|
7310
|
-
return /* @__PURE__ */
|
|
7347
|
+
return /* @__PURE__ */ jsx61("div", {});
|
|
7311
7348
|
}
|
|
7312
7349
|
};
|
|
7313
7350
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -7479,13 +7516,13 @@ var useStyles17 = (theme, colorScheme) => {
|
|
|
7479
7516
|
var BaseSignUp_styles_default = useStyles17;
|
|
7480
7517
|
|
|
7481
7518
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7482
|
-
import { jsx as
|
|
7519
|
+
import { jsx as jsx62, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7483
7520
|
var BaseSignUp = (props) => {
|
|
7484
7521
|
const { theme, colorScheme } = useTheme_default();
|
|
7485
7522
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
7486
|
-
return /* @__PURE__ */
|
|
7487
|
-
/* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7523
|
+
return /* @__PURE__ */ jsxs27("div", { children: [
|
|
7524
|
+
/* @__PURE__ */ jsx62("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx62(Logo_default, { size: "large" }) }),
|
|
7525
|
+
/* @__PURE__ */ jsx62(FlowProvider_default, { children: /* @__PURE__ */ jsx62(BaseSignUpContent, { ...props }) })
|
|
7489
7526
|
] });
|
|
7490
7527
|
};
|
|
7491
7528
|
var BaseSignUpContent = ({
|
|
@@ -7843,30 +7880,30 @@ var BaseSignUpContent = ({
|
|
|
7843
7880
|
t
|
|
7844
7881
|
]);
|
|
7845
7882
|
if (!isFlowInitialized && isLoading) {
|
|
7846
|
-
return /* @__PURE__ */
|
|
7883
|
+
return /* @__PURE__ */ jsx62(Card_default, { className: cx20(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx62(Card_default.Content, { children: /* @__PURE__ */ jsx62("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx62(Spinner_default, { size: "medium" }) }) }) });
|
|
7847
7884
|
}
|
|
7848
7885
|
if (!currentFlow) {
|
|
7849
|
-
return /* @__PURE__ */
|
|
7850
|
-
/* @__PURE__ */
|
|
7851
|
-
/* @__PURE__ */
|
|
7886
|
+
return /* @__PURE__ */ jsx62(Card_default, { className: cx20(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx62(Card_default.Content, { children: /* @__PURE__ */ jsxs27(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
7887
|
+
/* @__PURE__ */ jsx62(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
7888
|
+
/* @__PURE__ */ jsx62(Alert_default.Description, { children: error || t("errors.sign.up.flow.initialization.failure") })
|
|
7852
7889
|
] }) }) });
|
|
7853
7890
|
}
|
|
7854
|
-
return /* @__PURE__ */
|
|
7855
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
7891
|
+
return /* @__PURE__ */ jsxs27(Card_default, { className: cx20(containerClasses, styles.card), variant, children: [
|
|
7892
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx62(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx62("div", { className: styles.messagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx62(
|
|
7856
7893
|
Alert_default,
|
|
7857
7894
|
{
|
|
7858
7895
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
7859
7896
|
className: cx20(styles.messageItem, messageClasses),
|
|
7860
|
-
children: /* @__PURE__ */
|
|
7897
|
+
children: /* @__PURE__ */ jsx62(Alert_default.Description, { children: message.message })
|
|
7861
7898
|
},
|
|
7862
7899
|
message.id || index
|
|
7863
7900
|
)) }) }),
|
|
7864
|
-
/* @__PURE__ */
|
|
7865
|
-
error && /* @__PURE__ */
|
|
7866
|
-
/* @__PURE__ */
|
|
7867
|
-
/* @__PURE__ */
|
|
7901
|
+
/* @__PURE__ */ jsxs27(Card_default.Content, { children: [
|
|
7902
|
+
error && /* @__PURE__ */ jsxs27(Alert_default, { variant: "error", className: cx20(styles.errorContainer, errorClasses), children: [
|
|
7903
|
+
/* @__PURE__ */ jsx62(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
7904
|
+
/* @__PURE__ */ jsx62(Alert_default.Description, { children: error })
|
|
7868
7905
|
] }),
|
|
7869
|
-
/* @__PURE__ */
|
|
7906
|
+
/* @__PURE__ */ jsx62("div", { className: styles.contentContainer, children: currentFlow.data?.components && renderComponents(currentFlow.data.components) })
|
|
7870
7907
|
] })
|
|
7871
7908
|
] });
|
|
7872
7909
|
};
|
|
@@ -7877,7 +7914,7 @@ import {
|
|
|
7877
7914
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType2,
|
|
7878
7915
|
EmbeddedFlowType
|
|
7879
7916
|
} from "@asgardeo/browser";
|
|
7880
|
-
import { jsx as
|
|
7917
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7881
7918
|
var SignUp = ({
|
|
7882
7919
|
className,
|
|
7883
7920
|
size = "medium",
|
|
@@ -7904,7 +7941,7 @@ var SignUp = ({
|
|
|
7904
7941
|
window.location.href = response.data.redirectURL;
|
|
7905
7942
|
}
|
|
7906
7943
|
};
|
|
7907
|
-
return /* @__PURE__ */
|
|
7944
|
+
return /* @__PURE__ */ jsx63(
|
|
7908
7945
|
BaseSignUp_default,
|
|
7909
7946
|
{
|
|
7910
7947
|
afterSignUpUrl,
|
|
@@ -7922,41 +7959,41 @@ var SignUp = ({
|
|
|
7922
7959
|
var SignUp_default = SignUp;
|
|
7923
7960
|
|
|
7924
7961
|
// src/components/presentation/User/BaseUser.tsx
|
|
7925
|
-
import { Fragment as Fragment12, jsx as
|
|
7962
|
+
import { Fragment as Fragment12, jsx as jsx64 } from "react/jsx-runtime";
|
|
7926
7963
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
7927
7964
|
if (!user) {
|
|
7928
|
-
return /* @__PURE__ */
|
|
7965
|
+
return /* @__PURE__ */ jsx64(Fragment12, { children: fallback });
|
|
7929
7966
|
}
|
|
7930
|
-
return /* @__PURE__ */
|
|
7967
|
+
return /* @__PURE__ */ jsx64(Fragment12, { children: children(user) });
|
|
7931
7968
|
};
|
|
7932
7969
|
BaseUser.displayName = "BaseUser";
|
|
7933
7970
|
var BaseUser_default = BaseUser;
|
|
7934
7971
|
|
|
7935
7972
|
// src/components/presentation/User/User.tsx
|
|
7936
|
-
import { jsx as
|
|
7973
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
7937
7974
|
var User5 = ({ children, fallback = null }) => {
|
|
7938
7975
|
const { user } = useAsgardeo_default();
|
|
7939
|
-
return /* @__PURE__ */
|
|
7976
|
+
return /* @__PURE__ */ jsx65(BaseUser_default, { user, fallback, children });
|
|
7940
7977
|
};
|
|
7941
7978
|
User5.displayName = "User";
|
|
7942
7979
|
var User_default = User5;
|
|
7943
7980
|
|
|
7944
7981
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
7945
|
-
import { Fragment as Fragment13, jsx as
|
|
7982
|
+
import { Fragment as Fragment13, jsx as jsx66 } from "react/jsx-runtime";
|
|
7946
7983
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
7947
7984
|
if (!organization) {
|
|
7948
|
-
return /* @__PURE__ */
|
|
7985
|
+
return /* @__PURE__ */ jsx66(Fragment13, { children: fallback });
|
|
7949
7986
|
}
|
|
7950
|
-
return /* @__PURE__ */
|
|
7987
|
+
return /* @__PURE__ */ jsx66(Fragment13, { children: children(organization) });
|
|
7951
7988
|
};
|
|
7952
7989
|
BaseOrganization.displayName = "BaseOrganization";
|
|
7953
7990
|
var BaseOrganization_default = BaseOrganization;
|
|
7954
7991
|
|
|
7955
7992
|
// src/components/presentation/Organization/Organization.tsx
|
|
7956
|
-
import { jsx as
|
|
7993
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
7957
7994
|
var Organization5 = ({ children, fallback = null }) => {
|
|
7958
7995
|
const { currentOrganization } = useOrganization_default();
|
|
7959
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ jsx67(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
7960
7997
|
};
|
|
7961
7998
|
Organization5.displayName = "Organization";
|
|
7962
7999
|
var Organization_default = Organization5;
|
|
@@ -8044,18 +8081,25 @@ var useStyles18 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
8044
8081
|
}
|
|
8045
8082
|
}
|
|
8046
8083
|
`;
|
|
8084
|
+
const iconStyles = css18`
|
|
8085
|
+
width: 60%;
|
|
8086
|
+
height: 60%;
|
|
8087
|
+
fill: ${backgroundColor ? "#ffffff" : theme.vars.colors.text.secondary};
|
|
8088
|
+
opacity: 0.8;
|
|
8089
|
+
`;
|
|
8047
8090
|
return {
|
|
8048
8091
|
avatar: baseAvatar,
|
|
8049
8092
|
variant: variantStyles[variant],
|
|
8050
8093
|
image: imageStyles,
|
|
8051
|
-
skeleton: skeletonStyles
|
|
8094
|
+
skeleton: skeletonStyles,
|
|
8095
|
+
icon: iconStyles
|
|
8052
8096
|
};
|
|
8053
8097
|
}, [theme, colorScheme, size, variant, backgroundColor]);
|
|
8054
8098
|
};
|
|
8055
8099
|
var Avatar_styles_default = useStyles18;
|
|
8056
8100
|
|
|
8057
8101
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8058
|
-
import { jsx as
|
|
8102
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
8059
8103
|
var Avatar = ({
|
|
8060
8104
|
alt = "User avatar",
|
|
8061
8105
|
background = "random",
|
|
@@ -8063,7 +8107,8 @@ var Avatar = ({
|
|
|
8063
8107
|
imageUrl,
|
|
8064
8108
|
name,
|
|
8065
8109
|
size = 64,
|
|
8066
|
-
variant = "circular"
|
|
8110
|
+
variant = "circular",
|
|
8111
|
+
isLoading = false
|
|
8067
8112
|
}) => {
|
|
8068
8113
|
const { theme, colorScheme } = useTheme_default();
|
|
8069
8114
|
const generateBackgroundColor = (inputString) => {
|
|
@@ -8097,17 +8142,29 @@ var Avatar = ({
|
|
|
8097
8142
|
return background;
|
|
8098
8143
|
}, [background, name, imageUrl]);
|
|
8099
8144
|
const styles = Avatar_styles_default(theme, colorScheme, size, variant, backgroundColor);
|
|
8145
|
+
const isDefaultState = !imageUrl && !name && !isLoading;
|
|
8100
8146
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
8101
8147
|
const renderContent = () => {
|
|
8102
8148
|
if (imageUrl) {
|
|
8103
|
-
return /* @__PURE__ */
|
|
8149
|
+
return /* @__PURE__ */ jsx68("img", { src: imageUrl, alt, className: cx21(withVendorCSSClassPrefix21(bem16("avatar", "image")), styles.image) });
|
|
8104
8150
|
}
|
|
8105
8151
|
if (name) {
|
|
8106
8152
|
return getInitials(name);
|
|
8107
8153
|
}
|
|
8108
|
-
|
|
8154
|
+
if (isLoading) {
|
|
8155
|
+
return /* @__PURE__ */ jsx68("div", { className: cx21(withVendorCSSClassPrefix21(bem16("avatar", "skeleton")), styles.skeleton) });
|
|
8156
|
+
}
|
|
8157
|
+
return /* @__PURE__ */ jsx68(
|
|
8158
|
+
"svg",
|
|
8159
|
+
{
|
|
8160
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8161
|
+
viewBox: "0 0 640 640",
|
|
8162
|
+
className: cx21(withVendorCSSClassPrefix21(bem16("avatar", "icon")), styles.icon),
|
|
8163
|
+
children: /* @__PURE__ */ jsx68("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" })
|
|
8164
|
+
}
|
|
8165
|
+
);
|
|
8109
8166
|
};
|
|
8110
|
-
return /* @__PURE__ */
|
|
8167
|
+
return /* @__PURE__ */ jsx68(
|
|
8111
8168
|
"div",
|
|
8112
8169
|
{
|
|
8113
8170
|
className: cx21(
|
|
@@ -8115,6 +8172,7 @@ var Avatar = ({
|
|
|
8115
8172
|
styles.avatar,
|
|
8116
8173
|
styles.variant,
|
|
8117
8174
|
withVendorCSSClassPrefix21(bem16("avatar", null, variant)),
|
|
8175
|
+
isDefaultState && withVendorCSSClassPrefix21(bem16("avatar", "default")),
|
|
8118
8176
|
className
|
|
8119
8177
|
),
|
|
8120
8178
|
children: renderContent()
|
|
@@ -8141,8 +8199,8 @@ import { cx as cx22 } from "@emotion/css";
|
|
|
8141
8199
|
import React from "react";
|
|
8142
8200
|
|
|
8143
8201
|
// src/components/primitives/Icons/LogOut.tsx
|
|
8144
|
-
import { jsx as
|
|
8145
|
-
var LogOut = (props) => /* @__PURE__ */
|
|
8202
|
+
import { jsx as jsx69, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8203
|
+
var LogOut = (props) => /* @__PURE__ */ jsxs28(
|
|
8146
8204
|
"svg",
|
|
8147
8205
|
{
|
|
8148
8206
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8156,17 +8214,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs29(
|
|
|
8156
8214
|
strokeLinejoin: "round",
|
|
8157
8215
|
...props,
|
|
8158
8216
|
children: [
|
|
8159
|
-
/* @__PURE__ */
|
|
8160
|
-
/* @__PURE__ */
|
|
8161
|
-
/* @__PURE__ */
|
|
8217
|
+
/* @__PURE__ */ jsx69("path", { d: "m16 17 5-5-5-5" }),
|
|
8218
|
+
/* @__PURE__ */ jsx69("path", { d: "M21 12H9" }),
|
|
8219
|
+
/* @__PURE__ */ jsx69("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
8162
8220
|
]
|
|
8163
8221
|
}
|
|
8164
8222
|
);
|
|
8165
8223
|
var LogOut_default = LogOut;
|
|
8166
8224
|
|
|
8167
8225
|
// src/components/primitives/Icons/Plus.tsx
|
|
8168
|
-
import { jsx as
|
|
8169
|
-
var Plus = (props) => /* @__PURE__ */
|
|
8226
|
+
import { jsx as jsx70, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8227
|
+
var Plus = (props) => /* @__PURE__ */ jsxs29(
|
|
8170
8228
|
"svg",
|
|
8171
8229
|
{
|
|
8172
8230
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8180,16 +8238,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs30(
|
|
|
8180
8238
|
strokeLinejoin: "round",
|
|
8181
8239
|
...props,
|
|
8182
8240
|
children: [
|
|
8183
|
-
/* @__PURE__ */
|
|
8184
|
-
/* @__PURE__ */
|
|
8241
|
+
/* @__PURE__ */ jsx70("path", { d: "M5 12h14" }),
|
|
8242
|
+
/* @__PURE__ */ jsx70("path", { d: "M12 5v14" })
|
|
8185
8243
|
]
|
|
8186
8244
|
}
|
|
8187
8245
|
);
|
|
8188
8246
|
var Plus_default = Plus;
|
|
8189
8247
|
|
|
8190
8248
|
// src/components/primitives/Icons/User.tsx
|
|
8191
|
-
import { jsx as
|
|
8192
|
-
var User7 = (props) => /* @__PURE__ */
|
|
8249
|
+
import { jsx as jsx71, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8250
|
+
var User7 = (props) => /* @__PURE__ */ jsxs30(
|
|
8193
8251
|
"svg",
|
|
8194
8252
|
{
|
|
8195
8253
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8203,16 +8261,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs31(
|
|
|
8203
8261
|
strokeLinejoin: "round",
|
|
8204
8262
|
...props,
|
|
8205
8263
|
children: [
|
|
8206
|
-
/* @__PURE__ */
|
|
8207
|
-
/* @__PURE__ */
|
|
8264
|
+
/* @__PURE__ */ jsx71("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
8265
|
+
/* @__PURE__ */ jsx71("circle", { cx: "12", cy: "7", r: "4" })
|
|
8208
8266
|
]
|
|
8209
8267
|
}
|
|
8210
8268
|
);
|
|
8211
8269
|
var User_default2 = User7;
|
|
8212
8270
|
|
|
8213
8271
|
// src/components/primitives/Icons/X.tsx
|
|
8214
|
-
import { jsx as
|
|
8215
|
-
var X = (props) => /* @__PURE__ */
|
|
8272
|
+
import { jsx as jsx72, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
8273
|
+
var X = (props) => /* @__PURE__ */ jsxs31(
|
|
8216
8274
|
"svg",
|
|
8217
8275
|
{
|
|
8218
8276
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8226,8 +8284,8 @@ var X = (props) => /* @__PURE__ */ jsxs32(
|
|
|
8226
8284
|
strokeLinejoin: "round",
|
|
8227
8285
|
...props,
|
|
8228
8286
|
children: [
|
|
8229
|
-
/* @__PURE__ */
|
|
8230
|
-
/* @__PURE__ */
|
|
8287
|
+
/* @__PURE__ */ jsx72("path", { d: "M18 6 6 18" }),
|
|
8288
|
+
/* @__PURE__ */ jsx72("path", { d: "m6 6 12 12" })
|
|
8231
8289
|
]
|
|
8232
8290
|
}
|
|
8233
8291
|
);
|
|
@@ -8250,17 +8308,6 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
8250
8308
|
border-radius: ${theme.vars.borderRadius.large};
|
|
8251
8309
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
8252
8310
|
outline: none;
|
|
8253
|
-
max-width: 35vw;
|
|
8254
|
-
min-width: 35vw;
|
|
8255
|
-
@media (max-width: 900px) {
|
|
8256
|
-
max-width: 80vw;
|
|
8257
|
-
min-width: 80vw;
|
|
8258
|
-
}
|
|
8259
|
-
@media (max-width: 600px) {
|
|
8260
|
-
max-width: 95vw;
|
|
8261
|
-
min-width: 95vw;
|
|
8262
|
-
}
|
|
8263
|
-
max-height: 90vh;
|
|
8264
8311
|
overflow-y: auto;
|
|
8265
8312
|
z-index: 10000;
|
|
8266
8313
|
`;
|
|
@@ -8310,7 +8357,7 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
8310
8357
|
var Dialog_styles_default = useStyles19;
|
|
8311
8358
|
|
|
8312
8359
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
8313
|
-
import { jsx as
|
|
8360
|
+
import { jsx as jsx73, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8314
8361
|
function useDialog({
|
|
8315
8362
|
initialOpen = false,
|
|
8316
8363
|
open: controlledOpen,
|
|
@@ -8356,7 +8403,7 @@ var useDialogContext = () => {
|
|
|
8356
8403
|
};
|
|
8357
8404
|
function Dialog({ children, ...options }) {
|
|
8358
8405
|
const dialog = useDialog(options);
|
|
8359
|
-
return /* @__PURE__ */
|
|
8406
|
+
return /* @__PURE__ */ jsx73(DialogContext.Provider, { value: dialog, children });
|
|
8360
8407
|
}
|
|
8361
8408
|
var DialogTrigger = React.forwardRef(
|
|
8362
8409
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -8374,7 +8421,7 @@ var DialogTrigger = React.forwardRef(
|
|
|
8374
8421
|
})
|
|
8375
8422
|
);
|
|
8376
8423
|
}
|
|
8377
|
-
return /* @__PURE__ */
|
|
8424
|
+
return /* @__PURE__ */ jsx73("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
8378
8425
|
}
|
|
8379
8426
|
);
|
|
8380
8427
|
var DialogContent = React.forwardRef((props, propRef) => {
|
|
@@ -8383,7 +8430,7 @@ var DialogContent = React.forwardRef((props, propRef) => {
|
|
|
8383
8430
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
8384
8431
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
8385
8432
|
if (!floatingContext.open) return null;
|
|
8386
|
-
return /* @__PURE__ */
|
|
8433
|
+
return /* @__PURE__ */ jsx73(FloatingPortal, { children: /* @__PURE__ */ jsx73(FloatingOverlay, { className: cx22(withVendorCSSClassPrefix22(bem17("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ jsx73(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx73(
|
|
8387
8434
|
"div",
|
|
8388
8435
|
{
|
|
8389
8436
|
ref,
|
|
@@ -8405,8 +8452,8 @@ var DialogHeading = React.forwardRef(
|
|
|
8405
8452
|
context.setLabelId(id);
|
|
8406
8453
|
return () => context.setLabelId(void 0);
|
|
8407
8454
|
}, [id, context.setLabelId]);
|
|
8408
|
-
return /* @__PURE__ */
|
|
8409
|
-
/* @__PURE__ */
|
|
8455
|
+
return /* @__PURE__ */ jsxs32("div", { className: cx22(withVendorCSSClassPrefix22(bem17("dialog", "header")), styles.header), children: [
|
|
8456
|
+
/* @__PURE__ */ jsx73(
|
|
8410
8457
|
"h2",
|
|
8411
8458
|
{
|
|
8412
8459
|
...props,
|
|
@@ -8416,7 +8463,7 @@ var DialogHeading = React.forwardRef(
|
|
|
8416
8463
|
children
|
|
8417
8464
|
}
|
|
8418
8465
|
),
|
|
8419
|
-
/* @__PURE__ */
|
|
8466
|
+
/* @__PURE__ */ jsx73(
|
|
8420
8467
|
Button_default,
|
|
8421
8468
|
{
|
|
8422
8469
|
color: "tertiary",
|
|
@@ -8425,7 +8472,7 @@ var DialogHeading = React.forwardRef(
|
|
|
8425
8472
|
shape: "round",
|
|
8426
8473
|
onClick: () => context.setOpen(false),
|
|
8427
8474
|
"aria-label": "Close",
|
|
8428
|
-
children: /* @__PURE__ */
|
|
8475
|
+
children: /* @__PURE__ */ jsx73(X_default, { width: 16, height: 16 })
|
|
8429
8476
|
}
|
|
8430
8477
|
)
|
|
8431
8478
|
] });
|
|
@@ -8441,7 +8488,7 @@ var DialogDescription = React.forwardRef(
|
|
|
8441
8488
|
context.setDescriptionId(id);
|
|
8442
8489
|
return () => context.setDescriptionId(void 0);
|
|
8443
8490
|
}, [id, context.setDescriptionId]);
|
|
8444
|
-
return /* @__PURE__ */
|
|
8491
|
+
return /* @__PURE__ */ jsx73(
|
|
8445
8492
|
"p",
|
|
8446
8493
|
{
|
|
8447
8494
|
...props,
|
|
@@ -8471,7 +8518,7 @@ var DialogClose = React.forwardRef(({ children, asChild = false, ...props }, pro
|
|
|
8471
8518
|
onClick: handleClick
|
|
8472
8519
|
});
|
|
8473
8520
|
}
|
|
8474
|
-
return /* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ jsx73(
|
|
8475
8522
|
Button_default,
|
|
8476
8523
|
{
|
|
8477
8524
|
...props,
|
|
@@ -8594,7 +8641,7 @@ var useStyles20 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
8594
8641
|
var MultiInput_styles_default = useStyles20;
|
|
8595
8642
|
|
|
8596
8643
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
8597
|
-
import { jsx as
|
|
8644
|
+
import { jsx as jsx74, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8598
8645
|
var MultiInput = ({
|
|
8599
8646
|
label,
|
|
8600
8647
|
error,
|
|
@@ -8617,8 +8664,8 @@ var MultiInput = ({
|
|
|
8617
8664
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
8618
8665
|
const canRemove = values.length > minFields;
|
|
8619
8666
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
8620
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
8621
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
8667
|
+
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ jsx74("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx23(styles.icon, className2), children: /* @__PURE__ */ jsx74("path", { d: "M12 5v14M5 12h14" }) });
|
|
8668
|
+
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ jsx74("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx23(styles.icon, className2), children: /* @__PURE__ */ jsx74("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" }) });
|
|
8622
8669
|
const handleAddValue = useCallback11(
|
|
8623
8670
|
(newValue) => {
|
|
8624
8671
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -8662,9 +8709,9 @@ var MultiInput = ({
|
|
|
8662
8709
|
};
|
|
8663
8710
|
switch (fieldType) {
|
|
8664
8711
|
case "DATE_TIME":
|
|
8665
|
-
return /* @__PURE__ */
|
|
8712
|
+
return /* @__PURE__ */ jsx74(DatePicker_default, { ...commonProps });
|
|
8666
8713
|
case "BOOLEAN":
|
|
8667
|
-
return /* @__PURE__ */
|
|
8714
|
+
return /* @__PURE__ */ jsx74(
|
|
8668
8715
|
Checkbox_default,
|
|
8669
8716
|
{
|
|
8670
8717
|
...commonProps,
|
|
@@ -8673,7 +8720,7 @@ var MultiInput = ({
|
|
|
8673
8720
|
}
|
|
8674
8721
|
);
|
|
8675
8722
|
default:
|
|
8676
|
-
return /* @__PURE__ */
|
|
8723
|
+
return /* @__PURE__ */ jsx74(TextField_default, { ...commonProps, type });
|
|
8677
8724
|
}
|
|
8678
8725
|
},
|
|
8679
8726
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -8685,7 +8732,7 @@ var MultiInput = ({
|
|
|
8685
8732
|
setCurrentInputValue("");
|
|
8686
8733
|
}
|
|
8687
8734
|
}, [currentInputValue, handleAddValue]);
|
|
8688
|
-
return /* @__PURE__ */
|
|
8735
|
+
return /* @__PURE__ */ jsxs33(
|
|
8689
8736
|
FormControl_default,
|
|
8690
8737
|
{
|
|
8691
8738
|
error,
|
|
@@ -8693,27 +8740,27 @@ var MultiInput = ({
|
|
|
8693
8740
|
className: cx23(withVendorCSSClassPrefix23(bem18("multi-input")), className),
|
|
8694
8741
|
style,
|
|
8695
8742
|
children: [
|
|
8696
|
-
label && /* @__PURE__ */
|
|
8697
|
-
/* @__PURE__ */
|
|
8698
|
-
/* @__PURE__ */
|
|
8743
|
+
label && /* @__PURE__ */ jsx74(InputLabel_default, { required, error: !!error, children: label }),
|
|
8744
|
+
/* @__PURE__ */ jsxs33("div", { className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "container")), styles.container), children: [
|
|
8745
|
+
/* @__PURE__ */ jsx74("div", { className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ jsx74("div", { className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
8699
8746
|
currentInputValue,
|
|
8700
8747
|
setCurrentInputValue,
|
|
8701
|
-
canAddMore ? /* @__PURE__ */
|
|
8748
|
+
canAddMore ? /* @__PURE__ */ jsx74(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
8702
8749
|
canAddMore ? handleInputSubmit : void 0
|
|
8703
8750
|
) }) }),
|
|
8704
|
-
values.length > 0 && /* @__PURE__ */
|
|
8751
|
+
values.length > 0 && /* @__PURE__ */ jsx74("div", { className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ jsxs33(
|
|
8705
8752
|
"div",
|
|
8706
8753
|
{
|
|
8707
8754
|
className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "list-item")), styles.listItem),
|
|
8708
8755
|
children: [
|
|
8709
|
-
/* @__PURE__ */
|
|
8756
|
+
/* @__PURE__ */ jsx74(
|
|
8710
8757
|
"span",
|
|
8711
8758
|
{
|
|
8712
8759
|
className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "list-item-text")), styles.listItemText),
|
|
8713
8760
|
children: value
|
|
8714
8761
|
}
|
|
8715
8762
|
),
|
|
8716
|
-
canRemove && /* @__PURE__ */
|
|
8763
|
+
canRemove && /* @__PURE__ */ jsx74(
|
|
8717
8764
|
"button",
|
|
8718
8765
|
{
|
|
8719
8766
|
type: "button",
|
|
@@ -8721,7 +8768,7 @@ var MultiInput = ({
|
|
|
8721
8768
|
disabled,
|
|
8722
8769
|
className: cx23(withVendorCSSClassPrefix23(bem18("multi-input", "remove-button")), styles.removeButton),
|
|
8723
8770
|
title: "Remove value",
|
|
8724
|
-
children: /* @__PURE__ */
|
|
8771
|
+
children: /* @__PURE__ */ jsx74(BinIcon, { className: styles.icon })
|
|
8725
8772
|
}
|
|
8726
8773
|
)
|
|
8727
8774
|
]
|
|
@@ -8909,7 +8956,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
8909
8956
|
var BaseUserProfile_styles_default = useStyles21;
|
|
8910
8957
|
|
|
8911
8958
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8912
|
-
import { Fragment as Fragment14, jsx as
|
|
8959
|
+
import { Fragment as Fragment14, jsx as jsx75, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8913
8960
|
var fieldsToSkip = [
|
|
8914
8961
|
"roles.default",
|
|
8915
8962
|
"active",
|
|
@@ -8945,13 +8992,31 @@ var BaseUserProfile = ({
|
|
|
8945
8992
|
onOpenChange,
|
|
8946
8993
|
onUpdate,
|
|
8947
8994
|
open = false,
|
|
8948
|
-
error = null
|
|
8995
|
+
error = null,
|
|
8996
|
+
isLoading = false,
|
|
8997
|
+
showFields = [],
|
|
8998
|
+
hideFields = []
|
|
8949
8999
|
}) => {
|
|
8950
9000
|
const { theme, colorScheme } = useTheme_default();
|
|
8951
9001
|
const [editedUser, setEditedUser] = useState17(flattenedProfile || profile);
|
|
8952
9002
|
const [editingFields, setEditingFields] = useState17({});
|
|
8953
9003
|
const { t } = useTranslation_default();
|
|
8954
|
-
const
|
|
9004
|
+
const shouldShowField = useCallback12(
|
|
9005
|
+
(fieldName) => {
|
|
9006
|
+
if (fieldsToSkip.includes(fieldName)) {
|
|
9007
|
+
return false;
|
|
9008
|
+
}
|
|
9009
|
+
if (hideFields.length > 0 && hideFields.includes(fieldName)) {
|
|
9010
|
+
return false;
|
|
9011
|
+
}
|
|
9012
|
+
if (showFields.length > 0) {
|
|
9013
|
+
return showFields.includes(fieldName);
|
|
9014
|
+
}
|
|
9015
|
+
return true;
|
|
9016
|
+
},
|
|
9017
|
+
[showFields, hideFields]
|
|
9018
|
+
);
|
|
9019
|
+
const PencilIcon = () => /* @__PURE__ */ jsx75(
|
|
8955
9020
|
"svg",
|
|
8956
9021
|
{
|
|
8957
9022
|
width: "16",
|
|
@@ -8962,7 +9027,7 @@ var BaseUserProfile = ({
|
|
|
8962
9027
|
strokeWidth: "2",
|
|
8963
9028
|
strokeLinecap: "round",
|
|
8964
9029
|
strokeLinejoin: "round",
|
|
8965
|
-
children: /* @__PURE__ */
|
|
9030
|
+
children: /* @__PURE__ */ jsx75("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
8966
9031
|
}
|
|
8967
9032
|
);
|
|
8968
9033
|
const toggleFieldEdit = useCallback12((fieldName) => {
|
|
@@ -8987,12 +9052,12 @@ var BaseUserProfile = ({
|
|
|
8987
9052
|
}, []);
|
|
8988
9053
|
const ObjectDisplay = ({ data }) => {
|
|
8989
9054
|
if (!data || typeof data !== "object") return null;
|
|
8990
|
-
return /* @__PURE__ */
|
|
8991
|
-
/* @__PURE__ */
|
|
9055
|
+
return /* @__PURE__ */ jsx75("table", { className: styles.value, children: /* @__PURE__ */ jsx75("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs34("tr", { children: [
|
|
9056
|
+
/* @__PURE__ */ jsx75("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs34("strong", { children: [
|
|
8992
9057
|
formatLabel(key),
|
|
8993
9058
|
":"
|
|
8994
9059
|
] }) }),
|
|
8995
|
-
/* @__PURE__ */
|
|
9060
|
+
/* @__PURE__ */ jsx75("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx75(ObjectDisplay, { data: value }) : String(value) })
|
|
8996
9061
|
] }, key)) }) });
|
|
8997
9062
|
};
|
|
8998
9063
|
function set(obj, path, value) {
|
|
@@ -9062,9 +9127,9 @@ var BaseUserProfile = ({
|
|
|
9062
9127
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
9063
9128
|
const label = displayName || description || name || "";
|
|
9064
9129
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
9065
|
-
return /* @__PURE__ */
|
|
9066
|
-
/* @__PURE__ */
|
|
9067
|
-
/* @__PURE__ */
|
|
9130
|
+
return /* @__PURE__ */ jsx75(Fragment14, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ jsxs34("div", { className: styles.field, children: [
|
|
9131
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
9132
|
+
/* @__PURE__ */ jsx75("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) })
|
|
9068
9133
|
] }, index)) });
|
|
9069
9134
|
}
|
|
9070
9135
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -9080,9 +9145,9 @@ var BaseUserProfile = ({
|
|
|
9080
9145
|
} else {
|
|
9081
9146
|
fieldValues = [];
|
|
9082
9147
|
}
|
|
9083
|
-
return /* @__PURE__ */
|
|
9084
|
-
/* @__PURE__ */
|
|
9085
|
-
/* @__PURE__ */
|
|
9148
|
+
return /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
9149
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: label }),
|
|
9150
|
+
/* @__PURE__ */ jsx75("div", { className: styles.value, children: /* @__PURE__ */ jsx75(
|
|
9086
9151
|
MultiInput_default,
|
|
9087
9152
|
{
|
|
9088
9153
|
values: fieldValues,
|
|
@@ -9113,9 +9178,9 @@ var BaseUserProfile = ({
|
|
|
9113
9178
|
} else {
|
|
9114
9179
|
displayValue2 = "-";
|
|
9115
9180
|
}
|
|
9116
|
-
return /* @__PURE__ */
|
|
9117
|
-
/* @__PURE__ */
|
|
9118
|
-
/* @__PURE__ */
|
|
9181
|
+
return /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
9182
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: label }),
|
|
9183
|
+
/* @__PURE__ */ jsx75("div", { className: cx24(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx75(
|
|
9119
9184
|
Button_default,
|
|
9120
9185
|
{
|
|
9121
9186
|
onClick: onStartEdit,
|
|
@@ -9130,7 +9195,7 @@ var BaseUserProfile = ({
|
|
|
9130
9195
|
] });
|
|
9131
9196
|
}
|
|
9132
9197
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
9133
|
-
return /* @__PURE__ */
|
|
9198
|
+
return /* @__PURE__ */ jsx75(ObjectDisplay, { data: value });
|
|
9134
9199
|
}
|
|
9135
9200
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
9136
9201
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -9145,16 +9210,16 @@ var BaseUserProfile = ({
|
|
|
9145
9210
|
let field;
|
|
9146
9211
|
switch (type) {
|
|
9147
9212
|
case "STRING":
|
|
9148
|
-
field = /* @__PURE__ */
|
|
9213
|
+
field = /* @__PURE__ */ jsx75(TextField_default, { ...commonProps });
|
|
9149
9214
|
break;
|
|
9150
9215
|
case "DATE_TIME":
|
|
9151
|
-
field = /* @__PURE__ */
|
|
9216
|
+
field = /* @__PURE__ */ jsx75(DatePicker_default, { ...commonProps });
|
|
9152
9217
|
break;
|
|
9153
9218
|
case "BOOLEAN":
|
|
9154
|
-
field = /* @__PURE__ */
|
|
9219
|
+
field = /* @__PURE__ */ jsx75(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
9155
9220
|
break;
|
|
9156
9221
|
case "COMPLEX":
|
|
9157
|
-
field = /* @__PURE__ */
|
|
9222
|
+
field = /* @__PURE__ */ jsx75(
|
|
9158
9223
|
"textarea",
|
|
9159
9224
|
{
|
|
9160
9225
|
value: fieldValue,
|
|
@@ -9166,11 +9231,11 @@ var BaseUserProfile = ({
|
|
|
9166
9231
|
);
|
|
9167
9232
|
break;
|
|
9168
9233
|
default:
|
|
9169
|
-
field = /* @__PURE__ */
|
|
9234
|
+
field = /* @__PURE__ */ jsx75(TextField_default, { ...commonProps });
|
|
9170
9235
|
}
|
|
9171
|
-
return /* @__PURE__ */
|
|
9172
|
-
/* @__PURE__ */
|
|
9173
|
-
/* @__PURE__ */
|
|
9236
|
+
return /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
9237
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: label }),
|
|
9238
|
+
/* @__PURE__ */ jsx75("div", { className: styles.value, children: field })
|
|
9174
9239
|
] });
|
|
9175
9240
|
}
|
|
9176
9241
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -9183,9 +9248,9 @@ var BaseUserProfile = ({
|
|
|
9183
9248
|
} else {
|
|
9184
9249
|
displayValue = "-";
|
|
9185
9250
|
}
|
|
9186
|
-
return /* @__PURE__ */
|
|
9187
|
-
/* @__PURE__ */
|
|
9188
|
-
/* @__PURE__ */
|
|
9251
|
+
return /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
9252
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: label }),
|
|
9253
|
+
/* @__PURE__ */ jsx75("div", { className: cx24(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx75(
|
|
9189
9254
|
Button_default,
|
|
9190
9255
|
{
|
|
9191
9256
|
onClick: onStartEdit,
|
|
@@ -9213,8 +9278,8 @@ var BaseUserProfile = ({
|
|
|
9213
9278
|
alignItems: "center",
|
|
9214
9279
|
gap: theme.vars.spacing.unit
|
|
9215
9280
|
};
|
|
9216
|
-
return /* @__PURE__ */
|
|
9217
|
-
/* @__PURE__ */
|
|
9281
|
+
return /* @__PURE__ */ jsxs34("div", { className: styles.field, children: [
|
|
9282
|
+
/* @__PURE__ */ jsx75("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
9218
9283
|
schema,
|
|
9219
9284
|
isFieldEditing,
|
|
9220
9285
|
(value) => {
|
|
@@ -9224,21 +9289,21 @@ var BaseUserProfile = ({
|
|
|
9224
9289
|
},
|
|
9225
9290
|
() => toggleFieldEdit(schema.name)
|
|
9226
9291
|
) }),
|
|
9227
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */
|
|
9228
|
-
isFieldEditing && /* @__PURE__ */
|
|
9229
|
-
/* @__PURE__ */
|
|
9230
|
-
/* @__PURE__ */
|
|
9292
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs34("div", { className: styles.fieldActions, children: [
|
|
9293
|
+
isFieldEditing && /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
9294
|
+
/* @__PURE__ */ jsx75(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
9295
|
+
/* @__PURE__ */ jsx75(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
9231
9296
|
] }),
|
|
9232
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
9297
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx75(
|
|
9233
9298
|
Button_default,
|
|
9234
9299
|
{
|
|
9235
9300
|
size: "small",
|
|
9236
9301
|
color: "tertiary",
|
|
9237
|
-
variant: "
|
|
9302
|
+
variant: "icon",
|
|
9238
9303
|
onClick: () => toggleFieldEdit(schema.name),
|
|
9239
9304
|
title: "Edit",
|
|
9240
9305
|
className: styles.editButton,
|
|
9241
|
-
children: /* @__PURE__ */
|
|
9306
|
+
children: /* @__PURE__ */ jsx75(PencilIcon, {})
|
|
9242
9307
|
}
|
|
9243
9308
|
)
|
|
9244
9309
|
] })
|
|
@@ -9267,30 +9332,31 @@ var BaseUserProfile = ({
|
|
|
9267
9332
|
const renderProfileWithoutSchemas = () => {
|
|
9268
9333
|
if (!currentUser) return null;
|
|
9269
9334
|
const profileEntries = Object.entries(currentUser).filter(([key, value]) => {
|
|
9270
|
-
if (
|
|
9335
|
+
if (!shouldShowField(key)) return false;
|
|
9271
9336
|
return value !== void 0 && value !== "" && value !== null;
|
|
9272
9337
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
9273
|
-
return /* @__PURE__ */
|
|
9274
|
-
/* @__PURE__ */
|
|
9275
|
-
/* @__PURE__ */
|
|
9338
|
+
return /* @__PURE__ */ jsx75(Fragment14, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ jsxs34("div", { className: styles.field, children: [
|
|
9339
|
+
/* @__PURE__ */ jsx75("span", { className: styles.label, children: formatLabel(key) }),
|
|
9340
|
+
/* @__PURE__ */ jsx75("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
9276
9341
|
] }, key)) });
|
|
9277
9342
|
};
|
|
9278
|
-
const profileContent = /* @__PURE__ */
|
|
9279
|
-
error && /* @__PURE__ */
|
|
9280
|
-
/* @__PURE__ */
|
|
9281
|
-
/* @__PURE__ */
|
|
9343
|
+
const profileContent = /* @__PURE__ */ jsxs34(Card_default, { className: containerClasses, children: [
|
|
9344
|
+
error && /* @__PURE__ */ jsxs34(Alert_default, { variant: "error", className: cx24(withVendorCSSClassPrefix25(bem19("user-profile", "alert")), styles.alert), children: [
|
|
9345
|
+
/* @__PURE__ */ jsx75(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
9346
|
+
/* @__PURE__ */ jsx75(Alert_default.Description, { children: error })
|
|
9282
9347
|
] }),
|
|
9283
|
-
/* @__PURE__ */
|
|
9348
|
+
/* @__PURE__ */ jsx75("div", { className: styles.header, children: /* @__PURE__ */ jsx75(
|
|
9284
9349
|
Avatar,
|
|
9285
9350
|
{
|
|
9286
9351
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
9287
9352
|
name: getDisplayName(),
|
|
9288
9353
|
size: 80,
|
|
9289
|
-
alt: `${getDisplayName()}'s avatar
|
|
9354
|
+
alt: `${getDisplayName()}'s avatar`,
|
|
9355
|
+
isLoading
|
|
9290
9356
|
}
|
|
9291
9357
|
) }),
|
|
9292
|
-
/* @__PURE__ */
|
|
9293
|
-
if (
|
|
9358
|
+
/* @__PURE__ */ jsx75("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
9359
|
+
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
9294
9360
|
if (!editable) {
|
|
9295
9361
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
9296
9362
|
return value !== void 0 && value !== "" && value !== null;
|
|
@@ -9306,13 +9372,13 @@ var BaseUserProfile = ({
|
|
|
9306
9372
|
...schema,
|
|
9307
9373
|
value
|
|
9308
9374
|
};
|
|
9309
|
-
return /* @__PURE__ */
|
|
9375
|
+
return /* @__PURE__ */ jsx75("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
9310
9376
|
}) : renderProfileWithoutSchemas() })
|
|
9311
9377
|
] });
|
|
9312
9378
|
if (mode === "popup") {
|
|
9313
|
-
return /* @__PURE__ */
|
|
9314
|
-
/* @__PURE__ */
|
|
9315
|
-
/* @__PURE__ */
|
|
9379
|
+
return /* @__PURE__ */ jsx75(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs34(Dialog_default.Content, { children: [
|
|
9380
|
+
/* @__PURE__ */ jsx75(Dialog_default.Heading, { children: title ?? t("user.profile.title") }),
|
|
9381
|
+
/* @__PURE__ */ jsx75("div", { className: styles.popup, children: profileContent })
|
|
9316
9382
|
] }) });
|
|
9317
9383
|
}
|
|
9318
9384
|
return profileContent;
|
|
@@ -9353,9 +9419,9 @@ var updateMeProfile_default = updateMeProfile;
|
|
|
9353
9419
|
|
|
9354
9420
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
9355
9421
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
9356
|
-
import { jsx as
|
|
9422
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
9357
9423
|
var UserProfile3 = ({ ...rest }) => {
|
|
9358
|
-
const { baseUrl } = useAsgardeo_default();
|
|
9424
|
+
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
9359
9425
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
9360
9426
|
const { t } = useTranslation_default();
|
|
9361
9427
|
const [error, setError] = useState18(null);
|
|
@@ -9372,7 +9438,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
9372
9438
|
setError(message);
|
|
9373
9439
|
}
|
|
9374
9440
|
};
|
|
9375
|
-
return /* @__PURE__ */
|
|
9441
|
+
return /* @__PURE__ */ jsx76(
|
|
9376
9442
|
BaseUserProfile_default,
|
|
9377
9443
|
{
|
|
9378
9444
|
profile,
|
|
@@ -9589,7 +9655,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
9589
9655
|
var BaseUserDropdown_styles_default = useStyles22;
|
|
9590
9656
|
|
|
9591
9657
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
9592
|
-
import { jsx as
|
|
9658
|
+
import { jsx as jsx77, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9593
9659
|
var BaseUserDropdown = ({
|
|
9594
9660
|
fallback = null,
|
|
9595
9661
|
className = "",
|
|
@@ -9648,14 +9714,14 @@ var BaseUserDropdown = ({
|
|
|
9648
9714
|
defaultMenuItems.push({
|
|
9649
9715
|
label: "Manage Profile",
|
|
9650
9716
|
onClick: onManageProfile,
|
|
9651
|
-
icon: /* @__PURE__ */
|
|
9717
|
+
icon: /* @__PURE__ */ jsx77(User_default2, { width: "16", height: "16" })
|
|
9652
9718
|
});
|
|
9653
9719
|
}
|
|
9654
9720
|
if (onSignOut) {
|
|
9655
9721
|
defaultMenuItems.push({
|
|
9656
9722
|
label: "Sign Out",
|
|
9657
9723
|
onClick: onSignOut,
|
|
9658
|
-
icon: /* @__PURE__ */
|
|
9724
|
+
icon: /* @__PURE__ */ jsx77(LogOut_default, { width: "16", height: "16" })
|
|
9659
9725
|
});
|
|
9660
9726
|
}
|
|
9661
9727
|
const allMenuItems = [...menuItems];
|
|
@@ -9665,8 +9731,8 @@ var BaseUserDropdown = ({
|
|
|
9665
9731
|
}
|
|
9666
9732
|
allMenuItems.push(...defaultMenuItems);
|
|
9667
9733
|
}
|
|
9668
|
-
return /* @__PURE__ */
|
|
9669
|
-
/* @__PURE__ */
|
|
9734
|
+
return /* @__PURE__ */ jsxs35("div", { className: cx25(withVendorCSSClassPrefix26("user-dropdown"), className), children: [
|
|
9735
|
+
/* @__PURE__ */ jsxs35(
|
|
9670
9736
|
Button_default,
|
|
9671
9737
|
{
|
|
9672
9738
|
ref: refs.setReference,
|
|
@@ -9676,7 +9742,7 @@ var BaseUserDropdown = ({
|
|
|
9676
9742
|
size: "medium",
|
|
9677
9743
|
...getReferenceProps(),
|
|
9678
9744
|
children: [
|
|
9679
|
-
/* @__PURE__ */
|
|
9745
|
+
/* @__PURE__ */ jsx77(
|
|
9680
9746
|
Avatar,
|
|
9681
9747
|
{
|
|
9682
9748
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -9685,7 +9751,7 @@ var BaseUserDropdown = ({
|
|
|
9685
9751
|
alt: `${getDisplayName()}'s avatar`
|
|
9686
9752
|
}
|
|
9687
9753
|
),
|
|
9688
|
-
showTriggerLabel && /* @__PURE__ */
|
|
9754
|
+
showTriggerLabel && /* @__PURE__ */ jsx77(
|
|
9689
9755
|
Typography_default,
|
|
9690
9756
|
{
|
|
9691
9757
|
variant: "body2",
|
|
@@ -9696,7 +9762,7 @@ var BaseUserDropdown = ({
|
|
|
9696
9762
|
]
|
|
9697
9763
|
}
|
|
9698
9764
|
),
|
|
9699
|
-
isOpen && /* @__PURE__ */
|
|
9765
|
+
isOpen && /* @__PURE__ */ jsx77(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx77(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs35(
|
|
9700
9766
|
"div",
|
|
9701
9767
|
{
|
|
9702
9768
|
ref: refs.setFloating,
|
|
@@ -9704,8 +9770,8 @@ var BaseUserDropdown = ({
|
|
|
9704
9770
|
style: floatingStyles,
|
|
9705
9771
|
...getFloatingProps(),
|
|
9706
9772
|
children: [
|
|
9707
|
-
/* @__PURE__ */
|
|
9708
|
-
/* @__PURE__ */
|
|
9773
|
+
/* @__PURE__ */ jsxs35("div", { className: cx25(withVendorCSSClassPrefix26("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
9774
|
+
/* @__PURE__ */ jsx77(
|
|
9709
9775
|
Avatar,
|
|
9710
9776
|
{
|
|
9711
9777
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -9714,8 +9780,8 @@ var BaseUserDropdown = ({
|
|
|
9714
9780
|
alt: `${getDisplayName()}'s avatar`
|
|
9715
9781
|
}
|
|
9716
9782
|
),
|
|
9717
|
-
/* @__PURE__ */
|
|
9718
|
-
/* @__PURE__ */
|
|
9783
|
+
/* @__PURE__ */ jsxs35("div", { className: cx25(withVendorCSSClassPrefix26("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
9784
|
+
/* @__PURE__ */ jsx77(
|
|
9719
9785
|
Typography_default,
|
|
9720
9786
|
{
|
|
9721
9787
|
noWrap: true,
|
|
@@ -9725,7 +9791,7 @@ var BaseUserDropdown = ({
|
|
|
9725
9791
|
children: getDisplayName()
|
|
9726
9792
|
}
|
|
9727
9793
|
),
|
|
9728
|
-
/* @__PURE__ */
|
|
9794
|
+
/* @__PURE__ */ jsx77(
|
|
9729
9795
|
Typography_default,
|
|
9730
9796
|
{
|
|
9731
9797
|
noWrap: true,
|
|
@@ -9737,7 +9803,7 @@ var BaseUserDropdown = ({
|
|
|
9737
9803
|
)
|
|
9738
9804
|
] })
|
|
9739
9805
|
] }),
|
|
9740
|
-
/* @__PURE__ */
|
|
9806
|
+
/* @__PURE__ */ jsx77("div", { className: cx25(withVendorCSSClassPrefix26("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx77("div", { children: item.label === "" ? /* @__PURE__ */ jsx77("div", { className: cx25(withVendorCSSClassPrefix26("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ jsxs35(
|
|
9741
9807
|
"a",
|
|
9742
9808
|
{
|
|
9743
9809
|
href: item.href,
|
|
@@ -9751,10 +9817,10 @@ var BaseUserDropdown = ({
|
|
|
9751
9817
|
onBlur: () => setHoveredItemIndex(null),
|
|
9752
9818
|
children: [
|
|
9753
9819
|
item.icon,
|
|
9754
|
-
/* @__PURE__ */
|
|
9820
|
+
/* @__PURE__ */ jsx77("span", { children: item.label })
|
|
9755
9821
|
]
|
|
9756
9822
|
}
|
|
9757
|
-
) : /* @__PURE__ */
|
|
9823
|
+
) : /* @__PURE__ */ jsx77(
|
|
9758
9824
|
Button_default,
|
|
9759
9825
|
{
|
|
9760
9826
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -9780,7 +9846,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
9780
9846
|
|
|
9781
9847
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
9782
9848
|
import { useState as useState20 } from "react";
|
|
9783
|
-
import { Fragment as Fragment15, jsx as
|
|
9849
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9784
9850
|
var UserDropdown = ({
|
|
9785
9851
|
children,
|
|
9786
9852
|
renderTrigger,
|
|
@@ -9809,14 +9875,14 @@ var UserDropdown = ({
|
|
|
9809
9875
|
closeProfile
|
|
9810
9876
|
};
|
|
9811
9877
|
if (children) {
|
|
9812
|
-
return /* @__PURE__ */
|
|
9878
|
+
return /* @__PURE__ */ jsxs36(Fragment15, { children: [
|
|
9813
9879
|
children(renderProps),
|
|
9814
|
-
/* @__PURE__ */
|
|
9880
|
+
/* @__PURE__ */ jsx78(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9815
9881
|
] });
|
|
9816
9882
|
}
|
|
9817
9883
|
if (renderTrigger || renderDropdown) {
|
|
9818
|
-
return /* @__PURE__ */
|
|
9819
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
9884
|
+
return /* @__PURE__ */ jsxs36(Fragment15, { children: [
|
|
9885
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx78(
|
|
9820
9886
|
BaseUserDropdown_default,
|
|
9821
9887
|
{
|
|
9822
9888
|
user,
|
|
@@ -9826,11 +9892,11 @@ var UserDropdown = ({
|
|
|
9826
9892
|
...rest
|
|
9827
9893
|
}
|
|
9828
9894
|
),
|
|
9829
|
-
/* @__PURE__ */
|
|
9895
|
+
/* @__PURE__ */ jsx78(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9830
9896
|
] });
|
|
9831
9897
|
}
|
|
9832
|
-
return /* @__PURE__ */
|
|
9833
|
-
/* @__PURE__ */
|
|
9898
|
+
return /* @__PURE__ */ jsxs36(Fragment15, { children: [
|
|
9899
|
+
/* @__PURE__ */ jsx78(
|
|
9834
9900
|
BaseUserDropdown_default,
|
|
9835
9901
|
{
|
|
9836
9902
|
user,
|
|
@@ -9840,7 +9906,7 @@ var UserDropdown = ({
|
|
|
9840
9906
|
...rest
|
|
9841
9907
|
}
|
|
9842
9908
|
),
|
|
9843
|
-
isProfileOpen && /* @__PURE__ */
|
|
9909
|
+
isProfileOpen && /* @__PURE__ */ jsx78(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
9844
9910
|
] });
|
|
9845
9911
|
};
|
|
9846
9912
|
var UserDropdown_default = UserDropdown;
|
|
@@ -9863,9 +9929,9 @@ import { cx as cx26 } from "@emotion/css";
|
|
|
9863
9929
|
import { useState as useState21 } from "react";
|
|
9864
9930
|
|
|
9865
9931
|
// src/components/primitives/Icons/Building.tsx
|
|
9866
|
-
import { jsx as
|
|
9867
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
9868
|
-
/* @__PURE__ */
|
|
9932
|
+
import { jsx as jsx79, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9933
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs37("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
9934
|
+
/* @__PURE__ */ jsx79(
|
|
9869
9935
|
"path",
|
|
9870
9936
|
{
|
|
9871
9937
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -9875,25 +9941,25 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
9875
9941
|
strokeLinejoin: "round"
|
|
9876
9942
|
}
|
|
9877
9943
|
),
|
|
9878
|
-
/* @__PURE__ */
|
|
9879
|
-
/* @__PURE__ */
|
|
9880
|
-
/* @__PURE__ */
|
|
9881
|
-
/* @__PURE__ */
|
|
9882
|
-
/* @__PURE__ */
|
|
9883
|
-
/* @__PURE__ */
|
|
9944
|
+
/* @__PURE__ */ jsx79("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9945
|
+
/* @__PURE__ */ jsx79("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9946
|
+
/* @__PURE__ */ jsx79("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9947
|
+
/* @__PURE__ */ jsx79("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9948
|
+
/* @__PURE__ */ jsx79("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
9949
|
+
/* @__PURE__ */ jsx79("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
9884
9950
|
] });
|
|
9885
9951
|
Building.displayName = "Building";
|
|
9886
9952
|
var Building_default = Building;
|
|
9887
9953
|
|
|
9888
9954
|
// src/components/primitives/Icons/Check.tsx
|
|
9889
|
-
import { jsx as
|
|
9890
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
9955
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
9956
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx80("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx80("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
9891
9957
|
Check.displayName = "Check";
|
|
9892
9958
|
var Check_default = Check;
|
|
9893
9959
|
|
|
9894
9960
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
9895
|
-
import { jsx as
|
|
9896
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
9961
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
9962
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx81("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx81("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
9897
9963
|
ChevronDown.displayName = "ChevronDown";
|
|
9898
9964
|
var ChevronDown_default = ChevronDown;
|
|
9899
9965
|
|
|
@@ -10123,7 +10189,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10123
10189
|
var BaseOrganizationSwitcher_styles_default = useStyles23;
|
|
10124
10190
|
|
|
10125
10191
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
10126
|
-
import { Fragment as Fragment16, jsx as
|
|
10192
|
+
import { Fragment as Fragment16, jsx as jsx82, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10127
10193
|
var BaseOrganizationSwitcher = ({
|
|
10128
10194
|
organizations,
|
|
10129
10195
|
currentOrganization,
|
|
@@ -10176,8 +10242,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10176
10242
|
const switchableOrganizations = organizations.filter(
|
|
10177
10243
|
(org) => org.id !== currentOrganization?.id
|
|
10178
10244
|
);
|
|
10179
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */
|
|
10180
|
-
/* @__PURE__ */
|
|
10245
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
10246
|
+
/* @__PURE__ */ jsx82(
|
|
10181
10247
|
Avatar,
|
|
10182
10248
|
{
|
|
10183
10249
|
variant: "square",
|
|
@@ -10187,24 +10253,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
10187
10253
|
alt: `${organization.name} avatar`
|
|
10188
10254
|
}
|
|
10189
10255
|
),
|
|
10190
|
-
/* @__PURE__ */
|
|
10191
|
-
/* @__PURE__ */
|
|
10192
|
-
/* @__PURE__ */
|
|
10193
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
10256
|
+
/* @__PURE__ */ jsxs38("div", { className: cx26(styles.organizationInfo), children: [
|
|
10257
|
+
/* @__PURE__ */ jsx82(Typography_default, { variant: "body2", fontWeight: "medium", className: cx26(styles.organizationName), children: organization.name }),
|
|
10258
|
+
/* @__PURE__ */ jsxs38("div", { className: cx26(styles.organizationMeta), children: [
|
|
10259
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs38("span", { children: [
|
|
10194
10260
|
organization.memberCount,
|
|
10195
10261
|
" ",
|
|
10196
10262
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
10197
10263
|
] }),
|
|
10198
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
10199
|
-
showRole && organization.role && /* @__PURE__ */
|
|
10264
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx82("span", { children: " \u2022 " }),
|
|
10265
|
+
showRole && organization.role && /* @__PURE__ */ jsx82("span", { className: cx26(styles.roleCapitalized), children: organization.role })
|
|
10200
10266
|
] })
|
|
10201
10267
|
] }),
|
|
10202
|
-
isSelected && /* @__PURE__ */
|
|
10268
|
+
isSelected && /* @__PURE__ */ jsx82(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
10203
10269
|
] });
|
|
10204
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
10205
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
10206
|
-
return /* @__PURE__ */
|
|
10207
|
-
/* @__PURE__ */
|
|
10270
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx82("div", { className: cx26(styles.loadingContainer), children: /* @__PURE__ */ jsx82(Typography_default, { variant: "caption", className: cx26(styles.loadingText), children: t("organization.switcher.loading.organizations") }) });
|
|
10271
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx82("div", { className: cx26(styles.errorContainer), children: /* @__PURE__ */ jsx82(Typography_default, { variant: "caption", className: cx26(styles.errorText), children: errorMessage }) });
|
|
10272
|
+
return /* @__PURE__ */ jsxs38("div", { className: cx26(styles.root, className), style, children: [
|
|
10273
|
+
/* @__PURE__ */ jsxs38(
|
|
10208
10274
|
Button_default,
|
|
10209
10275
|
{
|
|
10210
10276
|
ref: refs.setReference,
|
|
@@ -10214,8 +10280,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10214
10280
|
size: "medium",
|
|
10215
10281
|
...getReferenceProps(),
|
|
10216
10282
|
children: [
|
|
10217
|
-
currentOrganization ? /* @__PURE__ */
|
|
10218
|
-
/* @__PURE__ */
|
|
10283
|
+
currentOrganization ? /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
10284
|
+
/* @__PURE__ */ jsx82(
|
|
10219
10285
|
Avatar,
|
|
10220
10286
|
{
|
|
10221
10287
|
variant: "square",
|
|
@@ -10225,18 +10291,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
10225
10291
|
alt: `${currentOrganization.name} avatar`
|
|
10226
10292
|
}
|
|
10227
10293
|
),
|
|
10228
|
-
showTriggerLabel && /* @__PURE__ */
|
|
10229
|
-
] }) : /* @__PURE__ */
|
|
10230
|
-
/* @__PURE__ */
|
|
10231
|
-
showTriggerLabel && /* @__PURE__ */
|
|
10294
|
+
showTriggerLabel && /* @__PURE__ */ jsx82(Typography_default, { variant: "body2", className: cx26(styles.triggerLabel), children: currentOrganization.name })
|
|
10295
|
+
] }) : /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
10296
|
+
/* @__PURE__ */ jsx82(Building_default, { width: avatarSize, height: avatarSize }),
|
|
10297
|
+
showTriggerLabel && /* @__PURE__ */ jsx82(Typography_default, { variant: "body2", className: cx26(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
10232
10298
|
] }),
|
|
10233
|
-
/* @__PURE__ */
|
|
10299
|
+
/* @__PURE__ */ jsx82(ChevronDown_default, { width: "16", height: "16" })
|
|
10234
10300
|
]
|
|
10235
10301
|
}
|
|
10236
10302
|
),
|
|
10237
|
-
isOpen && /* @__PURE__ */
|
|
10238
|
-
currentOrganization && /* @__PURE__ */
|
|
10239
|
-
/* @__PURE__ */
|
|
10303
|
+
isOpen && /* @__PURE__ */ jsx82(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx82(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs38("div", { ref: refs.setFloating, className: cx26(styles.content), style: floatingStyles, ...getFloatingProps(), children: [
|
|
10304
|
+
currentOrganization && /* @__PURE__ */ jsxs38("div", { className: cx26(styles.header), children: [
|
|
10305
|
+
/* @__PURE__ */ jsx82(
|
|
10240
10306
|
Avatar,
|
|
10241
10307
|
{
|
|
10242
10308
|
variant: "square",
|
|
@@ -10246,10 +10312,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10246
10312
|
alt: `${currentOrganization.name} avatar`
|
|
10247
10313
|
}
|
|
10248
10314
|
),
|
|
10249
|
-
/* @__PURE__ */
|
|
10250
|
-
/* @__PURE__ */
|
|
10251
|
-
/* @__PURE__ */
|
|
10252
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */
|
|
10315
|
+
/* @__PURE__ */ jsxs38("div", { className: cx26(styles.headerInfo), children: [
|
|
10316
|
+
/* @__PURE__ */ jsx82(Typography_default, { noWrap: true, className: cx26(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
10317
|
+
/* @__PURE__ */ jsxs38("div", { className: cx26(styles.headerMeta), children: [
|
|
10318
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs38(
|
|
10253
10319
|
Typography_default,
|
|
10254
10320
|
{
|
|
10255
10321
|
noWrap: true,
|
|
@@ -10259,17 +10325,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
10259
10325
|
currentOrganization.memberCount,
|
|
10260
10326
|
" ",
|
|
10261
10327
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
10262
|
-
showRole && currentOrganization.role && /* @__PURE__ */
|
|
10328
|
+
showRole && currentOrganization.role && /* @__PURE__ */ jsxs38("span", { children: [
|
|
10263
10329
|
" \u2022 ",
|
|
10264
10330
|
currentOrganization.role
|
|
10265
10331
|
] })
|
|
10266
10332
|
]
|
|
10267
10333
|
}
|
|
10268
10334
|
),
|
|
10269
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
10335
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx82(Typography_default, { noWrap: true, className: cx26(styles.headerRole), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
10270
10336
|
] })
|
|
10271
10337
|
] }),
|
|
10272
|
-
onManageProfile && /* @__PURE__ */
|
|
10338
|
+
onManageProfile && /* @__PURE__ */ jsx82(
|
|
10273
10339
|
Button_default,
|
|
10274
10340
|
{
|
|
10275
10341
|
onClick: onManageProfile,
|
|
@@ -10278,7 +10344,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
10278
10344
|
size: "small",
|
|
10279
10345
|
"aria-label": "Manage Organization Profile",
|
|
10280
10346
|
className: cx26(styles.manageButton),
|
|
10281
|
-
endIcon: /* @__PURE__ */
|
|
10347
|
+
endIcon: /* @__PURE__ */ jsxs38(
|
|
10282
10348
|
"svg",
|
|
10283
10349
|
{
|
|
10284
10350
|
width: "16",
|
|
@@ -10290,8 +10356,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
10290
10356
|
strokeLinecap: "round",
|
|
10291
10357
|
strokeLinejoin: "round",
|
|
10292
10358
|
children: [
|
|
10293
|
-
/* @__PURE__ */
|
|
10294
|
-
/* @__PURE__ */
|
|
10359
|
+
/* @__PURE__ */ jsx82("circle", { cx: "12", cy: "12", r: "3" }),
|
|
10360
|
+
/* @__PURE__ */ jsx82("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" })
|
|
10295
10361
|
]
|
|
10296
10362
|
}
|
|
10297
10363
|
),
|
|
@@ -10299,20 +10365,20 @@ var BaseOrganizationSwitcher = ({
|
|
|
10299
10365
|
}
|
|
10300
10366
|
)
|
|
10301
10367
|
] }),
|
|
10302
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
10368
|
+
organizations.length > 1 && /* @__PURE__ */ jsx82(
|
|
10303
10369
|
"div",
|
|
10304
10370
|
{
|
|
10305
10371
|
className: cx26(styles.header, styles.sectionHeaderContainer),
|
|
10306
10372
|
style: {
|
|
10307
10373
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
10308
10374
|
},
|
|
10309
|
-
children: /* @__PURE__ */
|
|
10375
|
+
children: /* @__PURE__ */ jsx82(Typography_default, { variant: "caption", fontWeight: 600, className: cx26(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
10310
10376
|
}
|
|
10311
10377
|
),
|
|
10312
|
-
/* @__PURE__ */
|
|
10378
|
+
/* @__PURE__ */ jsx82("div", { className: cx26(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
10313
10379
|
switchableOrganizations.map((organization) => {
|
|
10314
10380
|
const isSelected = false;
|
|
10315
|
-
return /* @__PURE__ */
|
|
10381
|
+
return /* @__PURE__ */ jsx82(
|
|
10316
10382
|
Button_default,
|
|
10317
10383
|
{
|
|
10318
10384
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -10330,10 +10396,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10330
10396
|
organization.id
|
|
10331
10397
|
);
|
|
10332
10398
|
}),
|
|
10333
|
-
menuItems.length > 0 && /* @__PURE__ */
|
|
10334
|
-
/* @__PURE__ */
|
|
10399
|
+
menuItems.length > 0 && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
10400
|
+
/* @__PURE__ */ jsx82("div", { className: cx26(styles.menuDivider) }),
|
|
10335
10401
|
menuItems.map(
|
|
10336
|
-
(item, index) => /* @__PURE__ */
|
|
10402
|
+
(item, index) => /* @__PURE__ */ jsx82("div", { children: item.href ? /* @__PURE__ */ jsxs38(
|
|
10337
10403
|
"a",
|
|
10338
10404
|
{
|
|
10339
10405
|
href: item.href,
|
|
@@ -10347,10 +10413,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
10347
10413
|
onBlur: () => setHoveredItemIndex(null),
|
|
10348
10414
|
children: [
|
|
10349
10415
|
item.icon,
|
|
10350
|
-
/* @__PURE__ */
|
|
10416
|
+
/* @__PURE__ */ jsx82("span", { children: item.label })
|
|
10351
10417
|
]
|
|
10352
10418
|
}
|
|
10353
|
-
) : /* @__PURE__ */
|
|
10419
|
+
) : /* @__PURE__ */ jsx82(
|
|
10354
10420
|
Button_default,
|
|
10355
10421
|
{
|
|
10356
10422
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -10524,7 +10590,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
10524
10590
|
var BaseCreateOrganization_styles_default = useStyles24;
|
|
10525
10591
|
|
|
10526
10592
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
10527
|
-
import { jsx as
|
|
10593
|
+
import { jsx as jsx83, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
10528
10594
|
var BaseCreateOrganization = ({
|
|
10529
10595
|
cardLayout = true,
|
|
10530
10596
|
className = "",
|
|
@@ -10611,13 +10677,13 @@ var BaseCreateOrganization = ({
|
|
|
10611
10677
|
console.error("Form submission error:", submitError);
|
|
10612
10678
|
}
|
|
10613
10679
|
};
|
|
10614
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
10615
|
-
/* @__PURE__ */
|
|
10616
|
-
error && /* @__PURE__ */
|
|
10617
|
-
/* @__PURE__ */
|
|
10618
|
-
/* @__PURE__ */
|
|
10680
|
+
const createOrganizationContent = /* @__PURE__ */ jsx83("div", { className: cx27(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ jsxs39("div", { className: cx27(styles.content), children: [
|
|
10681
|
+
/* @__PURE__ */ jsxs39("form", { id: "create-organization-form", className: cx27(styles.form), onSubmit: handleSubmit, children: [
|
|
10682
|
+
error && /* @__PURE__ */ jsxs39(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
10683
|
+
/* @__PURE__ */ jsx83(Alert_default.Title, { children: "Error" }),
|
|
10684
|
+
/* @__PURE__ */ jsx83(Alert_default.Description, { children: error })
|
|
10619
10685
|
] }),
|
|
10620
|
-
/* @__PURE__ */
|
|
10686
|
+
/* @__PURE__ */ jsx83("div", { className: cx27(styles.fieldGroup), children: /* @__PURE__ */ jsx83(
|
|
10621
10687
|
TextField_default,
|
|
10622
10688
|
{
|
|
10623
10689
|
label: `${t("organization.create.name.label")}`,
|
|
@@ -10630,7 +10696,7 @@ var BaseCreateOrganization = ({
|
|
|
10630
10696
|
className: cx27(styles.input)
|
|
10631
10697
|
}
|
|
10632
10698
|
) }),
|
|
10633
|
-
/* @__PURE__ */
|
|
10699
|
+
/* @__PURE__ */ jsx83("div", { className: cx27(styles.fieldGroup), children: /* @__PURE__ */ jsx83(
|
|
10634
10700
|
TextField_default,
|
|
10635
10701
|
{
|
|
10636
10702
|
label: `${t("organization.create.handle.label") || "Organization Handle"}`,
|
|
@@ -10644,9 +10710,9 @@ var BaseCreateOrganization = ({
|
|
|
10644
10710
|
className: cx27(styles.input)
|
|
10645
10711
|
}
|
|
10646
10712
|
) }),
|
|
10647
|
-
/* @__PURE__ */
|
|
10648
|
-
/* @__PURE__ */
|
|
10649
|
-
/* @__PURE__ */
|
|
10713
|
+
/* @__PURE__ */ jsx83("div", { className: cx27(styles.fieldGroup), children: /* @__PURE__ */ jsxs39(FormControl_default, { error: formErrors.description, children: [
|
|
10714
|
+
/* @__PURE__ */ jsx83(InputLabel_default, { required: true, children: t("organization.create.description.label") }),
|
|
10715
|
+
/* @__PURE__ */ jsx83(
|
|
10650
10716
|
"textarea",
|
|
10651
10717
|
{
|
|
10652
10718
|
className: cx27(styles.textarea, formErrors.description && styles.textareaError),
|
|
@@ -10660,15 +10726,15 @@ var BaseCreateOrganization = ({
|
|
|
10660
10726
|
] }) }),
|
|
10661
10727
|
renderAdditionalFields && renderAdditionalFields()
|
|
10662
10728
|
] }),
|
|
10663
|
-
/* @__PURE__ */
|
|
10664
|
-
onCancel && /* @__PURE__ */
|
|
10665
|
-
/* @__PURE__ */
|
|
10729
|
+
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.actions), children: [
|
|
10730
|
+
onCancel && /* @__PURE__ */ jsx83(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.cancel") }),
|
|
10731
|
+
/* @__PURE__ */ jsx83(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.creating") : t("organization.create.button") })
|
|
10666
10732
|
] })
|
|
10667
10733
|
] }) });
|
|
10668
10734
|
if (mode === "popup") {
|
|
10669
|
-
return /* @__PURE__ */
|
|
10670
|
-
/* @__PURE__ */
|
|
10671
|
-
/* @__PURE__ */
|
|
10735
|
+
return /* @__PURE__ */ jsx83(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs39(Dialog_default.Content, { children: [
|
|
10736
|
+
/* @__PURE__ */ jsx83(Dialog_default.Heading, { children: title }),
|
|
10737
|
+
/* @__PURE__ */ jsx83("div", { className: styles.popup, children: createOrganizationContent })
|
|
10672
10738
|
] }) });
|
|
10673
10739
|
}
|
|
10674
10740
|
return createOrganizationContent;
|
|
@@ -10704,7 +10770,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
10704
10770
|
var createOrganization_default = createOrganization;
|
|
10705
10771
|
|
|
10706
10772
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
10707
|
-
import { Fragment as Fragment17, jsx as
|
|
10773
|
+
import { Fragment as Fragment17, jsx as jsx84 } from "react/jsx-runtime";
|
|
10708
10774
|
var CreateOrganization = ({
|
|
10709
10775
|
onCreateOrganization,
|
|
10710
10776
|
fallback = null,
|
|
@@ -10720,7 +10786,7 @@ var CreateOrganization = ({
|
|
|
10720
10786
|
return fallback;
|
|
10721
10787
|
}
|
|
10722
10788
|
if (!isSignedIn) {
|
|
10723
|
-
return /* @__PURE__ */
|
|
10789
|
+
return /* @__PURE__ */ jsx84(Fragment17, {});
|
|
10724
10790
|
}
|
|
10725
10791
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
10726
10792
|
const handleSubmit = async (payload) => {
|
|
@@ -10754,7 +10820,7 @@ var CreateOrganization = ({
|
|
|
10754
10820
|
setLoading(false);
|
|
10755
10821
|
}
|
|
10756
10822
|
};
|
|
10757
|
-
return /* @__PURE__ */
|
|
10823
|
+
return /* @__PURE__ */ jsx84(
|
|
10758
10824
|
BaseCreateOrganization,
|
|
10759
10825
|
{
|
|
10760
10826
|
onSubmit: handleSubmit,
|
|
@@ -10936,7 +11002,7 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
10936
11002
|
var KeyValueInput_styles_default = useStyles25;
|
|
10937
11003
|
|
|
10938
11004
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
10939
|
-
import { jsx as
|
|
11005
|
+
import { jsx as jsx85, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
10940
11006
|
var KeyValueInput = ({
|
|
10941
11007
|
className = "",
|
|
10942
11008
|
disabled = false,
|
|
@@ -11011,10 +11077,10 @@ var KeyValueInput = ({
|
|
|
11011
11077
|
);
|
|
11012
11078
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
11013
11079
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
11014
|
-
return /* @__PURE__ */
|
|
11015
|
-
label && /* @__PURE__ */
|
|
11080
|
+
return /* @__PURE__ */ jsxs40("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input")), styles.container, className), children: [
|
|
11081
|
+
label && /* @__PURE__ */ jsxs40("label", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "label")), styles.label), children: [
|
|
11016
11082
|
label,
|
|
11017
|
-
required && /* @__PURE__ */
|
|
11083
|
+
required && /* @__PURE__ */ jsx85(
|
|
11018
11084
|
"span",
|
|
11019
11085
|
{
|
|
11020
11086
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "required")), styles.requiredIndicator),
|
|
@@ -11022,13 +11088,13 @@ var KeyValueInput = ({
|
|
|
11022
11088
|
}
|
|
11023
11089
|
)
|
|
11024
11090
|
] }),
|
|
11025
|
-
/* @__PURE__ */
|
|
11026
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */
|
|
11091
|
+
/* @__PURE__ */ jsxs40("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
11092
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ jsx85("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ jsxs40(
|
|
11027
11093
|
"div",
|
|
11028
11094
|
{
|
|
11029
11095
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
11030
11096
|
children: [
|
|
11031
|
-
/* @__PURE__ */
|
|
11097
|
+
/* @__PURE__ */ jsxs40(
|
|
11032
11098
|
"span",
|
|
11033
11099
|
{
|
|
11034
11100
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
@@ -11038,7 +11104,7 @@ var KeyValueInput = ({
|
|
|
11038
11104
|
]
|
|
11039
11105
|
}
|
|
11040
11106
|
),
|
|
11041
|
-
/* @__PURE__ */
|
|
11107
|
+
/* @__PURE__ */ jsx85(
|
|
11042
11108
|
"span",
|
|
11043
11109
|
{
|
|
11044
11110
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
@@ -11048,12 +11114,12 @@ var KeyValueInput = ({
|
|
|
11048
11114
|
]
|
|
11049
11115
|
},
|
|
11050
11116
|
`${pair.key}-${index}`
|
|
11051
|
-
)) : pairs.map((pair, index) => /* @__PURE__ */
|
|
11117
|
+
)) : pairs.map((pair, index) => /* @__PURE__ */ jsxs40(
|
|
11052
11118
|
"div",
|
|
11053
11119
|
{
|
|
11054
11120
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "pair-row")), styles.pairRow),
|
|
11055
11121
|
children: [
|
|
11056
|
-
/* @__PURE__ */
|
|
11122
|
+
/* @__PURE__ */ jsx85(
|
|
11057
11123
|
TextField_default,
|
|
11058
11124
|
{
|
|
11059
11125
|
placeholder: keyPlaceholder,
|
|
@@ -11064,7 +11130,7 @@ var KeyValueInput = ({
|
|
|
11064
11130
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
11065
11131
|
}
|
|
11066
11132
|
),
|
|
11067
|
-
/* @__PURE__ */
|
|
11133
|
+
/* @__PURE__ */ jsx85(
|
|
11068
11134
|
TextField_default,
|
|
11069
11135
|
{
|
|
11070
11136
|
placeholder: valuePlaceholder,
|
|
@@ -11075,7 +11141,7 @@ var KeyValueInput = ({
|
|
|
11075
11141
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
11076
11142
|
}
|
|
11077
11143
|
),
|
|
11078
|
-
!readOnly && /* @__PURE__ */
|
|
11144
|
+
!readOnly && /* @__PURE__ */ jsx85(
|
|
11079
11145
|
"button",
|
|
11080
11146
|
{
|
|
11081
11147
|
type: "button",
|
|
@@ -11083,15 +11149,15 @@ var KeyValueInput = ({
|
|
|
11083
11149
|
disabled,
|
|
11084
11150
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "remove-button")), styles.removeButton),
|
|
11085
11151
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
11086
|
-
children: /* @__PURE__ */
|
|
11152
|
+
children: /* @__PURE__ */ jsx85(X_default, { width: 16, height: 16 })
|
|
11087
11153
|
}
|
|
11088
11154
|
)
|
|
11089
11155
|
]
|
|
11090
11156
|
},
|
|
11091
11157
|
`${pair.key}-${index}`
|
|
11092
11158
|
)),
|
|
11093
|
-
!readOnly && /* @__PURE__ */
|
|
11094
|
-
/* @__PURE__ */
|
|
11159
|
+
!readOnly && /* @__PURE__ */ jsxs40("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "add-row")), styles.addRow), children: [
|
|
11160
|
+
/* @__PURE__ */ jsx85(
|
|
11095
11161
|
TextField_default,
|
|
11096
11162
|
{
|
|
11097
11163
|
placeholder: keyPlaceholder,
|
|
@@ -11102,7 +11168,7 @@ var KeyValueInput = ({
|
|
|
11102
11168
|
"aria-label": "New key"
|
|
11103
11169
|
}
|
|
11104
11170
|
),
|
|
11105
|
-
/* @__PURE__ */
|
|
11171
|
+
/* @__PURE__ */ jsx85(
|
|
11106
11172
|
TextField_default,
|
|
11107
11173
|
{
|
|
11108
11174
|
placeholder: valuePlaceholder,
|
|
@@ -11118,7 +11184,7 @@ var KeyValueInput = ({
|
|
|
11118
11184
|
}
|
|
11119
11185
|
}
|
|
11120
11186
|
),
|
|
11121
|
-
/* @__PURE__ */
|
|
11187
|
+
/* @__PURE__ */ jsx85(
|
|
11122
11188
|
"button",
|
|
11123
11189
|
{
|
|
11124
11190
|
type: "button",
|
|
@@ -11126,13 +11192,13 @@ var KeyValueInput = ({
|
|
|
11126
11192
|
disabled: isAddDisabled,
|
|
11127
11193
|
className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "add-button")), styles.addButton),
|
|
11128
11194
|
"aria-label": "Add new key-value pair",
|
|
11129
|
-
children: /* @__PURE__ */
|
|
11195
|
+
children: /* @__PURE__ */ jsx85(Plus_default, { width: 16, height: 16 })
|
|
11130
11196
|
}
|
|
11131
11197
|
)
|
|
11132
11198
|
] })
|
|
11133
11199
|
] }),
|
|
11134
|
-
(helperText || error) && /* @__PURE__ */
|
|
11135
|
-
maxPairs && /* @__PURE__ */
|
|
11200
|
+
(helperText || error) && /* @__PURE__ */ jsx85("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
11201
|
+
maxPairs && /* @__PURE__ */ jsxs40("div", { className: cx28(withVendorCSSClassPrefix27(bem20("key-value-input", "counter")), styles.counterText), children: [
|
|
11136
11202
|
pairs.length,
|
|
11137
11203
|
" of ",
|
|
11138
11204
|
maxPairs,
|
|
@@ -11299,7 +11365,7 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
11299
11365
|
var BaseOrganizationProfile_styles_default = useStyles26;
|
|
11300
11366
|
|
|
11301
11367
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11302
|
-
import { Fragment as Fragment18, jsx as
|
|
11368
|
+
import { Fragment as Fragment18, jsx as jsx86, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11303
11369
|
var BaseOrganizationProfile = ({
|
|
11304
11370
|
fallback = null,
|
|
11305
11371
|
className = "",
|
|
@@ -11350,7 +11416,7 @@ var BaseOrganizationProfile = ({
|
|
|
11350
11416
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
11351
11417
|
const [editedOrganization, setEditedOrganization] = useState25(organization);
|
|
11352
11418
|
const [editingFields, setEditingFields] = useState25({});
|
|
11353
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
11419
|
+
const PencilIcon = () => /* @__PURE__ */ jsx86(
|
|
11354
11420
|
"svg",
|
|
11355
11421
|
{
|
|
11356
11422
|
width: "16",
|
|
@@ -11361,7 +11427,7 @@ var BaseOrganizationProfile = ({
|
|
|
11361
11427
|
strokeWidth: "2",
|
|
11362
11428
|
strokeLinecap: "round",
|
|
11363
11429
|
strokeLinejoin: "round",
|
|
11364
|
-
children: /* @__PURE__ */
|
|
11430
|
+
children: /* @__PURE__ */ jsx86("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
11365
11431
|
}
|
|
11366
11432
|
);
|
|
11367
11433
|
const toggleFieldEdit = useCallback14((fieldName) => {
|
|
@@ -11424,7 +11490,7 @@ var BaseOrganizationProfile = ({
|
|
|
11424
11490
|
let fieldInput;
|
|
11425
11491
|
if (key === "attributes") {
|
|
11426
11492
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
11427
|
-
fieldInput = /* @__PURE__ */
|
|
11493
|
+
fieldInput = /* @__PURE__ */ jsx86(
|
|
11428
11494
|
KeyValueInput_default,
|
|
11429
11495
|
{
|
|
11430
11496
|
value: attributesValue,
|
|
@@ -11462,26 +11528,26 @@ var BaseOrganizationProfile = ({
|
|
|
11462
11528
|
}
|
|
11463
11529
|
);
|
|
11464
11530
|
} else {
|
|
11465
|
-
fieldInput = /* @__PURE__ */
|
|
11531
|
+
fieldInput = /* @__PURE__ */ jsx86(TextField_default, { ...commonProps });
|
|
11466
11532
|
}
|
|
11467
|
-
return /* @__PURE__ */
|
|
11468
|
-
/* @__PURE__ */
|
|
11469
|
-
/* @__PURE__ */
|
|
11533
|
+
return /* @__PURE__ */ jsxs41(Fragment18, { children: [
|
|
11534
|
+
/* @__PURE__ */ jsx86("span", { className: cx29(styles.label), children: label }),
|
|
11535
|
+
/* @__PURE__ */ jsx86("div", { className: cx29(styles.value), children: fieldInput })
|
|
11470
11536
|
] });
|
|
11471
11537
|
}
|
|
11472
11538
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
11473
11539
|
const isFieldEditable = editable && fieldEditable;
|
|
11474
11540
|
let displayValue;
|
|
11475
11541
|
if (hasValue) {
|
|
11476
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
11542
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx86(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
11477
11543
|
} else if (isFieldEditable) {
|
|
11478
11544
|
displayValue = getFieldPlaceholder(key);
|
|
11479
11545
|
} else {
|
|
11480
11546
|
displayValue = "-";
|
|
11481
11547
|
}
|
|
11482
|
-
return /* @__PURE__ */
|
|
11483
|
-
/* @__PURE__ */
|
|
11484
|
-
/* @__PURE__ */
|
|
11548
|
+
return /* @__PURE__ */ jsxs41(Fragment18, { children: [
|
|
11549
|
+
/* @__PURE__ */ jsx86("span", { className: cx29(styles.label), children: label }),
|
|
11550
|
+
/* @__PURE__ */ jsx86("div", { className: cx29(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx86(
|
|
11485
11551
|
Button_default,
|
|
11486
11552
|
{
|
|
11487
11553
|
onClick: onStartEdit,
|
|
@@ -11504,8 +11570,8 @@ var BaseOrganizationProfile = ({
|
|
|
11504
11570
|
if (!shouldShow) {
|
|
11505
11571
|
return null;
|
|
11506
11572
|
}
|
|
11507
|
-
return /* @__PURE__ */
|
|
11508
|
-
/* @__PURE__ */
|
|
11573
|
+
return /* @__PURE__ */ jsxs41("div", { className: cx29(styles.field), children: [
|
|
11574
|
+
/* @__PURE__ */ jsx86("div", { className: cx29(styles.fieldContent), children: renderField(
|
|
11509
11575
|
field,
|
|
11510
11576
|
isFieldEditing,
|
|
11511
11577
|
(value) => {
|
|
@@ -11515,8 +11581,8 @@ var BaseOrganizationProfile = ({
|
|
|
11515
11581
|
},
|
|
11516
11582
|
() => toggleFieldEdit(field.key)
|
|
11517
11583
|
) }),
|
|
11518
|
-
isFieldEditable && /* @__PURE__ */
|
|
11519
|
-
/* @__PURE__ */
|
|
11584
|
+
isFieldEditable && /* @__PURE__ */ jsx86("div", { className: cx29(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ jsxs41(Fragment18, { children: [
|
|
11585
|
+
/* @__PURE__ */ jsx86(
|
|
11520
11586
|
Button_default,
|
|
11521
11587
|
{
|
|
11522
11588
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -11527,7 +11593,7 @@ var BaseOrganizationProfile = ({
|
|
|
11527
11593
|
children: saveButtonText
|
|
11528
11594
|
}
|
|
11529
11595
|
),
|
|
11530
|
-
/* @__PURE__ */
|
|
11596
|
+
/* @__PURE__ */ jsx86(
|
|
11531
11597
|
Button_default,
|
|
11532
11598
|
{
|
|
11533
11599
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -11538,7 +11604,7 @@ var BaseOrganizationProfile = ({
|
|
|
11538
11604
|
children: cancelButtonText
|
|
11539
11605
|
}
|
|
11540
11606
|
)
|
|
11541
|
-
] }) : hasValue && /* @__PURE__ */
|
|
11607
|
+
] }) : hasValue && /* @__PURE__ */ jsx86(
|
|
11542
11608
|
Button_default,
|
|
11543
11609
|
{
|
|
11544
11610
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -11547,7 +11613,7 @@ var BaseOrganizationProfile = ({
|
|
|
11547
11613
|
size: "small",
|
|
11548
11614
|
title: "Edit field",
|
|
11549
11615
|
className: cx29(styles.editButton),
|
|
11550
|
-
children: /* @__PURE__ */
|
|
11616
|
+
children: /* @__PURE__ */ jsx86(PencilIcon, {})
|
|
11551
11617
|
}
|
|
11552
11618
|
) })
|
|
11553
11619
|
] }, field.key);
|
|
@@ -11555,23 +11621,23 @@ var BaseOrganizationProfile = ({
|
|
|
11555
11621
|
if (!organization) {
|
|
11556
11622
|
return fallback;
|
|
11557
11623
|
}
|
|
11558
|
-
const profileContent = /* @__PURE__ */
|
|
11559
|
-
/* @__PURE__ */
|
|
11560
|
-
/* @__PURE__ */
|
|
11561
|
-
/* @__PURE__ */
|
|
11562
|
-
/* @__PURE__ */
|
|
11563
|
-
organization.orgHandle && /* @__PURE__ */
|
|
11624
|
+
const profileContent = /* @__PURE__ */ jsxs41(Card_default, { className: cx29(styles.root, cardLayout && styles.card, className), children: [
|
|
11625
|
+
/* @__PURE__ */ jsxs41("div", { className: cx29(styles.header), children: [
|
|
11626
|
+
/* @__PURE__ */ jsx86(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
11627
|
+
/* @__PURE__ */ jsxs41("div", { className: cx29(styles.orgInfo), children: [
|
|
11628
|
+
/* @__PURE__ */ jsx86("h2", { className: cx29(styles.name), children: organization.name }),
|
|
11629
|
+
organization.orgHandle && /* @__PURE__ */ jsxs41("p", { className: cx29(styles.handle), children: [
|
|
11564
11630
|
"@",
|
|
11565
11631
|
organization.orgHandle
|
|
11566
11632
|
] })
|
|
11567
11633
|
] })
|
|
11568
11634
|
] }),
|
|
11569
|
-
/* @__PURE__ */
|
|
11635
|
+
/* @__PURE__ */ jsx86("div", { className: cx29(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
11570
11636
|
] });
|
|
11571
11637
|
if (mode === "popup") {
|
|
11572
|
-
return /* @__PURE__ */
|
|
11573
|
-
/* @__PURE__ */
|
|
11574
|
-
/* @__PURE__ */
|
|
11638
|
+
return /* @__PURE__ */ jsx86(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs41(Dialog_default.Content, { children: [
|
|
11639
|
+
/* @__PURE__ */ jsx86(Dialog_default.Heading, { children: title }),
|
|
11640
|
+
/* @__PURE__ */ jsx86("div", { className: cx29(styles.popup), children: profileContent })
|
|
11575
11641
|
] }) });
|
|
11576
11642
|
}
|
|
11577
11643
|
return profileContent;
|
|
@@ -11640,7 +11706,7 @@ var updateOrganization = async ({
|
|
|
11640
11706
|
var updateOrganization_default = updateOrganization;
|
|
11641
11707
|
|
|
11642
11708
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
11643
|
-
import { jsx as
|
|
11709
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
11644
11710
|
var OrganizationProfile = ({
|
|
11645
11711
|
organizationId,
|
|
11646
11712
|
mode = "default",
|
|
@@ -11648,8 +11714,8 @@ var OrganizationProfile = ({
|
|
|
11648
11714
|
onOpenChange,
|
|
11649
11715
|
onUpdate,
|
|
11650
11716
|
popupTitle,
|
|
11651
|
-
loadingFallback = /* @__PURE__ */
|
|
11652
|
-
errorFallback = /* @__PURE__ */
|
|
11717
|
+
loadingFallback = /* @__PURE__ */ jsx87("div", { children: "Loading organization..." }),
|
|
11718
|
+
errorFallback = /* @__PURE__ */ jsx87("div", { children: "Failed to load organization data" }),
|
|
11653
11719
|
...rest
|
|
11654
11720
|
}) => {
|
|
11655
11721
|
const { baseUrl } = useAsgardeo_default();
|
|
@@ -11700,7 +11766,7 @@ var OrganizationProfile = ({
|
|
|
11700
11766
|
throw err;
|
|
11701
11767
|
}
|
|
11702
11768
|
};
|
|
11703
|
-
return /* @__PURE__ */
|
|
11769
|
+
return /* @__PURE__ */ jsx87(
|
|
11704
11770
|
BaseOrganizationProfile_default,
|
|
11705
11771
|
{
|
|
11706
11772
|
organization,
|
|
@@ -11950,21 +12016,21 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
11950
12016
|
var BaseOrganizationList_styles_default = useStyles27;
|
|
11951
12017
|
|
|
11952
12018
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
11953
|
-
import { jsx as
|
|
12019
|
+
import { jsx as jsx88, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
11954
12020
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
11955
|
-
return /* @__PURE__ */
|
|
11956
|
-
/* @__PURE__ */
|
|
11957
|
-
/* @__PURE__ */
|
|
11958
|
-
/* @__PURE__ */
|
|
11959
|
-
/* @__PURE__ */
|
|
11960
|
-
/* @__PURE__ */
|
|
12021
|
+
return /* @__PURE__ */ jsxs42("div", { className: cx30(styles.organizationItem), children: [
|
|
12022
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.organizationContent), children: [
|
|
12023
|
+
/* @__PURE__ */ jsx88(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
12024
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.organizationInfo), children: [
|
|
12025
|
+
/* @__PURE__ */ jsx88(Typography_default, { variant: "h6", className: cx30(styles.organizationName), children: organization.name }),
|
|
12026
|
+
/* @__PURE__ */ jsxs42(Typography_default, { variant: "body2", color: "textSecondary", className: cx30(styles.organizationHandle), children: [
|
|
11961
12027
|
"@",
|
|
11962
12028
|
organization.orgHandle
|
|
11963
12029
|
] }),
|
|
11964
|
-
showStatus && /* @__PURE__ */
|
|
12030
|
+
showStatus && /* @__PURE__ */ jsxs42(Typography_default, { variant: "body2", color: "textSecondary", className: cx30(styles.organizationStatus), children: [
|
|
11965
12031
|
t("organization.switcher.status.label"),
|
|
11966
12032
|
" ",
|
|
11967
|
-
/* @__PURE__ */
|
|
12033
|
+
/* @__PURE__ */ jsx88(
|
|
11968
12034
|
"span",
|
|
11969
12035
|
{
|
|
11970
12036
|
className: cx30(
|
|
@@ -11977,7 +12043,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
11977
12043
|
] })
|
|
11978
12044
|
] })
|
|
11979
12045
|
] }),
|
|
11980
|
-
organization.canSwitch && /* @__PURE__ */
|
|
12046
|
+
organization.canSwitch && /* @__PURE__ */ jsx88("div", { className: cx30(styles.organizationActions), children: /* @__PURE__ */ jsx88(
|
|
11981
12047
|
Button_default,
|
|
11982
12048
|
{
|
|
11983
12049
|
onClick: (e) => {
|
|
@@ -11991,17 +12057,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
11991
12057
|
) })
|
|
11992
12058
|
] }, organization.id);
|
|
11993
12059
|
};
|
|
11994
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */
|
|
11995
|
-
/* @__PURE__ */
|
|
11996
|
-
/* @__PURE__ */
|
|
12060
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs42("div", { className: cx30(styles.loadingContainer), children: [
|
|
12061
|
+
/* @__PURE__ */ jsx88(Spinner_default, { size: "medium" }),
|
|
12062
|
+
/* @__PURE__ */ jsx88(Typography_default, { variant: "body1", color: "textSecondary", className: cx30(styles.loadingText), children: t("organization.switcher.loading.organizations") })
|
|
11997
12063
|
] });
|
|
11998
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */
|
|
11999
|
-
/* @__PURE__ */
|
|
12064
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ jsx88("div", { className: cx30(styles.errorContainer), children: /* @__PURE__ */ jsxs42(Typography_default, { variant: "body1", color: "error", children: [
|
|
12065
|
+
/* @__PURE__ */ jsx88("strong", { children: t("organization.switcher.error.prefix") }),
|
|
12000
12066
|
" ",
|
|
12001
12067
|
error
|
|
12002
12068
|
] }) });
|
|
12003
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */
|
|
12004
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
12069
|
+
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ jsx88(Button_default, { onClick: onLoadMore, disabled: isLoading, className: cx30(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoading ? t("organization.switcher.loading.more") : t("organization.switcher.load.more") });
|
|
12070
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx88("div", { className: cx30(styles.emptyContainer), children: /* @__PURE__ */ jsx88(Typography_default, { variant: "body1", color: "textSecondary", className: cx30(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
12005
12071
|
var BaseOrganizationList = ({
|
|
12006
12072
|
className = "",
|
|
12007
12073
|
allOrganizations,
|
|
@@ -12044,53 +12110,53 @@ var BaseOrganizationList = ({
|
|
|
12044
12110
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
12045
12111
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
12046
12112
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12047
|
-
const loadingContent = /* @__PURE__ */
|
|
12113
|
+
const loadingContent = /* @__PURE__ */ jsx88("div", { className: cx30(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
12048
12114
|
if (mode === "popup") {
|
|
12049
|
-
return /* @__PURE__ */
|
|
12050
|
-
/* @__PURE__ */
|
|
12051
|
-
/* @__PURE__ */
|
|
12115
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12116
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
12117
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.popupContent), children: loadingContent })
|
|
12052
12118
|
] }) });
|
|
12053
12119
|
}
|
|
12054
12120
|
return loadingContent;
|
|
12055
12121
|
}
|
|
12056
12122
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
12057
|
-
const errorContent = /* @__PURE__ */
|
|
12123
|
+
const errorContent = /* @__PURE__ */ jsx88("div", { className: cx30(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
12058
12124
|
if (mode === "popup") {
|
|
12059
|
-
return /* @__PURE__ */
|
|
12060
|
-
/* @__PURE__ */
|
|
12061
|
-
/* @__PURE__ */
|
|
12125
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12126
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
12127
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.popupContent), children: errorContent })
|
|
12062
12128
|
] }) });
|
|
12063
12129
|
}
|
|
12064
12130
|
return errorContent;
|
|
12065
12131
|
}
|
|
12066
12132
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
12067
|
-
const emptyContent = /* @__PURE__ */
|
|
12133
|
+
const emptyContent = /* @__PURE__ */ jsx88("div", { className: cx30(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
12068
12134
|
if (mode === "popup") {
|
|
12069
|
-
return /* @__PURE__ */
|
|
12070
|
-
/* @__PURE__ */
|
|
12071
|
-
/* @__PURE__ */
|
|
12135
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12136
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
12137
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.popupContent), children: emptyContent })
|
|
12072
12138
|
] }) });
|
|
12073
12139
|
}
|
|
12074
12140
|
return emptyContent;
|
|
12075
12141
|
}
|
|
12076
|
-
const organizationListContent = /* @__PURE__ */
|
|
12077
|
-
/* @__PURE__ */
|
|
12078
|
-
/* @__PURE__ */
|
|
12142
|
+
const organizationListContent = /* @__PURE__ */ jsxs42("div", { className: cx30(styles.root, className), style, children: [
|
|
12143
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.header), children: [
|
|
12144
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.headerInfo), children: /* @__PURE__ */ jsx88(Typography_default, { variant: "body2", color: "textSecondary", className: cx30(styles.subtitle), children: t("organization.switcher.showing.count", {
|
|
12079
12145
|
showing: organizationsWithSwitchAccess?.length,
|
|
12080
12146
|
total: allOrganizations?.organizations?.length || 0
|
|
12081
12147
|
}) }) }),
|
|
12082
|
-
onRefresh && /* @__PURE__ */
|
|
12148
|
+
onRefresh && /* @__PURE__ */ jsx88(Button_default, { onClick: onRefresh, className: cx30(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.refresh.button") })
|
|
12083
12149
|
] }),
|
|
12084
|
-
/* @__PURE__ */
|
|
12150
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
12085
12151
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
12086
12152
|
) }),
|
|
12087
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
12088
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
12153
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx88("div", { className: cx30(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
12154
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx88("div", { className: cx30(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
12089
12155
|
] });
|
|
12090
12156
|
if (mode === "popup") {
|
|
12091
|
-
return /* @__PURE__ */
|
|
12092
|
-
/* @__PURE__ */
|
|
12093
|
-
/* @__PURE__ */
|
|
12157
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12158
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
12159
|
+
/* @__PURE__ */ jsx88("div", { className: cx30(styles.popupContent), children: organizationListContent })
|
|
12094
12160
|
] }) });
|
|
12095
12161
|
}
|
|
12096
12162
|
return organizationListContent;
|
|
@@ -12167,7 +12233,7 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
12167
12233
|
var OrganizationList_styles_default = useStyles28;
|
|
12168
12234
|
|
|
12169
12235
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
12170
|
-
import { jsx as
|
|
12236
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
12171
12237
|
var OrganizationList = ({
|
|
12172
12238
|
autoFetch = true,
|
|
12173
12239
|
filter = "",
|
|
@@ -12189,7 +12255,7 @@ var OrganizationList = ({
|
|
|
12189
12255
|
setAllOrganizations(await getAllOrganizations2());
|
|
12190
12256
|
})();
|
|
12191
12257
|
}, []);
|
|
12192
|
-
return /* @__PURE__ */
|
|
12258
|
+
return /* @__PURE__ */ jsx89("div", { className: cx31(styles.root, className), style, children: /* @__PURE__ */ jsx89("div", { className: cx31(styles.container), children: /* @__PURE__ */ jsx89(
|
|
12193
12259
|
BaseOrganizationList_default,
|
|
12194
12260
|
{
|
|
12195
12261
|
allOrganizations,
|
|
@@ -12204,8 +12270,8 @@ var OrganizationList = ({
|
|
|
12204
12270
|
var OrganizationList_default = OrganizationList;
|
|
12205
12271
|
|
|
12206
12272
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
12207
|
-
import { jsx as
|
|
12208
|
-
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
12273
|
+
import { jsx as jsx90, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12274
|
+
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs43(
|
|
12209
12275
|
"svg",
|
|
12210
12276
|
{
|
|
12211
12277
|
width,
|
|
@@ -12218,13 +12284,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
12218
12284
|
strokeLinecap: "round",
|
|
12219
12285
|
strokeLinejoin: "round",
|
|
12220
12286
|
children: [
|
|
12221
|
-
/* @__PURE__ */
|
|
12222
|
-
/* @__PURE__ */
|
|
12223
|
-
/* @__PURE__ */
|
|
12224
|
-
/* @__PURE__ */
|
|
12225
|
-
/* @__PURE__ */
|
|
12226
|
-
/* @__PURE__ */
|
|
12227
|
-
/* @__PURE__ */
|
|
12287
|
+
/* @__PURE__ */ jsx90("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
12288
|
+
/* @__PURE__ */ jsx90("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
12289
|
+
/* @__PURE__ */ jsx90("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
12290
|
+
/* @__PURE__ */ jsx90("path", { d: "M10 6h4" }),
|
|
12291
|
+
/* @__PURE__ */ jsx90("path", { d: "M10 10h4" }),
|
|
12292
|
+
/* @__PURE__ */ jsx90("path", { d: "M10 14h4" }),
|
|
12293
|
+
/* @__PURE__ */ jsx90("path", { d: "M10 18h4" })
|
|
12228
12294
|
]
|
|
12229
12295
|
}
|
|
12230
12296
|
);
|
|
@@ -12232,7 +12298,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
12232
12298
|
var BuildingAlt_default = BuildingAlt;
|
|
12233
12299
|
|
|
12234
12300
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
12235
|
-
import { Fragment as Fragment19, jsx as
|
|
12301
|
+
import { Fragment as Fragment19, jsx as jsx91, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12236
12302
|
var OrganizationSwitcher = ({
|
|
12237
12303
|
currentOrganization: propCurrentOrganization,
|
|
12238
12304
|
fallback = null,
|
|
@@ -12256,7 +12322,7 @@ var OrganizationSwitcher = ({
|
|
|
12256
12322
|
return fallback;
|
|
12257
12323
|
}
|
|
12258
12324
|
if (!isSignedIn) {
|
|
12259
|
-
return /* @__PURE__ */
|
|
12325
|
+
return /* @__PURE__ */ jsx91(Fragment19, {});
|
|
12260
12326
|
}
|
|
12261
12327
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
12262
12328
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -12270,19 +12336,19 @@ var OrganizationSwitcher = ({
|
|
|
12270
12336
|
const defaultMenuItems = [];
|
|
12271
12337
|
if (currentOrganization) {
|
|
12272
12338
|
defaultMenuItems.push({
|
|
12273
|
-
icon: /* @__PURE__ */
|
|
12339
|
+
icon: /* @__PURE__ */ jsx91(BuildingAlt_default, {}),
|
|
12274
12340
|
label: t("organization.switcher.manage.organizations"),
|
|
12275
12341
|
onClick: handleManageOrganizations
|
|
12276
12342
|
});
|
|
12277
12343
|
}
|
|
12278
12344
|
defaultMenuItems.push({
|
|
12279
|
-
icon: /* @__PURE__ */
|
|
12345
|
+
icon: /* @__PURE__ */ jsx91("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx91("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
12280
12346
|
label: t("organization.switcher.create.organization"),
|
|
12281
12347
|
onClick: () => setIsCreateOrgOpen(true)
|
|
12282
12348
|
});
|
|
12283
12349
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
12284
|
-
return /* @__PURE__ */
|
|
12285
|
-
/* @__PURE__ */
|
|
12350
|
+
return /* @__PURE__ */ jsxs44(Fragment19, { children: [
|
|
12351
|
+
/* @__PURE__ */ jsx91(
|
|
12286
12352
|
BaseOrganizationSwitcher_default,
|
|
12287
12353
|
{
|
|
12288
12354
|
organizations,
|
|
@@ -12295,7 +12361,7 @@ var OrganizationSwitcher = ({
|
|
|
12295
12361
|
...props
|
|
12296
12362
|
}
|
|
12297
12363
|
),
|
|
12298
|
-
/* @__PURE__ */
|
|
12364
|
+
/* @__PURE__ */ jsx91(
|
|
12299
12365
|
CreateOrganization,
|
|
12300
12366
|
{
|
|
12301
12367
|
mode: "popup",
|
|
@@ -12309,7 +12375,7 @@ var OrganizationSwitcher = ({
|
|
|
12309
12375
|
}
|
|
12310
12376
|
}
|
|
12311
12377
|
),
|
|
12312
|
-
currentOrganization && /* @__PURE__ */
|
|
12378
|
+
currentOrganization && /* @__PURE__ */ jsx91(
|
|
12313
12379
|
OrganizationProfile_default,
|
|
12314
12380
|
{
|
|
12315
12381
|
organizationId: currentOrganization.id,
|
|
@@ -12317,11 +12383,11 @@ var OrganizationSwitcher = ({
|
|
|
12317
12383
|
open: isProfileOpen,
|
|
12318
12384
|
onOpenChange: setIsProfileOpen,
|
|
12319
12385
|
cardLayout: true,
|
|
12320
|
-
loadingFallback: /* @__PURE__ */
|
|
12321
|
-
errorFallback: /* @__PURE__ */
|
|
12386
|
+
loadingFallback: /* @__PURE__ */ jsx91("div", { children: t("organization.profile.loading") }),
|
|
12387
|
+
errorFallback: /* @__PURE__ */ jsx91("div", { children: t("organization.profile.error") })
|
|
12322
12388
|
}
|
|
12323
12389
|
),
|
|
12324
|
-
/* @__PURE__ */
|
|
12390
|
+
/* @__PURE__ */ jsx91(
|
|
12325
12391
|
OrganizationList_default,
|
|
12326
12392
|
{
|
|
12327
12393
|
mode: "popup",
|
|
@@ -12341,7 +12407,7 @@ var OrganizationSwitcher = ({
|
|
|
12341
12407
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
12342
12408
|
|
|
12343
12409
|
// src/index.ts
|
|
12344
|
-
import { AsgardeoRuntimeError as AsgardeoRuntimeError7, http } from "@asgardeo/browser";
|
|
12410
|
+
import { AsgardeoRuntimeError as AsgardeoRuntimeError7, http, getActiveTheme as getActiveTheme2 } from "@asgardeo/browser";
|
|
12345
12411
|
export {
|
|
12346
12412
|
Alert_default as Alert,
|
|
12347
12413
|
AlertDescription,
|
|
@@ -12440,6 +12506,7 @@ export {
|
|
|
12440
12506
|
createPatchOperations,
|
|
12441
12507
|
createSignInOption,
|
|
12442
12508
|
createSignInOptionFromAuthenticator,
|
|
12509
|
+
getActiveTheme2 as getActiveTheme,
|
|
12443
12510
|
getAllOrganizations_default as getAllOrganizations,
|
|
12444
12511
|
getMeOrganizations_default as getMeOrganizations,
|
|
12445
12512
|
getScim2Me_default as getMeProfile,
|